Driving more RC servos than you have PWM outputs
#1
Posted 12 October 2010 - 11:57 AM
#2
Posted 12 October 2010 - 01:38 PM
Take a seat, I'll be right with you.
#3
Posted 12 October 2010 - 02:54 PM
#5
Posted 12 October 2010 - 10:19 PM
#6
Posted 13 October 2010 - 04:33 AM
I wonder if that's what the guys at GHI did. They use OutputCompare to drive Servos on any digital pin. I would love to have something like that on the Netduino also....It occurs to me, however, that I may be able to get around this by creating a 100kHz timer interrupt (to get 10uS resolution) and a lookup table to brute force the signal generation.
#7
Posted 13 October 2010 - 04:37 AM
#8
Posted 13 October 2010 - 04:45 AM
Woohoo! Awesome!!! Thanks Chris!Hari,
We have a "software PWM" feature planned for a future firmware update. It would basically use a timer interrupt in the background to allow you to run one or two additional PWM channels. This would also give Netduino 100% pinout compatibility with Arduino shields.
Chris
#9
Posted 13 October 2010 - 09:04 PM
Take a seat, I'll be right with you.
#10
Posted 14 October 2010 - 04:50 AM
Hari,
We have a "software PWM" feature planned for a future firmware update. It would basically use a timer interrupt in the background to allow you to run one or two additional PWM channels. This would also give Netduino 100% pinout compatibility with Arduino shields.
Chris
Will this be limited to 1 or 2 extras or will it allow you to run pulse accurate PWM for every digital pin?
#11
Posted 14 October 2010 - 05:02 AM
Will this be limited to 1 or 2 extras or will it allow you to run pulse accurate PWM for every digital pin?
Good point. The initial theory is to enable 1 or 2 pins (specifically the two PWM pins where we don't have true hardware PWM--but you could do it on any analog/digital pin). The good news and bad news here is that software PWM requires a lot of processor time. If you had a slow PWM clock we might be able to enable PWM on more pins--but we'll have to see how testing goes on that... As it is, two super-fast software PWM will slow down your app significantly.
Chris
#12
Posted 14 October 2010 - 05:25 AM
#13
Posted 14 October 2010 - 05:37 AM
RC electric speed controllers are a different matter. Screw up the pulse going into one of those and you can easily have a dangerous situation. They are very sensitive.
#14
Posted 14 October 2010 - 05:42 AM
Would this depend on whether you were doing full phase accurate PWM? For servos though, we don't actually really care about that sort of thing. All we care about is 1uS accuracy on the pulse width, delay between pulses could be pretty random and from 2.5ms to 20ms. Is there any chance of getting some advance look at the code you are putting together for this?
The software PWM is scheduled for phase 3. Right now we're in Phase 2 (getting the PWM code done for the v4.1.1 beta). But there's no reason we can't share the code when we get there...
The basic operation will be a timer in the background which executes every # clock cycles--and compares a counter to determine when to raise/lower the pin's output.
Does that give you a good idea of the direction?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users