Download Print this page

Communication Protocol - Parallax Continuous Rotation Servo Manual

Advertisement

ctra[30..26] := %00100
ctra[8..0]
:= servoPin
frqa := 1
dira[servoPin]~~
' Set up cycle and high times
tInc := clkfreq/1_000_000
tC
:= tInc * 21_500
tHa := tInc * 1500
t
:= cnt
repeat
phsa := -tHa
t += tC
waitcnt(t)

Communication Protocol

The Parallax Continuous Rotation Serv o is controlle d through pulse width modulation. Rotational speed
and direction are determi ned by the d uration of a high pulse, i n the 1.3– -1.7 ms range. In order for
smooth rotation, the servo needs a 20 ms pause between pulses. Below is a sample timing diagram for a
centered servo:
As the length of the pulse decreases from 1.5 ms, th e servo will gradually rotate faster in th e clockwise
direction, as can be seen in the figure below:
Likewise, as the length of the pulse increases from 1.5 ms, the servo will gradually rotate faster in the
counter-clockwise direction, as can be seen in the figure below:
Copyright © Parallax Inc.
' Configure Counter A to NCO
' Mark counter time
' Repeat PWM signal
' Set up the pulse
' Calculate next cycle repeat
' Wait for next cycle
Parallax Continuous Rotation Servo (#900-00008)
v2.2 10/24/2011 Page 5 of 8

Advertisement

loading

This manual is also suitable for:

900-00008Rob-16048