ESC Control With Arduino

Hello,

recently my friend and I undertook the task of replacing the flight controller in the hexacopter he built with a custom programmed one that uses an arduino. We are currently having trouble using the ESC (Electronic Speed Controller) on the hexacopter. We have got it to work once but after some modification of the code, it is now not working (and we cannot figure out how to go back to when it was). We suspect we are failing to arm the ESC correctly. We are using this ESC:

http://www.centuryheli.com/products/productdetail.htm?prtnm=CNE430M&pageid=346

Our code is this:

#include <Servo.h>

Servo m1;

void setup() {

m1.attach(11);
m1.delay(1);
m1.write(90);

}

void loop() {

m1.write(100);

}

We have tried to mess around with the arming sequence by changing the delay length and angle in the write() function, but to no avail. Any help would be much appreciated. Thank you,

  • Jacob

What is the arming sequence when used with typical RC equipment?

Originally a NAZA MV2 flight controller sent the arming sequences to the ESCs. The arming sequences that could be used on the remote controller were the following:

Any of those controller positions would have worked.

Those don't look like arming sequences, but rather positions which make the flight controller enter a calibration mode. You should only have to send a neutral signal to the ESC for a sufficiently long time.

First, your delay command should come after the first write command. The delay is also far too small. The argument of the delay function is in milliseconds, not seconds. Servo signals are usually only sent every 20 ms, and each command lasts from 1 to 2 ms. So a 1 ms delay is insignificant. Many controllers actually need to see steady neutral signals for several seconds before arming. This varies, though, so you can play around with reducing the delay once you have it working.

Another issue is that the your neutral signal might be incorrect. This is defined internally by the ESC's calibration, but I expect that a 1 ms signal would work [using m1.writeMicroseconds(1000)]. If not, you can go back to 1.5 ms ("90 degrees") or try 2 ms.