HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Sep 03, 2010, 04:20 PM
Registered User
Joined Sep 2010
8 Posts
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?

Hope for the reply.. thx
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Sign up now
to remove ads between posts
Old Sep 03, 2010, 04:26 PM
five by five
sonicj's Avatar
Panama City Bch, FL
Joined Jan 2009
2,074 Posts
you can use the servo library that comes with the IDE. http://www.arduino.cc/en/Reference/Servo
sonicj is offline Find More Posts by sonicj
Reply With Quote
Old Sep 04, 2010, 02:47 AM
Registered User
Joined Sep 2010
8 Posts
Quote:
Originally Posted by sonicj View Post
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?
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Old Sep 04, 2010, 09:16 AM
Registered User
UK
Joined Oct 2003
3,822 Posts
Standard RC pulse width for 0-100% stick is 1ms - 2ms (1.5ms center stick). This is repeated every 20ms
Malc C is offline Find More Posts by Malc C
Reply With Quote
Old Sep 04, 2010, 09:46 AM
Registered User
Joined Sep 2010
8 Posts
Quote:
Originally Posted by Malc C View Post
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?
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Old Sep 04, 2010, 01:54 PM
Dave the Rave
dmccormick001's Avatar
Joined Jun 2007
876 Posts
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.
dmccormick001 is offline Find More Posts by dmccormick001
Reply With Quote
Old Sep 04, 2010, 02:32 PM
Registered User
UK
Joined Oct 2003
3,822 Posts
Quote:
Originally Posted by windhamwong View Post
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)
Malc C is offline Find More Posts by Malc C
Reply With Quote
Old Sep 04, 2010, 03:29 PM
Registered User
Joined Sep 2010
8 Posts
Quote:
Originally Posted by Malc C View Post
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?
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Old Sep 04, 2010, 04:33 PM
Registered User
UK
Joined Oct 2003
3,822 Posts
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.
Malc C is offline Find More Posts by Malc C
Reply With Quote
Old Sep 04, 2010, 04:42 PM
Registered User
UK
Joined Oct 2003
3,822 Posts
Quote:
Originally Posted by windhamwong View Post
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
Malc C is offline Find More Posts by Malc C
Reply With Quote
Old Sep 05, 2010, 05:14 AM
Registered User
Joined Sep 2010
8 Posts
Quote:
Originally Posted by Malc C View Post
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!!
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Old Sep 05, 2010, 02:25 PM
Registered User
Joined Sep 2010
8 Posts
I got the another question..
the number of pulses inside 20ms is just to ensure the signal is sent correctly or for what reason?
windhamwong is offline Find More Posts by windhamwong
Reply With Quote
Old Sep 05, 2010, 03:14 PM
Registered User
UK
Joined Oct 2003
3,822 Posts
Quote:
Originally Posted by windhamwong View Post
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 ! )

Malc C is offline Find More Posts by Malc C
Last edited by Malc C; Sep 05, 2010 at 03:43 PM. Reason: added image
Reply With Quote
Old Sep 05, 2010, 05:21 PM
Registered User
GlowFly's Avatar
Midlands, UK
Joined Jun 2004
1,337 Posts
Quote:
Originally Posted by Malc C View Post
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
GlowFly is offline Find More Posts by GlowFly
Reply With Quote
Old Sep 05, 2010, 10:22 PM
Registered User
Joined Sep 2010
8 Posts
Quote:
Originally Posted by GlowFly View Post
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
windhamwong is offline Find More Posts by windhamwong
Last edited by windhamwong; Sep 06, 2010 at 05:12 AM.
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion How do i use this ESC.......so many wires?? scorpion1 Racing Boats - Electric 28 Sep 05, 2010 08:43 AM
Discussion How high (or, how to find altitude the old fashioned way)? kosch Electric Plane Talk 23 Aug 30, 2010 09:05 AM
Discussion how many 9g servos can a 40 amp esc use? The_RattleSnake Power Systems 15 Jan 27, 2010 10:39 AM
Help! How to control ESC using a MicroController fawad_cse DIY Electronics 7 Oct 14, 2009 06:31 AM
Help! How to control ESC using a MicroController fawad_cse Power Systems 3 Oct 09, 2009 07:24 AM