PWMPAL and Servos
Rich Green
Posts: 11
In Nuts and Volts column # 100 Jon explains:
"Let's say, for example, we want to control a servo and start with it centered. Knowing what we
know about servos, we need the on-time to be 1.5 milliseconds and the off-time to be 20
milliseconds. The rest is simple math: 1.5 milliseconds divided by 0.025 milliseconds (25
microseconds) is 60. This will be our on-time count. Next we take 20 milliseconds and divide by
0.025 milliseconds to get 800."
He then goes on:
"If we want to connect the servo to P15, here's the command to send the centering counts:
SEROUT 0, 6, [noparse][[/noparse]"!PWMM4", 60, 0, 32, 3]"
Try as I might, I can't figure out how 332 relates to 20 milliseconds or 800.
Can anyone help me to understand this?
·
"Let's say, for example, we want to control a servo and start with it centered. Knowing what we
know about servos, we need the on-time to be 1.5 milliseconds and the off-time to be 20
milliseconds. The rest is simple math: 1.5 milliseconds divided by 0.025 milliseconds (25
microseconds) is 60. This will be our on-time count. Next we take 20 milliseconds and divide by
0.025 milliseconds to get 800."
He then goes on:
"If we want to connect the servo to P15, here's the command to send the centering counts:
SEROUT 0, 6, [noparse][[/noparse]"!PWMM4", 60, 0, 32, 3]"
Try as I might, I can't figure out how 332 relates to 20 milliseconds or 800.
Can anyone help me to understand this?
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Rich Green