Basically ESC (Electronic Speed Controllers) are designed to work with remote controllers using PPM protocol and are similar to how you would control a Servo.


ArduMotion (Arduino comptaible board) can generate servo signals with the builtin Servo function. The “Servo” function sets the angle of servo with values 0 to 180.
This angle information interpreted in ESC as:
void ServoSetup() { // Please ensure the servo's dont require more current than the regulator is able to //supply. otherwise, the board will continuously reset and start over // Servo and Analog Sensor input connector servo 1 is the leftmost toward the right // edge of the board). 5VDC for + pin. // Analog input is the leftmost 3-pin connector when looking from the topside. // A 1 2 3 4 (yellow, orange or white = Signal) // + + + + + (+=Orange or Red = Positive) // - - - - - (-=Brown or Black = Ground) pinMode(PWM1, OUTPUT); // digitalWrite(PWM1, LOW); // DONOT EVER WRITE LOW TO A // ESC / SERVO PORT as it will short out and reset the board!!! servo1.attach(PWM1); // attaches the servo on pin 9 to the servo object servo1.write(90); // tell servo to go to resting position in case of an ESC controller, // 90 is the neutral zero speed position so it is safe for either an // ESC or a Servo hookup delay(500); // give enough time for the first servo to stabilize pinMode(PWM2, OUTPUT); servo2.attach(PWM2); // attaches the servo on pin 3 to the servo object servo2.write(90); delay(500); pinMode(PWM3, OUTPUT); servo3.attach(PWM3); // attaches the servo on pin 5 to the servo object servo3.write(90); delay(500); pinMode(PWM4, OUTPUT); servo4.attach(PWM4); // attaches the servo on pin 6 to the servo object servo4.write(90); delay(500); }Lessons Learnt:
Board resets while using high powered Servos or trying to move multiple high powered servos at the same time is pretty common in electronic systems, especially when they're controlled by microprocessors: while the system is initializing itself, glitches can occur in parts of the system that aren't fully initialized.Since ArduMotion (Arduino compatible) pins default to "input" on reset, you need to add some external logic that inhibits the servo signals unless a digital pin you choose as the "enable" is outputting an active low. Perhaps a buffer with tri-state outputs that are enabled by a logic 0 input. Make sure your code doesn't pull the enable low until after you're sure the servo outputs are stable. You'll also need to make sure you don't enable them in mid-pulse, or you'll get exactly the sort of glitch you're trying to avoid.
I was trying to control 3 mid-large servos at the same time in one of our projects and here is what i found: With the 3rd connected and all 3 servos trying to move, the ArduMotion board would reset. It would reset almost immediately after the servos started moving. I changed the code to only move 2 of the servos and things went back to working as expected. Every once in a while the board would reset. But adding the 3rd would cause a reset every time. About this time it dawned on me that I might be trying to draw too much power through the board.
So I disconnected the power and ground lines for the 3 servos and connected them to the +5v of an external power supply and ground wires of the power supply. I added a wire connecting the ArduMotion ground with the external 5vdc power supply ground and powered up the ArduMotion. All three servos started moved their control arms back and forth without any more resets of the board.
Pingback: Technical Information | Arduino Yellowjacket Compatible WiFi Shield, GP-2106 GPS, TB6612FNG DC Motors, ESC, and UAV Drone & Rover Servo Controller for iPhone, iPad, Android or Windows Phone