Page 132 ·
Robotics with the Boe-Bot
PULSOUT 12, 650
PAUSE 20
NEXT
Let’s say that the Boe-Bot turns just a bit more than 90° (1/4 of a full circle). Try
FOR
counter = 1 TO 23
, or maybe even
FOR counter = 1 TO 22
. If it doesn’t turn far
enough, increase the run time of the rotation by increasing the
FOR…NEXT
loop’s
EndValue
argument to whatever value it takes to complete the quarter turn.
If you find yourself with one value slightly overshooting 90° and the other slightly
undershooting, try choosing the value that makes it turn a little too far, then slow down
the servos slightly. In the case of the rotate left, both
PULSOUT
Duration
arguments
should be changed from 650 to something a little closer to 750. As with the straight line
exercise, this will also be an iterative process.
Your Turn - 90° Turns
√
Modify ForwardLeftRightBackward.bs2 so that it makes precise 90° turns.
√
Update ForwardLeftRightBackward.bs2 with the
PULSOUT
values you
determined for straight forward and backward travel.
√
Update the label on each servo with a notation about the appropriate
EndValue
for a 90° turn.
Carpeting can cause navigation errors.
If you are running your Boe-Bot on carpeting,
don’t expect perfect results! A carpet is a bit like a golf green – the way the carpet pile is
inclined can affect the way your Boe-Bot travels, especially over long distances. For more
precise maneuvers, use a smooth surface.
ACTIVITY #3: CALCULATING DISTANCES
In many robotics contests, more precise robot navigation lends itself to better scores.
One popular entry level robotics contest is called dead reckoning. The entire goal of this
contest is to make your robot go to one or more locations and then return to exactly
where it started.
You might remember asking your parents this question, over and over again, while on
your way to a vacation destination or relatives’ house:
“Are we there yet?”