PDA

View Full Version : Servos and Plusin math



Ramius
- 20th May 2012, 20:27
Hi All!
Okay so I know that the pulse width for a servo is from 1 ms to 2 ms with 1.5 ms as neutral. I used Plusin PORTA.0,1,Rawpulse. The variable Rawpulse should display the pulse width to the servo. What I do not understand is why does neutral on the RC transmitter give a Rawpulse result of 380? Thanks, Ed

Dave
- 20th May 2012, 20:58
It depends on the clock speed. It's in the manual....

Ramius
- 20th May 2012, 22:12
Okay, then in the manual the results are given in us units (micro-seconds) which is 1000 time more than in ms (milliseconds). IE "If a 4MHz oscillator is used, the pulse width is returned in 10us increments. If a 20MHz oscillator is used, the pulse width will have a 2us resolution." I am using a 10MHz crystal. Best, Ed

HenrikOlsson
- 21st May 2012, 09:28
So, with a 10MHz crystal the pulswidth is returned in units of 4us, a result of 380 equals a pulsewidth of 1520us.