After a lot of research, I found out that the variable spindle speed output is a PWM signal, while the ESC needs a PPM signal to be controlled. Although that, it's a specific PPM signal that actually looks like PWM, so it can be used.
The problem is that, instead of being controlled by the duty cycle, what actually controls it is the amount of time that each pulse stays on high, which depends on the period, which is the inverse of the frequency. Long story short, the frequency is too high.
I managed to change the frequency used by grbl and found one that works. I don't know if this frequency allows the whole throttle range to be controlled but, for my application that doesn't require a very strict RPM, it was enough. Here are the steps (some steps are already explained elsewhere):
- Import grbl's library in Arduino IDE.
- Find out where the library got installed and edit
grbl/spindle_control.c, lines 89 and 94.
0x05. Save and close the file.
- Compile and download the library to Arduino Uno.
- Connect everything but leave the ESC unpowered.
M3 S0 (that's a zero).
- Power the ESC.
- You should hear a 123 tone (three beeps of different frequencies). It will then continue to beep once from time to time — I have no idea why... It should have stopped after a few.
S600. It should start spinning. If it doesn't, first send lower values from 0 to 600.
S500 to stop.