Parallax Boe-Bot Student Manual page 150

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

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
40
=
×
p
ulses
. 2
22
s
=
90
.
24
...
pulses
90
pulses
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.
Boe
Bot
=
p
ulses
Boe
Bot
Example – Time for 20 in
At 9 in/s, your Boe-Bot has to travel for
2.22 s to travel 20 in.
20
in
40
.
65
pulses
=
×
p
ulses
9
in/s
s
s 1
40
=
20
in
×
×
9
in
=
÷
×
20
9
40
.
65
pulses
=
90
.
333
...
pulses
90
pulses
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:
loop's
FOR...NEXT
.
65
pulses
s
dis
tan
ce
40
.
65
pulses
×
speed
s
Example – Time for 51 cm
At 23 cm/s, your Boe-Bot has to travel for
2.22 s to travel 51 cm.
p
ulses
.
65
pulses
s 1
argument.
EndValue
51
cm
40
.
65
pulses
=
×
23
cm/s
s
s 1
40
.
65
pulses
=
1 5
cm
×
×
23
cm
s 1
=
÷
×
51
23
40
.
65
pulses
=
90
.
136
...
pulses
90
pulses

Advertisement

Table of Contents
loading

Table of Contents