Chapter 3: Assemble and Test Your Boe-Bot
· Page 115
be 650. If you enter a pulse width of 700,
pulseWidthComp
will be 800. Try a few other
examples. They will all add up to 1500.
pulseWidthComp = 1500 - pulseWidth
A
FOR…NEXT
loop that runs for 6 seconds sends pulses to the right (P12) servo. The
pulseWidthComp
value is sent to the left (P13) servo, making it turn in the opposite
direction.
FOR counter = 1 TO 244
PULSOUT 12, pulseWidth
PULSOUT 13, pulseWidthComp
PAUSE 20
NEXT
Your Turn – Advanced Topic: Graphing Pulse Width vs. Rotational Velocity
Figure 3-20 shows an example of a transfer curve for a continuous rotation servo. The
horizontal axis shows the pulse width in ms, and the vertical axis shows the rotational
velocity in RPM. In this graph, clockwise is negative and counterclockwise is positive.
This particular servo’s transfer curve ranges from about -48 RPM to 48 RPM over the
range of test pulse widths that range from 1.3 ms to 1.7 ms.
Rotational Velocity vs. Pulse Width for Servo
-60
-40
-20
0
20
40
60
1.300
1.350
1.400
1.450
1.500
1.550
1.600
1.650
1.700
Pulse Width, m s
R
o
ta
ti
on
a
l V
e
lo
c
ity
,
R
P
M
Right Servo
Figure 3-20
Transfer Curve
Example for
Parallax Servo