How do I activate Electric Speed Controller with Arduino?


#1

Team,


Does anyone know how to activate the ESC with Arduino? cant seem to get it to work.

could it be that i am testing with 9.6v battery. I'm only trying to test 1. here is the setup how i have it configured


Thank you for the awesome help!


#2

Did you program the ESC?


#3

How do i do this? Do i need something else or can i do it with the arduino?


#4

Does the arduino have power?


#5

yes its connected through usb, but have 8 1.5v attached to power of esc


#6

Can you verify the signal coming from arduino? You could see it with an oscilloscope. You might be able to see it with a voltmeter ( an analog meter would tick up and down or it would be between 0 and the signal voltage, and a digital meter’s reading would bounce )


#7

the esc turned green when using this:

/*
* This code is in the public domain.
* (Do whatever you want with it.)
*/

// Need the Servo library
#include <Servo.h>

// This is our motor.
Servo myMotor;

// This is the final output
// written to the motor.
String incomingString;


// Set everything up
void setup()
{
// Put the motor to Arduino pin #9
myMotor.attach(9);

// Required for I/O from Serial monitor
Serial.begin(9600);
// Print a startup message
Serial.println("initializing");
}


void loop()
{
// If there is incoming value
if(Serial.available() > 0)
{
// read the value
char ch = Serial.read();

/*
* If ch isn't a newline
* (linefeed) character,
* we will add the character
* to the incomingString
*/
if (ch != 10){
// Print out the value received
// so that we can see what is
// happening
Serial.print("I have received: ");
Serial.print(ch, DEC);
Serial.print('\n');

// Add the character to
// the incomingString
incomingString += ch;
}
// received a newline (linefeed) character
// this means we are done making a string
else
{
// print the incoming string
Serial.println("I am printing the entire string");
Serial.println(incomingString);

// Convert the string to an integer
int val = incomingString.toInt();

// print the integer
Serial.println("Printing the value: ");
Serial.println(val);

/*
* We only want to write an integer between
* 0 and 180 to the motor.
*/
if (val > -1 && val < 181)
{
// Print confirmation that the
// value is between 0 and 180
Serial.println("Value is between 0 and 180");
// Write to Servo
myMotor.write(val);
}
// The value is not between 0 and 180.
// We do not want write this value to
// the motor.
else
{
Serial.println("Value is NOT between 0 and 180");

// IT'S a TRAP!
Serial.println("Error with the input");
}

// Reset the value of the incomingString
incomingString = "";
}
}
}


#8

It's getting signal. But not sure what signal



#9

using this ESC: http://www.hobbyking.com/hobbyking/store/uh_viewitem.asp?idproduct=14630


#10

Afternoon David, What approach did you take to program the ESC?


#11

What voltage is the arduino’s pwm output? What is the minimum voltage for signalling the ESC?


#12

actually for first 10 seconds keep the pwm output form the arduino brd at 0 degree
-----
ie..... the ON time of the PWM should be 1000 millisecond for first 10 second so that the controller sitting inside the ESC judge that the input signal is ok....... then you can vary the PWM..


#13

What I mean is the voltage, not the timing( but that could also be it ). I think the UNO is a 5Volt controller. We should check with the ESC datasheet for the minimum signalling voltage, but usually 4.5Volts is enough.


#14

Here are the instructions for the ESC. It may be difficult to do the initial calibration with an arduino.

http://www.hobbyking.com/hobbyking/store/uploads/310301368X493050X53.pdf


#15

Uno is 5V out on pin 9:

http://arduino.cc/en/Main/ArduinoBoardUno

Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(), digitalWrite(), anddigitalRead() functions. They operate at 5 volts. However also note:

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable

power from USB will only supply 5V. Check the output voltage on Pin 9 and watch it for a bit and verify you have a solid 5v.

If I had to guess I would guess the voltage cutoff is the problem. Your ESC:

Voltage Cutoff: default - Auto-Lipo(d)

The userguide for the ESC states that it auto-senses the number of LiPo batteries in use. You are using another battery type. NiCad's I bet?


#16

I figure its the batteries being supplied i'm using. So i ordered: Turnigy nano-tech 4000mah 3S 25~50C Lipo Pack

http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=20516

My model will be using same concepts but diy parts for body, and running only arduino and a gorpo camera. I hope it works out. Any luck on the images for mounting the Delta 15?


#17

Delta V15s... http://openrov.com/forum/topics/attaching-delta-v15-props


#18

I would recommend running the example program that comes with the Arduino software called "Sweep" this will make a servo move back and forth and would therefor also make your ESC move forward and backward. If that doesn't work, let us know and we'll take it from there. Your electrical configuration should work provided that your battery is supplying enough voltage (ideally 12v but several volts below that should be fine) and the ESC switch is in the "on" position.

Good luck!


#19

Thank you Eric@ I think my issue was that i was using the GND pin on the power side of the board. Then it clicked. I moved the gnd pin to the exact pin shown above and used the code here:

blog.richard-potter.co.uk/2009/11/servo-control-with-an-arduino-board/

to push buttons to test the motors and it worked!!!!

Here is the Video: http://www.facebook.com/photo.php?v=3357229908886