How is the way to use arduino to control ESC? - RC Groups
Sep 03, 2010, 03:20 PM
Registered User
Question

# How is the way to use arduino to control ESC?

Hello..
i am new to the RC and i would like to use arduino to control the ESC..
but i don kno what is the pulse and what signal means what command...
Is there any data sheet or guideline?

 Sep 03, 2010, 03:26 PM five by five you can use the servo library that comes with the IDE. http://www.arduino.cc/en/Reference/Servo
Sep 04, 2010, 01:47 AM
Registered User
Quote:
 Originally Posted by sonicj you can use the servo library that comes with the IDE. http://www.arduino.cc/en/Reference/Servo
oh..
but what is the pulse width and else to control?
 Sep 04, 2010, 08:16 AM Registered User Standard RC pulse width for 0-100% stick is 1ms - 2ms (1.5ms center stick). This is repeated every 20ms
Sep 04, 2010, 08:46 AM
Registered User
Quote:
 Originally Posted by Malc C Standard RC pulse width for 0-100% stick is 1ms - 2ms (1.5ms center stick). This is repeated every 20ms
ok..
Do u means pulse width = the stick %? And the height of the pulse is the direction of the stick?
It should be using analog not digital because only 1/0 in digital right?
 Sep 04, 2010, 12:54 PM Dave the Rave It's the pulse width not the height, that determines the output sent to the servo. A pulse of 1.5ms is interpreted by the servo as the center position. Anything less, from1.0ms to <1.5ms, is interpreted as left or right of center, depending on whether the servo direction is set to normal or reversed. Anything greater, from >1.5ms to 2.0ms, is read as the other side of center. These pulses are repeated every 20ms or so.
Sep 04, 2010, 01:32 PM
Registered User
Quote:
 Originally Posted by windhamwong ok.. Do u means pulse width = the stick %? And the height of the pulse is the direction of the stick? It should be using analog not digital because only 1/0 in digital right?
No, as stated above it's the pulse width that changes not the height. here's the trace from the trainer port of my JR 3810.

Each pulse is a single channel, each pulse is the same height. When the transmitter stick is at the bottom (0%) the pulse width is typically 1ms. when the stick is at the top (100%) the pulse width is typically 2ms in duration. I said typically as with most transmitters having extended rates or trims it's possible to reduce the minimum width and increase the maximum width (approx 0.8ms to 2.2ms is probably the max range possible)
Sep 04, 2010, 02:29 PM
Registered User
Quote:
 Originally Posted by Malc C No, as stated above it's the pulse width that changes not the height. here's the trace from the trainer port of my JR 3810. Each pulse is a single channel, each pulse is the same height. When the transmitter stick is at the bottom (0%) the pulse width is typically 1ms. when the stick is at the top (100%) the pulse width is typically 2ms in duration. I said typically as with most transmitters having extended rates or trims it's possible to reduce the minimum width and increase the maximum width (approx 0.8ms to 2.2ms is probably the max range possible)
Oh..thx for the details...
Then the command should be only the servo going to left or right am i correct?
if using ESC to control the motor and just to give the command of the turning speed of the motor is enough?

Also..can i have the software in ur foto?
Do the software need the real transmitter/receiver?
 Sep 04, 2010, 03:33 PM Registered User If you google Oscilloscope 2.51 or "soundcard Oscilloscope" you'll find it - it's a free program and uses your sound card to get the trace via a 3.5mm mono jack plug at each end of a length of screened cable - simple to make. For use with an ESC, then at minimum throttle stick you need to have your board send a 1ms pulse every 20ms. At maximum stick the board needs to send a 2ms pulse every 20ms To be honest I don't think you have really grasped how a pulse proportional signal works. It matters not if you have a servo or ESC connected - if the pulse is 1ms wide then (assuming the esc is forward only) the motor will be off, increasing in speed as you increase the pulse width to 2ms which the ESC will read as full throttle. If you have a forward / reverse ESC then when the pulse width is 1.5ms wide the ESC will interpret that as off. As the pulse width is reduced to 1ms it treats that as one direction (say reverse), getting faster in reverse as the signal reduces in width - treating 1ms as full throttle in that direction. as the pulse width increases back up to 1.5ms it reduces in speed until the pulse width is 1.5ms again. Then as pulse width is increased to 2ms it treats that as accelerating to full throttle in the other direction. Hope you've got this now - if not then try googling PWM or RC servo PPM Oh and no you don't needs a real TX to use the software shown in my post above - you could make up a lead that has a probe on it and test the PW coming out of your board if you wished. I used it to check the signals coming from my TX when I was developing the USB interface in the sticky post above.
Sep 04, 2010, 03:42 PM
Registered User
Quote:
 Originally Posted by windhamwong Is there any data sheet or guideline?
I just googled "Arduino servo control" and came up with lots of hits - Here's one example

http://www.arduino.cc/playground/Lea...leServoExample
Sep 05, 2010, 04:14 AM
Registered User
Quote:
 Originally Posted by Malc C If you google Oscilloscope 2.51 or "soundcard Oscilloscope" you'll find it - it's a free program and uses your sound card to get the trace via a 3.5mm mono jack plug at each end of a length of screened cable - simple to make. For use with an ESC, then at minimum throttle stick you need to have your board send a 1ms pulse every 20ms. At maximum stick the board needs to send a 2ms pulse every 20ms To be honest I don't think you have really grasped how a pulse proportional signal works. It matters not if you have a servo or ESC connected - if the pulse is 1ms wide then (assuming the esc is forward only) the motor will be off, increasing in speed as you increase the pulse width to 2ms which the ESC will read as full throttle. If you have a forward / reverse ESC then when the pulse width is 1.5ms wide the ESC will interpret that as off. As the pulse width is reduced to 1ms it treats that as one direction (say reverse), getting faster in reverse as the signal reduces in width - treating 1ms as full throttle in that direction. as the pulse width increases back up to 1.5ms it reduces in speed until the pulse width is 1.5ms again. Then as pulse width is increased to 2ms it treats that as accelerating to full throttle in the other direction. Hope you've got this now - if not then try googling PWM or RC servo PPM Oh and no you don't needs a real TX to use the software shown in my post above - you could make up a lead that has a probe on it and test the PW coming out of your board if you wished. I used it to check the signals coming from my TX when I was developing the USB interface in the sticky post above.
yeah thx for the useful information.
This is very details and useful! reli thx!!
 Sep 05, 2010, 01:25 PM Registered User I got the another question.. the number of pulses inside 20ms is just to ensure the signal is sent correctly or for what reason?
Sep 05, 2010, 02:14 PM
Registered User
Quote:
 Originally Posted by windhamwong I got the another question.. the number of pulses inside 20ms is just to ensure the signal is sent correctly or for what reason?
Nope - each pulse in the image above is a channel from the transmitter

Hope the attached makes it clear (finally ! )

### Images

Last edited by Malc C; Sep 05, 2010 at 02:43 PM. Reason: added image
Sep 05, 2010, 04:21 PM
Registered User
Quote:
 Originally Posted by Malc C Nope - each pulse in the image above is a channel from the transmitter Hope the attached makes it clear (finally ! )
That's almost right. The effective servo pulse width in a PPM stream runs between two like edges. So Tb in your diagram should include the low-going 300/400us separator pulse.

Once decoded in a Rx an individual servo pulse will rise at the rising edge of Tb and fall at the next rising edge.

Steve
Sep 05, 2010, 09:22 PM
Registered User
Quote:
 Originally Posted by GlowFly That's almost right. The effective servo pulse width in a PPM stream runs between two like edges. So Tb in your diagram should include the low-going 300/400us separator pulse. Once decoded in a Rx an individual servo pulse will rise at the rising edge of Tb and fall at the next rising edge. Steve
That means the 8 waves in the picture means the channel of the signal and for about 300/400us is in LOW signal to seperating them?
typing misstake :S
Last edited by windhamwong; Sep 06, 2010 at 04:12 AM.