Page 136 ·
Robotics with the Boe-Bot
you can use these values to calculate how many pulses to send to the servos. This is the
number you will have to use for your
FOR…NEXT
loop's
EndValue
argument.
pulses
90
pulses
...
24
.
90
s
pulses
65
.
40
s
22
.
2
ulses
p
≈
=
×
=
The calculations in this example took two steps. First, figure out how long the servos
have to run to make the Boe-Bot travel a certain distance, then figure out how many
pulses it takes to make the servos run for that long. Since you know you have to multiply
by 40.65 to get from run time to pulses, you can reduce this to one step.
s
pulses
65
.
40
speed
Bot
Boe
ce
tan
dis
Bot
Boe
ulses
p
×
−
−
=
Example – Time for 20 in
At 9 in/s, your Boe-Bot has to travel for
2.22 s to travel 20 in.
pulses
90
pulses
...
333
.
90
pulses
65
.
40
9
20
s
1
pulses
65
.
40
in
9
s
1
in
20
s
pulses
65
.
40
in/s
9
in
20
ulses
p
≈
=
×
÷
=
×
×
=
×
=
Example – Time for 51 cm
At 23 cm/s, your Boe-Bot has to travel for
2.22 s to travel 51 cm.
pulses
90
pulses
...
136
.
90
pulses
65
.
40
23
51
s
1
pulses
65
.
40
cm
23
s
1
cm
1
5
s
pulses
65
.
40
cm/s
23
cm
51
ulses
p
≈
=
×
÷
=
×
×
=
×
=
Your Turn – Your Boe-Bot’s Distance
Now, it’s time to try this out with distances that you choose.
√
If you have not already done so, use a ruler and the ForwardOneSecond.bs2
program to determine your Boe-Bot’s speed in in/s or cm/s.
√
Decide how far you want your Boe-Bot to travel.
√
Use the pulses equation to figure out how many pulses to deliver to the Boe-
Bot’s servos: