Pages: [1]   Go Down
Author Topic: Controlling two ESC's through the arduino  (Read 988 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to power two brushless DC motors separately through the arduino in order to give a car that I'm working on differential steering.  This is the datasheet for the ESC's I'm using:
http://s195302033.onlinehome.us/CX/esc/duratrax-intellispeed-auto-sport-fwd-rev-manual.pdf

I have the arduino set up with a breadboard to connect to the ESC pins - I have the black wires connected to the Arduino ground and the red Vin wires connected to nothing.  The yellow PWM pins are connected to PWM out pins on the Arduino.  Each ESC has the correct voltage going to it from the battery and is connected to each respective motor correctly as well.

My problem is this:
    When I send a PWM command to one motor(say, for example, I send a forward command to the right motor only), BOTH motors move forward.  The same thing happens when I send a command to the left motor.  I'm not sure what's wrong....

Is the ground on the arduino completing some circuit that makes both ESC's send the same current to the motors?  It's a very simple circuit...I'm not sure what's going on....
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An ESC is controlled like a model airplane servo.  Are you using the servo library like in the Sweep tutorial?

 http://arduino.cc/en/Tutorial/Sweep

Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All common hobby R/C ESC I have seen emulate being controlled just like a servo, so you really should be using a servo library to control them. Trying to use simple PWM with a 20-25 msec period (standard servo refresh period) and using only 1 msec ( 1-2 msec is standard servo pulse width control) of pulse width control leaves you with poor resolution.

 Other things to be aware of is if ESC is bidirectional (like for cars) or only one directional control (like airplane props), That drasticaly changes the pulse width that a stopped motor uses. Also check the initial arming sequence procedure as it is most somewhat unique for every model of ESC and so you need to study the user manual carefully as your Arduino code will have to emulate this procedure.

Lefty  
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Search the old forum for ESC and you will find a lot of previous discussions on using an ESC with an arduino. One of the key points is generating the "arming" sequence used by ESCs.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: