Continuous rotation (CR) servos save I/O pins. I mentioned CR servos in Part 2 of this series. These electronic gearmotor modules offer full speed control in both directions. They are widely used in hobby robotics and have some clear advantages over motors and H-bridges — especially when used with an 08M2. A CR servo uses just one output
pin compared to two pins required for an H-bridge. As a
result, servos can’t be destroyed by “shoot through” (like an
H-bridge can) by a single hardware or software error.
It remains to be seen if RoboCar’s H-bridges can
actually be burned out by its small alkaline batteries; they
may not be strong enough to do damage. Hopefully, no
readers found out otherwise! (Incidentally, since Part 4
went to press, I did a bit of abuse testing on the H-bridges
by putting stronger batteries in RoboCar. You can see my
Drifting figure 8 test at www.youtube.com/
watch?v=DVMQhxR2OL4.)
Finally, since our 08M2 only has PWM on one pin (C. 2)
for speed control, RoboCar could drive forward slowly, but
reverse was always necessarily full speed; check out
www.youtube.com/watch?v=7gPOgpU6BmA. Our
08M2 has SERVO commands on four pins, so we could
have full speed control (forward and reverse) for up to four
CR servos. That’s a significant upgrade.
This month, we’ll build Cruiser: a rolling breadboard
which can turn in place using differential steering.
Mastering this popular drive method is a rite of passage for
any budding roboticist. You have probably seen BoeBots,
Roombas, and 3Pi robots — all which use differential
steering. Spinning in place is a very desirable feature and
clearly superior to RoboCar’s 15-point turns:
www.youtube.com/watch?v=etHzjX0B-2A.
Cruiser is more work to make and program than
RoboCar was. First, we’ll modify two HXT900 servos for
continuous rotation. (You did order those last month as
suggested, right?) It’s a pain to modify them, but is yet
another rite of passage to get your robot diploma (don’t
ask). A modified HXT900 gives vastly better
performance than this factory-made nine gram CR servo:
www.youtube.com/watch?v=ImnRsLZ6urw.
The second hurdle is driving in a straight line.
RoboCar moved fairly straight by merely turning on the
drive motor, but this new bot must synchronize its
wheels to drive straight. It’s far from automatic. Left to
themselves, most robots will curve left or right since
there are no wheel encoders nor any DRIVESTRAIGHT
command in PICAXE BASIC. We will experimentally
determine the right SERVOPOS numbers to make the
bot drive straight. Making a precise turn will be similarly
challenging, but such is the challenge of robotics. If it
was easy, everyone would be doing it!
➤ More Things to Order Now...
Wheels: The DIYer in me normally likes to scratch-build
wheels from servo horns and sheet plastic or masonite, but
Pololu’s 2819 wheels are nice, perfectly sized, and well
worth $5 ( www.pololu.com/product/2819).
Servo Extension Cables: We’ll need one to connect
our USB adapter (since one servo now interferes) and more
for sensors. Grab five 150 mm cables (you can find them
on eBay for a dollar; search 401014399897).
Long Male/Male Headers allow the servo connector
to plug into the breadboard for structural support at least.
Let’s start by building a new breadboard and battery
box per Part 1, since we don’t want to tear apart our
walking robot built in Part 3. We’ll use another left-facing IR
receiver on input-only pin C. 3. The receiver’s power
connections make it convenient to locate our servos nearby.
Since we need to hook up two servos this time, solder on
some long male/male header pins (jump to Figure 9 for a
sec) for the servo power connectors. The breadboard’s
socket connections are not reliable for high servo currents;
you’ll want your servo power pins soldered directly to the
power wires. Not quite as solderless as we might like, but
that’s reality. From my experience, always route battery
power directly to the servos using heavy wire.
From there, you can route it to the micro with good
filter capacitors. You can see how I made my connections in
Figures 1A, 1B, and 1C. Note that the servo end of the
wires from C. 2 and C. 4 bends up to plug into the servo
connector, not down into the breadboard.
Another option is to cut the servo connector off the
cable and solder the power wires (red+, brown-) directly to
the battery box wires, and a breadboard-friendly male pin
SERVO 01.2016 37
Post comments on this section and find any associated files and/or downloads at
www.servomagazine.com/index.php/magazine/article/january2016_PICAXERobots.
Figure 1A.