Pages: [1]   Go Down
Author Topic: PWM "hardware geek speak" to "software  (Read 767 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have read the tutorials and done the fade demo. I understand the concept of setting a level and delaying to get the timing. What isn't sinking in is how to take a spec of what I need to do from a hardware perspective and turn that into what I need to do from the software perspective.

Here are my instructions:
Quote
The standard servo control in RC which runs the ESC is a PWM pulse with a 5 cycle carier, 1ms – 2ms subpulse that controls the ESC. Our aircraft ESCs arm at 1ms and go to full throttle at 2ms. Our car controllers need to be calibrated to the PWM source then arm at 1.5ms, from there to 2ms is forward, from 1.5ms to 1ms is brake and reverse.

What is the level and delay for the 1ms subpulse? 2ms? Or better yet, how do I figure that out?

Thanks!
Andy
« Last Edit: October 14, 2010, 11:09:29 am by arbarnhart » Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you trying to move a servo?  If so, you don't use PWM.  And there's a servo library which makes it super easy to do. (Check the libraries section on the main page of this site.)
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks; I am checking that option and will update this post later with confirmed thanks or additional info...
Logged

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, the servo library is your friend. Basically the Electronic Speed Control acts like any servo you connect to your RC-receiver.

In the Servo library you can either set the values as degree (0-180) or as µs impulse duration going from 1000µs to 2000µs with 1500µs being the middle. I prefer the µs values as those undergo less transformations. The degree will internally converted to µs. When you all attach, it's a good idea to set the limits, in your case 1000 and 2000.

If you use the call attach(...), the servo will go to the middle position 1500µs. If you don't like this, set the servo to the desired original position (eg 1000µs for off in case of airplanes) before calling attach.

For your ESC, you might need to calibrate it first by setting it to various positions. Don't forget to do this, otherwise the ESC will calibrate itself to values you don't intend and behave strangely. There was recently a thread here on the boards about this.

Korman
Logged

Pages: [1]   Go Up
Jump to: