You are on page 1of 84

V

o
l
.

5

N
o
.

1
2
S
E
R
V
O
M
A
G
A
Z
I
N
E
H
E
R
O

S
E
R
V
O
S

S
P
A
R
E

T
H
E

R
O
D
,

S
P
O
I
L

T
H
E

B
O
T

T
A
S
K

P
R
I
M
I
T
I
V
E
S
D
e
c
e
m
b
e
r

2
0
0
7
Cover.qxd 11/6/2007 3:46 PM Page 84
Order 24 hours a day, 7 days a week
www.Jameco.com
Or call 800-831-4242 anytime
Jameco Electronics. *According to the line cards on their web sites on August 28, 2007. Trademarks are the property of their respective owners.
OTHER JAMECO ADVANTAGES:
More major brands of semis than any other catalog.
99% of catalog products ship the same day.
Lowest prices guaranteed, or we pay 10%.
Major brand names and generic equivalents
for even greater cost savings.
5
10
15
20
Were passive aggressive
When it comes to passive products, we dont pull
any punches: we stock more major brands of
passive components than any other major cata-
log distributor.* So whatever brands you need
from AMP or AVX to Vishay or Wakefield
youre more likely to find them all at Jameco.
Check our stats below and see for yourself.
Its another Jameco advantage.
Jameco

Digi-Key

Mouser

Newark

AMP AMP AMP AMP


Astec Power Astec Power Astec Power Astec Power
Augat AVX AVX AVX
AVX Bourns Bourns Bourns
Bourns Cherry Cherry Cherry
Cherry Corcom Condor Power Corcom
Condor Power CTS Corcom Elco Connector
Corcom Elco Connector Elco Connector Grayhill
CTS Fox Electronics Fox Electronics Intl Rectifier
Elco Connector Grayhill Intl Rectifier Kemet
Fox Electronics Intl Rectifier Kemet Molex
Grayhill Kemet Molex Osram
Intl Rectifier Molex Panasonic Panasonic
Kemet Osram Potter & Brumfield Potter & Brumfield
Molex Panasonic Teledyne Relays Vishay
Osram Potter & Brumfield Vishay Wakefield
Panasonic Power-One Wakefield
Potter & Brumfield Vishay
Power-One Wakefield
Teledyne Relays
Vishay
Wakefield
Free shipping on these
and 83 other major brands.
Call for details.
CoverInside.qxd 11/1/2007 3:10 PM Page 2
SERVO 12.2007 3
Full Page.qxd 11/1/2007 3:16 PM Page 3
4 SERVO 12.2007
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 ADDITIONAL 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
Departments
06 Mind/Iron
07 Bio-Feedback
18 Events Calendar
19 Robotics Showcase
20 New Products
66 Robo-Links
73 SERVO Webstore
82 Advertisers Index
Columns
08
Robytes by Jeff Eckert
Stimulating Robot Tidbits
10
GeerHead by David Geer
Tortuga From Isle of Pirates to
Underwater Spy
14
Ask Mr. Roboto by Pete Miles
Your Problems Solved Here
60
Lessons From The Lab
by James Isom
NXT Packbot: Part 2
68
Robotics Resources
by Gordon McComb
Using Lasers With Your Robots
76
Appetizer by Daniel Albert
Transitioning Sequencer Using Static
Frames for Biped Control
79
Then and Now by Tom Carroll
Servos
PAGE 79
TOC Dec07.qxd 11/5/2007 4:08 PM Page 4
12.2007
VOL. 5 NO. 12
SERVO 12.2007 5
ENTER WITH CAUTION!
22 The Combat Zone
31 Votrax SC-01 to
SpeakJet Translator
by Robert Doerr
Break the language barrior with your
HERO robot.
36 GPS
by Michael Simpson
Part 3: Parse positional data from the
NEMA protocol.
43 Spare the Rod ...
Spoil the Bot
by Karla Conn
Rewards and punishments can serve
as fundamental motivations for
your robot to learn by.
46 Programming by
Demonstrating Robots
Task Primitives
by Alexander Skoglung and
Boyko Lliev
Using imitation to teach robots
isnt as straightforward as youd
think, but it can be done.
51 Using FRAM for
Non-Volatile Storage
by Fred Eady
If EEPROMdensities are too small
for your robotic application and
you dont want to design in a
hard drive or battery-backed SRAM,
then FRAM is your answer.
Features & Projects
PAGE 14
TOC Dec07.qxd 11/5/2007 4:08 PM Page 5
Published Monthly By
T & L Publications, Inc.
430 Princeland Court
Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
Product Order Line 1-800-783-4624
www.servomagazine.com
Subscriptions
Inside US 1-877-525-2539
Outside US 1-818-487-4545
P.O. Box 15277
North Hollywood, CA 91615
PUBLISHER
Larry Lemieux
publisher@servomagazine.com
ASSOCIATE PUBLISHER/
VP OF SALES/MARKETING
Robin Lemieux
display@servomagazine.com
EDITOR
Bryan Bergeron
techedit-servo@yahoo.com
CONTRIBUTING EDITORS
Jeff Eckert Tom Carroll
Gordon McComb David Geer
Pete Miles R. Steven Rainwater
Michael Simpson Kevin Berry
Fred Eady Robert Doerr
Alexander Skoglund Boyko Lliev
Karla Conn Dan Albert
James Baker Chad New
Paul Ventimiglia James Isom
CIRCULATION DIRECTOR
Tracy Kerley
subscribe@servomagazine.com
MARKETING COORDINATOR
WEBSTORE
Brian Kirkpatrick
sales@servomagazine.com
WEB CONTENT
Michael Kaudze
website@servomagazine.com
PRODUCTION/GRAPHICS
Shannon Lemieux
Michele Durant
ADMINISTRATIVE ASSISTANT
Debbie Stauffacher
Copyright 2007 by
T & L Publications, Inc.
All Rights Reserved
All advertising is subject to publishers approval.
We are not responsible for mistakes, misprints,
or typographical errors. SERVO Magazine
assumes no responsibility for the availability or
condition of advertised items or for the honesty
of the advertiser. The publisher makes no claims
for the legality of any item advertised in SERVO.
This is the sole responsibility of the advertiser.
Advertisers and their agencies agree to
indemnify and protect the publisher from any
and all claims, action, or expense arising from
advertising placed in SERVO. Please send all
editorial correspondence, UPS, overnight mail,
and artwork to: 430 Princeland Court,
Corona, CA 92879.
True Autonomy
When roboticists talk of
autonomy, its generally understood
that this elusive goal will be achieved
through advances in computational
methods, such as artificial intelligence
algorithms, more powerful processors,
and increasingly powerful and
affordable sensors. However, achieving
truly autonomous robots will require
more than simple computational
evolution. Its a misnomer to call
a robot that can navigate a
room without human assistance
autonomous when the duration of
autonomy is limited to perhaps a half
hour because of battery life. Other
than simplistic stimulus-response
BEAM robots (see Figure 1), the Mars
rovers are perhaps the best examples
of computationally and energetic
autonomous robots. However, even
the rovers are controlled remotely by
scientists at NASA.
The advances in battery
technology, fuel cells, and power
management chips havent kept pace
with computational advances in
energy management, such as behavior
modification. Unfortunately, behavior
tactics such as resting, altering speed
or path to reflect remaining energy
stores, and shutting down unnecessary
sensors can only go so far in extending
the operating time of a robot. New
sources of energy must be identified
and perfected.
Although there is ample
commercial pressure to develop higher
capacity energy sources and more
effective energy management devices,
there are also significant incentives
from the military. According to the
DOD, soldiers of the near future are
expected to be assisted by electronic
devices ranging from audio, video,
and data communications equipment,
night vision gear, and wearable
computers, to exoskeletons. And these
devices will require an unprecedented
amount of portable power.
In response to this need, the
Department of Defense Research and
Mind / Iron
by Bryan Bergeron, Editor
Mind/Iron Continued
6 SERVO 12.2007
FIGURE 1. Solar powered
light-seeking BEAM robot.
Mind-Feed Dec07.qxd 11/5/2007 4:34 PM Page 6
Engineering Wearable Power Prize is offering $1M for the
first place winner for the best wearable electric power
system prototype. The competition which is open to
individual US citizens 21 or older will be held in the fall of
2008. The grand prize goes to the developer of the
technically superior power vest that weighs 4 kg or less,
operates continuously for four days, and provides 20W
average and 200W peak. See www.dod.mil/ddre/
prize/topic.html#7 for details on the competition.
Even if you don't take part in the competition, consider
the energy autonomy of your next robot design. While you
probably don't have access to Sterling isotope thermal
generators or other esoteric energy sources available to military
robotics designers, there are numerous promising technologies
that you are free to explore. One that I've followed for several
years is illustrated by the predatory robot EcoBot II, developed
by the University of the West of England in Bristol.
The EcoBot II uses a microbial fuel cell to generate
electricity from flies. Bacteria in the microbial fuel cells
metabolize sugars in the flies, releasing electrons in the
process. The robot isn't yet up to the capabilities of the
Mr. Fusion Home Energy Reactor-equipped De Lorean
featured in Back to the Future top speed is 10
centimeters per hour. However, the EcoBot II can travel
for five days on just eight flies. If you have an aversion
to flies and other decaying organic matter, you can try
your hand at extending the basic BEAM robots,
available from several vendors featured in SERVO. SV
Dear SERVO:
In reference to the September 07 Robytes ... Holy cow! $69
million for an RC airplane? Wow, where can I sign up? I think as a
tax payer I should feel screwed! Who am I? I used to fly RC planes
before I became a pilot. Ive built a four seat airplane, and been
president of an EAA (experimental aircraft association) chapter. I
know a bit about what airplanes are, and what they cost.
One of the members of our EAA chapter built a Lancair 4,
which would be a 300 mile per hour airplane. He went top shelf
on it, and spent about $400,000 on it. Sure, it only has half the
payload of the MQ-9 (1,550 lbs), but it
seems like for not a lot more, one could
build it bigger, and get the payload.
Looking at an Epic Dynasty, it has
3,300 lbs payload, and is priced under $2
million; its capable of 340 knots. The
specs might be misleading with the empty
and max takeoff weights but that is with
an interior, and equipment for people.
Strip all that out and you can have a UAV.
Basically, the remote control is
some extra wiring to the auto pilot
servos. I am to believe that is worth 50
some million dollars?
So, maybe someone might say I am
comparing toy airplanes to some
commercial aircraft. How about a Boeing
737? Well, right from Boeing, ready to fly,
they list at $49 million. I guess a $20
million conversion would be reasonable
(probably not). But this aircraft is capable
of hauling over 30,000 lbs (about 10X the
MQ-9). It can also cruise at over 500 mph.
I am very sad to hear the way things are going in the
UAV market.
People claim the UAVs are supposed to be cheaper and
safer, but it still takes a crew of two to fly this MQ-9, where an
F-35A lightning II will only cost about $50 million and takes a
crew of one. Its capable of carrying 18,000 lbs and flying past
mach 1 in a stealth mode carrying smart weapons. This
manned aircraft is clearly a more useful aircraft.
Tom Brusehaver
Dallas,TX
SERVO 12.2007 7
Resources
EcoBot II Self-sustaining killer robot creates a stink.
New Scientist, September 9, 2004.
www.newscientist.com/article.ns?id=dn6366
EcoBot II in action. www.youtube.com/watch?v=1Nuw654pFbU
BEAM Robots. www.solarbotics.net; www.solarbotics.com;
www.geocities.com/SouthBeach/6897/beam2.html
How Fuel Cells Work. How Stuff Works.
www.howstuffworks.com/fuel-cell.htm
Mind-Feed Dec07.qxd 11/5/2007 4:35 PM Page 7
8 SERVO 12.2007
Fooling Virtual Robots
A highly abstract but interesting
concept has emerged from the University
College London (www.ucl.ac.uk),
where Dr. Beau Lotto and other
researchers have been experimenting
with virtual robots to understand why
humans can be fooled by visual illusions.
Some folks at the UCL Institute of
Ophthalmology trained artificial neural
networks (essentially, virtual toy robots
with tiny virtual brains) to see correctly
(i.e., as we do). They trained the virtual
critters to predict surface reflectance in a
variety of 3D scenes such as found in
nature. When the bots examined a range
of grey scale illusions, they often made
the same mistakes that humans do.
Among the studys conclusions is
that it is likely that illusions must be
experienced by all visual animals regard-
less of their particular neural machin-
ery. For details and some entertaining
illusions, visit www.lottolab.org.
Concept Car Includes
Companion Bot
At the latest Tokyo Motor Show,
Nissan (www.nissanusa.com) unveiled
the Pivo 2 electric concept car, evolved
from the original three-seater that first
appeared in 2005. It is mechanically as
strange as it looks, given that the wheels
(each of which is powered by its own
motor) can turn up to 90, and the cabin
can rotate 360, so you can drive it for-
ward, sideways, or backward and never
need a reverse gear. Its powered by lithi-
um-ion batteries and uses by-wire con-
trol technologies rather than mechanical
systems for braking and steering.
But possibly the strangest feature
is the Robotic Agent that rides with
you everywhere you go. Its basically
a bobbling head, located near the
steering wheel, that communicates
with you in either English or Japanese.
Aimed at making every journey less
stressful, the Agent speaks in a cute
electronic voice and provides a link to
everything from basic vehicle functions
to searching for a parking spot.
According to Nissan, the head can
sense the drivers mood by analyzing
facial expressions (it has digital eyes
and a microphone) and deliver prepro-
grammed phrases that might include
Relax, dont worry, Youve dripped
Big Mac sauce into your lap, and Put
away that gun. At this point, the car is
fully functional but alas is still too
expensive for the commercial market.
Fortune Teller in a Bowl
Also too expensive for the com-
mercial market but there anyway, is
the Swami Conversational Robot, avail-
able from Neiman Marcus (www.nei
manmarcus.com). This goes way
beyond the old mechatronic gypsy for-
tune teller machines of penny arcade
fame, although, peeping out from his
glass dome, he does bear some resem-
blance to Zoltar. Under the control of
a laptop running special AI software,
this guy generates facial expressions
using some 30 micromotors and can
watch you via eye-mounted cameras.
Apparently, you can teach him to
recognize family members, have
meaningful conversations with you,
and answer questions intelligently.
Thats probably more than the afore-
mentioned family members can do,
but the catch is that this thing costs
more than my first house: $75,000.
Give em the Bird for
Christmas
On a level that will allow it to fit
your Christmas budget is Squawkers
In this image, it appears that the dark
stripes on top are darker than the
white stripes on the front of the
object. But a mask placed over the
image reveals that the white stripes
in the foreground are exactly the
same as the grey ones on top.
Thanks to Beau Lotto/UCL.
Nissans Pivo 2 concept car. Photo
courtesy of Nissan Motor Company.
The Swami Conversational Robot.
Photo courtesy of Neiman Marcus.
by Jeff Eckert
Robytes.qxd 11/1/2007 11:16 AM Page 8
McCaw, recommended for children over
5 years and very lonely people of all
ages. Widely available on the Internet
for about $55, it talks, squawks, and is
nearly as annoying as a real parrot. He
can repeat any words spoken to him,
give appropriate responses to prepro-
grammed commands, and learn new
responses. Put him in dance mode, and
he will sashay to whatever music you
play or even provide his own music.
In terms of mechanics, Squawkers
can move his head, flap his wings, eat a
cracker, and even give you a smooch
when you touch his beak. Probably the
best feature is that he goes to sleep
when his eyes are covered or the room
gets dark. You can see him at www.has
bro.com or in your local toy store.
Robot Plays the Theremin
As most readers will already know,
the theremin invented by Leon
Theremin in 1919 is one of the earliest
completely electronic musical instruments
and the first to require no physical contact
with the musician. As far as I can verify,
it was played only by human beings until
about 2003, when Ranjit Bhatnagar built
Lev specifically for that purpose.
Lev, the product of a floor lamp,
some metallic junk, and a few micro-
processors, has been a solo act since
then but is now accompanied by a few
thumpbots, which provide a rhythmic
background to the theremins notorious-
ly unappealing sound. If youre curious,
a video of the band playing a tune that
is said to be Gnarls Barkleys Crazy
(but sounds more like belly dance music)
can be viewed at www.youtube.com/
watch?v=19RJEnNUg1I.
Mini Chopper Fights Fires
Most unmanned surveillance seems
to be performed by fixed-wing aircraft
these days, but the West Midlands Fire
Service, over in Birmingham, U.K., is
trying out a small chopper, which it has
dubbed the Incident Support Imaging
System (ISIS). The device doesnt
actually put out fires, but it does provide
live video from above the incident
scene and aids firefighters in planning
an emergency response.
Such incidents can also include
general rescue operations, inspection
of water supplies and gas cylinders,
and so on. ISIS is actually a modified
MD4-200 vertical takeoff and landing
(VTOL) micro aerial vehicle (MAV) built
by Microdrones GmbH (www.micro
drones.com) over in Germany.
The composite shell provides lower
weight and EMI shielding and houses
instruments that can include a GPS,
accelerometers, gyroscopes, a magne-
tometer, a still or video camera, and pres-
sure, temperature, and humidity sensors.
The unit weighs only about 2 lbs (900 g)
and carries up to nearly 0.5 lbs (200 g).
Depending on the payload, the four
battery-powered rotors can keep it aloft
for up to 20 min. In spite of the $60,000
price tag, Microdrones has sold 250 of
them 16 months after their introduction.
Biped Bot Responds to
PS2 Controller
Closer to home, Dallas-based
KumoTek (www.kumotek.com) is a
builder of custom and standard bots for
education, research, entertainment, and
some industrial applications. (Kumo, in
case you were wondering, is Japanese for
spider.) The news there is the introduc-
tion of the model KT-X, billed as the first
low-cost bipedal root platform that can
be controlled via a wireless PS2 controller.
The 13-in, 2.9-lb robot can walk,
run, do somersaults, and stand up from
a face-up or face-down position. KT-X
has 17 degrees of freedom, is driven by
a 60 MHz HV processor, and comes with
75+ preprogrammed motions. As of this
writing, the unit is still under develop-
ment, but it should be commercially
available within a few months. SV
Robyt es
Squawkers McCaw, the latest in
the Furreal Friends lineup.
Photo courtesy of Hasbro.
Lev the musical robot now performs
with thumpbot friends. Shown with
a Moog Etherwave instrument. Photo
courtesy of www.moonmilk.com
A special version of the MD4-200
is being evaluated for fire and
rescue operations. Photo courtesy
of Microdrones GmbH.
SERVO 12.2007 9
The new KT-X.
Robytes.qxd 11/1/2007 11:17 AM Page 9
10 SERVO 12.2007
T
he competition is sponsored by
the Office of Naval Research
(ONR), as well as by AUVSI,
according to a Robotics@Maryland aca-
demic paper, Tortuga: Autonomous
Underwater Vehicle, authored by
several club members and advisors.
The competition tasks each
robot with six challenges:
Maintain a straight course and head-
ing through the starting gate.
Locate the flashing start buoy.
Ram that buoy to free it.
Locate the first orange pipeline
segment.
Follow the orange pipeline until it
meets a second flashing buoy, which it
must also ram.
Follow two more pipelines, locate a
sonar beacon, and follow it to the
treasure octagon.
Team members based the robots
design and construction on the best
possible completion of these tasks.
Tortuga Design and
Construction
A serviceable aluminum chassis
surrounds and supports Tortugas
mechanics, as well as an 18.5 long by
8 diameter clear acrylic tube, which
houses the watertight components.
The team members selected the chassis
design for ease of access to the robots
functional parts, electronics, and other
innards and attachments.
The robot uses an inertial
navigation system (INS) to establish its
location and maintain its heading.
The system is comprised of sensors,
processors, and software. These enable
the vehicle to establish and change
location by adjusting its velocity.
The INS includes the following
hardware and software:
1) Three magnetometers (to measure
the Earths magnetic field).
2) Three gyroscopes (to measure angu-
lar acceleration).
3) Three accelerometers (to measure
Contact the author at geercom@alltel.net by David Geer
Tortuga From Isle of
Pirates to Underwater Spy
The Isle of Tortuga, Haiti once a haven for pirates lives on as the namesake for
the University of Maryland Robotics Clubs submersible competition robot.
Tortuga the Clubs entry in the Association for Unmanned Vehicles and Systems
Internationals (AUVSIs) annual Autonomous Underwater Vehicle (AUV)
competition first appeared in the yearly event in Autumn 2007.
Tortuga was the first robot that the
University of Maryland entered into the
Association for Unmanned Vehicles
and Systems Internationals (AUVSIs)
annual Autonomous Underwater
Vehicle (AUV) competition, according
to Scott Watson, a University of
Maryland student and Robotics Club
member. This is a close-up, aft (tail,
stern) angle view of Tortuga.
The AUV is equipped with four
Seabotix thrusters (three of four are
visible) to control depth, pitch, yaw,
and horizontal translation, according to students who crafted the submersible robot. Roll
is statically stabilized with a careful distribution of foam, small weights, and putting heavy
electronics (such as the batteries) at the bottom of the pressure hull, Watson notes.
The AUV uses a MacMini to interface with all its sensors and motor controllers
through USB ports.
Photos are courtesy of Scott Watson,
University of Maryland student and
Robotics Club member.
Geerhead.qxd 11/4/2007 6:32 PM Page 10
GEERHEAD
linear acceleration).
4) An inertial measurement unit (IMU)
houses the aforementioned nine
sensors.
5) Closed-loop controller software to
process force vector equations.
The combination of sensors and
sensor data are relied on for navigation
because GPS signals dont travel
underwater.
Attaining Objectives
To get through the starting gate
properly, Tortuga uses a combination
of position confirmations from its
forward camera and output from a
nonlinear adaptive controller.
A nonlinear adaptive controller
takes sensor data as input and uses it
to calculate the orientation (location,
position) of the robot and how that is
changing, according to Scott Watson,
University of Maryland student and
Robotics Club member.
It does some calculations and
then determines how best to use the
actuators available (thrusters, in our
case) to do something desirable, like
maintain heading, depth, pitch, roll,
and velocity, explains Watson.
The nonlinear aspect means that
the controller can take the many differ-
ent forces acting on the robot into
account, according to Watson. If the
team could guarantee that only one
force contributed to the robot moving
up and down in the water and, similar-
ly, that only one thruster was able to
affect that up and down motion, then
the robot would only need a linear
controller, explains Watson.
But, in nature, Watson says,
forces tend to constructively and
destructively interfere with each
other in a way that may not be deter-
minable from the available sensors.
The adaptive aspect means
the controller knows that the input
(parameters) it receives from the
sensors isnt necessarily 100 per-
cent accurate and that it is permit-
ted to intelligently adjust those
parameters, by use of its pro-
gramming, according to Watson.
For example, its impossible to
measure buoyancy or roll moments per-
fectly, but an adaptive controller will, in
a sense, learn how to adjust these
parameters to more successfully control
the vehicle by depending on sensor
measurements, illustrates Watson.
Next, we have buoy ramming.
Buoy ramming sounds like fun
and, in this instance, it is a carefully cal-
culated maneuver. The buoy is a flash-
ing light housed in a watertight enclo-
sure. The robots task is to locate this
buoy and run directly into it to knock it
loose from its mooring, according to
Watson. This demonstrates vehicle
control, valid image processing, and
SERVO 12.2007 11
This University of Maryland student and Robotics Club member Matt Bakalar is check-
ing for air bubbles that might emanate
from the watertight enclosure that
protects the AUVs electronics.
Devastating leaks can come
from the o-ring seals, as well as the
wet-matable connectors drilled into
the aluminum end caps of the pres-
sure hull. If all goes well, the lead
controller programmer will secure
shell (SSH, a form of connection
interface) into the MacMini to begin
testing the robots stability under
active control, according to Watson.
University of Maryland
student and Robotics Club
member Stepan Moskovchenko
submerges the watertight pres-
sure hull to watch for air bubbles
and water accumulation beneath
the electronics and batteries.
The first leak in the lifetime
of the robot was discovered
minutes earlier due to user error
with the homemade underwater
FireWire connector, says Watson.
The straps hold aluminum
CNCd end caps with piston style
o-ring seals in place on an 8 diameter acrylic tube, Watson explains.
Three student team members check whether the inertial measurement unit
(IMU) is level within the vehicle. While hanging from the team tent at the competi-
tion in San Diego, the students
attempt to calibrate the internal
magnetometer and tweak gains
in the controller code.
The team uses a
MEMSense Nano IMU with
Mi cro- El ect ro- Mechani cal
Systems (MEMS) technology.
This affords a relatively low cost
and lightweight solution for
inertial measurements and to
track the course of the robot,
says Watson.
Geerhead.qxd 11/4/2007 6:33 PM Page 11
12 SERVO 12.2007
artificial intelligence, explains Watson.
The robot employs two Unibrain
Fire-I cameras for object recognition.
These cameras stream video via
FireWire connection to the MacMini
(1.83 GHz dual core, 2 GB RAM),
which is the robots onboard computer.
Image processing algorithms on the
MacMini, written in C++, use the
OpenCV image processing library
to identify competition objects
like the buoy (and, of course, the
orange pipelines it must follow),
according to a Robotics@Maryland
Tortuga academic paper.
The artificial intelligence comes
from the robots higher level autonomy
software in the robots hardware brain.
A gigabit Ethernet tether stretches the
distance between Tortugas onboard
MacMini computer and a com-
puter on dry land. We usually
communicate with the onboard
computer over a shell session, that is,
over the Linux console, says Watson.
This is especially useful during testing.
To aid the robot in recognizing and
following the pipelines, the team uses
color filters to bring out the orange,
according to Watson. Then we run an
edge detection algorithm that gives us
a collection of points that belong to
edges in the image. Finally, we feed
these points into another algorithm
called a Hough transform, which picks
out straight lines from those edge
points, Watson continues.
Marker dropping is another task
in the AUVSI competition. In this case,
the robot drops six inch by half inch red
PVC pipe sections into target boxes as
markers at two points in the competi-
tion. A weight in the PVC makes sure it
drops, according to club members and
students.
Team members mount these PVC
pipe sections inside Tortugas deploy-
ment tubes, which are fitted with
permanent and electromagnets to hold
and deploy the markers. When the robot
energizes the electromagnet, it cancels
the permanent magnets magnetic field,
releasing the marker over its target.
The team mounted the marker
tubes next to the ventral video camera
in order to minimize positioning error.
The ventral camera is the one on
Tortugas belly, specifically designated
to watch for targets and for the orange
pipelines, according to Watson.
The robot uses sound to help it
locate its treasure in the final task of
the competition. A sonar, seated
beneath the octagonal treasure target,
creates the sounds. A three sensor
hydrophone array on the robots side
senses these underwater sounds like a
single microphone. A series of micro-
controllers and analog filters determine
the frequency and time of arrival of the
sounds to pinpoint the location of the
sonar, according to Watson.
System Support
A microcontroller network offloads
low-level tasks from the MacMini and
supports the robot. For example,
GEERHEAD
UM students and Robotics Club
members Stepan Moskovchenko [left]
and Joe Gland [right] inspect the
thruster and camera housing cables for
damage after a competition-qualifying
run that knocked the camera housing
loose.
The external frame, made of
80/20 tubing, performed one of its
design functions by protecting all the
electronics and cabling during the
jolt. A little bit of rope and the team
is ready to go straight back to testing
code to get the robot back in the
water for another run, Watson
exclaims!
UM students and Robotics Club members take a moment to pose behind the
Autonomous Underwater Vehicle (AUV) they designed and built in nine months for
the Association for Unmanned
Vehicles and Systems International
annual competition.
The Maryland students fin-
ished 13th out of a field of 27 teams
in this their first year, winning a
$500 prize. They are proud of their
accomplishment and look forward
to spending more time developing
the artificial intelligence code and
refining sensor systems to better
compete with more experienced
teams in 2008, Watson says.
Robotics Club member Nathan
Davidge waits at Reagan National
Airport with the teams AUV robot.
All the electronics and parts for
the AUV fit in the travel case on the
seat to the right of Nathan. Even at
the airport, the student team was
working on integrating a new binary
protocol for more reliable communi-
cation to the motor controllers from
MacMini, says Watson.
Geerhead.qxd 11/4/2007 6:33 PM Page 12
collecting hundreds of voltage measurements from a sensor,
averaging them together, and performing small calculations
that the main computer can ask for without worrying about
the electrical details of how it was done is an optimization
of the architecture, as Watson explains.
A sensor PCB contains most of the microcontrollers
and they have a parallel bus (8 bits wide) that coordinates
information flow and job instructions.
Conclusion
AUVSI held this years competition July 11-15 at the
Space and Naval Warfare Systems Center TRANSDEC Facility
in San Diego, CA. The University of Maryland expects to see
Tortuga or its offspring competing again next year. SV
Department of Electrical and Computer Engineering,
A. James Clark School of Engineering, University of Maryland
www.ece.umd.edu
Robotics@Maryland Club http://ram.umd.edu/trac
Replacement thrusters www.seabotix.com
AUVSI www.auvsi.org
RESOURCES
SERVO 12.2007 13
GEERHEAD
HE8EJIFH;<;H>?J;9)0'
The results of an informal poll taken recently at the First
Annual World Domination Symposium are now in. Robots
prefer Hitec servos 3:1 over other servo brands. They know the wide
selection of Hitec analog and digital servos provide them with the power and depend-
ability needed to eventually take over the World. Make your robot happy, use Hitec servos.
12115 Paine Street | Poway | California | 92064 | 858-748-6948 | www.hitecrcd.com
>_j[Y
Ej^[h8hWdZ
.EW2OBOT3ERVOS
HSR-5980SG
Speed: 0.14 sec
Torque: 417 oz/in
Steel Gears
HSR-5498SG
Speed: 0.19 sec
Torque: 187 oz/in
Steel Gears
HSR-5990TG
Speed: 0.14 sec
Torque: 417 oz/in
Titanium
ALL SPECFCATONS AT 7.4 VOLTS
Geerhead.qxd 11/4/2007 6:34 PM Page 13
14 SERVO 12.2007
Q
. Do you know of any
humanoid robot kits that
cost less than a $1,000? I like
the ROBONOVA and KHR-1 body
designs with all of the motors and
flexibility, but it costs way too much
money for me. I was wondering if you
happened to know of any cheaper
robots out there.
Andy Kerns
A
. When it comes to fully articulated
humanoid robots, the ROBONOVA
(www.robonova.com) and the
Kondo KHR-2HV (www.kondo-robot.
com or visit www.trossenrobotics.
com) can be purchased for around
$1,000. The Kondo KHR-2HV is the next
generation of the KHR-1 and is a little
less expensive than the KHR-1.
Since humanoid robots are becom-
ing more popular,
there are new robot
designs coming out
each year. A couple
that I am aware of are
the I-Sobot (www.iso
botrobot.com) which
costs around $300 and
the RoboPhilo (www.
robophilo.com) which
costs about $500. I
dont have any personal
experience with either
of these two robots,
but from what I can see
from the videos on their websites, they
are very impressive. The I-Sobot is
currently available from several places,
such as Amazon (www.amazon.com).
The RoboPhilo kit should be available by
December 2007. Table 1 shows a few
basic specifications for these two robots.
Another option to consider is the
BRAT from Lynxmotion (www.lynx
motion.com) which costs less than $300
for the basic kit. This is a very basic
bipedal robot kit that has a total of six
servos (three for each leg). It requires
assembly and a connection with a PC
to control the robot. If you add your
own electronics and develop your own
walking routines, the BRAT can become
autonomous.
For those people that want a
challenging project, the BRAT is an
inexpensive route to get started. All of
the parts on the BRAT are interchange-
able and expandable, so at a later time,
the BRAT can be reconfigured with
some additional parts to make a 17 or
19 degree of freedom robot.
On the subject of reconfigurable
robot kits, you might want to take a look
at look at the Bioloid (www.tribotix.
com) robotics kit. This is a very good
general-purpose robot kit which allows
you to build many different types of
robots, such as dogs, spiders, six-servo
walkers like the Lynxmotion BRAT, and
even the big 17+ servo humanoid robots.
The Bioloid robots use the Dynamixel
servos, which are some of the most
advanced robotics servos on the market.
To be able to build a humanoid
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
Pete Miles
Our resident expert on all things
robotic is merely an Email away.
roboto@servomagazine.com
Figure 1. I-Sobot. Figure 2. RoboPhilo.
Specification I-Sobot RoboPhilo
Height 6.5 inches 13 inches
Weight 12 oz. 38 oz.
Servos (degrees
of freedom)
17 20
Power 3 AAA NiMH 6V NiMH
Remote Control Infrared Infrared
Special Features
Built-in Gyro, Voice Recognition,
Speaker, Pre-programmed
Motions, Programmable
Pre-programmed
Motions,
Programmable
Approximate Costs $299
~
$500
Table 1. I-Sobot and RoboPhilo Humanoid Robot Specifications.
MrRoboto.qxd 11/5/2007 3:58 PM Page 14
robot, you would need the comprehen-
sive kit, which has 18 servos, brackets,
and a microcontroller for controlling the
entire robot. The approximate $900
price is a bit higher than the robots
previously discussed, but it has a lot of
different projects and robot designs to
build. There is a beginner set which con-
sists of four servos, power supply, micro-
controller, and construction brackets
which costs about $350 that will help
you to start learning how to control the
servos and program the microcontroller.
Both the BRAT and the Bioloid kits
require assembly and knowledge about
how to build and program robots.
Developing walking routines on your own
can be rather challenging. These kits are
not recommended for those who want a
fully functional robot right out of the box.
It may take several days to weeks to get
one of these robots to do the same things
as the I-Sobot and the RoboPhilo.
Q
. I have been searching the
Internet for several months
looking for an inexpensive logic
analyzer. My main need is for something
to analyze serial data between my laptop
and various microcontrollers. I have seen
prices range from $500 to over $3,000
for the different logic analyzers, and this
is way outside my budget. Do you know
of any low price logic analyzers?
Bill T.
Salt Lake City, UT
A
. It is amazing to see how much
logic analyzers cost relative to
oscilloscopes. One would think
that with all of the digital electronics
in use today, there would be dozens
of low cost, budget logic analyzers
available on the market.
Several months ago, I stumbled
across a very nice and inexpensive
logic analyzer from Parallax (www.
parallax.com) called the BASIC
Stamp Logic Analyzer (part #30010).
Check out Figure 5. It is a very
impressive little tool for $79. With a
sampling rate of 2Ms/s on 16 I/O
lines, it should be able to accurately
monitor all of your serial communica-
tion data with 0.5 s resolution.
It will store a minimum of 1 million
data points to well over 30 million data
SERVO 12.2007 15
Figure 6. BASIC Stamp 2px24 mounted
on the BASIC Stamp Logic Analyzer. Figure 5. BASIC Stamp Logic Analyzer.
Figure 4. Bioloid humanoid configuration. Figure 3. Lynxmotion BRAT.
S
X
2
8
A
C
/
D
P
Vss RB.0
Vdd
RB.1
RB.2
RB.4
RB.3
RB.7
RB.6
RB.5
RC.0
RC.3
RC.2
RC.1
RC.5
RC.6
RC.4
RC.7
RA.3
RA.0
RA.2
RA.1
MCLR
OSC2
OSC1
RTCC
4 MHz
10 K
+5V +5V
P1
P5
P7
P6
P3
P4
P2
P0
SIN
SOUT
B
A
S
I
C
S
T
A
M
P

L
O
G
I
C

A
N
A
L
Y
Z
E
R
P14
P10
P8
P9
P12
P11
P13
P15
Vdd
RES
Vss
+5V
BASIC STAMP
LOGIC ANALYZER
(Basic Stamp not required)
EXAMPLE
MICROCONTROLLER
Figure 7. BASIC Stamp Logic Analyzer wiring example.
MrRoboto.qxd 11/5/2007 3:59 PM Page 15
points (the manual states that the maxi-
mum storage limit is based on how much
available RAM is on your computer). With
trigger points set at 0.8V and 1.8V, both
CMOS and TTL circuits are supported.
The one requirement to use the
BASIC Stamp Logic Analyzer is
that your computer must have
a USB 2.0 connection.
This BASIC Stamp Logic
Analyzer is designed to
mount directly under a BASIC
Stamp microcontroller (see
Figure 6). It gets its power from the
same power supply to the Stamp, and
it will monitor all 16 of the Stamps I/O
pins, along with the Vdd, RES, Sin, and
Sout pins. I havent tried this, but the
BASIC Stamp Logic Analyzer should
work with other microcontrollers that
use the same footprint.
Like with all electronic circuits, they
can be used in a different application
than they were originally designed for.
This particular logic analyzer can be used
as a stand-alone device. All that is
required is a +5V and GND power source
to the logic analyzer and wires to connect
to the signal that you want to monitor.
Remember you will need to
provide a common ground between
the BASIC Stamp Logic Analyzer and
the system under test. Figure 7 shows
a simple schematic illustrating how to
wire the BASIC Stamp Logic Analyzer
to another microcontroller, and Figure
8 shows a photo of the setup.
Figure 9 shows the graphical user
interface for the BASIC Stamp Logic
Analyzer. This has some pretty power-
ful features, such as setting the trigger
levels for beginning the data storage,
setting the maximum data storage
length, cursors for measuring the
signals, zoom in and out control, and
decoding serial, SPI, and I
2
C signals.
Figure 10 shows you an example of the
asynchronous serial data decoder.
I havent tried testing the signal
voltage limits to the BASIC Stamp Logic
Analyzer. The manual doesnt state
what the voltage limits are, so I would
assume that you are limited to 0-5V
signals to the logic analyzer. If you have
voltages outside this range, I would
recommend that you implement some
sort of a voltage signal conditional that
chops/scales the voltage signals to the
0-5V range. Also, if you do not connect
any of the unused signal pins to ground,
then the signal on them will float and
may either copy an adjacent signal pin,
or bounce between logic 0 and 1.
This is a pretty nice, little inexpen-
sive logic analyzer, and I have used it
successfully to diagnose a multitude of
projects, and reverse-engineered other
signals from other devices I wanted to
use in my projects. SV
16 SERVO 12.2007
Figure 8. BASIC Stamp Logic Analyzer mounted on
a Parallax Professional Development Board and
connected to an SX28 microcontroller.
Figure 9. BASIC Stamp Logic Analyzer software.
Figure 10. Asynchronous
serial data decoder.
For those of you who are interested
in further reading on a similar topic,
Nuts & Volts (www.nutsvolts.com)
will be featuring a project in the
January 2008 issue on a Low Cost
RF Impedance Analyzer.
MrRoboto.qxd 11/6/2007 2:24 PM Page 16
Full Page.qxd 11/1/2007 3:17 PM Page 17
Know of any robot competitions Ive missed? Is your
local school or robot group planning a contest? Send an
email to steve@ncc.com and tell me about it. Be sure to
include the date and location of your contest. If you have a
website with contest info, send along the URL as well, so we
can tell everyone else about it.
For last-minute updates and changes, you can always
find the most recent version of the Robot Competition FAQ
at Robots.net: http://robots.net/rcfaq.html
R. Steven Rainwater
D De ec ce em mb be er r
7-8 Souths BEST Competition
Beard-Eaves Memorial Coliseum, Auburn
University, Auburn, AL
Regional BEST teams from multiple states compete
in this regional championship.
www.southsbest.org
8 Penn State Abington Robo-Hoop
Penn State Abington, Abington, PA
The Penn State Abington Robo-Hoop is an
autonomous robot basketball event in which robots
must pick up foam balls and shoot or dunk them
into a basket.
www.ecsel.psu.edu/~avanzato/robots/con
tests/robo-hoops
J J a an nu ua ar r y y 2 20 00 08 8
25-27 TechFest
Indian Institute of Technology, Bombay, India
Lots of events for autonomous and remote
controlled robots including standard Micromouse
and several events unique to TechFest: Pixel, a
contest for vision-equipped bipeds; Full Throttle:
Grand Prix, remote-controlled, internal combustion
powered cars race on a concrete track; Vertigo, a
remote-controlled robot and an autonomous
robot must work together to move blocks around;
Prison Break, remote-controlled robot must
climb out of a pit and survive a fall to escape
robot-jail; U-571, an obstacle avoidance contest
for underwater robots.
http://techfest.org/competitions/department
F Fe eb br ru ua ar r y y
24-28 APEC Micromouse Contest
Austin Convention Center, Austin, TX
Amazingly fast little autonomous robot critters race
to solve a maze. If youve never
seen one of these events, go see
this one. You wont believe how
fast these things are.
www.apec-conf.org
28-Mar 2 Pragyan
National Institute of
Technology, Trichy, India
Events in this competition include
standard Micromouse and
Sym-Bot, a contest in which a
remote controlled robot must
guide an autonomous robot to
the starting line of a course
then the autonomous robot must
complete the course by itself.
www.pragyan.org/08/home/
events/
Send updates, new listings, corrections, complaints, and suggestions to: steve@ncc.com or FAX 972-404-0269
18 SERVO 12.2007
Events.qxd 11/5/2007 4:37 PM Page 18
IMService
P. O. Box 1 42, New Hudson, MI 481 65
Voice: 888-451-1670
or: 248-486-3600
imsrv. com
Servo CNC Routers
Starting at $1995
DeskCNC
Desktop CNC Solutions
12 x 12 x4 90 or 175 ipm
12 x 24 x 4 NEW 400 ipm
The
Power SchmartModule
will power up your
circuits with your choice
of -9, -12, +2.5, +3.3,
+5, +9, and +12 volts.
$15
Very Schmart!
www.schmartboard.com
The Escape
Robot`s built-in
microprocessor
enables it to
'think on its own.
(KSR4) $29.95
20 second voice recorder/playback
module. The electret microphone is on the
board. One button records, the other button is
momentarily pressed to replay the message.
(pre-assembled) (A96010) $6.60
5mm White
water clear
LED 3.5V
10,000 mcd
(AB287)
$0.56
The Velleman Personal Scope
is not a graphical multimeter
but a complete portable
oscilloscope at the size and
cost oI a good multimeter.
(HPS10)
The robot Irog moves Iorward
when it detects sound and
repeats: start (move Iorward) -~
stop -~ leIt turn -~ stop -~ right
turn -~ stop. (KSR2) $19.95
S
o
l
d
e
r
i
n
g

r
e
q
u
i
r
e
d
Thousands
m
ore item
s on
our w
eb site!
Ask for our FREE 96 page catalog
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....
ORDER TOLL FREE
1 - 8 0 0 - 8 2 6 - 5 4 3 2
THOUSANDS OF ELECTRONIC
PA RT S A N D S U P P L I E S
SERVO 12.2007 19
Robotics Showcase Robotics Showcase
ShowcaseDec07.qxd 11/4/2007 6:42 PM Page 19
Resistance Soldering Systems
H
eavy-duty resistance sol-
dering systems for solder-
ing tasks such as large military
pin connectors where the
solder joint quality must
be exceptional have been
introduced by American Beauty
Soldering Tools of Clawson, MI.
American Beauty Ultra
High Heat Plier-Style Resistance
Soldering Systems provide
instantaneous, localized heat from cold to >1,000F in less
than one second, depending upon the application.
Featuring plier-style hand pieces, the heat is concentrated
directly at the solder joint and these footswitch-actuated
systems allow cold fixture setup before soldering.
Ideal for soldering large single wire terminations up
to 0 AWG into terminal lugs, electrical splices, and
multi-pin connectors, American Beauty Ultra High Heat
Plier-Style Resistance Soldering Systems avoid heat
damage to the wires insulation. Hand pieces are lighter
than conventional irons and are offered in a variety of
sizes for confined spaces and special applications.
American Beauty Ultra High Heat Plier-Style Resistance
Soldering Systems are priced according to the power
supply wattage and hand piece design. Literature and
pricing are available upon request.
For further information, please contact:
Digital Compass
A
new, low-cost, three-axis, tilt-compensated, solid-state
digital compass that provides drop-in compatibility
with most popular digital compasses has been introduced
by OceanServer Technology, Inc., of Fall River, MA.
The OS3000 Digital Compass is a three-axis, 1.4 x
1.8 PCB and includes RS-232 and USB connectivity, and a
24-bit A/D converter with digital filters for easy integration
into a wide range of applications. Accurate to 1 azimuth,
with 0.1 resolution, tilt-compensation up to 60, and
0.1 resolution for roll and pitch,
the compass components have a
50,000 G shock rating.
Providing a programmable
update rate from 0.1 to 20 Hz,
an ASCII interface, and hard-iron
calibration, the OS3000 Digital
Compass can be easily embedded
into another device and provides
precise heading, roll and pitch
data, and is ideal for rapid attitude
measurement. It incorporates a
three-axis Honeywell Magneto resistive sensor, a MEMS
accelerator, and is RoHS compliant.
The OS3000 Digital Compass sells for $249 each or
$199 ea. for 10; larger quantity discounts are available.
For further information, please contact:
NeuroArm Educational Edition
N
euroRobotics a British based manufacturer of
robotic arm products with models of varying
complexity and functionality has just added the
NeuroArm education edition to its range of robot arm
products. This education edition teams up the NeuroArm
Educational Edition 5 DOF Revolute Robotic Arm kit with
the popular Webots 5.0 EDU Simulation and Programming
software from Cyberbotics. This enables a vast array of
teaching applications and experiments. Everything needed
to build and operate the robot is included in the kit. No
soldering or electronics PCB assembly is required.
Using the supplied NeuroArm Webots model, you can
program the arm to carry out virtually any imaginable task
on the computer simulation. Then when you are happy with
the simulation, just download the program to the real robot
and watch it perform the same tasks as in the simulation.
The joint drives on this robot provide less
torque, speed, and lower gripper force than the more
advanced NeuroRobotics models, but still achieves a reach
comparable with an adult human arm.
For further information, please contact:
New Products
ACCESSORIES AND TOOLS
N
N
E
E
W
W
P
P
R
R
O
O
D
D
U
U
C
C
T
T
S
S
20 SERVO 12.2007
1177 West Maple Rd.
Clawson, MI 48017-1059
8005502510 Fax: 2482802878
Email: es@americanbeautytools.com
Website: www.americanbeautytools.com
American Beauty
Soldering Tools
151 Martine St.
Fall River, MA 02723
Tel: 5086780550 (x103)
Fax: 5086780552
Email: kirk@ocean-server.com
Website: www.ocean-server.com
Ocean Server
Technology, Inc.
Website: www.neurorobotics.co.uk
NeuroRobotics
Dec07NewProd.qxd 11/5/2007 4:28 PM Page 20
Full Page.qxd 11/1/2007 3:19 PM Page 21
Featured This Month
Articles
22 Feather Weight Armor
by James Baker
24 Armor Guidelines
by Chad New
26 Advanced Materials in Insect
Armor by Kevin Berry
27 Armor Considerations in
Large Robots
by Paul Ventimiglia
Events
29 Results and Upcoming
A
rmor is a subject all
combat robot builders will
have an opinion on. Many
have written in detail about
the theory of robot armor
materials, with formulae and
specification tables galore.
All of this is must-read
material if you plan to
survive in this sport.
With so many knowl-
edgeable people offering
articles containing such
detailed material science, I
think this article needs to focus
elsewhere. Instead of trying to
tell you what you should do and
offering mathematical reasoning, I
will simplify the issue, based on
my experiences, to the game of
Rock/Paper/Scissors.
Rock
Rock is solid, its hard, it
doesnt bend. Rock is strong.
Traditionally, a robot builder
looking to fend off all attacks will
22 SERVO 12.2007
FEATHER
WEIGHT
ARM R
by James Baker
As we do periodically (sorry pun alert), this months Combat Zone
departs from our usual format to focus on a topic of interest to all builders
armor. From my own experience and that of many other veterans, this
is the single most misunderstood area when new builders attempt
their first bot. SERVO put out a call to the community, asking for tips and
techniques from builders on this tough subject (sorry, the puns just keep
on a'coming). Four builders answered the call, and we hope their
thoughts will be useful to all builders, new or veteran.
Combat Zone is meant to be a resource to the robot fighting community.
We welcome builders stories, requests for topics of interest, build reports,
and feedback on how to make this even more useful. Kevin Berry
CombatZone.qxd 11/5/2007 4:06 PM Page 22
SERVO 12.2007 23
build their machines with heavy,
thick, solid armor. This is especially
true at the moment in the feather-
weight class in the UK. We currently
have a very high number of robots
built using Hardox, a very strong
wear resistant steel.
One example of the rock
solution is my own featherweight,
Unity which is a zero compromise
armored steel tank without weapons
and with moderate drive power. My
teammate has a similar robot called
Bloody-L machined from a solid
billet of high-grade aluminium with
stainless steel skin.
It is obvious where the advan-
tages and disadvantages lie with
these. All but the most extreme of
spinning weapons are unable to even
scratch the outside, but inside the
components are shaken to pieces.
The rock is very good against crush-
ing, cutting, and piercing weapons,
but the solid robot transmits impacts
from spinning and impact weapons
directly to the components inside,
causing unseen failures.
Having heavy armor also reduces
the other capabilities of the robot,
such as reduced speed or lacking
weapons, which means it can be less
than exciting in rock vs. rock fights.
When rock breaks, it usually breaks
badly, leaving distorted, sharp
sections of very visible damage.
Paper
Paper is light. Its flexible, and
easy to cut and shape. Paper absorbs
energy. The analogy of the paper
robot is not one built of cardboard,
but one of deformable materials such
as polycarbonate, polypropylene,
HPDE, wood, or even rubber. The
characteristics of the paper robot are
the opposite of the rock. By allowing
the energy from the opposing
weapon to deform and damage the
armor, almost all of the energy is
used up or displaced, leaving less to
rattle the internal components.
This type of armor works very
well against axes or impact weapons,
but does not do very well
against crushing, cutting, or piercing
weapons. Because of the relative
light weight of this type of armor,
more weight can be allocated to
drive power and weapons, making
for fast and exciting fights,
taking small amounts of damage
constantly, but sometimes ending in
catastrophic failure.
The paper robot (how strange
does that term sound?) is usually a
crowd pleaser. It is also easy to work
with, allowing new builders to get
into the sport without spending a
fortune on tools and metalworking
equipment. I run a number of robots
with chassis and armor made
entirely of plastic, which I found has
another, often overlooked advantage
I can keep my antenna inside
the robot as it is transparent to radio
signals.
Scissors
Scissors are hard and strong, but
they can move and change shape. It
is a bit of a stretch to call a strong,
but flexible robot
scissors, but the term
refers to the armor
being rock-like in its
resistance to cutting
or penetration, but
paper-like in its energy
absorption capabilities.
It is a middle ground,
giving good levels of
protection against all
types of weapons, but
still being more vulnera-
ble than a zero compromise solution.
Rubber mounted steel, for exam-
ple, fits this description. Titanium is
also a good example of scissors-type
armor. It is very resistant to cutting,
but flexes well to absorb energy.
Titanium is not the indestructible
material many people think, but it is a
very good compromise between
stronger, heavy steels and light plas-
tics. It is expensive and hard to work
with, but in the featherweight class, it
is common and works very well. My
heavyweight robot Wheely Big
Cheese is made entirely of titanium,
as is the featherweight version. There
really is nothing like it for solving so
many problems with just one product.
Aluminium is also a scissors type
more paper than rock but we
use it very effectively in our heavy-
The spinning disk weapon that tore Bloody-Ls
stainless steel armor destroyed itself doing so.
Edgehog uses sacrificial armor that takes
a lot of visible damage, but saves the
internals from shock damage.
Building a robot from titanium
gives excellent strength and
energy absorption, but they are
expensive and hard to build.
CombatZone.qxd 11/5/2007 4:06 PM Page 23
24 SERVO 12.2007
L
et me ask you: Would you walk
into a hail storm without any sort
of protection/armor for your body? I
am going to guess not unless, of
course, you want to get pelted to
death. So, would you create a
combat robot without armor, which
is going to face other robots that are
armed to the teeth with various
destructive weapons that are
capable of ruining the creation that
took you so many hours to build?
Again, I would hope that the
answer to that would be no.
Armor is one of the most
critical aspects you must account
for when you are designing your
combat robot. If you do not have
armor of some sort, what is going
to protect the expensive and
critical places inside your robot
from being destroyed by your
opponents? In this article, I will
weight robot Edgehog The armor
takes a lot of damage, but keeps the
opponents axes from doing internal
damage. We have many aluminium
featherweights who require a lot of
repairing after events, but they work
very well.
Rock Beats Scissors
Beats Paper Beats
Rock ...
It is a very black and white
subject, or so it would seem from
what I have written so far. You can
have indestructible robots that
cannot beat anyone (as they have no
available weight left) or awesome
weapons on fragile robots that fall
apart with the slightest impact, or
you can spend a fortune on middle
ground materials and machining. Of
course, it is never really black and
white. What happens if we put heavy
steel under polycarbonate, or have
stainless steel parts of the robot,
with aluminium elsewhere?
A hybrid robot made of light
materials, using heavy, strong materi-
als in specific areas, is one solution.
Laminate armor using layers of dif-
ferent types of material can have
advantages, as well. Bonding these
layers can help them; sometimes
they work better if not bonded.
One very cheap solution to
improving the capability of your
armor is to correctly shape it.
Crushers love a flat lid, spinners love
vertical sides and catching edges.
Shape your armor to maximize its
natural properties. If it needs to flex,
give it room to do so. If it
must not bend, support it
properly. Slope as many
sides as possible. If you
have thick, super strong
armor all around you
robot, do you need
internal structure at all?
Why not put teeth on the
armor and spin it?
Armor is a subject
that should be given as much
thought as weapons or drive. There
is no perfect solution. Some people
choose to turn their armor into
weapons, such as ram-bots or shell
spinners. Others have armor as an
afterthought, relying on huge offen-
sive weapons to ward off attackers.
Whatever you choose to do, it
will always be a compromise, unless
you live in the UK right now. We just
had our weight limit raise from 12 kg
(26.4 lbs) to 13.6 kg (30 lbs) to meet
the American standard, so all of our
weapon-focused robots can have 1.6
kg of extra armor, and our weapon-
less rock-bots can have 1.6 kg of
weapons. Does that make them all
scissors now? Then, I guess its time
to build a new 30 lb rock or paper
robot. SV
Spatula shows
heavy damage
mainly because
of the vertical and
rigid mounting.
150g robot Pookie uses
shaped titanium to
deflect the attacks of
opposing robots.
ARM R GUIDELINES
by Chad New
Even super strong ram-bots like
Unity take damage sometimes.
CombatZone.qxd 11/5/2007 4:07 PM Page 24
SERVO 12.2007 25
explain what I believe
to be the most
critical aspects of your
armor configuration; for
instance, the type, how
you mount it, its shape,
and attachments. By
the end of this article, it
is my hope that you will
be able to utilize this
information and improve the armor-
ing techniques on your robots.
Mounting
We will start with mounting
because I believe this to be one of
the most important aspects of your
entire armor layout. You can have
the best and most expensive armor
ever created, but unless you mount it
correctly, it will be useless. If you
have an armor shell that mounts to
the base plate or frame, you need to
have very strong attachment points.
If your 1/4 titanium shell is held
onto your 1/4 titanium base plate
by 1/8 aluminum brackets, there is a
good chance that it will be torn off
or bent in short order.
Consider the forces involved in
the class that you are going to enter.
Use appropriate sized hardware that
wont distend under high loads and
consider using armor mounts that
are just as strong as the armor itself.
You might also want to consider
shock mounting your armor. Shock
mounting usually involves rubber of
some sort which provides a cushion.
When its impacted, it allows some
of the force to be absorbed into
the mounts.
If your robots armor is the
frame itself, you need to plan for the
armor getting bent and damaged.
Allow tolerance for components
to work even with a damaged
frame/armor panel. Consider
layering the outer area with
UHMW or even a thin shock
mounted strip of metal to shield the
important pieces.
Type
The type of armor that you are
going to use depends on the goal of
your robot. If you want a robot that
is going to be able to withstand
attacks from the most destructive
competitors, then you are obviously
going to need strong and thick
armor that is mounted very securely
to the frame. If weight is not a
concern, you might as well use cheap
metal such as steel; many robots
have even used wood as armor with
positive results.
If your robot uses a weapon, you
will likely not have the weight to
allocate towards an impenetrable
setup such as steel. You may have to
consider materials that are able to
absorb shock well or have a high
strength-to-weight ratio. Materials
such as UHMW, aluminum, and
titanium work well in this instance.
Shape
I believe that a robots armor
should be built around the chassis.
Once you have decided the basic bits
of your robot, you need to begin to
think about how you are going to
armor it. Are you going to bolt
it flush onto the frame, bend a
piece of plastic around the
whole thing, or perhaps even
use a shaped piece of wood to
protect the robot?
When you design your
armor, you also need to keep
the shape of it in mind. Why
mount it vertically which gives
spinning robots a wonderful surface
to grip and impact on when you
can design your armor with a
slope so that the angles will help to
dissipate some of the force (which
will give you a distinct advantage
when facing your opponents)? Try
to design your armor so that it will
aid your design. Do not think of it
as something that has to be only
defensive. If possible, attempt to
incorporate it into the offense side
of your bot.
Attachments
If after you have completed your
robot and you find that you have
weight left over, you might want to
consider making some attachments
for weapons that you might face.
Even if you dont have extra weight,
it might be worth it to take off a
wheel, lose a motor, or cut back
on the batteries to give you the
advantage of some added armor.
If you are going to fight a
horizontal spinner, you might want
to add extra armor at the height of
the blade. That way, it will be less
Rocket, a 60 lb launch bot, uses
its shape, shock mounting,
and attachments to protect
itself from opponents.
Get Flippen, an ant weight, uses the shape
of its armor to keep damage to a minimum.
A great example of what can happen
to even the best designed robots if
the mounting is not strong enough.
CombatZone.qxd 11/5/2007 4:07 PM Page 25
26 SERVO 12.2007
O
ur team, Legendary Robotics, has
built (or done major upgrades to)
almost 50 insect class bots (150
gram, one pound, three pound, or
six pounds), and their armor has run
the gambit. Weve had bots with no
armor (all offense), ones mostly
made of armor (all defense), and
many in between.
Until the advent of major
spinners in the last few years, we had
great success with 1/8 aluminum,
which was easy to work, absorbed
hits well, and was inexpensive. Once
ant or beetle spinners started cutting
through it, however, we knew we
had to move to something else. In
this sport, you either stay ahead of
the death spiral, or it screws you
into the ground.
At one event, we were talking
with Team Barracuda about their
antweight, Flounder. It was made of
a novel carbon fiber honeycomb.
Exhibiting the sportsmanship that
defines our sport, they directed us to
their favorite bot supply place, Acme
Industrial Surplus in Sanford, FL
(www.acmeindustrialsurplus.com
). Well, we hit the mother lode.
Besides the CF honeycomb, they also
carry a Kevlar honeycomb material,
in thicknesses from 3/32 to 1. In
fact, they have aluminum honey-
comb in all kinds of various sizes.
We knew we just had to build a bot
out of this stuff!
Babe The Blue Bot, an
antweight, was our first (and most
successful) build. Using this material,
along with titanium from Titanium
Joe (www.titaniumjoe.com), we
developed a bot that has survived
battles with some of the Southeasts
(and Texas, as well) most vicious
spinners.
Our strategy was to combine
the chassis and armor, using a fairly
classic wedge/box design. The top
and bottom are just the raw
Kevlar, while the sides have a layer
of 0.014 titanium over them.
This light, stiff, strong material left
us plenty of weight for a 0.040
titanium plow.
We started with spacer/screw
sinks/corner braces made of wood,
but after having several split by a
massive hit from superspinner
Pirhana, we upgraded those to
UHMW (also from Acme). All cuts
were made with hand tools. The
Kevlar cuts well with a hack saw or
coping saw, and the titanium with
snips. The plow, of course, was
harder to work, but by wearing out a
hacksaw blade, it was done by
hand also. The Kevlar basically works
like plywood, except it takes hits
likely to rip through and damage
your armor. If you are fighting a
vertical, think about a wedge of
some sort, or the ever-popular keep
away stick which can be used for
just about any type of spinner. The
point is that anything you can add
for a specific opponent is something
that will give you an advantage; try
to allocate weight for attachments.
Conclusion
In wrapping up, remember how
important it is to keep the armor design
at the forefront of your mind when
designing your robot. Try to incorporate
it as an offensive part of your robot and
dont half ass it during the last-minute
rush getting ready for the event. I also
think it is very important to keep in
mind that offense and defense are both
huge factors for the success of your
robot. Again, take note of how you will
mount your armor, what type of armor
you are going to use, the shape of it,
and perhaps some special attachments
to better equip yourself against certain
robots. If you do all of this, chances are
your robot will be in much better shape
at the end of an event! SV
ADVANCED MATERIALS
IN INSECT ARM R
by Kevin Berry
Babes top shows Pirhana damage, while the bottom exhibits the
results of a 30 second ride on SWARCs kill saw.
Battered but functional, Babes aluminum bracket, zip tie, and UHMW spacer
construction provides nine ounces for motors, battery, ESC, and receiver.
CombatZone.qxd 11/5/2007 4:08 PM Page 26
SERVO 12.2007 27
T
here are some nasty weapons
found in todays combat robots,
especially in the 120 lb-340 lb weight
classes. If your armor isnt up to the
task, you will not only lose the
match, but your expensive robot
innards will be defenseless. Having
the proper armor for a match is
just as important as having that
killer weapon, and often it is more
important.
Know Your Constraints
To maximize your chance of
success, you must plan ahead
carefully. You should first decide how
much weight you have allotted
for armor. The most important
design factor is surface area; in
order to maximize protection,
you must minimize surface
area. If you reduce the length
or width of an armor pane,
then you can increase the
thickness of that piece while
keeping the weight constant.
Remember, your robot should not
have to be taller than the largest
extremely well.
We bought some 5/8
thick material for our light-
weight, and plan to layer
some 0.030 titanium over
that (if we ever get it
finished). Weve also used
this 3/32 as the chassis for
our beetle John Henry, and its
proven just as tough in the beetle
class with 0.018 titanium overlay.
Weve seen the carbon fiber honey-
comb used in antweights as well,
and it seems to perform just fine.
When we bought it, the 3/32
ran about 10 per square inch, or
about $5 for Babe. The 0.014 titani-
um ran about $1 for every six
square inches, or about $18.
The plow, made from 0.040
costing about $1 for every four
inches, cost around $3. So, our
chassis and armor cost $26. Of
course, we bought the material
in bigger sheets, but with
thrifty layout, we use every
possible bit with no waste.
Table 1 shows sizes, material,
and weight for all six pieces.
I strongly recommend this
approach for any small bot, and
would like to see someone
experiment in a mid-sized machine.
Babe has survived dozens of nasty
battles, and while sometimes losing
these fights and often parts her
soft creamy center has never been
violated. Knock on wood (or maybe
Kevlar)! SV
ARMOR CONSIDERATIONS
IN LARGE ROB TS
by Paul Ventimiglia
While the 0.040 titanium plow is
barely scratched, the thinner
0.012 does get a bit dinged up.
No marks or penetration to the
Kevlar underneath, however.
Exploded view of Babes side construction.
When using wooden spacers, this was how
it looked coming out of the arena, also!
Front view shows the plow
attachment. The screws are left
a bit loose so it bounces over
arena irregularities.
Heavyweight Verbal Abuse
illustrates the rubber shock
mounting technique where its
armor will attach to all sides.
Photo courtesy of Dick Stuplich.
Material Size (in) Weight (oz)
Top Kevlar 6 x 6 1.4
Bottom Kevlar 6 x 6 1.4
Side Kevlar/Ti 1 x 6 0.5
Side Kevlar/Ti 1 x 6 0.5
Rear Titanium 1 x 6 0.2
Plow Titanium 2 x 6 1.2
TABLE 1 TOTAL 5.2
CombatZone.qxd 11/5/2007 4:08 PM Page 27
component inside!
Always consider the application
of what you are designing. You
might not be able to predict what
each of your opponents will look
like at an event, but you know
historically what types of robots have
competed. This is an area to take
some design risks in how you choose
to distribute your allocated weight.
For example, there are many heavy-
weight spinners, but almost no
hammer or crushing weapons.
Using that assumption, I am making
a potentially risky tradeoff as I shift
weight from my top/bottom armor
to the rest of my robot.
Importance of Shape
When designing your armor,
look at the most powerful robots
that exist and ask yourself, Do I feel
comfortable letting them hit each
part of my robot? At a minimum,
you should plan to receive an attack
from a horizontal spinner such as
Megabyte or Last Rites, a hammer
robot such as The Judge, and a
vertical disk spinner such as
Nightmare. The energy of those
attacks can be deflected if your
armor is sloped at an angle.
Megabyte, Last Rites, and
Brutality have all placed holes in the
1/2 inch thick steel arena bumpers.
Does that mean your robot must
have better than 1/2 inch steel armor
everywhere? No of course not it
is all about the shape of your armor.
Thin aluminum and plastic can
easily render a spinning weapon
useless if it is mounted at a low angle
(below 30 degrees) to the floor.
Similarly, having a one inch thick
steel front bumper will do you no
good if a spinner can catch onto its
edge. Often an entire armor panel
can be torn off from a solid hit. That
is why the corners of your robot are
the most vulnerable area; any seam
or edge can be caught by a
good spinner.
Material Selection
The most common robot
armor materials are alu-
minum, steel, polycarbonate,
and titanium. Your budget
and tools will often be the main
limiting factor in your selection
process.
Steel offers the best protection
for your dollar. Mild steel (such as
1018) offers good strength and
comes in any shape and size. High
carbon steels (such as 4130 and tool
steels) have the added advantage of
the ability to be hardened, becoming
many times stronger and harder
to penetrate.
A simple steel wedge is your
best chance of fending off that big
spinning weapon, but plan to have it
at least 3/16 inch thick at a low
angle, and almost 3/8 inch thick as
the wedge approaches 45 degrees.
For armor in less vulnerable areas,
you can get away with 1/4 inch
thickness, if you dont mind a few
large gashes and holes.
Aluminum is the most common-
ly used robot building material. It
comes in a variety of alloys; 6061 has
about half the strength of mild steel,
but that comes at about a third of
the weight. More exotic alloys such
as 7075 obtain similar strengths to
mild steel, but they can be very
expensive. Additionally, the stronger
aluminum will generally fail in a
brittle way by cracking, but 6061 is a
softer metal that will bend.
Polycarbonate (or Lexan) is a
surprisingly resilient material. It is one
of the lightest materials you can use
for armor, and is available in sheets
up to about one inch thick. Although
it has low strength in tension and it
The 1/4 inch steel wedge is being welded
upside-down to steel hinges on WPIs
winning middleweight entry at BotsIQ 2006.
Note the use of many large fasteners.
Photo courtesy of Paul Ventimiglia.
The 340 lb robots from Robogames
2007. The Judge tries to sentence
Ziggy who has added additional
shock-mounted panels by removing
the side armor just for this fight.
Photo courtesy of Brian Benson.
The 120 lb robots from
Robogames 2007.
Subzero shows off its
shock-mounted armor
and titanium wedge
deflecting the hits from
the drum of Touro.
Photo courtesy of
Brian Benson.
28 SERVO 12.2007
CombatZone.qxd 11/5/2007 4:09 PM Page 28
can be cut fairly easily, it performs
well during impact forces. This is due
to its ability to flex and still return to
its original shape.
Some care must be taken when
designing to use polycarbonate
however, because it is prone to
cracking in areas such as sharp
corners and near holes. Additionally,
this plastic does not block radio
waves, and it can give your robot a
nice look because it is transparent.
Titanium offers the highest
strength-to-weight ratio of these
materials, but with a very costly price
tag. Alloys such as 6AL-4V have more
strength than many steel alloys.
Super heavyweights such as Ziggy
and The Judge are clad in titanium all
around; it is necessary to keep their
weight down while covering their
large surface areas. I personally do
not feel it is worth the price to use
titanium armor in the large classes,
so instead I try and allow extra
weight to use steel.
Mounting Your Armor
If your armor is rigidly secured to
your frame by welds or bolts, it will
resist bending well. The front of your
robot will take the most abuse, so
use the largest and highest quality
fasteners you can find. Reinforce all
long spans with gussets and multiple
attachment points. If armor panels
are mounted on hinges, make sure
they are steel, and bigger than you
think is necessary. (I use 1/4 inch
thick walled, 5/8 inch pin steel
hinges on Brutality.)
Alternatively, many builders
swear by shock-mounting their
armor. Large rubber washers or
metal studs encased in rubber
completely isolate an armor panel
from a robots frame. By using this
technique, the energy of an impact is
more slowly absorbed and therefore
your robot will not be damaged
as easily. I prefer to save weight
overall by making my frame a part of
the armor.
Whatever you choose, remem-
ber to make it easily repairable or
bring spares. Steel can always be
welded at an event, but good luck
gluing back together your shattered
polycarbonate! SV
Table 1
Material Density (lbs/in^3) Best Used For Other Notes
Mild Steel 0.284 Front wedge, high impact areas, sides Easily machined and welded; welded
with MIG and TIG.
High Carbon Steel 0.284 Front wedge, high impact areas Has to be machined in annealed state;
must be hardened for best results.
6061 Aluminum 0.098 Sides, top, bottom Easily machined, difficult to weld in
thicknesses above 3/8 inch.
7075 Aluminum 0.098 Sides, top, bottom Easily machined, cannot be welded.
Polycarbonate 0.043 Top, sides against non-spinners Very easily machined, should not be
tapped; mount with bolts and washers.
Titanium 0.161 Works well in all areas Difficult to machine, welds only with
TIG and heavy shielding.
R
obothon Robot
Combat 2007
was presented by
Western Allied
Robotics in Seattle,
WA, on 9/22/2007.
Go to www.west
ernalliedrobotics.
com for more
details. Results are as
follows:
12 lb Hobbyweight Class 1st:
Death Dealer, Team DMZ; 2nd:
Raven, Team DMZ;
3rd: Fiasco, Team
Velocity.
3 lb Beetleweight
Class 1st: Hurty
Gurty, Team Death
by Monkeys; 2nd:
Altitude, Team
Velocity; 3rd: Mission
Mayhem, Team Wildcard.
1 lb Antweight Class 1st: Melty
B 2.0, Spam Butcher; 2nd: Baby
Blaster, Ghetto Logic Robotics; 3rd:
Green Hornet, Robo-Yasha.
R
oaming Robots held an event in
Portsmouth at the Mountbatten
Centre on 10/6-7/2007. Go to
www.roamingrobots.co.uk for
EVENTS
Results and Upcoming Events
SERVO 12.2007 29
CombatZone.qxd 11/5/2007 4:10 PM Page 29
more details.
R
oboCore was held in Brazil on
10/6-7/2007. Go to
www.robocore.net for more
details. Results are as follows:
Middleweight 1st: Touro, Team
RioBotz; 2nd: Orion, Team Triton;
3rd: Team ThunderRatz.
Hobbyweight (12 lb) 1st:
Puminha, Team RioBotz; 2nd:
Butcher, Team Uai!rrior; 3rd: Team
Botville.
Upcoming Events for
December 2007 and
January 2008
B
otsIQ Boston Regional, Rumble
At The Rock, will be presented
by: BotsIQ Boston in Plymouth,
MA on 12/1/2007. Go to
www.botsiq.org for more details.
T
he Plymouth North and
Plymouth South High School
Engineering Teams in cooperation
with BOTSIQ and The Boston
Tooling and Machining Association,
will host a 15 lb BOTSIQ Robot
Combat Competition at the
Engineering Lab at Plymouth North
High School 41 Obery Street,
Plymouth, MA.
W
reck-The-Halls will be present-
ed by Carolina Combat
Robots in Greensboro, NC, on
December 28 and 29, 2007. Go
to www.carolinacombat.com for
more details.
C
arolina Combat Robots is having
its second event in Greensboro,
NC. The arena is a 16 ft x 32 ft
steel structure with 1/4 steel floor
and 1/2 of Lexan for the walls.
The event will include robots from
150 g Fairyweight to the 120 lb
Middleweights.
R
oboChallenge will present their
Thinktank Christmas Special
December 28th and 29th in
Birmingham, England. Go to
www.robochallenge.co.uk for
more details. SV
MaximumRobotics.com
1-800-979-9130
Wiring Robot Controller
Atmel ATMega 128
128k Memory
43 Digital I/O Pins
8 Analog Inputs
8 External Interupts
6 PWM Channels
2 Serial Ports including Bi-Directional USB
The Wiring Programming Language
The Wiring language provides a simplified subset of
C or C++ that hides more advanced concepts like
classes, objects, pointers (while still making them
accessible for advanced users). You get the power
of C or C++ with the ease of a language like Basic.
Programs execute at full C++ speed on the board.
$69.95
Robot Controllers
ARC1.1 Robot Controller
Atmel ATMega16
1k SRAM, 16k Flash
Dual 1.1 amp motor drives
Supports motors up to 25V
Dual quadrature encoder support
Programming cable included with kit
No additional hardware needed
Works with BASCOM and AvrDude programming software
Ideal for controlling your small robot. With a Microcontroller
and onboard motor controllers, you get all the electronics
that you need (except sensors) on one board.
Kit $37.95 / Assembled $41.95
Programmable Robot Kits
INEX MicroCamp Mega8
Atmel ATMega8
Dual DC motor drivers
2 Buttons, 2 LEDs
Serial port
5-Analog ports for sensors
+5V switching power supply
No soldering required
Supports In-system Programming via ISP connector
with included PX-400 Serial Programmer
Includes eveything you need to build a simple mobile
robot. Add your own additional sensors for even
more complex robots.
$59.95
MicroBric Viper
Screw-together Assembly
BasicAtom Microcontroller
2 motor modules
Bump sensor modules
Switch Modules
IR Remote & Receiver Module
With microbric, you can build complex electronic
devices with little or no prior electronics knowledge.
As no soldering is involved and the parts are fully
reusable, you can build and rebuild programmable
robots as many times as you like.
$89.95
Also Available:
Electronic Components
Servos
Motors
Hardware
Wheels & Tires
and More!
More New Products on the way!
30 SERVO 12.2007
CombatZone.qxd 11/5/2007 4:10 PM Page 30
I
t is the voice for the Heathkit HERO
1 and HERO Jr robots, the RB5X
robot, some arcade games, and
several other devices. Many will always
remember hearing this chip asking if
Dr. Falken would like to play a game
of chess in the classic War Games
movie. The SC-01 had a long run, but
these days they are getting hard to
find. I was concerned about this and
wanted to ensure there was some sort
of replacement option that would be
available for the future.
Finding a suitable replacement for
this chip proved to be an interesting
project. It highlights
the many different
problems that come up
in the robotics hobby.
What seemed at first to
be a very straightforward
endeavor ended up covering a lot of
ground. Ill try to review all the ups and
downs and share some knowledge
along the way.
Currently, there is no direct drop-in
replacement for the SC-01 speech
synthesizer, so I decided to go about
creating one. At least a hybrid one
for now!
The Language
Barrier
First, let me start with how the
SC-01 generates its speech. Some
speech chips (or modules) accept
regular ASCII text strings and others act
like a sound recorder which play back
The SC-01 speech chip
was one of the most
popular speech chips in
use during the 80s ...
The SC-01 speech chip
was one of the most
popular speech chips in
use during the 80s ...
b y R o b e r t D o e r r
b y R o b e r t D o e r r
SERVO 12.2007 31
Doerr.qxd 11/1/2007 11:02 AM Page 31
32 SERVO 12.2007
stored phrases. The SC-01, however, is a
phoneme based synthesizer which
builds words from small sound
fragments called phonemes. With this in
mind, I looked to see
what other phoneme-based
speech chips are out there.
After looking at the few
available chips, it seemed
that the closest match
would be the SpeakJet
(SpeakGin) chip. Although
it too is phoneme based,
that is about all it has in
common with the SC-01
chip (except that they are
both in DIP packages).
In the SC-01, there are
64 of these phonemes
defined. The SpeakJet has 72 (allo-
phones) plus a variety of sound effects.
The first part of the project was to see
if this idea had merit and was possible.
All of the codes for each phoneme are
different for each chip. I went through
and made a lookup table for what I
thought would be a good mapping
of each SC-01 phoneme to SpeakJet
allophone. With this conversion table
in hand, I had some speech strings
from the HERO 1 that I ran through
the table.
Initially, I had a SpeakJet wired up
to an old Handyboard for testing. I then
took the translated string of phoneme
codes and with an Interactive C
program, sent them all to the SpeakJet.
The results of that first test were
inspiring and showed that this could be
a viable option. Some of the words
sounded exactly the same while others
needed work. (More to follow ...)
The original SC-01 chip.
Schematic for
the translator.
Doerr.qxd 11/1/2007 11:03 AM Page 32
The Protocol Barrier
Now that the SpeakJet could sound
like the good old SC-01 (provided the
right codes were fed into it), the next
step was handling the protocol it uses
to talk to the host. These days, a lot of
peripheral devices can be told what to
do using a single serial line with perhaps
a handshaking line or two.
The SC-01 and many earlier
devices are from when most peripheral
devices were parallel based. The SC-01
accepts six parallel bits of phoneme
data, two bits of inflection data, and
has a couple control lines to latch the
data and acknowledge (busy) that it
was received. This added one more
thing to deal with for a translator. The
SpeakJet, on the other hand, expects
to receive all the allophones sent as a
serial data stream.
Too Much Power
Another oddity about the SC-01 is
its source of power. Instead of just +5V
that most devices seem happy with,
this chip was commonly run at +12V.
Even so, it had a nice feature in that
the data lines had 5V compatible
inputs to make it easy to interface to
standard 5V systems. A hybrid module
would also need an onboard 5V
regulator to bring the supply down to a
safe level.
Enter the Translator
To fit in with the idea of drop-in
replacement for the SC-01, the whole
thing had to plug into the odd 22-pin
DIP socket and act just like an SC-01.
Lately, Ive been working with the
Parallax SX series of microcontrollers
and found that the SX28 was ideal for
this project. The translator program
was written in SX/B (BASIC compiler)
to make it easy for everyone reading
this article to follow the code. The
SX28 acts as the hardware protocol
translator, phoneme translator, and
handles all the handshaking signals. In
order to do this, it must:
Accept the parallel phoneme and
pitch data meant for the SC-01.
Acknowledge to the host
that it was received.
Perform a lookup to
determine what the equiv-
alent SpeakJet phoneme
should be.
Send any special codes
to the SpeakJet.
Send the new phoneme
to the SpeakJet (if buffer is
not too full).
Set the acknowledge line high to signal
that host can send another phoneme.
The Hardware
To jumpstart the project, this
whole prototype was built upon an
SX28 protoboard that Parallax offers. It
contains a SX28AC/SS-G surface mount
chip, voltage regulator, prototype area,
and a header for the programming
adapter. Programming the SX series
chips also requires the use of an SX-Key
or SX-Blitz. The ability to quickly Flash
the SX28 processor with new versions
of the translator code really helped
speed the development process along.
The SX28 is available in both a
28-pin SSOP package and a 28-pin DIP
package. An important point to note is
that pins 1 through 14 are not the same
on both package styles. Make sure to
note which package is used in any
schematic that uses the SX28 chip! Care
has to be taken when
switching package styles to
ensure the wiring is correct.
In the example schematic,
a surface mount SX28
SSOP package was used.
The SX28 chip sits
between the 22 pin SC-01
socket and the SpeakJet
chip to translate all the
signals. The only exception
is the voice out signal
which the SpeakJet
handles and goes out through pin 21
of the 22 pin socket. Port A of the
SX28 handles the serial data to and
also gets the status back from the
SpeakJet. Port B is used to get the
strobe from the host since that port
can generate interrupts. This will allow
for an alternate version of the transla-
tor to be written as interrupt driven.
A portion of port B can also act as an
analog converter and that pin is wired to
pin 16 (MCRC) of the 22 pin SC-01
socket. It can eventually look at the
riginal SC-01 timing signal and adjust
the translation speed accordingly. The
remaining pins on port B are used to get
configuration information from a DIP
switch. Port C is used to get the phoneme
and inflection data from the host.
To ensure the serial timing to the
SpeakJet would be accurate, a 4 MHz
resonator is used. Although the internal
RC clock of the SX28 is fine for many
projects, an external resonator or crystal
should be used when timing is critical.
SERVO 12.2007 33
The custom DIP adapter.
Original SC-01 amp board with
the DIP adapter replacing
the SC-01 microchip.
Doerr.qxd 11/1/2007 11:04 AM Page 33
34 SERVO 12.2007
Issues That Came
Up (and were
overcome)
As a real world test, I pulled out the
genuine SC-01 chip from the Speech
board of my HERO 1 robot and plugged
in my translator gadget.
The original power source for this
prototype originated from
the supply pin of the SC-01
socket. The HERO 1 can shut
down parts of itself to save
power and as a result the
power on the speech board
would cycle on and off this
12V supply whenever the
robot tried to talk. It also
made downloading new
translator program code a
chore since the board would
normally be off.
As a temporary solution, I supplied
power to the prototype board from the
+5V connection on the HERO 1 bread-
board. The amplifier section on the HERO
1 speech board would still power up and
down to save power. Later, the 5V regula-
tor will take the 12V from pin 1 on the 22
pin socket for power so that all the con-
nections are directly to the SC-01 socket.
The default behavior of the SpeakJet
is to announce READY. It is also what
the HERO 1 says when you first power
him up. When the power was first
applied, it would say READY but it was
misleading. I knew it wasnt going to be
that easy! It only did it the first time it
was powered up and following that, all it
made was a sort of sick Ehhh sound
repeating a bit before going silent.
Well, that isnt supposed to hap-
pen! It was pretty obvious what was
going on with the READY announce-
ment, so I took another look at the
source code. I found a typo for the vari-
able name used for the index to look
up the SpeakJet allophone in the table.
As a result, it was always pointing to
the first phoneme in the table (that
happens when your index is always 0)
so that explained it. I fixed that and
started to hear a few new phonemes.
I could make out some of the
phonemes and portions of words but it
was way off. I knew that the lookup
table would need work but thought I
cant be that far off! A little trou-
bleshooting work quickly uncovered
what had happened. I had used a 22 pin
DIP socket to make the plug-in adapter
to go into the original SC-01 socket. The
leads are fairly thin as it was a standard
dual leaf socket. You may have already
guessed what had happened.
Two of the six data leads used to
send the phoneme data to the SC-01
on my custom connector had folded
under instead of going into their
appropriate pins in the socket below.
That left two of the six data bits used
to select a phoneme open and in a
floating state. Usually when something
is open it floats high, so it meant that
some phonemes would never be used
and other incorrect ones would be
selected in their place! Once that was
fixed, it started to sound a lot better.
The robot would speak a portion
of what it was supposed to but would
be truncated before it could finish. The
SC-01 would accept a single phoneme
at a time and would be ready to accept
the next while speaking so the speech
would be continuous. This ended up
being another issue.
The SpeakJet is nice enough to
offer a 64 byte buffer for incoming
commands/allophones. The robot
would send along all its phonemes
which were being buffered by the
SpeakJet. Once transferred, the robot
would assume the speech was done
and shut down power to the speech
board, shutting off the sound amplifier.
(Hmm, thats a problem!)
To confirm that was the case, I threw
in a small delay after each phoneme was
received and sent over to the SpeakJet. It
definitely showed this was it and then
brought up the issue of how to deal with
it. The SpeakJet provides a few handshak-
ing signals. It can signal if its ready, it can
tell you if it is actively speaking, and it can
tell you if the 64 byte buffer is half full.
Unfortunately, it has no easy way of
letting you know when there is only one
byte left in the buffer.
This is something that would have
been extremely useful in its role of
impersonating an SC-01. Instead of
sending all it could take and using the
buffer half full as a handshaking signal,
I wanted to spoon-feed the chip and
provide it the allophone codes one at a
time so I would know about when it
would be done. I did try using the
speaking line as the handshake, but the
problem was there ended up being a
pause between each phoneme which
was unacceptable. It seemed that it
www.robotworkshop.com
Authors website, home for the HERO
robots and vintage robot Guru
(Pre-programmed SX28 chips with
resonator available here).
www.parallax.com
Provider of the SX series processors.
Offers free software development
tools like SX/B.
http://forums.parallax.com/forums/
Online user forum for SX series
microcontrollers.
www.speechchips.com
Provider of SpeakJet chips.
www.redcedar.com
Great historical reference and
data on SC-01.
groups.yahoo.com/speakjet
Online user group for SpeakJet chip.
www.speakjet.com
Website for the SpeakJet chip.
www.soundgin.com
Website for the SpeakGin and
SoundGin chips.
www.rbrobotics.com
Home of the RB5X robot.
SpeakJet-based
replacement board.
References
Doerr.qxd 11/1/2007 11:05 AM Page 34
would either take too much or too little.
Unfortunately, none were just right ...
Luckily, an elegant little solution hit
me. Why not just go ahead and send
codes to the SpeakJet using the buffer
half full as a throttle. Then as a way to
sync up the timing, I could use the
Speaking handshake line whenever the
SC-01 was sent a pause or a STOP. It just
so happens that the convention used in
the HERO 1 is such that all the speech
sent to the speech board ends with a
STOP to ensure the board would finish
speaking before it was powered off. This
was PERFECT! An audible pause between
phonemes might normally be a problem,
but if the phoneme was a silent one,
then no one would notice. This is just
what I needed to make it work on HERO
1 and it got around the power issue.
After that, some more work went
into the translation table for the SC-01
phonemes to SpeakJet allophones. Extra
code was added to consider the two
inflection bits. If they changed state from
the last phoneme, then the program will
send out a code to the SpeakJet to
change its inflection to improve the
emulation. Its still not perfect, but keeps
getting better with each revision.
One of the last minute additions
into the code was to send a small
pause phoneme to the SpeakJet when
everything was first powered up.
Without this, the first phoneme that
was translated and sent to the
SpeakJet was garbled. Adding that
delay cleared up the problem and now
everything sounds just as expected.
The Extras
Finally just for fun I wanted to
use some of the extra features of the
SpeakJet and put a few of the extra
unused pins on the SX28 chip to good
use. One of the unused bits on port
B (RB.5) can send debugging info
to a serial port for monitoring the
translation process. A small DIP switch
was added to configure the way the
translation is handled. Alternately,
instead of a DIP switch, an output port
on the robot or another device could
be used to control these settings.
In the example program provided,
DIP switch 1 is used to enable R2/Bio
sounds instead of regular SC-01
phoneme translation, DIP switch 2
enables extra status info to be sent out
the debug port, and DIP switch 3
enables a small section of code to ini-
tialize a fresh SpeakJet chip by disabling
its startup READY announcement.
Now, by merely flipping a DIP
switch, I can have HERO speak just like
R2D2 since it translates real phonemes to
equivalent R2 sounds. I dont know if the
real R2 would understand it but everyone
that hears it seems to like it! So, not only
will this project effectively emulate an
SC-01, but also adds value by leveraging
some extras within the SpeakJet.
Ideas for
Improvement
Better matching of audio output
circuitry here.
Monitor RC circuit that sets SC-01
timing and adjust overall timing of
emulation.
Tweak phoneme lookup table.
Add another mode to enable more
special SpeakJet features like sound
effects.
Make another version to translate
from the SC-02 (SSI263) to the SpeakJet.
It should be noted that either the
SpeakJet or SpeakGin chips can be used
interchangeably as the target speech
chip with this project. For those that
may not be aware, these two devices
are actually the exact same chip. The co-
developers decided to pursue different
markets and each have their own brand
name for this particular speech chip.
Eventually, this can all be put on a
little hybrid module as a nice tidy
plug-in replacement package. For those
of you interested in trying out the
translator yourself, preprogrammed
SX28 chips with a resonator will be
available from the author. SV
SERVO 12.2007 35
Robert has been working on personal
robots since building one of the early
HERO 1 robot kits when they came
out. He enjoys repairing/rebuilding/
upgrading all the robots from that era. It
can be challenging at times, but it is
rewarding to keep these old robots going.
About the Author
The source code for the translator is
available on the SERVO website at
www.servomagazine.com.
Note
Tormach PCNC 1100 Features:
Q Table size 34" x 9.5"
Q R8 Spindle 1.5 hp variable speed to 4500 RPM
Q Computer controlled spindle speed and direction
Q Precision ground ballscrews
Q Digitizing and tool sensing support
Q 4th axis and high speed spindle options
3 Axis Mill
$6800
plus shipping
When youre serious about hardware, you need serious tools.
Whether milling 0.020 traces on prototype PCBs or cutting
steel battle armor, this CNC mill can do it all. Weighing in at more
than 1100 lbs, the PCNC can deliver the hardware end of your
combined hardware & software projects.
Precision CNC
Machining
Mill includes Control, CAD and CAM
software. Optional stand, coolant system,
computer and accessories are extra.
Product information and online ordering at www.tormach.com
Doerr.qxd 11/1/2007 11:07 AM Page 35
36 SERVO 12.2007
More on the NEMA
0183 Protocol
Back in Part 1, we looked at the
GSV and GSA NEMA commands.
While those commands are invaluable
for determining your GPS lock status,
they wont yield any positional
data, which you will need in order to
generate a nifty plot like that of Figure
1. Lets take a look at two additional
commands:
GGA: Time, Position, Fix Type
RMC: Time, Date, Position, Course,
Speed
Remember you can download a
complete NEMA 0183 reference
manual at www.sparkfun.com/data
sheets/GPS/NMEA%20Reference%
20Manual1.pdf.
Just To Recap:
A NEMA 0183 message begins
with a $GP and ends with a
carriage return. It looks something
like this:
$GPGSV,3,1,12,20,00,000,,10,00,
000,,25,00,000,,27,00,000,*79
The message name which is
also referred to as the option
comprises the characters just
following the $GP. Each data
element is separated by a comma.
The data elements are terminated
by the * character, followed by the
checksum. There is an eight-bit
XOR of each character between the
$ and * to form the checksum. The
last two characters in the message are
a hex representation of the calculated
checksum.
GGA: Global Positioning System
Fixed Data
Field 1, UTC Time in the format of
hhmmss.sss
Field 2, Latitude in the format of
ddmm.mmmm
Field 3, N/S Indicator (N=North,
S=South)
Field 4, Longitude in the format of
dddmm.mmmm
Field 5, E/W Indicator (E=East,
W=West)
Field 6, Position Fix Indicator (0=No
Fix, 1=SPS Fix, 2=DGPS Fix)
Field 7, Satellites Used (0-12)
Field 8, Horizontal Dilution of
Precision
Field 9, MSL Altitude
Field 10, MSL Units (M=Meters)
Field 11, Geoid Separation
Field 12, Geoid Units (M=Meters)
Field 13, Age of Diff Correction in
seconds
Field 14, Diff Reference
by Michael Simpson
FIGURE 1
GPS
PART 3
Simpson3.qxd 11/5/2007 3:45 PM Page 36
RMC: Recommended Minimum
Specific GNSS Data
Field 1, UTC Time in the format of
hhmmss.sss
Field 2, Status (A=Valid Data,
B=Invalid Data)
Field 3, Latitude in the format of
ddmm.mmmm
Fields 4, N/S Indicator (N=North,
S=South)
Field 5, Longitude in the format of
dddmm.mmmm
Field 6, E/W Indicator (E=East,
W=West)
Field 7, Speed over ground in knots
Field 8, Course over ground in
degrees
Field 9, Date in the format of ddmmyy
Field 10, Magnetic Variation in degrees
Field 11, Mode (A=Autonomous,
D=DGPS, E=DR)
Both the GGA and RMC fields will
give you the Longitude and Latitude,
but only the GGA will report the
Altitude and Fix Type. The RMC
command will report your course and
speed. So, its clear that we need to
parse both of these commands to
gain all the information.
Data Logger
To help you understand the GGA
and RMC commands a little better,
lets start out by building a data
logger. Data loggers are invaluable
because they let you collect test data
that you can later use to help you
test and refine your projects without
having to resort to field tests.
As shown in Figure 2, the data
logger is straightforward. I have
included both PC and
Pocket PC versions that will handle all
the modules and receivers discussed in
this series. You select the device using
the Device menu shown in Figure 3.
This will set the correct baud rate and
enable special setup commands needed
for the Etek and Copernicus modules.
You start the data collection by
hitting the start button shown in
Figure 4. The program will then open
the com port indicated and initialize
the GPS module, if needed. Collected
data will be saved to the file indicated.
If you want to save the file into the
same directory as the GPSDataLogger
program, precede the filename with a
decimal point as shown in Figure 4.
As data is collected and saved, it is
also parsed. The NEMA commands
GGA, GSV, GSA, and RMC are all
parsed. The pertinent information is
FIGURE 2 FIGURE 3
FIGURE 5
FIGURE 6
FIGURE 4
SERVO 12.2007 37
Simpson3.qxd 11/5/2007 3:48 PM Page 37
38 SERVO 12.2007
displayed on the form as shown in Figure
5. The actual number of bytes captured
and saved will also be displayed. If
you see the captured number go up
but none of the data fields are updated,
you have selected the wrong device.
Data Plotter
You will want to view the data
you collected. I have created two
programs to allow you to do just that.
The GPSLogDisplay program shown in
Figure 6 will display all the pertinent
information. You select the log file
captured with the GPSDataLogger
program by selecting the File Menu as
shown in Figure 7.
You have the option of displaying
the data as fast as your computer can
process the data, or in real time by
setting the RealTime menu shown in
Figure 8. When in real time,
the data will be processed
based on the UTC time stamp
in the message. What the
program does is look for
differences in the seconds in
the UTC field. When it sees a
discrepancy, it delays the
program for one second.
For actual plotting, you
can use the program called
GPSLogPlot shown in Figure 9.
This program will allow you to
plot your actual trip. By default,
the program sets the scale to
200. This divides plot points by
200, thus shrinking the plot to
fit on the display. You can
change this using the settings
menu. When plotting short
distances, use a smaller scale.
When you start the plot,
the first valid point becomes
the reference starting point
that will be by default the
center point on the display.
You can change this point by
changing the Start x and Start
y points in the settings menu.
The actual plot area is a 1000
x 1000 grid. You can change
the view of this grid by using
the small pad on the form
shown in Figure 10. The
center button will center the
view to its default.
The plots shown in Figure
11 were all captured with the
GPSDataLogger and my pocket PC
using the BT359W shown in Figure 12.
This is the most accurate GPS I have
ever owned. The main reason I have not
showcased it in this series is that it is a
Bluetooth only receiver. You can use the
same interface program as the Holux
GPSLim236. Unlike the GPSLim236, the
BT359W does supports WAAS.
GPS Parsing Software
While I have included the
compiled version of the pro-
grams presented in this article, I
have also included the source
code for those that may want to
Function Variable Populated
procGGA
GGA_UTCTime
GGA_Latitude
GGA_NS
GGA_Longitude
GGA_EW
GGA_FIX
GGA_FIXtxt
GGA_Sats
GGA_HDOP
GGA_AltValue
GGA_AltUnit
GGA_Sep
GGA_SepUnits
GGA_Age
GGA_Diff
procRMC
RMC_UTC
RMC_Status
RMC_Latitude
RMC_NS
RMC_Longitude
RMC_EW
RMC_SOG
RMC_COG
RMC_Date
RMC_Variation
RMC_Mode
procGSV
GSV_SATSINVIEW
GSV_NOM
GSV_MSG
GSV_SATIDS(x)
GSV_SATELE(x)
GSV_SATAZ(x)
GSV_SATSNR(x)
When GSV_NOM = GSV_MSG then
all data has been
collected. At that point you should
set GSV_NOM = 0
procGSA
GSA_SATMODE
GSA_SATCOUNT
TABLE 1
FIGURE 7
FIGURE 8
FIGURE 9
FIGURE 11 FIGURE 10
Simpson3.qxd 11/5/2007 3:48 PM Page 38
roll their own. Each of the programs
parse the GGA, RMC, GSV, and GSA
NEMA commands. The main NEMA
processor function is called ProcNEMA.
This function calls four functions to
handle the parsing of these commands.
Each function populates a set of global
variables as shown in Table 1. These
variables map to the fields in the NEMA
specification. One exception is the
GGA_FIXtxt variable, which contains an
actual description of the FIX type.
Take a look at the Dispit function
shown in Program Snippet. This
is the heart of the GPSLogDisplay
program. This function is called
when the Start button is pressed. The
function opens the log file you have
selected, then enters a processing
loop. In each iteration of the loop,
the abort button is checked and a line
of data is retrieved from the log file. If
the end of the file is reached or the

Get and display the data

func Dispit()
dim tstr as string
dim newtime as string
dim oldgpstime as string
FormMenu(0,0,0,)
FormButton(Disp_Start,-1,-1,-1,-1,Abort)
First Open the File
if FileOpen(1,gfname,Open) = 0 then
msgbox(Unable to open file: +gfname,0,Open File)
FormMenu(0,0,1,)
FormButton(Disp_Start,-1,-1,-1,-1,Start)
exit()
endif
============================================================
- Main Data Display Loop -
loop:
if FormButton(Disp_Start,0) > 0 then
FileClose(1)
FormMenu(0,0,1,)
FormButton(Disp_Start,-1,-1,-1,-1,Start)
exit()
endif
if FileEOF(1) = 1 then
FileClose(1)
Print End of Data
FormMenu(0,0,1,)
FormButton(Disp_Start,-1,-1,-1,-1,Start)
exit()
endif
- Read a Line of data from Log File
procNEMA(FileReadLine(1))
- If we get a GGA message lets update the display
strif NEMAmsg = GGA then
newtime=converttime(GGA_UTCTime,-5))
FormLabel(Disp_time,-1,-1,-1,-1,newtime)
Formlabel(Disp_Fix,-1,-1,-1,-1,GGA_FIXtxt)
Formlabel(Disp_mode,-1,-1,-1,-1,GSA_SATMODE)
Formlabel(Disp_sats,-1,-1,-1,-1,GSA_SATCOUNT)
GSV_NOM=0
GSV_MSG=0
if GGA_Fix <> 0 then
Formlabel(Disp_Longitude,-1,-1,-1,-1,GGA_Longitude+GGA_EW)
Formlabel(Disp_Latitude,-1,-1,-1,-1,GGA_Latitude+GGA_NS)
Formlabel(Disp_Alt,-1,-1,-1,-1,GGA_AltValue+GGA_AltUnit)
Formlabel(Disp_Course,-1,-1,-1,-1,RMC_COG)
Formlabel(Disp_Speed,-1,-1,-1,-1,Format(float(RMC_SOG *
1.1508),.0)+ mph)
else
Formlabel(Disp_Longitude,-1,-1,-1,-1,)
Program Snippet
FIGURE 12
FIGURE 13
SERVO 12.2007 39
continued ...
Simpson3.qxd 11/5/2007 3:51 PM Page 39
40 SERVO 12.2007
abort button is hit, the file is closed
and the function exits. Each line
retrieved from the log file is passed to
the procNEMA function and only
when a GGA message is received does
the display get updated.
The plotit function in the
GPSLogPlot program is very similar to
the dispit function, with the exception
of how the GPS information is pre-
sented. The plotit function uses a spe-
cial command built into the Zeus lan-
guages called GPSCVTLongitudedec
and GPSCVTLatitudedec to convert
the GPS positional string data to an
integer value in degrees * 100000.
This is a whole number that can be
used for plotting.
One final variation of the dispit
function is the StartCapture function
used in the GPSDataLogger program. In
this function, a com port is opened and
its parameters are
set based on
the actual device
selected. The function also calls various
setup functions to place the device into
the correct mode when needed. Instead
of calling the procNEMA function
directly, data from the device is added
to a global variable called rxdat when
it is received. A call is then made to a
function called procdata. This function
pulls a single line (one at a time) from
the rxdat variable and passes them to
the procNEMA command as before.
Sending Log Data
Plotting and displaying data is
cool to play with, but the main reason
we want to capture the data is so that
we can simulate an actual GPS mod-
ule or receiver. I have included a pro-
gram called GPSLogOutput shown in
Figure 13. GPSLogOutput allows you
to play back the captured log data to
a serial port. The program looks and
operates much like the GPSLogDisplay
program, but also sends a copy of the
captured data to a serial com port.
You select the com port via the
Settings menu shown in Figure 14.
You can also set the baud rate and
flag the data to be sent in real time.
Using the Log
Data with a
Microcontroller
Next month, when we start
to interface the GPS modules
to a microcontroller, the
GPSLogOutput program will be
indispensable. In addition to
your PC, you will
need a DiosPro
DiosProg1.txt
func main()
dim val
hsersetup baud,HBAUD4800,start,txon
nodata:
hserin nodata,val
debug val
goto nodata
endfunc
Program 1
FIGURE 14
FIGURE 15
FIGURE 16
Program Snippet continued ...
Formlabel(Disp_Latitude,-1,-1,-1,-1,)
Formlabel(Disp_Alt,-1,-1,-1,-1,)
Formlabel(Disp_Course,-1,-1,-1,-1,)
Formlabel(Disp_Speed,-1,-1,-1,-1,)
endif
- Used for realtime display option
strif oldgpstime <> newtime then
oldgpstime = newtime
if realtime = 1 then pause(1000)
endif
endif
goto loop
endfunc
Simpson3.qxd 11/5/2007 3:51 PM Page 40
microcontroller and a carrier
board. I will be using the
Dios Workboard Deluxe
shown in Figure 15. The
DiosPro has a UART built
into the chip that has a TTL
interface. This is perfect for
the modules, but in order to
use our PC as a simulator, you
will need an EZRS232 interface shown
in Figure 16.
In order to use the GPSLogOutput
program, you will need two serial
ports on your PC. One port will con-
nect to the program port on the
Workboard and the other will connect
to the EZRS232 module. Connect the
following pins on the EZRS232
module to the Dios Workboard as
shown in Figure 17.
EZRS232 Pin 1 Workboard VSS
EZRS232 Pin 2 Workboard VDD
EZRS232 Pin 3 Workboard Port 8
EZRS232 Pin 4 Workboard Port 9
Load code shown in Program 1
into the DiosPro compiler and
program the chip. Once loaded, start
the GPSLogOutput program and load
up one of the LogData files I have
included. Set the GPSLogOutput com
port to the one that is connected to
the EZRS232 module. Set the baud
rate to 4800 as shown in Figure 18.
Once this is done, hit the start
program. You should see NEMA data
in the debug terminal of the Dios
compiler as shown in Figure 19.
It just so happens that the
DiosPro already has a library called
DiosNEMA. It is automatically loaded
when you place a call to the
procNEMA function in your Dios
program as shown in
Program 2.
This library will
break down the
GGA and RMC com-
mands and load up a
FIGURE 19
FIGURE 20
Dios NEMA Proccessor
func main()
clear
hsersetup baud,HBAUD4800,start,txon,clear
print Mode Lat Long Alt Speed Dir
print - - - -
loop:
procNEMA()
if NEMAcmd = 3 then GGA
if NEMAfix > 0 then
print NEMAfix,:,NEMAsats, ,{-6.0} NEMAlatmin, ,NEMAlongmin;
print ,{6.1} NEMAaltitude, ,{4.1} NEMAspeed, ,NEMAdir
else
print No Fix ,NEMAfix,:,NEMAsats
endif
endif
goto loop
endfunc
include \lib\DiosNEMA.lib
Program 2
SERVO 12.2007 41
FIGURE 17
FIGURE 18
Simpson3.qxd 11/5/2007 3:52 PM Page 41
set of global variables that you can
use in your own program. In Program
2, I used the print command to send
various pieces of NEMA data to the
debug terminal shown in Figure 20.
Whats Next
Next month, Im going to show
you how to connect the various GPS
modules to the microcontroller and
how to parse the data.
Be sure to check for updates
and downloads for this article at
www.kronosrobotics.com/Projects
/GPS.shtml SV
The following is a breakdown of sources
for all the components needed for
Parts 1 through 4 of this project.
SPARK FUN ELECTRONICS
EM-406A GPS Module
www.sparkfun.com/commerce/
product_info.php?products_id=465
EM-406 Evaluation Board
www.sparkfun.com/commerce/
product_info.php?products_id=653
EM-408 GPS Module
www.sparkfun.com/commerce/
product_info.php?products_id=8234
Copernicus Evaluation Board
www.sparkfun.com/commerce/
product_info.php?products_id=8145
Nine-Pin Serial Cable
www.sparkfun.com/commerce/
product_info.php?products_id=65
6V AC Adapter
www.sparkfun.com/commerce/
product_info.php?products_id=737
External Antenna with SMA connector
www.sparkfun.com/commerce/
product_info.php?products_id=464
SMA to MMCX Adapter Cable
www.sparkfun.com/commerce/
product_info.php?products_id=285
KRMICROS
ZeusPro
www.krmicros.com/Development/
ZeusPro/ZeusPro.htm
KRONOS ROBOTICS
EZRS232
www.kronosrobotics.com/xcart/
product.php?productid=16167
DiosPro Chip
www.kronosrobotics.com/xcart/
product.php?productid=16428
Dios WorkBoard Deluxe
www.kronosrobotics.com/xcart/
product.php?productid=16452
Parts List
42 SERVO 12.2007
Simpson3.qxd 11/5/2007 3:53 PM Page 42
R
ewards and punishments
can serve as fundamental
motivations for learning. Think
of how you train your dog through
tasty treats or the occasional knock
on the nose. Your robot isnt much
different. You can reward a robot for
staying on target or punish it for getting
out of line in much the same way.
Dogs already know how good a
treat is and can associate the reward
with their behavior. Robots, however,
need to be taught what a reward
is and how to relate it to their
actions. Reinforcement learning (RL) is
a technique for educating your robot
about actions that are beneficial or
detrimental.
Lets work with a barebones
example. Say you want to teach your
robot to stop at a goal one foot in front
of it. You could program that behavior
directly, but that approach could get
tedious or tricky with more complex
scenarios. What if you want the robot
to find its way through a maze? What
if you want the robot to find the
quickest path through a range of
terrains? Or the most opti-
mal grip for an assortment
of drinking cups? Or the
optimal tilt angle to shoot a
projectile? RL can help.
First, you have to define
a goal, actions, states,
rewards, a policy for choos-
ing actions, and a value
function for the states. In
general, for each time step t, an action
a is taken, the state s is updated, and
reward r is given (Figure 1).
Lets go back to the example of
stopping at a goal one foot in front
of a starting point. We will need a
sensor (e.g., odometry) that can return
how far the robot has moved. Next,
by Karla Conn
SERVO 12.2007 43
FIGURE 1. Basic relation
between a robot and
an RL environment.
Conn.qxd 11/1/2007 11:10 AM Page 43
44 SERVO 12.2007
we need to define the scenario (see
Table 1).
A program flowchart and the cen-
tral loop of the corresponding example
code are shown in Figure 2. Go to
www.servomagazine.com to down-
load RL_stand_alone_example.cpp for
the full C++ code. To begin the RL
algorithm, we initialize the odometry,
starting state, starting action, reward,
and the values of the states. The robot
will begin stopped (a2) at a location
away from the goal (s2) and then use
the policy to select actions. With each
action taken, the state is updated and
a reward is given based on the new
state. The objective is to take actions
that lead to the current state matching
the goal (s1).
While the current state is not the
goal, the robot takes actions based
on the policy (e.g., randomly). Then,
sensors are used to determine the
new state and a reward is given. Values
of the states (value_s1, value_s2)
are updated based on the reward
until the search for the goal is
satisfied. Once the goal is found, the
robot can stop.
In the above example, say the first
action randomly chosen is stop. The
odometry would be updated (i.e., less
than one foot), and the state would be
updated based on the definitions (since
odometry < one foot, new state = not
goal, represented by s2). Therefore,
the reward given for the state would
be zero, and the value function would
update the state value by adding
the current state value to the reward
(s2 = 0 + 0).
Say the next action
randomly chosen is move
forward and the robot
moved at least a foot,
then the odometry would
read at least one foot or
more. The updated state
would be set to s1 (i.e.,
since odometry one
foot, new state = goal).
Therefore, the reward
given would be one, and
the value function would
update the state value (s1
= 0 + 1). The while loop
would be satisfied and
since the robot has found
the goal, it can stop. The
result is an educated set
of state values that can be used in
later runs of the program to improve
performance.
Intrigued with how the algorithm
works? Impressed? Unimpressed?
Perhaps. The above example outlines a
mere foundation for a valuable way to
teach a robot. RL is valuable because it
can adapt to so many different
situations and remains flexible enough
to accommodate a variety of goals
and/or state definitions.
In the remainder of this introducto-
ry article, I will touch on some ways
you can compound on the basics set
up so far and give examples of where
to try your own RL ideas. First, a bit of
fair warning. Your robot may need lots
and lots of iterations (maybe hundreds
or thousands of runs, depending on
the application) before the RL
algorithm settles on an optimal
solution. So schedule adequate time
for your robot to learn, but dont let
that word of caution stop you from
giving your robot the means to learn
on its own. Dont be confined to the
definitions in the above basic example,
either. There are plenty of ways to
expand on the RL parameters.
For example, instead of random
selection, the policy can choose to
Start
Initialize
Parameters
Goal
Found?
Stop
Use Policy to
Choose Action
Take
Action
Update
State Value
Update
State
Give
Reward
//Goal Found?
while (current_state != s1){
//Use Policy to Choose Action
if (random_number < 5){
current_action = a1;
}
else current_action = a2;
//Take Action
if (current_action == a1){
//execute move forward action
}
else //execute stop action
//Get new Odometry value in units of feet
//Update State
if (odometry >=1){
new_state = s1;
}
else new_state = s2;
//Give Reward
if (new_state == s1){
reward = 1;
}
else reward = 0;
//Update State Value
if (new_state == s1){
value_s1 = value_s1 + reward;
}
else value_s2 = value_s2 + reward;
//Replace Current State with New State
current_state = new_state;
}
//Once current_state is the goal, stop
current_action = a2; //execute stop action
Y
N
FIGURE 2. Program
flowchart (left) and
central while loop of
RL_stand_alone_example.
cpp (right).
Goal: When odometry one foot
Actions (a
1
, a
2
): a
1
= move forward
a
2
= stop
States (s
1
, s
2
): s
1
= goal
s
2
= not goal
Reward: If current state = not goal, reward = 0
If current state = goal, reward = 1
Policy: Random selection
Value: New state value = current state value + reward
Table 1
Conn.qxd 11/1/2007 11:11 AM Page 44
move into states with the highest
value. Preference could also be set
to choose moving forward, turning
left, etc. Modifications can certainly
be made to the definitions for states
and actions. Also, initializing the
state values to zero is common, but
assigning specifically-chosen values or
randomly populating state values is
permitted.
Rewards can also be negative
(punishments) to penalize states that
move away from the goal, and any
piece of data which you wish to
maximize or minimize can be used as
part of the reward function. For
instance, what if you want your robot
to learn to choose actions which find
the goal quickly? Incorporate a variable
to represent time or the number of
steps taken to find the goal in a
negative reward function (reward =
-full_reward*time_step). A slightly
negative step-based reward is like
giving your robot a little kick at each
step toward the goal, training it to
hurry up and find the goal faster.
A constructive addition to an RL
algorithm is the combination of states
and actions into state-action pairs. This
concept is called Q-learning, where
Q(s,a) represents the value of taking
action a in state s. This way, the reward
function rewards the state-action pair
that caused the action to move from a
non-goal state into the goal state.
Multiple runs can develop the
Q(s,a) values for all state-action pairs in
a task until the optimal solution is
found. Even if the optimal solution is
not found (due to equivalent solu-
tions), each run can refine the Q(s,a)
values towards closer representations
of the true value of taking action a in
state s.
Table 2 shows a set-up for an RL
algorithm with (i) a policy with a pref-
erence for moving forward, (ii) multiple
states besides the goal, and (iii) a
slightly negative step-based reward
function. A full example of this C++
code (RL_expanded_example.cpp),
including a random population of the
state values and state-action pairs, can
also be downloaded from www.ser
vomagazine.com.
Once mastered, you can use this
algorithm in loads of applications. You
simply need a task with a goal. Then
you define your states, actions,
rewards, policy, and value function. Say
you want your robot to learn how to
coordinate its leg movements to
crabwalk. Define plausible states and
actions, and set a reward function
based on forward movement. Then let
your robot loose to learn. Give your
robot plenty of chances to find the
goal, and youll have a self-sufficient
robot in no time.
Once your robot can learn to
associate rewards with its actions,
challenge it to a duel of who can find
the quickest path through a maze or
over rough terrain. Reward yourself
and your robot accordingly. SV
SERVO 12.2007 45
Goal: When odometry two feet
Actions (a
1
, a
2
, a
3
): a
1
= move forward
a
2
= stop
a
3
= move backward
States (s
1
, s
2
, s
3
, s
4
): s
1
= goal (odometry two feet)
s
2
= not goal (two feet > odometry one foot)
s
3
= not goal (one foot > odometry zero feet)
s
4
= not goal (zero feet > odometry)
Reward: If current state = s
4
, reward = -8*time_step
If current state = s
3
, reward = -4*time_step
If current state = s
2
, reward = -1*time_step
If current state = s
1
, reward = 100
Policy: 60% move forward, 30% highest state-action pair
value, 10% random
Value: New state-action pair value = current state-action
pair value + reward
Table 2
Conn.qxd 11/1/2007 11:11 AM Page 45
46 SERVO 12.2007
I
t is an appealing thought to have a
robot that can be instructed how to
perform a task by simply showing it
what to do. It would save a lot of time
otherwise spent on programming the
robot. The concept to simplify robot pro-
gramming by giving the robot abilities to
mimic tasks shown by the user is called
Programming by Demonstration, or PbD.
In future applications where
robots are assumed to be found
everywhere in our life it would also be
advantageous to give them instructions
on exactly how we want a task
performed simply by showing the task.
Another reason to try simplifying robot
programming is that smaller enterpris-
es with shorter production series might
then become interested in automating
their production.
Motion Capturing
The first step in the PbD process is to
capture the data. That is, record and store
the motions performed by the human
demonstrator and their impact on the
environment. Several options using
different measurement principles are
available for this purpose. If a vision-
based system is used, the human can
move without too many constraints These
systems require rather heavy image
processing, though. In most cases, the
system tracks different markers attached
to certain body parts and the limb motion
is reconstructed with the help of a
kinematic model of the human body. It is
also possible to extract human body
motions directly from raw image data.
Another option is to use a dedicated
wearable motion capturing system
(popular for movie making and analyzing
motion in sports). The measurement
system is firmly attached to the areas of
the body that need to be captured. This
type of system requires less data
processing, however, the user cannot
move as freely. Another catch is the price;
for example, a reliable six degree of
freedom tracker starts at about $10,000!
Another issue with a wearable data
capturing system is that the information
the sensors can pick up is limited to a
Programming By Demonstrating Robots
TASK PRIMITIVES
It is relatively easy for humans to imitate a task shown to us. This ability to
imitate is well developed both in us and in other primates, but rarely found in
other animals. Think of a pet; it is not straightforward to just show your dog how
to fetch the newspaper. So, it should be no surprise that it has been very hard
to design a robot with the same imitating capabilities as humans.
by Alexander Skoglung
and Boyko Iliev
Skoglund.qxd 11/5/2007 4:01 PM Page 46
specific area. For example, a glove will
only provide data on the fingers
configuration; no data will be available
on hand position and orientation, or
objects in the sensors vicinity. Basically,
the sensor is blind to the environment.
Data fusion to combine several
inputs into a single source is often
necessary in order to gather information
surrounding the motion capturing
device. In structured environments
(such as factory lines), CAD models can
be used to aid the data capturing
instead of using more sensors.
Task Primitives
Another important aspect to
consider is what your robot is capable of.
The mechanical structure of the robot
will determine what tasks and motions it
can perform. For example, Figure 1
shows a six degree of freedom robot
arm with the elbow in an up position.
It is important to distinguish
between tasks and motions. Returning
to the example of a dog fetching your
newspaper, the dog can perform the
required task, but in a different way (or
motion) than you would since dogs
dont have hands. (Of course, you
could do it the same way as your dog).
The difference between human and
robot body configurations means that
the robot may be able to perform a
task, but not with the same motion as
a human. Therefore, the human needs
to know how the robot behaves.
To approach the problem of
different body configurations, there are
two assumptions to be made that will
simplify the process. First, the humans
and robots end effectors (the humans
hand and the robots gripper) can be
associated with each other. Second, the
task can be seen as a set of subtasks.
In the the case of subtasks,
consider a fairly general task such as
Pick-and-Place commonly performed by
industrial robots. Break the task down
into smaller building blocks: Move-To-
Point, Move-Linearly-To-Point, Move-
Along-Path, Approach-Object, Grasp-
Object, Release-Object, and so on.
Given a clever design of these building
blocks, a great number of tasks can be
described by a small set of task
primitives. Each of these building
blocks can be seen as small robot
programs that when put in sequence
will produce a full task.
One of the big challenges in PbD is
how to map the demonstrated task to
these primitives. Researchers are
currently trying to solve the daunting
challenge of how a robot should learn
completely new and novel tasks from a
set of predetermined primitives. For an
industrial robot that only performs Pick-
and-Place operations, learning novel
tasks is clearly requesting too much.
A number of basic facts about the
task are usually known in advance. In
a Pick-and-Place operation, the robot
starts from a certain position, moves to
an object, grasps the object, moves the
object to a new location, releases the
object, and moves away from it. It is
our belief that future manipulators
should be simple to program and have
these basic behaviors built in.
To simplify mapping from the
demonstration of primitives, we make the
assumption that the robots end-effector
is corresponding to the demonstrators
hand; by doing so, we indirectly tell the
robot that only the humans end
effectors trajectory is of importance.
Besides recording the end
effectors motion path, the velocity
profile (Figure 2) provides important
information about where the motion
segments start and end.
In a Pick-and-Place task, we know
the order of sub-tasks (illustrated in
Figure 2). The first detected point is
associated with the location to pick up
FIGURE 1. The manipulator in our experimental
setup, an ABB IRB140 equipped with a vacuum
gripper. A video of the task being performed
is available at AASS Learning Systems Labs
webpage: www.aass.oru.se/Research/ Learning/.
SERVO 12.2007 47
Skoglund.qxd 11/5/2007 4:02 PM Page 47
48 SERVO 12.2007
an object; the second location is where
to place the object. The trajectory
between these two locations should be
imitated, but the start and end points
are not important since they are not
actually parts of the task. However, the
segment on the trajectory just before
the grasp and after the release should
be imitated to preserve the way the
grasp is performed.
When the different variables (such
as locations, velocities, and orientations)
of the task are determined, the
sequence of instructions is transferred to
the robot controller. The sequence could
look like this:
1) <Move-To-Point 640,30,80>
2) <Grasp-Object 640,30,20>
3) <Move-Along-Path 648,25,87>
4) <Move-Along-Path 647,28,90>
By doing so, we assume the lower
control levels of the manipulator, such
as inverse kinematics, constraints of
the workspace, generation of the
trajectory with a higher granularity,
etc., to execute the requested
commands in the proper way.
It is important to note that other
primitives than these can be used.
For example, some tasks require the
robot to reorient an object, turn an
object several times (assembly tasks),
and so on. Consider the capabilities
of the robot; what motions can the
robot do and what motions are
impossible?
The primitives are small pieces of
program code that should reflect what
the robot can do and how it would do
it, and the human demonstrations put
these pieces together in a sequence.
A comparison can be made to a
programming language, made up by a
small set of instructions, from which
large programs can be written. In this
comparision, these task primitives are
an attempt to add some high-level
features to robot programming.
An Example Scenario
Lets look at how to teach an
industrial robot equipped with a
vacuum gripper to execute a Pick-and-
Place task. Inside the gripper, a spring
with a switch is mounted to detect
resistance when picking or placing an
object (illustrated in Figure 3). The
steps from the demonstration to a
robot program would be:
1) A human demonstration is captured
and transformed into the robots
reference frame.
2) Trajectories are segmented to
extract the points where the motions
start and end.
3) Extracted motions are decomposed
into task primitives.
4) Each task primitive is automatically
translated into robot-specific code.
5) The complete task is executed by
the robot.
It is important to note for Step 4
that the task is known in advance
which makes it possible to describe the
task as a predetermined sequence of
task primitives. These task primitives
are designed specifically for the robot,
but can be executed on most six
degree of freedom serial manipulators.
The primitives controlling the
grasp and release are specific to the
0 1 2 3 4 5 6 7 8 9 10
0
100
200
300
400
500
600
700
M
e
a
n

S
q
u
a
r
e
d

V
e
l
o
c
i
s
t
y

(
m
m
)
Time (sec)
GraspObject
MoveToPoint MoveToPoint
MoveAlongPath
MoveAlongPath
MoveAlongPath
ReleaseObject
First motion Second motion Third motion
d
u
Set point
Starting point
l
Gripper
Spring
FIGURE 2. The blue line is the mean
squared velocity from a human
demonstrator, recorded from the
fingertip at 12 Hz. The green vertical
lines are the detected start of a motion,
where the velocity profile is over a
certain threshold and the increase is over
a certain level. In a similar way, the red
vertical lines are the end of a motion.
FIGURE 3. The vacuum
gripper with the spring
switch; d is the distance
between the target point
and the starting point,
and is dependent of the
sensor inaccuracy, u. When
the spring is compressed
and the switch turned on,
the downward motion
immediately stops and the
suction is turned on.
Skoglund.qxd 11/5/2007 4:02 PM Page 48
type of gripper used. Furthermore,
we assume that the demonstrator is
aware of the manipulators structure,
such as workspace boundaries and
possible motions.
The demonstration is done under
the assumption that the teachers index
finger is associated with the suction cup
of the gripper. During demonstration,
the fingertip is tracked by a motion
capturing device, shown in Figure 4.
Initially, the demonstrator moves
from a starting point, P
0
, to the desired
pick-point, P
pick
(Figure 5). Then, he/she
moves along a certain path towards the
desired place-point, P
0
, and finally, back
to the end position P
w
(t).
The collected data consists of
position coordinates used for two
purposes: to detect the Pick-and-Place
positions, P
pick
and P
place
, and to
reconstruct the desired trajectory that
the robot should travel from P
pick
to P
place
.
The decomposition of a Pick-and-
Place task into task primitives is
illustrated in Figure 2. By using primitives
reflecting the commands available in the
robot language of the manipulator, we
achieve a simple implementation. In this
particular scenario, the following
primitives are used:
Move-Linearly-To-Point moves the
manipulators end effector linearly
(Cartesian space) to the desired point
in the workspace.
Move-To-Point moves the
manipulators end effector to the point
where it can hook on to the
demonstrated trajectory.
Move-Along-Path follows a
demonstrated trajectory by taking a
sequence of points with relatively
high granularity as the input, and
then executing an interpolated motion
between these points.
Grasp-Object moves towards an
object using a search motion (due to
the uncertainty of the objects location)
and grasps the object. A search motion
moves the gripper slowly towards
the object until contact is detected
by the touch sensor and the motion
is stopped.
Release-Object is similar to Grasp-
Object, but releases the object
instead.
The two first primitives are
typically implemented on standard
industrial manipulators as instructions,
since most manipulators would be of
limited use without such basic
instructions. The last three primitives
are not normally part of the
programming language for industrial
robots, so its a benefit to add them to
the repertoire.
A Primitive Example
Now lets take a closer look at the
task primitive Grasp-Object. Before
performing a grasp operation, the
For those interested, check out the
coverage listed below on the subject of
robot learning from demonstration:
Robotics and Autonomous Systems,
vol. 47, no. 2&3 (2004).
Robotics and Autonomous Systems,
vol. 54, no. 5 (2006).
Neural Networks, vol. 19, no. 3 (2006).
IEEE Transactions on Systems, Man, and
Cybernetics, vol. 37, no. 2 (2007).
Visit the AASS Learning Systems Labs
webpage at www.aass.oru.se/Research
/Learning/. More details on the subject
in this article can be found in the paper:
A. Skoglund, B. Iliev, B. Kadmiry, and R.
Palm. Programming by Demonstration of
Pick & Place Tasks for Industrial
Manipulators using Task Primitives in the
Proceedings of the IEEE International
Symposium on Computational
Intelligence in Robotics and Automation
(CIRA), Jacksonville, FL, 2007.
Further Reading
0
w
(t)
P
place
P
pick
L (t)
w
L
0
P
P
FIGURE 4. The 6D-tracker mounted
on a data glove that was used to
capture the human demonstration.
FIGURE 5. The dotted
line is the demonstrated
path, starting at P
0
going
to P
0w
(t)$, via P
pick
and
P
place
. The solid line is
the robot path with the
different starting location,
L
0
, executing the grasp
and release primitives
just above the Pick-and-
Place points, respectively.
SERVO 12.2007 49
Skoglund.qxd 11/5/2007 4:02 PM Page 49
approach phase of the gripper towards
the object must be performed. The
position and orientation of the table
are known since the manipulator is
mounted on a table, like the robot in
Figure 1. However, the height of the
object to be grasped is unknown due
to the uncertainty of the sensor, thus
the approach primitive has to deal
with uncertainty.
When performing a grasp
operation, the manipulator is given a
goal position to move towards the
object and search for contact with it.
When a certain resistance is detected
(that is, a compliant spring is
compressed to a certain length) the
motion stops. The starting point is
determined by the distance, d, derived
from the inaccuracy of the sensor that
performs the motion capturing. The
retracting motion is the same as the
approach but in reverse.
Since the grasp and release
primitives are actually the same but
with one binary input variable to
decide whether to grasp or release
this pays off in the design process.
Conclusion
Task primitives link high-level
human instructions to particular
robot/gripper functionalities. By using
task primitives, the programming of a
robot becomes faster and simpler,
which is one goal of the PbD concept.
One drawback to PbD is that
motion capture systems with high
accuracy are expensive. Either PbD
needs to become less sensitive to
inaccuracies (for example, by use of
information from additional sensors and
intelligent environments) or the price
for accurate sensors needs to drop.
Another problem is that many
motion trackers use magnetic fields for
positioning and therefore suffer from
degrading accuracy when theyre close
to large metal objects or electric
motors generating magnetic fields.
Alternative trackers are vision based
or use optics instead of magnetic fields.
Intelligent environments containing RFID
tags, passive location sensors, and other
sensory units can be a complement
to motion capturing sensors when
interpreting the environment.
One can also think of solutions
where more than one primitive can be
active at the same time.
For example, a gripper can have
two primitives for approaching an
object from two orthogonal directions.
By blending them, one can achieve
reaching motions that approach the
object from an arbitrary direction.
Some of the current research on
the topic addresses the problem of
action classification where the motions
performed by the demonstrator are
recognized automatically. However, the
design of various task primitives is still
needed. The challenge of designing fully
autonomous robots is finding a way to
enable the robot to generate new task
primitives through learning, development,
and interaction with humans and the
surrounding world on its own. SV
50 SERVO 12.2007
Skoglund.qxd 11/6/2007 1:53 PM Page 50
W
hether they be fact or fiction,
you dont see many things
robotic moving about with
trailing AC line cords. As a matter of
fact, if you classify todays smart
weapons as bots, the only serious
mobile mechatronic devices that I can
think of that may still trail a wire are
the early wire-guided anti-tank missiles.
Will Robinsons buddy didnt drag
a cable around. Come to think of it, old
Robby didnt have a tail, either.
Thats because Will and Robby lived in
a time when battery technology was
very good. You are fortunate as our
battery technology today isnt too
shabby, either. However, even with the
best of batteries, there is a possibility
that you can lose important pieces of
data that your mechatronic creation
has learned or sensed when its lights
go out.
On the other hand, if your roving
pile of mechanical parts and transistors
is not a hunter-gatherer, you will
come to find it a royal pain to
reload those special parameters and
configuration data that are kept in the
robots volatile SRAM every time the
battery goes south.
In many instances, EEPROM is the
answer. However, if you have to
change your precious data too often,
youll eventually wear out the EEPROM
cells. And, even though EEPROM is a
good way to store nonvolatile data,
sometimes there just isnt enough
EEPROM available to do the job.
If EEPROM densities are too small
for your application and you dont
want to design in a hard drive or
battery-backed SRAM, the real (and
simple) answer to reliable nonvolatile
storage is Ferroelectric Nonvolatile RAM.
The RAMTRON FM21L16
We are about to embark upon a
project that will tie a RAMTRON
FM21L16 Ferroelectric Nonvolatile
RAM (FRAM) device to a 16-bit
PIC24FJ128GA010. The FM21L16 is
organized as 128K x 16. This 16-bit
FRAM configuration melds well with
the 16-bit PIC24FJ128GA010. If your
application does not require or cannot
handle a 16-bit data bus, the FM21L16
can be configured to run in eight-bit
mode, which doubles the available
FRAM to 256K x 8.
SERVO 12.2007 51
Put a new memory technology
to work in your robot!
Using FRAM
FRAM
for
Non-Volatile
Storage
Using for
Non-Volatile
Storage
by Fred Eady
Eady.qxd 11/6/2007 9:34 AM Page 51
R
S
-
2
3
2

C
O
N
N
E
C
T
O
R
N
O
T
E
S
:
1
.

1
0
M
H
z

o
s
c
i
l
l
a
t
o
r

=

D
I
G
I

K
E
Y

4
9
0
-
1
1
9
6
-
1
-
N
D
2
.

V
C
A
P

=

D
I
G
I

K
E
Y

5
1
1
-
1
4
4
7
-
1
-
N
D
3
.

Y
1

I
S

O
P
T
I
O
N
A
L

A
N
D

I
S

N
O
T

I
N
S
T
A
L
L
E
D
A
0
A
1
A
2
A
3
A
4
A
5
A
6
A
7
A
8
A
9
A
1
0
A
1
1
A
1
2
A
1
3
A
1
4
A
1
5
A
1
6
D
Q
0
D
Q
1
D
Q
2
D
Q
3
D
Q
4
D
Q
5
D
Q
6
D
Q
7
D
Q
8
D
Q
9
D
Q
1
0
D
Q
1
1
D
Q
1
2
D
Q
1
3
D
Q
1
4
D
Q
1
5
A
0
A
1
A
2
A
3
A
4
A
5
A
6
A
7
A
8
A
9
A
1
0
A
1
1
A
1
2
A
1
3
A
1
4
A
1
5
A
1
6
D
Q
0
D
Q
1
D
Q
2
D
Q
3
D
Q
4
D
Q
5
D
Q
6
D
Q
7
D
Q
8
D
Q
9
D
Q
1
0
D
Q
1
1
D
Q
1
2
D
Q
1
3
D
Q
1
4
D
Q
1
5
W
E
O
E
C
E
U
B
L
B
W
E
O
E
C
E
L
B
U
B
P
G
C
P
G
D
M
C
L
R
R
X
I
N
T
X
T
X
O
U
T
T
X
R
X
T
X
O
U
T
R
X
I
N
R
X
3
.
3
V
D
C
3
.
3
V
D
C
3
.
3
V
D
C
3
.
3
V
D
C
C
1
1
.
1
u
F
+
C
1
0
2
2
0
u
F
C
1
2
.
1
u
F
U
2
F
M
2
1
L
1
6
1
9
2
0
2
1
2
2
2
4
2
5
2
6
2
7
1
7
4
0
4
2
4
3
4
4
1 2 3 4 5
6
4
1
7 2
9
8 3
0
9 3
1
1
0
3
2
1
3
3
5
1
4
3
6
1
5
3
7
1
6
3
8
3
9
1
8
1
1
3
3
1
2
3
4
2
8
2
3
A
1
5
A
1
4
A
1
3
A
1
2
A
1
1
A
1
0
A
9
A
8
W
E
U
B
A
7
A
6
A
5
A
4
A
3
A
2
A
1
A
0
C
E
O
E
D
Q
0
D
Q
8
D
Q
1
D
Q
9
D
Q
2
D
Q
1
0
D
Q
3
D
Q
1
1
D
Q
4
D
Q
1
2
D
Q
5
D
Q
1
3
D
Q
6
D
Q
1
4
D
Q
7
D
Q
1
5
L
B
A
1
6
V
D
D
V
D
D
V
S
S
V
S
S
Z
Z
N
C
C
2
.
1
u
F
C
3
.
1
u
F
C
4
.
1
u
F
C
9
.
1
u
F
C
5
.
1
u
F
C
8
.
1
u
F
C
6
.
1
u
F
C
7
.
1
u
F
U
3
S
P
3
2
3
2
1
3 8
1
0
1
1 1 3
4 5
2
6 1
2
9 1
4
7 1
5
1
6
R
1
I
N
R
2
I
N
T
2
I
N
T
1
I
N
C
1
+
C
1
-
C
2
+
C
2
-
V
+
V
-
R
1
O
U
T
R
2
O
U
T
T
1
O
U
T
T
2
O
U
T
V
S
S
V
D
D
R
1
1
0
K
Y
1
O
P
T
I
O
N
A
L
C
1
7
.
1
u
F
U
1
P
I
C
2
4
F
J
1
2
8
G
A
0
1
0
1
2
3 4 5 6 7 8 9
1
0
1
1
1
2
1
5
1
6
1
7
1
8
3
0
3
1
3
2
3
3
3
4
3
5
3
6
3
7
4
8
4
9
5
0
5
1
5
2
5
3
5
4
5
5
9
1
7
5
9
2
9
7
9
8
9
9
1
0
0
7
1
6
4
5
7
2
7
2
9
2
8
7
0
6
9
8
1
8
0
1
4
6
5
8
2
4
0
4
1
4
2
4
3
4
4
4
5
4
6
4
7
7
9
7
8
7
7
7
6
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
7
2
7
3
7
4
9
5
9
4
6
7
6
6
6
3
6
2
6
1
6
0
5
9
5
8
6
8
9
0
8
9
8
8
8
7
8
6
8
5
8
4
3
8
8
3
3
9
5
6
9
6
9
3
1
3
5
2
5
1
R
G
1
5
V
D
D
R
E
5
R
E
6
R
E
7
R
C
1
R
C
2
R
C
3
R
C
4
R
G
6
R
G
7
R
G
8
V
S
S
V
D
D
R
A
0
R
E
8
A
V
D
D
A
V
S
S
R
B
8
R
B
9
R
B
1
0
R
B
1
1
V
S
S
V
D
D
R
D
1
5
R
F
4
R
F
5
U
1
T
X
U
1
R
X
R
F
8
R
F
7
R
F
6
R
A
6
V
S
S
R
A
7
R
G
1
3
R
E
2
R
E
3
R
E
4
R
D
1
1
O
S
C
2
R
G
2
R
B
7
/
P
G
D
R
A
1
0
R
A
9
R
D
1
0
R
D
9
R
D
4
R
D
1
3
R
G
9
V
S
S
R
D
5
R
F
1
2
R
B
1
2
R
B
1
3
R
B
1
4
R
B
1
5
V
S
S
V
D
D
R
D
1
4
R
D
1
2
R
D
3
R
D
2
R
D
1
R
E
9
R
B
5
R
B
4
R
B
3
R
B
2
R
B
1
R
B
0
R
B
6
/
P
G
C
R
D
0
R
C
1
3
R
C
1
4
R
G
1
4
R
E
1
R
A
1
5
R
A
1
4
O
S
C
1
V
D
D
R
A
5
R
A
4
R
A
3
R
A
2
R
D
8
R
G
0
R
G
1
R
F
1
R
F
0
E
N
V
R
E
G
V
C
A
P
R
D
7
R
A
1
R
D
6
R
F
1
3
R
G
3
R
G
1
2
R
E
0
M
C
L
R
R
F
2
R
F
3
I
C
S
P

C
O
N
N
E
C
T
O
R
1 2 3
4 5 6
1 2 3
4 5 6
R
2
1
0
0
+
C
1
1
0
u
F
C
1
3
.
1
u
F
C
1
6
.
1
u
F
C
1
4
.
1
u
F
R
3
1
K
C
1
5
.
1
u
F
D
B
9

F
E
M
A
L
E
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
52 SERVO 12.2007
SCHEMATIC 1. As you can see,
there are plenty of open pins
just waiting for you to connect
them to something in your
FRAM project.
Eady.qxd 11/6/2007 9:34 AM Page 52
As youve probably already ascer-
tained, the FM21L16 does not require
a battery to retain the data contained
within its memory cells. Otherwise, the
FM21L16 reads and writes just like a
piece of standard volatile SRAM. Once
the power is removed from the
FM21L16, it can hold on to the data in
its possession for a minimum of 10
years. Before you decided to put your
FM21L16 into a deep sleep, you can
issue up to 100,000,000,000,000
read/write cycles to the device with
no concern for loss of data due to
memory cell damage.
I still have fond memories of hang-
ing 2KB chunks of SRAM from the pins
of 8748 and 8751 microcontrollers.
The very first of Microchips PIC17CXX
series of microcontrollers I was
exposed to were supported with
standard UV-erasable EPROM devices,
whose pin layouts resembled their
SRAM counterparts. So, Im glad to see
that the FM21L16 has followed in the
traditional footprint path that was
initiated back in the day by Intels line
of industry standard EPROM devices.
The FM21L16s industry standard pad
layout allows the FM21L16 to be
dropped into the space that a standard
128K x 16 volatile SRAM device would
take up.
In addition to being durable, the
FM21L16 is fast; 60 ns reads can be
initiated using the FM21L16s active-
low CE pin or by simply changing the
address. To prevent accidental data
corruption, the FM21L16 utilizes a low
voltage monitor that blocks access to
the FM21L16s memory array when
the power rail drops below a specified
voltage.
If you dont want your
FRAM-equipped mechanical devices
computing device to overwrite critical
data within the FM21L16, you have the
ability to write protect any of the
FM21L16s eight uniform 16K x 16
memory blocks. The FM21L16 is tough
enough to ride in the electronic
compartment of an automobile. That
means it would prove to be a very
macho part inside of your mechanical
animal, as well.
Designing the FRAM
Controller
I dont know about you, but I love
to put electronic stuff together from
scratch. So, lets design and build a
PIC24FJ128GA010-based controller
that is equipped with a serial port and
a FM21L16 FRAM device. Before we
begin, it might be a good idea to
examine the FM21L16s pinout and
understand what we need to design in
to read and write to the FM21L16s
memory cells. Ive provided a
schematic for you to reference as we
discuss the FM21L16s control pins
and I/O lines.
Naturally, we will have to deal with
assigning the FM21L16s 17 address
lines to PIC24FJ128GA010 microcon-
troller I/O pins. The PIC24FJ128GA010
does not support 17-bit I/O port
configurations. However, there are a
couple of 16-bit ports and a few other
I/O ports with a minimum of 10
available I/O positions. The trick is to
select the port that is easiest to access
in relation to the FM21L16s address
SERVO 12.2007 53
SCREENSHOT 1. Using a four-layer printed
circuit board eliminates the need to
route power and ground connections to
each hardware device. The latest version
of ExpressPCB allows the inner layers to
be cut into areas. Being able to separate
the inner power and ground layers is
great if you have to run multiple
voltages or separate ground planes.
SCREENSHOT 2. Every power and
ground connection has been assigned to
a power or ground plane in this shot.
Eady.qxd 11/6/2007 9:35 AM Page 53
pin layout. Also, well need to get
as many address lines from a
single PIC24FJ128GA010 I/O port as
possible. Following some brain bash-
ing, I selected the PIC24FJ128GA010s
PORTE for the first 10 bits of the
FM21L16s 17-bit address require-
ment. The remaining seven bits
of PORTB will be used to complete
the PIC24FJ128GA010s 17-bit
address bus.
The PIC24FJ128GA010s PORTB is
a 16-bit I/O port. However, Ive used
seven of its bits as address lines.
Fortunately, I still have a complete
16-bit I/O port that I can apply to the
FM21L16s 16-bit data bus. As you can
see in the schematic, Ive assigned the
PIC24FJ128GA010s 16-bit PORTD I/O
port to handle the FM21L16 data
bus duties.
The FM21L16s CE (Chip Enable)
pin is used to select the device and
begin a new memory access. Taking
the FM21L16s CE pin low while
holding the FM21L16s ZZ input high
will kick off a memory access event.
The ZZ (Sleep) pin is an important one
if your project needs to conserve
power. I decided not to dedicate a
PIC24FJ128GA010 I/O pin to the ZZ
input, which also eliminates us from
having to write some ZZ code to
support it. If you decide to use the ZZ
pin, be sure you understand how it
relates to the FM21L16s CE pin.
The FM21L16 datasheet recom-
mends that the ZZ input be tied to Vdd
when it is not utilized. As you can see
in the schematic, I follow directions
very well. The address data on the
FM21L16s address bus is latched
internally on the falling edge of the
FM21L16s CE. The FM21L16 has a
special feature that allows page mode
reads while the CE pin is low by
manipulating the two least significant
bits of the address bus. I simply
chose the most convenient
PIC24FJ128GA010 I/O pin for the
FM21L16s CE line. Since we can
choose to manipulate the CE pin or tie
it to a logic low level, I designed in a
jumper that connects the FM21L16s
CE pin to the PIC24FJ128GA010 or
directly to ground.
As with the CE pin selection, there
is absolutely no science behind my
selection of the FM21L16s WE (Write
Enable) line connection. A FM21L16
write cycle is initiated when the active-
low WE pin is driven to a low logic
level. Data on the FM21L16s data bus
is written into the FM21L16s memory
cells on the rising edge of the WE
pulse. The initial high-to-low logic level
transition of the WE pin is used to latch
in the new column address for page
mode write cycles.
I decided to control the FM21L16s
OE (Output Enable) line simply because
I can. The FM21L16s active-low OE line
allows the contents of the FM21L16s
data bus to be exposed to the
PIC24FJ128GA010s PORTD I/O pins
during read operations. Driving the
FM21L16s OE line to a high logic level
will tri-state the FM21L16s data bus.
In this project, I could have simply
tied the OE line low. I figure well write
that one instruction to drive RG3 low
and never touch the I/O pin again. If
you have other things competing for
the PIC24FJ128GA010s data bus,
you must utilize the FM21L16s OE
control pin.
The UB (Upper Byte) and LB
SCREENSHOT 3. The FRAM is located
on the far right of this shot. Note that I
attempted to route all of the top traces
(red) horizontally and all of the bottom
layer traces (green) vertically.
SCREENSHOT 4. The hard work is done.
All of the 17 address lines and 16 data
lines are in place in this shot.
54 SERVO 12.2007
Eady.qxd 11/6/2007 9:35 AM Page 54
(Lower Byte) FM21L16 control pins are
very interesting. Depending on how
you drive UB and LB, you can read and
write the most significant byte only or
read and write the least significant byte
only or read and write all 16 bits of the
FM21L16s data bus. Taking the
FM21L16s UB pin high will tri-state the
most significant byte (DQ15:8) of the
FM21L16s 16-bit data bus. Conversely,
a high logic level applied to the LB
control pin will tri-state the least
significant byte (DQ7:0) of the
FM21L16s 16-bit data bus. There was
no way I was not going to put some
PIC24FJ128GA010 control behind
these two FM21L16 control bits.
The FM21L16 wants to see a volt-
age rail that resides between 2.7V and
3.6V. The absence of a voltage regula-
tor circuit in the schematic leads one
to the conclusion that Im supplying
the FRAMs and PIC24FJ128GA010s
power via a 3.3V wall wart.
Well have no way of knowing
whats inside the FRAM without having
some way of communicating the state
of the data at a certain address to a
human. Im still on the fence about
throwing away my RS-232 interface for
a USB interface. So, what you see in
this design is a standard 3.3V RS-232
interface driven by a tried and true
SP3232 circuit.
All thats left to do is assign a 0.1
F power supply bypass capacitor to
each Vdd pin in the design and con-
nect the PIC24FJ128GA010s internal
voltage regulator capacitor between
Vcap and ground. Note that the
PIC24FJ128GA010s ENVREG (Enable
Voltage Regulator) pin is tied logically
high to enable the PIC24FJ128GA010s
internal voltage regulator circuitry.
It all looks good on paper. So, lets
translate the schematics contents to a
physical device.
Building up the
Controller
I used the services of ExpressPCB
to design and fabricate our FRAM
controller printed circuit board (PCB).
To make things easy, I opted to put
the FRAM hardware down on a four-
layer PCB.
The very first thing I do after
determining a preliminary layout
is assign and make the power connec-
tions to the PCBs inner planes.
Connecting pins to the power and
ground planes of a four-layer PCB is a
simple ExpressPCB procedure. Take a
look at Screenshot 1. Ive laid in a
0.026 via, connected it to the
appropriate PIC24FJ128GA010 power
pin, selected the via, right-clicked on
the via, and assigned the via connec-
tion to the power plane of the PCB. I
performed the power and ground
assignment task against all of the
PIC24FJ128GA010, FRAM, SP3232,
and ICSP power pins. The entire set of
FRAM controller power plane connec-
tions can be seen in Screenshot 2.
The schematic really organizes
things nicely. However, youre reading
a technical magazine and I know you
want the skinny on the actual PCB
design. So, Ive chronicled the FRAM
PCB layout process in a series of screen
captures for your enjoyment.
After I laid in the power and
ground connections, I took on the task
of routing the 17-bit address bus. Note
SERVO 12.2007 55
SCREENSHOT 6. This is a shot of the MPLAB
Watch window following a run of the
MAIN ROUTINE. If you take a pencil to
the PORTB and PORTE bits, youll see that
together they form an address of 0x1FFFF.
SCREENSHOT 5. Sometimes even a blind
hog finds an acorn. Everything fits and
everything is connected. The next step
involves getting the board manufactured
and getting it populated.
Eady.qxd 11/6/2007 9:36 AM Page 55
that in Screenshot 3 I attempted wherever possible to route
the top layer traces horizontally in relation to the bottom
layer traces, which are routed vertically. You can see that
attempting to route in power and ground traces would have
made this PCB design task take on a certain odor of
ugly. Another advantage to using a four-layer PCB is that the
internal ground plane reduces electronic noise in the FRAM
controllers circuitry.
Screenshot 4 folds in the 16-bit data bus connections
between the PIC24FJ128GA010 on the left and the
FM21L16 on the right of the shot. You never know until you
get deep into it if your preliminary device layout will actually
work out. From the looks of Screenshot 4, we may have
lucked out.
The rest of the connections to the FRAM control pins,
the RS-232 port, and the ICSP programming/debugging port
can be seen in the full-board capture represented in
Screenshot 5. Four days later, everything that you now see as
paper and electronic images becomes reality in Photo 1.
I check my PCB designs over at least 10 times before
submitting them for manufacture. As it turned out, I found
three minor mistakes that I corrected after photographing
the FRAM controller board. The ExpressPCB PCB layout file
I have provided for you via the SERVO website (www.servo
magazine.com) incorporates all of the corrections. Be
aware that the FRAM controller PCB you see in Photo 1 is a
prototype version. If you want the pretty silkscreen and
solder mask, order a production version of the FRAM
PCB. Also, before submitting your FRAM controller PCB for
manufacture, remove or move the silkscreen legends I placed
on the pads of the resistors and capacitors to allow for
reliable soldering.
Now that weve taken our FRAM controller from paper
to printed circuit board, lets give it some smarts.
FRAM Cram
Although you see a ceramic oscillator module in Photo 1,
we wont be using it. Instead, we will use the
PIC24FJ128GA010s internal Fast RC Oscillator (FRC).
Well boost the PIC24FJ128GA010s native FRC from its
default 4 MHz to 16 MHz using the PIC24FJ128GA010s
internal 4X PLL.
The Microchip C30 C compiler will be our firmware
vehicle and well use the Microchip REAL ICE as our
programming/debugging platform. Both the C30 C compiler
and the REAL ICE will fall under the command of Microchips
MPLAB IDE. Lets begin the firmware creation process
by assigning firmware variables to the actual hardware
connections. Heres the code:
//******************************************************
//* FRAM CONTROL PINS
//******************************************************#
define WE LATGbits.LATG2
#define OE LATGbits.LATG3
#define CE LATCbits.LATC14
#define LB LATFbits.LATF4
#define UB LATFbits.LATF5
//******************************************************
//* DATA BUS DEFINITIONS
//******************************************************
#define data_in PORTD
#define data_out LATD
#define data_lo 0
#define data_hi 1
#define rd_data TRISD = 0xFFFF
#define wr_data TRISD = 0x0000
//******************************************************
//* ADDRESS BUS DEFINITIONS
//******************************************************
#define addrlo LATE
#define addrhi LATB
This is pretty simple stuff that will save you lots of time
when you start coding. Rather than trying to remember what
pin does what, I have given each pin a logical name
that relates to its function. Well use the data_lo and data_hi
definitions when we write the code to read the FRAM in
eight-bit mode. The rd_data and wr_data definitions will
allow us to easily put the PIC24FJ128GA010s data bus port
into input or output mode.
We already know that well have to test this puppy. So,
why not go ahead and put aside some variables that will
store what we read from the FM21L16. Here they are:
unsigned int framdata16;
char framdatalo, framdatahi;
Well use framdata16 to read the 16-bit data value and
framdatalo/framdatahi to store the results of eight-bit reads.
We now have enough stuff tied down to begin seriously
56 SERVO 12.2007
PHOTO 1. If you look closely, you can see my boo-boos. I missed
placing a via to the CE jumpers and I rotated a trace all the way
through the ICSP resistors and capacitors. What you cant see
is a switched address line on the bottom layer of the board. I
fixed all of these errors after I took this shot. Note the 0603 0.1 F
capacitors surrounding the PIC24FJ128GA010 and the FM21L16.
The rest of the passive components are 0805 SMT devices.
Eady.qxd 11/6/2007 9:37 AM Page 56
writing our FRAM I/O routines. Since the very first thing one
would do to access the FM21L16 is write the desired address
to the FRAM address pins, lets put together a routine to
write the memory cell address to the FRAMs address bus.
Recall that we split the PIC24FJ128GA010s address bus
between the E and B I/O ports. Therefore, we must do some
minor bit manipulation to get the correct address out onto
the PIC24FJ128GA010s address bus. No problem:
//******************************************************
//* WRITE FRAM ADDRESS
//******************************************************
void wr_fram_addr(unsigned long addr)
{
addrlo = addr & 0x000003FF;
addrhi = (addr & 0x0001FC00) >> 1;
}
The addrlo alias is actually PORTE of the
PIC24FJ128GA010. Since PORTE only consists of 10 bits, we
provide a mask value of 0x3FF to capture all of the PORTE
address information. If you count the 1 bits in the addrhi
mask, youll come up with seven. Thats how many more bits
we need to assemble to complete the 17-bit FRAM address.
The most significant seven bits of PORTB are represented by
the alias addrhi and we need to put the most significant bit
of the FRAM address into the most significant bit of addrhi.
That explains the one-bit shift to the right.
We have the option of performing three types of read
operations. Heres the code for a 16-bit FRAM read:
//******************************************************
//* 16-BIT FRAM READ
//******************************************************
unsigned int rd_fram16(void)
{
unsigned int data;
rd_data; //PIC24FJ128GA010 data bus = input mode
UB = 0; //enable upper byte of FRAM data bus
LB = 0; //enable lower byte of FRAM data bus
WE = 1; //make sure write is disabled
CE = 0; //begin the read access
Nop(); //access time wait
data = data_in; //read the data into the PIC
CE = 1; //terminate the read cycle
return data;
}
Before we do anything else, we must put the
PIC24FJ128GA010s data bus (PORTD) into input mode.
Thats what the rd_data macro does for us. Putting both the
UB and LB FRAM control lines at a logic low level enables
the full 16-bit FM21L16 to the PIC24FJ128GA010s PORTD.
We are clocking the PIC24FJ128GA010 at 16 MHz, which
means we have a 125 nS cycle time. Thus, one NOP (No
Operation) instruction is plenty of time for the FM21L16
to respond to a read operation. We also have enough time
for a full FRAM write cycle, which has a maximum duration
of 110 nS.
Performing eight-bit FRAM reads is just as easy as pulling
off a 16-bit read operation. Using the UB and LB FRAM
control pins allows us to read either the high byte or low byte
of the FRAM data bus. I wrapped both read types into a
single function:
//******************************************************
//* 8-BIT FRAM READ
//******************************************************
unsigned int rd_fram8(char mode)
{
unsigned int data;
rd_data;
switch(mode)
{
case data_lo: //read the low data byte only
UB = 1; //kill the FRAM upper byte
LB = 0; //enable the FRAM lower byte
WE = 1; //make sure write is disabled
CE = 0; //begin read process
Nop(); //read access time
data = data_in & 0x00FF; //get data
CE = 1; //terminate read operation
break;
case data_hi: //read the high data byte only
UB = 0; //enable the FRAM upper byte
LB = 1; //kill the FRAM lower byte
WE = 1; //make sure write is disabled
CE = 0; //begin read process
Nop(); //read access time
//read and adjust FRAM data
data = (data_in & 0xFF00) >> 8;
CE = 1; //terminate read operation
break;
}
return data;
}
To use the eight-bit read, you must enter the mode
(data_lo or data_hi) as an argument to the rd_fram8
function. Nothing to it, right? Thats it for the FM21L16
read functions. Lets move on and do the FRAM write
function coding.
Im sure you have a good grasp of what to do here. See
how close you came in your mind to writing the same 16-bit
FRAM write code Ive presented here:
//******************************************************
//* 16-BIT FRAM WRITE
//*******************************************************
void wr_fram16(unsigned int data)
{
wr_data; //PORTD = output mode
UB = 0; //enable upper FRAM byte
LB = 0; //enable lower FRAM byte
data_out = data; //put the data on PORTD
CE = 0; //access the FRAM
WE = 0; //begin the write cycle
Nop(); //write cycle wait
WE = 1; //terminate write cycle
CE = 1; //terminate FRAM access
rd_data; //return PORTD to input mode
}
Again, the eight-bit writes are no more difficult than the
16-bit write. And, again, Ive combined the upper and lower
eight-bit write functions into a single routine:
SERVO 12.2007 57
Eady.qxd 11/6/2007 9:37 AM Page 57
//******************************************************
//* 8-BIT FRAM WRITE
//******************************************************
void wr_fram8(char data, char mode)
{
wr_data;
switch(mode)
{
case data_lo:
UB = 1; //kill the FRAM upper byte
LB = 0; //enable the FRAM lower byte
data_out = data & 0x00FF; //data on PORTD
CE = 0; //access the FRAM
WE = 0; //begin the write operation
Nop(); //write cycle time
WE = 1; //terminate the write cycle
CE = 1; //terminate FRAM access
break;
case data_hi:
UB = o; //enable the FRAM upper byte
LB = 1; //kill the FRAM lower byte
//put data out onto PORTD
data_out = (data & 0xFF00) >> 8;
CE = 0; //access the FRAM
WE = 0; //begin the write operation
Nop(); //write cycle time
WE = 1; //terminate the write cycle
CE = 1; //terminate FRAM access
break;
}
rd_data;
}
Note that the FRAMs OE pin is never accessed in the
read routines. Thats because I set OE to a logical low at the
beginning of the FRAM read/write program:
int main(void)
{
CLKDIV = 0; //no clock division
OE = 0; //set OE active
Since were already there, lets continue with the FRAM
read/write main program flow:
//******************************************************
//* INITIALIZE I/O PORTS
//******************************************************
//make PORTB data bus pins digital
AD1PCFG = 0xFE00;
LATB = 0x01FF;
TRISB = 0x01FF;
LATC = 0xFFFF;
TRISC = 0x4FFF;
LATE = 0x0000;
TRISE = 0x0000;
LATF = 0xFFFF;
TRISF = 0xFFCF;
LATG = 0xFFFF;
TRISG = 0xFFF3;
This is standard PIC stuff. All you really need to pay
attention to here is the disabling of the PORTB analog
functionality on the PORTB pins we are using to support the
address bus.
Its always a good idea to control your own destiny
when it comes to initial logic levels. In the code snippet that
follows, I made sure that all of the FRAM control pins
were in a state that disabled any read or write access to
the FRAM:
//******************************************************
//* INITIALIZE FRAM
//******************************************************
CE = 1;
WE = 1;
OE = 1;
If were going to use the FRAM controllers RS-232 port,
well need to support it with some code. I used the C30 C
compilers mathematician to compute the RS-232 port baud
rate divisor:
#define YFREQ 4000000 //internal FRC frequency
#define PLLMULT 4 // PLL multiplier
#define FCY YFREQ*PLLMULT //PLL clock frequency
#define BAUDRATE 57600 //desired baud rate
//compute the baud rate divisor value
#define BRGVAL ((FCY/BAUDRATE)/16)-1
Recall that the PIC24FJ128GA010s internal FRC defaults
to 4 MHz at reset. I simply used the PIC24FJ128GA010s
configuration bits to set up the FRC and turn on the PLL:
_CONFIG1(JTAGEN_OFF & GCP_OFF & BKBUG_ON &
COE_OFF & ICS_PGx2 & FWDTEN_OFF)
_CONFIG2(IESO_OFF & FNOSC_FRCPLL & FCKSM_CSD-
CMD & OSCIOFNC_OFF & POSCMOD_NONE)
If youre not familiar with the _CONFIGx language, just
view the PIC24FJ128GA010.h include file, which is part of
the Microchip C30 C compiler package. Once the compiler
has ciphered BRGVAL, all I have to do is plug it in. The rest
of the UART registers default to the standard RS-232
parameters and only require bits to be set to enable the
UART circuitry:
//******************************************************
//* INITIALIZE UART1
//******************************************************
U1BRG = BRGVAL;
U1MODE = 0x8000; // Reset UART to 8N1 and enable
U1STA = 0x0400; // Rst status reg, enable TX,RX
_U1RXIF=0; // Clear UART RX Interrupt Flag
I decided to show you the UART interrupt flag even
though were not going to use UART interrupts in this
project. If you decide to expand upon the FRAM controller
project, youll most likely need to use the UART in interrupt
mode.
Were at the top of the hill now. All of the FRAM
read/write functions are in place and the UART is ready for
action. Lets run a 16-bit FRAM write cycle and utilize all of
the read modes as a test case:
58 SERVO 12.2007
Eady.qxd 11/6/2007 9:37 AM Page 58
//******************************************************
//* MAIN ROUTINE
//******************************************************
framdata16 = 0; //clear the variable
//put 0x1FFFF on the FRAM address bus
wr_fram_addr(0x001FFFF);
//write 0x1234 to address 0x1FFFF
wr_fram16(0x1234);
//read the address we just wrote to
framdata16 = rd_fram16();
//read the lower byte of address 0x1FFFF
framdatalo = rd_fram8(data_lo);
//read the upper byte of address 0x1FFFF
framdatahi = rd_fram8(data_hi);
// Print values to terminal emulator
printf(\r\n0x%04X,framdata16);
printf(\r\n0x%02X,framdatahi);
printf(\r\n0x%02X,framdatalo);
while(1); //loop here
forever
The terminal emulator I refer to in the MAIN ROUTINE
code snippet is called Tera Term Pro. Tera Term Pro is a free
download from the web.
The results of running the MAIN ROUTINE code are
shown in the MPLAB Watch window capture you see in
Screenshot 6. The printf statements also wrote the contents
of the Watch window variables out to the Tera Term Pro
terminal emulator window.
Its Your Data
So, put a RAMTRON FM21L16 to work for you. To make
implementing a RAMTRON FM21L16 a bit easier for all of you,
I have provided a copy of the code and the ExpressPCB layout
files for you on the SERVO website. The PIC24FJ128GA010 has
plenty of analog-to-digital converters, PWM, and digital I/O
that I didnt touch. Use my ExpressPCB layout to expand upon
the design to meet your robotic needs. See you next time. SV
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
STEER WINNING ROBOTS
WITHOUT SERVOS!
Order at
(888) 929-5055
SERVO 12.2007 59
Microchip (www.microchip.com)
PIC24FJ128GA010; MPLAB; C30 C Compiler; REAL ICE
RAMTRON (www.ramtron.com) FM21L16
ST Micro (www.stmicro.com) SP3232
Sources
Fred Eady can be reached via email at fred@edtp.com.
Contact the Author
Eady.qxd 11/6/2007 9:38 AM Page 59
60 SERVO 12.2007
// castling bonuses
B8 castleRates[]={-40,-35,-30,0,5};
//center weighting array to make pieces prefer
//the center of the board during the rating routine
B8 center[]={0,0,1,2,3,3,2,1,0,0};
//directions: orthogonal, diagonal, and left/right
from orthogonal for knight moves
B8 directions[]={-1,1,-10,10,-11,-9,11,9,10,-10,1,-
1};
//direction pointers for each piece (only really for
bishop rook and queen
B8 dirFrom[]={0,0,0,4,0,0};
B8 dirTo[]={0,0,0,8,4,8};
//Good moves from the current search are stored in
this array
//so we can recognize them while searching and make
sure they are tested first
by James Isom
A
bi-m
onthly
colum
n for
kids!
LESSONS
FROM THE
LABORATORY
LESSONS
FROM THE
LABORATORY
NXT Packbot:
Part 2
STEP 1:
STEP 4:
STEP 7:
Parts:
Parts:
Parts:
Parts:
STEP 2:
Parts:
STEP 5:
Parts:
Parts:
STEP 3:
STEP 6:
L
ets pick up where we left
off in October and add the
shoulders and a few other
pieces to the NXT Packbot.
Left Shoulder:
The shoulders are mirror images
of one another. I included both
sets of steps just in case you
don't like puzzles.
LessonsFromTheLab.qxd 11/5/2007 4:19 PM Page 60
SERVO 12.2007 61
STEP 8:
STEP 10:
Parts:
STEP 11:
Parts:
STEP 9:
Parts:
Parts:
STEP 13:
STEP 16:
Parts: Parts:
STEP 12:
STEP 15:
STEP 14:
Parts: Right Shoulder: Parts: Parts:
LessonsFromTheLab.qxd 11/5/2007 4:19 PM Page 61
62 SERVO 12.2007
STEP 17:
STEP 20:
STEP 23:
STEP 26:
Parts:
Parts:
Parts:
Parts:
STEP 18:
Parts:
Parts:
Parts:
STEP 19:
Parts:
STEP 22:
STEP 25:
Parts:
Parts:
STEP 21:
STEP 24:
LessonsFromTheLab.qxd 11/5/2007 4:20 PM Page 62
STEP 29:
STEP 32:
STEP 35:
Parts: Parts:
Parts:
STEP 28:
STEP 31:
STEP 34:
STEP 27:
STEP 30:
STEP 33:
SERVO 12.2007 63
Add Treads:
Place two treads around the front wheels. The back
portion of the treads will eventually be attached to a
rear assembly that will be covered in a future article.
Attach the Shoulders:
The shoulder placement is
a bit tricky, so have a look
at the following images
to make sure you get the
placement right.
Building and
Connecting the
Front Strut:
LessonsFromTheLab.qxd 11/5/2007 4:21 PM Page 63
64 SERVO 12.2007
STEP 36:
STEP 39:
Adding the Arm Brackets:
Build an arm bracket using the following steps
for each shoulder. I have colored the model white
for these steps so the new parts are easier to see.
Parts:
STEP 37:
Parts:
STEP 38:
Parts:
Thats it for this installment. Theres
more to come in February. Your NXT
Packbot should now look like this. SV
LessonsFromTheLab.qxd 11/5/2007 4:22 PM Page 64
SERVO 12.2007 65
Page65.qxd 11/5/2007 2:44 PM Page 65
66 SERVO 12.2007
Electronic Parts & Supplies
Since 1967
C Stamp Controller
LOW COST - High Pin Count
48-Pin Module with Analog
High Speed, Large Memory
Professional SW Dev. Tools
Easy to Connect Accessories
Free Expert Technical Support
www.c-stamp.com
Toll-Free: 1 (800) 985-AWIT
HobbyEngineering
www.HobbyEngineering.com
Robot Kits, Parts, Tools and Books
IMService
P. O. Box 1 42, New Hudson, MI 481 65
Phone: 888-451-1670
or: 248-486-3600
imsrv. com
Desktop CNC
Solutions
For the finest in robots,
parts, and services, go to
www.servo
magazine.com
and click on
Robo-Links.
Robolinks.qxd 11/5/2007 4:29 PM Page 66
Subscribe online at: www.servomagazine.com
or call: 877-525-2539 (toll free) / 818-487-4545 (outside US)
Go to
www.servomagazine.com
to enter your gift order!
Be sure to use promotion code Y7WXMS when ordering.
U.S. Prices
1 Yr $24.95
2 Yr $45.95
3 Yr $65.95
Give the
gift that
lasts all
year!
Give the
gift that
lasts all
year!
SV-GiftSubAd2007.qxd 11/1/2007 3:38 PM Page 67
68 SERVO 12.2007
W
hen I was growing up, two tech-
nologies captivated both science
and science fiction: robots and lasers.
Both started out expensive and compli-
cated, but today, these technologies
are within reach on any budget. This is
especially true of lasers, which just a
generation ago were laboratory
curiosities and the stuff of adventure
novels. Now they are such an integral
part of our lives we have all but
forgotten about them. Weve lost the
appreciation of how useful they can be.
Thanks to advances in semiconduc-
tor technologies, you can purchase a
fully functioning laser for just a few
dollars. Given their low cost, and the
unique properties and capabilities of
laser light, you may want to consider
combining these two stalwarts of
sci-fidom into your next project. What
follows are some ideas to pique your
interest and, of course, a listing of
online sources you can check out to
further your education and experimen-
tation into the world of lasers.
Lasers 101
Though there are many types of
lasers, they all do pretty much the same
thing: Lasers amplify a source of photons
into an intense beam of light. The
wavelength of the light varies across
the visible, infrared, and ultraviolet
spectrum. Most people are familiar with
the ruby-red light of the common laser
pointer. These operate at about 650-670
nanometers (nm), depending on their
design. A newer class of laser pointers
put out a green beam (about 530 nm),
which is useful because the human eye
is most sensitive to light of this wave-
length. The green lasers are more expen-
sive to manufacture, so they cost more.
Many devices such as CD and DVD
players use infrared lasers that put out an
invisible beam in the 750-780 nm range.
While you cant see the beam, an
infrared laser is nevertheless quite useful,
especially when combined with sensors
that are most receptive to light in the
infrared region. These include most types
of phototransistors and photodiodes, and
both CMOS and CCD image arrays.
And, of course, there are lasers
that emit light in the deep blue and
even ultraviolet region. These are fairly
expensive, finding typical uses in
such things as high definition DVD
players, and validating the authenticity
of paper currency.
The vast majority of lasers today
are the semiconductor variety. They are
typically constructed of a sandwich of
semiconducting material that has been
cleaved at exactly the right angle to
allow a pinpoint of amplified laser light
to be emitted. At low currents, the
laser operates like a light emitting
diode (LED); with the proper operating
current, the device emits true laser
light, described below.
Semiconductor lasers can be further
classified by their operating mode. Most
of the devices we are most familiar with
are designed for continuous light
output. These are operated within a con-
trolled region of current; if the current is
too low, the light that is emitted lacks
the laser characteristics. If the current is
too high, the device will overheat and
burn up. To maintain the proper operat-
ing output, a sensor inside the laser
collects a portion of the emitted light
and a control circuit varies the current to
keep it within the prescribed range.
Other semiconductor lasers
capable of much higher light outputs
operate in a pulsed mode. They are
operated by applying a series of pulses,
each one of a short enough duration
that the device will not overheat. The
intensity of the laser is controlled by
varying the duty cycle the ratio of on
time versus off time of the pulses.
Diode lasers may be self con-
tained, or they may require separate
driver electronics. Self-contained diode
lasers include the laser itself, as well as
its control circuitry. You need only
apply power. This is the case with laser
pointers. Diode lasers without circuitry
require a separate driver board. The
board provides the correct voltage and
current to the laser diode at all times.
One advantage to getting a laser
diode and separate driver board is the
extra flexibility in operating the laser.
With a separate driver board, you often
have more control over the intensity of
the laser output. The better driver
boards have a separate modulation
input that allows you to use an external
signal to turn the laser on and off very
quickly. Modulation speeds of 5-10 kHz
are common.
The older style of laser (still found
on the surplus market) uses a tube
filled with various gasses. A familiar
version is the helium-neon laser, which
emits a red beam of 632 nm. The laser
itself is constructed of a glass tube
Using Lasers With
Your Robots
Tune in each month for a heads-up on
where to get all of your robotics
resources for the best prices!
RoboResources.qxd 11/4/2007 6:36 PM Page 68
filled with a mixture of helium and
neon gasses. A high voltage is applied
to terminals on either end of the tube.
Carefully positioned mirrors on either
end serve to amplify the light that
bounces back and forth. One of the
mirrors is fully reflective; the other is
partially reflective. Once suitably ampli-
fied, the light escapes the partially
reflective mirror and exits the tube.
There are yet more methods of
producing lasers, including various crys-
tals such as ruby and YAG, plasma, and
even Jello. Ill leave it to you to research
these if the subject is of interest to you.
The Properties of
Laser Light
Laser light is special for a number
of reasons. First is that unlike most light
sources, the beam from a typical laser is
composed of a single wavelength, or
color. The single wavelength makes it
possible to isolate the color, and ignore
all others. For example, if youre
designing a sensor that is only sensitive
to the light of your laser source, you can
filter out all but that light. You know
whatever remaining light your sensor is
picking up is probably from your laser.
(In actuality, many lasers emit sev-
eral specific wavelengths, called main-
lines. These may be selectively filtered
or split to obtain the desired color. For
example, an argon gas laser emits both
a green and a weaker blue light. A
simple prism may be used to separate
the mainlines of a laser, while not
reducing the light output of the beam.)
Recall from high school physics
that while light is made up of photons,
the photons travel as a wave. Because
a laser beam is made up of the same
wavelength of light, the photons exit
the laser and travel in synchronism.
This is called coherence. One striking
benefit of coherence is the effect of
reflections of the laser light. These
reflections cause the waves of light to
interfere with one another. What was
once practically a solid beam of
light is now a mish-mash of light rays
that commingle in measurable ways.
Such so-called local interference
forms the basis for a number of sens-
ing techniques. Ill cover a few in a bit.
Another useful property of laser
light is the limited degree to which it
spreads as it travels through space. This
is due to the nature of coherence,
described above. All light eventually
spreads out, but with the right laser and
the right optics, its possible to focus
laser light into an extremely thin beam
that stays thin for a longer distance
than regular light. Without this proper-
ty, we would not have CDs or DVDs.
For robots, we can use this property
to ensure a small pinpoint of light
regardless of the distance between the
light source and its target. The spot
caused by the laser beam will remain
relatively small and compact whether the
laser is a foot away from the target or 20
feet away. Simple collimating optics can
further control the spread of the beam.
Last, and certainly not least, is the
sheer intensity of a laser beam. A small
pocket laser, operating on a couple of
watch batteries, can emit a light as
brilliant as noon day sun. Of course,
the area of the light is limited to a small
spot, but that works to our advantage.
Even in average lighting conditions, its
relatively easy for people and sensors
to spot the light of a laser beam.
Uses for Lasers in
Robotics
Some applications for lasers in
robotics are obvious, and some are not.
First to mind are decorative uses dress-
ing up the bot with colored lasers that
flash on and off as the machine drives
down a darkened hallway. Combine a
laser beam with a reflective diffraction
grating, and the beam is split into
multiple sub-beams that dance around
the room as the robot travels. You
can get metalized diffraction grating
material at any party store. Just look for
the stuff that makes a rainbow when
you look at it under ordinary light.
More practical applications for using
lasers with robots involve some type of
sensor. Light-based sensors are already
popular solutions in all types of robots,
but the majority of these use standard
non-laser (i.e., non-coherent) infrared or
visible light. Such sensors work by
detecting the amount or direction of
light. The coherent nature of laser light
permits additional sensory techniques.
One notable approach is to rely on
the local interference of a laser beam
reflected off a surface. To the naked
eye, the local interference appears as
speckle, a grain-like pattern that
moves as the light or the surface
moves. You could use this idea as a
way to measure movement and even
distance. Point a laser toward the
ground, and pick up the reflections
using a suitable sensor. As the robot
moves, the pattern of the speckle also
moves in direct proportion to the direc-
tion and distance of that movement.
Systems of these types that rely on
local interference typically warrant a
multi-cell sensor array. A single light
sensor is insufficient to detect the
motion of the speckle pattern.
However, sensor arrays, such as linear
CCDs or even low-resolution CMOS
camera chips, can be used to measure
finite differences in the speckle pattern.
Lasers also find use in various
beacon and landmark systems used for
robotics. One or more lasers pointed
upward from a stationary lighthouse
are used to project a pattern of beams
or lines onto a white ceiling. A tradi-
tional CMOS or CCD camera is pointed
toward the ceiling, and with the right
filtering, sees only the dots/lines of the
laser. The unique orientation of the
dots or lines reveals the location of the
robot within the room. This is basically
the same concept as the celestial
navigation techniques used for
centuries by mariners. Its already used
in some commercial and experimental
robotic navigation systems.
Recall above that because of the
property of coherence, a laser beam
will keep its pencil-thin shape for a
longer distance than ordinary light.
With appropriate optics, a single sensor
can focus onto the same area that the
laser beam is being projected onto.
Using a variety of timing techniques, its
possible to construct a laser-based
distance measurement device that can
scan a room and build a 3D map of
objects in front of the sensor. This is the
basic idea behind the expensive laser-
based rangefinder systems build by
German electronics manufacturer SICK.
Determining the distance between
SERVO 12.2007 69
RoboResources.qxd 11/4/2007 6:36 PM Page 69
70 SERVO 12.2007
laser sensor and target can be accom-
plished in a variety of ways. With fast
enough electronics, its possible to
measure distances using time of flight
of the light itself, which travels about
186,000 miles per hour. Perhaps a
more common method that does not
require fast switching electronics is
to modulate the laser beam with a
fairly low frequency sine wave. The
difference between the phase of the
source laser beam modulation and its
returned reflection indicates distance.
Laser Safety
The light from a laser is highly
intense, and when aimed directly into
someones eyes can cause severe pain
and optic damage. In the United
States, lasers are regulated by the Food
and Drug Administration, or more
specifically, an FDA unit known as the
Center for Devices and Radiological
Health, or CDRH.
Lasers are roughly classified by the
potential damage they can cause; this
damage is defined by relying on simple
metrics, such as whether the beam is
visible or invisible to the human eye, if
the light of the laser is ever exposed
outside of the device its used in, the
power output of the beam (usually
expressed in milliwatts or watts), and
whether the beam is stationary or
constantly in motion.
As noted on the FDA website, laser
devices are separated by class. The
lower class numbers are the least dan-
gerous. Each of these classes has its
own warnings and restrictions for use.
Class I products include laser printers
and CD players where the laser radiation
is usually contained within the product.
Class II and IIa products include bar
code scanners.
Class IIIa products include laser pointers.
Class IIIb and IV products include
laser light shows, industrial lasers, and
research lasers.
The vast bulk of lasers available to
consumers is Class IIIa. Note that the
laser in a CD player is ordinarily a Class
I device (but thats when its used inside
the player where its light is never
exposed). Used outside youve
hacked a CD player and raided its optics
the laser is most likely a Class IIIa.
Also note that the FDA limits Class
IIIa devices to five milliwatts, as indicat-
ed by a light meter specifically designed
to measure laser output levels. Its tech-
nically possible to operate some laser
pointers with a higher-than-normal
voltage, or even to pulse them with
significantly higher voltages. The result
is an increase in power output that
makes these devices non-compliant.
Class IIIa and lower lasers are gen-
erally considered safe, but only in their
intended application. Whether or not
the laser light may be harmful to people
or animals depends on the output
power of the laser, whether the laser is
visible, and if the beam is held station-
ary for a long enough period of time. Id
recommend never using anything above
a Class IIIa laser in a robotics project,
and then only use a visible light laser.
The beam of an infrared laser can
be damaging to the eyes, and when
strapped to a robot, an unsuspecting
person or animal may be inadvertently
exposed to the effects of the beam.
When an infrared laser must be used,
consider only employing it in a fashion
where its beam is pointed down to the
ground, and not out or up.
If you must use a higher power
laser, do so only with appropriate
research and safety training, and be
sure to follow all laws and regulations.
If your goal is to design a mobile light
show robot, employing high power 10
watt diode lasers, do so only after you
have fully immersed yourself into the
study of laser safety.
Be aware that operating certain
Class IIIb and above lasers in
public without the appropriate safety
measures may be against the law, and
could expose you to severe fines.
Finally, should you opt for older
fashioned tube lasers on your robot,
know that these require high voltages
to operate. These voltages typically
in the 1-2 kilovolt range can cause
nasty shocks. Be sure all wiring is
covered. Lasers with glass tubes (like
helium neon) should be suitably
protected in plastic or metal enclo-
sures, to avoid the risks of broken glass.
Sources
In addition to the sources listed
American Science and Surplus often carries optics and sometimes laser components.
RoboResources.qxd 11/4/2007 6:36 PM Page 70
here, be sure to check out the regular
advertisers in both SERVO and Nuts &
Volts, as many of them carry surplus
lasers and optics.
Almaz Optics
www.almazoptics.com
Even lasers need the occasional
lens. This outfit sells optics for conven-
tional and laser light applications.
American Science and Surplus
www.sciplus.com
Variable surplus merchandise, so
check their catalog. Often carries
optics and sometimes laser compo-
nents. Low prices.
Anchor Optics
www.anchoroptics.com
Low-cost optics and laser (diode
and gas) products.
Coherent, Inc.
www.cohr.com
Leading manufacturer of industri-
al, educational, and laboratory lasers.
The site contains numerous application
notes and other useful information.
Industrial Fiber Optics
www.i-fiberoptics.com
Manufacturer of educational
grade lasers. Check out their informa-
tional pages.
Information Unlimited
www.amazing1.com
Lasers, laser products, and optics
for all sizes and types of interesting
projects.
Instapark
www.instapark.com
Online retailer of laser pointers
and diode laser modules. Fairly low
prices, even for the green lasers.
Jameco
www.jameco.com
Small but impressive selection
of diode lasers and laser pointers.
Laser Glow
www.laserglow.com
Red, green, yellow, and even blue
laser pointers and diode laser modules.
Laser Surplus Sales
www.lasersurplus.com
Laser Surplus Sales carries lasers
and optics, at surplus prices.
This includes variety of gas, solid-state,
and crystal (e.g., ruby) lasers, and
upporting optics.
Melles Griot
www.mellesgriot.com
Maker of laser components,
optics, and complete laser systems,
Jameco has a small but impressive selection of diodes and laser pointers.
SERVO 12.2007 71
Another established company, Midwest offers a number of higher powered
diode lasers, including Class IIIb units of 40 mW and more.
RoboResources.qxd 11/4/2007 6:37 PM Page 71
from educational to industrial. Check
out their online tutorials, such as the
section on fundamental optics.
Meredith Instruments
www.mi-lasers.com
Meredith Instruments is one of the
oldest names in hobby and educational
lasers. Good selection of low-cost red
diode lasers, collimating lenses, and
line-producing optics.
Midwest Laser Products
www.midwest-laser.com
Midwest Laser Products is another
established company, offering a
number of higher powered diode
lasers, including Class IIIb units of
40 mW and more.
US Food and Drug
Administration CDRH website
www.fda.gov/cdrh
Main portal to the CDRH pages at
the United States Food and Drug
Administration. Plenty of useful
information and factoids about lasers,
laser use, and laser safety. SV
72 SERVO 12.2007
Gordon McComb can be reached
via email at robots@robotoid.com
CONTACT THE AUTHOR
RoboResources.qxd 11/4/2007 6:38 PM Page 72
Robot Builders Sourcebook
by Gordon McComb
Fascinated by the
world of robotics but
dont know how to
tap into the incredible
amount of informa-
tion available on the
subject? Clueless as
to locating specific
information on robot-
ics? Want the names,
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
youve been searching for? Turn to Robot
Builders Sourcebook a unique clearing-
house of information that will open 2,500+
new doors and spark almost as many new
ideas. $24.95
123 Robotics Experiments
for the Evil Genius
by Myke Predko
If you enjoy tinkering
in your workshop and
have a fascination for
robotics, youll have
hours of fun working
through the 123
experiments found in
this innovative project
book. More than just
an enjoyable way to
spend time, these
exciting experiments also provide a solid
grounding in robotics, electronics, and
programming. Each experiment builds on
the skills acquired in those before it so
you develop a hands-on, nuts-and-bolts
understanding of robotics from the
ground up. $25.00
FIRST Robots: Aim High
by Vince Wilczynski / Stephanie
Slezycki
This book looks at
30 different robot
designs all based on
the same chassis,
and provides in-
depth information
on the inspiration
and the technology
that went into build-
ing each of them.
Each robot is fea-
tured in 6-8 pages providing readers with a
solid understanding of how the robot was
conceived and built. There are sketches,
interim drawings, and process shots for each
robot. $39.95
2007 CD Rom
Pre-order before December 20th and get
free shipping (U.S. Only) $24.95
Order other CDs with your 2007 copy of
SERVO or NV (of any combination) and pay
only $21.95 each.
Plus get the free shipping!
All orders will ship mid December.
Mechanisms and Mechanical
Devices Sourcebook
by Neil Sclater / Nicholas Chironis
The fourth edition
of this invention-
inspiring engineering
resource covers the
past, present, and
future of mechanisms
and mechanical
devices. Youll find
drawings and
descriptions of more
than 2,000 compo-
nents that have
proven themselves over time and can
be incorporated into the very latest
mechanical, electromechanical, and mecha-
tronic products and systems. Overviews of
robotics, rapid prototyping, MEMS, and
nanotechnology, along with tutorial chapters
on the basics of mechanisms and motion
control, will bring you up-to-speed quickly
on these cutting-edge topics. $89.95
We accept VISA, MC, AMEX, and DISCOVER
Prices do not include shipping and
may be subject to change.
CNC Robotics
by Geoff Williams
CNC Robotics gives you
step-by-step, illustrated
directions for designing,
constructing, and testing
a fully functional CNC
robot that saves you 80
percent of the price of an
off-the-shelf bot and
that can be customized
to suit your purposes
exactly, because you designed it. Written
by an accomplished workshop bot
designer/builder, this book gives you
everything you need. $34.95
The SERVO Webstore
Insectronics
by Karl Williams
This complete project
book delivers all the step-
by-step plans you need
to construct your own
six-legged insect-like
robot that walks and
actually responds to its
environment. Using
inexpensive off-the-shelf
parts hobbyists can build a better bug
and at the same time have loads of fun
honing their knowledge of mechanical
construction, programming, microcontroller
use, and artificial intelligence. $19.95
Attention Subscribers ask about your discount on prices marked with an *
N N
E E
W
!
W
!
SERVO 12.2007 73
WebstoreDec07.qxd 11/5/2007 3:25 PM Page 73
Get your very own limited-edition SERVO Magazine T-shirt. Shirts come
in sizes S, M, L, and are available in either black or white.
All shirts are 100% preshrunk cotton.
SERVO
Magazine
T-Shirts
For men and women
G
re
a
t
G
re
a
t
G
if
G
if t Id
e
a
!
t Id
e
a
!
$
1
9
.9
5
!
$
1
9
.9
5
!
From HomoSapien to RoboSapien Before R2D2 there was R1D1
Take This Stuff and Hack It!
by Dave Prochnow
Transform common
household items into real-
ly cool stuff. You don't
need to be an electronics
genius to get started turn-
ing everyday items into
high-performing wonders.
With how-to guru Dave
Prochnow's step-by-step
directions and fully illustrated plans, even
beginners can hack their way to a high-tech
home, cooler toys, and less yard work.
Certain to fire your imagination and start you
plotting new, original, and even more creative
wonders you can make from ordinary house-
hold items, Take This Stuff and Hack It! is the
perfect gift for your inner inventor. $27.95
Building Robots with LEGO
Mindstorms NXT
by Mario Ferrari, Guilio Ferrari
The Ultimate Tool for
MINDSTORMS
Maniacs, the new
MINDSTORMS kit has
been updated to
include a program-
ming brick, USB cable, RJ11-like cables,
motors, and sensors. This book updates the
robotics information to be compatible with
the new set and to show how sound, sight,
touch, and distance issues are now dealt
with. $39.95
N N
E E
W
!
W
!
J
U
N
-0
7
J
U
N
-0
7
Forbidden LEGO
by Ulrik Pilegaard / Mike Dooley
Build the Models
Your Parents
Warned You
Against.
Forbidden LEGO
introduces you to
the type of free-
style building that
LEGOs master
builders do for fun
in the back room. Using LEGO bricks in com-
bination with common household materials
(from rubber bands and glue to plastic
spoons and ping-pong balls) along with
some very unorthodox building techniques,
youll learn to create working models that
LEGO would never endorse. $24.95
Robot Builders Bonanza
Third Edition
by Gordon McComb / Myke Predko
Everybodys favorite
amateur robotics book
is bolder and better
than ever and now
features the fields
grand master Myke
Predko as the new
author! Author duo
McComb and Predko
bring their expertise
to this fully-illustrated
robotics bible to enhance the already
incomparable content on how to build
and have a universe of fun with robots.
$27.95
NEED MORE
INFO?
Go where
SERVE
goes!
The online stor The online store @ e @
www www.ser .ser v vomagazine omagazine.com .com
To order call 1-800-783-4624
N N
E E
W
!
W
!
74 SERVO 12.2007
WebstoreDec07.qxd 11/5/2007 3:26 PM Page 74
To order call 1-800-783-4624
Or order online www.servomagazine.com
BACK ROOM SPECIALS
The Official Robosapien
Hacker's Guide
by Dave Prochnow
The Robosapien robot
was one of the most
popular hobbyist gifts
of the 2004 holiday
season, selling approxi-
mately 1.5 million units
at major retail outlets.
The brief manual
accompanying the
robot covered only
basic movements and maneuvers the
robot's real power and potential remain
undiscovered by most owners until now!
This timely book covers all the possible
design additions, programming possibilities,
and "hacks" not found any place else.
$24.95 Sale Price $14.95
Pub date: August 17, 2005
Concise Encyclopedia
of Robotics
by Stan Gibilisco
Written by anaward-win-
ning electronics author,
the Concise Encyclopedia
of Robotics delivers 400
up-to-date, easy-to-read
definitions that make even
complex concepts
understandable. Over
150 illustrations make the
information accessible at a
glance and extensive cross-referencing
and a comprehensive bibliography facilitate
further research.
$19.95 Sale Price $9.95 Only 2 Left
Pub date: November 12, 2002
SERVO'S CUSTOM
EMBROIDERED HAT
This is one good looking hat, with its stone
washed blue cap and bright yellow/gold
stitching. There's no better way to show
everyone that you're well endowed with a
bigger - than - average brain then by proudly
displaying your affiliation with SERVO
Magazine. $ 14.95*
Hydrogen Powered Racer and Hydrogen Station
Recently named as one of the Best Inventions of 2006 by Time Magazine, the H-racer is now 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 generate
a DC current to power an electric motor. Unlike a gas-powered car engine, the only byproducts
of this electrochemical process are electricity, heat, and pure water. With the H-racer, you can
witness the power of new energy technology in the palm of your hand. Horizon has created
this unique, patented miniature fuel-cell car and hydrogen refueling station. All you need to do
is add water. Only $115.00 plus S/H
Robotics Demystified
by Edwin Wise
YOU DON'T NEED ARTIFICIAL INTELLIGENCE
TO LEARN ROBOTICS!
Now anyone with an
interest in robotics can
gain a deeper under-
standing without for-
mal training, unlimited
time, or a genius IQ. In
Robotics Demystified,
expert robot builder
and author Edwin Wise
provides an effective and totally painless
way to learn about the technologies used
to build robots!
$19.95 Sale Price $13.95
Pub Date October 20, 2004
The Day the Earth
Stood Still
An alien (Klaatu) with his
mighty robot (Gort) land
their spacecraft on Cold
War-era Earth just after
the end of World War II.
They bring an important
message to the planet
that Klaatu wishes to tell
to representatives of all
nations. Directed by: Robert Wise
Actors: Michael Rennie, Patricia Neal
Run Time: 92 minutes $14.95
Forbidden Planet:
50th Anniversary Edition
A starship crew goes to
investigate the silence of a
planets colony only to
find two survivors and a
deadly secret that one of
them has. Dr. Morbius and
his daughter Altaira have
somehow survived a
hideous monster which
roams the planet.
Directed by: Fred M. Wilcox
Run Time: 98 minutes $26.95
Blade Runner
(The Directors Cut) (1982)
In a cyberpunk vision of
the future, man has devel-
oped the technology to
create replicants, human
clones used to serve in the
colonies outside Earth but
with fixed lifespans. In Los
Angeles, 2019, Deckard is a
Blade Runner, a cop who
specializes in terminating replicants.
Directed by: Ridley Scott
Rated: R Violence $19.95
NEW! THE SERVO STORE NOW OFFERS DVDS!
With this kit, you now can see and
feel the future of energy generation
in your own hands!
SERVO 12.2007 75
Order now and get
your Hydrogen Racer
before Christmas
WebstoreDec07.qxd 11/5/2007 3:27 PM Page 75
M
y first impression of a Robo-1 style biped was one of
amazement. It walked, performed tricks, and could
battle in competition.
WOW! So, I bought a Kondo KHR-1, spent many hours
building it. And there it was. Now what to do with it!?
I programmed in moves I downloaded from the Internet
and impressed my friends. I created new moves and
sequences and taught it to climb a small staircase. (Not very
easy for movements based on static positions!) Out of the
box, the robot needed to be tethered. There was a kludgy
remote available from Kondo, but I opted not to buy that.
Ive been a programmer since the late 70s, so, of
course, I had to try to improve the interface. I spent the next
few months hacking the communications protocol and wrote
a PDA remote controlled WiFi interface. Thats when
the disappointment hit. The robot could only run
pre-programmed sequences of static frames. If the surface
was tilted, the robot fell over. If the surface was rough, the
robot fell over. Drat!
As with most technical things, there are always
innovations. The Hitec RoboNova soon came along. It was
programmable via an onboard RoboBasic interpreter.
Optional gyros even helped stabilize its movements.
COOL! So I bought a RoboNova, spent many hours
building it. And there it was. Now what to do with it!?
I programmed in moves I downloaded from the Internet
and impressed my friends. There was also a decent PC
program for creating new static positions. So, like most
other RoboNova hobbyists, I built RoboBasic programs. It
even had an out of the box I/R TV style remote. But the
general limiting algorithm was the same:
Receive a command from the remote control.
Run a sequence.
Loop.
I wanted to make the robot walk more like a human.
Rather than just run one sequence after another, what I
really needed were dynamic movements. However, most of
the math involved is beyond the people reading this article,
including myself. Not to mention that the RoboNova only has
an Atmel ATmega128 MCU running at 7 MHz.
I decided to develop a better static model frame
sequencer. One that can transition sequences when common
frames exist in both. First, I tried to do this in RoboBasic. I hit
so many limitations with the compiler that I gave up and
wrote MOOSE (My Own Operating System Executive) to
replace the RoboBasic operating system (kids, dont try this
at home). Yet, I want to point out that a clever Basic
programmer can still make this design work.
And now a pearl of wisdom:
Define your task and build the database prior to writing
any code.
A wisely designed database set ultimately reduces the
amount of code needed to perform a given task. Below is a
list of the features and record type definitions included in the
MOOSE sequencer database.
1) Use the vendors existing static position builder program.
2) Communicate with existing programs.
3) Have variable length sequences.
4) Allow adjustable velocity between frames.
5) Point-to-point servo movement between frames
6) Independence of footedness, play left footed or right
footed.
7) Symmetry flag, indicating a frame is identical left footed
or right.
8) Play a sequence forwards or backwards.
9) Hold at critical places in the sequence momentarily (for
stability).
10) Transition sequences at closest similar frame.
11) Auto-repeat sequences, if desired.
12) Change footedness of sequence on auto-repeat, if
desired.
13) Change direction of sequence on repeat, if desired.
14) Work with my wireless serial based PS2 style controller.
Transitioning Sequencer
Using Static Frames for
Biped Control
by Daniel Albert
76 SERVO 12.2007
Appetizer.qxd 11/4/2007 6:30 PM Page 76
// Record Types
// P: single static Position (Long name, servo
// positions[24])
// S: sequence (Long Name, ID, Flags)
// Sequence Flags:
// (R)epeat sequence over, change footedness.
// (r)epeat sequence over verbatim.
// directional changes only go forward!
// (D)irectional change at end of seq, change
// footedness & continue
// (d)irectional change at end of seq. and
// continue
// F: looping frames within seq. (Position Long Name,
// bit flags)
// Frame Flags:
// (V)elocity V0 - V3 (V0 = slowest)
// (A)mbidextrous - can change footedness from
// left to right if need
// (J)ump - play this move during a sequence
// change, else skipped
// (H)old - Hold when moving forward into this
// position
// (h)old - Hold when moving backward into this
// position
// (S)ymmetrical - This move can be played either
// way
FreeLoader a PC based program I wrote to
accompany MOOSE parses the following example text
file and loads the EEPROM of the RoboNova. Record types
precede the colon. Flags trail.
P:Zero,100,76,144,96,101,100,101,30,81,100,100,100,101,
30,81,100,100,100,100,76,144,96,101,100
P:Lean,69,79,133,101,113,100,105,45,71,100,100,100,101,
37,71,100,100,100,117,96,118,100,94,100
P:ON1Foot,59,73,136,107,117,100,105,45,71,100,100,100,1
00,37,71,100,100,100,116,77,143,98,90,100
P:LeanWide,67,102,114,92,116,100,106,51,83,100,100,100,
98,40,65,100,100,100,106,139,80,89,107,100
P:KneeUpInCenter,87,113,74,130,93,100,105,30,84,100,100
,100,101,33,90,100,100,100,108,109,83,128,112,100
P:KneeUpInFront,86,124,76,152,94,100,67,35,67,100,100,1
00,125,37,82,100,100,100,114,110,88,111,107,100
P:ShortPlantWeightBk,84,10,182,121,95,100,67,40,73,100,
100,100,112,36,72,100,100,100,109,134,67,120,105,100
P:ShortPlantWeightCt,100,63,121,130,102,100,67,43,64,10
0,100,100,120,43,64,100,100,100,100,117,138,71,102,100
P:ShortPlantWeightFw,105,113,78,128,108,100,72,43,68,10
0,100,100,135,48,68,100,100,100,80,107,172,43,93,100
P:LongPlantWeightCtr,100,44,121,151,100,100,67,43,64,10
0,100,100,120,43,64,100,100,100,100,130,138,47,100,100
P:KneeUpInBack,114,110,88,134,107,100,60,47,70,100,100,
100,144,34,81,100,100,100,86,124,76,53,94,100
P:LongPlantFw,117,134,58,142,102,100,66,43,68,100,100,1
00,139,46,65,100,100,100,83,114,181,43,97,100
P:LongPlantBk,90,09,161,132,99,100,81,42,78,100,100,100
,116,42,59,100,100,100,106,152,54,101,103,100
P:WidePlantBk,85,15,167,121,113,100,73,42,78,100,100,10
0,129,42,59,100,100,100,109,136,53,121,106,100
P:WidePlantFw,117,154,35,132,111,100,78,42,78,100,100,1
00,134,29,77,100,100,100,77,115,183,25,103,100
P:bigKneeUpFw,95,18,143,137,115,100,64,34,81,100,100,10
0,131,47,70,100,100,100,113,133,87,67,87,100
P:bigKneeUpBk,100,98,96,45,105,100,144,34,81,100,100,10
0,60,47,70,100,100,100,109,96,127,108,97,100
P:BU1,100,130,120,80,110,100,150,160,10,100,100,100,150
,160,10,100,100,100,100,130,120,80,110,100
P:BU2,80,155,85,150,150,100,185,40,60,100,100,100,185,4
0,60,100,100,100,80,155,85,150,150,100
P:BU3,75,165,55,165,155,100,185,10,100,100,100,100,185,
10,100,100,100,100,75,165,55,165,155,100
P:BU4,60,165,30,165,155,100,170,10,100,100,100,100,170,
10,100,100,100,100,60,165,30,165,155,100
P:BU5,60,165,25,160,145,100,150,60,90,100,100,100,150,6
0,90,100,100,100,60,165,25,160,145,100
P:BU6,100,155,25,140,100,100,130,50,85,100,100,100,130,
50,85,100,100,100,100,155,25,140,100,100
//
S:Stand,01,r
F:Zero,S,V3,A
F:Lean,V5,J,A
//
S:ShortStepFwdBck,11,R //(R)epeat sequence
// with changed footedness
F:Lean,V6,J,A
F:KneeUpInFront,V6
F:ShortPlantWeightBk,V6,H
F:ShortPlantWeightCt,V6
F:ShortPlantWeightFw,V6,h
F:KneeUpInBack,V6
//
S:ShortStepTurn1way,15,R //(R)epeat sequence with
//changed footedness
F:Lean,V6,J,A
F:KneeUpInFront,V6
F:ShortPlantWeightBk,V6,H
F:ShortPlantWeightCt,V6
F:LongPlantWeightFw,V6,h
F:KneeUpInBack,V6
S:ShortStepTurnOtherway,17,R //(R)epeat sequence with
// changed footedness
F:Lean,V6,J,A
F:KneeUpInFront,V6
F:LongPlantWeightBk,V6,H
F:ShortPlantWeightCt,V6
F:ShortPlantWeightFw,V6,h
F:KneeUpInBack,V6
//
S:ShortStepLftRgt,E3,D //(D)irection and footedness
// changed at end. Repeatable
// at start
F:Lean,A,V5
F:KneeUpInCenter,V5
F:ON1Foot,V5
//
S:RotateInPlace,69,r //(r)epeat sequence verbatim
F:Lean,V3,A
F:LongPlantWeightCtr,V3
F:Stand,V3,S,A
//
S:UpFromBack,B6 //runs once and stops at Stand
F:Lean,V3,J,A
F:BU1,V6
F:BU2,V6
F:BU3,V6
F:BU4,V6
F:BU5,V6
F:BU6,V6
F:Zero,S,A,V6
END
MOOSE starts out on boot-up by playing the first sequence;
in this case, S:Stand. The serial port waits for a data packet
indicating the status of the wireless PS2 controller. MOOSE
converts the joystick and button data to a requested sequence
ID, direction, and footedness. If it finds an S that matches the
requested ID, it will then search both the current sequence and
the requested sequence for the best transition point.
You may notice several things about the S:Stand
sequence. It has two static frames: F:Zero and F:Lean. In addi-
tion, it is has the r flag indicating it will repeat at the end.
Why would you want to lean in a stand sequence?
Normally, you wouldnt. The F:Lean frame has a J flag
indication that it is merely a jump point and will only be
played if necessary during a transition to another
sequence. So, until you jump away from the S:Stand
sequence, the F:Lean is ignored.
Now the Fun Begins!
Lets say that we want to transition to the
SERVO 12.2007 77
Appetizer.qxd 11/4/2007 6:30 PM Page 77
S:ShortStepFwdBck sequence with a forward direction, starting
with the left foot. MOOSE sees that there is a common frame
F:Lean in both sequences. It plays the F:Lean in the S:Stand
sequence, followed by the next desired frame F:KneeUpInFront.
Had the direction requested been backwards, MOOSE
would see that S:ShortStepFwdBck can be repeated and
would run the sequence in reverse starting with
F:KneeUpInBack. Upon reaching either end of a repeating
sequence that requires a change of footedness, MOOSE will
change from left to right foot and continue the sequence. A
full backwards/forwards or left footed/right footed walk can
be achieved from six static frames.
Now, Lets Turn While Walking!
We dont need to know where we are in a sequence and
we dont need to finish the sequence in order to transition.
Going from S:ShortStepFwdBck to S:ShortStepTurn1way
can transition on any of the four common frames. MOOSE
will immediately switch sequences on the next frame if it can.
If not, it will find the next best jump point. I know there are
some really sharp readers out there are saying, What if the
left knee is up and we want to transition to the right knee up
... they are the same frame ... can it hop?
No problemo! Even though the RoboNova cant hop, MOOSE
continues the sequence until it finds either a symmetrical
frame where it can just switch current footedness to requested
footedness with no delay (i.e., S:Stand) or an ambidextrous frame
where it can play it twice (i.e., Lean left then Lean right).
Sequences with the direction flag set like S:ShortStepLftRgt
play forward only from their first frame up to the last, can
switch footedness if needed, and play backwards down to the
first. They can then repeat from the first frame if the repeat
flag is set. One time sequences like S:UpFromBack get played
forward once and stop at the last frame.
Frames with the (H)old and (h)old flag pause momentar-
ily to allow the robot to settle. These flags are directional
since it may be critical to hold during the bounce that occurs
when placing a foot to the ground but not hold in the reverse
direction of picking the foot off the ground.
Well, thats all there is to giving your biped some dynam-
ic like sequences without using dynamic model programming.
If you have a RoboNova and would like to test drive
MOOSE and FreeLoader, please contact me.
MOOSE emulates much of your original Basic programs
serial command protocol. It can communicate with RoboBasics
servo motor real time control in order to create the static frames
and even adjust and store the zero settings. MOOSE and
RoboBasic cannot exist concurrently. If you try to upload a Basic
program, you will wipe out MOOSE and reload RoboBasic. I
would be happy to assist any brave, savvy RoboBasic program-
mer that wants to try to emulate this sequencer in RoboBasic.
Support for a five degree of freedom IMU (Inertial
Measurement Unit) is currently under development. SV
78 SERVO 12.2007
Dan Albert can be reached via email at dan@alberts-equation.net.
CONTACT THE AUTHOR
Appetizer.qxd 11/4/2007 6:31 PM Page 78
S
ervos? Just what is a servo (or a servo
motor or servo mechanism, as they
are sometimes called)? Is that a years
collection of this magazine? Most of us
who have built robots have used one or
more of these in our creations, but not all
robots use servos. Most of the larger vari-
eties of robots dont use servos though
they might employ shaft encoders to
provide some sort of positional feedback
to a controlling microcontroller or
computer. Most combat robots (like the
ones that seem out of control) dont use
any form of them, so why do so many
experimenters utilize them?
Who would have ever thought that
these small plastic boxes would have had
such an impact on experimental
robotics? I remember playing with a four
channel R/C system years ago, trying to
figure out how I could use it in a robot.
Most of my robots were usually rather
large and the tiny servos could do little
more than move small special effects
appendages. Cute decorations really
served no useful function, so I decided to
hack one to see what I could do with it.
I believe that first thing I made was
a linear actuator. Pulling the 4.7K pot
out, cutting off the stops from the
output gear, I attached a 25 turn lead
screw and a 25 turn 5K trim pot (in the
place of the other one) to the output
shaft and had an amazingly powerful
push-pull actuator. Other experi-
menters in our robotics group were
attaching them to arm and leg joints,
and driving the servos with 555/556
timer circuits or 6502 microprocessors,
and a few started to use them as drive
motors for small robots wheels.
Typical Servos Used
in Robotics
The three servos shown in Figures
1a, 1b, and 1c are just a tiny fraction of
the many types, torque capacities, sizes,
and weights available from the many
manufacturers today. Servos are quite
often the only motive force of many
experimenters robots. Most of the
beginners kits from Parallax and others
use similar servos in small robots.
Tabletop robots can make use of
the little motor/gearbox to drive a
set of wheels and the associated
electronics to receive the pulse trains
from a microcontroller and convert
them to drive signals. This is a cheap
and effective way to get a robot design
from a few sketches to a working
machine in a few hours.
As robot experimenters, we think
of those little black boxes that
were originally developed for model
airplanes as the only servo that were
familiar with. Many of us have boxes of
them; some hacked, some in pieces,
and some actually in one piece.
Servo Feedback
With the advent of specialized ICs
and electronics, modern servos have
emerged as marvels of mechanics and
electronics. Servos have been used in
industrial applications for years, long
a
n
d
SERVOS
b y T o m C a r r o l l
FIGURE 1a. JR servo. FIGURE 1b. HiTec robot servo. FIGURE 1c. Futaba coreless servo.
SERVO 12.2007 79
Then&Now.qxd 11/5/2007 4:29 PM Page 79
80 SERVO 12.2007
before model aircraft found them useful
to move various surfaces to change the
direction of flight. Newer applications
are popular for CNC machine tool use.
Figure 2 shows three servos used
to move the three axes of a milling
machine by Servo Products. Way back
in 1787, James Watt used a servo-like
device the flyball governor to reg-
ulate the speed of his steam engines.
Figure 3 from the cover of a 1952
Scientific American Magazine shows a
classic drawing of the flyball governor.
It certainly was not what we think of
today as an electrical/electronic servo,
but it could be set in different positions
to control the speed of a steam engine.
The revolving set of balls was
directly connected to the engines output
shaft and as the speed increased,
centrifugal force caused the balls to move
outward, pulling down the upper ring
and connected lever. As this ring moved
downward, it would slowly shut down
the flow of steam by moving a valve, thus
slowing the engine and revolving balls.
At one point, a stable speed was
developed. By manually changing the
distance between the ring and where
the valve cut down the steam flow, one
could set the engines speed wherever
desired. A relief valve was set to open
at a specific pressure, thus preventing
an exploding boiler.
No, this certainly is not a typical
servo that were familiar with, but it did
utilize feedback to control a machine.
No 1.0 to 2.0 millisecond pulses were
sent remotely to Watts engine to
control speed, just a simple mechanical
adjustment by a human operator.
What is a Servo?
Just like the definition of a robot is
so different to so many people, a servo
has many definitions. Allow me to pres-
ent four definitions of the term servo
that I found at random through Google:
A servo is: An electromechanical
device that uses feedback to provide
precise starts and stops for such
functions as the motors on a tape drive
or the moving of an access arm on a
disk (PC Magazine).
A servo is: An automatic device
used to correct errors in the operation
of machinery, used in satellite-tracking
systems, power-steering systems on
some cars, and to control robots and
keep ships on course (encyclopedia).
A servo is: A small mechanism
inside the RC vehicle, the servo is a device
with a motor, gears, and circuits that con-
trols things like steering and speed. A
typical RC car has a steering servo to
make the wheels turn and a speed con-
trol or throttle servo to make it go faster
or slower. Other types of servos may be
present to control other functions (radio-
control car enthusiasts definition).
A servo is: An electro-mechanical
device that is used to convert the
received signal into mechanical move-
ment. Servos are used to move control
surfaces, throttles, retractable landing
gear, or auxiliary functions (model
airplane enthusiasts definition).
Servo is: The name of a great
robot experimenters magazine. (Sorry,
I just had to put that in.) If you Google
servo, youll find most definitions and
hits are about the model airplane types.
How Does a Servo
Work?
Are you really any closer to
knowing just what a servo is? So many
articles in this magazine (including
some of mine) have gone over how a
typical model aircraft servo works. The
more popular and certainly cheaper
models utilize a pulse width modula-
tion pulse train from the R/C receiver.
The pulse train consists of 50 to 60
pulses per second with each pulse
being one to two milliseconds long,
though experimenters have used 0.8 to
2.2 ms pulses to drive the servo further
than the typical 90 to 120 degrees of
travel. A shorter series of pulses will
drive the servos output shaft one
direction, and the longer pulses will
drive the other way with positions in
between for pulses closer to 1.5 ms.
In these older servos that have
been used for years, there are three
wires to the servo: a signal wire (for the
pulse train) that can be a number of
colors; a 4.8 to 6 volt power wire that
is usually red; and a ground wire that is
usually black or brown. Note that there
is no output wire to inform an operator
or microcontroller just where the
servos shaft is positioned.
Early Model Aircraft
Servos
One of the first R/C systems that I
used was by Kraft. Figure 4 shows an ear-
lier analog Kraft system with three servos
mounted in the airplane, lying behind
the transmitter and receiver in the
foreground. Back in the 80s, several of
us from the Robotics Society of Southern
California were invited down to the Kraft
FIGURE 3. Flyball governor on the
cover of Scientific American.
FIGURE 2. Three axis milling machine
set up by Servo Products.
Then&Now.qxd 11/5/2007 4:30 PM Page 80
plant in Vista, CA and were given a tour
of the facility. The guy leading us around
the Kraft facility gave us a lot of servos,
receivers, and battery packs just for good
will; maybe he saw that the end was
near. Futaba from Japan was starting to
really hurt the US manufacturers and
Krafts days seemed numbered.
Experimenting with them at home,
I found the Kraft servos to be quite well
made. I also had an old Heathkit R/C
system that I built that used two PS-4
servos made by Orbit (remember kits?).
Kraft later came out with the smaller
KPS-12 servos that some people I knew
built into robot joints for walkers. I later
began to frequent the Hobby Shack
(now Hobby People) in Fountain Valley,
CA and found that Futaba and HS
Cirrus line of R/C equipment to be a lot
cheaper for my R/C projects.
One of my first R/C robots for a
movie used a Hobby Shack AeroSport
four channel system with two Vantec
speed controllers for the two wheels
and two very large Cirrus servos for the
two arms. I used coil springs to compen-
sate for the arms weight and the little
robot could easily pick up over a pound.
Futaba took the lead several
decades ago and is still one of the more
popular R/C systems with a full line of
servos for all applications, including
servos designed specifically for robots.
HiTec of Korea also has a line of servos
specifically designed for robots, as does
the Robotis Bioloid line of Dynamixel
servos (actuators), also from Korea.
Servo Selection
You may be wondering just what
type of servo that youll need for your
project. For economys sake, you can
start with the cheaper analog servos
with a three pole cored motor, plastic
gears, and bushings for the shaft. These
will work great for almost all applica-
tions where you need to study the basics
before advancing to your final design.
The next step for tougher applica-
tions is to buy a metal geared servo
with ball bearings on the main shaft.
Coreless motors have quicker changes
in speed over the three and five pole
cored motors. The most advanced are
the digital servos with an embedded
microcontroller to deliver a greater
number of PWM pulses to the motor
for quicker response, greater accuracy,
and torque with less deadband. They
do draw a bit more power to operate,
but that is usually not too much of a
concern for robot builders.
Of course, servos vary widely in
their torque, weight, and size. The Cirrus
CS-3 Micro Joule SX servo weighs only
three grams (its four channel receiver
weighs a bit less), yet it only has seven
oz. in. of torque (see Figure 5). Monster
servos can weigh over a pound and put
out 10 foot pounds of torque or more.
It all depends on what you need.
This single paragraph certainly
cannot narrow down the right servo
for your application; you need to go
to the Internet or to manufacturers
websites and do some research.
Servo Feedback vs.
Feedback to a
Microcontroller
This magazine takes its name from
these devices that so many of us have
used in our robots for years, yet servos
offer no built-in intelligence. They only
take commands from a microcontroller
or R/C receiver and move to a certain
point and stop. But hack the little
suckers and you have an intelligent
drive motor of sorts.
After reading my August column
on Robot Arms, Alex Dirks of
CrustCrawler wrote SERVO concerning
what he felt were incorrect statements
that I made concerning servos used in
many experimenters robots the
types used with radio controlled model
airplanes to move various wing and
rudder surfaces. He referred to the
following statements that I made
concerning their use with robot arms:
The advantage of using R/C
servos is the positional feedback.
Potentiometric feedback, as in R/C ser-
vos, allows the controlling computer to
know where each joint is positioned.
Alex countered with the following:
FIGURE 4. Early Kraft radio.
FIGURE 5. Cirrus CS-3 Micro
Joule SX servo.
FIGURE 6. Robotis Dynamixel AX-12. FIGURE 7. Robotis Dynamixel RX-28.
SERVO 12.2007 81
Then&Now.qxd 11/5/2007 4:30 PM Page 81
There are no feedback mechanisms
built into any standard servo today with
the exception of the AX-12+ (the servo
from Robotis and several others in that
line) and a few specialized servos used
in biped type robots. Alex knows
servos as President of CrustCrawler, a
business he started six years ago with
the HexCrawler and QuadCrawler.
The products he feels have the
most promise today are probably the
AX12 Smart arms designed around the
Robotis smart servos that Ill discuss
later. However, it is CrustCrawlers and
the other well-known suppliers of
ready-to-roll robots and kits that have
steered the servo manufacturers into
designs that are made specifically for
robot experimenters.
I felt that the best way to under-
stand where he was coming from was
to talk with him personally. When I
talk about servo feedback, he told
me, I mean feedback to an external
controller. Feedback that is limited to
the servo itself without feedback to an
external controlling/monitoring device
such as a microcontroller or host
computer limits the usefulness of the
servo motor substantially. I convinced
him that I was speaking of the
feedback of the internal potentiometer
to the internal circuitry, not to the
outside world. Its internal feedback pot
serves only to tell the internal circuitry
just where the servo horn is positioned.
I feel that this is an advantage over
the use of a stepper motor as a stepper
can become stuck and the microcon-
troller will assume that it still has
moved the required number of turns. A
microcontroller connected to a typical
servo will send the appropriate series
of specific width pulses and the servo
will continue to try to move to the right
spot until it is there.
Intelligent Servos
Alex feels that the standard servo
of today whether analog or digital
will soon be phased out for walking
robots, especially the higher end kits
and ready-builts. The Robot Exclusive
Actuator Dynamixel from Robotis is
one of the most innovative servos to
come out in years. The Robotis line of
rotary actuators (as they call them)
have some very good features for
robot experimenters. They certainly
command a premium price but
humanoid builders will find one feature
very useful in their designs the ability
to be daisy-chained rather that have
three leads from each of, say, 18 ser-
vos leading back to a controller board.
Dynamixel actuators, such as the
AX-12+ (Figure 6), speak to each other
through a TTL line, and units such as
the RX-28 (Figure 7) communicate
through the popular RS-485 protocol.
CrustCrawler has developed the AX12
Smart arm that uses the Robotis
Dynamixel actuators for the arms joints.
Each servo in the daisy chain is assigned
an address for control and feedback pur-
poses. Yes, these devices have true feed-
back to the controlling microcontroller,
such as an Atmel or BASIC Stamp.
Most of the larger manufacturers
and dealers of robots and robot kits in
SERVO Magazine have numerous styles,
costs, and capabilities of servos in their
lineups. Figure 8 shows a line of servos
from Pololu. The Seattle Robotics Society
(SeattleRobotics@yahoogroups.com) has
excellent sources for hacking and
modifying servos as do many other
groups sites. R/C and model aircraft
sites offer much useful information.
In the two months that I have
been working on this article off and
on, I have come across so much
information on the subject of servos
and many of the articles are complete-
ly contradictory with others. So, dont
take everything that you read as fact.
Talk with fellow robot experimenters
and just take one apart and determine
how it works and what youre going to
do with it next. Modern servos are a
true bargain. SV
FIGURE 8. Line of servos from Pololu.
Tom Carroll can be reached via email
at TWCarroll@aol.com.
CONTACT THE AUTHOR
All Electronics Corp. ..........................19, 66
AP Circuits/e-pcb.com ............................13
AWIT ..........................................................66
Budget Robotics ......................................16
CrustCrawler ...............................................3
Electronics123 ..........................................19
Floatation Center Art Gallery ..............65
Futurlec .....................................................66
Gears Educational Systems, LLC ............50
Hitec ..........................................................13
Hobby Engineering .................................66
IMService ............................................19, 66
Jameco .................................................2, 66
Lorax Works ........................................19, 66
Lynxmotion, Inc. .......................................17
Maxbotix ...................................................66
Maximum Robotics ............................30, 66
Net Media .................................................83
Parallax, Inc. ...............................Back Cover
PCB Pool .............................................66, 72
Pololu Robotics & Electronics ..........42, 66
Robotis Co. Ltd. .......................................78
RobotShop, Inc. .................................66, 72
Schmartboard.....................................19, 65
SCON .........................................................19
Solarbotics/HVW .......................................7
SORC ..........................................................59
SPSU...........................................................21
Technological Arts ...................................66
TORMACH ................................................35
Vantec .......................................................59
Yost Engineering ......................................45
Advertiser Index
82 SERVO 12.2007
Then&Now.qxd 11/5/2007 4:31 PM Page 82
Order 24 hours a day, 7 days a week
www.Jameco.com
Or call 800-831-4242 anytime
Jameco Electronics. *According to the line cards on their web sites on August 28, 2007. Trademarks are the property of their respective owners.
OTHER JAMECO ADVANTAGES:
More major brands of semis than any other catalog.
99% of catalog products ship the same day.
Lowest prices guaranteed, or we pay 10%.
Major brand names and generic equivalents
for even greater cost savings.
5
10
15
20
Were passive aggressive
When it comes to passive products, we dont pull
any punches: we stock more major brands of
passive components than any other major cata-
log distributor.* So whatever brands you need
from AMP or AVX to Vishay or Wakefield
youre more likely to find them all at Jameco.
Check our stats below and see for yourself.
Its another Jameco advantage.
Jameco

Digi-Key

Mouser

Newark

AMP AMP AMP AMP


Astec Power Astec Power Astec Power Astec Power
Augat AVX AVX AVX
AVX Bourns Bourns Bourns
Bourns Cherry Cherry Cherry
Cherry Corcom Condor Power Corcom
Condor Power CTS Corcom Elco Connector
Corcom Elco Connector Elco Connector Grayhill
CTS Fox Electronics Fox Electronics Intl Rectifier
Elco Connector Grayhill Intl Rectifier Kemet
Fox Electronics Intl Rectifier Kemet Molex
Grayhill Kemet Molex Osram
Intl Rectifier Molex Panasonic Panasonic
Kemet Osram Potter & Brumfield Potter & Brumfield
Molex Panasonic Teledyne Relays Vishay
Osram Potter & Brumfield Vishay Wakefield
Panasonic Power-One Wakefield
Potter & Brumfield Vishay
Power-One Wakefield
Teledyne Relays
Vishay
Wakefield
Free shipping on these
and 83 other major brands.
Call for details.
CoverInside.qxd 11/1/2007 3:10 PM Page 2
V
o
l
.

5

N
o
.

1
2
S
E
R
V
O
M
A
G
A
Z
I
N
E
H
E
R
O

S
E
R
V
O
S

S
P
A
R
E

T
H
E

R
O
D
,

S
P
O
I
L

T
H
E

B
O
T

T
A
S
K

P
R
I
M
I
T
I
V
E
S
D
e
c
e
m
b
e
r

2
0
0
7
0 4 74470 58285
12>
U.S. $5.50 CANADA $7.00
Cover.qxd 11/6/2007 3:46 PM Page 84

You might also like