−
Boe
Bot
=
p
ulses
−
Boe
Bot
√
Modify BoeBotForwardOneSecond.bs2 so that it delivers the number of pulses
you determined for your distance.
√
Run the program and test to see how close you got.
This technique has sources of error. The activity you just completed does not take into
account the fact that it took a certain number of pulses for the Boe-Bot to get up to full
speed. Nor did it take into account any distance the Boe-Bot might coast before it comes to
a full stop. The servo speeds will also go slower as the batteries lose their charge.
You can increase the accuracy of your Boe-Bot distances with devices called encoders,
which count the holes in the Boe-Bot's wheels as they pass.
documentation and example programs are available in the Robotics
www.parallax.com.
ACTIVITY #4: MANEUVERS – RAMPING
Ramping is a way to gradually increase or decrease the speed of the servos instead of
abruptly starting or stopping. This technique can increase the life expectancy of both
your Boe-Bot's batteries and your servos.
Programming for Ramping
The key to ramping is to use variables along with constants for the
argument. Figure 4-4 shows a
Duration
speed from full stop to full speed ahead. Each time the
variable increases by 1. The first time through,
pulseCount
like using the commands
through the loop, the value of
and
13, 752
PULSOUT 12, 748
does the speed of the servos. By the hundredth time through the loop, the
variable is 100, so it's like using the commands
, which is full-speed ahead for the Boe-Bot.
650
dis
tan
ce
40
.
65
pulses
×
speed
s
FOR...NEXT
and
PULSOUT 13, 751
is 2, so it's like using the commands
pulseCount
. As the value of the
Chapter 4: Boe-Bot Navigation · Page 137
Encoders hardware,
Accessories page at
PULSOUT
loop that can ramp the Boe-Bot's
loop repeats itself, the
FOR...NEXT
pulseCount
. The second time
PULSOUT 12, 749
variable increases, so
pulseCount
and
PULSOUT 13, 850
command's
is 1, so it's
PULSOUT
pulseCount
PULSOUT 12,
Need help?
Do you have a question about the Boe-Bot and is the answer not in the manual?
Questions and answers