robot to travel, we explained the benefit of
using subroutines. Students learned how
subroutines shorten the length of their
programs while making it much easier to
understand.
Now that they had robots that could
drive, they could control the direction each
wheel spun and could understand the
effects of the PAUSE command. So, we
gave students the task of programming
their robot to drive in a square path. We
explained that this is called dead reckoning
and that sailing ships used this method for
navigation in the 15th century.
Dead reckoning is a method for driving
a robot that does not make use of
feedback. As a result, robots using this
technique eventually deviate from their
programmed path. The reason is that the
wheels do not turn at exactly the same
speed. There are ways to address this issue;
in fact, one of our families corrected for
this behavior by occasionally halting the
faster spinning wheel.
Using Feedback
For Line FoLLowing
We asked students to imagine trying to walk to the
door with their eyes closed. Even if they aimed themselves
accurately towards the door before closing their eyes, each
step was likely to take them off course. This mental exercise
and observing the behavior of their robot made our
students aware of the need for feedback in their program.
Because this was a beginner’s class, the method of
feedback we chose was line following. Students found
themselves soldering a second but simpler PCB. The line
follower consisted of a left side and right side detector.
Each detector consisted of a phototransistor and
neighboring IR LED. If the light from the IR LED reflected
off the surface below it, then there was no black tape
beneath the detector, so it produced a signal of zero volts
(a logic low). The opposite was true when the black tape
was beneath the sensor.
After completing their line follower circuit, students
bolted it to the front of their robot and plugged its cable
into the robot controller’s GPIO. Then, we explained how to
use the IF-THEN command to control the driving of the
robot’s wheels. At this point, we were running out of class
time. Several of our students needed extra time to catch up
with the rest of the class, so they began programming their
robot at home.
SERVO 12.2013 39
James, a mentor from the BoRG is helping a student program
his recently completed robot controller.
components provided
in cLass
The robot kit was pretty extensive as the following
list shows:
• CheapBot- 14 robot controller kit (from NearSys)
• CheapBot robot body kit (from NearSys)
• CheapBot line follower kit (from NearSys)
• Plastic parts cup (plastic jar lid from a container
company)
• Wire cutters (jewelry cutters from Walmart)
• Soldering sponge (cut up sponge from Walmart)
• Cen-Tech digital multimeter (from Harbor Freight)
• Screwdrivers (from Harbor Freight)
• Safety glasses (from Harbor Freight)
• Pliers (from Harbor Freight)
• Boxer 30W soldering iron (from Frys.com)
• Work surface (Masonite sheet form Home Depot)
• USB-to-serial adapter (from Parallax)
• 1 GB USB thumb drive (from Amazon.com)*
• Soldered LED and resistor (scraps from a junk box)
• Copy of SERVO Magazine (Thanks T&L for your gift)
Contains PICAXE editing software, lessons, and
software driver.