I'm trying to get my Arduino Nano (ATmega328P - old bootloader) to control a Turnigy Plush ESC (Electronic Speed Controller) for an RC plane brushless motor.
Once the ESC is powered, it makes the motor beep until a signal of 0 throttle is received, indicating that it's safe to control the motor. My issue is that I can't get the Arduino to send the correct signal to the ESC to allow control.
I've tried different PWM values for the signal input going into the ESC, but I haven't been able to get it to work.
Iv'e tried different PWM values but the ESC continues to beep and doesn’t allow motor control. I’ve ensured the ESC is powered correctly and the connections are secure.
Any advice or suggestions on how to get the ESC to recognize the signal and allow motor control would be greatly appreciated.
Thank you!
You' need to limit the pulse width to 1000...2000 ms and initialize the Servo object with 1000ms width ( or ...write(0) ), like so:
Servo esc;
...
void setup() {
esc.attach(THE_OUTPUT_PIN, 1000, 2000);
// either all in ms:
esc.writeMicroseconds(1000);
// or from 0...180:
esc.write(0);
...
}
I’ve just tried that, but the ESC still will not initiate. Here is how the circuit is connected (a ChatGPT output )
Arduino Nano to IR Sensor:
5V (Arduino Nano) -> VCC (IR Sensor)
GND (Arduino Nano) -> GND (IR Sensor)
D9 (Arduino Nano) -> OUT (IR Sensor)
Arduino Nano to LED:
D11 (Arduino Nano) -> Anode (long leg) of LED
GND (Arduino Nano) -> Cathode (short leg) of LED (through a 220Ω resistor)
Arduino Nano to ESC (Turnigy Plush 40A):
D10 (Arduino Nano) -> Signal wire (usually white or yellow) of ESC
GND (Arduino Nano) -> Ground wire (usually black) of ESC
Power connections:
Normally (when i use the ESC with a RC plane transmitter & receiver) i never calibrate it.
the ESC works as is right out of the box.
all i do is to plug the ESC to the motor and receiver => throttle down to min and then the motor will make that sequence of beeps letting me know it's good to go.
chatGPT did gave me some calibration code to run but it didnt help.
can you please share your cal. code so i can try it out?
chatGPT also instruct me to only connect the negative and signal to the 3 wires harness coming out the ESC (it didn't mention the positive), although i tried both case.
I did plug in the lipo battery.
thanks a mil for your advise guys
That is your clue. All ESC’s have an initialization sequence. The most common is to turn on the transmitter with throttle at max. Then power up the receiver and ESC. The last step is to throttle down to minimum.
This not only lets the ESC know you are ready to go, it also calibrates the ESC to your throttle stick range every time you start.
You will have to program a start sequence in the Nano that matches the requirements of your ESC.
What beep code are you getting? There are different ones with different meanings based on the note and duration.
That 10 second delay seems overly long. Try sending a throttle stick max signal as @bitherder_57 says before the three second mark on power up, then send the 1000uS signal after 3.2 or so seconds. Even better, on startup send a ramping down signal from 1000-700uS or even just lower the startup signal to 700uS.
i try the following with different min throttle values but the ESC won't start
should i take the RC transmitter and receiver to someone with oscilloscope to read the throttle signal coming out the receiver so I can adjust the code base on the reading?
Check the manual of your ESC on the exact calibrtion sequencewm then try to replicate it with your RC sender/receiver. If you get that working try it on the arduino. There's also the setup sequence, but without you teling if there is a beeping sequence from the motor there's no way telling.
You should hear a beep after esc.writeMicroseconds(2000); and you must power off the ESC after some seconds (and the arduino). The calibration is a onetime thing to do, so remove it from the code if it succeeds.
You can use your RX/TX and read out the signal range using pulseIn().
No need for an oscilloscope.
I suspect that 1000uS isn't your lower limit.
Did you have to adjust throttle trim to get it to arm with the TX?
For testing use a Potentiometer instead of a fixed value to vary the output to your ESC while checking the variable via serial Monitor. If the ESC locks you have the right value