Anda di halaman 1dari 85

This E-Book and More

From

http://ali-almukhtar.blogspot.com
Page 1

0 7>
7:36 PM
6/4/2008
Cover.qxd

Vol. 6 No. 7 SERVO MAGAZINE ROBOTICS HISTORY • ENCODER MATCHING • BIG MAMA GEAR MOTOR • CES ROUNDUP July 2008
Full Page.qxd 3/5/2008 4:10 PM Page 2

Let your geek shine.


Meet Leah Buechley, developer of LilyPad—a
sew-able microcontroller—and fellow geek. Leah
used SparkFun products and services while she
developed her LilyPad prototype.

The tools are out there, from LEDs to conductive


thread, tutorials to affordable PCB fabrication,
and of course Leah’s LilyPad. Find the resources
you need to let your geek shine too.

»Sharing Ingenuity
SP A R K F U N.C OM

©2008 SparkFun Electronics, Inc. All rights reserved.


Full Page.qxd 6/2/2008 11:33 AM Page 3

Free
Book
with Kit
TOC Jul08.qxd 6/4/2008 3:41 PM Page 4

PAGE 12 Columns
08 Robytes by Jeff Eckert
Stimulating Robot Tidbits

12 GeerHead by David Geer


Lewis, the Robot Photographer

16 Ask Mr. Roboto by Dennis Clark


Your Problems Solved Here

58 Twin Tweaks
by Bryce and Evan Woolley
There’s a New Humanoid on the Block

64 Robotics Resources
by Gordon McComb
Stocking Up with Surplus Electronics

67 Different Bits
by Heather Dewey-Hagborg
Random Bits

74 Appetizer
by Kym Graner
Dusting Robots

77 Then and Now by Tom Carroll


Robotics — A Historical Perspective

THE COMBAT ZONE ...


Features
28 BUILD REPORT
Apollyon
30 MANUFACTURING
High-Performance Drill Motor
Modification
06
Departments

Mind/Iron 32 PARTS IS PARTS


07 Bio-Feedback Mag Motor Upgrades and Repairs
22 Events Calendar
24 Robotics Showcase Events
26 New Products 33 Results and Upcoming Competitions
70 Robo-Links
71 SERVO Webstore Robot Profile
81 Advertiser’s Index 31 Billy Bob

4 SERVO 07.2008
TOC Jul08.qxd 6/4/2008 3:42 PM Page 5

07.2008
VOL. 6 NO. 7

Features & Projects


34 CES 2008 Robot Roundup PAGE 34
by Ted Larson
The annual Consumer Electronics
Show does not disappoint with its
coverage of robotics in the
Tech Zone.

39 Encoder Matching
by Robert Doerr
Scaling and inverting encoder values
to fit your particular application.

44 Big Mama Gear Motors


by Fred Eady
Learn what it takes to design, build,
and code a heavy duty DC motor
driver module.

50 Loki Crosses the Pond


— Part 2
by Alan Marconett
This final installment examines the
QwikFlash controller board and the
software that runs Loki.

PAGE 44
PAGE 39

SERVO Magazine (ISSN 1546-0592/CDN Pub Agree#40702530) is published


monthly for $24.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona,
CA 92879. PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITION-
AL ENTRY MAILING OFFICES. POSTMASTER: Send address changes to SERVO
Magazine, P.O. Box 15277, North Hollywood, CA 91615 or Station
A, P.O. Box 54,Windsor ON N9A 6J5; cpcreturns@servomagazine.com

SERVO 07.2008 5
Mind-Iron Jul08.qxd 6/4/2008 2:22 PM Page 6

Published Monthly By
T & L Publications, Inc.
430 Princeland Court
Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
Webstore Only 1-800-783-4624
www.servomagazine.com

Mind / Iron Subscriptions


Toll Free 1-877-525-2539
Outside US 1-818-487-4545
P.O. Box 15277
by Bryan Bergeron, Editor ΠNorth Hollywood, CA 91615
PUBLISHER
become a reality. There are issues Larry Lemieux
Small is Big of how to provide communications publisher@servomagazine.com
When it comes to robot between each insect-sized robot and ASSOCIATE PUBLISHER/
components, small is big. If you’ve their human masters, local VP OF SALES/MARKETING
followed the robotics news lately, you computation, sensors, power, and Robin Lemieux
display@servomagazine.com
know that academic and military of course, powerful, lightweight,
R&D communities are busy at work controllable micromotors. And there’s EDITOR
developing robots that mimic – in the underlying issue of cost. Bryan Bergeron
form and function – small crawling A recent advance in the area techedit-servo@yahoo.com
and flying insects. Need to locate of micromotors has been the CONTRIBUTING EDITORS
survivors in the rubble of a collapsed commercial availability of linear Jeff Eckert Tom Carroll
building? Simply release a swarm of micromotors from New Scale Gordon McComb David Geer
Dennis Clark R. Steven Rainwater
heat-seeking crawling robots that can Technologies (www.newscaletech. Fred Eady Kevin Berry
squeeze through cracks without com). Their series of Squiggle motors Robert Doerr Ted Larson
disrupting the rubble and fills the void between the microscopic Alan Marconett Kym Graner
endangering trapped victims. Need nanomotors and the miniature servos Bryce Woolley Evan Woolley
Heather Dewey-Hagborg Nick Martin
an up-close view of a hostage and electronic/pneumatic linear Mike Jeffries Bryan Ruddy
situation? A swarm of flying actuators popular among robotics
microbots with photosensors could enthusiasts. CIRCULATION DIRECTOR
provide police with a composite, I had the opportunity to evaluate Tracy Kerley
subscribe@servomagazine.com
real-time image of the victims and New Scale’s mid-sized offering — the
their captors. Squiggle SQL-1.8-6 linear motor — MARKETING COORDINATOR
Despite ongoing advances in shown in the photo. As the name WEBSTORE
research laboratories, there are suggests, the motor is a mere 1.8 Brian Kirkpatrick
sales@servomagazine.com
numerous challenges that must be mm in width. The rectangular motor
overcome before practical body is 6 mm long, with a 12 mm WEB CONTENT
autonomous insect swarms can axial screw running through its Michael Kaudze
website@servomagazine.com
center. The 160 milligram SQL 1.8 is
Piezoelectric Squiggle micro motor on
polycarbonate mount shown next to a capable of handling a 30 g load PRODUCTION/GRAPHICS
six-pin DIP for size comparison. when driven by a 400 mW, 40V, 171 Shannon Lemieux
kHz pulse. The even smaller SQL 1.5 Joe Keungmanivong
linear motor can work with a 20 g ADMINISTRATIVE ASSISTANT
load. As illustrated in the photo, the Debbie Stauffacher
electrical connection to the Squiggle
Copyright 2008 by
motor is via a flex printed circuit T & L Publications, Inc.
strip. All Rights Reserved
With a PC-based control All advertising is subject to publisher’s approval.
application and USB-to-Squiggle We are not responsible for mistakes, misprints,
or typographical errors. SERVO Magazine
interface, I was able to vary the travel assumes no responsibility for the availability or
rate from micrometers per second to condition of advertised items or for the honesty
millimeters per second, with an of the advertiser.The publisher makes no claims
impressive 0.5 micrometer resolution. for the legality of any item advertised in SERVO.
This is the sole responsibility of the advertiser.
Although the relatively fragile motor Advertisers and their agencies agree to
was glued to a polycarbonate mount indemnify and protect the publisher from any
and all claims, action, or expense arising from
advertising placed in SERVO. Please send all
Mind/Iron Continued editorial correspondence, UPS, overnight mail,
and artwork to: 430 Princeland Court,
6 SERVO 07.2008
Corona, CA 92879.
Mind-Iron Jul08.qxd 6/4/2008 2:23 PM Page 7

SchmartBoard Is Looking for


Beta Testers
New Website will be Social Network
for Electronics Enthusiasts
Dear SERVO:
chmartBoard is looking for people to beta-test a soon The “analog” servo block diagram, Figure 5, of the
S to be opened web space call Solder By Numbers™.
The website, which is due to launch in late summer,
Servo Buddy article in May 2008, is missing the velocity
feedback path from the motor to the local pulse
will be a social network for electronics enthusiasts. generator. Without this damping feedback, the servo will
SchmartBoard is looking for all levels of testers from oscillate. After the stretched drive pulse has ended, the
professional engineers to novices who have an interest motor back EMF is used to modify the next local pulse.
in electronics. They are looking for people from around In servos that use the NE544 IC, this feedback is from
the world. pin 9 to pin 1 via a resistor. For the NJM2611 IC, from
According to SchmartBoard’s VP of Sales & pin 11 to pin 15.
Marketing, Neal Greenberg, “SchmartBoard is not yet It is interesting to note that years ago what is
ready to reveal specific details about the website, now called an analog servo was called a digital servo.
except that it is web 2.0 for electronics enthusiasts. Back then, an analog servo required an analog VOLTAGE
Solderbynumbers.com will be a place to design and input.
build your electronic circuits while you create a worldwide — William J. Kuhnle
network of peers. The site will be much more than a
social network. It will be a place to collaborate, create, RESPONSE: While I tried to keep the diagram simple,
communicate, and learn.” it might have been good to include that. Thanks for
To sign up to be a beta-tester, go to www.solder pointing it out.
bynumbers.com. — Jim Stewart

for evaluation purposes, I could easily envision a challenge in creating a suitable IR rangefinder with
spider-sized eight-legged walker, powered by 16 standard components. A typical IR LED alone is about the
skeleton-mounted Squiggles. size of an insect’s head. And the available ultrasound
The size of the peripherals that accompanied the rangefinders require even more volume. Clearly, when it
motor — a wall wart power supply, a USB driver card, and comes to microsensors for autonomous microbots, it’s time
a three-foot USB cable — not to mention the desktop PC for a new generation of SMT devices.
and software — explains why the robotics shops aren’t Although autonomous microbots made completely of
offering autonomous robots sporting Squiggle-based commodity — read affordable and readily available —
grippers and actuators. Even a six-pin DIP dwarfs the components may be a few years away, there are myriad
Squiggle, much less a PIC or BASIC Stamp. However, the applications of micromotors in other areas of robotics. The
control issue should be partially solved by the time you most obvious applications range from the manipulation of
read this. New Scale has a miniature ASIC driver under camera optics and R/C mini helicopter control surfaces, to
development that could form the heart of a Squiggle control of microvalves in implantable drug delivery devices
spider robot. to surgical robots. Although I expect to see the first
Power issue is another matter. The smallest battery large-scale applications of micromotors in the consumer
packs that I’ve used are thin-film lithium-polymer cells electronics industry, the medical applications will likely
designed for miniature indoor R/C aircraft. The thin, have the most profound effect on quality of life.
dime-sized cells power a single-motor aircraft for about Consider that current surgical robotics rely on
five minutes. As such, an autonomous eight-legged standard-sized motors connected to scalpels and other
Squiggle spider would likely have a lifespan measured instruments through cables. Although these robotic
in seconds with current battery technology. Even so, systems enable surgeons to operate with greater efficiency
in some applications, 20-30 seconds of operation and effectiveness than traditional methods, because of the
could be worth the cost of a swarm of insect-sized physical arrangement of cables and instruments, the
microbots. working area is constrained to only a few inches across.
On the topic of microsensors, with the exception of The use of micromotors connected directly to instruments
Hall-effect devices, I haven’t seen any commercial sensor would allow for a much larger work area for tele-surgeons,
offerings that come close to the level of miniaturization as well as lighter, mechanically simpler surgical robots. Size
required for an insect-sized microbot. I’d like to have an and weight can be critical factors if the remote patient
affordable ultrasonic or IR rangefinder comparable in happens to be an astronaut on Mars, or a critically injured
relative size to the Squiggle. However, consider the US soldier in a remote area of the world. SV

SERVO 07.2008 7
Robytes.qxd 5/29/2008 2:20 PM Page 8

Robytes by Jeff Eckert


The Vulture Seldom Comes “What you don’t want to build is a million over three years from the
Home to Roost fragile, expensive pain in the butt.” Defense Advanced Research Projects
The Aurora offering will be based Agency (www.darpa.gov) — is
on its “Odysseus” iRobot (www.irobot.com). Under
design, which uses solar the grant, the company will develop
power during daylight the LANdroid robot, a portable com-
hours and stored energy munications relay device. According
at night. It combines to the contractor, “This robot will be
three “constituent small enough that a single dismounted
aircraft” in a 500 ft warfighter can carry multiple robots,
(150 m), intriguing inexpensive to the point of being
Z-wing configuration. disposable, robust enough to allow
Boeing is expected to the warfighter to drop and throw
field a design based on them into position, and smart enough
the existing British-built to autonomously detect and avoid
Zephyr high-altitude, obstacles while navigating in the
long-endurance UAV, urban environment.”
Aurora’s Odysseus design: A possible from partner QinetiQ The objective is to enable
configuration of the Vulture UAV. (www.qinetiq.com). networking in urban areas where
Photo courtesy of Aurora Flight Sciences. Lockheed Martin is still buildings and other pesky objects
mum on the subject. can block wireless operations. In
On a more celestial level, DARPA The competitors have 12 months operation, each of the little guys will
is also funding a competition to to come up with their initial designs wander around until it finds a good
develop an unmanned aerial vehicle for DARPA review. Phase two will end spot to function as a node and then
that will shatter endurance records. with a three-month flight test of a join the rest of the swarm to form
The bird will draw 5 kW of power, subscale demonstrator, and the final the network. If one is destroyed, the
carry a 1,000 lb (450 kg) payload, phase will require a 12-month test of others will adjust their positions to
stay aloft for at least five years, and a full-scale vehicle. keep the system up and running.
remain in its assigned airspace 99
percent of the time while fighting
winds encountered at operating
altitudes, reportedly ranging from
Mini Network Bots New Touch Technology
60,000 to 90,000 ft (18,000 to Also pulling down government One of the perennial problems in
27,000 m). The goal is to provide funding — in this case, up to $3 robotics is improving the machine’s
long-term intelligence, surveillance,
reconnaissance, and communication
missions over locations of interest.
Contractors for phase one are
Aurora Flight Sciences (www.aurora.
aero), Boeing (www.boeing.com),
and Lockheed Martin (www.lock
heedmartin.com). A variety of
propulsion approaches — including
solar and internal combustion — will
be considered; however, nuclear and
lighter-than-air designs have been
ruled out. The winning design must
comply with space — not aviation —
industry standards, because only a
“pseudo-satellite” will handle the
demanding requirements. A supervi-
sory engineer at NASA observed, Sneak peak at what the LANdroid robot will look like. Photo courtesy of DARPA.

8 SERVO 07.2008
Robytes.qxd 5/29/2008 2:23 PM Page 9

Robytes

event’s Vienna-based facilitating the already existing


creator (www.robo exchange of ideas between the West
exotica.com), “Until Coast’s very much alive technology/
recently, no attempts art scene and the RoboExotica
had been made to mother ship in Vienna.”
publicly discuss the Unfortunately, the US incarnation
role of cocktail will not include the annual cocktail
robotics as an index robot awards, where you can enter a
for the integration machine in one of five categories:
of technological serving cocktails, mixing cocktails,
Artist’s concept of the “ScratchBot” innovations into the bartending conversation, smoking
employing the BIOTACT sensor. human Lebenswelt culture, and other achievements in
Photo courtesy of the BIOTACT project. [environment], or the sector of cocktail culture. To
to document the participate, you’ll have to show up at
sense of touch, and what could be a increasing occurrence of radical the Rote Bar/Volkstheater Wien
better way to solve it than to learn hedonism in man-machine (www.volkstheater.at/rotebar
from our touchy-feely friend, the rat? communication.” Imagine that. .html). The program is still under
Enter BIOTACT (BIOmimetic Technology But you can stop worrying, because development, so check the website
for vibrissal ACtive Touch, www. “RoboExotica is an attempt to fill from time to time for details.
biotact.org), a project funded by the this vacuum.”
European Union and involving nine RoboExotica generally consists
research groups in seven countries. of a series of events (exhibition,
The goal is to emulate how such conference, workshops, music, and
Bot Assists Endoscopy
mammals as rats and Etruscan shrews film presentations) held at various
can rapidly sweep their whiskers locations in Vienna. But this year,
back and forth to gather information sometime after the December 4th
about their surroundings. Thus, a bot kickoff in Austria, it will be presented
fitted with hundreds of whisker-like in San Francisco, as well, “thus
sensors may be able to seek, identify,
and track fast-moving target objects,
even in poorly lit places where machine
vision doesn’t get you anywhere.
The challenge is to develop new
biomimetic computational methods
and technologies that enable the
technology. But the consortium
has been granted four years and
$11.6 million to do it, so the odds The EndoAssist robotic manipulator.
look good. Photo courtesy of Prosurgics.

This month’s device for taunting


the squeamish is EndoAssist, a robotic
Showcase of Robotenders endoscope manipulator offered by
It’s beginning to look like the Prosurgics Ltd. Used in invasive
Germanic tribes have a curious thoracic and abdominal surgery, it is
fetish about linking robotics with particularly useful for ardiothoracic,
such ostensibly unrelated fields as urological, bariatric, ob/gyn, and
sociology, philosophy, and art (see general surgery. Perhaps the most
last month’s Robytes). In this vein, the interesting feature is that the surgeon
upcoming 10th anniversary of the controls camera angles simply by
RoboExotica conference recently A contestant from RoboExotica 2007. moving his head. Glance left, and the
came to light. According to the Photo courtesy of Roboexotica.com. camera moves left, and so on. You

SERVO 07.2008 9
Robytes.qxd 5/29/2008 2:24 PM Page 10

Robytes
can also pan, zoom, or modify the tank. Reportedly, using
view in any direction. For a video specially developed
demonstration that may affect your antibacterial detergent,
ability to keep lunch down, visit Dasubee can shine up
www.prosurgics.com/prosurgics_ a fouled privy in only
endoassist.htm. 10 seconds.
If you’re still
reluctant to buy one,
consider that Kanai
Uribot Tends Kobe Airport has included “a
Finally, the strangest application vacuum function to
of robotics of late would be Dasubee, breathe in a scraper
a bot designed specifically to clean and the water of the
urinals. One is already operating in floor to be able to
the Kobe, Japan airport. An astute wash the dirt scattered
observer will note that it resembles to the floor together
an elephant. Designer Susumu Kanai on the function side.”
revealed that this design was inspired (Something may have
by the pachyderm’s trunk, which been lost in the
resembles the powerful water cannon translation.) You can
employed by the bot. The ears are pick one up for only
handles, the eyes are the start and one million yen (about
stop buttons, and its little yellow hat $9,500). SV Dasubee, the urinal bot and its proud operator.
is the filler cap for the 13 gal (50 l) Photo courtesy of Impress Watch Corp.

STEER WINNING ROBOTS


WITHOUT SERVOS!

P erform proportional speed, direction, and steering with


only two Radio/Control channels for vehicles using two
separate brush-type electric motors mounted right and left
with our mixing RDFR dual speed control. Used in many
successful competitive robots. Single joystick operation: up
goes straight ahead, down is reverse. Pure right or left twirls
vehicle as motors turn opposite directions. In between stick
positions completely proportional. Plugs in like a servo to
your Futaba, JR, Hitec, or similar radio. Compatible with gyro
steering stabilization. Various volt and amp sizes available.
The RDFR47E 55V 75A per motor unit pictured above.
www.vantec.com
Order at
(888) 929-5055
10 SERVO 07.2008
Full Page.qxd 6/3/2008 11:06 AM Page 11
Geerhead.qxd 5/30/2008 10:07 AM Page 12

by David Geer Contact the author at geercom@alltel.net

Lewis, the Robot


Photographer
At first brush, a robot that snaps people’s pictures might not imbue the mind with
a novel image. But, a photographer that sets its subjects at ease, circumvents their
shy and self-conscious natures and related facial reactions, and captures the essence
of the subject unawares, now that’s a wonder to see!
hen Lewis the Robot Lewis separates real faces from
Full side view of Lewis.

W Photographer first enters a


crowded room, it gets atten-
tion. But, once people have adjusted
things that may look like faces to the
robot eye. Lewis eliminates anything
that is too big, too low, or the wrong
to its roaming around, looking here shape. Anything left is assumed to
and there, they forget all about it. be a face.
After all, it’s just a machine, another Lewis can take front-on and side
object in their environment. angle pictures of people. It continually
Lewis’ ability to blend in keeps scans images for the criteria that
it from creating the kind of predict a face or group of faces. Once
apprehension that comes with a it has detected a suitable image, it
live photographer who roams around adjusts the camera to take a quality
snapping candid pictures of people photo, moving it into position via
(as a wedding photographer might a series of zooming, tilting, and
do, for example). panning.
Because Lewis captures people at The robot uses object avoidance
ease, it can take a much higher quality technology to guide itself around
of photos — no blinking, phony smiles, objects and people, and maintains its
or stiff or awkward poses. Because position within the mass of subjects
Lewis recognizes faces and quickly by recognizing a given object and
snaps only the best photos, it takes centering itself in the group based on
many more quality pictures in the the position of that object.
same period at gatherings, functions,
and on special occasions. Forming Pictures
Looking for Faces How does Lewis form pictures of
faces? By following rules. One such
Lewis starts by scanning the room rule is the rule of thirds. The rule of
for pairs of what appear to be legs. thirds says that if you split a picture
This way, he can identify people and into thirds, first horizontally, then also
then look up to find and identify vertically, the primary point of visual
their faces. Then, Lewis uses face- interest in the photo should be where
recognition technology that identifies the lines cross. Lewis makes human
parts of images with lots of skin tones faces the points of greatest interest,
grouped closely together. placing them at these cross points.
12 SERVO 07.2008
Geerhead.qxd 5/30/2008 10:10 AM Page 13

GEERHEAD

Photographers try to avoid empty Sharing a more whimsical


space in their photos. This helps moment with Lewis are
ensure that photos contain as much members of the Media and
relevant visual information as possible. Machines Lab (from left):
Assistant Professor William
Lewis weighs the rule of thirds and Smart; Assistant Professor Cindy
the rule around empty space one Grimm (seated): two of the
against the other whenever they lab’s founders, Shannon
Lieberg, Engineering Class of ‘04
conflict, to take the best pictures. and research assistant Michael
Lewis can also think for himself Dixon, B.S./M.A. ‘03; and Nik
when taking photos. He is free to Melchior, a fifth year B.S./M.S.
student in computer science
break the rules altogether and take and engineering. Members are
feedback about his images. He uses showing off the “playful props”
this information to learn which rules used by Lewis in the lab.
to break and when in order to deliver
great photos based on a sort of it there for? In this version
photographic instinct. of the robot it made a noise,
sounding an alarm or signal
Live Test when it had taken a picture. However, hold still to get their picture taken, or
the sound wasn’t loud enough for they might move around. After the
Researchers tested the Lewis most people to hear. robot’s test run, people suggested
robot photographer on a group of If the signal were louder, this that the robot actually say cheese or
5,000 subjects over a period of 40 would communicate to people in the show a picture of a “birdie” (as in,
hours. Lewis took 3,000 pictures in robot’s proximity that it had just taken look at the birdie) to signal that it was
that period. During this 40 hour run, a picture. This would form some level about to take a picture.
people (guests at a large technology of communication between the robot People waiting in front of the
event) either ignored the robot and those people, and provide some robot hoping to have their pictures
completely or tried to interact with it. simple basis for interaction. taken were often disappointed when
Because the robot wasn’t instilled The robot had no way of telling the robot was navigating, getting its
with the ability to interact, people people to hold still or say cheese. It bearings, or homing in on a landmark
quickly dispensed with it and began took four seconds for the robot to line instead of taking pictures at that
socializing with other people in up shots, in which time people might particular moment. However, the
the crowd. Because people ignored
the robot, they relaxed and acted Lewis close-up head shot with camera. Lewis has worked
naturally, enabling the robot to take photographing at a real live
wedding reception.
candid, natural pictures.

Results
Among other things, researchers
determined that the robot should
have a sort of bi-modal capability. If
someone is trying to interact with it,
it should stop what it is doing and
interact with those people, taking
their pictures where possible. If no
one is trying to interact with the
robot, it should blend into the
background and continue to take
candid shots. This version of the robot
is only capable of blending in. So, the
robot will ignore people who want to
interact with it or who specifically look
to have their picture taken.
People will be more likely to
interact with the robot on some level
if they know what it is up to. What’s
SERVO 07.2008 13
Geerhead.qxd 5/30/2008 10:51 AM Page 14

GEERHEAD

In particular, when the camera


pointed in their direction coinci-
dentally in response to trying to
hail the robot, this was mistaken
for eye contact.
Lewis seemed intelligent to
people when he did what
appeared to be a double take.
Because the robot face detection
code was not optimized, the cam-
era panned past the faces and
beyond by the time the software
determined it had detected a
face. The camera then returned to
focus on the face for the picture.
This apparent “double take”
humanized the robot in the eyes
Here, Nik Melchior (left), a fifth year B.S./M.S. of on-lookers, attracting people to
student in computer science and engineering, interact with the robot.
helps create the programming framework that
allows others to command Lewis. Shannon Lieberg Likewise, other robot
(center) of the Engineering class of ‘04, works Lewis’ behaviors made the robot appear
controls with Assistant Professor Bill Smart. Full frontal view of Lewis. not so smart, even though these
behaviors were quite intelligent
robot was programmed to take Photographic subjects expected for a robot in what they
frequent pictures of human faces even the robot to respond when waved at, accomplished. One such behavior
when it may not have had the like a human being would. However, was looking at the wall (pointing its
opportunity to focus in for a good the robot didn’t have this capacity camera toward the wall) or moving
picture. To better interact with either. When the robot did seem to along a wall in order to aid in its
subjects, the robot should have the react — because it turned toward navigation. While the robot was
ability to communicate which mode or someone by sheer coincidence when trying to get its bearings, it appeared
“state” it is in to the subjects. So, if someone had waved at it, for example not to “see” anyone around it, and so
the robot is available to interact, it can — people thought this meant it was looked dumb.
communicate that, and so on. more intelligent than it actually was.
Conclusion
Continued research based on
Lewis should address whether Lewis
truly functions in two separate modes,
whether the level of sophistication of
the people interacting with Lewis has
an impact, and whether the robot or
the people around it should drive its
interaction. SV

RESOURCES
Lewis, the Robot Photographer
www.cs.wustl.edu/MediaAnd
Machines/Lewis

The Media and Machines Lab


http://mm.cse.wustl.edu/about/
index.html

Washington University in St. Louis


www.engineering.wustl.edu

14 SERVO 07.2008
Page 15.qxd 6/4/2008 3:26 PM Page 15

New breed of robots could soon She developed a program that lets the SnoMotes negotiate
with each other and “bid” on which site to investigate, allowing
wander Antarctica them to decide for themselves how to dole out their assignments.
The next challenge, though, was to come up with
By GREG BLUESTEIN, Associated Press Writer navigation for the rovers. Other probes tend to use distinguishing
obotic rovers have patrolled deep space and the deepest seas,
R but scientists are still struggling to create drones that can
overcome the multiple challenges of exploring Antarctica.
characteristics like rocks to chart their paths. But such features
can be hard to come by in vast icy expanses.
On a field trip to a Colorado glacier, Howard's team
Georgia Tech researchers think the SnoMote — a small robot discovered they could use microscopic fissures in the ice and
designed like a snowmobile — will be able to deal with the nasty snowbanks to guide their way.
weather and with slippery terrain that constantly cracks and “If you can come up with a way to classify these uniquely,
shifts. They envision dozens of SnoMotes roving Antarctica's you can come up with a way to navigate,” she said.
vast expanses to add to data already collected by satellites Simulations so far have proved her team's formula effective,
and a handful of weather stations and sensors. Ayanna but plenty of challenges await when the robot is put to the test
Howard, an associate professor at Georgia Tech in Atlanta, on the glaciers of Alaska.
has worked for two years under a NASA grant to perfect the With Penn State University researcher Derrick Lampkin,
two-foot-long robots. Howard has designed a shell that weighs 60 to 70 pounds, can
Her initial designs with spider-like legs proved too withstand harsh winters, and eventually could include heaters to
cumbersome to navigate snowbanks. So, she and her colleagues keep computers and wiring running in the cold.
leaned on others' designs, outfitting a snowmobile designed for Lampkin said his goal is to develop a "scale-adaptable,
kids with sensors, gauges, and cameras, and then programming it. autonomous, mobile climate-monitoring network."
The researchers hope the robots will ultimately cost around
$10,000, relatively cheap for governments, researchers, and
The Mechanicrawl • Saturday, July 12, 2008 others seeking to document changing conditions in the world's
Spend a summer day exploring the mechanical marvels along most remote places.
San Francisco's North Shore! See giant running steam engines, turn The more the better: Howard said in order for scientists to
of the century automata, mechanical computers, an eight foot high say with certainty how climate change is affecting the ice, they
need plenty of accurate data points to create climate models.
mechanical planetarium, and more. You'll be able to map your own
She envisions a field of 40 to 50 of the SnoMotes wandering
route for the event and spend as much time at each location as you'd icy plains, a small army gathering data to shed light on global
like. You can walk, bicycle, or use public transport for Mechanicrawl; warming and other quandaries without breaking the bank.
maps, routes, and additional info are listed under Map Your Crawl on “The whole concept is: How do you do this in the most
the website. For all the details, go to www.mchanicrawl.com. affordable way?” she said.

HE8EJIFH;<;H>?J;9)0'
.EW2OBOT3ERVOS

>_j[Y
Ej^[h8hWdZ

+656* +656* +657*


6SHHGVHF 6SHHGVHF 6SHHGVHF
7RUTXHR]LQ 7RUTXHR]LQ 7RUTXHR]LQ
6WHHO*HDUV 6WHHO*HDUV 7LWDQLXP

$//63(&,),&$7,216$792/76

7KHUHVXOWVRIDQLQIRUPDOSROOWDNHQUHFHQWO\DWWKH)LUVW
$QQXDO:RUOG'RPLQDWLRQ6\PSRVLXPDUHQRZLQ5RERWV
SUHIHU+LWHFVHUYRVRYHURWKHUVHUYREUDQGV7KH\NQRZWKHZLGH
VHOHFWLRQRI+LWHFDQDORJDQGGLJLWDOVHUYRVSURYLGHWKHPZLWKWKHSRZHUDQGGHSHQG
DELOLW\QHHGHGWRHYHQWXDOO\WDNHRYHUWKH:RUOG0DNH\RXUURERWKDSS\XVH+LWHFVHUYRV
3DLQH6WUHHW_3RZD\_&DOLIRUQLD___ZZZKLWHFUFGFRP

SERVO 07.2008 15
MrRoboto.qxd 5/30/2008 11:21 AM Page 16

NEW
Our ∧ resident expert on all things
robotic is merely an email away.
roboto@servomagazine.com

Tap into the sum of all human knowledge and get your questions answered here!
From software algorithms to material selection, Mr. Roboto strives to meet you
where you are — and what more would you expect from a complex service droid?

by
Dennis Clark

Q . Every once in a while there is a question floated


around in my local robotics group that (I think) is
such an epiphany (read: slap forehead) that I think
it deserves a wider audience. This first question is one of
this nature:
and would need a circuit board to use. Don Clay put
forward the solution of using a BEC that the R/C airplane
hobby crowd commonly uses on electric aircraft that use
large battery voltages. This is a very cool idea because it
can be connected to the robot’s main battery and will
Does anyone have any recommendations for an efficiently give the needed 5V in a small, self-contained
inexpensive DC-DC converter that has 11-14 VDC in, 5 VDC unit, and it already has easily usable cabling. The one that
out (up to 3-5 amps)? I need a heftier supply for the low- Daniel selected was the Castle Creations CC BEC which sells
level control system on my robot. Currently, I’ve got a 12V, for about $22 at good ol’ HobbyTown USA (www.hobby
12 Ah lead-acid battery with a 5V-1A converter, and I’m town.com); see Figure 1. This device is very useful because
reaching the limit of the converter when I add my sonars it can be set to output voltages from 4.8V to 9V by using
and IRs ... later, I would prefer an off-the-shelf solution. the Castle USB link adapter (not included). In case you were
— Daniel Herrington wondering, BEC stands for Battery Eliminator Circuit. In the
“old days,” electric R/C cars had a battery for the motor and

A . My first thought was the TI PT78ST105, which is a


1.5 amp 5V switching regulator that works with up to
38V. This nifty part has the same pin-out as the
another for the R/C electronics. The BEC “eliminated” one
of those batteries.

venerable 7805 regulator and is way more efficient.


Another suggestion was the TI PTN78020 which has similar
input voltage maximums and a 6 amp output with high
efficiency since it too is a switching DC/DC converter.
However, this part has lots more pins; it still needs no
Q . I want to send commands to my robot using an
IR remote. I don’t want to build another IR remote;
I want to use one of the bazillions that I have lying
around the house. How do I use these? How can I decode
their output?
external components. These parts are easily found at places — George S.
like Mouser, pricing depends upon various options. As good
though, as these solutions are, they are not “off-the-shelf”

Figure 1. CC BEC. A . Oh boy, I feel a marathon answer


coming up! I’m not going to go into
huge detail about every kind of IR
remote out there — there are a ton of web
pages that you can Google and find those
kinds of details. I’ll provide a selection of
them at the end of this answer for those
curious though. I did not find a lot of pages
that connected the dots between the various
formats and how to write a program to read
them, either. So, in this answer I’ll provide the
nitty gritty details of how the most popular IR
codes are created and provide some PIC code
that allows you to decode them. First, the
ugly details ...there are many, MANY different
16 SERVO 07.2008
MrRoboto.qxd 5/30/2008 11:24 AM Page 17

IR encoding schemes out there. Wikipedia tells us that there Description ON Time OFF Time
are literally hundreds of IR protocols! Fortunately for us, there
are three that are by far the most common: SONY SIRC, Lead In 2.4 ms 0.6 ms
NEC, and Phillips RC-5. If you pick up any odd remote at Logic 1 1.2 ms 0.6 ms
your house, it will most likely be using the SONY or NEC Logic 0 0.6 ms 0.6 ms
formats. Let’s discuss each of the “big three.”
Table 1. SONY timing values.
SONY SIRC Format
Significant Bit is first and the Most Significant Bit (MSB) is
First off, here are a couple of links that discuss this last. The packet format includes some kind of a Lead Out as
format. There is a lot of useful information in these; I well, but it is really just a guarantee of some time spacing
disagree with a few things that they say (more on that later), before the next packet is sent. Don’t bother to look for it
but since some of the data that I used to write my code since its length depends upon the data just sent; it doesn’t
came from these links, most of what they say is accurate: seem to be consistent (see Packet 1).
When you code for this protocol, you need to
www.hifi-remote.com/infrared/IR-PWM.shtml remember to assemble the bytes by putting the bits in
This site gives a lot of information on how to read the reverse order! Remember, they are LSB first.
universal IR remote entries that you use to program your When you press a button on a SONY remote, it will
universal remotes. The author calls this “PWM,” or pulse simply repeat the command packet every 45 ms for as long
width modulation. It is more accurately called “PPM,” or pulse as you hold the button. Some buttons on my remotes
position modulation, rather like R/C radio communications and would only send a command once when you let up off of
what we deal with when controlling hobby servos. the button, but the rest just kept repeating endlessly.

www.edcheung.com/automa/sircs.htm NEC Format


This site gives some hints on how to write code to send
IR signals. Not what I was looking for, but you might be I found useful information on the NEC format here:
interested in this if you wanted to have a robot wander into www.hifi-remote.com/infrared/IR-PWM.shtml
your TV room and take over control of the TV set!
and here:
The SONY format has three timing values that we are www.mcselec.com/index.php?option=com_content&
interested in, shown in Table 1. The Lead In is the header task=view&id=223&Itemid=57
before the data that tells us that the code is coming.
Everyone says this is to set up the AGC (automatic gain The NEC format is a bit different. It includes some error
control) in the receiver, but quite frankly, if it didn’t look checking and has a different way of dealing with repeating
different from the rest of the transmission how could we packets. The NEC protocol sends a Lead In, 32 bits of data,
tell that a new command was coming? The rest of the data and a Lead Out. Since we can count on the Lead In and 32
is an asynchronous data stream of 1s and 0s like the serial bits of data, don’t bother to look for the Lead Out here
data in RS-232, but coming in over modulated IR radiation either. The NEC format sends its data LSB first like SONY,
instead of a pair of wires. When I say “On,” I mean that the
IR carrier is detected. An “Off” means that there is no IR Description ON Time OFF Time
detected by the sensor.
Lead In 9 ms 4.5 ms
The actual SONY IR command can come in three
variations: 12 bits, 15 bits, and 20 bits. In every variation, Logic 1 0.56 ms 1.68 ms
we first have the Lead In header, then we have a seven-bit Logic 0 0.56 ms 0.56 ms
command. Next, in the 12-bit protocol we have a five-bit Repeat 9 ms 2.25 ms
Device ID. The Device ID tells us what is being controlled,
for instance, a TV or a DVD. In the 15-bit format, the Table 2. NEC timing values.
Device Code is eight bits; in the
20-bit code, we have a five-bit 12 Bit Code [Lead In] [0 | 1 | 2 | 3 | 4 | 5 | 6] [0 | 1 | 2 | 3 | 4] PACKET 1
Device ID and then an eight-bit Command Device ID
Extended Command byte. All
15 Bit Code [Lead In] [ 0 | 1 | 2 | 3 | 4 | 5 | 6] [0 | 1 | 2 | 3 | 4 | 5 | 6 | 7]
of my remotes were either Command Device ID
12-bit or 15-bit. All of the
codes come in LSB first. This 20 Bit Code [Lead In] [0 | 1 | 2 | 3 | 4 | 5 | 6] [0 | 1 | 2 | 3 | 4] [0 | 1 | 2 | 3 | 4 | 5 | 6 | 7]
means that the Least Command Device ID Extended Command

[Lead In] [0 | 1 | 2 | 3 | 4 | 5 | 6| 7] [0 | 1 | 2 | 3 | 4 | 5 | 6| 7] [0 | 1 | 2 | 3 | 4 | 5 | 6| 7] [0 | 1 | 2 | 3 | 4 | 5 | 6| 7] [Lead Out]


Device ID ~Device ID Command ~Command PACKET 2

SERVO 07.2008 17
MrRoboto.qxd 5/30/2008 11:24 AM Page 18

can be found here:


www.hifi-remote.com/infrared/IR-bi-phase.shtml

and here:
http://home1.stofanet.dk/hvaba/fprc5rx/index.html

The last of the big three formats that I’m going to talk
about is the Phillips RC-5 protocol. Rather than using PPM
encoding like SONY and NEC, the RC-5 format uses Bi-Phase
encoding. This means that the transition from a logic ‘1’ to
a logic ‘0’ and vice-versa is shown by a change in the bit
phase. If you are like most of us, your eyes just glazed over
at that description. This is one time that a picture is pretty
Figure 2. Bi-Phase encoding. much needed to explain what I mean (see Figure 2).
Note that it isn’t the timing that shows what the bit is,
but there the similarity ends. The packet format looks like but rather the phase of the timing. But how — you ask — do
that in Packet 2. By ~Device ID and ~Command, I mean you know what a ‘1’ is and what a ‘0’ is? You know because
that it is inverted, or 1’s complement of its respective the bit stream of RC-5 starts out with two 1 bits and then a
Device ID and Command. To check for a proper reception, toggle bit, which on the first press of the button is a 0. Figure
all you need to do is AND the byte with its respective 3 shows how a transmission is formatted. An RC-5 packet
complement; if it comes up all zeros, then you have a good consists of the preamble of 1 1 0, then a five-bit address and
reception. When you hold down a button on the NEC then a six-bit control. RC-5 packets are encoded with the MSB
remote, it does not send out the same command over and (Most Significant Bit) first. Because you know that the first
over; it sends out a special signal called the Repeat Code. bit is a 1, then any bit transition from that point onward
The NEC protocol has four timing values that we care you can track to know what the current bit is — a 1 or a 0.
about, and one we don’t (the Lead Out). Table 2 shows the Figure 3 may look a little odd because I put both same
ones that we pay attention to. and switch phases in every bit cell except for the start bits.
Just to make it more confusing though, I’ve read that the
Phillips RC-5 Format start bits can be either 1 1 or 1 0. I hope not; it’d make it
hard to figure out the 1 startup. The RC-5 protocol will
Some useful information on the Phillips RC-5 format repeat the button press every 113.8 ms, but every packet
after the first one will have the Toggle bit toggled
Figure 3. RC-5 packet. differently than the last start bit.

How to Decode IR Transmissions


Okay, now that the explanations are over with, how

Part Description
C1 110 μF 25V capacitor
Figure 4. IR detector schematic. C2-C4 .1 μF 25V capacitor
R1 10K 1/4W 5%
R2 2.2K 1/4W 5%
R3 1K 1/4W 5%
D1 Green LED
S1 N.O. button
U1 PIC16F688 DIP
U2 7805 regulator
U3 PNA4602 IR demodulator
J1 Power connector
J2 Four-pin male .1” connector
J3 RJ-11 six-pin connector

Table 3. IR detector parts list.


18 SERVO 07.2008
MrRoboto.qxd 5/30/2008 11:24 AM Page 19

can we use the IR transmissions from our remotes in our set-up of the interrupt routine that will capture the times
robots? To see what is going on, I built a special IR between pulses by measuring between falling edges on
decoder board that has a Panasonic PNA4602 (38 kHz) IR the INT line. When the IR transmitter is On, this will be
demodulator, a PIC16F688, a power plug, regulator, detected by the PNA4602 and it will drop its output low.
programming header (Microchip ICD2 six-pin type) and a This is why I chose falling edges; the output of the device
plug for the Acroname RS-232 converter board. Figure 4 is normally high, or Off. Before I go into my logic for
shows the schematic and Figure 5 is a photo of the finished detecting pulses and parsing them out, let’s get an idea of
board with everything plugged in. This board was wired how I set the PIC up to look for these transmissions. To do
together with a bunch of wire that I had lying around, so it that, let’s look at how to initialize this PIC. The code snippet
isn’t very sensitive to how you put it together. I just wanted below shows how I set up the timers:
an experimenter board that would show me the IR
codes and allow me to experiment with decoding the IR //Turn off comparator
transmissions. Different remotes use different modulation setup_comparator(NC_NC_NC_NC);
frequencies, but the Sharp PNA4602 will work with
frequencies between 36 kHz and 40 kHz just fine. I chose //We will be doing interrupts
setup_timer_0(RTCC_INTERNAL | RTCC_DIV_128);
the PIC16F688 because it had an interrupt line, a hardware //16ms timer
USART, two timers, and an internal RC oscillator that runs setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);
at 8 MHz, all in a 14-pin package. These were all of the //Gives 131ms max timeout
hardware interfaces that I needed. Unfortunately, for some ext_int_edge(H_TO_L);
reason Microchip requires some kind of dongle to debug //IR IRQ on falling edge
this chip which I didn’t have, so I debugged using “printf”
statements in the code. CCS does a good job of hiding the ugly details of the
The board isn’t particularly sensitive to the components hardware from you, but you still need to read your data
that you can use. My previous list just came from my parts sheets to understand what they are hiding! Here we turn
bins. The power connector was a barrel socket that fit the off the comparators because these pesky things default to
various wall warts that I had lying around. I chose the pin on in the PIC and will get in the way of those I/O lines.
out of the RS-232 connector to match the Acroname Serial We’re going to use TMR0 to time our pulses because it
Interface Connector that you can get from www. is an eight-bit timer and we don’t want all that much
junun.org/MarkIII for about $10. Finally, the resolution in our times. This “slop” allows us to quickly
programming connector is chosen to fit the cable on check a bit time and save it away; the coarseness of the
my Microchip ICD2 so that I can just plug in and program measurement allows us to read remotes that are close, but
the board without constantly taking the part out of a not perfect to the specified times. We know that the pulses
programmer board and plugging it back into my test board. in SONY and NEC are between 1.2 ms and 13.5 ms (see
If your programmer allows In Circuit Serial Programming Tables 1 and 2 again) so we want this timer to have a
(ICSP), then get a connector that matches its cable. maximum time before it rolls over that is near that
Figure 5 shows what my board looks like. I put little maximum time. Since our PIC is running on its internal
rubber feet on the bottom to make it extra spiffy looking. I 8 MHz clock (which is divided by four internally), we know
put a small three-pin socket on my board so that I could that if we use the prescaler on TMR0 at divide by 128, we
swap around IR demodulators that have the same pin-out will have a maximum time of:
as the Panasonic units, should I so desire.
Now that we understand the formats and we have a (1/(2MHz/128))*256 = 16.384 ms
board to look at the signals, how can we decode them?
The answer is software, of course. I like to use C as my Figure 5. IR detector board and Acroname serial connector.
programming language, but the logic that I use here can be
ported to any compiler language that you feel comfortable
with. I should qualify that statement — any compiler that
allows interrupts to be used is required. In this case, my
compiler of choice is the CCS C compiler for the Microchip
14-bit cores (the PIC16Fnnn series.) I am not going to go
into the gory details about how to program a PIC; whole
books have been written on that subject and that isn’t my
intent with this column. However, you can benefit from my
line of reasoning for doing things how I did them and move
these procedures to your compiler or even your other
microcontroller if you wish. I’m only going to show SONY
and NEC decoding in my code. This is because I don’t have
any RC-5 remotes; all of mine were SONY and NEC formats.
My test code has two sections in it. The first is the
SERVO 07.2008 19
MrRoboto.qxd 5/30/2008 11:24 AM Page 20

That is pretty close to 13.5 ms. Why are we using I can hear the groaning now! I’ve used PIC assembly
TMR1? When we start saving times to measure for our language! In CCS C, the compiler flag “#int_global” means
data bits, we need some way to stop looking if the signal is that CCS will not handle the saving of registers that need
interrupted, otherwise we’ll just appear to “hang” and do to be saved during an ISR call. This means that we need to
nothing. TMR1 will be set to values that are just a little do it. Really, the only reasonable way to do this is with
larger than the inter-packet repeat rate. For NEC, this is some simple assembly code. This function needs to be
108 ms; for SONY, it is 45 ms. TMR1 is a 16-bit timer and it FAST and we do that by keeping it lean. I combine this
only has four prescales to choose from, so I took the one lean ISR with the definitions at the top of the program that
that got me close to 108 ms. Finally, I set the INT interrupt looks like this:
to trigger on a high-to-low transition for my measurements.
Here is the code for the actual interrupt service routine: unsigned char save_w; //These next 3 bytes
//are saved on interrupt
#int_global #locate save_w=0x7f
void isr(void) unsigned char save_status;
/* #locate save_status=0x7e
* Lets handle all ISR save/recovery functions, the unsigned char save_FSR;
default isn’t lean enough for #locate save_FSR=0x7d
* an ISR that is highly time critical. unsigned char wBits=0; //To make access to
*/ //these variables fast
{ #locate wBits = 0x7c //Keep them in common
#asm //memory for ISR use
//store current state of processor unsigned char t1h;
MOVWF save_w #locate t1h = 0x7b
SWAPF status,W unsigned char t1l;
MOVWF save_status #locate t1l = 0x7a
SWAPF FSR,W /*
MOVWF save_FSR * Give me direct access to several SFR’s that CCS
BCF status,5 //Set to page 0 for SFR’s doesn’t handle the way I want.
BCF status,6 */
#endasm #byte TXREG = 0x15
#byte T1CON = 0x10
//We only have two interrupts, so if it isn’t #byte INTCON = 0x0B
this one, it’s the other. #byte FSR = 0x04
if (bit_test(PIR1,0)) //Timer1 overflow IRQ
#byte status = 0x0
{
#byte TMR1L = 0x0E
bits[wBits++] = 255; //timed out
#byte TMR1H = 0x0F
bit_clear(PIR1,0); //Clear TMR1 int flag
#byte PIR1 = 0x0C
bit_clear(T1CON,0); //Turn TMR1 off until...
#byte TMR0 = 0x01
}

if (bit_test(INTCON,1)) //CCP1 capture IRQ Those confusing compiler directives tell the compiler to
{
bits[wBits++] = TMR0; //save the pulse time
put certain variables into “access RAM” that is available in
bit_clear(INTCON,1); //clear external all data banks. This means that I don’t have to waste time
//interrupt flag switching banks to save our timing measurements or our
TMR1H = t1h; //reset the timeout saved registers. Make sure you look this up in the CCS
TMR1L = t1l; manual. You don’t have to do this in other micros that
bit_set(T1CON,0); //turn TMR1 back on so don’t use banked data memory.
//we can time out
TMR0 = 0; //clear out the timer Now look at the ISR from above. When we get an
} interrupt from INT, we record the value in the TMR0 register
in the next available data slot in our ring buffer (called ring
if (wBits == MAXBIT) //rollover the bit because it rolls over to 0 when it reaches the end of the
//buffer “ring”). If we time out on TMR1, then we stuff a 255 into
wBits=0;
the buffer telling the decoding routine that we timed out
#asm and we should ditch the entire set of numbers and wait for
// restore processor and return from interrupt the next start to be detected.
SWAPF save_FSR,W The second part of the program will decode the times
MOVWF FSR saved in the buffer and turn them into 1s and 0s. It uses its
SWAPF save_status,W own pointer into the ring buffer and knows when to look
MOVWF status
SWAPF save_w,F
for a value when the read pointer is different from the
SWAPF save_w,W write pointer. I’ve put lots of comments into this code, so
#endasm I’m not going to go over it line-by-line. Here is what the bit
} decoding routine looks like:
20 SERVO 07.2008
MrRoboto.qxd 6/4/2008 4:58 PM Page 21

unsigned char DecodeBit(unsigned char time)


/*
* This will determine if the bit is a 0 or a 1,
* by whichever standard is in being used.
* Returns a 1 if a logic 1 bit, 0 otherwise.
*/
{
unsigned char ret = 0;
unsigned char val = 0;

val = time; //Can be used to “fuzzy”


//the time for rounding

if (whichOne == NEC)
{
if ((val <= NEC_ONE+FUZZY) &&
(val >= NEC_ONE-FUZZY))
ret = 1;
else if ((val <= NEC_ZERO+FUZZY) &&
(val >= NEC_ZERO-FUZZY))
ret = 0;
} Figure 6. A selection of IR remotes.
else if (whichOne == SONY)
{
if ((val <= SONY_ONE+FUZZY) &&
(val >= SONY_ONE-FUZZY)) Conclusion
ret = 1;
else if ((val <= SONY_ZERO+FUZZY) &&
(val >= SONY_ZERO-FUZZY))
Figure 6 shows my collection of IR remotes that I used
ret = 0; to test my program. I found interesting departures from the
} established standards in some of them; no doubt you will, too.
return ret; I’ve given you a powerful tool that you can use to
}
discover IR codes and a basic template that you can use
to embed the ability to control your robot using a common
There is more magic in DecodeCode() that shows how household device: the IR remote. Have fun and be creative.
to recognize the start of a transmission and how to end If you have any questions about this program or how I
one. This little routine above simply shows the decoding of “figured it all out,” send your questions to roboto@servo
a single data bit. Notice the + and – FUZZY settings. IR magazine.com — I’m happy to answer! SV
specs allow for about a 10% slop in the standard times.
This FUZZY setting gives us that. You can experiment with NEWS FLASH! At the last possible moment I discovered
how large you want that FUZZY to be since it is a #define this site. It is an excellent compendium of various IR
at the top of the program. I’ve found that a setting of 2 remote formats: www.rhoads.nu/bjorn/hp48/remote.
works well.
My code will “auto” detect NEC
code if you hold the button down.
This is because NEC uses the repeat
code frame that is distinct from any
other transmission. You don’t have to
do that if you don’t want to, and
you’ll need to reset the PIC to get it to
pay attention to SONY codes again
regardless. I have two modes of
operation that can be selected by the
setting of the TEST define. If this is set
to 1, then the program will only print
out the times. This is useful for when
you are trying to understand a new
format. If TEST is set to anything else,
then the program will decode either
SONY or NEC, and print out the
device and control codes when they
are received. The entire program
source can be found on the SERVO
website www.servomagazine.com).
It is called IRdecoder.c.
SERVO 07.2008 21
Events.qxd 6/4/2008 9:37 AM Page 22

Send updates, new listings, corrections, complaints, and suggestions to: steve@ncc.com or FAX 972-404-0269

Know of any robot competitions I’ve missed? Is your


local school or robot group planning a contest? Send an 14-18 K’NEX K*bot World Championships
email to steve@ncc.com and tell me about it. Be sure to Las Vegas, NV
include the date and location of your contest. If you have a This competition includes events for two-wheel
website with contest info, send along the URL as well, so we drive autonomous K*bots, four-wheel drive
can tell everyone else about it. autonomous K*bots, and the remote control
For last-minute updates and changes, you can always Cyber K*bot Division.
find the most recent version of the Robot Competition FAQ www.livingjungle.com
at Robots.net: http://robots.net/rcfaq.html
22-25 FIRA Robot World Cup
— R. Steven Rainwater Shinan Software Park, Qingdao, China
This competition has events for every kind of
robot soccer imaginable, ranging from the
J u ly humanoid robot league down to the tiny
Khepera robot league.
www.fira.net
7-11 Africa Championship Robotics Competition
Pretoria, South Africa 26 RoboBombeiro
Students from various countries and continents Polytechnic Institute of Guarda, Guarda, Portugal
will compete in several robot challenge Autonomous fire-fighting robot contest.
events. http://robobombeiro.ipg.pt
www.nydt.org/home.asp?pid=963
28 AUVS International Aerial Robotics
8-10 European Micro Air Vehicle Competition Competition
Research Airport, Braunschweig, Germany Fort Benning, GA
Tiny, autonomous flying robots compete for Autonomous flying robots complete missions
prizes. Every year, these things get smaller that include dropping sub-vehicles and gathering
and smaller. information. This event runs through August 1st.
www.mav08.org http://avdil.gtri.gatech.edu/AUVS/IARC
LaunchPoint.html
8-11 Botball National Tournament
Norman, OK 29 AUVS International Underwater Robotics
Educational robot contest for middle and Competition
high school students designed to use science, Space and Naval Warfare System Center,
technology, engineering, and math to solve San Diego, CA
real world problems. In this competition, autonomous underwater
www.botball.org robots built by university students must complete
an underwater course. This event runs through
13-17 AAAI Mobile Robot Competition August 3rd.
Chicago, IL www.auvsi.org/competitions/water.cfm
This year’s competition will take the form of
exhibits that demonstrate either robot creativity TBA RoboCup Robot Soccer World Cup
or mobility and manipulation. Expect to see Suzhou, China
robots that dance, paint, play musical instruments, Soccer Simulation — teams demo and test their
and much more. robots; Small-size Robot Soccer — F180 robots
www.aaai.org/Conferences/conferences. play soccer; Mid-size Robot Soccer — larger robots
php play soccer; Sony Legged Robot Soccer — legged

22 SERVO 07.2008
Events.qxd 6/4/2008 3:06 PM Page 23

robots play soccer; RoboCup Junior — small robots


play soccer; Humanoid Soccer — humanoid robots
play soccer; Rescue Robots — NIST Standard
Rescue Robot Test Field; RoboCup@Home — real
world robot event.
http://www.robocup.org

TBA War-Bots Xtreme


Saskatoon Saskatchewan, Canada
“Robots” (RC vehicles) attempt to destroy each
other.
http://www.warbotsxtreme.com

August
23-24 Motodrone AFO Competition
Finowfurt, German
Autonomous Flying Objects (AFOs) compete in
several areas including the ability to hover in Extreme Robot Speed Control!
changing wind conditions, stable flight between
points, capturing photos of targets, recovering
idewinder 6
6
14V - 50V - Dual 80A H-bridges - 150A+ Peak!
Adjustable current limiting
from free fall, and automated take off and S 6
6
Temperature limiting
Three R/C inputs - serial option
landing. 6
6
Many mixing options - Flipped Bot Input
Rugged extruded Aluminum case
www.motodrone.de $399 6 4.25" x 3.23" x 1.1”

29 DragonCon Robot Battles


Atlanta, GA $79.99 $119.99
Remote-controlled and autonomous robots fight it $29.99 Scorpion XL
Scorpion HX
out at the DragonCon science fiction convention. Scorpion Mini 6 Dual 2.5A (6A pk) H-bridges 6 Dual 13A H-bridge 45A Peak!
6 2.5A (6A pk) H-bridge 6 Plus 12A fwd-only channel 6 5V - 24V
www.dragoncon.org 6 5V - 18V 6 5V - 18V 6 2.7“ x 1.6” x 0.5”
6 1.25“ x 0.5” x 0.25” 6 1.6“ x 1.6” x 0.5”

TBA DPRG Robot Talent Show Introducing Dalf


The Science Place, Dallas, TX 6 Closed-loop control of two motors
6 Full PID position/velocity loop
Autonomous robots demonstrate their talents. 6 Trapezoidal path generator
www.dprg.org/competitions 6 Windows GUI for all features
50
6
6
Giant Servo Mode!
C source for routines provided
$2
TBA Robot Fighting League National 6 PIC18F6722 CPU See www.embeddedelectronics.net
Minneapolis, MN H-bridges: Use with Dalf or with your Micro/Stamp
“Robots” (RC vehicles) attempt to destroy each
Simple-H
19

other. OSMC
$2

6 Monster power! 6 6-28V 25A!


6 2.25”x2.5”x0.5”
www.botleague.com 6 14-50V 160A!
6 3 wire interface
6 3.15”x4.5”x1.5”
6 3 wire interface 6 current & temp
protection
TBA Robots at Play $79
City Square, Odense, Denmark MADE IN

Robots compete to demonstrate playfulness and


interactivity. www.robotpower.com THE USA

Phone: 253-843-2504 s sales@robotpower.com

SERVO 07.2008 23
Showcase Jul08.qxd 6/4/2008 2:08 PM Page 24

DEVELOPERS IN of Technology in Pasadena. He


conceived and led the development
ROBOTICS TECHNOLOGY of an interface system to allow
FOR USE IN SPACE scientists and engineers to
EXPLORATION RECEIVE collaborate in generating activity
2008 IEEE ROBOTICS sequences, which was used as the
primary science planning tool in the
AND AUTOMATION 2003 MER mission. The interface also
AWARD enables the public to view mission
Contributions to Autonomous data and simulate their own activity
Robotic Operations Result in sequences. Backes holds seven
Significant Data Collection patents, has won several awards,
from Mars and has published numerous book
chapters, articles, and papers. He

I EEE (Institute of Electrical and


Electronics Engineers) has named
Paul Backes, Eric T. Baumgartner, and
was associate editor of the IEEE
Robotics and Automation Society
Magazine from 1993 to 1998.
Larry Matthies recipients of its 2008 Baumgartner contributed to
Robotics and Automation Award. The the MER project as the lead systems,
three are being recognized for their test, and operations engineer for
contributions to different robotics the MER Instrument Positioning
technologies used in space flight System. This system was responsible
systems including the successful Mars for the robotic deployment and
Exploration Rover (MER) mission placement of four in-situ — meaning
rovers Spirit and Opportunity, which “in place” — instruments onto the
to this day are still functioning on Martian surface through the use
the surface of Mars. The IEEE is the of a five degree-of-freedom robotic
world’s leading professional arm. Presently, Baumgartner is the
association for the advancement of dean of the T. J. Smull College of
technology. Engineering at Ohio Northern
The award, sponsored by the University in Ada. He has published
IEEE Robotics and Automation numerous papers in the area of
Society, recognizes Backes, mobile robotics and vision-guided
Baumgartner, and Matthies for manipulation and has received
contributions to robotics enabling several awards for his efforts on the
effective autonomous operations of MER project.
science investigations under extreme Matthies’ work on autonomous
conditions on the planet Mars. The navigation of robotic ground and
award was presented to the three air vehicles led to the development
on May 23, 2008 at the IEEE of algorithms for descent motion
International Conference on Robotics estimation, visual odometry, and
and Automation (ICRA) in real-time 3D perception with stereo
Pasadena, CA. vision. These capabilities were
The works of Backes (distributed incorporated into the MER mission,
ut
and remote operations), providing landers with the ability to B l ow O l
Baumgartner (manipulator control), estimate horizontal velocity and
Specia
$9.95!
and Matthies (navigation systems) rovers with the ability to detect
have advanced robotic technology, obstacles and measure slip. His
particularly rover operations, and work can be found in terrestrial
made possible the scientific applications including off-road WWW.SERVOMAGAZINE.COM
exploration of Mars. MER is the first autonomous navigation and robotic
long-term mobile autonomous vision systems. An associate member
robotic exploration in an unknown of the IEEE, Matthies is an adjunct
space environment. professor at the University of
An IEEE member, Backes is the Southern California and a member
technical group supervisor of the of the editorial boards of the
Mobility and Manipulation group in Autonomous Robots Journal and the
the Mobility and Robotic Systems Journal of Field Robotics. He has
section at the Jet Propulsion received several awards, holds two
Laboratory of the California Institute patents, and is widely published.

24 SERVO 07.2008
Showcase Jul08.qxd 6/4/2008 2:11 PM Page 25

7KH(VFDSH
5RERW¶VEXLOWLQ
PLFURSURFHVVRU
HQDEOHVLWWR
³WKLQN´RQLWVRZQ

G 
.65 

L U H QJ
TX UL
U H R O GH
6
7KHURERWIURJPRYHVIRUZDUG
ZKHQLWGHWHFWVVRXQGDQG
UHSHDWVVWDUW PRYHIRUZDUG !
VWRS!OHIWWXUQ!VWRS!ULJKW
WXUQ!VWRS .65 
PP:KLWH
ZDWHUFOHDU
/('9
PFG
$% 

VHFRQGYRLFHUHFRUGHUSOD\EDFN
PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH
ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV
PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH
SUHDVVHPEOHG  $ 
7KH9HOOHPDQ3HUVRQDO6FRSH
LVQRWDJUDSKLFDOPXOWLPHWHU
EXWDFRPSOHWHSRUWDEOH
RVFLOORVFRSHDWWKHVL]HDQG
FRVWRIDJRRGPXOWLPHWHU
+36  $146.
QGV
7KRXVD RQ
P V
PRUHLWH LWH
Z H E V
RXU

Robotics Showcase

THOUSANDS OF ELECTRONIC
PA R T S A N D S U P P L I E S
VISIT OUR ONLINE STORE AT
www.allelectronics.com
WALL TRANSFORMERS, ALARMS,
FUSES, CABLE TIES, RELAYS, OPTO
ELECTRONICS, KNOBS, VIDEO
ACCESSORIES, SIRENS, SOLDER
ACCESSORIES, MOTORS, DIODES,
HEAT SINKS, CAPACITORS, CHOKES,
TOOLS, FASTENERS, TERMINAL
STRIPS, CRIMP CONNECTORS,
L.E.D.S., DISPLAYS, FANS, BREAD-
BOARDS, RESISTORS, SOLAR CELLS,
BUZZERS, BATTERIES, MAGNETS,
CAMERAS, DC-DC CONVERTERS,
HEADPHONES, LAMPS, PANEL
METERS, SWITCHES, SPEAKERS,
PELTIER DEVICES, and much more....

O R D E R TO L L F R E E
1-800-826-5432
Ask for our FREE 96 page catalog

SERVO 07.2008 25
JUL08NewProd.qxd 6/4/2008 4:41 PM Page 26

New Products

N E W P RO D U C T S
computer (IBM PC or compatible). The interface connects
CONTROLLERS & PROCESSORS to the PC’s USB port. The software for the interface
permits real time control and contains a built-in
Baby Orangutan B-168 interactive script writer. A user may write a script that
contains up to 99 individual robotic arm functions
Robot Controller (including pauses) into a single script file. Script files

P ololu announces the release of


the Baby Orangutan B-168 robot
controller, the latest addition to Pololu’s line of
may be replayed automatically for demonstrating
computer controlled automation and animatronics.
The Robotic Arm PC Interface creates a fun way of
Orangutan robot controllers. The compact module learning and experimenting with computer automation
has dimensions of 1.2” x 0.7”, and it can be configured and animatronics.
to fit in a solderless breadboard or a 24-pin dual in-line The USB OWI-535 Interface (assembled and tested)
package (DIP) socket. For applications with low I/O usage, costs $99.95; the USB OWI-535 Interface Kit (requires
the Baby Orangutan B-168 board can also be configured soldering and assembly) is $84.95.
with pins on just one side of the module for use as a single The Interface Kit Includes:
in-line package (SIP). The diminutive size of the Baby
Orangutan B-168 makes it well suited for primary control of • Windows 2000/XP/Vista program
miniature robots or for auxiliary control on larger robots. • Printed circuit board for easy construction
The Baby Orangutan B-168 is based on an Atmel • All components
ATmega168 microcontroller running at 20 MHz with 16
KB of Flash program memory and 1 KB data memory.
The use of the ATmega168 microcontroller makes the
Baby Orangutan B-168 compatible with the popular
Arduino development platform. Free C and C++
development tools and libraries are also available.
Integrated motor control sets the Orangutan family
of controllers apart from other small microcontroller
boards, and the Baby Orangutan B-168 features dual
high-performance, MOSFET-based H-bridges to deliver up
to 1A per channel over the 5-13.5V operating range.
With hardware-based ultrasonic PWM generation, two
independent, bidirectional DC motors can be controlled
symmetrically and without any processor overhead.
The unit price is $29.95. For further information, please contact:
For further information, please contact:
Images Scientific Website: www.imagesco.com
Pololu 6000 S. Eastern Ave. Suite 12-D Instruments
Las Vegas, NV 89119
Corporation Tel: 877•7•POLOLU or 702•262•6648
Fax: 702•262•6894
Email: www@pololu.com
Website: www.pololu.com
MECHANICS

INTERFACE Motor Mount and Wheel Kit


PC Windows USB Interface for
OWI-535 Robotic Arm
I t’s time to give your robot the mobility and style it
deserves with the new Motor Mount and Wheel Kit
with Position Controller from Parallax. Powerful 12 VDC,
150 RPM motors are combined with precision machined

T he robotic arm interface kit available from Images


connects OWI’s 535 Robotic Arm Edge™ to a personal
6061 aluminum hardware to provide enough power,
strength, and beauty to make other robots jealous.

26 SERVO 07.2008
JUL08NewProd.qxd 6/4/2008 4:42 PM Page 27

Conveniently positioned provides an easy migration route to 32 bit power.


screw holes in the bearing ARM hardware development tools, based on the
block make mounting this Matrix’s E-blocks range, are also available. A fully
kit a breeze, and the functional demonstration version is available on the
included six inch Matrix website.
pneumatic rubber tires For further information, please contact:
perform well on a variety of
smooth or rugged terrains. The Matrix Website: www.matrixmultimedia.co.uk
Multimedia
kit includes two position controllers which
use a quadrature encoder system to reliably
track the speed and position of each wheel with
36 positions/rotation resolution and report the data TOOLS & TEST EQUIPMENT
on command via a 19.2 kbps serial bus. The position
controllers can also be interfaced with HB-25 motor
controllers (sold separately) to automatically provide user- Four-Channel Digital Battery
definable smooth speed ramping and accurate position Test System
control, which frees up the main processor to handle
more important tasks.
The entire Motor Mount and Wheel Kit (#27971) is
a value at $279.95.
For further information, please contact:

Parallax, Inc. Website: www.parallax.com

SOFTWARE
T he Cadex C8000 is an advanced battery test system
capable of performing complex lifecycle tests. These
tests may include discharging a battery with GSM,
Flowcode for ARM CDMA, or other pulses of choice. Replicate battery
Microcontrollers runtime of a power tool, digital camera, or computing
device by first capturing the current profile and then

M atrix has recently


launched a new
version of their popular
applying the load on the test battery for verification. The
C8000 can also test the function of a Li-ion charger,
verify battery safety circuits, and read SMBus registers.
graphical programming Automated programs assure safe charging and correct
language for micro- discharge terminations; custom programs provide for
controllers — ‘Flowcode user-defined settings. Each of four independent channels
for ARM micro- delivers up to 10A and 36V, with 0.1% FSR. Total power
controllers.’ Now, 32-bit is 400W on charge and 320W on discharge. The Cadex
ARM microcontrollers C8000 runs as a stand-alone unit or with PC-BatteryLab™
are available for the software.
same price as eight For further information, please contact:
bit micros but offer
massive advantages to Cadex Website: www.cadex.com/c8
developers: low power, Electronics
more I/O lines, several
times more ROM and
RAM than a typical eight bit micro, full floating point Show Us What You’ve Got!
and maths libraries, and a massive increase in processing
Is your product innovative, less expensive, more functional,
speed and power.
or just plain cool? If you have a new product that you
This new version of Flowcode provides
would like us to run in our New Products section, please
engineers and developers access to all of these features
email a short description (300-500 words) and a photo of
of the ARM based on Atmel’s popular range of AT91
your product to:
microcontrollers. Flowcode for ARM is also backwards
compatible with Flowcode for PICmicro® newproducts@servomagazine.com
microcontrollers and AVR® microcontrollers which

SERVO 07.2008 27
CombatZone.qxd 5/29/2008 2:26 PM Page 28

Featured This Month:


Features
28 BUILD REPORT:
Apollyon
by Mike Jeffries
BUILD REP RT
Apollyon
30 MANUFACTURING: ● by Mike Jeffries
High-Performance Drill
Motor Modification
by Bryan Ruddy
I designed this 12 pound,
Hobbyweight, robot with the
purpose of cramming as much
box possible. It’s low, it’s fast,
and it’ll just keep slamming its
face into your spinning weapon
power as I could into the smallest until something breaks. The horns
on top allow it to
32 PARTS IS PARTS: FIGURE 1 take its opponents
Mag Motor Upgrades into the wall of
the arena while
and Repairs wearing them like a
by Nick Martin polished metal hat.
Apollyon won its
debut tournament
Events this past December
with a 3-1 record.
33 Apri/May 2008 Results and
Jul/Aug 2008 Upcoming FIGURE 2

Events

ROBOT PROFILE – Top


Ranked Robot This Month:
31 Billy Bob by Kevin Berry

28 SERVO 07.2008
CombatZone.qxd 5/29/2008 2:28 PM Page 29

FIGURE 3

FIGURE 4 FIGURE 5

FIGURE 6
Parts List
ITEM QTY PRICE
• Victor 883 speed controller 2 $139.99
• GB42 gearbox 2 $85.99 (no longer available)
• Mini-EV motor 2 $8.99
• 18V 1,650 mAh NiMH battery pack $62.50
• Spektrum DX6 with BR6000 receiver 1 $199.99
• 3” Colson wheel with hub 2 $25.00 (no longer available)
(www.cncbotparts.com)
• GWS elevator/aileron mixer $14.99
• S-BEC Super BEC 5V $46.99 (being replaced
with receiver battery pack
for future events)
• MS-05 power switch 1 $48.00
• 45A powerpole connectors $1.39/set
• #8 ring terminals $1.99/25
• Deans Wet Noodle Wire — 12 awg $1.25/ft
• Raw metal, nuts, and bolts (www.mcmaster.com and www.onlinemetals.com)
• Wood and plumbing pieces for battery mount — local hardware store
• Machining (www.teamwhyachi.com)

FIGURE 7 NOTE: All items are from www.robotmarketplace.com unless noted otherwise.

Figure 1 is a CAD model of been mounted, and the robot is FIGURE 8


Apollyon drawn in SolidWorks. Some almost ready for competition.
minor changes were made, but most Take a look at Figure 7.
of the parts are almost identical to You’ll see an internal shot of
the ones in the drawing, for example, Apollyon the night before the
the side and internal frame rails, as “Wreck the Halls” event in
well as the horns that are used to Greensboro, NC. This shows
catch other robots. The horns are the layout of the electrical
steel and the rest of the frame is components and the battery
6061 aluminum (see Figure 2). mount. The piece of PVC pipe
The sides of the frame are in the back left of the robot
lined up to show the profile of the serves as a power distribution
chassis, shown in Figure 3. The block and battery mount.
holes in the top, front, and bottom Figure 8 shows Apollyon at
of the plate are tapped to allow Wreck the Halls being prepared for
armor to be bolted directly to them. the first match of the competition.
Figure 4 shows the chassis with Apollyon won the 12 lb class
the baseplate, drive motors, and inter- with a 3-1 record (see Figure 9).
nal portion of the front armor installed. The damage was all cosmetic
Figure 5 shows a mostly and easily repaired. The shaft collar
assembled Apollyon sitting inside on the visible axel was torn off in
the chassis of my 60 lb robot Ruiner. combat. A new front wedge is
In Figure 6, Apollyon has been being designed to reduce
painted, the front steel wedge has impacts on the chassis. SV FIGURE 9

SERVO 07.2008 29
CombatZone.qxd 5/29/2008 2:30 PM Page 30

MANUFACTURING
High-Performance Drill Motor Modification
● by Bryan Ruddy
PHOTO 1. The 36-volt DeWalt DC900KL
contains a gearmotor rated for 750 watts of
power and is capable of a bone-crushing 200
foot-pounds of stall torque in low gear. On
C ordless drills are among the
richest sources of affordable
gearmotors for the robotics hobbyist;
paper, this gearmotor should be capable of
moving a 200 pound robot at about five miles from inexpensive, low-power imports
per hour in a 4WD configuration.
(such as the drills offered by Harbor
Freight) to high-performance, name-
brand drills (particularly DeWalt).
Unfortunately, drill gearmotors lack
convenient mounting features, often PHOTO 4. As shown on the left, the first-stage
ring gear (part #628002-00) is free to rotate as
have minimal bearings, and generally part of the clutch mechanism. To lock this gear
in place, we can machine it down to a square,
contain slip clutches, making them as shown on the right. The modified gear
unsuitable for use in robotic drive presses into the motor mount.
and mobility applications without
modifications. While there are
commercially-available modification
kits for some drill gearmotors, most
motors must be modified by the
hobbyist. The photos here document
my modifications to
DeWalt’s newest and
most powerful drill
motor. SV
PHOTO 6. The stock gearbox
output has an overrunning
clutch to prevent back-driving.
Since this can cause the output to
lock up under some conditions,
it must be disabled by removing
the five pins and outer ring.

PHOTO 5. The DC900KL uses a three-speed


gearbox — for robotics use, the gears must
PHOTO 2. The gearbox (part #629059-00) and motor (part be secured for a single speed. The stock
#639521-00) are shown without the drill casing. They are gearcase (top) uses a set of molded-in teeth
mounted to the casing by the small plastic tabs where the to keep the ring gears (bottom) from turning
motor and gearbox meet. To mount the gearmotor securely when engaged; these have been duplicated in
to a robot, we will make a metal replacement for the stock the magnesium gearcase (right).
plastic gearcase.

PHOTO 8. The completed gearcase, with


motor and gearbox parts installed, is
PHOTO 7. The gearbox output (left) shown here. The parts were made on CNC
uses a simple double-D shaft equipment, but could be made manually
PHOTO 3. The original motor mount is shown on the left, with geometry, duplicated in the hardened, with slight simplifications. The motor,
its twist-lock interface to the gearbox. An alternative mount high-strength shaft on the right. The gearbox, and spare ring gears are
— machined from a block of magnesium — is shown on the step in shaft diameter allows the new available from www.dewaltservicenet.
right. Long bolts will be used to assemble the motor mount gearbox to be protected from impacts com, at a total cost of $110 per
to the new gearcase. by a bronze thrust bearing. motor-gearbox assembly.

30 SERVO 07.2008
CombatZone.qxd 5/29/2008 2:31 PM Page 31

ROBOT PR FILE
TOP RANKED ROBOT THIS MONTH
● by Kevin Berry

Top Ranked Combat Bots Billy Bob – Currently Ranked #1


History Score Ranking

Weight Bot Weight Bot Win/Loss


Win/Loss
Class Class
150 grams VD 26/7 150 grams Micro Drive 7/1
1 pound Dark Pounder 44/5 1 pound Dark Pounder 23/3
1 kg Roadbug 27/10 1 kg Roadbug 11/4
3 pounds 3pd 48/21 3 pounds Limblifter 12/1
6 pounds G.I.R. 17/2 6 pounds G.I.R. 11/2
12 pounds Solaris 42/12 12 pounds Surgical Strike 17/7
15 pounds Humdinger 26/4 15 pounds Humdinger 26/4

Totally
30 pounds
Offensive
43/13 30 pounds Billy Bob 12/4
30 (sport) Bounty Hunter 9/1 30 (sport) Bounty Hunter 9/1
Wedge of
60 pounds
Doom
43/5 60 pounds Texas Heat 11/4 Historical Ranking: #9
120 pounds Devil's Plunger 53/15 120 pounds Touro 10/0 Weight Class: 30 lb Featherweight
220 pounds Sewer Snake 43/12 220 pounds Sewer Snake 11/5
Team: Benson Labs
Builder: Brian Benson
340 pounds SHOVELHEAD 39/15 340 pounds Ziggy 3/0
Location: Winchendon, Massachusetts
390 pounds MidEvil 28/9 390 pounds MidEvil 3/0

History Score is calculated by Current Ranking is calculated by BotRank Data Total Fights Wins Losses
perfomance perfomance at all performance at all known events,
events known to BotRank using data from the last 18 months Lifetime History 16 12 4
Current Record 16 12 4
Rankings as of May 10, 2008 Events 5

● Drive batteries — 21.6 volt A123 ● Radio system — Spectrum DX6


B illy Bob has competed in House
of NERC 2006, Motorama 2007,
RoboGames 2007, Franklin Institute
battery pack
● Future plans — Four-wheel drive
2007, and Motorama 2008. ● Weapon — Custom S7 tool version
Details are: steel single tooth blade at 8,000
RPM ● Design philosophy — Balance the
● Configuration — Vertical Spinner drive, weapon, and armor with
● Weapon power — 24 volt NiCd smart engineering, and make it
● Frame — 2024 milled aluminum 2,400 mAh battery pack cool!
frame
● Weapon motor — Axi 5330 at ● Builders bragging opportunity —
● Drive — Two AstroFlight 940s 24 volts Billy Bob went undefeated at its first
with Team Whyachi gearboxes event. SV
● Weapon ESC — Castle Creations
● Wheels — Two 3.5” Colsons Phoenix HV85
All fight statistics are courtesy of BotRank
● Configuration — Two wheel drive ● Armor — Rubber shock mounted (www.botrank.com) as of May 10,
2008. Event attendance data is courtesy
in the rear steel and a rear titanium wedge, of BotRank and The Builder’s Database
along with various attachments for (www.buildersdb.com) as of May 10,
● Drive ESC — Two IFI Victor 883s other types of bots 2008.

SERVO 07.2008 31
CombatZone.qxd 5/29/2008 2:32 PM Page 32

PARTS IS PARTS:
Mag Mot r Upgrades
and Repairs
● by Nick Martin

I f you rely on the Satcom Mag


motor to deliver a deadly blow or
a punishing push to your robotic
loose, but losing a brush cap during
an event can be a disaster. If your
motors get particularly hot, you
too tall for the counterbores in the
front of the motor, so start by
grinding the heads down by about
opponent, you will want to follow might need high temperature Kapton .016” (0.4 mm).
these simple tips for improved tape, however I have never had a Grinding the heads down also
reliability and performance. problem with the cheap stuff. puts a small burr around the 5/32”
hex socket, making it a tight fit on
Tape the Brush Covers Replace the Case your hex driver. Use the driver to
Screws (beginner) wiggle the screw about until it
The quickest tip is to place elec- starts to thread into a hole; after
trical tape over the four brush covers The long case screws supplied the first screw, this becomes very
(see Figure 1). They don’t often come by Satcom are 10-32 by 3” stainless easy. I like to apply a slathering of
steel with Phillips Loctite 243 to make sure the screws
FIGURE 1. Taped drive heads. These stay put. NOTE: If you have a newer
brush covers and
the timing marks. are not up to heavy four screw motor, one screw is only
combat duty and 2-3/4” long; you will need to cut
should be replaced. one of the replacement screws
I use hex socket down to fit.
cap screws,
McMaster-Carr part Replace the Mounting
#91251A360, for Screws
this; they can be
tightened more The tiny 8-32 face mounting
than the original screws always look inadequate to
screws and the me; if you are mounting the motor
threads are better with these screws, I recommend
formed (Figure 2). up-sizing them to around 12-24 or
The heads of these M6. Start by removing the front
screws are plate of the Mag motor, leaving the
sometimes armature and case in place.

FIGURE 3. Aligning the


mounting holes with a tapered
pin. (Insert: Which screw size
would YOU trust?)

FIGURE 2. Replacement
case screws. (Insert:
The replacements have
far stronger heads.)

32 SERVO 07.2008
CombatZone.qxd 5/29/2008 2:33 PM Page 33

Position the front plate you combine this tip with the just turn the case, rotate the
accurately on your drill press using stronger case screw tip, you will case left until the screws touch a
a tapered pin made from the shank have one tough motor. magnet. Mark the position of your
of an old drill (see Figure 3). This line on the rim of the endbell. Now
will keep the new mounting points Neutral Timing rotate the case left until the screws
accurately in position; important if stop on the opposite magnets.
you have a pre-made gearbox to fit. Mag motors can be timed Mark this position on the endbell
Drill each of the mounting holes slightly advanced or retarded, rim. The marks on the rim represent
out to fit your preferred screw size; although I find that advanced timing the extremes of forward and
5 mm for M6 and #17 for 12-24 makes hardly any difference so I reverse timing; draw a line midway
sized screws. leave them neutrally timed. If you between your two extremes
Tap the new holes and take want to experiment or need to and this is your neutral timing
extra care to remove all the swarf adjust the timing after repairs, here position — too easy! SV
from the inside of the plate; you is the quick way to do it. Mark a line
don’t want conductive chips falling along the case so it meets the rear
into the armature! Re-assemble the end bell, as shown in Figure 1. With You can contact Nick via his build thread at
www.robowars.org/forum/viewtopic.php
motor as detailed in previous tips; if the case screws loosened enough to ?t=74&start=0.

EVENTS
Results and Upcoming Events
Results Apr 14 –
May 12, 2008
Miami Beach, FL. One hundred
thirty-five bots were entered. T he North East Robotics Club will
present House of Benson –
Barnyard Brawl in Winchendon, MA,

H ORD
Spring
2008 was held
R oaming Robots presented
Fenton Manor 2008 on May 4th
in Stoke On Trent, England.
on July 26th. Thirty-six bots were
registered at press time. For more
details, go to www.nerc.us.
in Brecksville,
OH on April Upcoming Events for
19th. Twenty- July-August 2008
five bots were registered.

R otunda Rumble was held at the D . W. Robots will


present
Mall Of America in Minneapolis,
MN on April 25th. Twenty-seven
bots were registered.
Pennsylvania Bot
Blast 2008 in Bloomsburg, PA on
July 12th. Seventeen bots were
R oaming
Robots
will present
registered at press time. For more Guildford
details, go to www.dwrobots. 2008 in
com/tournament.html. Guildford, England on June 15th,
and UK Champs 08/RAF Fairford in

W ar-Bots
Xtreme
Gloucestershire, England on July
12th and 13th. For more details, go

S mackdown in Sactown IV
was held on April 27th in
will present
WBX-V
to www.roamingrobots.co.uk.

Sacramento, CA. Eight bots were


registered.
“Taking the
Fifth” on July
26th in
R oboCore will present Winter
Challenge 4th Edition in
Amparo, Sao Paulo, Brazil on
Saskatoon, July 26th–27th. SV
Saskatchewan, Canada. Nineteen
bots were registered at press time.

B otsIQ: The Competition 2008


was held April 30th–May 4th in
For more details, go to www.war
botsxtreme.com.

SERVO 07.2008 33
Larson.qxd 5/30/2008 12:08 PM Page 34

CES 2008
Robot Roundup
by Ted Larson

Photo 1

Just about every electronic

A
s usual, in the second week of January,
consumer device is
over 100,000 technology lovers converged represented at CES ...
on Las Vegas for the 41st annual
... including car audio, home audio, cell
Consumer Electronics Show (CES). The show phones, DVD players, laptops, digital
went on from 8 AM to 5 PM for four days, and photo and video recorders, and of
course, massive plasma TVs. There was
even then, it was almost impossible to see a 150 inch TV at the Panasonic booth
everything. CES took up 1.8 million square that was the talk of the show. Imagine
a TV as big as a queen-sized bed
feet of trade show space, spanning all of the hanging on your wall? Seems like one
major convention centers in Las Vegas. So much would have to reinforce the wall just to
keep it from falling down.
walking is involved for the attendees, you can Most of the booths that are
technology specific are organized into
easily blow out your feet unless you are wearing Tech Zones, such as USB, ZigBee,
running shoes. Blu-ray Disc, HDMI, Mobile Internet and
WiMAX, IPv6, Sustainable Technologies,
34 SERVO 07.2008
Larson.qxd 5/30/2008 12:08 PM Page 35

CES 2008 Robot Roundup

and finally, Robotics. With just a few exceptions, most of Photo 2


the robots and robot companies were on display in the
Robotics Tech Zone or in nearby booths.
The biggest exhibitor in the Robotics Tech Zone this
year was WowWee (www.wowwee.com). Every year they
seem to have many innovative, new designs and this year
was no exception. The most noteworthy items they brought
out were the Femisapien, Tribot, and Rovio. Femisapien is a
female counterpart for the popular Robosapien. She
dances, poses, and with her 9x degrees of freedom is
capable of 56 interactive functions. They had a nice demo
with three of them line-dancing together (Photo 1). She has
a learning mode where you can pose her and learn
sequences for playback, which seems like endless fun. I
thought the best feature of all was that when brought in
proximity to a Robosapien, she is the boss and tells him
what to do (sounds a bit like my wife). With an MSRP of
$99, I can see her ending up on the desks of many geeks
for fun and show.
Tribot (Photo 2) certainly received the most attention
out of the WowWee group, with the TV crews swarming
around him to get some footage of him doing his demo. I
was really surprised at how much personality he had when
they switched him on. He has animated ears and a pop-top
head, and goes on and on about how great it is that you
rescued him from his packaging when you turn him on for
the first time. He has an omni-wheel, holonomic drive
system which seems to be a new theme for WowWee determine its repetitive position down to 2 cm of accuracy.
robots. Several of their newer products are now sporting The technology is similar to that of Evolution Robotics
omni-wheels, including Rovio. Rovio is a WiFi capable, Northstar system, although Evolution does not need to stick
anything to the ceiling. StarGazer is currently manufactured
as a module you can simply mount in a robot, place the IR
“The biggest exhibitor in the Robotics projectors in the room with the passive landmarks, and you
Tech Zone this year was WowWee ...” are ready to go. They had a nice demonstration of two little
robots navigating around on the floor, avoiding obstacles,
and mapping their positions (Photo 3).
omni-wheeled robot with a camera and navigation Meccano showed their new additions to the Spykee
capabilities. It can be tele-operated over the Internet, (www.spykeeworld.com) robot line-up. All the Meccano
with live streaming video of what it sees. The notable and robots are being sold under the ERECTOR brand as a robot
unique technology item here is that it is using the Evolution
Robotics (www.evolution.com) Northstar 2.0 system
for navigation.
Northstar is like “micro-GPS” for a robot. It uses
constellations of infrared energy beamed onto the ceiling
from a fixed point to determine its location within a room.
Rovio is the first use of this technology in a low-cost,
consumer package and it is quite impressive. One can set
waypoints for Rovio within the room and it easily find its
way back to them, even if the robot is picked up and
moved. At a retail price of $299, it is quite amazing that all
this technology can be packed into such a cool little robot.
Since I am on the topic of indoor positioning, it is a
good time to mention the booth of Hagisonic. Hagisonic
(www.hagisonic.com) is a Korean sensor manufacturer
which makes an indoor positioning system for robots called
StarGazer. StarGazer analyzes the image of an infrared ray
which is reflected from a passive landmark with a unique
ID, mounted on the ceiling. From this landmark, it is able to Photo 3

SERVO 07.2008 35
Larson.qxd 5/30/2008 12:09 PM Page 36

CES 2008 Robot Roundup

Photo 4

Erector set. The four new robots in the line are Spykee Cell, several Spykee Micro kits. I brought two assembled units
Spykee Miss, Spykee Vox, and Spykee Micro, three of which home, and had great fun with my four-year-old daughter
are designed to cradle your iPod, and allow it to be voice having robot races in the hallway with them.
controlled and give it some personality (Photo 4). Spykee About 50 feet from the Robotics Tech Zone was the
Cell can be controlled from your cell phone via Bluetooth iRobot booth. Among all the consumer robots they showed,
and is targeted at both boys and girls. Spykee Miss is an the two that were the standouts were the iRobot Looj
emotional electronic friend targeted at girls that gives you Gutter Cleaning Robot (Photo 5) and the new iRobot
advice when you ask her a question. Spykee Vox is also Roomba 500. The Looj has piqued my interest ever since it
voice controlled, an interactive friend, and can be either a was announced, although I had never seen one in person
hero or a villain. It is targeted primarily at boys. Spykee before. I have heard many rumors about what it can and
Micro is a small, little remote controlled robot that looks cannot do, so I thought I would ask the tough questions,
similar to its larger counterparts, but is primarily just for and see if I could clear some things up. In a nutshell, the
driving around and making noise. Again, all the robots are Looj is a remote controlled robot that is designed to be put
kits — in the spirit of the ERECTOR brand — and some are in a gutter and run up and down to dislodge any debris,
easier to assemble than others. When we were packing up using a rotating rubber agitator. The idea is you climb up
at the end of the show, the Meccano people were looking the ladder to the corner of your house, put the Looj in the
to lighten their load for their trip home, so they gave us gutter, and run it up each gutter section, thus minimizing

Photo 5

Photo 6

36 SERVO 07.2008
Larson.qxd 5/30/2008 12:10 PM Page 37

CES 2008 Robot Roundup

the number of times you have to go up and down the Photo 7


ladder. They had a nice little demo with a piece of roof, a
gutter mounted to it that was filled with plastic leaves, and
they would drive the Looj down it and it would throw the
leaves all over the aisle in front of their booth (Photo 6). It
was great fun to see it go.
After asking many questions, I came up with all the
things it cannot do, to dispel any myth making. It cannot
climb the downspout, you cannot just throw it up on the
roof and let it do the rest, it cannot go around the corners
in your gutters, it is not compatible with ancient gutters,
with weird dimensions, and it won’t do the job all by itself
while you sit down on your lawn with a glass of lemonade.
What it can do, it does very well, and is quite amazing. Its
paddle is capable of blasting through all kinds of gunk in
your gutters, like pine needles, twigs, and sludge. If your
gutters are a standard 2-1/4” size, it is capable of driving
underneath the straps that hold the gutter to the house, robot on ISS, was part of the Hubble Telescope rescue
so you can clean long sections. If your house was perfectly project, and has contributed to some WowWee projects
square, you would only need to ascend and descend the such as RSMedia, Elvis, and RSG products. According to
ladder four times, thus minimizing your risk of life and limb Mike, E3 stands for Education, Entertainment, and Emotion,
by falling off the ladder. It is certainly better than the old which makes it a platform much like a video game. E3 can
method of climbing up there with gloves and a plastic express its emotion through motions (head, arms, body,
scoop, and at only $99 for the base unit, it is cheaper than wheel), light, and multi-media with customized content.
most lawn and garden appliances. It has five login modes: Baby, Teen, House-Keeper, Single,
The iRobot Roomba 500 Series (Photo 7) was there, and Silver. Each mode has its own unique and updatable
driving around a little test carpet that anyone could scatter personality according to the user’s age. E3 has WiFi built in
all kinds of debris on, and it would happily slurp it up. Every so it can be controlled remotely via the Internet and
time I see a new version of the Roomba I think, okay, what through its ad-hoc networking capabilities can be voice
now, seen this before, ho-hum. However, this one has some controlled, or stream or playback live video. It is even
great new features that would make me upgrade. It has capable of doing Sykpe teleconferencing. E3 has a big 5”
anti-tangle technology, that detects if it sucked up a carpet LCD mounted in his chest and runs Windows Mobile
fringe or an electrical cord, and automatically backs it out edition, so he can do many PDA-type functions, as well.
of the beater-brush before continuing along and restarting The retail price range of E3 will be between $1,500-$2,000
to clean. It has upgraded bump switches which give it a and he will be available in the US around November of
lighter touch to keep it from scuffing the baseboard or this year.
furniture. Also, it has a new Virtual Wall, called a Robotis (www.robotis.com) returned to CES again this
Lighthouse, that the robot interacts
with to allow it to be contained to one
room until the room is clean, which
then allows it to move onto the next
room and so on, and so on. So, one
robot can clean multiple rooms, and
know when it has completed them all.
At $349, it is in line with the pricing
of previous Roomba robots, and offers
significant improvements without a
significant increase in price.
Roboware (www.roboware.
com.hk) had a booth in the Tech
Zone, where they were showing off an
impressive looking, three wheeled,
holonomic drive humanoid named E3
(Photo 8). I guess 2008 is the year for
holonomic drive humanoids?!?!
Roboware was founded by Mike Kim,
who previously was one of the
researches on the Canadarm space Photo 8 Photo 9

SERVO 07.2008 37
Larson.qxd 5/30/2008 12:12 PM Page 38

CES 2008 Robot Roundup

year with yet more new imagine he is going to be inexpensive.


things to show, such as OLogic was there with plenty of interesting robots to
an updated version of show (www.ologicinc.com). OLogic is an outsourced
their Bioloid (www. research and development company with a focus on
bioloid.com) educational robotics, that I co-founded with Bob Allen. Of course, we
robot kit, their Dynamixel brought out some balancing robots to demonstrate our
high-performance servo capabilities to design difficult control systems. On the first
line, as well as their new day of the show, we realized we could place one on top of
URIA Robot (Photo 9). another and do a Las Vegas acrobatic act, in true Vegas
The Dynamixel servos style (Photo 10). Needless to say, it always attracted a
are designed specifically crowd and the TV people whenever we stacked them up.
for robotic actuator Dean Kamen, the inventor of many things including the
applications, and are Segway, came by and we were able to snap some photos
networked together using of us with Dean and the balancing robots (Photo 11).
a communications bus NPC Robotics (www.npcrobotics.com) commissioned
such as RS-485 or TTL OLogic to build a robot to demonstrate a device they have
signaling. They are been reselling, called a Ribbon Lift (Photo 12). A Ribbon Lift
powerful, metal geared is a device that takes three stainless steel ribbons rolled up
servos with torque up to on a spool like a tape measure, uses a motor to unwind
64 kg-cm. The Bioloid kits them, and stitchs them together into a self-assembling,
(as well as URIA) are triangular shaped pole. Since we just finished the robot
constructed from these before CES, we brought it out to show off. The robot is
servos. URIA stands for appropriately named “Giraffe” due to its long neck it can
Ubiquitous Robotic extend. The lift mounted in the robot is capable of raising a
Information Assistant, and 50 pound load to 15 feet, and can collapse down into a
is designed as a research spool eight inches high by 20 inches in diameter. It is quite
Photo 10 platform for working amazing to see it unfurl, and some people commented that
with humanoids. It has it seemed like magic, like Ali-Babba’s magic rope trick. We
a fully embedded PC onboard, running Windows XP, with mounted a WiFi camera on the top and had it feeding a
peripherals such as USB, LAN, Camera, VGA, WiFi, and a big plasma display to demonstrate its use for surveillance
microphone. He has a nice big LCD in his chest so you can applications. We are looking forward to building some
see what is going on with the PC. robots using the larger version of the Ribbon Lift that can
Other interesting peripherals include a Passive lift a 500 pound load 25 feet in the air.
Infrared Sensor (PIR) and a six-axis gyro for measuring Two robots I missed at CES this year, but heard about,
motion. The robot stands 22 inches tall and weighs about were robots that showed up for just one day to make a
12 pounds. In comparison to most of the Robo-One type cameo appearance in the Robotics Trends booth (www.
humanoids, he is really, really big. They didn’t give exact roboticstrends.com). They were Pleo (www.pleoworld.
pricing on this monster humanoid, but they were quite com) the Camarasaurus, made by UGOBE, and Zeno the
specific that it is designed for researchers and not the Revolutionary Robotic Friend by Hanson Robotics (www.
hobbyist. With all the servos and PC onboard, I don’t zenosworld.com). It was a bummer I missed them both,
but there was so much
Photo 11 Photo 12 to see, and certainly
one couldn’t see it all.
Hopefully, I will be able
to catch up with them
both next year. SV

Ted Larson is the CEO of


OLogic, Inc., and an active
member in the Home Brew
Robotics Club of Silicon Valley.
OLogic is an embedded
systems research and
development company with
a focus on robotics. OLogic
is currently working with
clients across a wide spectrum
of application domains such
as consumer electronics,
toys, medical products, and
education (www.ologic
inc.com).

38 SERVO 07.2008
Doerr.qxd 6/3/2008 1:08 PM Page 39

by Robert Doerr

One of the joys of the robotics hobby is mastering the art of interfacing. A lot of the parts are
already in front of us and we just need to make them work together. Recently, I ran into a
problem with a pair of quadrature encoders for the drive train on one of my robots. The
encoders themselves worked fine and were generating perfect quadrature outputs. However,
they were sending out data faster than the controller could handle at higher speeds. As a
result, the encoder readings were worthless and could not be trusted.

G etting a valid lower resolution reading of the encoder


is certainly better than high resolution unreliable data.
I needed to know how far the motors really moved but
the counts started going backwards! As it sped up some
more, it counted forward again. This cycle continued back
and forth a bit and then the counts were completely erratic.
didn’t necessarily need to know with as high of a resolution It appears that the encoder was exceeding the polling time
as the encoders were providing. So, the task at hand was used by the controller and would start missing pulses at
a way to lower the resolution enough so that I could higher speeds. Obviously, the encoders were not matched
always count on the readings and help keep track of the up well with the controller. I’ve seen this happen with my
movements. A bit of encoder resolution may be lost but it robot drive base and also when I was using some salvaged
should still be close enough for this particular project. encoders from HP scanners and DeskJet printers. Whenever
you see symptoms like this, it should throw up a red flag and
Symptoms of the Problem make you take a look to see if this may be the problem.

I was watching the Encoder processor board (component side). Encoder processor board (solder side).
encoder counts while running
some robot drive motors.
During the initial bench
testing, the motors weren’t
running at full speed and the
results I saw were just as
expected. However, things
got interesting when I started
ramping up the speed. A very
peculiar thing started happen-
ing. The encoder counts
started to rise as expected
but as the motors sped up,
SERVO 07.2008 39
Doerr.qxd 6/3/2008 1:10 PM Page 40

Methods of Correcting the single SX28 chip which costs under $3. A few more
Problem features were then added and the code cleaned up to
make it more presentable.
There are a few different methods of fixing this One of the extra features is the ability to allow a host
problem. In a nutshell, we just need to reduce the number controller to change the scaling factor on the fly. Since it
of transitions of the encoder per revolution. Obviously, the will accept commands via serial connection, I also added a
encoder itself could be swapped out with a lower resolution resonator for the clock timing to ensure the serial communi-
one. If feasible, it may be possible to replace just the cations would be reliable. This microcontroller will be
encoder disk with one that has a fewer number of holes. installed in between the existing encoder and the controller.
Another option is to change the physical placement of the This way, it can monitor the encoder, condition the signal,
encoder within the drive train. When it is directly attached and output a virtual encoder signal to the host controller.
to the armature of the motor, it may send out too many
pulses. If it was moved downstream to the wheels Quadrature Encoders 101
themselves or at some point in the gear train, it would slow
down the speed of the encoder. It will still be sending the Many of you already know how tachometers and
same number of pulses per revolution of the encoder but it quadrature encoders work, but for those who don’t, here is
will be rotating slower so we get the effect we’re after. a quick review. A tachometer signal only has one signal and
Instead of altering the mechanics of the encoder — which therefore only provides speed information and not any
isn’t always an option — we can look into electronic means directional information. It will only tell how fast something
of scaling the values. At first, I considered making something moved but not any details about the direction of travel. It
up with standard logic ICs but an easier and more flexible can be used to get an estimate on distance traveled as long
option was to use a small microcontroller to help match up as the direction is known ahead of time. However, a problem
the readings. Whatever method is selected, we would like can come up if the tachometer stops at a transition (edge).
the encoder to supply as high as possible a resolution If there are any vibrations, it can toggle state back and forth
without sending them too fast for the controller to handle. and mistakenly give the impression that it is moving. It is
more suited to regulate the speed of a motor where distance
Microcontroller to the Rescue /direction are not important; just the speed is critical.
Adding a second channel makes all the difference! A
I’ve run into this problem with other encoders and quadrature sensor will have two signals 90 degrees out of
controllers. I wanted a flexible solution so I decided to use a phase. These two signals are commonly referred to as
small microcontroller to scale the encoder readings. This Channel A and Channel B. With these, both position and
ended up being an excellent solution that can be used for direction can be determined. The direction is determined by
other projects, as well. I selected an SX28 processor and comparing if Channel A is leading Channel B or if Channel
wrote all the code in SX/B. This development went really B leads Channel A. The distance can be computed by
fast. I started building the encoder scaling board one keeping track of the counts and factoring in the direction
evening and had a working prototype with the core of movement. Velocity can be calculated by counting the
functionality the next day. Everything is handled by the number of pulses per second. I’ve seen some references to
encoders that state: “If A leads B, for example, the disk is
Encoder assembly on robot base. rotating in a clockwise direction. If B leads A, then the disk
is rotating in a counter-clockwise direction.”
That may be true for some encoders, but needs to be
verified for the particular encoder being used. I prefer to
just think of them as two channels of information and look
at which one is leading, then match that to the actual
direction of how it is installed in the robot. The clockwise/
counter-clockwise description isn’t something that lends
itself well to straight quadrature encoders, so keeping it
generic works out well. After all, it shouldn’t matter if it is
clockwise/counter-clockwise, right/left, up/down,
forward/back, etc. The important part is that two distinct
directions can be determined; the rest is relative.
Look at the examples of output from quadrature
encoder, through a few cycles.

Chan A 0 1 1 0 0 1 1 0 0 1 1 0
Chan B 0 0 1 1 0 0 1 1 0 0 1 1
40 SERVO 07.2008
Doerr.qxd 6/3/2008 1:11 PM Page 41

Schematic of encoder processor board.

Notice that if you follow the chart from left to right values from the encoder to host as they are. After all, any
and then from right to left you’ll see that one channel will number divided by 1 is the same number. For any other
lead the other and that is what can be used to determine value (2-15), the encoder reading will be scaled by that
direction. amount. In other words, if we have a DIP switch setting of
3, then it takes three transitions of the real encoder to
How the Encoder Scaling make one transition of our virtual one on the output of the
Program Works SX28. A setting of 15 means it would require 15 transitions
of the real encoder to make one transition of our virtual
Using a microcontroller really makes this solution one. The scaling factor goes like this:
flexible. As a starting point for this program, I used the
example in the SX/B help file for reading an encoder and DIP Switch Description
displaying it on a set of seven-segment displays. Since no 0 Encoders off
display is involved, all code relating to the display was 1 Encoders passed as-is to host
removed. The remaining code to watch an encoder became 2-15 Encoder scaled down by number specified
the basis to build upon. Instead of just incrementing and
decrementing a counter for the encoder, we just need to There are also two DIP switches used to specify the
keep track of a small count which ends up being the direction of the encoders. This is useful if the encoder is
number we’re scaling the encoder value by. This will then going in the wrong direction. Instead of swapping any of
be used to walk up and down the virtual Channel A and the wiring for Channels A and B, the DIP switch for that
Channel B of our scaled encoder output. Whenever we encoder can be flipped to correct the direction. This feature
rollover our count of the scale factor, we then update was easy to implement and makes this an even more
(either up or down) the count of our virtual encoder on flexible gadget.
the output. All of the heavy lifting is done in the ISR (interrupt
Upon start-up, the program does a bit of housekeep- service routine). The main program looks for commands
ing. It will check the status of four DIP switches to get the coming in from the serial port to either change the scaling
initial scaling factor. If the scaling factor is 0, then no factor or reset it to the ones specified by the DIP switches.
encoder processing occurs and nothing gets passed to the When looking at the source code in the ISR, we can
host. It made sense because micros don’t like dividing by focus on half of it since the code for the second encoder is
zero. This can be useful, more for troubleshooting, though. exactly the same with the exception of the pins used to
If the scaling factor is 1, then we end up just passing the watch the encoder and the output pins of the virtual one.
SERVO 07.2008 41
Doerr.qxd 6/3/2008 1:12 PM Page 42

A Look Into the ISR the XOR’d value with a DIP switch. This way, if the encoder
is going the wrong way, a flip of a switch will correct it! No
The initial ISR code deals with receiving serial data in the wiring changes or coding changes will be required.
background and buffering it. After that code is done, the
first thing that is checked is the scaling factor. If the scaling Awh, You Count Funny
factor is 0, then nothing needs to be done and we just exit
the ISR. Otherwise, we call the code to check and process Whenever we decrement our counter so it rolls over or
the encoders. There are a couple of important points here. increment it past our scaling factor, we need to update our
First, whenever you put code within an ISR routine you virtual encoder values on the output. When I did this, it was
must make sure there is enough time to execute the code. late and I just updated a simple counter from 0-3 and sent
It must all run within the ISR interval allocated to the ISR that value out as the scaled value. When I tested it, the
routine. If you have too many instructions in there, you’ll encoder output would only change by one up or down but
have to find ways to optimize your code or make the interval that was it. Upon looking at the code, I realized what I had
longer so that you can execute more instructions in the ISR. done. I forgot about counting funny. At least that is what my
In the program presented here, it may seem odd to see kids would say. Instead of counting 0, 1, 2, 3, the proper
a GOSUB within the ISR. The code that is called still count was more like 0, 1, 3, 2, etc. This was due to the
executes within the ISR but needs to be moved to another gray encoding where only one bit can change status at a
bank of memory due to the way SX/B structures the time. This was easily fixed by using my counter as the index
compiled program. By moving things around, it resolved an for a LOOKUP command. This would then take the value that
SX/B error on Pass 2. “Address xxx is not within lower half was looked up and present that at the output. This results in
of memory page.” I’ve had good results with SX/B so far, the correct gray code as the output for our virtual encoder.
and when errors like this crop up they can often be resolved The processing of the second encoder is identical. It
by re-organizing some of your program. starts out slightly different, however, because the second
The code to process the encoder starts out by reading the encoder is on a different set of pins. To accommodate that,
current value of the encoder port and masking off the bits so it has a slightly different mask of %00001100 to isolate the
that the current states of Channel A and Channel B on the two bits we need. Those two bits are then shifted right two
first encoder are used. Then, this value is XOR’d with the bits which will put them in the proper position so all the
previous encoder state. If there is no change in state, then the calculations are the same as for the first encoder. The result
value will be zero and we end up dropping down to check is then presented to the host controller on a separate set of
the next encoder. If there was a change of state, then we pins for the second virtual encoder.
need to figure out what the direction of the change was.
This is again accomplished with our friendly XOR instruction. The Extras
In this case, we shift over the old state by one bit before
performing the XOR. We just need to compare bit 0 of one Whenever I have leftover pins available on a microcon-
channel to bit 1 of the other. It doesn’t matter which one you troller, I always seem to find a use for them. One of the
use as the base, as long as you understand that using the features I wanted to add is the ability to alter the scaling
opposite set of bits will switch the direction of the encoder. factor on the fly. To accommodate this, one pin is used to
In the original program, it would see if the result from the receive serial data from the host controller. The command
XOR operation was 1 which would specify to decrement structure follows the AppMod style for compatibility with
the counter. A 0 would then mean the counter should be other modules. The header is “!ES” for Encoder Scaler
incremented. Instead of using a hard coded value, it compares followed by an address 0-3 and then the command. The
address must match those selected
High resolution encoder disk. HP encoder assembly. by a pair of jumpers connected to
RC6 and RC7. If the address
doesn’t match, it will ignore the
command and wait until something
is directed toward it. The exception
is an address of 255 which would
broadcast out to all the modules of
this type, regardless of their config-
ured address. At the moment, there
are only two commands supported.
The command “S” is a scale value
followed by a binary number 0-63.
Anything higher than this gets
limited to the highest scaling factor
42 SERVO 07.2008
Doerr.qxd 6/4/2008 5:24 PM Page 43

of 63. This new scale value


overrides whatever value was WEB REFERENCES
used at start-up from the DIP RobotWorkshop (Author’s website)
switches. This is useful if a www.robotworkshop.com
higher scaling factor is needed SX28 series processors
than what’s available on the Offers free software development tools like SX/B
DIP switch or for changing the www.parallax.com
scaling factor on the fly. The Online user forum for the SX series of microcontrollers
“R” command will reset scale http://forums.parallax.com/forums/
value to the one specified by
the DIP switch setting. In a Wikipedia article on encoders
http://en.wikipedia.org/wiki/Rotary_encoder
future version, a couple more
commands may be added to Dual I/R sensor with National Instruments article on encoders
return a version number to linear encoder. http://zone.ni.com/devzone/cda/tut/p/id/4763
the host and also one for
returning the current scaling factor. this encoder processor to help address a problem with the
data from a set of encoders. With the addition of this
Conclusion encoder scaling processor, some encoders can now be used
for controlled closed loop movements at any speed. This
Adding an extra microcontroller to offload tasks can help allows the encoders and host controller to work well
make the overall programming of the robot easier by letting together. There are multiple ways of accomplishing the
the main controller focus on higher level tasks. They are also same goals and using a microcontroller made sense for this
useful to handle odd interfacing and protocol issues that particular project. Keep those robots alive! SV
come up. One example is the speech translation device
covered in the December ‘07 issue of SERVO. Another is Robert Doerr can be reached via email at rdoerr@bizserve.com.

s Co Mot
r
ete
s or xis erom
3-A cel ntr or
n
Se
Ac 9.95
$1 oll
ers

R
QT ce 4.9
5
n $1
ct .49
a
e fle r $3 y
rra !
R so TReX Jr
Se
n o
s n
en -se
r A sing Robot Controllers Dual Motor
e S l ine Controller:
c r voltage dual H-bridge Instantly switches
tan fo
f l ec reat regulator trimmer pot between radio control
Re G (on ADC7) (RC) or analog voltage and
R
QT power LED asynchronous serial (RS-232
(green) or TTL), plus a multitude of
Solder Paste Stencils red user LED
additional features. $59.95
Use our low-cost
solder paste stencils
From $25 (on PD1)
programming
to quickly assemble
your surface-mount
ATmega48/168
microcontroller
connector Custom Laser Cutting
designs. 20 MHz clock From $25
Baby Orangutan B-48 and B-168
starting at $24.95

Cut your own custom


Find out more at www.pololu.com or by calling 1-877-7-POLOLU. chassis, front panels, and more!
SERVO 07.2008 43
Eady.qxd 6/4/2008 9:51 AM Page 44

by Fred Eady

There are times when a standard hobby servo just won’t do the job.
The same goes for small DC motors. Sometimes parts of aluminum
humans require a bit more torque than servos and low-load DC
motors can provide. In these cases, a hefty DC motor fills the bill.
However, a meaty DC motor needs a beefy DC motor driver.
Fortunately, there is inexpensive and easy
to use DC motor driver technology that is
available to us that will drive heavy iron.
his month, we’ll pull together what it takes to design, The BDPG-60-110’s maximum diameter at the motor cylinder
T build, and code a heavy duty DC motor driver module.
First, we’ll look at the electrical theory behind the DC motor
is 2.36 inches.
The BDPG-60-110’s name tells much of its story. All of
driver electronics. Then, we’ll build up the DC motor driver the planetary gear motors in the BDPG-60-110-24V-3000-
module’s “intelligence” and meld it with the DC motor R326’s class share the same part number including the “R.”
driver’s “brawn.” If all of that passes the smoke test, we’ll The numbers that follow the R provide us with more
code a simple RS-232 interface, which will allow you to information about the planetary gearmotor. The R326 is
control the big DC motor with simple serial commands. the most powerful gearmotor in the bunch as it can provide
The DC motor driver IC of choice for this project is the 4,166 ounce-inches of continuous torque. The BDPG-60-110
Allegro MicroSystems A3959. The A3959 is a DMOS Full- can peak at twice the amount of continuous torque. The
Bridge PWM Motor Driver IC. Before we begin our DC motor 326 also tells us what the gear ratio is. In our case, the
driver IC walk-thru, let’s take a look at the problem at hand. BDPG-60-110-24V-3000-R326 has a gear ratio of 326:1. At
326:1, the BDPG-60-110 rotates its shaft at a brisk 9.2 RPM
Big Mama Gearmotor unloaded. If you work the gearmotor, the shaft rotation will
fall to a loaded value of 7.7 RPM. Those RPM figures may
The behemoth you see in Photo 1 is an Anaheim seem too low to perform any real work. However, when
Automation BDPG-60-110-24V- you add external gearing to the
3000-R326 DC brush planetary BDPG-60-110, I can assure you
gearmotor. This motor is really that heavy loads will move about
not a “problem.” It’s actually our relatively quickly. The 3000
project design point. The BDPG- number in the BDPG-60-110’s
60-110 weighs in at four pounds, part number is the speed of the
10 ounces. From shaft to tail, the motor before the gearbox.
BDPG-60-110-24V-3000-R326 I initially gave you the
measures in at 8.08 inches. The BDPG-60-110-24V-3000-R326’s
planetary gear section is 2.65 dimensions in terms of inches.
inches in length while the shaft However, in reality the BDPG-60-
adds 1.10 inches to the overall PHOTO 1. This is one heavy 110 likes to be described
length. The actual motor cylinder duty motor all packed up in metrically. The body diameter is
comes in at 4.33 inches in length. a relatively tiny package. called out in the part number as
44 SERVO 07.2008
Eady.qxd 6/4/2008 9:52 AM Page 45

60 mm. The motor cylinder length PHOTO 2. This is a shot of the “brawn”
is also part of the part number of our DC motor driver. Before
we’re done, we’ll add homebrewed
and is specified as 110 mm. intelligence to this picture.
The 24V in the part number
calls out a 24 VDC gearmotor I have also freed the magic smoke
operating voltage. By the way, of many a power supply compo-
BDPG = Brushed DC Planetary nent in my years of working with
Gearmotor. Now that we know electronics. The A3959 relies on a
all about what our “problem” is, charge pump to help keep its
let’s move to the next step and internal H-bridge conducting and
learn about our “problem solver.” the motor shaft turning. To
provide a measure of safety when
The Allegro it comes to the power source,
MicroSystems the A3959 monitors the supply
voltage and the charge pump
A3959 voltage for undervoltage condi-
I’m experimenting with the tions. When a problem occurs,
BDPG-60-110-24V-3000-R326 and the A3959 goes into shutdown
likewise with the A3959. So, and disables the H-bridge drivers.
instead of building up a Okay, we’ve read the sticker
professional printed circuit board on the A3959 window. Now, let’s
(PCB) in the dark, I decided to base the initial tests on kick the tires and open the trunk and look under the hood.
official Allegro MicroSystems A3959 electronics. We will be I’ll add some important detail to Figure 1 as we walk around
working with the hardware you see in Photo 2. Before I the A3959. Since the A3959 is in a DIP configuration on our
describe the Photo 2 basic circuitry to you, let’s take a close A3959 demonstration board, all of our references to its pin
look at the A3959 itself. locations will be based on the DIP package from here on out.
The A3959 in many ways is a pumped-up A3979. Recall The A3959 SLEEP function is controlled by pin 22. Just
that the A3979 output current is limited to ±2.5 amperes with because the A3959 handles monstrous motor winding
a maximum motor voltage of +35 VDC. The A3959 doesn’t currents doesn’t mean it can’t be included in a low-power
contain all of the A3979’s internal logic as the A3979 is application. By driving the A3959 SLEEP pin logically low,
designed to drive stepper motors. However, the A3959’s we command it to enter SLEEP mode. The majority of the
power grid is much heftier than the A3979’s. The A3959 is A3959’s internal circuitry including the regulator and charge
designed to drive DC brush motors at voltages up to +50 VDC. pump will be disabled while it sleeps. If we choose not to
The maximum current capability of the A3959 is ±3.0 amperes. employ SLEEP mode in our application, we must drive the
Like the A3979, the A3959 is capable of controlling its A3959’s SLEEP pin logically high using a 4.7K pullup resistor.
attached DC brush motor using pulse width modulation To understand the functionality offered by the EXT
(PWM). And again, like the A3979, the A3959 can be com- MODE pin — which happens to be pin 15 of our A3959 —
manded to operate in slow, fast, and mixed
current-decay modes. The current-decay modes all
work in conjunction with the A3959 internal fixed
off-time PWM current-control timing circuitry.
I’ve used a bunch of motor control ICs. I’ve
also released my share of motor control IC magic
smoke. To help avoid the release of the A3959’s
magic smoke, its designers have outfitted the
A3959 with internal circuit protection. If the
A3959 gets a bit too hot under the collar (165°
C), it will shut itself down. To avoid hiccupping
on and off as it cools off, a bit of hysteresis is
built into the thermal shutdown protection.
In the course of building custom motor drivers,
one also has to build a suitable power supply
for the motor and the motor driver electronics.

FIGURE 1. Once you understand what the A3959


is and what it can do for us, this figure doesn’t
seem that busy anymore.
SERVO 07.2008 45
Eady.qxd 6/4/2008 9:53 AM Page 46

we must first have a firm grasp on the ENABLE pin. If we External Slow Decay Mode is invoked and both of the sink
wanted to control the speed of a motor, we would feed the drivers are activated during the chopped cycle.
PWM speed control signal into pin 10 (ENABLE) of the A3959. All of the switching of the H-bridge source and sink
When the incoming ENABLE PWM signal swings logically drivers generates current spikes. The A3959 contains
high, the A3959’s selected H-bridge sink and source pair are circuitry to synchronize the activation of the source and
activated. The H-bridge sink and source pair is selected with sink drivers versus the current drawn through the motor
the logic level present on the PHASE pin. The A3959 PHASE winding. A current spike could erroneously reset the source-
input is located on pin 3. By driving the PHASE pin logically enable latch. To filter out the current spikes, the A3959
high or logically low, we select alternate sink and source simply ignores its motor winding current sensing circuitry
H-bridge DMOS pairs and dictate the rotational direction of for a period of time when the spikes are known to occur.
the motor shaft. Driving the ENABLE input logically low will Driving the BLANK pin logically high provides twice the
switch off the source driver or both the source and sink blanking (ignoring) time of driving the BLANK pin logically
driver depending on the logic present at the EXT MODE pin. low. The BLANK timing is set via the A3959’s pin 12.
When the ENABLE pin is at a logically low level, this is How much BLANK time is twice as much? Well, that all
called the chopped cycle. The EXT MODE input logic depends on what we hang off of the A3959’s ROSC pin.
determines the current path during the chopped cycle. The datasheet recommends an internal oscillator frequency
For instance, when EXT MODE is driven logically low, the of 4 MHz. To utilize the services of ROSC, we simply hang a
opposite pair of selected drivers will be enabled during the resistor from pin 4 to VDD. Here’s how we come up with
chopped cycle. This is called External Fast Decay Mode. the 51K ROSC resistor value you see in Schematic 1 that
Conversely, when the EXT MODE pin is driven logically high, provides the basis for the 4 MHz clock:

+5VDC SCHEMATIC 1. The PIC18F4620 is


ICSP CONNECTOR
underutilized here and that’s a
6 3
R3
10K
C2
.1uF VBB
good thing. That leaves you with
5
6
5
3
2 2 LED1 lots of I/O and memory resources
4 4 1 1
for your motor application.
C1 C8 47uF
R1 .1uF
100
+

C9

R2 1K .1uF

+5VDC

C6 10uF
+

R6 R7 C7
51K 4.7K C10
U1 .22uF C11 .22uF
1 *MCLR RB7 40
2 39 .22uF
RA0 RB6 U2
3 38
20

24

RA1 RB5
9

4 RA2 RB4 37
5 36 22 C12 .22uF
VBB

VCP

CP1

CP2
VDD

RA3 RB3 SLEEP


6 RA4 RB2 35 4 ROSC VREG 23
7 RA5 RB1 34
8 RE0 RB0 33 3 PHASE
9 32 10 MT1
+5VDC RE1 VDD ENABLE MOTOR DC
10 RE2 VSS 31 OUTA 16
11 30 C4 12 21
C3 VDD RD7 .1uF BLANK A3959SB OUTB
12 VSS RD6 29
LED2 13 28 13
.1uF OSC1 RD5 PFD1
14 OSC2 RD4 27 11 PFD2 SENSE 17
15 RC0 RC7 26
16 RC1 RC6 25 15 MODE
17 24
GND
GND
GND
GND
GND
GND

RC2 RC5 +5VDC


18 RC3 RC4 23 14 REF
19 22 C13 R8
RD0 RD3
20 RD1 RD2 21
18
19

R4 .1uF .1
5
6
7
8

PIC18F4620 13K

P1
C5
.1uF R5 5
5.6K 9
4
8
U3 3
7
2 T1IN T1OUT 5 2
1 T2IN T2OUT 18 6
3 R1OUT R1IN 4 1
20 R2OUT R2IN 19

12 DB9 FEMALE
V-
V- 17
C2+ 11
NOTES: 15
C2+
1. LED1 AND LED2 - MOUSER 606-4302F5-5V C2- 16
2. SP233ACP 20-PIN DIP C2- 10
+5VDC
VCC 7

C14
6 .1uF
GND
GND 9

SP233ACP

46 SERVO 07.2008
Eady.qxd 6/4/2008 9:53 AM Page 47

fOSC = 204 x 109 / ROSC also require a 0.22 μF capacitor connected between them
4 MHz = 204 x 109 / ROSC to assist in the charge pump operation. The charge pump
ROSC = 204 x 109 / 4 MHz generates a gate supply voltage that is greater than the VBB
ROSC = 51K motor winding supply voltage. The gate supply voltage
drives the A3959’s H-bridge source drivers. Another 0.22 μF
Applying our clock frequency to the BLANK pin logic capacitor is tied from the CP pin to ground to act as a
level results in the following: reservoir for the H-bridge source drivers. CP1 and CP2 are
represented as pins 2 and 1, respectively, on the A3959 DIP
When BLANK = 0 tblank = 6/fOSC package. CP functionality can be found at pin 24. Access to
When BLANK = 1 tblank = 12/fOSC the motor winding voltage input (VBB) is at pin 20.
A3959 load current regulation is a function of the internal
I’ll let you do the BLANK math. Recall that I mentioned fixed off-time PWM control circuit working in conjunction
earlier that the A3959 used internal fixed off-time PWM with the external sense resistor, which hangs from the SENSE
current-control timing circuitry. Well, now that we know pin. When the OUTA and OUTB outputs (pins 16 and 21,
what the internal oscillator is doing, we can compute the respectively) are activated, current flows through the motor
fixed off-time interval. The A3959 is factory set for a fixed winding. The motor winding current increases until it reaches
off-time of 96 cycles of the internal oscillator. That comes to: a predetermined trip value. The current trip value is a direct
product of the value of the external sense resistor and the
Fixed off-time = 96 x (1 / 4 MHz) = 24 μs voltage applied to the VREF pin. The A3959’s sense comparator
resets the source-enable latch when the current trip point is
The PFDx pins control the function of the A3959’s reached. As a result, the H-bridge source driver is deactivated.
Internal Current-Control Mode. Those switching spikes we Recall that we use blanking to prevent the source-enable latch
just discussed are detected at the SENSE pin. The SENSE from being reset at the wrong time by a current spike. Once
input is responsible for monitoring the motor winding current the source driver is turned off, the motor winding current
and feeding that information into the A3959’s internal current recirculates for a time equal to the fixed off-time interval.
sensing/control circuitry. When an overcurrent event is During the recirculation time, the logic levels at the PFDx pins
detected at the A3959’s SENSE pin (pin 17), the selected determine which internal current-decay mode (slow, fast, mixed)
internal current-decay method is invoked. The internal current- is invoked. The current trip value is calculated as follows:
decay method is determined by the logic levels of pins 13 and
11, which are PFD1 and PFD2, respectively. We already know ITRIP = VREF / 10RSENSE
what the internal current-decay modes are. So, applying
logical low levels to both of the PFDx pins selects slow decay Let’s calculate the ITRIP value from the values you see in
mode. Conversely, when both PFDx pins are driven logically Schematic 1:
high, we have selected fast decay mode. In slow decay mode,
both of the A3959 H-bridge sink drivers are turned on for Using good old Ohm’s Law against the VREF pin:
the entire fixed off-time, which we computed as 24 μs. Where VDD = +5 VDC
A combination of logic inputs on the PFDx pins provides I=E/R
us with two mixed decay mode selections. Driving PFD1 I = 5 / 18.6K
logically high and PFD2 logically low will invoke fast decay I = 268.8 μA
mode for 15% of the fixed off-time with slow decay taking
up the rest of the fixed off-time interval. Driving PFD1 Voltage at VREF = 268.8 μA x 5.6K = 1.505 Volts
logically low while driving PFD2 logically high will produce
fast decay mode for 48% of the fixed off-time and slow ITRIP = 1.505 x (10 x 0.1) = 1.505 amperes
decay mode for the remaining 52% of the fixed off-time
interval. We can crank up ITRIP if we want to as our BDPG-60-
If this all seems a bit too much on the theory side, don’t 110 can eat 2.2 amperes of current. What we have is fine
worry. We’ll have total program control over all of the A3959’s for now. In the process of computing ITRIP, we covered the
inputs. That way, we can experiment with the logic levels only pin of the A3959 we have not yet addressed: VDD. Pin
until we find a combination that suits the BDPG-60-110. 9 needs to be sourced with +5 VDC.
If you had the opportunity to check out my SERVO A3979 The A3959 DIP package is 24 pins deep. So, that leaves
article, you already know about the A3959’s VREG pin and the a total of six pins we haven’t covered thus far. We can end
A3959’s charge pump as their functionality across devices is our A3959 walk-around right here as the remaining six pins
identical. We need only hang a 0.22 μF capacitor from the are all GROUND pins. Any internal heat that is generated is
VREG pin (pin 23) to ground. The voltage associated with VREG dissipated through pins 6,7,18, and 19, which should be
is generated internally and is used to operate the A3959’s directly attached to a heatsink pad.
H-bridge sink drivers. The charge pump pins, CP1 and CP2, The circuit for the A3959 motor driver is already laid
SERVO 07.2008 47
Eady.qxd 6/4/2008 9:54 AM Page 48

down for us on the demonstration board. So, let’s build up The names I’ve assigned to the PIC18F4620 PORTB I/O
our A3959 controller. pins should be very familiar to you. It would be nice if we
reduced the complexity of the PFDx selections, as well:
PICing an A3959 Motor Driver #define decay_slow PFD1 = 0; \
Controller PFD2 = 0;
#define decay_mixed_15 PFD1 = 1; \
I’ve chosen the PIC18F4620 to perform the A3959 PFD2 = 0;
controller duty. If you’ve ever designed with a PIC micro- #define decay_mixed_48 PFD1 = 0; \
PFD2 = 1;
controller, there’s nothing new for you here. In fact, the PIC #define decay_fast PFD1 = 1; \
controller hardware is so easy, I could simply tell you to look PFD2 = 1;
the circuit over in Schematic 1 and be done with it. As you
can see in Photo 3, the PIC hardware is so simple, I Using C macros to put human-readable names on the
hand-wired the PIC A3959 controller circuit on a perfboard. PFDx selections will make life a bit easier if you want to
I elected to leave the SLEEP pin alone and tie it to an experiment with the PDFx settings. The same holds true for
inactive state. I also chose to use the lesser PWM Blank the EXT MODE selections as well:
time (6 / fOSC ) by tying the BLANK pin to ground.
#define ext_mode_fast MODE = 0
There are plenty of I/O pins to spare. So, if you want to #define ext_mode_slow MODE = 1
experiment with the control lines I’ve chosen to logically tie
to a static state, don’t be afraid to hook up the SLEEP and The reason we are here is to turn the BDPG-60-110
BLANK control lines to the PIC. If you use my existing motor shaft. So, it would be fitting to put together some
control line code as an example, you won’t have any motion macros:
problems coding in the extra control lines.
The real work involved with building up an A3959 #define CW 1
motor driver controller is in the firmware. With that, let’s #define CCW 0
begin our firmware build by associating the A3959 control #define motion_CW ENABLE = 1; \
pins with their PIC18F4620 counterparts: PHASE = CW;

#define motion_CCW ENABLE = 1; \


//******************************************************* PHASE = CCW;
//* A3959 PIN DEFINITIONS
//******************************************************* #define motion_HALT ENABLE = 0;
#define PFD1 LATB0
#define PFD2 LATB1
#define ENABLE LATB2
Note the use of the A3959 ENABLE pin to start and stop
#define PHASE LATB3 the BDPG-60-110-24V-3000-R326. When you run your motor,
#define MODE LATB4 remember that clockwise and counter-clockwise rotation is
determined depending on how you attached the motor leads
to the A3959 OUTx pins. These CW and CCW settings worked
for me. The PHASE logic swaps the polarity of the OUTx pins.
If your CW and CCW directions are opposite of mine
here, it’s much easier to simply swap the motor leads than
recompile and reload the PIC18F4620.
With all of our A3959-to-PIC18F4620 definitions and
associations complete, we can add this bit of code at the
end of our initialization routine:

//*******************************************************
//* INITIALIZE A3959 MOTOR DRIVER HARDWARE
//*******************************************************
decay_mixed_15; // PFD1 = 1 - PFD2 = 0
ext_mode_fast; // MODE = 0
motion_HALT; // ENABLE = 0

I promised that we would also write some PIC firmware


PHOTO 3. It doesn’t get that would allow us to control the BDPG-60-110 through
much better than this. the A3959 controller’s serial port. I have coded up all of the
I’ve taken to powering necessary EUSART firmware for the PIC18F4620. You can
small PIC projects like
this from a PC USB port. see what I’ve done with the PIC18F4620’s EUSART by
downloading the A3959 driver firmware from the SERVO
48 SERVO 07.2008
Eady.qxd 6/4/2008 9:55 AM Page 49

website at www.servomagazine.com. Here’s the code


that will put the menu up in a terminal emulator window: SOURCES
void show_menu(void)
Allegro MicroSystems — www.allegromicro.com
{ A3959
cls(); A3959 Demonstration Board
cls();
printf(“%c[2;4H SERVO A3959 MOTOR CONTROL Microchip — www.microchip.com
MENU”,esc); PIC18F4620
printf(“%c[5;7H F - ROTATE CW”,esc);
printf(“%c[6;7H R - ROTATE CCW”,esc);
printf(“%c[7;7H S - STOP”,esc); HI-TECH Software — www.htsoft.com
} HI-TECH PICC-18 C Compiler

Entering an F, an R, or an S invokes the main routine code, Anaheim Automation — www.anaheimautomation.com


which is looping continuously: BDPG-60-110-24V-3000-R326

//******************************************************* motor driver application, be sure to solder the A3959 directly


//* MAIN SERVICE LOOP
//******************************************************* to the PCB. The A3959 tabs need to be soldered to a
show_menu(); copper heatsink area provided on the PCB. Give the
do{ heatsink area as much of the PCB’s copper as you can.
if(CharInQueue())
{ The download package firmware was written using the
bytein = recvchar(); HI-TECH PICC-18 C compiler and contains lots of goodies
switch(toupper(bytein)) you can use in other projects, such as timer manipulation
{
case ‘F’:
routines, timer interrupt handlers, serial communication
motion_HALT; routines, and serial communications interrupt handlers. The
mdelay1(100); A3959 is a really robust and easy to use part. I have no
motion_CW; doubt you’ll have your aluminum human doing some heavy
break;
case ‘R’: lifting in no time flat. See you next time! SV
motion_HALT;
mdelay1(100); Fred Eady can be reached via email at fred@edtp.com.
motion_CCW;
break;
case ‘S’:
motion_HALT;
break;
}
}
}while(1);

The CharInQueue() function informs the main routine


that a character is waiting in the EUSART’s external buffer.
When a character arrives from the personal computer, we
retrieve it from the external buffer and parse it. If the
character is an F, we stop the BDPG-60-110-24V-3000-R326,
wait for 100 ms and rotate the BDPG-60-110’s shaft in the
clockwise direction. An incoming “R” stops the motor, waits
for 100 ms, and forces the BDPG-60-110’s motor shaft to
rotate in the counterclockwise direction. To stop the motor
shaft, we simply drop the ENABLE line to a logical low.
That’s all there is to it!

Spinning Out
My version of the A3959 motor controller is shown
attached to its demonstration board in Photo 4. When
you’re ready to put the A3959 to work in a real-world

PHOTO 4. You’ll want to build up an A3959 motor driver board


without the socket if you plan to run a motor for an extended
length of time. It is important to make sure that the A3959
heatsink tabs are soldered to the copper heatsink area.
SERVO 07.2008 49
Marconett2.qxd 5/30/2008 2:14 PM Page 50

Loki Crosses the


Pond — Part 2
by Alan Marconett

In this second part of the Loki project, the


QwikFlash controller board and its control
softwaRE will be examined. This is a very useful
board for all kinds of robotic projects. I have two running
bots at this time and another one in the works!

I Controller Board
n Part 1, we studied Loki’s mechanical construction from
PCB (printed circuit board) material. The controller board
mounts on top of the body. Almost any controller board and processor can be
Part 1 also mentioned that I was inspired to build Loki used on a robot this size. I had several bare QwikFlash
because of his antics in walking and posturing. Another boards on hand I had purchased from the PICbook website.
reason I had for building Loki was to investigate subsumption This website (www.picbook.com) supports the book
and behaviors. Simply put, behaviors are the actions taken Embedded Design with the PIC18F452 Microcontroller
by a bot with given inputs. Loki will avoid an obstacle in its written by John Peatman. I’m currently using the 18F4620
path. Another behavior would be to follow (or avoid) a light PIC, although the 18F452 discussed in John’s book can be
source. Subsumption is the inhibiting of one behavior by used, and possibly even an old 16F877, as well (untested
another. However, more in-depth discussions of behaviors and limited). See the CA1.PDF document on the PICbook
and subsumption are beyond the scope of this article. I do website for construction, bill of materials, block diagram,
intend to port these ideas as ‘C’ functions into my hexapod and a schematic of this fine board. Note that no hex file or
(Shelob), as well. code is planned for the ‘877 chip at present. A hex file is
currently available for the ‘4620 PIC implementation.
QwikFlash board populated with LCD (on Shelob).
The Book
John’s book on the ‘452 is an excellent tutorial for
learning the workings of the 18F452, as well as the
18F4620 I used. And having a board to try out code on is
very helpful. Although John’s book uses assembly language
to test out the inner workings of the PIC, It is still quite useful
for C language developers and experimenters. Microchip
thought enough of the book to give out copies of it as
prizes for their seminar classes at the recent Embedded
Systems Conference. Other prizes were the ICD2 in-circuit
debugger and PIC start boards. (Now I have an additional
copy to pass along to my oldest son, who is also a
hardware engineer and is interested in the PIC.)
The QwikFlash board with a ‘4620 PIC runs at 40 MHz,
has 64K of Flash, 3986 bytes of RAM, and 1,024 bytes of
EEPROM. Plenty of I/O bits, counters, and timers too for
our use! To control Loki — or any other small bot — I added
connectors for four R/C servos, two Sharp GP2D12 IR
50 SERVO 07.2008
Marconett2.qxd 5/30/2008 2:14 PM Page 51

Loki Crosses the Pond — Part 2


rangefinders, and a Devantech
SRF08 ultrasonic rangefinder in the LOKI Four-Servo Biped Robot Summary
“prototype” area of this board.
• Cheap walking robot, low cost parts, can be made at home
The QwikFlash controller board has • Loki is inspired by the efforts of David Buckley
an RS-232 level converter and a built-in http://davidbuckley.net/DB/Loki.htm.
DB-9 connector for communications, • Original construction was wood (I later found out)
although I currently use just the TTL • My Loki is constructed of PCB material to a similar size
lines for telemetry (via Bluetooth). With • Currently using four Futaba S3004 R/C servos, need bigger knee servos
it, I run a terminal interface program • Battery is a salvaged six-cell Ni-MH 7.2V 1,300 mAh pack
called T2 on my PC to access Loki’s • Controller board is a $15 (bare) QwikFlash 18F4620 PIC board available from
small monitor program. I used the www.picbook.com
• 50 MHz, 64K Flash, 3K RAM, plus EEPROM
monitor program to develop Loki’s
• Bluetooth wireless for telemetry and monitor control
gaits and postures. • EEPROM gaits editable over wireless link
There is even an 8x2 character • PIC programming via ICD2
LCD that can be added to the board, • Control program written in HI-TECH C, used to develop gaits
although only the board on Shelob has • Two modes, autonomous and control via a small monitor program
this part. The LCD is not currently used • Parser used to decode commands received by monitor
on Loki. The Bluetooth (Blue SMiRF) • EEPROM commands save, view, and execute steps in sequences
setup I’m using is from SparkFun, and • Autonomous control currently consists of simple obstacle avoidance while doing
a simple walk
is great for freeing Loki from wires
• Sensors include two Sharp GP2D12 IR range finders and a SRF08 ultrasonic
(it doesn’t take much weight to off- rangefinder
balance a small robot such as this). • Body and feet PCB material CAD designed and cut on my CNC’d Sherline mill
Otherwise, a lightweight, three- • Loki’s gait is exaggerated due to the need to clear the toes of the overlapping feet
conductor cable can be used for • R/C servos are driven by two timers and interrupts in the PIC
normal RS-232 communications. • Servo commands set new angle for servo and time to get to new position
The QwikFlash board requires 7 to • Gaits are stored by strings of servo move commands, similar to those of the
9 VDC, which I get from a 1,300 mAh Lynxmotion SSC32 servo controller
7.2V battery pack I salvaged. A 6V • To walk, a simple array of six strings is repeated in an endless loop
• More strings allow Loki to make turns
battery pack would be sufficient if • An FSM selects the strings to be used, and changes the string selection upon
you’d like to use a 9V battery for the recognition of an object by a sensor
controller instead. I added three
1N4001 power diodes in
series to drop the voltage
from the battery pack closer
to 6V for the R/C servos I
used (servos don’t like too
much voltage). A modular
RJ11 connector to match
the Microchip MPLAB ICD2
in-circuit debugger cable is
also on the board. I used the
ICD2 to download and
develop the code for Loki.
MPLAB IDE v7.4 runs the
ICD2 and invokes the HI-TECH
Software compiler that I used.

Controller Board
Construction
To build the QwikFlash
controller board, you can
follow the instructions in the
CA1.PDF document found on
the previously mentioned
PICbook web page. Some Schematic 1. Drawing
comments are in order. If of Loki sensor, servo,
you use a Bluetooth module, and battery wiring.

SERVO 07.2008 51
Marconett2.qxd 5/30/2008 2:15 PM Page 52

Loki Crosses the Pond — Part 2


you will not install the U1 MAX232 level converter IC. the board. A six-position header is used for the Bluetooth
Also not installed is U2, the MAX522 DAC, as we will be connections and a five-position header is used for the
using the I2C interface for our ultrasonic sensor. We don’t ultrasonic rangefinder. These sensors are for the
need the connector on the bottom of the board, unless autonomous operation, but you can run Loki without
you just want it. them in the terminal mode.
Six resistors are needed. Four of the resistors are
Add Parts to the Prototype Area in-line to the data pins of the servo connectors, while the
remaining two resistors are pull-ups for the I2C lines.
To interface to our four servos and two IR sensors, we I used a three-position terminal block (optional) to
need to add some three-pin, single row, straight solder tail experiment with different batteries. You’ll want to provide
headers. I used the same header stock used elsewhere on a direct path from the battery to the servos to minimize

Schematic 2 H2
VDD GND1 Expansion header
(See Appendix A2)
CON1
Modular VDD GND 1 2 RB5
connector U3 RC3 3 4 RB4
PIC18F452 RE2 5 6 RB3
1
40 VDD 7 8 RB2
3 (RB7)
hardware

For 39 RC0 9 10 RB1


Debug

2 (RB6)
in-circuit 38 RC1 11 12 RB0
debugger 4 RB5 H1
37 RC2 13 14 RC5 Terminal
RB4
PORTB

5 VDD RD2 15 16 RC4


36 Unused strip at top
6 MCLR J1 RB3
35 of board
Interrupts

Jumper for INT2 RB2


QwikBug INT1 RB1 34
B1/INT1
U1 33 GND
CON2 INT0 RB0 B0/INT0
DB9F MAX232A GND
connector UART
13 12 26 (RC7)
For 3 RX
14 11 25 U2
QwikBug 2 TX (RC6)
8 9 Dual 8-bit DAC
7 CTS* 24 8
SDO (RC5) DIN
8 7 10
RTS* OutA 5 DACA
23 C8 GND
SPI

5 SDI RC4 Unused

SCK (RC3) 18 2 SCLK


6
16 1 CS OutB DACB
VDD C7 GND
PORTC

C10  0.1 F 15 4 7 3
VDD
2 17 C6  0.1  F
CCP1 RC2 C2/CCP1
C11  0.1 F GND
Protection circuitry
CCP

1
VDD
C4  0.1 F 3 D7 R12  1 k H3 QwikFlash
16
4 CCP2 RC1 C1/CCP2 instrument input
C2  0.1 F D8 R11  47 k GND (bottom of board)
5
15
6 RC0 VDD
C3  0.1 F 7
POT1
AN4 (RA5) 5 k
D2 R8  1 k C9
*RTS & CTS can be 6 potentiometer
RA4 VDD Alive LED 0.1
connected to unused F
PIC18F452 pins
5 R7  1 k D4
PORTA

to support hardware RA3 Left LED


flow control of serial R6  1 k
ADC

4 D5
data transfers. RA2 Center LED
3 R5  1 k D6
RA1 Right LED
SW2 VDD
R4 R3 R1  470  TMP1
RESET AN0 (RA0) 2 Temperature
47 k 470  C1  0.1  F
VDD sensor
10
AN7 RE2 E2/AN7
PORTE

MCLR 1 LCD1 GND


MCLR 9 6 E 2
13 RE1 VDD
OSC1 8 4 RS 8  2 LCD R14
Yl RE0
display 3.3 k
10 MHz 14 30 14 3 C17
OSC2 RD7 B7 0.1  F
C12 C13 29 13 R15
RD6 B6 "Nibble"
22 pF 22 pF 28 12 1 470 
RD5 B5 interface
VDD 11 27 11 5
VDD RD4 B4
R2  1 k D1 Power C15 R13  10 kVDD
LED 0.1  F 12
GND
PORTD

VDD 22
RD3 SW3
VDD 32 21 Pushbutton switch
VDD RD2 Unused
REG1 C16 VDD
CON3 0.1  F 31 R9  10 k
GND
Power 20 RPG1
RD1
connector VDD R10  10 k Rotary pulse
D3
19 generator
C5   C14 RD0 (24 inc./rev.)
33  F 33 F SW1

9 V in, 5 V out

52 SERVO 07.2008
Marconett2.qxd 6/4/2008 8:55 AM Page 53

Loki Crosses the Pond — Part 2


noise. Install two or three 1N4001 diodes in series with the
battery if you intend to use the 7.2V higher voltage battery
Electrical
pack. A bypass cap is sometimes needed on the servo The electrical system on Loki is simple. It consists of a
battery line. Another possible addition is a seven-pin, battery, switch, battery connector, and wiring. The free
double row, straight solder tail header for ends of this wiring are to be terminated in the power
the optional LCD display (follow
instructions in CA1). An external 16x2
LCD display could also be used. In Parts List
this case, you might want to put the ITEM/DESCRIPTION QTY SUPPLIER/PN
connector on the top of the PCB. QwikFlash board options
Current software does not utilize the • Blank PC board only 1 Micro Designs Inc./QF-QFPCB3.1
LCD display; and the RE0 and RE1 • Parts kit for 452 demo board 1 Digi-Key/18F452-KIT-ND
-OR-
pins were usurped for use by the IR
• Unassembled PC board and parts kit 1 Micro Designs Inc./QF-PARTS2
sensors. These PIC pins will need to be • IC MCU Flash 32KX16 40 DIP 1 Digi-Key/PIC18F4620-I/P-ND
re-assigned if the LCD is used. Available as programmed part from the author. (un-programmed)
The above parts are all added to
the prototype area of the QwikFlash Additional parts for prototype area of QwikFlash board
board. Wire these per the “Servos and • Rectifier GPP 50V 1A DO-41 3 Digi-Key/1N4001DICT
Sensors” diagram in Schematic 1. • Conn Header .100” SINGL STR 36 POS 1 Digi-Key/S1011-36-ND
• RES 2.7K ohm 1/4W 5% carbon film 2 Digi-Key/2.7KQBK-ND
There are hole positions for four • RES 1.0K ohm 1/4W 5% carbon film 4 Digi-Key/1.0KQBK-ND
miniature toggle switches on Loki’s • Qty. 10 5” jumpers and 20 headers 1 SchmartBoard/920-0006-01
body. I’m currently using only one for • Qty. 10 7” jumpers and 20 headers 1 SchmartBoard/920-0007-01
servo power. There is already a toggle • CST-100 six-position connector receptacle 1 Digi-Key/A19494-ND
switch on the QwikFlash board for 5V • Crimp CST-100 pins 6 Digi-Key/A19520-ND
power, but it is wired after the 5V • Conn 2.1 mm female plug 5.5 mm OUT 1 Digi-Key/CP3-1000-ND
regulator chip. Builders might want to Sensors
add a switch in the power line to the • Devantech SRF08 ultrasonic rangefinder 1 Super Droid Robots/TS-012-008
QwikFlash board, or for a board that • Sharp GP2D12 IR sensor 2 Lynxmotion/SIR-01
does not have its own power switch.
Servos and batteries
Cables • HS-475HB (76 oz in) standard servo
• 7.2 volt Ni-MH 1600 mAh battery pack
4
1
Lynxmotion/S475HB
Lynxmotion/BAT-02
• Wiring harness — battery connector 1 Lynxmotion/WH-01
I used four 4” pre-made “jumper” • 2.4 - 7.2 VDC Ni-CD and Ni-MH universal 1 Lynxmotion/USC-01
wires for the ultrasonic rangefinder smart charger
(cut two blue 8” lengths in half) and
six 6” yellow wires for the Bluetooth Bluetooth
transceiver. These are available from • Bluetooth modem — BlueSMiRF RP-SMA SKU# 1 SparkFun/WRL-00158
SchmartBoard (the colors designate • Bluetooth USB module SKU# 1 SparkFun/WRL-00150
• 2.4 GHz duck antenna RP-SMA SKU# 1 SparkFun/WRL-00145
the length) and have female pins for
.025” posts on either end. (These are Body parts
great for working on proto boards.) • 0.25” dia. standoff RND 4-40 .625”L alum 8 Digi-Key/1839K-ND
The ultrasonic rangefinder cable will • 0.25” dia. standoff RND 4-40 .375”L alum 2 Digi-Key/2026K-ND
need a CST-100 six-position connector • 4-40 x 1/4” Philips head screws 8
receptacle stuffed with six Crimp • 4-40 x 5/8” Philips head screws 2
• 4-40 nuts 10
CST-100s. A tool is available to crimp
the pins, or use a pair of needle-nose • Approximately 150 sq in. 1/16” double-sided Digi-Key or surplus
pliers to crimp the pin on the wire PCB board
before inserting them into the • PCB copper clad 4.5” X 7” two-side 3 Digi-Key/PC41-C-ND
connector receptacles. You’ll also want • PCB copper clad 6 X 9” two-side 1 Digi-Key/PC53-ND
to solder in a five-position, single row,
• Approximately 25 sq in 0.0625” 5052 (H32) Onlinemetals or surplus
straight solder tail header into the
aluminum plate
backside of the ultrasonic rangefinder. • Servo angle brackets bend up from 2
One of the other standard length aluminum plate
jumpers (red) would probably work for • IR sensor mount 1/2” x 1/2” x 6” long 1
the SMiRF, but I wanted a connector aluminum angle bend up from aluminum plate
body here. As an afterthought, I’d -OR-
have put one on the ultrasonic sensor • IR sensor mount 1/2” x 1/2” x 6” long 1
aluminum angle
cable, as well.
SERVO 07.2008 53
Marconett2.qxd 5/30/2008 2:16 PM Page 54

Loki Crosses the Pond — Part 2


Front view of Loki (new legs).
Sonar and IR sensors.
(interrupt service routine).
The ISR is called at a regular
interval by a timer interrupt.
The ISR generates “system
ticks” that initiate various
background tasks. Also,
several peripherals are
supported by an ISR in the
background. The USART
and A/D converter are
examples of this, as are the
updates for the R/C servo
positions. The I2C FSM for
the ultrasonic rangefinder
relies on multiple calls from
Top view of Loki (new legs). Sonar and IR sensors. the scheduler to avoid
“blocking” while waiting for I2C events. This RTOS is not
connector. The red +V wire goes to the center connector; pre-emptive and only supports a fixed list of tasks; hence,
the black -V wire goes to the shell. This connector allows the baby moniker.
easy disconnect from the controller board. The battery The current controller program (RTOS) is a bit eclectic
connector can be disconnected to allow connection of the in that it has a monitor that accepts commands from a
battery charger. console and also supervises an autonomous mode for
when the robot is on its own. I’ve mentioned the monitor
Software command to move the servos; there are also commands to
save/view/execute the servo positions stored in EEPROM,
Now down to the software issues. I’m an old hand at and to read the sensors. The current autonomous mode
the C language, and I naturally grabbed my trusty HI-TECH is in its infancy; it’s merely a simple obstacle avoidance
compiler for the job. (Note that any one of several different behavior for now. More is planned for it in the future.
languages would work.) Although I’m not using one, a
boot loader would be a good choice for a ‘bot like this. Parser
As mentioned, I use an ICD2 for programming, and have
to plug in a modular cable for this. Obviously with a boot The heart of the monitor is a simple hacked-together
loader and wireless connection, no cables would be parser to decode commands for Loki. Perhaps the most
needed! But don’t dismiss this simple umbilical cord; it is an important command is the R/C servo command which takes
easy way to get started. In fact, I initially ran my Loki with a position parameters for up to four servos (although I’ve
battery pack lying on my desk. Having the weight of the planned to allow up to eight servos) at a time. A servo
battery pack off-loaded allowed me to use some old Futaba command is a simple string of ASCII characters (like
S3004 R/C servos I had laying around until I could “#0P1200 #1P1500”) ending in a CR (carriage return) in a
determine what size servos I needed. The S3004 servos at format similar to that used by SSC (Serial Servo Controllers)
the knees are too weak to lift up the body of Loki. You such as the Lynxmotion SSC32 servo controller. This is
could also use the Hitec RCD servos listed here: convenient for me, as Shelob — my main hexapod — uses it.
Add to the command a parameter for the required time of
Hitec HS-645MG 107 oz-in @ 4.8V, 133 oz-in @ 6.0V the move (“T1000”), and we have a means of commanding
Hitec HS-475HB 61 oz-in @ 4.8V, 76 oz-in @ 6.0V 1-4 servos to move in what’s called in CNC parlance a
“coordinated motion” (all axis motion starts and ends at the
Note: Futaba 3004 servos rotate the opposite direction same time). This is very convenient for moving the legs of
to Hitec HS-475HB servos! Be sure you account for this Loki, or any robot, for that matter.
if you change between the servo brands. I’m currently Loki currently recognizes the following commands or
making modifications to the code to accommodate both parameters:
rotations.
• REV Loki revision # sign-on
RTOS • ESC Clear error
• #n Servo #
Loki’s controller program is basically a “baby RTOS” • +- Offset of servo position
(real time operating system), which means that there are • Tnn Time
several tasks that run at the same time, managed by an ISR • Pnn Servo position
54 SERVO 07.2008
Marconett2.qxd 5/30/2008 2:16 PM Page 55

Loki Crosses the Pond — Part 2


• POnn Servo offset controlled by another FSM. The ultrasonic sensor data read
• Cnn Canned sequence # is in inch range readings. The behavior FSM checks these
• Knn Continuous canned sequence # ranges for use in deciding when to make turns and when to
• R Reset (stop) sequence stop. If a terminal is connected (either by a direct RS-232
• U Range request (sonar) connection or by Bluetooth), the telemetry (actually, just a
• Z.. Pot update of a servo lot of printf statements) will be available, and the ranges
• I Range request (IR) seen by the sensors will be displayed, along with some
• X Execute step of stored EEPROM sequence sequence information.
• Y Execute (back) step of EEPROM sequence
• V View stored EEPROM steps LEDs
• E Save current position into EEPROM step
• A Set address of execution step The controller board has five LEDs. D1 is the power
on LED. D2 is the “heart beat” LED which flashes at a one
Loki can execute either one of the canned sequences, second rate to indicate that the program is still running. D4
or the EEPROM sequence that’s been saved. I developed is the message LED that indicates when a command is
the simple six-step gait and turn sequences used by the being received. D5 is the ERROR LED, which gets set when
autonomous mode (and the canned sequences) with the a received command is in error. D6 is the move LED that
EEPROM commands. indicates when a servo move is in progress.
Either the ‘Z’ or ‘+/-’ offset commands can be used
to position a servo, and then store all servos with the ‘E’ Switches
save command.
There are three switches on the controller board.
Sequences and Autonomous Mode SW1 is a miniature toggle switch for +5V. SW2 (small
pushbutton) is the reset switch and resets the processor.
The SW3 pushbutton is pressed to start up the SW3 (small pushbutton) is the data switch used to initiate
autonomous mode of Loki. Loki starts by walking forward, autonomous activity. There is also the miniature servo
and will take random turns at random intervals. Loki turns power switch on the body.
away if the IR sensors encounter an obstacle. The forward
walk is accomplished by continuously looping through Servo Operation
canned sequence #1.
A full left turn is really three #3 sequences, and a full The main timer already generates interrupts for the
right turn is three #5 sequences. Although not very efficient main ISR at the frame rate of the servos (2,500 μs). This
on space, the sequences are “man readable,” and easily cut rate is also divided down to generate system ticks at a 1/10
and pasted into a program or manually sent via a terminal. second rate for other background tasks. A second timer
Wondering what sequences #2, #4, and #6 are? They times the pulse width for each of the four (or eight) servos
are backwards gaits of #1, #3, and #5, respectively. sequentially. We don’t just suddenly “jump” from one servo
Sequence #7 reads the pot to determine position (more on position to the next. What we do is “sweep” the servo(s) to
that later), and #8 is a waving posture.
To control the transitions between the sequences, a Close-up front view of Loki (new legs). Sonar and IR sensors.
FSM (finite state machine) is used. This FSM is scheduled to
run periodically by the main ISR. The FSM can be called the
first “behavior” for Loki. I intend to add additional behaviors
such as following a light source. These too are implemented
as FSMs. All FSMs run in parallel and all are scheduled
from the main ISR via the system ticks. This parallel FSM
operation allows a new behavior to be easily programmed
(that’s the theory). The multiple FSMs will be controlled
by subsumption. Loki doesn’t have all that implemented
yet, however.

Sensors
Loki has three sensors currently. The two IR distance
sensors (also called proximity sensors or rangefinders)
have analog outputs. The processor reads the IR sensors
with the A/D and is controlled by interrupts. The IR data is
conditioned and results in left and right range values in
inches. The ultrasonic sensor is interfaced by I2C and
SERVO 07.2008 55
Marconett2.qxd 5/30/2008 2:16 PM Page 56

Loki Crosses the Pond — Part 2


the new position over the time period allocated for the Bluetooth module should be disconnected) and a 1:1 three-
move. An increment in position for each servo frame is wire DB9 cable to the PC. Run a suitable terminal emulator
calculated for each servo to be moved. Each frame we program such as T2 or Docklight (even HyperTerminal). Loki
increment each servo position as required. The result is a expects a 115K baud rate, no parity, and no handshake. Set
smooth transition of position for the servos. And it all runs your terminal software (and Bluetooth if used) accordingly.
in the background! The new positions, of course, come (Because of the variety of Bluetooth modules available, no
from the servo commands parsed. The code also reads and detailed description of using the Bluetooth or SmiRF will be
parses the canned sequences. The action of turning on a given here).
servo output line for the time determined by the second Assuming the terminal program is configured properly
timer results in a PWM (pulse width modulated) signal and the Bluetooth (if used) is operational, then you should
suitable for controlling R/C servos. observe the sign-on message “Loki 1.0 here!” when the
board power is turned on. Insure that you are familiar with
Checkout Bluetooth before attempting to use it! I suggest you try
RS-232 first (I did).
Before powering up Loki, make sure his legs are
positioned left foot first and he is standing up. This is the Loopback Tests
starting position, and all of the canned move sequences
both start and stop here. In case no sign-on message is seen, and assuming you
Initially, both the servo and the controller board power have the proper voltages and the chip(s) in right, you
switches should be off and the battery disconnected. should first check out communications. It is normally easier
Remove the PIC chip U3 if installed. It is recommended that to start off with a simple RS-232 serial cable known to
the servos and sensors be unplugged at this time. work. If no message is seen upon power-up of the board,
You may now connect the battery and turn on the disconnect the RS-232 cable and plug in a loopback plug
controller power switch, and observe the LED power into the end of the cable instead. You should see your
indicator come on. Measure +5V on the output terminal keystrokes echoed through the loopback plug. In the case
of the 5V regulator REG1. of Bluetooth, the Tx and Rx jumper leads (blue) can be
Turn the power off and insert the PIC (the end with pin unplugged from the controller board and connected
1 and the little notch faces the three LEDs). When you turn together with a small piece of .025” header pin. This
the power back on, you should again observe the LED power “loops” the Rx out of the Bluetooth module and right back
indicator come on and still read +5V on the output of the in. This is a typical way of checking out a terminal program
regulator. The “heart beat” LED D2 should be flashing once and cabling, and also the Bluetooth. After verifying the
a second, which indicates that the program is running. communications, standard troubleshooting techniques
apply. Check for shorts, grounds, damaged traces, and the
Terminal Tests like. Pins are easy to bend over on the IC chips. Mind the
polarity of the electrolytic caps, LEDs, and diodes.
Power down again and connect either a checked-out
Bluetooth module (TTL) with a viable wireless link to the PC Loki Here!
or install a MAX232 level converter chip into U1 (any
On your terminal, send the string REV<CR>. <CR> is a
Loki in a posture. RETURN keystroke. It is often represented as ‘\r,’ as well.
Loki should reply with “Loki 1.0 here!” This is the message
also seen on power-up, but it is a good fast test of a valid
two-way connection to the terminal. And with Bluetooth,
it’s nice to have a quick way to verify that you’ve still got
a connection.
You are now ready to send some initial servo
commands to Loki to test him out. Insure Loki’s legs are
positioned with the left foot first. (Loki always puts his left
foot forward!)

WARNING! Servos can rapidly jump when first turned


on. Positioning the feet as mentioned will minimize any
undesired jerking motion of the feet upon application of
servo power.
KEEP YOUR FINGERS CLEAR of Loki’s feet when
starting up!

I recommend connecting and testing one servo at a


56 SERVO 07.2008
Marconett2.qxd 5/30/2008 2:17 PM Page 57

Loki Crosses the Pond — Part 2


time. Driving servos into their mechanical stops can damage
them. Proceed cautiously. Also be aware that if the battery
Sensor Tests
discharges too far, erratic servo operation can occur. Turn With a terminal connected, the U (ultrasonic sensor)
off the power immediately! and I (IR sensor) commands can be issued from a terminal
Okay, we’ll now power-up Loki’s controller with ONLY to conveniently test Loki’s sensors. Note that distances less
servo #0 connected. Next, turn on the servo power, being than about 4” are invalid for the IR sensors.
careful to hold up Loki by the body, and WATCH YOUR Issuing walk commands with the servo power turned
FINGERS! off can also be used to view the range values and various
Issue the command #0P1600<CR> from the terminal. walk sequence states on a continuous basis.
Servo #0 is the right knee; it should move a little. This is the After Loki is successful in taking a few walks, the
basic servo command. You should experiment with the autonomous mode can be tried. Press SW3 to start Loki.
servo command to familiarize yourself with it and to check Objects should cause Loki to turn. An object too close will
out the other servos, as well. Try some other positions, such cause Loki to shut down.
as 1800 and 700. Add T1000 to the servo command, or
issue it by itself to set the move time at 1,000 ms (default). Other Board Uses
Try other move times.
You’ll find out that the servos have limits assigned to I found the QuikFlash board a very useful and
their travel. For example, 700 and 1779 are the limits for convenient board to use. It is also inexpensive and perfect
servo #0. There are similar limits for the other servos. These for other small robots. I’m already looking at it for another
limits prevent Loki from kicking himself. robotic project.
Up to eight servos could easily be accommodated with
Servo Calibration additional connectors. Although Loki is a legged bot, one
could also drive R/C servos modified for continuous rotation
As mentioned earlier, with the servo horns only and use them to build a small wheeled robot (I’m a leg
allowing rough squaring, we save a calibration value for man, personally.). The navigation portion of the software
each centered servo position. The servos can be finely would be a little different, but the section of the code
adjusted from a terminal program by setting up your driving the servos would probably be the same. And don’t
terminal program to send the strings #nP+25<CR> and forget robotic arms! Just add software.
#nP-25<CR> when buttons are pressed. These buttons can
then be used to jog the joint up or down to the required Loki’s Future
position; ‘n’ is the servo number and the ‘25’ is the amount
to move. Change the amount to suit your taste. The goal This is only the beginning for the controller board and
is to have the feet flat on the table, parallel, and about Loki! A custom control board for Loki is envisioned, which
1/2” apart. Record the location of all four servos (offsets would eliminate the need for hand-wiring servo and sensor
are 0 at this point). connectors in the prototype area.
After getting the servos where you want them, the On the software side, it is anticipated that more
calibration values are sent to Loki’s controller via the behaviors will be added, and improvements made over the
command #n PO nn <CR>. The servo number is n, and the rudimentary “rules” that currently suffice for subsumption.
centered position is nn. All four servo offsets can be sent Sequence entry to the EEPROM is at its infancy, to say the
in one command, if desired. The offset values will be least, and currently no fast download of sequences from a
calculated and stored in EEPROM. The centered or “left foot terminal is available. SV
forward” position of Loki’s legs will be normalized to 1500
with the offsets. A position of 0 results in the servo going Loki and author Alan, KM6VV.
to sleep (PWM pulses cease).

Loki’s First Steps


Now that we’ve got the servos moving, we can take a
little walk! A C1<CR> command will command a single gait
cycle, and K1 will initiate a continuous walk. The walk can
be stopped by a R<CR> command. Note that Loki always
finishes out his gait cycle to the left foot forward posture.
This is to ensure that the feet are in a known position,
which minimizes the possibility of Loki getting his feet
tangled up.
A C3<CR> Partial Right Turn or C5<CR> Partial Left Turn
can also be executed. Three will be needed to complete a
full 90 degree turn.
SERVO 07.2008 57
TwinTweaks.qxd 6/4/2008 4:16 PM Page 58

THIS MONTH:
There’s a New Humanoid
on the Block

H
umanoid shaped servo robots are with a hefty price tag. We’ve been dance off, kung-fu, or soccer against
some of the coolest robot kits lucky enough to review two such kits the Robonova and Bioloid? That’s
around. They are generally simple for SERVO so far. The surprising what we aim to discover.
to build, and the finished product is nimble Robonova-1 from Hitec will run
agile and undeniably entertaining. you over $1,000, and the versatile Like The Six Million
Robots this cool, however, often come Bioloid kit from Robotis comes with a
price tag of about $900. These prices Dollar Man With a
ROBOPHILO KIT. likely put these bots out of the reach 99.995% Discount
of many casual hobbyists, which is a
shame because they have so much The second half of Robophilo’s
to offer. The construction of these cryptic name stands for Programmable
robots is an excellent lesson in shrewd Humanoid In Lifelike Operation. If the
engineering design, and there are other servo module humanoids that
numerous competitions that cater to we’ve gotten our hands on are any
this unique type of bot at events like indication, this moniker is certainly not
RoboGames. an exaggeration of its abilities. But for
This month, we have the pleasure us to check on that, we first need to
of introducing the Robophilo from build the thing.
Robot Brothers, Inc. The Robophilo is The Robophilo can be acquired as
pitched as the most the pre-built Ready-To-Walk form or in
ROBOPHILO TEAM. affordable of the kit form, and we were fortunate
humanoid servomotor enough to get the Robophilo in
bots, and it certainly pieces. The Robophilo kit comes with
makes good on that a CD that contains all of the necessary
claim with its scant software and an electronic instruction
$400 price tag when manual in pdf form. The kit also
compared to its comes with a rechargeable battery
competitors. But does pack and charger.
affordability sacrifice And, in case there was any doubt
quality, or is the about whether or not the Robophilo
Robophilo agile enough was meant to be treated as a high
to hold its own in a tech plaything, the instruction manual
58 SERVO 07.2008
TwinTweaks.qxd 6/4/2008 4:16 PM Page 59

There’s a New Humanoid on the Block

declares on its very first page that


“Robophilo is not a toy.” It just goes
to prove that intellectually intensive
and brain stimulating robot projects
can be so fun that there might be
some confusion, so we’re glad that
the distinction has been made.
The Robophilo instruction manual
gives the directions on how to build
the bot with clear text and helpful
3D illustrations of the step-by-step
assembly. The pictures are very nice,
but the detail on the page, the
background watermark, and the
length of the manual (78 pages!)
discouraged us from printing it out.
Following along on the computer,
however, proved to be easy enough.
The brackets for the arms and
legs of the Robophilo are certainly
reminiscent of those used on the PHILOMOTION CREATOR.
Robonova and Bioloid, and this tried
and true design works just as well on servomotors. The casings, like most are only a minor setback that we
the Robophilo. These parts are made others for various servos, have little easily corrected after some quick
out of lightweight plastic instead of tabs on the side with holes for surgery with a hacksaw.
metal as one of the money saving mounting. We figured that the Other than that, the Robophilo
measures on the kit, but the quality of Robophilo made use of these went together relatively easily. All of
the parts do not appear to suffer for tabs, but we were mistaken. The the plastic parts have part numbers
the sake of economy. illustrations in the instruction manual directly on them for reference, and all
One thing that the Robophilo has and the pictures of completed screws and other bits are stored in
that its competitors do not is its own Robophilos on the box show servo conveniently labeled bags (except for
set of tools. This simply consists of a casings sans tabs, so we had to chop the fact that some of our bags were
crosshead and a hex head screwdriver, them off. Perhaps this was a manufac- labeled in Chinese, the parts were
but one hugely helpful detail about turing oversight that will be corrected very easy to keep organized). At the
the crosshead screwdriver is that it for future kits, but the tabbed casings end of most steps, rough tuning is
is magnetized. This proves to be
invaluable when dealing with so ROBOPHILO FINE TUNING.
many tiny screws.
Other aspects of the Robophilo kit
that set it apart from it contemporaries
are the inclusions of silicone grease
and rubber o-rings — the robot’s
substitute for synovial fluid, if you will.
The Robophilo also uses some smaller
servomotors in conjunction with
some small metal push bars for the
movement of the head and waist. An
unfortunate distinction is that a very
small number of steps demand the
judicious use of some super glue,
which is not included in the kit. But by
planning ahead and having some super
glue at the ready, this minor detail
shouldn’t mess up your building flow.
One problem that we encoun-
tered with the Robophilo construction
was with the actual casings of the
SERVO 07.2008 59
TwinTweaks.qxd 6/4/2008 4:17 PM Page 60

Twin Tweaks ...


forward by helpful diagrams in the nonetheless it was a vexing setback.
instruction manual. The mess of wires During our fine tuning of the
can be cleaned up with some wire Robophilo we witnessed something
sleeves included in the kit. disturbing and tragic. We were editing
The penultimate step of building the range of motion on the right leg,
the Robophilo is to do the fine tuning and then the Robophilo’s arm began
for all of the servos, which is a to quiver. We checked to see that
laborious and time-consuming process. nothing was blocking it, but the
The major money-saving measure quivering only got worse. Then, the
employed in the design of the entire robot started to convulse as its
Robophilo is in the servos, and the LED started to dim. It was a tragic
tradeoff for achieving a low cost thing, watching the Robophilo run out
becomes clear during the fine tuning of batteries before our eyes. The good
process. The Robophilo servos are news is that the battery pack is
cheap analog servos that lack the rechargeable, and the kit comes with
torque of the servos in the Robonova a charger. A few hours later, we were
and Bioloid, and are also more ready to press on.
difficult to tune. Thankfully, the tuning
process is more tedious than difficult Philo Goes West
and the quality of your experience will
ROBOPHILO MANUAL. most likely depend on how perfect After what seemed like hours of
you insist the tuning to be. fine tuning, we were finally ready to
done for the servomotors by hooking Tuning basically consists of finish the robot. The last steps include
them into the PCB (printed circuit entering various positions for the cleaning up the wires and attaching
board). The kit does include a battery servos and then adjusting the offset the final body panels. Unfortunately,
pack, and the tuning is a nice way to and range of motion in the halfway through putting on the
become familiar with the PCB before Robophilo’s fine tuning editor. With Robophilo’s ill fitting shoes we ran out
the more daunting task of wiring up 20 servos to tune, this can turn into a of screws! Most robot kits like the
the entire robot. time-consuming affair. During the Robophilo come with ample numbers
tuning process is also when the of spare screws, and running out was
Final Touches and instructions recommend to connect a disappointing surprise. We suppose
Fine Tuning the pushbars for the left and right leg we could have seen it coming,
movement and head turning into the because several other sizes of screws
Once the Robophilo is given all of servos. The pushbar is easy to insert came in only the exact amount
its limbs, there are only a few fine into the large servo horn for the waist necessary, with no extras left over.
touches before it is finished. One of movement, but the other servo horns Thankfully, we had enough screws to
them is to have holes that are simply too small keep the shoes on and the main body
ROBOPHILO REMOTE. wire it up, for the pushbars. After vigorously panels on.
which is made pressing the pushbars into place, we Unfortunately, the body casing for
very straight- were able to attach everything, but the Robophilo was a big engineering
disappointment in that it seemed to
ROBOPHILO PCB. sorely underestimate the amount of
space needed for the wires to escape.
Also, the front panel doesn’t even
seem to consider that extra room is
required on one side for the small
servo that turns the head. The thin
plastic is easy to modify, but it is a bit
annoying that it has to come to that.
Putting the final pieces onto the robot
should be a triumphant experience,
not the most frustrating of the entire
build.
Despite the final frustrations, we
had finished the bot and there was no
denying that it scored high marks in
cool factor. As a final touch, the
60 SERVO 07.2008
TwinTweaks.qxd 6/4/2008 4:18 PM Page 61

There’s a New Humanoid on the Block

Robophilo includes a
variety of decals to give
the bot some pizzazz,
and also as a way to tell
one Robophilo apart from
the other.
The Robophilo can be
controlled by an infrared
remote that bears a
stunning resemblance to
a TV remote. The rascally
robot was even seemingly
designed with team ROBOPHILO SERVO. ROBOPHILO TORSO (APART).
sports in mind, because
the receiver can be adjusted in such a pictures of servomotor androids tall and 30 kg, so our three androids
way so as to operate four Robophilos decked out in makeshift jerseys easily make the cut. Another three-on-
with four separate remotes and kicking around tiny soccer balls. three soccer event, however, seems to
without interference. The Robophilo Sometimes these events are referred only cater to the smaller and lighter
also has motion and pose editors so to as “Huro” events (RoboGames even Robonova with a height limit of a
users can create their own unique features a HuroCup), which we can mere 30 cm and a weight restriction
actions. There is even an option to only guess is a playful portmanteau of of 600 g.
assign the user created motions to the words human and robot. The HuroCup still offers a
buttons on the remote. By the time of this printing, plethora of events for intrepid
The Robophilo also has an option RoboGames will have already taken roboticists. The mission of the
for a software upgrade that would place in June, but it always seems like HuroCup is actually quite high
allow users to program their own a great way to analyze the versatility minded. According to the Laws of the
motions in C. We always like to see and effectiveness of a robot is in the HuroCup, “The goal of the HuroCup
this kind of versatility in robot kits, but context of a competition. league is to encourage research in
for our purposes we stuck with the The Robophilo, Robonova, and practical, autonomous, highly mobile,
easy to use GUI. Bioloid all easily pass the height and flexible, and versatile robotic
After all of the frustration and weight requirements for three-on- platforms.” That may sound like a lot
tedium, seeing the Robophilo move three soccer and for the variety of of work and a daunting task, but
around is a well deserved reward. The events that make up the HuroCup. the thrill of competition and exciting
weaker servos don’t give it quite the The main constraints on these events variety of events are sure to make it
agility of the Robonova or the Bioloid, are height, weight, and footprint as much a pursuit of fun as one of
but it still gets around just fine. In a dimensions. The wide open HuroCup progress.
dance-off between the Robophilo and allows robots that are up to 150 cm Track and field style events like
the Robonova the Robonova
would be more like the Korean ROBOPHILO TORSO (TOGETHER). ROBOPHILO WORK.
pop star and the Robophilo the
late night comedic pundit, but the
Robophilo certainly puts up a
valiant effort.

Rock’em Sock’em
Huros
By now, we had accumulated
three different “androids” as they
seem to be referred to in the
competitive robotics community,
and three seems to be the magic
number for a number of events.
The classic team sport of
competitive robotics is soccer, and
a quick online search of humanoid
soccer will return numerous
SERVO 07.2008 61
TwinTweaks.qxd 6/4/2008 4:19 PM Page 62

Twin Tweaks ...


module is equipped with. But construction a breeze, but the screws
one shouldn’t count out the seem to come out as easily as they go
Robophilo either — its PCB has in. It’s nothing a little Lock-Tite would-
numerous open ports for n’t fix, but it’s also nice to know that
additional servos and sensors, the Robophilo probably wouldn’t lose
and with the C upgrade it an arm in the middle of a golf swing.
proves to be a formidable
autonomous competitor. The Price of a
The epic RoboGames also Low Price
include a number of remote
controlled humanoid robot Overall, the Robophilo is a bit of a
events. The remote control Curate’s Egg — good in some parts
events include Kung-Fu, Golf, and bad in others. The troublesome
and even Taiko Drumming. servo casings, the ill fitting servo
Our three humanoids fit the horns and body panels, the weak and
bill as far as height and weight unruly servos, and the shortage of
ROBOPHILO FINISHED. restrictions for these events, screws are all quite irksome. Even the
and at first glance the seemingly neat addition of a hanger is
the Forward-Backward Dash and the Robophilo might seem like a better a mixed bag. Unlike our other two
Marathon test the limits of bipedal contender for these events than the androids, the Robophilo comes with
mobility, and events like Weight Lifting Bioloid. The reason for this is that the its own hanger for storage or display.
and the Lift and Carry stress balance Bioloid is the only one of the three The hanger is a nice idea and
and strength. The Robonova seems that does not come with a remote refreshingly simple to put together,
like a popular choice for these events, control, but an extra receiver module but it is not very stable and we had to
but we think the hefty Bioloid could can be added to make it controllable add our own extra base to it so it
also be a strong competitor. Without by radio frequency. The impressive wouldn’t topple over. The hanger
modification, the Robophilo would sensor arrays on each of the looks like a gallows, where an unruly
face an uphill climb (Stair Climbing is Dynamixel modules give it more than Robophilo could be justly put to death
actually another android event held at enough autonomous capabilities to for criminal frustration.
RoboGames). The catch about all of compensate for this inconvenience, Actually, that would be hyperbolic,
these events is that the Huros have to but such upgrades would likely be a because the Robophilo is not
be autonomous. In that case, the burden on a lot of hobbyists that have significantly more tedious to build
Bioloid might look like a better option already grappled with the steep price than any other servomotor humanoid,
because of the sophisticated sensors tag. The Robophilo, on the other but these numerous small details
that each and every Dynamixel servo hand, comes with a remote and is worked together to somewhat tarnish
ready to go — it even comes with some our opinion of the robot. To make
ROBOPHILO HANGER. preprogrammed karate chops, and the sure we weren’t crazy, we searched
motion editor would be a great way to for other reviews of the Robophilo to
add some more Kung-Fu moves. see if our sentiment was widespread
Such physically demanding events or a fluke. Searching for other
like Kung-Fu and Taiko Drumming commentary on the Robophilo online
would necessitate robust robots, and returned a number of glowing reviews
once again we think the Robophilo that seemed somewhat incongruent
would be up to scratch. The with our experience. Then we noticed
Robophilo miraculously seems to be that most of these reviews were for
free of one of the major concerns the Ready-To-Walk version of the
we’ve had about the Bioloid and Robophilo, which clocks in at $100
especially the Robonova — loose more than the kit version for a grand
screws. Perhaps it’s due to the pitfalls total of $499. This is still significantly
of mass production or loose less than other humanoid robot kits,
tolerances, but the screws that hold and for tinkerers that are short on
the Robophilo together certainly seem time or money it might be a decent
determined to stay put from our own option. Even so, other reviewers also
clumsy cross threads or some other noted the weak analog servos that
mystical mechanism. The fine metal were the big money saving item.
threads of the Robonova’s sleek metal They did, however, also tout the
frame may have made the initial expandability of the kit as a way to
62 SERVO 07.2008
TwinTweaks.qxd 6/4/2008 4:20 PM Page 63

There’s a New Humanoid on the Block

Recommended Websites
For more information, go to:
www.robophilo.com
www.robogames.net

overcome these problems. We couldn’t


agree more, and the Robophilo folks
are also hard at work at improving
their product.
We think that getting a humanoid
robot out there at such a low price is
an admirable accomplishment that
shouldn’t be overshadowed by a few
missing screws. The Robophilo still has
a number of great plusses in addition
to its affordability. The nice tools,
handy hanger (once stabilized), intu-
itive motion editor, stylish remote with ROBOPHILO SOCCER.
numerous channels, and expandability
all make for an impressive robot. certainly help in that department. It overcome with later upgrades and
The HuroCup Laws even mention may not be as stylish as the Robonova some ingenuity, but the Robophilo
how there is a drive to get more or as versatile as the Bioloid, but the and Robot Brothers should be
competitors involved in Huro events, Robophilo is accessible. The tradeoffs applauded for their sincere effort to
and we think that the Robophilo will made for affordability can easily be democratize humanoid robotics. SV

SERVO 07.2008 63
RoboResources.qxd 6/3/2008 11:11 AM Page 64

Tune in each month for a heads-up on


where to get all of your “robotics
resources” for the best prices!

Stocking Up With
Surplus Electronics
J ust because one person doesn’t
want it doesn’t mean it isn’t
valuable. That’s the case with surplus.
surplus shopping. We’ll get to mail
order buying in a moment, but before
logging into your PC, consider any
mostly on mail order to get what you
need. Many of the better online
stores are listed in the Sources section
Simply put, surplus is excess stock local surplus stores in your area. Don’t that follows, but don’t forget to use
for resale. Sometimes it’s used, have any? You’d be surprised at your favorite Internet search tool to
sometimes it’s new. Occasionally, it’s what’s out there. Look in the Yellow find more. Google, Yahoo!, MSN, or
worthless junk, but very often, surplus Pages under the heading of other web search engines let you
has a beneficial use to someone, Electronics. Sometimes you’ll find find items of interest from among the
somewhere. And just as importantly, what you’re looking for under a millions of websites throughout the
surplus means the item isn’t being Surplus heading, but these tend to be world. Add the keyword “surplus” to
thrown away in the trash, so it’s not military/camping surplus outfitters, the search terms to help narrow the
clogging up a land fill. rather than electronics surplus. hits you get.
Why bother with surplus? For Referrals are a great way to find Keep in mind that the Internet –
starters, it usually costs less, often a out-of-the-way businesses. If you and all mail order – is world wide.
lot less — there are exceptions, such attend a local robotics or other user’s You may find some retail stores that
as rare or antique items, but we’re group, ask members where they like are not located in your country. Many
not talking about that kind of stuff to shop. And when you find one businesses ship internationally, but not
here. The downside to surplus is store, ask the sales clerks if they know all do so, and the added shipping
limited selection and quantity. You of others in the area that might be of costs can all but negate the cost
may not find exactly what you’re interest to you. Most are willing to savings of surplus. Read the fine print
looking for, so you have to be point you to the competition, since in of the website to determine if the
prepared to improvise. And don’t the surplus world, if one store doesn’t company will ship to your country,
expect unlimited supplies of an item. have it, another one might. Customers and note any specific payment
Surplus is often one-of-a-kind, or at are gladly shared among the area requirements. If a check or money
least restricted quantity. stores. order is accepted, the denomination
You can find just about anything Local thrift outlets are another usually must be in the company’s
at surplus — cars, jet engines, elevator good source for surplus. Many have native currency.
parts, you name it. But the kind we’re sections devoted to old electronics Many surplus electronics outlets
most interested in this time around is such as TVs, VCRs, and radios. You’ll sell a mixed bag of new and surplus
surplus electronics and related gear — need to do your own dismantling to wares. In fact, it’s often difficult to
ICs, resistors, capacitors, small motors, get at the parts, but for many, that’s know what’s new or prime products,
jacks and plugs, and just about half the fun! Some thrift stores test and what is surplus. These stores
everything else you might need for their electronic goods and charge sell new products in order to keep
the average robot. more if they are working; for a stable inventory. What this means
cannibalizing surplus parts you won’t is that the store may be able to
Where to Go for care if they’re working or not, so just re-order some of the product, but
Surplus go for the cheapest you can find. not others.
Odds are, even if your area Remember that most surplus is a
The Internet — and by extension, supports just a couple of nearby retail “get it while you can” commodity.
mail order–is an ideal playground for surplus stores, you’ll probably rely Once it’s sold, it’s sold, and the stores
64 SERVO 07.2008
RoboResources.qxd 6/3/2008 11:11 AM Page 65

move on to the next item. Should you can. Be realistic in your expectations for new and used robotics compo-
need a larger quantity of a particular and be prepared to deviate from nents. Prices and selection are good.
part, inquire to see if additional your original project plans to suit the Walk-in stores in the Los Angeles area.
quantities are available, and whether materials on sale at the time. For Product line includes motors, switches,
it is a standard stocked item or limited example, if your robot calls for 2-1/2” discrete components, semiconductors,
availability surplus. diameter wheels, but you’ve found a LEDs, infrared and CdS sensors,
great deal on 2-3/4” ones that can batteries, LCDs, kits, and much more.
What to Stock Up On save you money, consider changing Specifications sheet for many
the specifications to accommodate the products are available on the website.
Because the availability of surplus different wheel size. Online store, Web catalog, and
comes and goes, you will want to take printed catalog.
advantage of a product offering while Sources
you still can. But that involves buying Alltronics
things you may not need at the Following are numerous online www.alltronics.com
moment — which could end up being outlets that offer electronics surplus, New and surplus merchandise.
not needed ever! It’s prudent to either exclusively or as part of a Among their product line useful in
exercise caution in ordering surplus broader selection. Several have printed robotics are DC and stepper motors,
merchandise that you have no catalogs for offline review, but bear in stepper motor controllers, power
immediate plans for. I like to limit non- mind that because surplus product MOSFETs, small CCD video cameras,
essential purchases to a certain dollar comes and goes, you’ll always want to and tools. Online sales with Web
amount per month or per quarter. I check the company’s website for the catalog.
often use surplus to refill depleted latest deals.
inventory. This includes basic items Bear in mind that many other American Science & Surplus
such as wire and switches. types of online resellers such as www.sciplus.com
For project-specific purchases – robotics specialty stores carry surplus AS&S sells surplus of all types,
such as motors and gears – I will electronics. These aren’t listed for the including some you’d normally find in
refrain from buying these until I need sake of space constraints. The moral: an Army/Navy surplus store. But they
them. Yes, this does mean sometimes It pays to study the Web catalogs of also carry motors, gears, batteries,
losing out on a great opportunity, but your favorite online retailer to be sure switches, and some electronics.
if you’re not careful it’s easy to you’re finding all the best deals.
over-buy, and end up with a garage APEX Electronics
full of components you may never A-2-Z Solutions, Inc. www.apexelectronic.com
use. This has happened to me, and I www.a2z-solutions.com Military and industrial surplus,
ended up donating several hundred A-2-Z Solutions carries new and with a major emphasis on wire of all
pounds of unused inventory to some surplus electronics. Mostly computer types and sizes. Huge selection, but
local robot user groups and schools. equipment (PCs, monitors, scanners, the retail store is not well organized,
As surplus electronics often and so forth). Online sales with Web in my opinion. Limited online sales
involves small parts, it is advantageous catalog. (only some components listed on
to organize your inventory so that you the site).
can find what you need quickly. AE Associates, Inc.
Plastic divider drawers sold at home www.ae4electronicparts.com Apex Jr.
improvement stores are a good AE Associates carries new and www.apexjr.com
option. For odd-size items, I use heavy used electronics, including switches, Surplus electronics and
duty self-sealing plastic bags, and connectors, electronic components mechanicals. General electronics,
write down the contents using a thick (resistors, capacitors, diodes, transformers, and “movie props.”
felt marker. I then put the filled bags transistors, etc.), and test equipment. Online store with Web catalog.
in shoe boxes. It only takes a moment Searchable database. Also sells a small
to sift through the bags to find just number of compact black and white Ax-Man Surplus
the part I need. and color video cameras. Local store www.ax-man.com
Of course, the real benefit of in Van Nuys, CA; online sales with Local (St. Paul, Fridley, and St.
shopping the electronics surplus Web catalog. Louis Park, MN) electronic and
outlets is the savings on things you mechanical surplus.
need right now. When you start a All Electronics Corp.
new project, get into the habit of www.allelectronics.com B.G. Micro
checking the surplus traders first. That All Electronics is one of the www.bgmicro.com
way, you’ll save money where you primary sources in the United States B.G. Micro is a haven for the
SERVO 07.2008 65
RoboResources.qxd 6/3/2008 11:12 AM Page 66

electronics tinkerer and robotics more. Online sales with Web catalog. motors is fairly small, but they make
enthusiast. Much of the stock is up for it with a wide selection of
surplus, so it comes and goes, but Electronic Surplus, Inc. other common (and some not-so-
while it’s being offered, it has a good www.electronicsurplus.com common) products.
price attached to it. Electronic Surplus has a wide
Online sales through Web selection of test equipment and MECI — Mendelson’s
catalog; printed catalog available. electronics parts. Liquidation Outlet
www.meci.com
BMI Surplus Electronix Express Surplus electronics, motors, and
www.bmius.com www.elexp.com even a special section for combat
Electronic surplus, much of it New and surplus electronics, robot parts — large motors, batteries,
high-end industrial or scientific; including passive components, motors, that sort of thing. Online sales with
opticals, laser. Online sales with relays, and more. Online sales with Web catalog.
Web catalog. Web catalog.
Quickar Electronics
Brigar Electronics Excess Solutions www.quickar.com
brigarelectronics.com www.excess-solutions.com Quickar carries surplus electronics
Handy selection of electronic Surplus electronics. Local store and tools. Online sales with Web
components, including unique and online sales. catalog.
sensors, construction hardware, and
motors, along with the usual Fair Radio Sales Skycraft Parts & Surplus, Inc.
transistors, resistors, etc. Online sales www.fairradio.com www.skycraftsurplus.com
with Web catalog. Though specializing in surplus Skycraft Parts & Surplus, Inc., is
for ham radio, Fair Radio also offers a “surplus mall” offering power
CTR Surplus plenty of general electronics and supplies, transistors, relays, ICs, wire,
www.ctrsurplus.com test equipment. Online sales with cable, heat shrink, transformers,
Surplus electrical, including Web catalog. A printed catalog is motors, fiber optics, test equipment,
motors, test equipment, and power available. resistors, diodes, and more. Local
supplies. Online sales with Web store in Florida, plus online sales with
catalog. Gateway Electronics, Inc. Web catalog.
www.gatewayelex.com
Electro Mavin Gateway Electronics is a general Timeline, Inc.
www.mavin.com electronics mail order and retailer. www.timeline-inc.com
Electro Mavin carries electronic Among their products are passive Surplus of all kinds: electronic,
components, motors, batteries, optics, and active components, motors, computer peripheral, laser, motors,
and test equipment. Online sales with electronic kits, gadgets, books, and LCDs, and more. Online sales with
Web catalog; retail store in Los tools. Some of their goods are new; Web catalog.
Angeles area. others are surplus.
Unicorn Electronics
Electronic Dimensions Hosfelt Electronics www.unicornelectronics.com
www.el-dim.com www.hosfelt.com Unicorn Electronics has a large
Electronic Dimensions carries General electronics. New and selection of electronic components,
military and industrial surplus, surplus. including passives, transistors, logic
electronics, radio receivers, ICs, relays, and more. Online sales
transmitters and parts, electron tubes, HSC Electronic Supply with Web catalog.
test equipment, and ham gear. Retail www.halted.com
store in Washington state, and online Online mail order sales, with Weird Stuff Warehouse
sales with Web catalog. walk-in retail stores in northern CA. www.weirdstuff.com
Halted offers a mix of computer and Weird Stuff Warehouse sells
Electronic Goldmine electronics surplus. surplus, including electronics. Retail
www.goldmine-elec.com store in Sunnyvale, CA. SV
Electronics Goldmine carries new Marlin P. Jones & Assoc., Inc.
and used electronic components www.mpja.com CONTACT THE AUTHOR
(LEDs, potentiometers, resistors, MPJA sells both new and surplus
heatsinks, transistors, etc.), robot electronic and mechanical products. Gordon McComb can be reached via
items, electronic project kits, and Their assortment of items such as email at robots@robotoid.com

66 SERVO 07.2008
DifferentBits.qxd 6/4/2008 1:54 PM Page 67

DIFFERENT
BITS
by Heather Dewey-Hagborg
RANDOM BITS
Throughout this column, we have relied on the idea of randomness to seed all of our
unconventional computing experiments. In this month’s article, we will take a brief
detour from code and hardware to examine just what the concept of “random”
actually means, how our microcontroller is implementing it, how this differs from a
computer, and some schemes for creating “true” random number generators.

F
irst, a little history. The concept of chance appears in therefore, of throwing two sixes in 24 throws is 1/36 x
most ancient cultures, dating back at least as far as 1/36 x 1/36 … 24 times or 0.4914. So it was not advisable
the ancient Egyptians use of the “talus,” an early for Chevaler de Mere to bet on throwing two sixes within
predecessor to the die. Fashioned from the knuckle or heel 24 throws after all, and probability theory was born!
bone of a hoofed animal, the talus had four possible So what does any of this probability stuff have to do
outcomes. It has been found alongside tomb illustrations with random number generation?
and scoreboards in Egyptian sites lending support to the Games of chance are, as Hacking called them
idea that playing dice and gambling were popular pastimes. “randomizers.” They are a way of abdicating responsibility
In the words of Ian Hacking, a historian of probability, for decision-making to the world of probabilities. In turn,
“It is hard to find a place where people use no randomizers results returned from such activities are random outcomes.
yet theories of frequency, betting, randomness, and At any given moment of the game, you cannot predict with
probability appear only recently. No one knows why.” certainty which number will appear next. And a set of ran-
An intriguing mystery! And indeed it is not until 1654 dom outcomes produces a sequence of random numbers
that what we know as probability today began to take containing no repeating patterns — a sequence which
shape. French nobleman Chevalier de Mere had a gambling Algorithmic Information Theory would call uncompressable.
problem. He wanted to know if it would be profitable to
bet that double-sixes would appear at least once in a set of AIT and Compressibility
24 dice throws. Luckily for him, he was a friend of one of
the most brilliant mathematicians of his day, Blaise Pascal. As Gregory Chaitin, founder of algorithmic information
De Mere posed the problem to Pascal and the theory of theory describes it, compression occurs if data can be repro-
probability emerged from the ensuing correspondence duced by a computer program with a smaller number of bits
between Pascal and his good friend Pierre de Fermat, than the original data contains. In other words, if I have a
another brilliant mathematician. data set of 500 one-byte measurements, the data contains
What Fermat and Pascal realized is what we all learned 500 * 8 = 4,000 bits. If I can find a repeating pattern in that
in grammar school — that with each throw of the dice, data, I can simplify it by creating a simpler symbol to represent
each possible outcome is equally likely. The possibility of each repeating subset of the sequence. I can then code an
throwing a six is therefore 1/6. They further realized that algorithm to process the input string and replace the
probabilities could be multiplied, and the probability of symbols based on a key. In this way, I can shrink the size of
throwing two sixes was 1/6 x 1/6 = 1/36. The probability, the data itself without losing any of the original information.
SERVO 07.2008 67
DifferentBits.qxd 6/4/2008 1:55 PM Page 68

DIFFERENT BITS
Example: random number, so how do they do it?
Original dataset
70, 15, 111, 32, 56, 70, 15, 70, 15, 7, 1, 3, 5, 20, 67, 54, rand() and srand()
42, 29, 113, 7, 1, 3, 5
Most likely, if you are reading this magazine you
Compressed dataset have also done at least a little programming and have
a, 111, 32, 56, a, a, b, 20, 67, 54, 42, 29, 113, b encountered some version of the rand() function or random
class. Almost every contemporary computer language and
Key platform has had some variant of this, from microcontroller
a = 70, 15 C to Java to Python. These functions generate what are
b = 7, 1, 3, 5 known as pseudo-random sequences of numbers. Why
pseudo-random? Well, for one thing, the random number
The more you can compress the data, the more generator in your computer is actually just an equation.
patterned or predictable it is, the less information it Most computer languages (including C and Java) contain
contains, and the less random the sequence of numbers is. a version of the classic algorithm, the linear congruential
By contrast, if the data cannot be compressed at all, “if the generator, as the source behind rand(). A linear congruential
smallest program for calculating it is just as large as it is ... generator works by computing each successive random
then the data is lawless, unstructured, patternless, not number from the previous, starting with a seed, X0. The
amenable to scientific study, incomprehensible. In a word, seed is generally what you supply to the algorithm by calling
random, irreducible!” (Chaitin, p. 64) srand(seed_value) before requesting a number from rand().
So randomness is equivalent to information. The more
information a sequence contains, the more difficult it is to Here is the formula:
compress, and the closer it is to randomness. In this light, Xn+1 = (aXn + c) mod m
white noise becomes pure information and a perfect source where Xn is the output set of random numbers
— in addition to games of chance — for generating random m is the modulus value
sequences. Anywhere noise is present, for example, radio a is the multiplier value
waves and the atmosphere, we can tap into it to extract c is the increment value and X0 is the initial seed value
random sets of numbers. (ex. supplied by srand)

Radioactivity In Ansi C, for example, m = 232, a = 1103515245, and


c = 12345. The number returned by the rand function is
Something that we thankfully have rare occasion to actually drawn from only bits 30:16 of the output result of
contemplate, radiation is an excellent source of random the function.
numbers. Radioactivity can be defined as “The spontaneous Similarly, Java uses the linear congruential generator
emission of radiation from the nucleus of an unstable atom. with an a value of 25,214,903,917 and a c value of 11.
As a result of this emission, the radioactive atom is converted,
or decays, into an atom of a different element that might Problems
or might not be radioactive.” (Defined by the Radiation
Emergency Assistance Center.) For our purposes, this means One of the defining characteristics of pseudo-random
that given an unstable atom, there is no way of predicting number generators is that given the same seed, they will
when it will lose its extra nucleon resulting in the radioactive always produce exactly the same series of numbers as output.
decay. By proxy, if you have multiple radioactive atoms, This is very useful when you need a sequence of data that
there is also no way of predicting the interval between appears random and is the same each time, for example, in
decays, and it is exactly this combination of random periods rendering computer graphics, but it is an annoyance for most
that can be used to generate random strings of binary. of the applications we have implemented in this column.
So, we know that randomness comes from dice The other problem with linear congruential generators
throws, card games, coin tosses, noise, and radioactive is that they are not terribly random. The longest random
decay, and I think we can safely bet that our computers are sequence it is possible to generate is the length of the
not striking up a game of cards each time we request a chosen modulus value (232 in C) before it begins to repeat
from the beginning; a characteristic referred to as the
FOR YOUR INFO period of the generator. Additionally, it has a characteristic
called serial correlation which means that there are
For more details on radioactive decay as a source of predictable patterns in the data. To return to our discussion
randomness, check out Hotbits, a company that supplies of algorithmic information theory above, this means that
random number sequences sourced from radioactive behavior the data could be compressed; it is not 100% random.
via the Internet; www.fourmilab.ch/hotbits/. In comparison, the Python programming language uses
68 SERVO 07.2008
DifferentBits.qxd 6/4/2008 1:55 PM Page 69

DIFFERENT BITS
a different random number generating algorithm known as their EX_EXTEE.C example for more details.
the Mersenne Twister. This algorithm has been proven to Other possible solutions for getting a good random
generate significantly more random data (the period is sequence on a microcontroller involve either developing
219937 – 1), but it requires more memory for implementation hardware specific to this task, or connecting to the Internet
and is therefore not suitable for microcontroller or space and querying a site like Hotbits (mentioned previously) or
intensive implementations. random.org.
If you do want to build your own dedicated random
What About Microcontrollers? number generating hardware, there are a few tried and
true methods. The first makes use of the principle that a
CCS (www.ccsinfo.com) reports their rand function to reverse-biased PN junction generates completely
be the following: unpredictable output known as “avalanche noise.” Lots of
details about making a random number generator using
unsigned int16 rand(void) this technique, as well as interfacing it to the PIC, are
{ available online from Rob Seward’s art project
_Randseed = _Randseed * 1103515245 + 12345;
return ((unsigned int16)(_Randseed >> 16) % ‘Consciousness field generator’ at http://robseward.com/
RAND_MAX); itp/adv_tech/random_generator/.
} The basic idea is to sample the weak avalanche noise
signal and amplify it dramatically. This value is then sampled
This is clearly derived from the ANSI C example we looked by a microcontroller either by sampling the time interval
at above, as you will recognize the linear congruential between spikes or simply choosing a constant sampling rate
function, simply separated into two steps. Notice also that and accumulating 1s and 0s each iteration. Because
the a and c values are identical to the ones above, and the succeeding bits may be more correlated than is desirable,
only difference between the two functions is that in the different unbiasing techniques exist. One popular technique
CCS version, m is the user defined value RAND_MAX rather called the Von Neumann method samples two bits at a
than 232. Note that this makes explicit the relationship time, discards them if they are equal, and keeps the first
between the maximum period of the random number one if they are different. Another method known as the
generator RAND_MAX and the modulus value m. XOR corrector samples two sets of pairs of bits and then
(Hitec did not respond to my query about their random performs an XOR operation on them and uses the output.
number generation technique, but it is probably safe to More information on the PN junction technique is
assume it is similar.) available at www.cryogenius.com/hardware/rng/.
Another method for hardware random number
A Better rand() generation makes use of the radioactivity method described
earlier. The basic premise is to use a Geiger-Müeller tube
If you have read some of the examples from earlier to count instances of individual atom’s decay in a given
installments of this column (neural networks, genetic isotope. Again, the time interval between decays can be
algorithms), you have undoubtedly noticed plentiful use of used, or a fixed sampling period can be established and the
the rand() function. And if you have actually implemented number of decays per unit of time can be counted.
any of these examples, you have also noticed that the A detailed description of this idea is available on Bernd
methods used to seed the PIC random number generator Ulmann’s blog at www.vaxman.de/projects/rng/
are less than satisfactorily random. I will conclude this rng.html.
month’s column by briefly explaining some possible Finally, if you can’t do the user keypress, EEPROM, or
methods for generating better random seeds on the PIC external hardware techniques, you can try sampling a
and providing some links to more details. floating pin on the analog-to-digital converter of your PIC,
CCS recommends measuring the time in microseconds and accumulating the least significant bit each sample. To
between power up and the first user keypress, and then maximize your randomness on this technique, test out one
using the least significant bits of that measurement. In terms
of code, this involves using a hardware timer to generate
interrupts and counting the number of intervals between
SUGGESTIONS FOR FURTHER READING
device initialization and the user’s keypress. An example of • Gregory Chaitin: Meta Math!
this is available on the CCS website at www.ccsinfo.com/
content.php?page=compexamples#seconds. • Ian Hacking: The Emergence of Probability: A
Their suggested workaround solution for when user Philosophical Study of Early Ideas about Probability,
input is not possible is saving an initial seed in EEPROM and Induction, and Statistical Inference
then incrementing it each time the processor is reset, and
saving the new value in place of the old. CCS has read and • Peter J. Bentley: The Book of Numbers: The Secret of
write EEPROM functions available for doing exactly this; see Numbers and How they Changed the World

SERVO 07.2008 69
DifferentBits.qxd 6/4/2008 1:56 PM Page 70

DIFFERENT BITS
of the unbiasing techniques just mentioned. computer generated version are available online at
To close on a completely random note, I will leave you http://sunsite.univie.ac.at/Mozart/dice/. SV
with a fun example of a very early musical piece that took
advantage of true random number generation. In 1787, CONTACT THE AUTHOR
Mozart composed a set of instructions for a ‘musical dice
game’ — a method of using consecutive dice throws to Heather Dewey-Hagborg can be contacted via email at
generate a minuet! Lots more information about this and a heather.servomagazine@gmail.com

CONTROLLERS & ROBOT KITS – SENSORS – DISPLAYS

Easy to Connect
!
ST
CO Free
LO
W Expert W
LO Technical CO
Support ST
LOW COST !

www.c-stamp.com
1 (800) 985-AWIT Professional SW Dev. Tools

For the finest in robots,


parts, and services, go to
www.servomagazine.com
Electronic Parts & Supplies and click on Robo-Links.
Since 1967

70 SERVO 07.2008
WebstoreJuly08.qxd 6/3/2008 8:29 AM Page 71

Lo
W h ao k
The SERVO Webstore
Attention Subscribers ask about your discount on prices marked with an *
t
New ’ s

SERVO Magazine
Bundles

Published by T & L Publications, Inc.


Save $10
$57 off the
normal
per bundle
price!!
Now you can get one year’s worth of all
your favorite articles from SERVO Magazine
in a convenient bundle of print copies.
Available for years 04, 05, 06, and 07.
FIRST Robots: Rack 'N' Roll Robot Builder’s Cookbook Forbidden LEGO
Behind the Design by Owen Bishop by Ulrik Pilegaard / Mike Dooley
by Vince Wilczynski / Stephanie This is a book for
Slezycki first-time robot Build the Models
The second annual builders, advanced Your Parents
book highlighting the builders wanting to Warned You
creativity and process know more about Against.
behind 30 winning programming robots,
robot designs from and students in Forbidden LEGO
the 18th annual further and higher introduces you to
international FIRST education tackling the type of free-
Robotics Competition. microcontroller- style building that
LEGOs master
The FIRST organization, based practical
builders do for fun
founded by Dean work. They will all find this book a unique in the back room. Using LEGO bricks in com-
Kamen (inventor of the Segway), promotes and exciting source of projects, ideas, and bination with common household materials
education in the sciences, technology, and techniques to be combined into a wide (from rubber bands and glue to plastic
engineering in collaboration with sponsors range of fascinating robots. $29.95 spoons and ping-pong balls) along with
including Motorola, Xerox, NASA, Delphi, some very unorthodox building techniques,
General Motors, and other companies Mechanisms and Mechanical you’ll learn to create working models that
invested in science education. $39.95 Devices Sourcebook LEGO would never endorse. $24.95
by Neil Sclater / Nicholas Chironis
Build Your Own The fourth edition Robotics Demystified
Humanoid Robots of this invention- by Edwin Wise
inspiring engineering YOU DON'T NEED ARTIFICIAL INTELLIGENCE
by Karl Williams
resource covers the TO LEARN ROBOTICS!
GREAT 'DROIDS, INDEED!
past, present, and Now anyone with an
future of mechanisms interest in robotics can
This unique guide to
and mechanical gain a deeper under-
sophisticated robotics
devices. You’ll find standing — without for-
projects brings
drawings and mal training, unlimited
humanoid robot
descriptions of more time, or a genius IQ. In
construction home to
than 2,000 compo- Robotics Demystified,
the hobbyist. Written
nents that have expert robot builder
by a well-known figure
proven themselves over time and can and author Edwin Wise
in the robotics
be incorporated into the very latest provides an effective and totally painless
community,
mechanical, electromechanical, and mecha- way to learn about the technologies used
Build Your Own
tronic products and systems. Overviews of to build robots! $19.95
Humanoid Robots provides step-by-step
directions for six exciting projects, each robotics, rapid prototyping, MEMS, and
costing less than $300. Together, they form nanotechnology, along with tutorial chapters We accept VISA, MC, AMEX, and DISCOVER
the essential ingredients for making your on the basics of mechanisms and motion
Prices do not include shipping and
own humanoid robot. $24.95* control, will bring you up-to-speed quickly
on these cutting-edge topics. $89.95 may be subject to change.

SERVO 07.2008 71
WebstoreJuly08.qxd 6/3/2008 8:34 AM Page 72

To order call 1-800-783-4624


Robot Builder’s Sourcebook
by Gordon McComb
Fascinated by the

Oil prices getting


world of robotics but
don’t know how to
tap into the incredible

to you, too?!
amount of informa-
tion available on the
subject? Clueless as

Stay home,
to locating specific
information on robot-
ics? Want the names,

read a book.
addresses, phone
numbers, and websites of companies that
can supply the exact part, plan, kit, building
material, programming language, operating
system, computer system, or publication
you’ve been searching for? Turn to Robot
Builder’s Sourcebook — a unique clearing-
The online store @
house of information that will open 2,500+ www.ser v omagazine .com
new doors and spark almost as many new
ideas. $24.95

CNC Robotics Linux Robotics The Amateur Scientist 3.0


by Geoff Williams by D. Jay Newman The Complete Collection
If you want your robot by Bright Science, LLC
CNC Robotics gives you to have more brains than There are 1,000
step-by-step, illustrated microcontrollers can projects on this CD, not
directions for designing, deliver — if you want to mention the
a truly intelligent,
constructing, and testing high-capability robot — additional technical
a fully functional CNC everything you need info and bonus
robot that saves you 80 is right here. Linux features. It
percent of the price of an Robotics gives you step- doesn’t matter if you’re
off-the-shelf bot — and by-step directions for a complete novice
that can be customized “Zeppo,” a super-smart, single-board- looking to do their first
to suit your purposes exactly, because you powered robot that can be built by any science fair project or a
designed it. Written by an accomplished hobbyist. You also get complete instructions super tech-head gadget
workshop bot designer/builder, this book for incorporating Linux single boards into freak; there are enough projects on the
your own unique robotic designs. No
gives you everything you need. $34.95 programming experience is required. This single CD-ROM to keep you and 50 of your
book includes access to all the friends busy for a lifetime! $26.99
downloadable programs you need.
$34.95

NEW
! FREE!
with any
e
Robot purchas 0
Programmer's over $1 0
Bonanza -in
Phone ly!
by orders o
n
John Blankenship,
Samuel Mishal
The first hands-on SERVO
programming guide
for today's robot hobbyist! Magazine
Get ready to reach into your programming
toolbox and control a robot like never before! T-Shirts
Robot Programmer's Bonanza is the one-stop From HomoSapien to RoboSapien For men and women Before R2D2 there was R1D1
guide for everyone from robot novices to Get your very own limited-edition SERVO Magazine T-shirt. Shirts come
advanced hobbyists who are ready to go
in sizes S, M, L, and are available in either black or white.
beyond just building robots and start
programming them to perform useful tasks. All shirts are 100% preshrunk cotton.
$29.95 Limited time offer. Call 1-800-783-4624.
72 SERVO 07.2008
WebstoreJuly08.qxd 6/3/2008 8:38 AM Page 73

Or order online www.servomagazine.com


BACK ROOM SPECIALS
123 Robotics Experiments
for the Evil Genius
S AVE 10% plus by Myke Predko
If you enjoy tinkering in
GET FREE US your workshop and have
SHIPPING! a fascination for robotics,
you’ll have hours of fun
working through the 123
experiments found in this
Buy both these books innovative project book.
together in the month
More than just an enjoy-
of July 2008
able way to spend time,
The LEGO Mindstorms Building Robots with these exciting experiments also provide a
NXT Idea Book and LEGO Mindstorms NXT solid grounding in robotics, electronics, and
programming. Each experiment builds on the
and save 10% off the list price. Plus get free shipping in the US!!
skills acquired in those before it so you
Call 800 783-4624 or order online @ www.servomagazine.com develop a hands-on, nuts-and-bolts
List Price $29.95 Sale Price $ 26.95 List Price $39.95 Sale Price $35.95 understanding of robotics. Sale $22.95

Bionics for the Evil Genius The Definitive Guide to Fuel Cell Projects
by Newton C. Braga Building Java Robots for the Evil Genius
THE EVIL GENIUS by Scott Preston by Gavin D J Harper
TACKLES BIONICS! The Definitive Guide to FUEL YOUR EVIL
Step into the future -- (or Building Java Robots URGES WHILE YOU
the past, if you have a is for educators, BUILD GREEN
touch of Dr. Frankenstein students, hobbyists, ENERGY PROJECTS!
in your soul) -- with these and startups looking Go green as you amass
25 incredibly cool bionic for Java/hardware power! Fuel Cell
experiments! interaction. This book Projects for the
Demonstrating how life shows you how to use Evil Genius broadens
forms can be enhanced, combined, your PC to build NEW your knowledge of this
manipulated, and measured with electronic robots, and how you ! important, rapidly
and mechanical components, these can interface with a developing technology and shows you how
inexpensive projects from internationally microcontroller to do the basics. You’ll learn to build practical, environmentally conscious
renowned electronics guru Newton Braga to design your robot to navigate, see, speak, projects using the three most popular and
provide hours of fun and learning. recognize your face, listen to you, and build widely accessible fuel cells!
$24.95 Sale Price $ 22.95 maps. $55.95 Sale Price $ 47.95 $24.95 Sale Price $ 22.95

PROJECTS
H Racer video clips can be found in the on-line store product descriptions!!
The SERVO BUDDY
KIT

An inexpensive circuit you


can build to control a servo With this kit, you now can see and
without a microcontroller! feel the future of energy generation
For more information, in your own hands!
please check out your Recently named as one of the Best Inventions of 2006 by Time Magazine, the H-racer is now
May 2008 issue the best selling fuel cell product in the world. The H-racer is a micro-version of what engineers
and scientists have been dreaming about for real cars: combining hydrogen with oxygen to
or go to our website @
generate a DC current to power an electric motor. Unlike a gas-powered car engine, the only
www.servomagazine.com byproducts of this electrochemical process are electricity, heat, and pure water. With the
Subscriber’s Price $39.55 H-racer, you can witness the power of new energy technology in the palm of your hand.
Non-Subscriber’s Price $43.95 Horizon has created this unique, patented miniature fuel-cell car and hydrogen refueling station.
PCB includes article reprint.
All you need to do is add water. Only $115.00 plus S/H
SERVO 07.2008 73
Appetizer.qxd 6/4/2008 3:46 PM Page 74

Dusting Robots
One Woman’s View of Life
With an Electronics Hobbyist
by Kym Graner

When you were five, 10, or even 15 years old, what did you want to be when you grew up?
I’m betting those career aspirations changed with your interests until you eventually became
whatever you are today. Maybe you wanted to be a fireman-superhero-doctor, or maybe
a veterinarian-cheerleader-cop. I wanted to be a mom. From the time I was about 12,
I knew that was the job for me. Nothing showy, nothing extremely technical or requiring
decades of schooling. I just loved kids, cooking, crafts, and the outdoors. I couldn’t think
of anything better than being a stay-at-home mom.

B y the time I graduated high


school, I had already met the
love of my life, Vern, and was well on
had arrived. I had picked up some
techie skills through my job, but didn’t
really anticipate ever needing them
fledged Novell CNA with a strong A+
skill set. My husband was (and is) an
excellent network engineer. As he
my way to my career goal. We got again, except for working on our designed and installed networks, I
married in our early 20s and, although home network or fixing my sister’s would assist and then go on to
I had a “day job,” I embraced my computer. Then came reality. administer, repair, and upgrade as
home life in my free time. Fast- A mere two months after our son needed. Our son became accustomed
forward 10 years and enter our first was born, Vern and I decided to open to a wide range of environments as
child, Nic. Finally! The time to stay a small ISP and network services he traveled with me to customer sites
home and hone my mothering skills company. My marginal techie skills and enchanted everyone there. After
took a quick ramp up to being a full- the business settled into more ISP and
Nic as a baby (left). Nic now (right). less network services, child number
two was on her way and I once again
attempted the stay-at-home thing. But
my quiet Suzy Homemaker world was
not going to stay that way for long.
By then, my husband’s electronics
interests had branched out to include
the Halloween world.
Let me explain: My husband is a
prolific designer of devices. He has
developed the Robo Spin-Art machine,
the Ponginator, Therepings, Ping Pong
Printer, Sonar Station, a talking skull in
a coffin, a 20-foot wide “venomous”
spider, and so much more. The ideas
he has still on the drawing board have
the same potential for eye-catching
74 SERVO 07.2008
Appetizer.qxd 6/4/2008 3:08 PM Page 75

Sami as a baby (left). Sami now (right).

fun that the ones already living in the


outside world possess. He’s always
been like this — inventing things since
he was in grade school. He really
can't help it.
Many of these creations came
together in 2005 to make an awe-
some Halloween Haunt that the
neighborhood still talks about.
Unfortunately, it was made at the
expense of my one beautifully deco-
rated room — the dining room. My
vintage cherry Queen Anne dining
set, hutch, and my grandmother's
antique desk had to take shelter in
Exclusively at Jameco…
my bedroom. The stained glass
chandelier was removed, black
The Lowest Prices…
plastic sheeting was stapled onto
my gorgeous crimson walls, and
Guaranteed!
voilá! One scary spider’s lair was Save 3% to 5% Save 15%-25% Save 30% or more!
created. Like I said, it was fab — Looking to save on Save more when a Looking for killer deals?
thousands of Name Brand specific manufacturer is Jameco buyers often find
award-winning, even! But just last
components? Jameco not required. Major Brand Factory Overruns from
weekend, I found another staple in
offers these popular semi’s are sourced some of the industry’s
the ceiling, holding just a scrap of products for 3% to 5% from 5-6 specific major biggest names. That
spider webbing. below market price, and manufacturers, plus we means savings of 30%
The accoutrement that we guarantee it! also offer Jameco Brand and more to you!
currently grace my dining room and Generic passives for
include two human-sized robots/ even greater savings.
sculptures, the coffin guy, Bob —
who, at roughly six feet in height 3 Levels of Choice
— is also human-sized, a Stargate
Defender machine, a trashcan 3 Levels of Savings
zombie, and an evil spider-con-
trolled robot. My living room set
includes a former motorized
wheelchair base, turned mobile
platform for an in-process “boogie
bot,” one of the Robo Spin-Art
machines, and a supply of ping
pong balls for the Ping Pong
Printer. Rather than reflecting my
daydreaming interest in a Better
Homes & Gardens living space, our
house now sports a look that was
once described by a friend as
looking like Godzilla swallowed a
RadioShack and then threw up. Other Jameco Advantages:
There’s a part of me that wishes  We offer over 300 Major Manufacturers
my home could revert to the  99% of catalog products ship the same day.
“normal” decorator dream it started  Lowest prices guaranteed, or we pay 10%.
to become. But then I look at all
Order 24 hours a day, 7 days a week
the fun we’ve had making and
showing off these things, teaching www.Jameco.com
our children to design and build, Or call 800-831-4242 anytime
and getting to meet like-minded SEMICONDUCTORS • PASSIVES • INTERCONNECTS • ELECTROMECHANICAL • POWER
people, and it makes the “clutter”
worth the sacrifice. SV
SERVO 07.2008 75
Full Page.qxd 6/2/2008 10:40 AM Page 76

76 SERVO 07.2008
Then&Now.qxd 6/4/2008 10:02 AM Page 77

Then NOW

a n d
ROBOTICS — A HISTORICAL
PERSPECTIVE
b y T o m C a r r o l l

O ver the years, I have written


about advances in all types of
robot designs, robot technology, and
Capek had yet to write his 1920 play,
RUR, which stood for Rossum’s
Universal Robots. The Czech word,
THE THREE LAWS
OF ROBOTICS
various robotic subsystems in this robota meant ‘serf,’ ‘drudgery,’ or First Law: A robot may not injure
column. In each article, I have tried to ‘laborer’ in Czech — a person who a human, or, through inaction, allow
cover advances in the science of does hard work. Karel attributes his a human being to come to harm.
robotics and have covered the history brother, Josef, as the inventor of the
Second Law: A robot must obey the
of a part of robotics in a specific word robot, though he first suggested orders given it by human beings
way. I have never tried to examine the word roboti. It was changed to except where such orders would
the way that we humans have robot for the play. The term robotics conflict with the First Law.
viewed these creations of ours as was later derived from a mix of robot
they have slowly taken over many and electronics or mechanics (there Third Law: A robot must protect
parts of our lives. I have often are those who steadfastly stand by its own existence as long as such
wondered just what mindset each of the two words that are protection does not conflict with the
developed in people’s thought attached to robot). First or Second Law.
processes as the science of robotics Robots were always thought of
took a certain turn. We, as robot as anthropomorphic or ‘man formed’ on the lowly vacuum tube.
experimenters and hobbyists, certainly in the plays and movies of a century Asimov’s robots were also a
view robotics in a way different from ago. The earliest robots of man’s bit kinder to mankind. In later
the average person. We don’t just sit imagination were machines to be years, his ‘Three Laws of Robotics’
back and read about how they weld feared. Maria from the film Metropolis have had a great impact on all
and paint our cars in far away was anything but an agreeable levels and types of robots including
factories. We build our own or buy creature. The many stories of Isaac the design and manufacturing of
ready-built robots or robot kits so we Asimov (Figure 1) from the 1940s on industrial robots — the only robots
can see the technology at work, first brought a semblance of ‘man-like’ to
hand. As a society, robotics is now these machines. They walked on two FIGURE 1. The Late Dr. Isaac Asimov.
changing our lives in ways we never legs as nobody had a clue in those
imagined. days just how difficult it was to have a
machine balance while walking.
The ‘20s to the ‘50s — Asimov had enough technical
knowledge to realize that the
The First Visions of electronics of his day were not
Robots in Our Society sufficient for a robot’s brain, so he
envisioned the ‘positronic brain’ in his
The idea of a non-human robot tales as the mystical power
humanoid in our society has been behind his creations. There was no
around for thousands of years. Most way he could have imagined the
of these mythical creatures were not cheap Flash drives that we use today
particularly nice to us. A hundred that contain billions of transistors as
years ago, the very word robot did memory cells. Transistors were still
not exist as Czech playwright Karel years in the future so electronics relied
SERVO 07.2008 77
Then&Now.qxd 6/4/2008 10:03 AM Page 78

when asked to car factories. Newsreels and


handle items many magazines showed images of rows of
times. The media mechanical servants snaking their
touted these times lanky arms into car frames, sparks or
as the ‘Robotics paint mist spewing onto the floor.
Age’ and a Robot ‘intelligence’ — if that word
magazine was applied at all — usually meant an
actually published expensive mini-computer or maybe a
in the ‘80s with mainframe in another room, linked to
that same name. the robot by a bi-directional RF or
FIGURE 2. Joe FIGURE 3. Unimate Robot. “The ‘steel collar’ wired link. Sensors were almost
Engelberger. Photo
courtesy of Industry Week. worker has non-existent on industrial robots.
arrived!” touted the headlines. Expensive cameras and factory
of the ‘60s with sufficient power to Industries welcomed these automation devices served as sensors
injure a human being. machines as workers who never tired, for university experimental robots.
never asked for a raise, and never got Large drum memories held crude
The ‘60s and ‘70s — sick. Human factory workers first programs for the robots, but, hey,
looked at these intruders with a jaded they worked, and more and more
Robots Arise from eye, worried that their jobs were at were being installed in factories
Fiction to Reality stake. Soon, they saw their dirty, around the US and the world.
repetitive, and dangerous jobs being You could ask a kid on the street
When George Devol received his replaced by the machines and their in those years, “What is a robot?” He
patent on universal automation for job status being elevated to robot might, at first, say it was Tobor The
‘programmable transfer of articles in operator or robot repairman. Workers Great from the movie of the same
a factory’ and later met young Joe were happy and management even name. You could then ask, “No, what
Engelberger in 1954 (Figure 2), happier. The robot tide rapidly spread is a real robot?” He would then
Unimation was born and so was the overseas, primarily to Japan. The describe the rows of robots in a car
first industrial robot — nothing at all world was now accepting robots factory, as would any adult of those
like the walking creatures of film and in society. times. Others might mention the
literature. This was the first pivotal The presence of ‘the Three Laws’ unmanned Surveyor or Viking lunar
point in the history of robotics. Robots did not prevent Robert Williams, a landers, or the space probes sent
were now real and useful tools to worker in a Ford Motor Company across the solar system to explore our
humanity. These two men were plant in Flat Rock, MI, from being planetary system. Some might even
thinking only of ways to automate killed by a robot in early 1979. He felt recall the ‘hot cell’ teleoperators
manufacturing processes, not to that the robot was operating a bit too at Oak Ridge, TN that handled
replace people in their jobs. slow and was retrieving a part from a radioactive materials by remote
The original Unimate robot had a bin when the robot’s arm struck him control. All will agree that robots are
single arm extending out of a turret, in the head, killing him instantly. A now real creations of man.
much like a military tank gun (Figure massive structure moving at high
3). However, despite the lack of speed can be very dangerous. No, the The ‘80s — Japan
human form, the robot was here to robot wasn’t acting in anger that a
stay as the first Unimate toiled away human was taking his job back, but a Becomes the Leader
in a General Motor’s plant in New jury awarded Williams’ family $10 in Robotics
Jersey. ‘Robots’ became the new tools million from the robot’s manufacturer.
that made American industry the envy Two years later, a Japanese worker, The US can take pride in many
of the world. Kenji Urada, was killed in a Kawasaki innovations in robotics but it is Japan
Factory robots started out plant when a robot that he thought that has taken the lead in implementa-
handling parts and soon were spot he had turned off, pushed him into a tion of robotic technology. In the
welding and spray painting cars on grinding machine. beginning, virtually all of the robot
assembly lines. Robots always seem Throughout the ‘60s, the vast manufacturers were based in the US
extremely powerful to the average majority of the world’s robots were but today’s list of the top companies
person but few realize that a typical the industrial variety. Talented are all Japanese based. There are still
industrial robot can actually only experimenters built some machines a few innovative US, Canadian, and
handle a small payload. What they are in their garage workshops and European robot companies but most
capable of doing is moving this small universities allowed a few grad stu- of the original US companies were
payload quickly and precisely and dents to craft a robot or two for a either bought out by their Asian
many times; thus the need for a thesis project, but the word ‘robot’ to competition or went out of business.
massive structure. Humans quickly tire most people meant the machines in Japan also has the greatest
78 SERVO 07.2008
Then&Now.qxd 6/4/2008 10:03 AM Page 79

number of industrial robots installed in shows around the country. The


their factories; a good reason they are world’s industries touted all these new
one of the world’s top manufacturing applications for robotic technology as
powers. By the end of 2005, Japan the Robot Revolution.
had over 373,000 industrial robots in
place in factories, with the US in a Service Robot — a
distant second place with 131,000.
Sweden, Germany, Korea, Canada, New Category
and other countries were soon A new tide of interest in robotics
installing robots and even manufactur- began to develop. With varieties of FIGURE 4. Motoman
ing their own. The UP400RN robot in robots spilling over into all aspects of UP400RN by Yaskawa.
Figure 4 is made by Motoman, the life in the early ‘80s, it was natural
North American name for the for the large electronic kit maker, students found their special interests
Japanese parent company, Yaskawa. Heath, to design a robot kit for the within mechanical engineering,
This company has a line of over 250 experimenter and hobbyist (Figure 5). electrical engineering, computer
different robots for all types of indus- The Hero 1 was an instant hit, and science, physics, computer
tries, not at all untypical for modern a later Hero Jr. and the more engineering, and other technical
robot manufacturers. The proverbial sophisticated Hero 2000 rounded out fields such as chemistry and optics.
‘yanking the rug from under North the line. With Heath long since out of Once the dominate force in
American robot manufacturers’ was business, for those who are interested, robotics, industrial installations took
the second pivotal point in the history Robert Doerr at www.robots a back seat to newer applications.
of robotics. Actually, the rug wasn’t wanted.com has many Hero parts Robot technology had now spread out
yanked; it was handed over. and whole robots to sell. Bob also from the factory floor to teleoperators
handles the equally famous RB5X for remote manipulation, mobile
The ‘Robot robot that cost a whopping $2,295 in military robots, and remotely-operated
1984 (Figure 6). vehicles for under the sea, on the
Revolution’ Begins Nolan Bushnell of Atari fame ground, and in the air. Medical
in the ‘80s started a company called Androbot applications were replacing the
and began selling his ready-built TOPO surgeon, floors were being cleaned by
Applications soon spread from and BOB robots in early 1983, or as robots, and medicines delivered by
just material handling, spot welding, he stated — “the year 1 AB,” for the robot couriers in hospitals. Robots
and painting to more sophisticated first year of AndroBot, or After Bob, snaked their way through pipes for
operations such as vision-aided pick as others have said. Universities and inspection, crawled up the sides of
and place systems. The SCARA community colleges began to offer buildings to clean windows, delivered
(selective compliance assembly robot courses in robotics for the budding food to tables in restaurants, and
arm) soon became the most popular roboticist — a new buzz word that entertained us in our homes.
robot configuration when it was first began to make the rounds in the late
used in 1978 in small assembly ‘80s. I’m assuming that the word was FIGURE 6. RB5X.
operations such as electronic circuit derived from robotic and scientist. As
board ‘parts insertion.’ Gantry x-y-z the science of robotics comprises so
axis robots were developed to handle many diverse technologies, robotics
large and small parts. AGVs (automat-
ed guided vehicle) took a departure FIGURE 5. Hero Robot.
from fixed base robots and moved
about factory floors carrying parts,
guided by invisible paths on the floor
or by other means. Surveillance and
security robots silently guarded factory
and office floors.
Robot applications were
spreading outside of the typical
factory floor to many new uses. The
Robotic Industries Association (RIA)
and the Robotics International of the
Society of Manufacturing Engineers
(RI/SME) were in their heyday in
the mid-1980s with thousands of
members attending the many industry
SERVO 07.2008 79
Then&Now.qxd 6/4/2008 10:04 AM Page 80

need “man” in the loop to small, furry robot animal reminiscent


accomplish something intelligently. of the characters in the Gremlins
It is this seemingly intelligent movie (Figure 7). This talking and
appearance of robots that somewhat moving creature sold over
appeals to a new breed of robot 40 million units. Sony, the huge
enthusiasts — those with strictly electronics manufacturer first
computer science or AI produced its robot dog (and cat)
backgrounds. Once called gear named Aibo in 1999. Many people
heads for their mechanical bent, wondered just who would shell out
the new generation of robot $1,500 to $2,000 for a plastic dog but
experimenter now has at his almost 200,000 did until Sony ceased
or her disposal all types of production in early 2006. It is
sophisticated microcontrollers, rumored that they will bring out a
sensors, vision systems, and new model this year called the Aibo
navigation methods to create PS to be controlled by their latest
some ‘killer’ robots. PlayStation (Figure 8).
History will show that these
FIGURE 7. Furby. Sophisticated introductions of sophisticated robot
toys were an important turning point
Entrepreneurs searched for different Robots Become in robotics and its acceptance with
ways to use this new technology. Available to Everyone non-technical people. CrustCrawler,
Lynxmotion, Parallax, and many other
Interest in Robotics Gone are the old robot kit companies advertising in SERVO
companies as new hobby robot now supply or make some amazing
from the ‘90s to the manufacturers step up to the plate. robots or robot components for robot
Present is Phenomenal LEGO — the maker of the plastic block experimenters.
sets for kids — develops some The average person has no clue
Robot experimenters have long amazingly unique and powerful robot how these creations of ours work,
been interested in robotics as a means kits with their Mindstorms series. so our various clubs have arranged
of using a machine to do something Robot Sumo moves from Japan and exhibitions for the public. Robothon
physical, in that it either investigated becomes popular in the US and the was one of the larger robotics
its environment by roving about or it world. Dean Kamen, inventor of the expositions developed and presented
actually made changes to the environ- Segway Personal Transporter of 2001, by the Seattle Robotics Society at
ment. With the advent of affordable had interests in robotics back in the Seattle Center — home of the
microprocessors and microcontrollers, 1989 when he founded FIRST (For Space Needle. For years, Robothon
robots can now operate on their own. Inspiration and Recognition of introduced thousands to the exciting
These autonomous robots do not Science and Technology), a robotics science and hobby of robot building
competition that in 2008 had and robot competition. This year, it
FIGURE 8. Aibo. over 37,000 high school students will not be held, not because there
in robotics teams across the is not interest for such events but
nation. A recent article in Electronic because leadership of the Robothon
Design magazine indicated that has kept it alive for so many years that
students in the FIRST competition burnout has occurred.
were more likely to attend college The same applies to the Portland
and were likely to be interested in Robotics Society’s popular PDXBot and
engineering fields, were more other group’s events around the
community oriented, and aspired to country. However, others such as the
post-graduate studies. Does this big San Francisco RoboGames and
mean students who entered the the Dallas group’s contests are still
competitions were then inspired to packing ‘em in. The leadership of
go into robotics and engineering, or these events has seen a gradual
that FIRST naturally attracted the lessening in the attendance of these
type of student who would have exhibitions, unfortunately. Possibly the
gone this route, anyway? downturn in our economy is making
Robots have always appealed money a bit tight for expensive
to children, and the child in all of hobbies. Maybe the rest of society has
us. Tiger Toys brought forth the become so used to robots vacuuming
extremely popular Furby in 1998 — a our floors and entertaining us that a
80 SERVO 07.2008
Then&Now.qxd 6/4/2008 10:04 AM Page 81

demonstration of a championship Yet, the March 27th edition of robotics interests you most. Outside
Robo-Magellan or a 20-servo Electronic Design had a picture of of the usual timelines, every “history
humanoid walker brings a bored “ho Star Wars’ C-3PO on the cover with of robotics/robots” that I Google
hum” from the average bystander. Do the article title under it stating: “The always seems to have a different
they really want a full-size Honda Droid War: Cost, Lack of Industry slant on the subject. I would very
Asimo as a servant in their homes? Focus Clouds Robotics Future.” The much appreciate some of you readers
Does this hiccup in interest signify article actually paints a rosier picture of SERVO to email me with your
another turn in the history of robotics? of the state of robotics in the actual feelings about the future trends of
Possibly. Have we failed as robotics essay, with an emphasis of LEGO’s robotics, for it is you who will
enthusiasts? No way! The history of Mindstorms NXT robotics kit and ultimately change the directions of
any technology has always gone National Instrument’s LabVIEW experimental robotics with your
through these cycles of interest and software package. purchases, designs, exhibition
acceptance. The steam engine was a So, you see, there are always attendance, and comments at
marvel until it drove trains, ships, and multiple sides to any historical subject, meetings and on the web. SV
factories everywhere. The common whether a part of the Civil War or
light bulb that lit the world as the the subject at hand we all love so
Tom Carroll can be reached via email
marvel of a century ago, is so much. It just depends on your point
at TWCarroll@aol.com.
commonplace that it is ignored today, of view and what particular facet of
soon to be replaced by LED lamps.
The amazing $2,000 cell phone of
two decades ago is now given away
and is in the hands of most school
children.

The Robot Revolution


The recent April 21st edition of
U.S. News and World Report had an
article entitled ‘The Robot Revolution
May Finally be Here.’ I’m thinking,
“They’re saying this again, after 20
years?” The article went on to
mention that iRobot has sold almost
three million Roombas — the vast
majority of the new helper robot
category. “Personal robots emerged as Looking for a GIFT or maybe just something
a mainstream product last Christmas, special for yourself?
with Sharper Image’s catalog
featuring a “Shop for Bots” section, Check out our website and take a look at
says Philip Solis of market tracker ABI all our other robotic items for sale!
Research,” as written in U.S. News.

Advertiser Index
All Electronics Corp. .........................25, 70 Jameco ......................................................75 Robot Craft ...............................................70
AP Circuits/e-pcb.com ............................10 Lorax Works ........................................25, 70 Robot Power ............................................23
AWIT ..........................................................70 Lynxmotion, Inc. .......................................11 RobotShop, Inc. .................................70, 76
Boca Bearings ....................................23, 70 Maxbotix ...................................................70 Skycraft Surplus ........................................25
Mini Robotics .....................................63, 70
CipherLinx Technologies .........................70 Solarbotics/HVW .....................................14
Net Media .................................................83
CrustCrawler .............................................82 solderbynumbers.com ............................25
Parallax, Inc. ...............................Back Cover
Electronics123 ..........................................25 PCB Pool ..............................................21, 70 Sparkfun Electronics ..................................2
Endurance Robotics ................................70 Pololu Robotics & Electronics ..........43, 70 Technological Arts ...................................70
Hitec ..........................................................15 Rabbit, A Digi International Brand ............3 Vantec .......................................................10
Images Co. ................................................70 RoadNarrows Robotics ...........................24 Weird Stuff Warehouse ...........................25

SERVO 07.2008 81
Full Page.qxd 6/2/2008 10:33 AM Page 82
Full Page.qxd 4/29/2008 4:05 PM Page 83
backcvr.qxd 6/2/2008 10:30 AM Page 84

Anda mungkin juga menyukai