Vous êtes sur la page 1sur 84

Cover.

qxd 12/9/2004 3:54 PM Page 84

Vol. 3 No. 1
SERVO MAGAZINE
HACK-A-SAPIEN WINNERS
January 2005

Circle #106 on the Reader Service Card.


CoverInside.qxd 12/9/2004 3:33 PM Page 2

Circle #60 on the Reader Service Card.

SERVO 08.2004 83
Circle #32 on the Reader Service Card.
Full Page.qxd 12/9/2004 3:22 PM Page 3

Circle #81 on
the Reader Service Card.
TOC.qxd 12/8/2004 10:00 AM Page 4

Departments Columns
6 Publisher’s Info 6 Mind/Iron
7 Bio-Feedback 8 Rubberbands
37 Robotics Showcase 14 GeerHead
38 Events Calendar 30 Menagerie
58 SERVO Bookstore 60 Brain Matrix
62 New Products 64 Ask Mr. Roboto
82 Advertiser’s Index 68 Robytes
70 Robotics Resources
80 Appetizer

Check out our new column


dedicated to hacking robots
to do things they were never
designed to do — but can!
Take a Sneak Peek! 76 Twin Tweaks
Witness the ups and downs
involved in transforming a
four-legged walker into a
biped.

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.
APPLICATION TO MAIL AT PERIODICALS
POSTAGE RATE IS PENDING AT CORONA,
CA AND AT ADDITIONAL ENTRY MAILING
See what the st ylish RSs are w ear ing! OFFICES. POSTMASTER: Send address changes
to SERVO Magazine, 430 Princeland

Coming 2.2005 Court, Corona, CA 92879-1300 or


Station A, P.O. Box 54,Windsor ON N9A 6J5.
cpcreturns@servomagazine.com

4 SERVO 1.2005
TOC.qxd 12/8/2004 9:58 AM Page 5

SERVO 1.2005 VOL. 3 NO. 1

Features & Projects

17 BEAM Robotics, Part 4: Seeking the Light


by Thomas Gray and Wolfgang Goerlich

23 Hack-a-Sapien: Sci Fi Becomes Reality


by Jamie Samans

29 Hack-a-Sapien Contest Winners

31 Bot Brain Basics


by Kerry Barlow

39 Navigating Robo-Magellan
by Daryl Sandberg and Larry Geib

43 Virtual Robotics
by Thomas Braunl, Andreas Koestler, and Axel Waggershauser

51 IR Remotes for Your Robot


by Karl Williams

SERVO 1.2005 5
JanPages6&7.qxd 12/9/2004 9:44 AM Page 6

Published Monthly By
The TechTrax Group — A Division Of
T & L Publications, Inc.
430 Princeland Court
Corona, CA 92879-1300
(951) 371-8497
FAX (951) 371-3052
www.servomagazine.com
Mind / Iron Subscription Order ONLY Line
1-800-783-4624

by Dan Danknick Œ
PUBLISHER
Larry Lemieux
publisher@servomagazine.com
There are some things we were not column. Which is best? A clearer
meant to know. Fortunately — in the area definition of this question leads us to the ASSOCIATE PUBLISHER/
of robotics — this is not the case. Each answer. VP OF SALES/MARKETING
year brings new advances in the art, Better power supplies: Better battery Robin Lemieux
robin@servomagazine.com
borne on the back of previous technologies allow longer run times and
accomplishments. Some of these more complex behavior by providing MANAGING/TECHNICAL EDITOR
achievements are incremental and some energy for more motors and sensors. This Dan Danknick
dan@servomagazine.com
are major shifts in current design increases the overall functionality of
paradigms. Either way, things move robots and extends the "design cap" of ASSOCIATE EDITOR/
forward. In the past year and a half of projects. You should be taking advantage PRODUCTION MANAGER
interviewing various robot protagonists, of the hot new batteries as much as you Alexandra Lindstrom
alexa@servomagazine.com
interacting with robot clubs, and take advantage of new R/C servos and
observing the research money that advanced math routines on CPU boards. CIRCULATION DIRECTOR
companies spend, I have made some Better competitions: From the start Mary Descaro
predictions of the hot topics for 2005. of the “Mind/Iron” column, I've subscribe@servomagazine.com
Active sensors: In the December, encouraged robot clubs to move on to WEB CONTENT/STORE
2003 issue of SERVO, we published a more clever competitions. Some have Michael Kaudze
project on an active sonar mapper. I stepped up to the plate with ribbon michael@servomagazine.com
wonder how many of you built this and climbing and SRS' Robo-Magellan. This
PRODUCTION/GRAPHICS
integrated it into your room-exploring trend will continue as the excitement of Shannon Lemieux
robot? It's easier to learn about your tackling new challenges continues to spur
environment if you send out a known builders. COVER ART
Michele Durant
pulse and then measure the return signal, Ultimately, that's the future of 2005
inferring environmental features from in our avocation — staring down STAFF
how it is modified. We need more challenges with good designs. We are up Kristin Rutz
research in this area — and that is why to our ears in cheap CPU processing, low Dawn Saladino
many large companies are working on cost sensors, low weight frame materials, INTERN
such devices. As Guy Marsden's project and the like. It's time to step into the Mandy Garcia
demonstrated, the typical robot hobbyist game and make robots that solve new
can also jump in. problems. I know my words would fall flat OUR PET ROBOTS
Guido
Locomotion gaits: Not every robot if I didn't also take up that challenge and Mifune
rolls on wheels — some walk. When that's why this is my last “Mind/Iron” in
constructing a walker, the builder needs SERVO. I've accepted an engineering Copyright 2005 by
T & L Publications, Inc.
to implement a gait or sequence in which position at a top-notch R&D company, All Rights Reserved
the legs move to affect motion. Consider where I'll be designing and building
a horse: it walks, trots and gallops — three robots to solve some of the big problems All advertising is subject to publisher's approval.
different gaits, each uniquely suited for a we face in the world. It's a tall order, but We are not responsible for mistakes, misprints,
or typographical errors. SERVO Magazine
different application. As walking robots it's what all my years in the field have assumes no responsibility for the availability or
gain in popularity, the two-, four-, six-, and given me — the ideal toolkit for the task. condition of advertised items or for the honesty
eight-legged machines will necessarily I encourage you all to make the most of the advertiser.The publisher makes no claims
require different gaits. In the September of what you know and use it as best you for the legality of any item advertised in SERVO.
This is the sole responsibility of the advertiser.
2004 issue of Nuts & Volts, author Mike can. As mathematician René Descartes Advertisers and their agencies agree to
Keesling demonstrated a number of said, "It is not enough to have a good indemnify and protect the publisher from any
different gaits for the hexapod in his mind. The main thing is to use it well." SV and all claims, action, or expense arising from
advertising placed in SERVO. Please send all
subscription orders, correspondence, UPS,
overnight mail, and artwork to: 430 Princeland
Court, Corona, CA 92879.

6 SERVO 1.2005
JanPages6&7.qxd 12/9/2004 11:28 AM Page 7

Dear SERVO, home hobbyist. It is inexpensive, easy


You folks have been terrific in to operate, and produces high quality
providing copies of SERVO for our welds for steel or aluminum. 220 V
students in BEST ROBOTICS. Thank MIG welders are much more expensive
you so much for that!!! and are more for commercial
Robert Steele applications.
via Internet You can also get a low end AC
Dear SERVO, stick welder like a Sears "buzz box," but
The Tetsujin exosuits in the they require a 220 V plug (I don't
December 2004 issue are incredible! recommend the 110 V). The advantage
How can I find out more about them? of stick welders over MIG is they can
Tony Schnyder weld through rust and paint, in
via Internet addition to their ability to weld thicker
Dear Tony, metals. The disadvantage of stick
We promised you “ongoing welders is they require a lot more skill
Tetsujin coverage” and we’ll deliver! than a MIG does to produce a good
Keep reading over the next few bead. If you're going to weld clean
months and you’ll find in-depth articles metal surfaces, go with MIG.
about the suits, the builders, and the Also I have two more suggestions
motivation behind Tetsujin 2004. for your readers:
Editorial Dept.
1. Get a good book on welding. One
Dear SERVO, such book is New Lessons in Arc
In the December 2004 issue of Welding by The Lincoln Electric
SERVO “Robotics Resources” article Company. It's only $10.00 and can be
by Gordon McComb on Metalworking ordered from their website: https://
101 on welding and other metal fusing ssl.lincolnelectric.com/lincoln/apdi
techniques, he incorrectly states that rect/item.asp?prodnum=L
110 volt welders are, "limited to
welding fairly thin sheets of metal — 2. Welding requires lots of practice.
down to about 12 or 14 gauge." Take a class before you buy a welder.
I happen to own a Millermatic Many regional technical schools offer
135 MIG welder that plugs into a welding classes at night. At these
standard 110 V wall socket. You can classes, you get hands-on experience
easily weld up to 1/8" stock with it and with many types of welders. You will
— if you're good — 3/16". learn how to weld and get a good
The importance of him missing idea of which welder is best for you.
this fact is that a 110 V MIG welder is Tony Rea
a versatile and powerful tool for the via Internet

What kinda bot do you got?


Do you think your bot is cooler than what you see here every month?
Prove it!

Earn bragging rights by having your creation highlighted


in our Menagerie section!

Send us a high res picture of your robot with a brief description and we’ll
make you famous. Sort of.

menagerie@servomagazine.com

Circle #109 on the Reader Service Card.


7
Rubberbands.qxd 12/8/2004 9:34 PM Page 8

by Jack Buffington

Putting on a Display:
Spicing Up Your Robot With
an Alphanumeric LCD

Onemicrocontrollers
of the most frustrating things about working with
is that they don’t have a nice display like
Sometimes, you will have a free serial port available
that you can send data to a terminal program, but — if
standard equipment, like your desktop computer does. In your robot is mobile — you will inevitably want it to roam
fact, most of the time, all that you will have available is a freely so a serial link isn’t a great option. This month’s
couple of LEDs to look at to try to determine what is going column will show you how to connect to an inexpensive
on inside of it. alphanumeric LCD display that uses the HD44780 driver
chip hooked up to a PIC processor so that you can
Figure 1. Pin functions for the LCD module. have text-based feedback from your electronics,
wherever your robot may be.
The HD44780 chip is capable of driving LCD
displays of up to two lines of 40 characters. For this
column, an LCD that has four lines of 20 characters
each was chosen.
This particular LCD accomplishes this by splitting
each line of 40 characters into two lines of 20 characters.
If you are interested in working along with this column,
you can find the exact module used here at www.
mpja.com The part number is 153640P. At $9.95 each,
you really can’t beat the price!
The LCD module that is used in this column has 11
I/O pins. This is standard for modules using the
HD44780. Figure 1 shows the pin functions for the
module used here.
You can communicate with it by using eight of the
I/O lines in parallel to send bytes of data or you can
discard four of them and use a four-bit interface
instead. Here, we’ll use the eight-bit interface. Although

RESOURCES
I/D S Result
www.ccsinfo.com
0 0 Moves the cursor to the left after a character is displayed. Sells the C compiler for PIC processors
used in this column
0 1 Cursor stays at the same location. Line shifts to the right.
www.microchip.com
1 0 Moves the cursor to the right after a character is displayed. Manufacturer of the PIC microcontroller

1 1 Cursor stays at the same location. Line shifts to the left. www.mpja.com
Sells the LCD module used in this article
Figure 2. I/D and S truth table.

8 SERVO 01.2005
Rubberbands.qxd 12/8/2004 8:39 AM Page 9

Rubberbands and Bailing Wire

it is wasteful of I/O pins on a microprocessor, it makes the


source code more readable.
TECH TIDBIT
If you were to choose to use the four-bit interface, you Do you use a lot of LEDs in your projects? With most
would simply send the same commands as shown here, LEDs, you need to have a resistor in series in order
except that you would send the high nibble of the byte to keep the current through the LED below a certain
that you wanted to send and then follow it with the threshold. It is a pain to wire up all of those resistors.
low nibble.
A simple solution that lets you avoid this problem is to
There are three other pins that are exclusively inputs.
use an LED that has an integrated resistor.
These are E, RS, and R/W. E is the line that you use to signal
to the chip that you are sending it data. Data is loaded into
the chip on the falling edge of E. RS is the register select line. Connecting the Display to
You can choose between sending commands that change
how the display driver acts or sending data that is written to Your Electronics
one of the display driver’s registers using this pin. R/W selects
between read and write. In this column, a PIC16F870 is being used, but — if
For the most part, you will be writing data to the driver you happen to be using a different processor — the
more often than you will be reading it. Still, the option is connections will be essentially the same. You will need an
there, so — if you happened to be a hot-shot programmer eight-bit I/O port and three other pins for the E, RS, and
who was running low on RAM — you could command the R/W outputs. Figure 3 shows how you would connect
display to turn off and use its internal registers to store up to the display to your circuit. For this display, there is a con-
88 bytes of RAM! nection labeled VO. By adjusting the voltage supplied to
The HD44780 has just a few commands that you need this pin, you can adjust the display’s contrast. In practice,
to know (see Table 1). it turned out that simply connecting this pin to ground

Table 1
RS R/W Data Comments
0 0 00110000 Allows you to clear the display. It also moves the cursor back to the first character of the first line.
0 0 00000010 Will move the cursor back to the first character of the first line, but will not clear the display.
0 0 000001 I/D S Allows you to set the way that the LCD display responds to new characters that it receives.
The I/D bit allows you to specify whether you want the character position to increment or
decrement when you send it a character. The S bit allows you to specify if the whole line
should shift or if the cursor should move. Figure 2 describes how the display will act based
on the I/D and S bits.
0 0 001 DL N F 00 Allows you to set information about the LCD that the controller chip is connected to and how
you want to communicate with it. DL lets you choose between (1) an eight-bit interface or (0)
a four-bit interface. N lets you set the number of lines that the LCD can display. A 0 represents
one line while a 1 represents two lines. The F bit lets you specify either (1) a 5 x 8 pixel char-
acter or (0) a 5 x 10 pixel character. Most likely, the LCD display that you will be using will have
a 5 x 8 character.
0 0 01DDDDDD Lets you set the character generator address. Substitute the Ds for the address that you want.
The HD44780 allows you to specify eight custom characters, if you want. Their bitmaps are
stored in the character generator RAM.
0 0 1DDDDDDD Lets you set the display data address. The display data RAM holds the text or characters that
you want to be displayed on the screen. This data is the character codes and not the actual
bitmaps for the characters.
0 1 BF DDDDDDD This command switches the display’s input pins to outputs for as long as the E line is held high
and then makes them inputs again when the E line is brought low again. While these lines are
outputs, the BF bit tells you when the display is busy executing the last command. If it is high,
the display is busy and you shouldn’t send other commands to it until it is done. The remaining
outputs indicate the location of the address counter. This is how you could retrieve the
character codes of what is displayed on the screen.

SERVO 01.2005 9
Rubberbands.qxd 12/8/2004 8:40 AM Page 10

Rubberbands and Bailing Wire

provided the best contrast. The higher


Table 2 the applied voltage, the dimmer the
Steps RS R/W Data display was.
• Wait at least 15 milliseconds after power-up — — —
before doing anything. Making the Magic
• Send 00 00110000 by placing this data on the 0 0 00110000
output lines and then raising and then lowering
Happen
the E line. Before you can start to use the
• Wait at least 4.1 milliseconds. — — — display, you will have to initialize the
• Send the same command by raising the E line — — — HD44780 driver chip. You will have to
and lowering it again. send a number of commands. For
• Wait more than 100 microseconds. — — — each command, you will place your
• Once again, send the same command by — — — data on the eight-bit port and the RS
raising the E line and then lowering it. and R/W lines, raise the E line, and
• Send the function set command. 0 0 001 DL N F 00 then lower it again after a short delay.
• Wait for the command to finish by checking — — — Initialization can be done by following
the Busy flag or by simply waiting long enough. Table 2.
• Send the Display command. 0 0 00001DCB Your display should be initialized
• Wait for that command to execute. — — — now and you could go ahead and
• Send the cursor movement command. 0 0 000001 I/D S start sending ASCII character codes to
• Wait for that command to execute. be displayed. If you are using a one or
two line by 40-character display, then
Figure 3. Connections between a PIC and the LCD module. everything will work as
expected and the lines will
break as they should. The
display used in this column
broke each line up into two
lines of 20 characters, so
you have to be careful that
you don’t send more than
20 characters in a row or
else the cursor will likely jump
to a place where you don’t
want it.
Figure 5 shows the map
for the display used here. As
you can see, when the cursor
hits the end of the first line, it
will jump to the beginning of
the third line and — after it
reaches the end of the third
line, it will go to the second —
then the fourth. That’s not
quite intuitive. I’ll show you
how to more easily deal with
that a little later.
For now, let’s look at
how to send characters to
the display. Figure 6 shows a
chunk of C code that lets you
do this.
When sending any com-
mand to the display, the
procedure is to set up all of
your output pins and then
raise the E line. Although it
10 SERVO 01.2005
Rubberbands.qxd 12/8/2004 8:41 AM Page 11

Rubberbands and Bailing Wire

isn’t covered in the documentation, it


appears to be necessary to wait a few void lcdInit(int1 showCursor)
{// gets the display driver chip ready to display characters
microseconds to let the data settle before delay_ms(16);
lowering the E line again. After that, you will output_low(E);
need to wait until the display has processed output_low(RS);
that command. This is what the lcdBusy() output_low(RW);
routine is doing. Figure 7 shows the lcdBusy() portB = 0b00110000;
code, which will delay until a character or output_high(E);
command has been processed. delay_us(20);
You now have the ability to draw output_low(E);
delay_ms(5);
characters to the LCD. Let’s take a look at output_high(E);
the issue of the lines being jumbled and how delay_us(20);
you can specify where on the display you output_low(E);
would like to draw a character. Figure 8 delay_us(110);
shows code that will work for the display output_high(E);
delay_us(20);
being used in this column. You may need to output_low(E);
adjust the algorithm to match the display that delay_us(50);
you end up using.
Now, you have the ability to draw any portB = 0b00111000; // 8 bit operation, 2 lines, 5x8 character
delay_us(20);
character anywhere on the screen, but it can output_high(E);
be a little tedious to write the code to do it. delay_us(50);
This final example will show how — by using
the printf() statement — you can reduce what output_low(E);
if(showCursor) // send command for how the cursor acts
would be a long series of statements into just portB = 0b00001111;
one line. else
Every compiler works differently, but the portB = 0b00001100;
CCS C compiler for the PIC allows you to delay_us(20);
output_high(E);
specify a routine that takes eight-bit variables delay_us(50);
as the receiver of the data from a printf()
statement. This drastically simplifies the output_low(E);
task of writing to the display and allows you portB= 0b00000110; // move cursor to right, don’t shift
delay_us(20);
to do things like printf(lcdPutChar,”Button
output_high(E);
presses:%u”,presses); where you want to delay_us(50);
display numeric data. }

Dotting the I’s and Figure 4. How to initialize the LCD using C code.

Crossing the T’s Figure 5. Map of the LCD’s display.


Throughout the code presented here,
you will see statements like
output_high(E);. If you were to use this
code in a program, you would want to
stick the statements at the beginning of
your code (see Figure 10).

Figure 6. How to send a character to


be displayed.
void lcdPutChar(int8 theChar)
{
output_high(RS);
output_low(RW);
output_high(E);
portB = theChar;
delay_us(20);
output_low(E);
lcdBusy();
}

SERVO 01.2005 11
Rubberbands.qxd 12/8/2004 8:42 AM Page 12

Rubberbands and Bailing Wire

TECH TIDBIT void lcdBusy()


{// delays until LCD indicates that it is not busy
Wires are a major source of failure in electronic set_tris_b(0b11111111); // make LCD pins all inputs
projects. Wires tend to break off right where they are output_low(RS);
output_high(RW);
soldered to your circuit board. It is always best to try to output_high(E);
reduce the number of wires that will be necessary, but delay_us(10); // give the display some time to output
for wires that you absolutely need, here is a trick that while(input(BUSY))
{// do nothing
will keep them from breaking: Lay your wire against the }
board after it has been soldered. Using some E-6000 output_low(E);
glue — which can be bought at many craft, hobby, and set_tris_b(0b00000000); // make LCD pins all outputs
delay_cycles(2);
hardware stores — put a dab of glue over where the }
wire comes out of the board. E-6000 takes a while to
Figure 7. Code that waits until the display is done processing
dry, but — when it does — it is like hard rubber. the last command.
Attaching the wire to the board in this way makes it so
that any wiggling of the wire happens at a point where program will run on or maybe because you need to use a
there is insulation on the wire, which significantly peripheral that has its pins currently tied up by something
increases the longevity of the conductor inside. else in your program.
If you didn’t use the #define statement, then you would
have to go through your code and manually change every
Using #defines is a good way to program because it reference to that pin.
allows you to quickly rearrange your I/O connections if you Adding an alphanumeric display to your project has
need to. This can a certain cool factor to it, as well as an immediately useful
Figure 9. The first 10 lines and the be handy if you ability to instantly get feedback about what your robot is
printf statement do the same thing. are switching the doing internally.
LcdPutChar(‘L’); processor that your Overall, this is a relatively easy part to add to your robot
LcdPutChar(‘C’); and is well worth the effort.
LcdPutChar(‘D’); Figure 10. #define statements for the Next month’s column will cover
LcdPutChar(‘s’); various LCD pins. some more advanced things that you can
LcdPutChar(‘ ’);
LcdPutChar(‘r’); do with an LCD display that should be
#define E PIN_C0 // enable immediately useful to you — such as creat-
LcdPutChar(‘u’);
#define RW PIN_C1 // read/write
LcdPutChar(‘l’);
#define RS PIN_C2 // register ing your own characters, drawing bar
LcdPutChar(‘e’); graphs and sliders, and then using one
select
LcdPutChar(‘!’);
#define busy PIN_B7 // busy flag of the bar graphs to give you visual feed-
from LCD back about your robot’s battery’s voltage.
printf(lcdPutChar, “LCDs rule!”);
SV
Figure 8. Code to move the cursor to where you want it. Figure 11. Although not robotic, this
is a fun application that uses an LCD.
void lcdMoveTo(int8 line, int8 character)
{// move to the position on the display that was specified
int8 position;
if(line == 2 || line == 4) // If you want the second or fourth line
position = 0b11000000; // on the LCD, select the second line in
else // the driver’s memory.
position = 0b10000000;
if(line == 3 || line == 4) // If you want the third or fourth line
position += 20; // on the LCD, add 20 because these lines
position += character; // are actually the second halfs of the
output_low(RS); // driver’s two lines.
output_low(RW);
portB = position;
output_high(E);
delay_us(20);
output_low(E);
lcdBusy();
}

12 SERVO 01.2005
Full Page.qxd 12/9/2004 3:30 PM Page 13

Earn an Associate Degree


from HOME!
Cleveland Institute of Electronics
• Electronics & Computer Training Programs
• Nationally Accredited
• Affordable Tuition / Military Tuition Assistance

Cleveland Institute of Electronics offers distance learning CIE’s Distance Learning Programs
programs that will prepare you for rewarding careers in
• Electronics Associate Degree
Electronics Engineering or Computer Technology
- even if you have no experience! • Computer Associate Degree
• Basic Electronics with Lab
CIE's courses allow you to learn new technology at your
own pace, in your own home, without disrupting your • Advanced Electronics Troubleshooting with Lab
present job or lifestyle. • Electronics Technology with FCC Preparation
No prior experience is needed and you can do all your • PC Troubleshooting
training at home with full instructor support, extensive • Computer Networking
learning labs and on-line exams.
• Wireless Technology
They're fast, convenient, affordable and quickly • COMING SOON!
becoming the new way to earn an accredited degree. Industrial Electronics with PLC Technology
Send for your FREE CIE course catalog and take the
first step toward building a successful career in Cleveland Institute of Electronics
electronics and computer technology. You’ll find 1776 E. 17th St, Cleveland, OH 44114
it has many rewards!

Call (800) 243-6446 or visit www.cie-wc.edu for a FREE Career Catalog!

CD ROM & Certificate Training - CIE Bookstore


Introduction to Multimeters Introduction to Computers Soldering Course with Lab
2 meters • 4 lessons • 13 experiments 9 lessons • certificate 3 lessons • lab • video
02-069 (Pictured) cert .......... $195 01-IN01 ...................................... $195 01-SD01 (cert) ......................... $195

FCC License Prep Course Basic Electronics Course PC Board Design with Lab
19 FCC prep lessons on CD ROM. 39 lessons • 2 labs • 53 exercises 4 lessons • lab • CD ROM
01-FCC01 (cert) ................... $49.95 03-Introb (cert) ....................... $225 02-261 (cert) ............................ $195

Fiber Optics Course with Lab Oscilloscope Course Intro to Information Systems
2 lessons • Lab • Video • Certificate 7 learning topics • video 9 lessons • certificate
01-FB02 ..................................... $175 01-SCP01 (cert) ......................... $95 01-CET111 ................................ $195

FREE CIE BOOKSTORE CATALOG • www.ciebookstore.com • (800) 321-2155


Circle #82 on the Reader Service Card.

SERVO 01.2005 13
Geerhead.qxd 12/8/2004 8:44 AM Page 14

by David Geer
geercom@alltel.net

Mini metal muscle and brilliant


minds appear together in this
shot of the Mine Miner and its
designers: (L to R) Dat Truong,
project sponsor Carl V. Nelson,
Edoardo Biancheri, Dan Hake,
and Landon Unninayar.

Tiny, but Mighty!


Small Bot Saves Lives by Marking Land Mines!

Uncle Sam and Others Are Looking for a Few Good Robots
ast spring, four students at Johns zones around the world. back pictures of the target, which can
L Hopkins (JH, Mechanical Engineering
Department) completed a robot that
The bots, which can be built for
under $1,000.00 a piece (in produc-
be manually spray painted from the
controller and later neutralized.
can travel, locate metal objects, see, tion), traverse the grassy or jagged The little mine detective is in the
and spray paint. What’s the big deal? terra firma found in war zones like little welcome hands of explosive detection
With these capabilities, it becomes a two-part tanks. A metal detector — to scientists. They are using it as the
plausible solution for detecting and be replaced by top-notch sensors devel-
marking deadly land mines that are oped at JH — locates suspected land
* All photos are courtesy of Will Kirk. *
waiting underground in far away battle mines. The robot’s camera eye sends
14 SERVO 01.2005
Geerhead.qxd 12/8/2004 8:48 AM Page 15

GEERHEAD

model for an effective, inexpensive


solution to help circumvent the
24,000 mine deaths and maimings
that occur each year. (Over 100
million mines from as far back as
WWII surround the globe, still
undetected and fully capable of the
job they were initially planted for.)

Land Mine
Detection, Project
Inception Rugged bot mine detective finds its prey —
a metal target that represents a land mine —
The story began when John in a test demonstration.
Hopkins physicist Carl Nelson
presented the student engineers turned current demanded by the ones they did
robotics team with a problem. He had get was beyond the capacity of the
created these great new sensors targeted connectors. The team ended up This effective controller guides the robot
and receives video from its camera eye,
at detecting land mines, but he needed scrapping those motors and finding sounding the alarm when a metal object
an appropriate contraption to get the new motor and gearbox pairs. — possibly a mine — has been detected.
sensors through the brush, rocks, and
sand to the mines. The students were Robot Racer mines. The paint used to mark the spot
tasked with creating a mini-off-roading- where each mine is located is a very
all-terrain robot that could get to the With the “front vehicle” — more on light and, yet, a very easily recognized
mines without being blown up itself. that later — ready to go, the team tried
again. The new, high torque drill The eyes have it as the robot camera
enables the operator to have a glimpse
Robot Dud motors worked perfectly. The bot
of everything the bot itself sees.
zoomed around the lab, navigating all
On its maiden test run, the mine- terrains — including people’s toes. The
detecting bot looked more like one of its bot’s operator had the vehicle spin
exploding adversaries than a proponent of brodies like a racecar. The mini-tank-like
protection. When the student roboticists vehicle could spin in place at 60 RPMs.
first attempted to run the rascal via the The vehicle was detailed with an
joystick, they got no movement and a inverted cow catcher up front to move
load of melted connectors. obstacles out of its camera’s path. The
They found out that their supplier robot’s design was dictated by the
had shipped the wrong motors; the requirement that it not set off the land

CONSTRUCTION
The mine-detecting robot looks like product; it will be replaced by Professor feed can be received from up to 100
two robot tanks — one towing the other. Nelson’s specialized mine-seeking sensors feet away. The controller video screen
The front vehicle moves the bot by means in the funded research phase. can display real time images of what the
of its two cordless power drill motors, The rear vehicle also carries the bot sees. When the bot detects metal,
which are powered by a sealed lead-acid paint and paint nozzle for marking mine an alarm — a beep — sounds in the oper-
battery. This front vehicle is topped off locations. At this point, the mechanism ator’s headset. The operator must throw
with a color video camera, which lets the can only house enough paint to mark a switch on the controller to mark the
bot’s operator see what it sees. about 40 mines before it needs a refill — place where the metal detector reacted.
The rear vehicle carries the metal but that’s still four times the minimum The bot was constructed using plastic
detection coil that is used at this experi- requirement for the project. and other non-metal parts in order to save
mental phase to detect the land mines on weight, costs, and false positives from
(in this case, metal objects that are surro- Keeping a Safe Distance the bot detecting itself instead of the
gates for the mines themselves). This mines. The two part front and rear vehicle
detection device was scavenged from a A joystick controller steers the bot design spreads out the robot’s weight so
common consumer treasure hunting from up to 500 feet away. The video that it is less likely to set off a mine.

SERVO 01.2005 15
Geerhead.qxd 12/8/2004 8:50 AM Page 16

GEERHEAD

Tank-like treads enable mobility through tall grass, rugged terrain, and
any place mines may be laying in wait for their next victims.
The controller can steer the robot while operators
steer clear, up to 500 feet away. Video transmissions
reach out up to 100 feet from the bot’s camera. shade of yellow. constraints they had to work with.

RESOURCES Finishing Touches Lessons Learned


Low-res versions of pics in this article The young roboticists wanted their The type of laser cutter that Johns
and more at: machine to look as cool as it ran. The Hopkins made available for the
www.jhu.edu/news_info/news/ students chose an all-black construc- mechanical engineering class and the
home04/jun04/mines.html tion and appearance (where possible). Polycarbonate that was being used did
and They worked diligently to cut and not mix. The combination created
www.jhu.edu/news_info/news/ attach black acrylic sheets on the chlorine gas.
home04/jun04/mines2.html back where there were still some clear One of the young engineers
panels showing. discovered the hard way how easy it is
Robotic Mine Detector, Project Video at: The roboticists also machined all to have drill bits break on you and have
www.jhu.edu/news_info/news/ the applicable parts themselves. The the pieces come flying at you, hitting
audio-video/mediamines.html four shared in the cutting, drilling, you in the forehead.
gluing, sanding, mounting, and CNC The roboticists also suggest that
Johns Hopkins Department of programming for the project. anyone engaging in similar projects test,
Mechanical Engineering at: Maintaining this added project control break, rebuild, test, break, rebuild, and
www.me.jhu.edu gave them an edge in creating exactly repeat until not broken; this is the best
what they wanted within the time way to find your path to a solution. SV

TIDBITS
Yes, the four robotics engineers in prototype to US Army funding sponsors that meet all the specs they needed to
this story have names; all but one have to establish how an inexpensive mine- meet. So, the team set out to design and
graduated now. Landon Unninayar, Dan detecting bot could help prevent death test their own. They started by looking at
Hake, and Dat Truong were seniors and dismemberment from land mines both Polycarbonate and soda bottles.
working on this project before gradua- around the globe. Ultimately, a Polycarbonate bottle was
tion. Edoardo Biancheri planned to found that would fit all constraints.
have completed his undergraduate Challenges The only remaining spec was the
studies in December ‘04, with a double pressure test. How did they test it? They
major in mechanical engineering and Building a life saving bot is not a filled it with water, suited it up with gas
economics. goal without its obstacles. The biggest fittings, and pumped it up with a bike
These young men were tasked with one the crew reported was making a pump until it started to leak. At first,
building this successful bot project for pressurized paint sprayer out of almost leaks came from the pipe fittings. Then,
under $8,000.00; they did the job with 100 percent plastic materials. The those leaks were fixed and the cap
about $5,000.00 and believe it could be requirement included being able to broke off the bottle and shot out about
mass produced for under $1,000.00 — mark at least 10 mines before the 60 psi of water. Once they dealt with
less the cost of better sensing. Professor sprayer went empty. the weaknesses in the cap, the paint
Nelson will soon have demonstrated this There are no commercial sprayers container was complete.

16 SERVO 01.2005
Gray4.qxd 12/8/2004 8:27 AM Page 17

by Thomas Gray and J. Wolfgang Goerlich

T his is the final article in “BEAM Robotics Step-by-Step.“


During this series, we have touched on some of the
central themes in the BEAM (Biology, Electronics, Aesthetics,
Turbot is upside down.
A Turbot can maneuver in much the same way as a
walker can. It can turn on the spot, climb up and over
and Mechanics) design philosophy: obstacles, and traverse rough terrain, yet it only requires two
motors. Since motors cost a lot and draw a lot of power,
• Keep it simple; minimize everything from cost to part count fewer motors mean lower cost and longer battery life.
to power consumption. Also, the mechanics of a Turbot are simpler than those of a
walker and do not require much balancing or tweaking in
• Use basic circuits to simulate biological nervous systems order to work properly.
and pattern generators. Simple and low power, cheap and versatile — classic
BEAM!
We designed this final robot to illustrate these ideas
while tossing in a couple more BEAM bits. Step 1: What’s Nu?
Walking and Tumbling The Nu (pronounced “new”) Neuron looks like a Nv
Neuron with its resistor and capacitor mixed up. See Figure 1
At one time or another, every kid has spent an afternoon for a side-by-side comparison. There’s nothing to it, but —
poking and prodding insects. It is amazing how bugs move as with so many BEAM circuits — the resulting change in
around, handling rough environments. behavior exceeds the minor part change.
Walking robots — especially quadrupeds and hexapods — When we say that the Nv Neuron is “nervous,” we
can handle rough terrain better than wheeled or tracked vehi- are being a bit cheeky. The Nv Neuron is an edgy neuron,
cles. However, while there have been great improvements in trigger happy, and all the other silly puns. The Nv Neuron
walking robots, they still lag far behind the tough-shelled immediately sends an output pulse when an input impulse
bugs! comes in. There’s no waiting around — the Nv Neuron
One particularly tough problem faced by walking fires immediately, holds the output for a time, and then
robots — whether they are BEAM
or microprocessor driven — is what to Figure 1. Comparison of the Nv and the Nu Neuron.
do when they fall over. A unique type
of BEAM robot called the Turbot has
no problem being inverted because it
spends half its time upside down! A
Turbot moves by flipping itself using
rotating flagella instead of legs. A
Turbot doesn’t exactly walk; it scoots
and tumbles.
It’s a bit tricky to give a Turbot
directionality (having it head toward a
light, for example) because — every
time the bot flips over — the motors are
effectively reversed and a different side
will be facing the light. What we will
need, then, is a circuit to decide which
way to go (“Which way is brighter?”)
and another circuit (“Which way is
up?”) to invert the decision when the
SERVO 01.2005 17
Gray4.qxd 12/8/2004 8:29 AM Page 18

BEAM Robotics Step by Step — Part 4

Figure 2 shows the schematic for a single Nu. The first


part of this circuit is the Process Initialization Circuit from
the first article in this series. We have also added an
indicator LED to show what’s going on. Breadboard this
circuit (Figure 3) and try different resistors and capacitors.
Be sure to try the circuit without the 100K (1K in the
photo) pull-down resistor. Add an Nv to trigger the Nu or
take the first Nu to another neuron and see how they
work in chains.
Play and have fun. Uh, we mean experiment and gather
data.

Figure 2. Nu with indicator LED and PIC. Step 2: Muxing Around


shuts down. Often, it is helpful to be able to reverse a Nu or Nv
The time period is determined by the Nv’s RC Time output, in order to change the motion of a robot. To do this,
Constant. Again, this sets the time in seconds equal to the we will use a gadget called an Inverting Multiplexor or IMx
resistance in megohms times the capacitance in microfarads. (pronounced “eye-mux” or just mux) that can be built with
one half of a 74xx240.
T=RxC For our Turbot, this means that we can stick the entire
4.7 seconds = 1 M x 4.7 µF circuit on a single IC chip, keeping the parts count down and
keeping life simple.
The Nu or “Neural” Neuron waits a bit before deciding In Figure 4, Enable (A) is the enable line, which is
to switch. It receives a high input signal, waits around for a normally held high (off) in this case by the 100K resistor,
time period (again determined by its capacitor and resistor), but can be sent low (turned on) by a push-button switch.
then turns on and stays on until the input goes low again. If Input (B) normally comes from some neuron output; the
the Nu does not receive a low reset signal to its bias point, it 470 Ω resistor holds the input high through the LED. If A
will stay active. is high, then the inverter is turned off; the signal (B) is
Basically, you are charging a capacitor through a resistor. passed through R1 to the Output (C) via the output LED.
The capacitor takes time to charge up — again determined by In this case, C is the same as B and both LEDs glow. Push
the RC constant. When the capacitor’s charge passes the the button to set A to low, though, and the inverter turns
’240 switching threshold, the inverter will flip and send a low on. Since the resistance of the inverter is less than R1,
pulse. The Nu is said to be active. When the Nu input the inverted signal takes this path and the output is the
changes to Gnd, the inverter flips back to high and the Nu opposite of B. The input LED remains on, but the output
is inactive. LED goes out.
The IMx acts as an Exclusive Or (XOR) gate. Some BEAM
Figure 3. The Nu on the breadboard. A 4.7 mF electrolytic robots will use an XOR chip to get the same results. The
capacitor (watch polarity) and a 1M resistor give a delay Solarbotics Scout Walker, for example, uses two gates on a
of about 5 seconds.
4030B quad-XOR chip.

Step 3: Putting the Pieces


Together
Figure 5 shows the Tumbler schematic. If you study the
photos, you’ll see indicator LEDs that have been left off the
schematic for simplicity. However, previous articles have
shown where these LEDs go and you are welcome to add
them to your project. The diagram shows a 74HC240 for
power efficiency, but a 74AC240 works just as well.

A LITTLE BIT OF INFO


Mark Tilden built the first Turbot after being inspired
by Alan Turing’s state machines (Turbot = TURing + roBOT). A
couple of his delightful solar-powered Turbots are shown in
Figure 10 (photo courtesy of Solarbotics, Ltd.).

18 SERVO 01.2005
Gray4.qxd 12/8/2004 8:30 AM Page 19

Tumbling Turbots

Pace-maker:
A Bicore, which we looked at briefly last month, sets the
pace for the Tumbler. The grounded Bicore is an oscillator
that sends regular pulses. The timing of these pulses is based
on the RC constant of the Nvs. If the resistors and caps are
well matched, the Bicore will have a 50:50 cycle. Remember
that the two outputs of a Bicore are complementary: when
one half of the Bicore is positive, the other side is negative,
and then they switch.
The optimal timing of your bicore will depend on your
motors. Wolf used 6.8 µF caps, a 3M resistor for the tumble
phase (RX), and 1M for the reset phase (RY) with his
Solarbotics GM3s. Tom used 0.22 µF caps and 10M resistors
on a prototype (not illustrated) that used video lens motors
from BGMicro. Different timing will give different results and Figure 4. Inverting Multiplexor (IMx).
much of the fun is in training your own bot to give its best
performance. becomes active (goes low). Now, things start to get
The output of Nv(2,18) is fed to the bottom of a interesting.
reverse-biased photodiode voltage divider, used in the The high pulse from Nv(4,16) is fed to the Nu decision-
first article of this series (August
2004 issue of SERVO, page 10). Figure 5. Tumbler Turbot schematic.
This PD divider determines
whether the top or the bottom
side is brighter. Running the
photodiode divider from the
pacemaker instead of from
ground means it is turned on
only when needed.
The output of Nv(4,16) runs
to the decision circuit that deter-
mines whether the left side or the
right side is brighter. Again, it is
turned on only when needed.
This gives us a Turbot that
repeatedly ponders two deep,
existential questions: “Which way
is up?” and “Which side is
brighter?” AI, BEAM style.

Decision:
A Nu, as we saw earlier,
needs a high input signal to
activate. When Nv(4, 16) is
active, it sends a low signal to the
Nus. Nothing happens.
At this time, Nv(2, 18) will be
inactive because only one Nv in a
Bicore can be active at a time.
The Nv sends a high signal to the
photodiode voltage divider. Since
both sides of the voltage divider
are high, the mid-point is high
and the signal sent to the IMx
is also high. Again, nothing
happens.
After a while, Nv(4, 16) times
out (goes high) and Nv(2, 18)
SERVO 01.2005 19
Gray4.qxd 12/9/2004 1:07 PM Page 20

BEAM Robotics Step by Step — Part 4

like an inhibitory neuron.


FP Whichever Nu decides to fire first is
PP
the only one that can fire during
PP
the current Bicore cycle.

ƒ  XOR IMx:


PP At the same time that the
PP Nus are deciding which side is
FP brighter, the Turbot is deciding

$OOKROHVGLD PP which side is up. We are driving the
FP
enable line using the same
Photodiode setup used in the
Bare Bones Photovore. Two reverse-
biased photodiodes form a voltage
divider at roughly Vcc/2. More
FP
light on one photodiode raises or
ƒ lowers the output voltage of the
PP divider. In the Tumbling Turbot, this
output is fed to the enable pin of
FP
Bank B.
FP Nv(2,18) connects to the
FP ground side of this voltage divider.
When Nv(2,18) is inactive, the
Figure 6. The chassis plan. Use Sintra or PVC. divider is high and the IMx is
disabled. The divider is grounded
makers via the LDR. The brighter LDR with the lower when Nv(2,18) is active. The IMx’s state depends upon which
resistance will have the shorter delay, so it will turn on (go Photodiode is receiving more light. The Turbot can then make
low) first. A diode feeds this low signal to the bias point of the “Which way is up?” decision.
the opposite Nu, immediately turning it off. This ensures that When the Turbot is right side up, we want the Nus to
only one motor is affected. directly drive the appropriate motor. The bottom PD will be
Let’s say the right CdS is brighter. Nu(8,12) will have the dark and the top will be light, so the enable gate will be high.
shorter delay. It will fire first, its output will go low, and: The IMx will not be triggered. The active Nu input is passed
right on to its motor drive transistor, turning the Turbot to
a) It kills the pulse in Nu(6,14). one side.
b) It passes a low pulse to the IMx. When the Turbot is upside down, we want the Nus to
c) It remains low until the Nu is reset when the Bicore switches. drive the opposite motor. The top PD will be dark and the
d) Only the motor connected to this Nu will run. bottom light so the enable gate is pulled low. The IMx
triggers and inverts the Nu inputs. This means that the active
Touching back on biomimicry, this cross-wired design is Nu signal is turned off and the motor on that side will not

Figure 7. Assembling the Tumbler: autopsy photo. Figure 8. Photo of Tom’s prototype.

20 SERVO 01.2005
Gray4.qxd 12/9/2004 9:24 AM Page 21

Tumbling Turbots

run; on the opposite side, the inactive


Nu signal is reversed so that its motor
does run.

Step 4: Building the


Tumbler
Check out Wolfgang’s take on
the tumbling Turbot. He’s used Sintra
for the top and bottom shells (like a
turtle) and wire ties to hold down
the motors at an angle of about 120
degrees, as shown in Figure 8. (You
can try anything from 90 to 180
degrees. Different angles give
different patterns of movement). He
has also added some non-skid rubber
matting so the shell grips the floor
during tumbling.
The batteries and perfboard are
neatly tucked inside. The flagella
are brass welding rods (try old coat Figure 9. Photos of Wolf’s finished robot.
hangers — they’re easy to get!) held
to the motor shaft with European-style terminal blocks A LITTLE BIT OF INFO
removed from their plastic casings. A little heat shrink tubing
on the ends of the flagella (one flagellum, two flagella, isn’t Check these websites for more BEAM projects and information.
he a clever fella?) keeps them from scratching the floor, Photographs of Mark Tilden’s Turbots:
walls, or domestic livestock as they flail around. www.solarbotics.net/gallery/Turbots

Solarbotics BEP Turbot:


ABOUT THE AUTHORS www.solarbotics.com/resources/static/bep/bep5_turbot.php
Tom and Wolfgang connected online at http://groups. Grant McKee’s Turbots:
yahoo.com/group/beam/ and hope someday to meet face- http://grant.solarbotics.net/Turbots.htm
to-face for coffee and conversation or perhaps a friendly
Brett Hemes’ Solar-powered Turbot:
mini sumo match. http://breadboard.solarbotics.net/misc_03.html

Circle #118 on the Reader Service Card.


SERVO 01.2005 21
Gray4.qxd 12/8/2004 8:34 AM Page 22

BEAM Robotics Step by Step — Part 3

will flop its way into a pool of light. Be patient and swap the
motor connections until you get it right.

Conclusion
In this series of four articles on BEAM, we aimed to
give you an introduction to the simplicity-within-complexity
of this approach to robotics and a chance to create some
fascinating little robots with relatively simple circuitry.
If you have tried these projects and enjoyed them, experi-
Figure 10. Mark Tilden’s Turbots, courtesy of Solarbotics. mented with them and extended them, or developed an
interest in going deeper and learning more, then we’ve
When you build your Tumbler, it may take a few tries to succeeded.
get the motors hooked up properly. You’ve got a one-in-four As Tom signs all his BEAM posts, “Keep BEAMing and
chance of hitting it the first time. What you want is a bot that dreaming.” SV

PARTS LIST
Electronics
74HC240 Texas Instruments SN74HC240N Digi-Key 296-4305-5-ND
(74AC240 in a pinch) Fairchild MM74HC240N Solarbotics 74HC240
Solarbotics 74AC240
Photodiodes Siemens SFH 205f wide field Solarbotics IR1
Asst. LEDs Red, green, or yellow LEDs Digi-Key 350-1347-1-ND
(We use standard LEDs on the breadboard Digi-Key 350-1348-1-ND
and tiny LEDs in construction.) Solarbotics TLED
Resistors 4- 470 Ω, if desired, for indicator LEDs See text for details
and a few in the 1M – 10M range
Capacitors Assorted, 0.1 µF to 6.8 µF range See text for details
If electrolytic or tantalum caps are used,
observe polarity.
CdS Photoresistor Any of various types should work. Solarbotics CDS
Try for a matched pair.
PNP Transistors 2N2907 or 2N3906, for example RS 276-2032 or RS276-2034
Solarbotics TR2907 or TR3906
Diodes Two small signal diodes, RS 276-1122 or 276-1620
e.g., 1N914 or 1N4148 Solarbotics D1
Perfboard Perfboard or project board Solarbotics BEP BB1
RS 276-0050 or RS 276-1395

Mechanics
Motors Two matched hobby gear motors Solarbotics GM3
6 V Power Two AAA battery packs or one four-AAA RS 27-411 includes switch
battery pack (You can use four-AA, if you RS 27-413 x 2
wish. The AAAs are lighter and smaller.) RS 27-398 x 2
Solarbotics BHoldAAA x 2
Power Switch SPST toggle power switch RS 275-325
Use a slide switch, if you prefer. Solarbotics SWT2
Flagellum Connectors Euro-style terminal blocks RS 274-679
(get the smallest ones)

Misc.
Breadboard Generic solderless breadboard and ties
Body Use 3 mm Sintra or any suitable material Solarbotics
Wire ties Any hardware store
Flagella Brass welding rod or old coat hanger
Heat shrink tubing Or rubber tubing / model aircraft fuel tubing

22 SERVO 01.2005
Samans.qxd 12/8/2004 7:55 AM Page 23

I n his landmark 1984 novel,


Neuromancer, William Gibson wrote of
a space station — he called it a “cluster”
receives audio from my PC (or any
source), an upgraded stereo speaker
system, and an onboard stereo amplifier.
RoboSapien PC
Control Set-up
— known as Zion. One of the character- Using commercially available software
istics of Zion that always interested me and a USB infrared transceiver, I have The PC control scheme I made for
was its omnipresent music. Gibson also designed and implemented a RoboSapien uses MainLobby software
writes that his protagonist, Case, customizable PC control interface. from Cinemar. The central, circular con-
boarded Zion and, “gradually became The result is an audio visual “rover” trol button cluster controls movement
aware of the music that pulsed that can be controlled via PC and over and leaning. The identical circular con-
constantly through the cluster. It was the Internet from a remote desktop. I trol button clusters in the top corners
called dub, a sensuous mosaic cooked can connect to the robot from control each arm (up, down, in, out,
from vast libraries of digitized pop.” anywhere and walk him around the macros for all the way up, all the way
I first read Neuromancer in the late house to check on the surroundings. down, all the way in, all the way out,
1980s when I was in college and was Of course, I mainly use him and his and arm reset). Three small buttons
also discovering Jamaican dub — spacey, hi-fi stereo backpack to fill my own run along the inside curve and are
effects-laden instrumental versions of space station with “Zion dub.” macro buttons that can be assigned to
reggae songs. To me, it was
the perfect soundtrack for My dogs despise RoboSapien, especially since Here’s the 1 watt mono amplifier that I used
Gibson’s futuristic vision. I was I use it to keep tabs on them when I am away in the early stages of the project. For the
hooked and, today, my collec- from the house! This image is captured from final project, I used a circuit based on the
RoboSapiens’ own camera. stereo Phillips TDA7053A.
tion of Jamaican dub records
numbers in the thousands.
What always intrigued me was
how to make this music
omnipresent ... until I thought
up this RoboSapien hack.

The Hack
My RoboSapien hack has
several different components:
audio, video, and control. I
have outfitted the robot with
a wireless camera, a radio
frequency receiver that
SERVO 01.2005 23
Samans.qxd 12/8/2004 7:59 AM Page 24

SERVO Magazine Hack-a-Sapien Contest Winner

IR sensor. After you plug in the the MainLobby application used to


USB-UIRT for the first time, make interact with Girder.
sure to install the latest drivers.
Girder is Windows automa- Set-up:
tion software that is very popular So how do we get all these pieces
with the HTPC crowd. It can be setup and communicating with each
complicated and has a steep other? The first thing is to make sure
learning curve, but — in terms of that the USB-UIRT, Girder, ML Server,
depth of control and raw power and MainLobby are all installed and
— it is the best thing out there by running on your PC.
far. We are going to use it
primarily to learn, organize, and Girder Set-up and Configuration:
store the IR commands from the Go to File -> Settings -> Plug-ins tab
Here’s the early prototype of the RF receiver
with a RadioShack mini amplifier/speaker. RoboSapien remote and then exe- and make sure that the “Internet Event
Great backpack, horrible sound quality. cute them by pressing a button in Server” and “USB-UIRT driver” plug-ins
the MainLobby interface. are installed (checked). Also make sure
whatever I have programmed in Girder. As stated, another extremely useful that the “Auto Enable Input device”
Unlike the RoboSapien, Girder places feature of Girder is the ability to box is checked. Click “apply” and then
no limit on the number of steps you program macros (called “multigroups” click “OK.” You should now be back at
can put in a macro. in Girder) with unlimited amounts of the main Girder screen and the light in
The following is a detailed “how steps. We are really only using a fraction the bottom right corner should be
to” on setting up a skinned PC interface of the software’s capabilities; you can green (this means the plug-ins are
to control RoboSapien using the also use Girder to control your PC via IR enabled and operational). If it is not
USB-UIRT IR transceiver, Girder, and remote, to send and receive serial green, try going to File and choose
MainLobby. This information was commands, and a million other things. “Enable Input Device(s)” or hit F9.
originally published by me in the MainLobby is made by a company Now that the plug-ins are set up,
forums at RoboSapien.tk called Cinemar and is designed to be let’s teach Girder a RoboSapien
I used the USB-UIRT as my IR trans- an HTPC (home theater PC) front command. Go to File -> New. In the
ceiver. I don’t think it is the cheapest end. It allows you to create a custom large, white area on the left, right click
option, but I had an extra one laying graphical user interface (GUI) with and choose “Add command.” A folder
around. The creator, Jon Rhees, hand buttons that you can set up to launch named “New” and a command named
makes them and provides excellent programs, execute files, trigger events “New” will be created. Select these and
support; the device is also pretty much in Girder to send IR commands, and so right click to rename them. The folder
custom made to work with Girder. If on. It is entirely skin-able, so the sky is is what’s called a “group” and is used
you are just going to use it with the the limit in terms of graphics and the to organize commands. Let’s rename it
RoboSapien, the base model will do; design is accomplished via an easy as “arm commands” and use it to store
however, if you also want to use it to drop-and-drag interface. all of RoboSapien’s individual arm
learn IR from a lot of stereo and home For this project, I am using the trial movements. Select the command, right
theater components, you need to get version of MainLobby and I just used click, and rename it “R arm in.”
the version with the additional 56 kHz buttons and a background from the While it is still selected, look in the
included libraries. It will be top right and select “Internet Event
The wireless camera installed in chest cavity. If you fun to design RoboSapien- Server.” Click on the learn button and
weren’t looking for it, you probably wouldn’t notice themed setups. ML Server is enter an event string — for example,
it. Of course, the fact that you are being followed
by a robot would probably make you suspicious. “rarmin.” Notice that there is
The ZT-802 mini wireless camera. a new item underneath the
command called an “Event
String.” This is the command
that Mainlobby will send to
trigger Girder to send out the
appropriate IR command.
Click “OK.” Now, make
sure the “R arm in” com-
mand is still selected and, in
the bottom right, choose
the “Plug-ins” tab. Select the
“USB-UIRT driver” in the list
and then click on “Settings.”
24 SERVO 01.2005
Samans.qxd 12/8/2004 8:00 AM Page 25

SERVO Magazine Hack-a-Sapien Contest Winner

A USB-UIRT driver window will pop up; up Windows Explorer and find the file
click on the “Learn ...” button. Another gireventlib.dll (it should be in the folder
window will now come up and await C:\Program Files\girder) and copy it to
the IR signal. Take RoboSapien’s your C:\Windows\system32 folder.
remote and point it at your USB-UIRT Alternatively, you can add the file to
then continue pressing the right arm your path. Select Option on MLServer
up button until it learns the command and choose hide to send ML Server to
and returns you to the USB-UIRT driver the system tray.
window. I know that the instructions in
the window say to HOLD the button on MainLobby Set-up and
the remote, but RoboSapien’s IR isn’t a Configuration:
constant signal (it is a burst), so you With MainLobby open, go to the
might have to hit the “Accept Burst” top of the screen to bring up the menu.
button if it will not fully learn. Select options and hit the “Girder”
Now that you are back at the USB- button at the left. Setup both the
UIRT driver window, point the USB-UIRT Girder.exe location and the Internet
at RoboSapien and hit the “Test” button Event Server (ieventc.exe) location on
to make sure that the command was your hard drive. They should both be in
learned successfully. If not, relearn it. the main Girder directory.
Also pay attention to the “Repeat” box. Click on the “Scene” button on the RoboSapien with the RF receiver PCB
You will want to set this to 1 in most left. Notice that this is where you prior to installing it inside his back cavity.
cases, so that Girder only sends the choose your background skin, any
command once — unless you want it to animated effects, and so on. Click the down list in the “MLServeCmd” Panel,
send the IR command multiple times. “OK” button in the bottom right to exit choose “MLGirder.” This will populate
For example, I have commands setup to the Options screen. the following statement in the box:
move the arm all the way up, all the way Now, move your mouse to the top “MLServeCmd.MLGirder|.” Add the
down, all the way out, and all the way menu bar and choose design mode. Event String you created in Girder for a
in; these utilize the repeat function. Click “Add” to add a button; any particular RoboSapien command to the
Congratulations! You have taught button shape will do for now. You can end of this statement. Using the com-
Girder the first RoboSapien command. load custom buttons of your own or hit mand we created earlier, the box would
Repeat the above steps for each the “Library” button to choose from read “MLServeCmd.MLGirder|rarmin.”
command on the remote and organize those included with MainLobby. You can now test it via the test
them in groups as you see fit. Once you see the button appear on button to make sure it works or press
One other thing worth mentioning your background, you can drag and “OK” and test it from the button’s prop-
in Girder is “multigroups.” These are drop it wherever you like. Hit the “Edit” erties panel. Click “OK” when finished.
macros; you can take any girder com- mode button in the top menu bar and You should now be able to choose
mand you have created, right click on it click on the button you just created. A “Launch” from the top menu bar, click
to copy, and then paste it into multi- screen with tons of options will open up. on the button you created, and make
groups. String together unlimited com- Here, you can customize your button. RoboSapien bring his right arm in.
mands, but keep in mind that you might In the “MLServeCmd” area at the Repeat the above steps in
have to mess around with some more bottom, click on the “A” button. A new MainLobby for each button you wish
advanced settings to get the timing right window will pop up. From the drop to create.
when using RoboSapien’s combina-
tion or attitude moves. Don’t forget The wireless camera installation The RadioShack mini amplifier/speaker gutted.
to add an event string for them so from the inside. Oddly, it made me hungry for doughnuts.
you can call them from MainLobby.
Once you have your IR com-
mands learned into Girder, save
your file, and then click File-> close
window to send Girder into your
system tray.

ML Server Set-up and


Configuration:
Open up ML Server and make
sure that “MLGirder” is listed in
the plug-ins at the bottom. Open
SERVO 01.2005 25
Samans.qxd 12/8/2004 8:12 AM Page 26

SERVO Magazine Hack-a-Sapien Contest Winner

from my PC. This ties in nicely that works like a charm. Now, there
with the PC control scheme. was more than enough volume, but I
I gutted an inexpensive set realized that the speaker was subpar.
of Emerson EHP1000 wireless The solution was found in a set of
(RF) headphones. Initially, I just 10-year-old, unamplified Sony
stuck the circuit board in the Walkman speakers I had laying around.
little slot behind RoboSapien’s The speakers are each 8 Ω, 0.2 W, so I
head. I did not want to make a wired them in series. This made a real
more permanent decision until improvement in the sound quality. The
I could install a camera. This new problem was that the speakers are
allowed me to transmit sounds pretty big — 2.5” by 3/4” thick — plus
played on my PC to the a 9 V battery and two AAA batteries in
RoboSapien speaker. the mix, the amplifier PCB, and the RF
MainLobby lets you assign headset PCB. Obviously, I needed to
multiple events to each control house all this hardware in some sort of
button, so I can press one a backpack/project box.
button in the MainLobby GUI Building the project box was an
and it will send an IR command issue. All of the boxes at RadioShack
to RoboSapien and play an were either too big or too small. I tried
MP3 file. With the wireless a plastic box that housed a set of
set up, it plays this sound hobby knives. I liked the size, but it was
through RoboSapien’s speaker. too shallow for all the boards and bat-
RoboSapien now says whatever teries. While searching, I came across a
The finished RF receiver hack. The project box
includes a stereo amplifier, batteries for the cam- MP3 I send to him, plays music, decent little mini amplifier/speaker. It’s
era and the amplifier, an on/off toggle for the etc. a nice little package — about the size of
amp with LED indicator, volume control, and The possibilities are interest- a handheld transistor radio. It’s 200
inputs for both Robosapien’s native voice (mono) ing. You could set up separate mW and drives a 16 Ω, 0.5 W speaker
and the RF receiver output (stereo). The toggle
and indicator LED behind the head are for the RF control schemes for — a perfect robot backpack.
receiver, which is concealed in his back cavity. RoboSapien with separate Using a couple of lids from tin
sounds. For example, with a espresso boxes, I rigged up an enclo-
RoboSapien RF Sound custom themed GUI created in sure for the RF amplifier and the AA
MainLobby, you could create a football battery pack. I then Velcroed it
Mod RoboSapien, programmed to dance, all together and attached it to
The next step in my Zion replica- play the fight song of your favorite RoboSapien’s back. It’s very secure and
tion with RoboSapien was to develop a team, cuss at the refs, cheer for individ- it works pretty well. I needed to shield
modified sound system. The original ual players, whatever you want. his upper body motors; they caused
concept was to use the RF receiver Once I got into this hack, I found some interference. I’m still not really
from a set of wireless headphones so that I had a real problem with amplifi- very happy with this mod; although it
that RoboSapien could play MP3 music cation — more specifically, the lack of works as intended, it’s just okay.
files and, for that matter, any sound it. I am a total newbie when it comes Once I had decided that I needed
to electronics, so — when I to house all of the RF equipment and
RoboSapien at night with his new lighting system. hooked this up — I basically improved speakers “off site” from
just plugged the RF trans- RoboSapien, I wired up a toggle switch
mitter into the headphone on the robot’s back that turns off his
jack on my PC speakers and internal speaker. I found I was missing
hooked up the RoboSapien his “caveman talk” — which I found
speaker to the wires that quite strange. I ran a set of wires out of
were used for one of the RoboSapien to hook up his internal
headphone speakers. The sounds with the external setup,
volume was adequate although I am not really sure now that
through the RoboSapien they are needed. I left them because I
speaker (slightly lower than figure any backpack arrangement will
the default RoboSapien end up blocking his internal speaker.
voice) if I have the volume Now, the Sony speaker system
turned all the way up on my sounds fantastic and plays both the RF
PC. To solve this problem, I receiver input (in stereo) and
added a 1 W amplifier RoboSapien’s native voice (in mono).
26 SERVO 01.2005
Samans.qxd 12/8/2004 8:13 AM Page 27

SERVO Magazine Hack-a-Sapien Contest Winner

It’s pretty much the coolest MP3 boom- Before you start cutting
box ever! up RoboSapien, though, it
At this point, there are still a few is a good idea to test the
loose ends that need to be tied down: camera to not only make
sure it works, but to make
•I am using industrial strength Velcro sure you are happy with the
to hold the speakers on RoboSapien quality and with the set-up.
and the project box on the speakers. It Plugging it into a TV or VCR
is pretty heavy. I will need to come up probably isn’t as much fun
with a better solution to attach it — as plugging it into a PC that
maybe bolts or pegs of some sort. can control RoboSapien and
record the images.
• The weight of the speaker system The camera lens is
slows down RoboSapien’s walking 0.5”, so that’s the hole size
speed. This isn’t such a bad thing, as it we need to drill in
helps to stabilize him and make the RoboSapien’s chest. He’ll I see London, I see France, I see RoboSapiens’
wireless camera feed less jittery. probably have nightmares headlamp underpants!
about the drill for a long
• The amplifier eats through batteries time to come. I tried using smaller Finally, I felt it was the most aesthetically
pretty quickly. holes, but the result wasn’t as good as pleasing place for the camera.
letting the entire lens come through Here are a few notes on drilling
• I need to make longer patch cables the RoboSapien shell. It also looks the hole: Make sure you take your time
so that the entire “backpack” can be nicest when the camera lens is flush and go slow; once the hole is there,
removed once RoboSapien reaches his with the robot’s chest. you can’t easily fix it. I started with a
destination. I made them a little too I chose the center location in his 1/8” drill bit and drilled in the center
short. chest for several reasons. One, it is the point on his chest, right where his
spot where his chest cavity is widest. “cleavage” meets his black “throat
RoboSapien Camera Also, it is the furthest point away from piece.” Once this hole was made and
his arm and waist motors, so interfer- cleaned up with a hobby knife, I moved
Mod ence is kept to a minimum. I didn’t even to a 1/4” drill bit; I enlarged it and
Next, I decided to install a miniature need to shield his motors. This spot is again smoothed the edges with a
wireless camera in my RoboSapien. also one of the more stable points on hobby knife.
Thanks go to RoboSapien.tk for the the RoboSapien and — since it is dead Finally, it was time for the big
initial idea. Some people have installed center — it shouldn’t affect his balance. daddy — the 1/2” drill bit. This made a
a similar camera into the robot’s head.
This is great, since the head turns when
you raise and lower the arms and you
can pan the camera around. Getting
the glued head assembly apart is
:HERWV
)DVWSURWRW\SLQJ VLPXODWLRQRIURERWV
extremely difficult, so I went for the
easier solution: I installed it into 7KHFKRLFHRIXQLYHUVLWLHVDQG
RoboSapien’s roomy chest cavity.
For this project, I used a small
UHVHDUFKFHQWHUV
“ZT-802” type RF mini camera. They ZRUOGZLGH
are easily found on www.eBay.com It
will transmit both audio and video. The
actual camera is about the size of a
sugar cube and fits very nicely in
RoboSapien’s chest cavity. The receiver
has composite (RCA style) outputs that
you can plug into a TV or a tuner card
in your computer. I build HTPCs as a
hobby and swear by the Hauppauge
WinTV PVR-250. It works great with
this mod, since it provides the ability
to record the audio and video (or
snapshots) on your PC.
ZZZF\EHUERWLFVFRP
Circle #114 on the Reader Service Card.
SERVO 01.2005 27
Samans.qxd 12/8/2004 8:14 AM Page 28

SERVO Magazine Hack-a-Sapien Contest Winner

done. If you have other mods that


are taking up space in the chest
cavity, you may need to secure the
battery cable connector inside; it’s
pretty bulky, but I just let mine lay
where it wanted. One thing this
mod showed me was that there is a
ton of space inside the chest cavity.
The MainLobby configuration menu.
Lights, Camera,
mess because the plastic is so thin fit it exactly how you want it before you
(comparatively) and required a lot of even plug in your hot glue gun. Action
the old “in and out” with the drill to Apply the hot glue to the piece of As I mentioned, the main problem
smooth the hole. It also required quite wood and press the camera into place. with the mini cam is how much light it
a bit of sculpting with the hobby knife This makes it much easier to install. I needs. I knew that adding some lighting
to get the edges nice and smooth. glued the apparatus to the center would help alleviate this problem, so —
Once the hole is made, you will support peg. I left the antenna for the when I came across a Coleman LED
need to fit the camera and make any camera inside the chest cavity. Once headlamp for $10.00 — I convinced my
adjustments to the hole. There is no the camera is attached to RoboSapien’s wife that it would be great for camping
place to attach the camera and I don’t shell, hook it all up to make sure it still (which we haven’t done in three years).
really think it would be a smart idea to works and that the position, angle, and Anyway, I had planned on gutting it,
hot glue it onto the chest shell where so on are to your liking. but it turns out that it fit pretty well
the lens goes through. The threaded The next step is to elongate the right out of the blister pack in the
lens screws in and out of the camera cables for the battery. I simply snipped form of “headlamp underpants” on
body to focus and gluing would off the original battery snap from the RoboSapien. I like the design, as it’s
eliminate its ability to do this. connector — leaving the wires intact — just one piece. I’ve seen a lot of head-
I used a small piece of wood to and then used a RadioShack 9 V snap. lamps that have a separate pack for the
attach the camera to the robot’s chest This gave me 3” or 4” of wire, which batteries. I still need to test how well
shell. I used a spongy sanding block to was plenty. I also drilled a small hole in it works with the camera in terms of
make it nice and smooth and — more RoboSapien’s back shell to feed the upping the light levels, especially
importantly — to get exactly the right wires out of. If you are going to do during daylight indoors.
size and shape. Note that you will need this, make sure you feed the wires Now, I have my ever-present Zion-
to angle the camera upward slightly, before you connect them. I used Velcro style dub, in addition to remote control
unless you want RoboSapien to film only to connect the actual battery to the via PC and a video link, all thanks to
shoes. A custom sanded piece of wood robot. this RoboSapien hack. And there’s still
is perfect in this regard. Make sure you Put it all back together and you are room for more mods ... SV

28 SERVO 01.2005
Page29.qxd 12/9/2004 1:46 PM Page 29

Many cool and unique hacks were submitted to the contest,


but ultimately the winners were the ones who submitted
complete hacks that took the Robosapien out of the realm
of "toy" and into that of "tool." The decisions were hard,
but I think you'll enjoy my selections, which will be featured
this month and next. — Editor Dan

Official Results:
11 ss tt P
P ll aa cc ee -- JJ aa m
m ii ee SS aa m
m aa nn ss
22 nn dd P
P ll aa cc ee -- H
H ee nn rr yy P
P ff ii ss tt ee rr

Circle #132 on the Reader Service Card.


SERVO 01.2005 29
menagerie.qxd 12/9/2004 5:00 PM Page 30

Send us a high-res picture of your robot with a few


descriptive sentences and we'll make you famous.
Well, mostly. menagerie@servomagazine.com

Hero
Pat Stakem, Laurel, MD

The HERO was based on a Motorola M6808 eight-bit CPU and


had a Polaroid range finder, light and sound sensors, and voice
synthesis. The manipulator arm was a popular option. I built one
unit and borrowed the other machine from a research lab for some
co-ordination experiments.

Upper left: Let's think about this — the Hero-1 on the left uses the
teaching pendant of the other Hero-1 robot ...

Middle left: Two Hero-1 robots solder a connection on a Hero-JR.


I built the Hero on the right and the JR.

Lower left: Here's a good use for the little fellows.

Lower right: The Hero-1 on the left uses a pencil to operate the hex
keypad of the other Hero-1.

30 SERVO 1.2005
Barlow.qxd 12/8/2004 9:26 AM Page 31

— BY KERRY BARLOW —
obot designers face many challenges in their quest ty. The Atom comes in many variants — 24-pin, 28-pin, and
R for the perfect robot. The most obvious decisions are
microprocessor type, wheel configuration, sensor modes,
40-pin. In addition, there are Atom Pro microprocessors with
extended capabilities above and beyond what the Atom has.
prices of hardware, and software design. The list can be The Atom 24 is pin compatible with the Parallax BS2.
endless and daunting. One of the first decisions we all must Basic Micro is a small company, so they put their effort
face is the choice of microprocessor. into designing new hardware and features for their product
In my latest robot, I have chosen the Basic Micro Atom 24- line. A person will not find quite as much software support
pin as the brains of my creation (Figure 1). I chose the Atom as they would from a larger company, such as Parallax, but
primarily for its basic programming language and its compati- the extra hardware capabilities of the Basic Micro products
bility with many thousands of pre-existing program examples make up for some lack of support. Basic Micro does have
in the communi- excellent forums for their products. These forums cover both
hardware and software examples.
For those readers who have not been to
the Basic Micro site recently, please

SERVO 01.2005 31
Barlow.qxd 12/8/2004 9:28 AM Page 32

THE ATOM 24-PIN MICROPROCESSOR

• PEEK ... POKE read


/write specific RAM
location
• PULSIN measure
pulse width (10 µs
resolution)
• SPMOTOR control
any stepper motor
• XIN X-10 input
• XOUT X-10 output
FIGURE 1 FIGURE 2
The Atom 24-
allow me to list some of the many features of this chip and pin, as stated, is pin compatible with the BS2. For the
then I will go into further detail of how I implemented many additional A/D channels, Basic Micro has special pads
of these features on my robot. underneath the chip that a user may solder wires onto (see
Figure 2). Once a user does this, the A/D channels will be
• 14K contiguous program space no bank switching active. To view the wires attached, see Figure 3.
necessary The 28-pin version of the Atom has these additional A/D
• 368 bytes user RAM lines already brought out to pins on the chip. The 40-pin
• 256 bytes user EEPROM version has additional I/O channels. Soldering wires to the
• 33K instructions/second tiny lands under the chip is not an easy task. There is a
• Three hardware timers walk through provided by Basic Micro and I certainly advise
• Two hardware PWM reading this thoroughly before attempting the task. If you are
• A/D three channels of hardware A/D designing from scratch, I advise you to purchase the 28-pin
• Interrupts, both hardware and software driven version of the Atom and save yourself some grief. I, myself,
• 32-bit math integer and floating point have done the conversion; using a low wattage soldering
• NTSC video display generation iron, panavise, and reading glasses, it can be done.
• I2C bus The Atom software code is 99% compatible with the
• LCD commands BS2; however, there are some small differences that should
• Servo direct control software command be noted. Please review the sidebar for a list of differences I
• In circuit debugger line by line execution as debugger runs. have seen while programming the Atom.
• Oscilloscope
• DTMFOUT output DTMF signals on PIN Choosing the Microprocessor
• DTMFOUT2 two-pin DTMF, higher quality signal
• HCAPTURE capture internal timer value based on external I specifically chose the Atom for its A/D capability, the
event large program space, Basic language, and its interrupt capa-
• HCOMPARE set pin when timer value equals compare value bility. While working with the Atom and designing my robot,
• IF .. THEN .. ELSEIF .. ELSE .. ENDIF conditional statements I found many more features that have made life much easier.
• LCDREAD reads RAM on LCD For my latest robot, I wanted all the bells and whistles I
• LCDWRITE send text to an LCD could design within my budget. I wanted to stay with the
• OWIN receive data from one-wire device Basic program language. I had used many BS2 Stamp
• OWOUT send data to one-wire device products in the past and was happy with the language;
• PAUSE delay (1 mSec resolution) however, I was always running into the dreaded out-of-
• PAUSEUS delay (within 1 µs resolution) memory problem. I was never happy with the idea of bank
• PAUSECLK delay based on internal hardware timer switching. To me, it just confuses an already difficult
situation. In addition, RAM space was always tight in
my programs and — even if I learned how to bank
switch — I still would be running out of RAM space.
I also had run into problems on my previous robots
where a subroutine may be active and the robot is traveling
forward and hits an obstacle before the main loop can
process either a bumper switch or an I/R sensor. I was
hoping that a hardware interrupt could solve this problem
for me. I also had always wanted A/D capabilities. This
can be done externally, but then the processor has to run
through a software routine to read input. Hardware A/D
FIGURE 3 would be a much more worthwhile item to have.
32 SERVO 01.2005
Barlow.qxd 12/8/2004 9:29 AM Page 33

THE ATOM 24-PIN MICROPROCESSOR

Memory Space hardware to use. The Atom has two PWMs available. The first
is on pin 9, which is selected by setting a value of 1. The sec-
One of the biggest reasons I chose the Atom was its ond is on pin 10 and is selected by using a value of 0 for CCPx.
contiguous memory space. The Atom has a 14K program
space. Simply put, all you need to do is write your program Period is a variable or constant from 0 to 16,383 that specifies
— no more worries about bank switching or running out of the period of the pulse width in CLK cycles.
memory space. I could not possibly have fit everything I am
doing inside the 2K memory space of a different processor. Duty is a variable or constant from 0 to 16,383 that specifies
Consider the robot program I will be discussing (available the duty cycle of the pulse width.
on the SERVO website or my own — see Resources). At this
time, there are 200 bytes of RAM free and 4K of program ENABLEPIN con 9
TrackLow:
space still free; 656 program lines show as being compiled. HPWM 1,9890,8000 : Return ‘81% Duty
This is non-optimized code. On my own working version of Return
the program, there are many lines of old subroutines still left
in my program only because I have the space and it is easier TrackMed:
to leave them in for testing purposes. I have never had any HPWM 1,9890,9000 : Return ‘90% Duty
Return
worries about RAM space, as I did with the BS2. I have TrackHigh
variables declared that I am not even using. HPWM 1,9890,9890 : Return ‘99% Duty
The program on the SERVO website is cleaned up and Return
the unused code has been removed, but I simply wish to say
that variable and program space is so large that I never even IF .. THEN .. ELSEIF .. ELSE .. ENDIF
worried about it. The Atom does not have as much user EEP-
ROM available as a BS2. There are 256 bytes of EEPROM for The Atom uses standard syntax for its IF decision state-
data storage. If you need more storage for something like a ments. There are two ways in which IF ... THEN can be used.
data logger, then you will have to use an external memory The first tests a condition and, if that condition is true, goto or
system. The simplest method for this is to use an I2C bus gosub to a point in the program specified by an address label.
based EEPROM memory chip. For my robotics work, I have
never needed to actually store memory, but I can imagine a
person who would want to map a location to memory. In this
case, I do recommend using external memory. The internal
RAM of 368 bytes for variable and array space is quite large.
Even with 35 variables and two arrays in my program, I still
have 200 bytes of variable space free in the Atom! Variables
can be bit, nibble, byte, word, and long. These are defined as

Bit 0 or 1
Nib 0 to 15
Byte 0 to 255
Word 0 to 65535
Long 0 to 4,294,967,295

As you can see, the Atom gives a programmer great


versatility in defining a variable, thereby freeing up that much
more RAM space.

Hardware PWM
The HPWM command outputs a user-specified Pulse
signal on either of two channels. Both channels may run
independently at different duty cycles, if you wish. Hardware
PWM is much more useful than software generated PWM.
The Atom will continue processing your program at the same
time it is generating PWM signals.

HPWM CCPx, Period, Duty

CCPx is a variable or constant of 0 or 1 that specifies the PWM


Circle #122 on the Reader Service Card.
33
Barlow.qxd 12/8/2004 9:30 AM Page 34

THE ATOM 24-PIN MICROPROCESSOR

the SRF04 sonar would not


FIGURE 4 FIGURE 5 output values properly to the
ICD. To get around this, you
can send the SRF04 output to
a terminal window and
display the data in this man-
ner inside the ICD.
The Atom ICD has several
commands. Here are some of
them:

Animate
The animate button will ani-
If range <=130 then gosub OBJECT mate the displayed program line-by-line, as it is executed on
the target device.
The second use of the If ... Then can conditionally
execute a group of statements following the THEN. The state- Run
ments must be followed by Elseif or Else with an Endif. The run button will start program execution on the target
once the connection is established.
If Ldist <=10 then Lflag = 8
Endif Reset
Reset is used to restart the program currently running on the
Incircuit Debugger target device.

I have used the ICD and found it to be a valuable asset Pause


in debugging my programs. I can watch my variables The pause button will pause program execution.
changing on the fly or watch the flow of my program code
line-by-line. It is documented that timing dependent code Step Into
may not work properly with the ICD. In my case, I found that The step button allows you to step through the current
running program, line-by-line.
THE ATOM
Step Over
The Atom is 99% compatible with the BS2; however, there This allows the program to step over a routine, mainly a
are a few minor differences. Basic Micro has a list of differences gosub and/or for .. next loop.
between the Atom and a BS2 in their documentation, as well.
Debug code is different than with a BS2; primarily, the Atom Step Out
needs the command placed inside brackets. Step out will allow you to step out of a gosub routine. This
allows you to skip any gosub in your program and go to the
debug [DEC val02, 13]
next line after the routine.
Reserved variable names include: smp, swap, sound, int,
dt, skip. N9600 is used for serial output to a LCD display within
Run To Cursor
the Atom: serout 1,n9600,[“START”] You do not need to Using the run to cursor function will allow the program to
declare n9600 as you did with a BS2. An Atom may not be used run until the cursor is reached.
on a Board of Education unless you remove the capacitors on
the serial programming lines of the BOE. Show Variables
Servo commands are much simpler to use with the Atom. I If clicked, the variable button will open a small new window
have found a quicker way to program the Atom. This is not that displays all the current variables used in the current
documented by Basic Micro, but it works well for me. The Atom program and the current values in HEX, decimal, binary, and
IDE will do a WRITE command to the chip and then do a few floating point.
VERIFY commands to determine if the Atom was programmed
properly. I have found that I can cancel the IDE program Show SFRs
command at the end of the WRITE function and disregard the SFRs stands for Special Function Registers. These are the
VERIFY functions. The Atom will work fine. I have been doing registers built into the PICmicro MCU on the Atom.
this for years without any problems. I also have found that you
do not even have to do a full WRITE of 100%. If you have a short
Show Ram
program, WRITE may be canceled at 25% or 50% and the Atom
will work fine.
If clicked, the RAM button will open a small window that
displays all the RAM values in the Atom.
34 SERVO 01.2005
Barlow.qxd 12/8/2004 9:31 AM Page 35

THE ATOM 24-PIN MICROPROCESSOR

Show Gosub Stack


Displays the gosub stack. This FIGURE 6
indicates where a program is
in a gosub routine.

Oscilloscope
Inside the Atom IDE there
is a built-in oscilloscope tool.
The oscilloscope supports two
basic kinds of data plots.
Y/time is where the Y-axis is
the data and the X-axis is
time. Note that this is not real FIGURE 7
time. It is actually the time
between when the data points are received. So, if you are H-bridge motor control chip. I wanted motor speed control
only sending a data point once a second, that’s when the and had plans for Pulse Width Modulation (PWM). The Atom
Y-axis will be updated. will provide hardware-based PWM. This offloads much of the
I have not personally used the oscilloscope yet. There necessary overhead of software-driven PWM. At this time, I
is documentation on the Atom website (see Resources) have not used the PWM feature except as a test program. I
describing its full use. found that my robot runs at an adequate speed using full
battery voltage and I did not need any reason for speed
The Robot reduction at this time.
The H-bridge driver to the SN754410 has been detailed
My robot has been in its design phase for many years now, many times in previous articles, as have the I/R transmitters
mainly due to a busy work schedule. It would take too much using a 555-frequency generator. For an example of the
space to go through all the iterations and design changes. I
feel, however, that it would be beneficial for the reader to
know of some of the worst problems I have had, in addition to
why I changed my plans and some of the hardware on the STEER WINNING ROBOTS
robot. On this robot, I specifically did not want any mechanical
bumper switches. Bumper switches are fine and 100% reliable, WITHOUT SERVOS!
but an animal in nature does not really use them and I did not
want them on the robot, either. I had used servo motor-driven
drive wheels with a trailing caster previously and they work
fine, but a trailing caster would occasionally cause problems,
either catching on a carpet or catching while backing up. With
this in mind, I chose a dual track design (Figure 4).
It also was thought that edge-mounted I/R sensors would
be good as a final last-ditch obstacle detection system. See
Figure 5 for a close-up of the edge sensors. The Atom hardware
interrupt was to play a major part in the edge detection circuitry.
I will go into more detail on interrupts in Part 2 of this article.
You will notice two circuit boards on the robot. The
lower board has the Atom, H-bridge driver, and the 555 timer
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
for I/R and A/D connections (Figure 6). with our mixing RDFR dual speed control. Used in many
The upper board contains a LCD, 4052 multiplexor, and successful competitive robots. Single joystick operation: up
inputs for the three CDS cells (Figure 7). I’ll also explain the goes straight ahead, down is reverse. Pure right or left twirls
4052 multiplexor hardware and software in further detail in vehicle as motors turn opposite directions. In between stick
the next installment of this article. 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 Construction The RDFR47E 55V 75A per motor unit pictured above.
www.vantec.com
Design must turn into hardware at some point, so I
chose a toy tracked power shovel as the main drive unit. I Order at
was quite happy with the track drive unit for indoor use.
Motor control was achieved by the use of an SN754410
(888) 929-5055
SERVO 01.2005 35
Barlow.qxd 12/8/2004 9:32 AM Page 36

THE ATOM 24-PIN MICROPROCESSOR

FIGURE 8

schematic of the I/R transmitter, review Figure 8. and transmitters aft facing. All transmitters are tied in parallel
and so are the receivers.
Sensors I am using the Parallax IR receiver modules. These output
a digital LOW or 0 state if an object is detected. All receivers
Sonar are tied to the Atom’s interrupt hardware pin (pin 0). No matter
Four SRF04 sonar sensors mounted on the front and where the Atom may be in its main loop, if a detection
sides of the robot provide main object detection. These sonar occurs, the hardware pin will immediately stop the program
sensors are tied together using the 4052 multiplexor; look for and branch to a special subroutine. In this subroutine, a user
more details on the 4052 next month. may do anything desired. I chose to stop all motors, back up,
and then search for a large area to drive into. Again, I shall
I/R Ranged go into more detail on interrupts in Part 2.
Secondary object detection is performed by a GP2D02 IR
range finder inside a small project box that is mounted on CDS Light Sensor
top of a standard hobby servo. I can rotate this head to find I also have CDS light sensors mounted on the robot. One
the largest openings around the robot. sensor is mounted inside the rotating head and one is mounted
on either side of the robot. At this time, I only implement the
I/R Static light sensor inside the rotating head. I use this light sensor to
Interrupt-driven edge sensors are a third and final prevent the robot from driving under tables. I am currently using
detector. On the front of the robot, I have transistor pairs and the Atom’s A/D circuit connected directly to a standard CDS cell.
two sensors at each corner. On the rear, I have two sensors
Reliability
RESOURCES This method has proven to be 95% reliable. I highly recom-
Atom 24, accessories, and supplemental info mend mixing sensor types in this way. I have often seen sonar
www.basicmicro.com miss an obstacle that an IR sensor will detect and vise versa.
I/R receiver
www.parallax.com/detail.asp?product_id=350-00014 Final Notes
SRF04, PIR sensor, and GP2D02 I hope this review of the Atom has given you an appetite
http://acroname.com for a powerful microprocessor that is programmable in the
Basic language. So many times in the past, I have found great
SN754410 and CD4052
sounding robots, only to realize they are based on a micro-
http://mouser.com/
processor that either requires C code or uses such a convoluted
Program, Atom 24, and Atom Manual 2.2 syntax for its Basic that they would nearly require relearning
http://mntnweb.com/hobby/bolo/ the language. Basic Micro has done a good job of giving us
a high power processor wrapped in a high level language.
SERVO Magazine — code listings In Part 2, I will go into details of the Atom specific code
www.servomagazine.com and how I have used that code in my robot design. SV
36 SERVO 01.2005
Showcase.qxd 12/9/2004 4:28 PM Page 37

8lÛCYkl›ÛCgoÛ[gklÛ Smart Servos


]f[g\]jkÛ^gjÛ
THOUSANDS OF ELECTRONIC
eglgjkÛ¬Ûk]jngk›
PA R T S A N D S U P P L I E S
VISIT OUR ONLINE STORE AT
www.allelectronics.com
WALL TRANSFORMERS, ALARMS,
FUSES, CABLE TIES, RELAYS, OPTO
ELECTRONICS, KNOBS, VIDEO
ACCESSORIES, SIRENS, SOLDER
ACCESSORIES, MOTORS, DIODES, • Simple serial bus interface –
HEAT SINKS, CAPACITORS, CHOKES,
TOOLS, FASTENERS, TERMINAL
N`]]dNYl[`]j KD
31 motors on a single link
• Position & load readout,
STRIPS, CRIMP CONNECTORS, ÝÛ <YkqÛafklYddYlagf
overcurrent protection
L.E.D.S., DISPLAYS, FANS, BREAD- ÝÛ Dg\]dkÛ[gehYlaZd]Ûoal`Û=mlYZY•Û • Full rotation mode
BOARDS, RESISTORS, SOLAR CELLS, >NJ•Û?al][Û¬Û?gZZa[gÛk]jngkÛ • Modular connections –
BUZZERS, BATTERIES, MAGNETS, Yf\ÛeYfqÛJgdYjZgla[kÛeglgjk
CAMERAS, DC-DC CONVERTERS, 11 attachment pieces
ÝÛ Lk]kÛklYf\Yj\Ûo`]]dk
HEADPHONES, LAMPS, PANEL
METERS, SWITCHES, SPEAKERS, ÝÛ ;]Y\Ûj][cgfaf_•Ûg\ge]ljq•ÛklYddÛ Robot kits starting at $185
PELTIER DEVICES, and much more.... \]l][lagf•Û[dgk]\¤dgghÛ[gfljgd
KD
Garage Technologies, Inc.
O R D E R TO L L F R E E modular robotics,
modular electronics
1-800-826-5432 ooofmZgla[k[ge www.Garage-Technologies.com
Ask for our FREE 96 page catalog

Robotics Showcase

SERVO 01.2005 37
Events.qxd 12/8/2004 9:54 AM Page 38

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

We're starting a new year and tradition says it's time to


make some New Year's Resolutions. Here are a few to try
F e b ru a r y 2 0 0 5
out for size: 4-6 Robotix
IIT Khargpur, West Bengal, India
• I resolve to see at least one robot competition this year. Organized for students of IIT Khargpur, this
• I resolve to enter at least one robot competition this year. contest includes events for both autonomous
• I resolve to build a better robot this year. robots and radio-controlled machines.
www.robotixiitkgp.com/
That last one is important. Competitions are fun, but
sometimes we get too focused on competitions and rules to
innovate. March 2005
Even worse, some competitions seem to have rules
designed to prevent innovation. If you have a great idea for 6-10 APEC Micromouse Contest
a new robot, go ahead and build it — even if it Hilton Hotel, Austin, TX
doesn't fit into the rules for a contest. Some of the best This will be the 18th annual APEC Micromouse event.
robots that turn up at our local robot group meetings www.apec-conf.org/
weren't designed for a contest; they were created to try out
a new idea. 11-12 AMD Jerry Sanders
There continues to be a lot of talk online about new Creative Design Contest
types of competitions that would stimulate the construction University of Illinois at Urbana-Champaign, IL
of more innovative general-purpose robots rather than more The design problem for this contest is new and
and more specialized robots. I'm hoping some of these ideas different each year. Check the website for the latest
come to fruition this year and bring some much need news and details.
variety to the realm of robot competition. http://dc.cen.uiuc.edu/

— R. Steven Rainwater 19-20 Manitoba Robot Games


Manitoba Museum of Man and Nature, Winnipeg,
For last minute updates and changes, you can always find Manitoba, Canada
the most recent version of the complete Robot Competition A variety of events, including sumo, a robot tractor
FAQ at Robots.net: http://robots.net/rcfaq.html pull, and Atomic Hockey.
www.scmb.mb.ca/

Januar y 2005 24-27 ROBOlympics


San Francisco State University, San Francisco, CA
24 Citrus Robotics Robot Combat Lots of events, including sumo, BEAM, Mindstorms,
Inverness, FL FIRA, and robot combat.
Radio-controlled vehicles destroy each other in www.robolympics.net
Florida.
www.citrusrobotics.com/ A p r il 2 0 0 5
28-30 Techfest 2005 9-10 Trinity College Fire Fighting Home Robot
IIT, Mumbai, India Contest
A nationwide science and technology festival for Trinity College, Hartford, CT
Indian students. There are several robot contests, Could the fire have been set by a robot builder
including Yantriki and Survivor. frustrated with the voluminous rules?
www.techfest.org/ www.trincoll.edu/events/robot

38 SERVO 01.2005
Sandberg.qxd 12/7/2004 4:38 PM Page 39

by Daryl Sandberg & Larry Geib

A message dated 8/3/04 on the


PARTS Yahoo! listserver:
to do the job. succeed. I would make the chassis
functional and create the control
Early Decisions commands and Larry would develop
SandbergDJ writes ... the GPS software and CMUcam
I had a robot chassis (MRToo) that interface. Neither Larry nor I are great
“Is anyone building a robot for I had been tinkering with for two programmers, so we decided that a
Robo-Magellan? I’ve considered using years, but it would need a lot of work BASIC Stamp II was the best choice for
MRToo, but I don’t have the time or to make it to Robo-Magellan in less overall control. We felt that keeping
knowledge to do the navigation and than eight weeks. Larry Geib had a it simple and reliable provided our
sensor modifications to the robot. Is GPS that he had been playing with greatest chance for success.
anyone interested in collaborating?” for about a week, but didn’t have a
reliable chassis to attach it to. With The Chassis
LJGeib responds ... an exchange of several Emails, we
decided that — with lots of work and MRToo (pronounced M-R-2) is a
“Time is short, so we’ll have to a fair amount of luck — we might just four-wheel drive, four-wheel steering
start stirring the pot soon if we want be able to get a challenger assembled robot. The robot was built without
to try to do this.” for the contest. I registered the robot an overall plan or purpose. It just
right away to provide a little extra evolved from parts that I had acquired
And so the race to build a robot motivation and, with that, we began over time. The drive motors are
for the Seattle Robotics Society/ the project. discarded rear wiper motors modified
SERVO Magazine Robo-Magellan We decided that parallel develop- for continuous rotation. There is one
began. We had less than eight weeks ment was the only way that we could motor for each wheel and all four
SERVO 01.2005 39
Sandberg.qxd 12/7/2004 4:40 PM Page 40

MRToo Goes to Seattle


before I settled on the One is used for the drive motors, one
current version. for the steering mechanism, and one
A small Toyota window as a wheel encoder.
motor is geared down The drive motors, steering, camera
3-to-1 with a #25 roller pan, and calibration servos are con-
chain drive to turn a trolled through a Scott Edwards serial
series of bell cranks and controller. This allowed one pin and
connecting rods to coordi- simple code to maintain the mobility
nate movement of the functions of the robot. The encoder
wheels. A 10K potentio- also used just one I/O off the Stamp. A
meter gives position feed- serial signal is sent from the Stamp
back to a PICAXE 08M to to the 08M, indicating the desired
control the H-bridge to distance (in feet) for the robot to
make the motor into a giant travel. The wheel encoder 08M counts
servo. This setup provides down to zero and then sends a signal
The orange cones were easy on the sensors. the extraordinary torque back though the same pin to tell the
necessary to turn four Stamp, “We have arrived.”
motors are powered by a single wheels on a 40 pound robot. There is Another pin (with a 22K resistor in
H-bridge. The wheels are made from a certainly enough torque to bend and series) is used for a 4800 baud serial
couple of eight inch disks of ABS that break the steering components, so connection with the Garmin Geko 201
use a piece of one and a half inch ABS motion is limited both mechanically GPS unit. The Devantech CMPS-01
plastic plumbing pipe for a center hub and through software. compass module feeds a PWM
and a strip of three inch wide ABS for The chassis is constructed from signal to the BASIC Stamp on another
the outside edge. A rubber floor mat pieces of discarded Lexan given to me single I/O.
was cut into strips and glued to the by a friend. I just liked the idea of a A 4 x 20 LCD is used for debug-
wheel surface to provide a tire tread. A clear-bodied robot so that people could ging the BASIC Stamp program and is
nylon bearing was turned to ride on see the internal components. serial driven through a Peter Anderson
the housing of the motor and an I decided early on that the robot (www.phanderson.com) prepro-
aluminum disk was fashioned to needed some kind of suspension. The grammed PIC 16F628.
transmit power from the motor shaft front wheels pivot in relation to the A front bump sensor and a
to the wheel. body of the robot and provide about giant, red pause switch provided
The robot uses four-wheel steering five inches of wheel travel, which by Tim Weaver finish out all of the
for a really tight turning radius of allows the robot excellent mobility. connections to the BS2.
about three feet. It actually took more
time to get the steering working Computers and Navigation
properly than it did to build all the Sensors
rest of MRToo. I tried eight different To determine the longitude and
motor, gear, and linkage combinations The BASIC Stamp II has its limita- latitude of each of the target cones,
tions, so our goal was to Larry walked the course before the
GPS in action! get as much mundane start of the contest and entered the
processing as possible locations of the cones into the Garmin
off the Stamp and onto GPS unit as “waypoints.” These
individual PICAXE 08M waypoints would ultimately determine
microcontrollers. We used the path of the robot.
three 08Ms in the robot. The navigation process begins
when the Garmin gets a valid
Inside MRToo. signal. This triggers the BASIC
Stamp to start processing the
incoming data. The GPS gives
the BASIC Stamp a bearing and
then the Stamp looks for
readings from the compass to
decide if the robot is heading
in the right direction. The GPS
unit does all the calculations
of the bearing to waypoints
and automatically cycles through
40 SERVO 01.2005
Sandberg.qxd 12/7/2004 4:41 PM Page 41

MRToo Goes to Seattle


the individual waypoints on a route. day, we just didn’t know
The Stamp sends a signal (left or what to expect. We found
right) to the Scott Edwards Serial that the start of the contest
Controller that, in turn, sends a signal was a lot more difficult
to the PICAXE 08M to turn the wheels than what we had planned
in the desired direction. for. The first portion
When the GPS decides that the included an outdoor stage
robot can reach the waypoint within 15 with only two ramps for
seconds, a signal is sent to the Stamp. access, a serious three-foot
The Stamp starts the CMUcam on a drop off, and a narrow
search routine to locate the cone, pathway.
based on the reflected color of the After the first attempts,
cone. If the CMUcam doesn’t find a it didn’t look like many
cone on each pan, it returns direction of the robots were sophisti-
control to the GPS. cated enough to get through
all of the beginning obsta-
CMUcam cles. The officials offered an MRToo makes a run for the 50-yard line!
easier start for the later runs
The CMUcam code was all with one caveat — no prize money. We out of bounds on the first two runs
“liberated” from code and examples were more interested in some level of without making much progress. On
written by Ron Nucci in his original success, so this was our choice because our final run, we just cranked the
example hack that came with the we didn’t have the sensors to deal with compass module 70 degrees from
camera (www.seattlerobotics.com), the ramps and the stage drop-off. where it should have been and the
from Michael Miller’s previous SERVO Many of the other contestants picked robot did much better. MRToo started
articles, and from John Iovine’s book, this simpler option also, but a couple heading toward the first cone.
PIC Robotics. of the braver souls attempted the Unfortunately, a coding error
The camera calibrates itself when original start. caused the Stamp to not see the GPS
the robot is first turned on. It uses a We decided to go for the easiest signal that indicated that the robot
gray card to measure ambient light, cone and then head for the finish cone. was closing in on a cone, even though
then a bright orange card attached to If we were successful, we would make MRToo was within one meter. This
a servo arm that pops up in the another attempt for the medium diffi- was not a big problem because the
camera’s field of view. The camera culty cones on a later run. program stated that if the cone
then pans through 180 degrees in five We had been having problems all wasn’t found when expected, the
steps, covering the entire field of week with the compass (after the robot would just move on to the
view. If it finds enough bright orange contest, we found two wires on a next target.
color at any step, the Stamp uses the compass sensor that were shorted MRToo was about 10 meters away
direction that the camera servo is out). The compass worked well going from the final cone (which was hidden
pointed in to steer the robot toward east, north, and south. behind a concrete sculpture and a par-
the cone. Unfortunately, the robot needed tial wall) when it got hung up between
Like all the other code used on this to go west. The compass was 70 a tree and a garbage can. We were
robot, it’s quick and dirty. Larry wrote degrees off in that direction, which offered a chance to extricate the robot
the final version of the code in one caused the robot to make a
evening and debugged it the afternoon giant, curved path. It spiraled Detail of the wheel mounts.
before the contest. vaguely in the direction of the
Nevertheless — with the addition first cone, but the robot went
of an IR filter and a neutral gray
filter for the outdoor environment Navigating tricky terrain.
— the camera can detect an 18 inch
cone at 18 feet or more. Traffic
cones are easy to pick out from the
background in a park setting. With
more testing and tweaking, we
know it will do even better.

How We Did
When we arrived on contest
SERVO 01.2005 41
Sandberg.qxd 12/7/2004 4:42 PM Page 42

MRToo Goes to Seattle


band on the steering
program and use tighter
tie rod ends for the link-
age. These three things
were the reasons for the
drunken duck behavior
that the robot exhibited
during the contest.

Testing the steering. Sharp turns are no problem! Note the strong design. • We will add proximity
sensors. Sonar, IR, and
just to see if it could find the final cone, contest version looked at the wrong vision are some choices. We’ll spend
but we had already turned the variable to turn on the camera. We enough time on sensor fusion to
robot off. That killed the Stamp’s couldn’t test it after dark the night improve behavior and speed up the
memory, ending our chances at hitting before the contest, so we didn’t catch response to objects and hazards.
the destination cone. the error.
• We will do tests to gain more speed
Lessons Learned • GPS is a very robust navigation before next year. There are some really
method. Even with the bad compass fast robots out there!
Entering the contest this year was (shorted wires on a sensor), the GPS
an excellent learning experience. It offered enough correction to get the • We’ll add more of our own waypoints
gave us a good idea what works and robot around the course. With a GPS and include a scheme for determining
what doesn’t. that has routes, you don’t need to do which waypoints have cones attributed
double precision math. to them.
This is what we learned:
Next Year • TEST, TEST, TEST! What you think
• Start earlier. By the time Larry got you are writing isn’t always what the
the robot and put the sensors on it, • For next year, we will build on what robot ends up doing.
there were only nine days left to the we have. More time and cleaner
contest. It’s remarkable that the robot coding will smooth out the glitches in • We will provide alternate behaviors
worked at all. The fact that the camera the behavior. The camera code is a for different parts of the course.
didn’t turn on at the first cone is good example. It works over a wide
directly attributable to not having time field of view, but there are certainly • We’ll wear lots of orange and walk in
to debug the entire program. The more elegant ways to do the task. front of the other guys’ robots.

MRToo poses with its prize. • We will decouple the Conclusion


steering from the GPS input.
Currently, the steering When Larry and I began this
corrects only refresh once a project, I was genuinely concerned that
second because the Stamp differences in style or disagreements
spends most of its time about how the robot should be put
waiting in a looped SERIN together would lead to bickering and
statement. possibly damage our friendship. Quite
the opposite happened. Working as
• We will tighten the dead- a team was one of the best parts of
this project.
Testing the four-wheel drive. Being able to bounce ideas
off each other and encourage
each other when the going got
tough made getting a robot
completed on time possible.
I now have a much greater
level of respect for Larry’s abilities
and his creativity and we’ve
already begun working to
improve MRToo for next year’s
event. SV
42 SERVO 01.2005
Braunl.qxd 12/8/2004 8:15 AM Page 43

by THOMAS BRAUNL, ANDREAS KOESTLER, and AXEL WAGGERSHAUSER


The entry fee to robotics is not exactly cheap when you simulation much more easily than on a real robot. We can
consider the cost of all the mechanics and electronics have hundreds of robots interact in a simulation and let robot
required. This suggests the use of a simulation system; how- programs evolve through thousands of generations much
ever, very often simulation and reality are miles apart. The faster and with less trouble than on real robots. However, the
goal for our simulation system — EyeSim — was, therefore, to prerequisite for all this is that the so-called “reality gap” — the
create a simulation package that is available as a public difference between simulated and real robots — is minimal.
domain and that models real robots as realistically as possible.
Not only should the outer appearance of the simulated User Interface
robot match the real one, but the complete application
programmer interface (API) should also be identical for both The EyeSim user interface comprises two main parts: the
the simulation and the real robot. This allows us to switch virtual 3-D world in which the robots operate and the user
between the simulation and real robots without having to interface through which the simulation can be controlled
change a single line of source code! This simulation system (e.g., by changing a robot’s position or the timing of the
should implement all robot actuators and sensors of the simulation). A simple 3-D engine based on OpenGL has been
EyeBot robot family, including a virtual camera with developed for visualization. This provides for fast graphics
adjustable error models. rendering, even on older style PCs and graphics cards. Newer
Simulation is not only an ideal entry style graphics accelerators are supported and allow even
to the robotics arena, it is also faster rendering, but are not a requirement.
an important instrument
for research in many Environment Definition
computation-intense All models of robots and objects (walls, boxes, cans, etc.)
AI techniques, like have been designed with Milkshape3-D (www.swiss
genetic algorithms or quake.ch/chumbalum-soft), a simple but efficient share-
genetic programming ware module that is mainly used for
— which can be exe- generating polygon
cuted in the models for simulations
and computer

FIGURE 1. Omni-directional robot in reality.

SERVO 01.2005 43
Braunl.qxd 12/8/2004 8:17 AM Page 44

Mobile Robots Between SIMULATION & REALITY


simulation system and was extended for our
—————————————————— purposes.
I I
I I After processing the information from model
—I I—
and environment files, EyeSim displays the
I I
I o I scene from a standard viewpoint. The user can
I— — I change the displayed scene by turning, shifting,
I I or zooming to get a better overview of the
I I
I——————————————————I simulated world. Although the simulation could,
in principle, be executed without a complex
floor_texture ../textures/soccer.bmp GUI (Geographical User Interface) or the 3-D
width 3100 rendering of a scene, this simplifies debugging
height 1530 tremendously. For example, the user can directly
ball 1350 1028
see if a robot has been caught in a corner, as
; Wall (x1,y1, x2,y2), Thick.,Height, Col. (R,G,B) opposed to having to go through tables of
180 0 180 515 18 100 255 255 255 numbers in a purely numeric simulation.
180 1015 180 1530 18 100 255 255 255 The user interface has been designed by
0 497 198 497 18 100 255 255 0 using the freeware “fltk” class library
0 1015 198 1015 18 100 255 255 0 (www.fltk.org) that allows the user to change
0 515 0 1015 18 100 255 255 0
180 0 2938 0 18 100 255 255 255
the simulation settings. Among other things, it is
180 1530 2938 1530 18 100 255 255 255 possible to change the error probabilities of
2938 0 2938 533 18 100 255 255 255 sensors and actuators, have the robots leave a
2938 1015 2938 1530 18 100 255 255 255 visible trail, or change the simulation timing to
2938 1015 3100 1015 18 100 0 0 255 slow motion or fast forward. This is especially
2938 515 3100 515 18 100 0 0 255 useful for computation-intense algorithms like
3082 515 3082 1015 18 100 0 0 255
genetic algorithms, which often require several
CPU-days to complete.
FIGURE 2. Environment definition in maze format (top) and world format (bottom). Another step towards realistic robot simula-
tion is the implementation of the identical user
games. With its large library of import/export filters, it is interface of the EyeCon controller board with LCD output
possible to convert models designed with other 3-D modelers and user input buttons (see Figure 3). This allows you to run
to the Milkshape3-D format. the robot application with exactly the same source code as
For defining the simulation environment, we allow two the real robots under the RoBIOS operating system.
different formats: maze format (see Figure 2, top) — a simple
text format that was originally used to describe mazes in the Robot Model
MicroMouse competition and world format (see Figure 2, Each robot type is characterized by two files: a definition
bottom) — which was originally developed for the Saphira file (“name.robi,” see Figure 4) with all simulation relevant data
and an independent graph-
FIGURE 3. EyeSim user interface. ics file (“name.ms3D”) for
its realistic 3-D rendering.
The “robi” file contains the
name of the robot type, its
physical dimensions, values
for maximum speed, drive
type (differential drive,
Ackermann drive, omni-
directional drive), wheel
base, wheel diameter,
maximum wheel speed,
and encoder ticks per
revolution. The “robi” file
contains all sensor data,
similar to the hardware
description table (HDT) of
the real robot, where all
sensors are defined (e.g.,
PSD sensors in Figure 4).
We modeled a number of
44 SERVO 01.2005
Braunl.qxd 12/8/2004 8:18 AM Page 45

Mobile Robots Between SIMULATION & REALITY


robots from the Mobile Robot Lab
(http://robotics.ee.uwa.edu.au) and the name S4X
SoccerBots from Joker Robotics (http://joker- diameter 186
speed 600
robotics.com). However, it is easy to add your turn 300
own robot by providing a “robi” description model S4X.ms3D
file and a graphics file. psd PSD_FRONT 60 20 30 0
EyeSim (and RoBIOS for real robots) psd PSD_LEFT 56 45 30 90
provides driving commands on three different psd PSD_RIGHT 56 -45 30 -90
levels. High level driving commands allow the camera 45 0 72 0 -5 80 60
wheel 54 3600 1100 90
application programmer to specify the vehicle drive DIFFERENTIAL_DRIVE MOTOR_LEFT QUAD_LEFT MOTOR_RIGHT QUAD_RIGHT
speed directly in terms of linear speed and
rotational speed. A PID controller provides
velocity and position control. FIGURE 4. Robot definition file for type S4X with differential drive.
A low level interface allows the control of
individual motors and reading of their respective shaft RoBIOS functions are the simulator’s only way to influence
encoders. the execution of the robot programs. For every call of a
For example, for differential drive, setting the same RoBiOS function, the simulator first calculates the current
speed for left and right motors will result in a straight status of the simulated robot and exchanges synchronization
forward motion, while having different (positive) wheel messages with the Core, if required. It then follows the
speeds will result in driving a curved forward path. For simulated execution of the actual RoBIOS function, which
Ackermann drives (the classic automobile drive system), the may have to communicate with the Core again (e.g., for
rear wheels have one common motor, while both front reading sensor values or for setting actuator commands).
wheels are steered by a common servo. Using the patented The basis for a properly working dynamic model is a solid
Mecanum wheel design with three or four driven wheels model of time. For example, in order to be able to calculate
allows a vehicle with omni-directional drive to move in all the simulated distance sensor values properly, it must be
directions, including forward and sideways, as well as to turn known at which point in simulated time this sensor reading
on the spot.

Sensor Visualization
EyeSim’s sensor visualization can assist in locating an
error in a robot application program, as errors in robot pro-
grams are frequently related to incorrect sensor data reading
or incorrect interpretation. EyeSim provides a graphical and
numerical display of sensor values to assist the application
programmer. Read requests to the infrared distance sensors
(position sensitive device, PSD) are displayed as lines and are
stored for subsequent analysis. Camera read requests are
displayed with the camera’s frustrum and sending and
receiving wireless transmissions is represented with graphics
symbols (see Figure 5). In many cases, simply watching a
robot program with sensor visualization switched on helps in
locating an error.

Implementation
The internal simulator structure is client-based and
object oriented. The central object in the server is an
instance of class “Core.” Each robot is represented by a
client, which communicates with the server through a
bi-directional message channel. The main tasks of the Core
are: initialization of the simulation, administering of current
states of the “world” (including positions of robots and
objects), synchronization of individual robots, and interaction
with the GUI.
The interface between the simulator and robot
application program are the functions from the RoBIOS
operating system (see Box “RoBIOS API”). In addition, the
Circle #137 on the Reader Service Card.
45
Braunl.qxd 12/8/2004 8:19 AM Page 46

Mobile Robots Between SIMULATION & REALITY


speed of the host computer system. Running the simulation
faster is especially useful when simulating a very long robot
program or a large number of robot programs (e.g., for
evolutionary processes, such as Genetic Programming).

Error Models
In the simulation environment, sensor values are
obviously not measured, but calculated. This leads to the
strange situation that simulated values are usually much
more precise than an actual robot sensor could ever be. In
the real world, there are always aberrations from the
true signal that are due to sensor error or noise. There are
several causes for noise, such as the black signal in CCD
chips, discretization errors in A/D converters, etc. Generally
FIGURE 5. Visualization of PSD sensors and wireless communication. speaking, the performance of most sensor types is limited by
some form of noise.
takes place. Only then can positions of moving robots and In order to keep the “reality gap” as small as possible,
obstacles be properly calculated. Even more important is we implemented artificial sensor errors and noise in our
a solid model of time for synchronizing multiple robots in a simulation environment. Algorithms that have only been
simulation environment. Note that each robot program tested under perfect, synthetic conditions are very likely to
can itself make use of multi-tasking by starting threads for fail in a real environment. The Gaussian noise used in EyeSim
individual tasks. is a simplification of noise encountered in real environments,
EyeSim accomplishes this by giving each robot its local but is a tremendous help in the development of robust and
time, which is being synchronized with a global simulation fault-tolerant algorithms.
clock. By default, the global clock runs in real time — that is, While noise added to PSD sensors and shaft encoders
the simulation takes the same time as the real robots would. results in a normally-distributed aberration from the correct
However, it is possible to run the simulation slower or faster sensor value, we additionally implemented impulse noise for
than real time; the only limitation here is the processing the simulated camera. This can be specified in the form of
“salt and pepper” noise (stray black and white
FIGURE 6. Some of the real EyeBot sensors — PSD, inclinometer, and gyroscope. pixels) or “100s and 1,000s” noise (stray colored
pixels). In real camera systems, these incorrect
pixel values can be the effect of information loss
or failures during data transfer.

Application Examples
A good start in getting to know a simulation
system begins with looking at some application
examples in detail. For this, we have selected some
typical mobile robot tasks. Camera and sensor
commands in the RoBIOS operating system are
largely self-explanatory. For driving commands, the
application program-
FIGURE 7. Original, salt and pepper noise, 100s and 1,000s noise, and white Gaussian noise. mer can choose
between direct motor
control in low level
modus (MOTOR and
QUAD commands) and
the high level VW inter-
face with linear and
rotational velocities
(e.g., VWDriveStraight,
VWDriveTurn).

Maze Exploration
Making a robot
that has to find its way
46 SERVO 01.2005
Braunl.qxd 12/8/2004 8:22 AM Page 47

Mobile Robots Between SIMULATION & REALITY


in a maze has been a popular task for over 20 years.
Robots have been competing in the MicroMouse
Contest since the 1980s. A robot explores a previously
unknown maze, then has to return to the starting point,
and has several tries to find the goal files in the shortest
time.
What makes this task so interesting is the combina-
tion of algorithm design (we could call this the
Computer Science or IT side) and the required robust
implementation in order to navigate in a non-perfect real
world (we could call this the Engineering side).
The advantage of our simulation system is that it
can be used for both parts. First, we can deactivate all
error models. This means the robot will always drive
exactly the desired distance, turn exactly about the
desired angle, and return the correct sensor values.
This simplifies the maze problem to a pure algorithm FIGURE 8. Robot during maze exploration.
problem and the simulation system can be used to
debug the program logic. Once this stage has been test the extended robot program under these harder — but
achieved, the program is still far from being able to
succeed in a real robot environment, since the PROGRAM 1. Follow the left wall.
world is not perfect. There will always be errors of
a few mm in the robot’s distance sensors, the void explore_left(int goal_x, int goal_y) {
robot will overshoot or stop short its driving int x=0, y=0, dir=0; /* start position */
commands by a few mm, and it will turn a few int front_open, left_open, right_open;
degrees too far or too short — slowly drifting from
while (!(x==goal_x && y==goal_y)) { /* goal not reached */
its ideal trajectory. front_open = PSDGet(psd_front) > THRES;
So, essentially, the robot program has to be left_open = PSDGet(psd_left) > THRES;
extended to allow “robust” or fault tolerant driving in right_open = PSDGet(psd_right) > THRES;
a “realistic” maze environment (while a maze with
if (left_open) turn(+1, &dir); /* turn left */
fixed side lengths and only right angles is already an else if (front_open); /* drive straight*/
artificially simplified environment). This much more else if (right_open) turn(-1, &dir); /* turn right */
realistic scenario of a maze environment can also be else turn(+2, &dir); /* dead end - back up */
executed in EyeSim. We set realistic error values for go_one(&x,&y,dir); /* go one step in any case */
the robot’s sensors and actuators (e.g., found from } }
measurements with the real robots) and can now

NEW! Motor Control Choices from Pololu


1. Choose your protocol. 2. Choose your motor.
RC servo protocol With an operating range
lets you connect to of 6 volts to 18 volts and
an RC receiver or up to 3 A of current,
serial servo controller. you’ll have many
motor options.
Analog protocol is
simple for quick tests
and demonstrations.
3. Choose your
Serial protocol is great feedback mode.
for microcontroller- or
computer-based control. Position feedback mode allows you to use a
shown actual size
potentiometer or other analog voltage source
to accurately move to exact positions.

Visit www.pololu.com or call 1-877-7-POLOLU Speed feedback mode allows for tachometer-
based control of your motor’s speed.
for more innovative motion control solutions.

Circle #145 on the Reader Service Card.


SERVO 01.2005 47
Braunl.qxd 12/8/2004 8:23 AM Page 48

Mobile Robots Between SIMULATION & REALITY


the maze. However, the rule does not work for mazes
that have the exit (or goal) somewhere in the middle
— one (or the robot) will then be lost forever in the
maze.
Program 1 shows an implementation of the
always follow the left wall algorithm. In each field,
the robot uses its PSD sensors to check whether there
are walls to the left, front, or right side. It then tries
to drive to the field left of its current position. If this
is not possible because of a wall, the robot tries to
drive straight. If this is not possible, it tries to drive
right. If neither is possible (the robot would then be
FIGURE 9. The algorithm follow the left wall versus recursive maze trapped in a dead end with three surrounding walls)
exploration algorithm. it will turn around and back up to the field it came
from.
more realistic — conditions. If the extended program masters Unfortunately, the algorithm from Program 1 finds only
the simulation with error settings, it is then ready to be one path from start to goal, but not necessarily the shortest
subsequently used on the real robots. one. To find the shortest path, we need to implement a
For now, let’s only look at the algorithmic side of things. recursive algorithm that explores the complete maze (see
If you have ever been trapped in a maze (or have watched Program 2). The robot measures, in every field, the distance
Stanley Kubrick’s film, The Shining), you may remember this to left, front, and right and enters the information about
rule to find the exit: Always follow the left wall. (Another surrounding walls in its data structure. This allows it to build
rule that also works is always follow the right wall; however, a complete reconstruction of the maze structure, step-by-
you must not mix these two rules!) This simple rule does, in step.
fact, find the exit for most mazes because — quite often — The robot begins maze exploration at the start field. If
the entry and exit are located along the outside border of there are no walls at its current position (see Figure 9), it will
first explore the field to its left (then continue the recursive
PROGRAM 2. Recursive maze exploration. search from there), then the field in front (and continue
recursively), then the field to its right (and continue recursively).
Every new field is being marked in a data structure, so the
void explore() {
int front_open, left_open, right_open, old_dir; robot knows which field it has already visited, which is
required for the algorithm to terminate.
mark[rob_y][rob_x] = 1; /* set mark */ Figure 10 shows the robot’s local data structure after
PSDGet(psd_left), PSDGet(psd_right)); exploration. The robot now has a map of the maze and can
front_open = PSDGet(psd_front) > THRES; use it for finding the shortest path. For example, let’s start
left_open = PSDGet(psd_left) > THRES; in the bottom left field with [y, x] = [0, 0] and search the
right_open = PSDGet(psd_right) > THRES; shortest path to the top right field [8, 8]. The algorithm we
maze_entry(rob_x,rob_y,rob_dir, front_open); are using is called flood-fill. From the start field [0, 0], the
maze_entry(rob_x,rob_y,(rob_dir+1)%4, left_open);
maze_entry(rob_x,rob_y,(rob_dir+3)%4, right_open);
robot reaches field [0, 0] in zero steps (of course, since it is
check_mark(); already there) and the neighboring field [1,0] in one step. We
old_dir = rob_dir; now compute the distance from each newly reached field to
all their neighbor fields (in case there are no walls in
if (front_open && unmarked(rob_y,rob_x,old_dir)) {
between). If field [y, x] is
go_to(old_dir); /* go 1 forward */
explore(); /* recursive call */ FIGURE 10. Maze representation. reachable in k steps, then
go_to(old_dir+2); /* go 1 back */ neighbor fields [y+1, x],
} ..................... [y-1, x], [y,x+1], [y, x-1]
if (left_open && unmarked(rob_y,rob_x,old_dir+1)) {
._._._._._._._._._... are all reachable in k+1
go_to(old_dir+1); /* go 1 left */ | _ _ _ _ _| |.. steps, provided there are
explore(); /* recursive call */ | | _ _ _ | |_ _|.. no walls in between and
go_to(old_dir-1); /* go 1 right */ | | |_ _ _ | | | |.. we have not already
}
| | _ _|_ _| _|.. established a shorter path
if (right_open && unmarked(rob_y,rob_x,old_dir-1)) { | |_|_ _ _ _ _ _ |.. to any one of these in a
go_to(old_dir-1); /* go 1 right */ | |_ _ | _ | |.. previous step.
explore(); /* recursive call */ | _ | |_ _| | _|.. We continue with this
go_to(old_dir+1); /* go 1 left */ iterative process until we
} | | | | | _ _ |..
} |.|_ _ _|_ _ _ _|_|.. have reached the goal
field or until we have
48 SERVO 01.2005
Braunl.qxd 12/8/2004 8:25 AM Page 49

Mobile Robots Between SIMULATION & REALITY

Figure 11. Recursive maze exploration.

visited all reachable fields (the goal would not be reachable (CAMGetColFrame). Images can be displayed on the robot
in this case). console (LCDPutColorGraphic) and manipulated by using
image processing routines on the robot.
Object Detection and Tracking A simple problem is the detection of an object by using
Simulation gets much more interesting with the capability its color. For this task, we have placed a red ball in the robot’s
to perform image processing on the simulated robot. Like all environment and put the robot at a random position and
real robots in the EyeBot family, the simulated robots may orientation. We use a top-down program design strategy. We
have a virtual camera onboard, which can be accessed assume we have an image processing routine for ball
through RoBIOS calls in order to read an image detection ColSearch, then write our main program around it.

w
e
N
KHR-1 Robo-One Robot Kit
These awesome kits are the latest craze in Japan.
Robot has 17 motors for fluid movements.
Programed and Controlled via PC.
Upgradable to Bluetooth wireless.

BROUGHT TO YOU BY WWW.SOZBOTS.COM


Circle #151 on the Reader Service Card.
SERVO 01.2005 49
Braunl.qxd 12/8/2004 8:26 AM Page 50

Mobile Robots Between SIMULATION & REALITY

Figure 12. Object detection with onboard camera.

In a loop, we read a camera image and display it on the LCD, from function ColSearch, we return the column number
then call our detection routine ColSearch, and print its results (pos) with the highest concentration (val) of matching color
as text on the LCD (using LCDPrintf). values.
While we are not close enough to the object (val<20, Figure 12 shows the execution of the object detection
which means ball diameter is less than 20 pixels), we continue program. At the beginning of the experiment, the robot is
driving. If the detected ball position is equal to -1 (no ball facing the wall and is not able to see the ball. Following the
detected) or between 0 and 20 (ball detected in the left algorithm, the robot turns on the spot until the ball is being
image third), we rotate the robot to the left (VWDriveTurn). detected in the middle third of its local camera image. The
If the detected ball position is between 60 and 79 (ball robot then drives toward the ball and corrects its orientation
detected in the right image third), we rotate the robot to the in case the ball drifts towards the left or right image border.
left; otherwise, we drive a short distance forward Note that this algorithm requires the ball to be visible
(VWDriveStraight). from every board position; otherwise, the robot would spin
What is still missing is the actual implementation of the forever. An alternate solution would be to drive to various
ball detection routine ColSearch. Since color objects are points in the environment and start searching for the
easier to detect in the HSV color model (hue, saturation, ball locally.
value) than the camera output format RGB (red, green, blue),
our first step is to convert RBG to HSV. Downloads and Further Reading
However, this step is not always necessary. For example,
for the detection of a red object, one could more easily work The complete simulation system (version 6.1) for
on RGB values directly. Windows is freely available and can be downloaded from:
In the next step, we generate a column histogram in a http://robotics.ee.uwa.edu.au/eyebot/ftp/rob61win.
loop over all pixels. This means we count for every column exe (43 MB).
the number of pixels with a color (hue) that is similar to the This package contains the full EyeSim simulation system,
desired object color (obj_hue). With this, we get a number robot models, environments, example programs, and docu-
representing the concentration of the desired color value for mentation. Also included are the C/C++ compiler MinGW
each column. We only have to find the maximum value over and the RoBIOS environment for the real EyeBot robots.
all columns in order to find the ball’s position. As a result, See these general websites for more details and down-
loads of newer versions, as well as the EyeSim Linux version
About the Authors (version 5.01):
http://robotics.ee.uwa.edu.au
Thomas Braunl is Associate Professor at the University of http://robotics.ee.uwa.edu.au/eyebot/ftp/
Western Australia in Perth, where he directs the Centre for
Intelligent Information Processing Systems (CIIPS) and the Details on the EyeCon controller and SoccerBot robots
Mobile Robot Lab. He has published a number of books and are available from:
created the EyeBot mobile robot family. Axel Waggershauser is http://joker-robotics.com
a graduate student who is just finishing his Master’s Degree at
the University Kaiserslautern, Germany. He implemented EyeSim For further reading on robot design and applications —
version 5 under Linux. Andreas Koestler is a graduate student at both simulated and real — we recommend the book:
FH Giessen, Germany and has continued Axel’s work with Embedded Robotics — Mobile Robot Design and
implementing EyeSim version 6 under Windows. Applications with Embedded Systems by Thomas Braunl,
Contact details are available from http://robotics. Springer-Verlag 2003, 434 pages, hardcover, ISBN 3-540-
ee.uwa.edu.au
03436-6. SV
50 SERVO 01.2005
Williams.qxd 12/8/2004 9:44 AM Page 51

Many robotics experimenters

build small robots or devices

that are intended to stay within

the limits of a room in a house


by Karl Williams

or school. An inexpensive way to

remotely control these machines

is to use a television infrared

remote control transmitter.

SERVO 01.2005 51
Williams.qxd 12/8/2004 9:45 AM Page 52

INFRARED REMOTE CONTROL SIGNAL ANALYSIS


those signals is useful for is used by Panasonic. The shift coded
controlling small robots or scheme uses the direction of transition
devices. (phase) of the signal to represent the
Infrared remote controls data and all bits have a constant time
use anywhere from 12 to 60 period. In the shift coded scheme, a
bits when transmitting binary 0 is represented by the signal
codes. switching from high to low within a
As you will see later in constant time period. A binary 1 is
the article, only 8-10 of represented by the signal shifting
these bits are usually needed from low to high within a time period.
when controlling a robot. If The shift coded protocol is known as
you plan on using only the RC-5 and is used by Philips.
television controls on the The most common technique and
remote, then as little as four the one that we will investigate is
bits of the information is known as Pulse Width Modulation
Figure 1. A variety of infrared remote control necessary. (PWM). This method works by varying
transmitters. the duration of the ON or OFF periods
Infrared Signals of the modulated infrared. In order to
Most of the published literature and How They Work control a device, a unique number
focuses on using the Sony 12-bit representing the key that has been
protocol. I think the reason for this is IR remote control operates by pressed on the remote and possibly
because Sony uses a 12-bit standard modulating (turning on and off) an information about which device this
without any error checking, making it infrared (IR) light source. Infrared light key is intended to control needs to be
easy to decode. I already have a lot is located on the electromagnetic sent. This is done by representing the
of IR remote control transmitters spectrum just below the visible light number in binary or base 2. In binary,
lying around the house that have that our eyes can see. The rate at there are only two digits — 0 and 1 —
outlived their AV units, but none of which the modulation occurs is called to deal with.
them is from Sony — not to mention the carrier frequency. This is done to Therefore, only two distinct “pulse
the three remotes in the living provide a transmission system that widths” are needed to represent
room for my television, VCR, and allows operation in noisy lighting each digit. This simplifies the process
DVD player (Figure 1) that I could use environments. The remote control considerably.
for experimenting. information is placed on the carrier Using this scheme, the periods of
This article will focus on analyzing using several different techniques, ON and OFF will need to alternate. If
the signals generated by standard depending on the manufacturer. they didn’t, it would be impossible to
38 kHz IR transmitters and then deter- Three of the methods used are judge their widths. Either the width of
mining what information contained in pulse coded, space coded, and shift the ON period or the width of the OFF
coded, as illustrated in Figure 2. period will vary, depending on the
Figure 2. Information coding methods With the space coded method, manufacturer. In summary, IR transmis-
employed by infrared remote systems. data is represented by varying sions most often take place by varying
the space (amount of time) the ON/OFF times of an IR emitter to
between pulses. The space coded represent binary numbers according to
protocol is known as REC-80 and an established pattern. All that needs
to be done is to capture
Figure 3. PNA4602M and TRM1038 infrared the entire signal, measure
receiver modules. the width of each pulse,
and then decode the
pattern.

Analyzing
an Infrared
Remote
Control Signal
To capture the
infrared packet being
transmitted by the remote
52 SERVO 01.2005
Williams.qxd 12/8/2004 9:46 AM Page 53

INFRARED REMOTE CONTROL SIGNAL ANALYSIS


control, an IR receiver module that
responds to a 38 kHz carrier will
be needed. These detectors have a
band-pass filter that limits the input to
38 kHz only. This means that the
detector will give an output only when
a 38 kHz infrared signal is received. I
experimented using the Panasonic
PNA4602M module and two others (a
part labeled TRM1038 and a generic
unlabeled module) that I picked up at
a surplus electronics shop and each
functioned with the same results
(Figure 3).
The PNA4602M detector’s output
is active-low. That means that the
output is low when a 38 kHz IR signal
is being received. When no 38 kHz Figure 4. Infrared decoding circuit schematic diagram.
signal is present, the detector’s output
is high. Because I had a Sanyo IR common and inexpensive — thanks to in Figure 4. I use a Tektronix TDS 210
remote around, I decided to decode current RS-232 implementation and two channel, 60 MHz oscilloscope.
the signals that it produces to show an the excellent I/O specifications of the Set channel 1 to 2 volts per division,
alternative to using the Sony codes. PICmicro MCU — most applications a horizontal time of 10 ms, and the
Hopefully, the information that follows don’t require level converters. Rather, trigger mode to single.
will let you use all of those non-Sony inverted TTL (N300..N9600) can be If you need more information
remotes that are piling up. used when transmitting from the about how to use an oscilloscope,
To analyze the signals that are PICmicro to the computer. A 1KΩ then check out the excellent
being received by the PNA4602M IR current limiting resistor is suggested, oscilloscope tutorial on the Tektronics
module, an oscilloscope will be used but not necessary. website (www.tektronix.com/
along with a Microchip PIC 16F819 The infrared decoding circuit Measurement/App_Notes/XYZs/).
microcontroller that is clocked at 8 schematic (Figure 4) is simple enough Before writing a signal analysis
MHz internally. The PIC 16F819 will be to construct on an experimenter’s program for the microcontroller, let’s
interfaced to a personal computer breadboard. When the circuit is wired, take a look at the signal being transmit-
through the serial port of the PC. The attach the circuit to the computer’s ted from the Sanyo remote control
microcontroller will receive and store serial port using a straight through using an oscilloscope. Apply power to
the incoming infrared packets from the serial cable. Attach the channel 1 the circuit and set the oscilloscope as
PNA4602M IR module and then per- oscilloscope probe to the output pin of described above. Pressing the “1” key
form an analysis of each signal based the PNA4602M module, as indicated produces the waveform shown in
on the internal software
that will be written. Figure 5. Waveform produced by pressing the “1” key on the Sanyo remote.
When the analysis is
being performed, the
information will be sent
from the microcontroller
to a communications
terminal window on a PC
so that you can see what
is going on. This method
was used instead of a
serial LCD because I
wanted to be able to
display a list of packet
information to see what
sort of patterns were
emerging.
While single chip RS-
232 level converters are
SERVO 01.2005 53
Williams.qxd 12/8/2004 9:48 AM Page 54

INFRARED REMOTE CONTROL SIGNAL ANALYSIS


Figure 5. It is made up microcontroller software will need to
CODE 1 of 34 pulses — if you be written in order to capture and
START: include the last one — analyze the IR packet.
PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(0) that represent bits. The software examples are
IF IR_PULSE(0) = 0 THEN START As you can see, the given in the PicBasic Pro language
FOR I = 1 TO 33 large amount of time developed by microEngineering Labs
PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(I) (relatively speaking) (www.melabs.com) for Microchip
NEXT I of 9.2 ms goes by Technology’s powerful Picmicro micro-
with the output being controllers. The PicBasic Pro compiler is
low (0 volts) before “BASIC Stamp II-like” and has most of
CODE 2 the first pulse. This the libraries and functions of both
indicates the start of the BASIC Stamp I and II. Being a true
HIGH LED the transmission. compiler, programs execute much
FOR I = 0 TO 33 The first pulse in faster than their interpreted Stamp
IF IR_PULSE(I) > 150 THEN the packet is much equivalents.
SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, wider (4.2 ms) than You will also need a hardware
#(IR_PULSE(I) * 53) / 10, “ US = 1”] those that follow and programmer — such as the EPIC Plus
ELSE will be used by the programmer, also available at
SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, microcontroller soft- www.melabs.com — to program the
#(IR_PULSE(I) * 53) / 10, “ US = 0”] ware to trigger the PIC with the .HEX files that are
ENDIF measuring and storing generated by the compiler. I also use a
SEROUT COM,COM_BAUD,[13,10] of the width values of free integrated development environ-
NEXT I each pulse in the pack- ment called MicroCode Studio
LOW LED et. All of the pulses (www.mecanique.co.uk) because it
that follow are 5 volts makes editing, compiling, and pro-
and either have a gramming PIC microcontrollers easier.
Figure 6. Pulse timing values and their binary width of approximately One of the nice features of MicroCode
representations. 0.4 ms or 1.6 ms, except Studio is the serial communications
for the last pulse. window that will be used to display the
The space between signal analysis data.
each pulse is 0 volts and is
consistently 0.7 ms. The 0 Capturing and
volt, 0.7 ms space is a
marker to differentiate
Storing the Signal
between each bit. The The PicBasic Pro code segments
5 volt pulses that are will be listed for each of the functions
0.4 ms wide represent as they are discussed and then the
logic zero (0) and the entire program will be listed at the end
pulses that are 1.6 ms of the article.
wide represent logic one The first thing that the microcon-
(1). With the help of troller IR analysis program needs to do
the oscilloscope, we now is to determine the start of an IR pack-
know exactly what et transmission. This is done by moni-
toring for the first high
CODE 3 pulse on the output of
the PNA 4602M, as
HIGH LED shown in Figure 5. The
FOR I = 0 TO 33 PULSIN command is look-
IF IR_PULSE(I) > 150 THEN ing to measure the width
SEROUT COM,COM_BAUD,[“1”] of a pulse and — since the
ELSE output is constantly high
SEROUT COM,COM_BAUD,[“0”] — PULSIN returns a value
ENDIF of 0 when there is no
NEXT I activity. As soon as the
SEROUT COM,COM_BAUD,[13,10] start of the transmission
LOW LED has been detected, the
program will measure the
54 SERVO 01.2005
Williams.qxd 12/8/2004 9:49 AM Page 55

INFRARED REMOTE CONTROL SIGNAL ANALYSIS


width of each of the
following pulses CODE 4
and then store ‘ OUTPUT ALL BITS IN THE PACKET
these values in an
array variable that HIGH LED
we will call FOR I = 0 TO 33
IR_pulse(33). The IF IR_PULSE(I) > 150 THEN
PicBasic Pro code SEROUT COM,COM_BAUD,[“1”]
segment is shown in ELSE
Code 1. SEROUT COM,COM_BAUD,[“0”]
Now that the ENDIF
pulse width infor- NEXT I
mation has been SEROUT COM,COM_BAUD,[13,10]
stored in the array, a
routine will deter- ‘ CONVERT BITS 15 THROUGH 23 TO A DECIMAL
mine the timing VALUE
values of each
pulse, decide RESULT = 0
whether each pulse POWER = 1
represents either FOR I = 0 TO 8
logic “1” or logic IF IR_PULSE(15 + I) > 150 THEN
“0,” and output the RESULT = RESULT + POWER
results to the serial ENDIF
c o m mu n i c a t i o n s
POWER = POWER * 2
window on the PC.
NEXT I
The light emitting
SEROUT COM,COM_BAUD,[“ = “,#RESULT,13,10]
diode (LED) will be
LOW LED
turned on at the
RETURN
beginning of the
routine and turned
off when it completes so that the user baud rate of 2400, parity Figure 7. Binary packet information with decimal
is aware that a packet is being = none, byte size = 8, and equivalents of bits 15 through 23.
processed. One thing to note is that stop bits = 1. In order to
the PicBasic Pro PULSIN command advance the cursor to the next line in changed from one packet to the other.
calculates its values assuming that the the communications receive window, Once a complete list of key values is
processor is clocked at 4 MHz. the numbers 13 and 10 decimal output to the communications window,
Since we are using an 8 MHz are transmitted after each line of it is easy to see from the binary
clock, the timing values that have been output. This corresponds to the ASCII patterns that bits 15 through 23 pro-
obtained are smaller than the actual carriage return and new line duce unique values for each key
times. This means that — for a .4 ms characters (CR and NL), respectively. pressed on the remote control. To
time — a value of approximately 76 is Figure 6 is a screen shot of the make life easier, bits 15 through 23 are
returned by PULSIN and a value of 302 communications window displaying converted to decimal values. Bits 0
is returned for a 1.6 ms pulse. To the output produced by the routine in through 14 remain consistent for most
get the proper measurements in Code 2 when the “1” key is pressed on of the keys and are probably used to
microseconds, those values will need to the Sanyo remote. identify which device the signal is
be multiplied by 5.3. The 5.3 multiplier The next step will be to capture meant to control. The next code seg-
was determined so that the PIC timing and display the binary packet values ment will display the binary values of the
values correspond to the accurate transmitted for each of the buttons entire packet — along with the decimal
oscilloscope timing values of the pulses on the remote control so that we can equivalent of bits 15 through 23, with
and to compensate for the actual analyze and determine which bits can bit 15 being the least significant bit.
oscillator frequency. be used to control a robot or device. The output produced by this routine is
Because PicBasic can’t perform Code 3 will output all of the bits in shown in the code in Figure 7.
floating point math and I wanted the packet to the communications The decimal values that are
better precision for the timing values, window. I transmitted the codes for derived from the bits in the packet can
I used the technique of multiplying by all of the keys on the remote so that I now be used to control a robot or any
53 then dividing the result by 10. Set could visually determine which bits other application that needs close
up a communications terminal with a were consistent and which ones proximity remote control. If you plan
SERVO 01.2005 55
Williams.qxd 12/8/2004 9:50 AM Page 56

INFRARED REMOTE CONTROL SIGNAL ANALYSIS


on using only the television controls on array, convert the useable bits to a remote is called ir-decode.bas and is
the remote, then bits 25 through 28 decimal value, and then use that listed in Code 5. It can be used as a
can be used to create unique values — value to determine what events you starting point when writing routines
that’s only four bits! want to occur by using an for other remotes. The PicBasic
To summarize, all you need to do IF..THEN..ELSE..ENDIF or SELECT CASE program and the HEX file to program
to control a device with an IR remote is decision statement. The entire program the PIC 16F819 can be downloaded at
to capture the packet information in an to analyze the packets from a Sanyo www.thinkbotics.com SV

CODE 5
‘————————————————————————- GOTO START
‘ NAME : IR-DECODE.BAS
‘ COMPILER : PICBASIC PRO - MICROENGINEERING LABS ‘———————- DISPLAY PULSE STREAM ————————
‘ NOTES : IR REMOTE CONTROL DECODING PROGRAM
‘ AUTHOR : KARL P. WILLIAMS DISPLAY_PULSE:
‘————————————————————————- HIGH LED
FOR I = 0 TO 33
@ DEVICE PIC16F819, INTRC_OSC_NOCLKOUT, WDT_OFF, IF IR_PULSE(I) > 150 THEN
LVP_OFF, PWRT_ON, PROTECT_OFF, BOD_OFF SEROUT COM,COM_BAUD,[“1”]
ELSE
INCLUDE “MODEDEFS.BAS” SEROUT COM,COM_BAUD,[“0”]
ENDIF
TRISA = %00011111 NEXT I
TRISB = %00000001 SEROUT COM,COM_BAUD,[13,10]
DEFINE OSC 8 LOW LED
OSCCON = $70 RETURN

‘———— CONVERT USEABLE BITS DECIMAL VALUE ————-


IR_DETECT VAR PORTB.0
COM VAR PORTB.1 CONVERT_BITS:
LED VAR PORTB.2 HIGH LED
COM_BAUD CON N2400 RESULT = 0
IR_PULSE VAR WORD(33) POWER = 1
ACTIVE_LOW CON 0 FOR I = 0 TO 8
ACTIVE_HIGH CON 1 IF IR_PULSE(15 + I) > 150 THEN
RESULT VAR WORD RESULT = RESULT + POWER
I VAR BYTE ENDIF
POWER VAR WORD POWER = POWER * 2
NEXT I
LOW LED SEROUT COM,COM_BAUD,[“BITS 15 TO 23 = “,#RESULT,” DECI-
MAL”,13,10,13,10]
‘———- WAIT FOR START OF PACKET TRANSMISSION ———- LOW LED
RETURN
START:
‘—————— DISPLAY PULSE TIMING VALUES ——————-
PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(0)
IF IR_PULSE(0) = 0 THEN START PULSE_TIMING:
HIGH LED
‘——————— INPUT PULSE STREAM —————————- FOR I = 0 TO 33
IF IR_PULSE(I) > 150 THEN
FOR I = 1 TO 33 SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “,
PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(I) #(IR_PULSE(I) * 53) / 10, “ US = 1”]
NEXT I ELSE
SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “,
‘———————- CALL SUBROUTINES —————————— #(IR_PULSE(I) * 53) / 10, “ US = 0”]
ENDIF
GOSUB PULSE_TIMING SEROUT COM,COM_BAUD,[13,10]
GOSUB DISPLAY_PULSE NEXT I
GOSUB CONVERT_BITS LOW LED
RETURN

56 SERVO 01.2005
Full Page.qxd 12/9/2004 3:56 PM Page 57
BookstoreJan05.qxd 12/9/2004 12:50 PM Page 58

andy
Mind Cday’s
For To ticist
Robo
The SERVO Bookstore
ROBOT DNA SERIES Industrial Robotics Build Your Own All-Terrain
Three Volume Pack by Harry Colestock Robot
With so many industries by Brad Graham / Kathy McGowan
taking advantage of the Remotely operated
tremendous advances in robots are becoming
robotics, entities ranging increasingly popular
from small family because they allow the
businesses to large operators to explore
corporations need areas that may not
assistance in the normally be easily
selection, design, set-up, accessible. The use of
Everything you need to program your maintenance, and eco- video-controlled
robot controller: nomic considerations of industrial technology has sparked
• Microcontrollers in Robots automation. Industrial Robots shows how to a growing public interest not only in
• Software Development achieve maximum productivity with robotics, hobbyists, but also in the areas of research,
• The Microchip PICmicro Microcontroller classifies robots according to their complexity space, archeology, deep sea exploration,
• Microcontroller Connections and function, and explains how to avoid and even the military. Inside Build Your Own
• Designing the Robot System common automation mistakes. $39.95 All-Terrain Robot, the writers enable even
• Going Forward total newcomers to robots to construct a
rugged, video-controlled, talking, seeing,
Everything you need to build your own interacting explorer bot with a range of over
robot drive train: a mile for under $200.00! $29.95
Electronic Gadgets for the
• The Basics of Robot Locomotion
Evil Genius
• Motor Types: An Overview
by Robert Iannini
• Using DC Motors
The do-it-yourself
• Using RC Servo Motors
hobbyist market — Robot Building for Dummies
• Using Stepper Motors by Roger Arrick / Nancy Stevenson
particularly in the area
• Motor Mounting Ready to enter the robot
of electronics — is
• Motor Control world? This book is your
hotter than ever. This
• Electronics Interfacing passport! It walks you
book gives the “evil
• Wheels and Treads through building your
genius” loads of
• Locomotion for Multipods very own little metal
projects to delve into,
from an ultrasonic assistant from a kit, dress-
All the data you need to build your own ing it up, giving it a brain,
microphone to a body
robot base: programming it to do
heat detector, all the way to a Star Wars !
• Mechanical Construction
Light Saber. This book makes creating these things, even making it NEW
• Electrical Construction talk. Along the way, you’ll
devices fun, inexpensive, and easy. $24.95
• Operating Power gather some tidbits about robot history,
• Robot Designs enthusiasts’ groups, and more. $21.99
• Constructing a Two-Wheeled Rover Robot
• Selecting the Right Materials
• Glossary of Terms Robot Builder's Bonanza
• Tables, Formulas, and Constants by Gordon McComb
Robot Builder’s Bonanza Mobile Robotic Car Design
Subscribers: $62.99 Non-subscribers: $69.99 is a major revision of the by Pushkin Kachroo / Patricia
bestselling bible of Mellodge
Limited time only! amateur robot building — This thoughtful guide
Offer expires January 31, 2005! packed with the latest in gives you complete,
servo motor technology, illustrated plans and
microcontrolled robots, instructions for building
remote control, LEGO a 1:10 scale car robot
Robot Programming Mindstorms Kits, and that would cost
by Joe Jones / Daniel Roth other commercial kits. It gives electronics thousands of dollars if
Using an intuitive method, hobbyists fully illustrated plans for 11 bought off-the-shelf.
Robot Programming complete robots, as well as all-new coverage But, beyond hours of
deconstructs robot of Robotix-based robots, LEGO Technic- entertainment and
control into simple and based robots, Functionoids with LEGO satisfaction spent creating and operating an
distinct behaviors that are Mindstorms, and location and motorized impressive and fun project, Mobile Robotic
easy to program and systems with servo motors. $24.95 Car Design provides serious insight into the
debug for inexpensive science and art of robotics. Written by
microcontrollers with little robotics experts, this book gives you a solid
memory. Once you’ve We accept VISA, MC, AMEX, and DISCOVER background in electrical and mechanical
mastered programming your online bot, you Prices do not include shipping and theory, and the design savvy to
can easily adapt your programs for use in may be subject to change. conceptualize, enlarge, and build robotics
physical robots. $29.95 projects of your own. $29.95
58 SERVO 01.2005
BookstoreJan05.qxd 12/9/2004 12:52 PM Page 59

To order call 1-800-783-4624 or go to our website at


www.servomagazine.com

PIC Microcontroller Project Book Build Your Own Humanoid CNC Robotics
by John Iovine Robots by Geoff Williams
The PIC microcontroller by Karl Williams Now, for the first time,
is enormously popular Build Your Own you can get complete
both in the US and Humanoid Robots directions for building a
abroad. The first edition provides step-by-step CNC workshop bot for a
of this book was a directions for six exciting total cost of around
tremendous success projects — each costing $1,500.00. CNC Robotics
because of that. less than $300.00. gives you step-by-step,
However, in the four Together, they form the illustrated directions for
years that have passed essential ingredients for designing, constructing, and testing a fully
since the book was first making your own functional CNC robot that saves you 80 percent
published, the electronics hobbyist market humanoid robot. $24.95 of the price of an off-the-shelf bot and can
has become more sophisticated. Many be customized to suit your purposes exactly,
users of the PIC are now comfortable paying Robot Mechanisms and because you designed it. $34.95
the $250.00 price for the Professional Mechanical Devices Illustrated
version of the PIC Basic (the regular version by Paul Sandin
sells for $100.00). This new edition is fully Both hobbyists and Designing Autonomous
updated and revised to include detailed professionals will treasure Mobile Robots
directions on using both versions of the this unique and distinctive by John Holland
microcontroller, with no-nonsense sourcebook — the most Designing Autonomous
recommendations on which one serves thorough — and thoroughly Mobile Robots introduces
better in different situations.$29.95 explained — compendium the reader to the
of robot mechanisms and fundamental concepts of
devices ever assembled. this complex field. The
Robot Builder's Sourcebook Written and illustrated author addresses all the
by Gordon McComb specifically for people fascinated with pertinent topics of the
Fascinated by the world mobile robots, Robot Mechanisms and electronic hardware and
of robotics, but don’t Mechanical Devices Illustrated offers a software of mobile robot design, with
know how to tap into the one-stop source of everything needed for the particular emphasis on the more difficult
incredible amount of mechanical design of state-of-the-art mobile problems of control, navigation, and sensor
information available on ‘bots. $39.95 interfacing. Its state-of-the-art treatment of
the subject? Clueless as to core concepts in mobile robotics helps and
locating specific challenges readers to explore new avenues
information on robotics? Machine Nature: The Coming in this exciting field. The accompanying
Want the names, addresses, Age of Bio-Inspired Computing CD-ROM provides software routines for the
phone numbers, and websites of companies by Moshe Sipper examples cited, as well as an electronic
that can supply the exact part, plan, kit, Despite being marvels of version of the text. $49.95
building material, programming language, complexity and human
operating system, computer system, or ingenuity, computers are
publication you’ve been searching for? Turn notoriously bad at Robotics, Mechatronics, and
to the Robot Builder’s Sourcebook — a learning new things and Artificial Intelligence
unique clearinghouse of information that will dealing with new by Newton C. Braga
open 2,500+ new doors and spark almost as situations. Researchers Accessible to all readers —
many new ideas. $24.95 at the frontiers of including secondary school
computer science have students and
turned to nature for amateur technology
Robotics Demystified solutions to the enthusiasts — Robotics,
by Edwin Wise problem of machine Mechatronics, and Artificial
There's no easier, faster, adaptation and learning. By applying models Intelligence simplifies the
or more practical way to of complex biological systems to the realm process of finding basic
learn the really tough of computing machines, they have given rise circuits to perform simple
subjects. McGraw-Hill's to a new breed of adaptive software and tasks — such as how to
Demystified titles are hardware. In Machine Nature, computer control a DC or step motor — and provides
the most efficient, scientist Moshe Sipper takes readers on a instruction on creating moving robotic parts,
intriguingly written thrilling journey to the terra nova of computing such as an "eye" or an "ear." Though many
brush-ups you can find. to provide a compelling look at cutting-edge companies offer kits for project construction,
Organized as self- computers, robots, and machines now and most experimenters want to design and build
teaching guides, they in the decades ahead. $24.95 their own robots and other creatures specific
come complete with key points, background to their needs and goals. With this new book,
information, questions for each chapter, and hobbyists and experimenters around the
even final exams. You'll be able to learn more Check out our online bookstore at world will be able to decide what skills they
in less time, evaluate your strengths and www.servomagazine.com for a complete want to feature in a project and then choose
weaknesses, and reinforce your knowledge listing of all the books that are available. the right "building blocks" to create the ideal
and confidence. $19.95 results. $31.95
SERVO 01.2005 59
BrainMatrix.qxd 12/7/2004 4:43 PM Page 60

lathes

Ta Spin B ape
C

il
Sw

ar

Sp dle ore
D C ed
in

ai
C
ria
ist e

in
g

om Tr

n
ge Tra we )
an nt (in)

dl
ov

Sp
Sp

e T rou )
po ave
ce er

C ve en
er

in
ee

ro l (

un l (

ra
dl

Th (
be s (i
Si

ss in

ve
d,

eT
d in)
ze
M

t n

l(
RP

Sl
Fe )
od

SUPPLIER
(in

id

in
in
gh
ed
M
el

)
)

r
Cummins Industrial Tools Mini Lathe 7 x 12 Variable, 100-2500 7 11.8 2.6 2.2 MT-3 0.78 2.5
www.cumminstools.com

Grizzly 7 x 12 Mini 1.38 MT-3 0.75 2.5


7 x 12 Variable, 0-2500 7 11.82 2.75
www.grizzly.com Metal Lathe

Harbor Freight 7 x 10 Precision 2.87 MT-3 0.625 2


7 x 10 Variable, 186-3000 7 7.88 2.75
www.harborfreight.com Mini Lathe

Speedway Series
Homier 7 x 12 Mini Bench 7 x 12 Variable, 0-2500 7 12 2.56 1.38 MT-3 0.75 2.56
www.homier.com Metal Lathe

Jet Equipment & Tools Jet 9 x 20 Lathe 9 x 20 6 speed, 130-2000 8.75 20 5 1.88 MT-3 0.75 1.56
www.jettools.com

LatheMaster LatheMaster 8 x 14 8 x 14 6 speed, 125-2000 8 14 4.5 2.3 MT-3 0.75 2.75


www.lathemaster.com Mini Lathe

MICROLUX 7 x 14
Micromark High-Precision, 7 x 14 Variable, 100-3000 7 14 2.56 2.17 MT-3 0.787 2.13
www.micromark.com Heavy-Duty Lathe

Prazi Prazi MD200 3 speed, 690, 1200, 3.94


4x8 7.87 2.16 1.97” Option MT-1 0.35 1.6
various third party vendors Miniturn Lathe 2240

Prazi Prazi SD300 4 speed, 300, 600,


5 x 12 5.12 11.81 3.5 2.17 MT-2 0.438 1.5
various third party vendors Materturn Lathe 1200, 2400

Sherline Model 4000 Lathe 3.5 x 8 Variable, 70-2800 3.5 8 3 1.5” Option MT-1 0.405 1.25
www.sherline.com

Sherline Model 4400 Lathe 3.5 x 17 Variable, 70-2800 3.5 17 4.25 1.5” Option MT-1 0.405 1.25
www.sherline.com

Taig Tools International Micro Lathe II 4x9 6 speed, 525-5200 4.5 9.75 1.75 Option 15 deg 0.343 0.63
www.taigtools.com

60 SERVO 01.2005
BrainMatrix.qxd 12/7/2004 4:44 PM Page 61

by Pete Miles

Upcoming topics include SBCs and H-bridges, sensors, kits, shop tools, and actuators. If you’re a manufacturer of one of these
items, please send your product information to: BrainMatrix@servomagazine.com Disclaimer: Pete Miles and the publishers strive to present the most
accurate data possible in this comparison chart. Neither is responsible for errors or omissions. In the spirit of this information reference, we encourage readers
to check with manufacturers for the latest product specs and pricing before proceeding with a design. In addition, readers should not interpret the printing
order as any form of preference; products may be listed randomly or alphabetically by either company or product name.
Ra

N
um
te
,

D
bi

be

at
ts

Su
r

a
of
pe

En

pp

Li
C
A

C
r

on

st
ly
cr
nt

se

ha
ne

Pr
yp

Po
en

co

nn
ct

Si

ic
tio

w
nd
na

el

e
ze
or

er
n
s
3" Three Jaw Chuck,Tool Post, Live
and Dead Centers, Drill Chuck, Face
MT-2 No 12 to 52 tpi Plate, Steady and Following Rests, 110 250 13 x 30 x 13 90 $399.99
Gear Set, 5 Piece Cutting Tool Set,
Spare Fuse,Wrenches

3" Three Jaw Chuck,Tool Post, Dead


MT-2 No 12 to 52 tpi Center, Face Plate, Steady and 110 250 13 x 30.25 x 13 78 $399.00
Following Rests, Gear Set

3" Three Jaw Chuck,Tool Post, Live


MT-2 No 12 to 52 tpi 110 250 13 x 26.4 x 13 89 $399.00
Center, Face Plate, Gear Set

3" Three Jaw Chuck,Tool Post, Dead


MT-2 No 12 to 52 tpi 120 400 W 13 x 30.25 x 13 85 $299.00
Center, Face Plate, Gear Set

4" Three Jaw Chuck, 7" Four Jaw


Chuck,Threaded Back Plate, Face
MT-2 Yes 8 to 56 tpi Plate, Single Tool Post, Steady and 115 550 20 x 37.5 x 45 235 $999.99
Following Rests, Live and Dead
Centers,Threading Dial, More
4" Three Jaw Chuck, 5" Four Jaw
Chuck, Face Plate, Four Way Tool Post,
MT-2 Yes 8 to 40 tpi 110 550 17.5 x 17.5 x 34 190 $695.00
Steady and Following Rests, Dead
Center,Threading Dial, Gear Set

3" Three Jaw Chuck,Tool Post, Dead


MT-2 Yes 12 to 52 tpi 110 350 12 x 35 x 12.75 90 $574.95
Center, Gear Set, Digital Tachometer

2.6" Three Jaw Chuck, Dead Center, varies by


MT-1 Yes None 110 120 9.5 x 25 x 7.5 55
Tool Post, One Cutting Tool vendor

3" Three Jaw Chuck,Tool Post, One varies by


MT-1 Yes 11 to 60 tpi 110 250 11 x 31.5 x 8.5 97
Cutting Tool, Dead Center, Gear Set vendor

Tool Post,Two Dead Centers, One


MT-0 Yes Option 100-240 250 7.5 x 24 x 6 24 $575.00
Cutting Tool

Tool Post,Two Dead Centers, One


MT-0 Yes Option 100-240 250 8.75 x 32.25 x 8 30 $675.00
Cutting Tool

3" Three Jaw Chuck,Tool Post, 1/4


Custom Yes None 115 190 12 x 16 x 6 40 $399.00
Jacobs Drill Chuck, Pulleys

SERVO 01.2005 61
JanNewProducts.qxd 12/9/2004 9:41 AM Page 62

New Products

New Products
CIRCUIT BOARDS PLATFORMS

Canadian Circuit Board Solution  Revolutionizes


Botster
Robotics Kit Market
P CBexpress now manufac-
tures and ships their
quick turn around, quality S ummerour Robotics
Corporation sets a new
prototypes to Canada. standard in price, flexibility,
Due to the overwhelming and style for programmable
increase in Canadian cus- robotic kits with the launch
tomers, PCBexpress has created of their new Botster™ plat-
a specialized website dedicated to Canada — form. Botster provides an
www.PCBexpress.ca They’ve incorporated the same economical way for hobby-
pricing, quality, and ease of ordering that they have been ists, students, and educators to jump-start their robotic
offering for the past seven years from their US online projects. The provision of a ready-made platform allows
service. Combined with 29 years of PCB manufacturing, more time for enthusiasts to develop intelligent software.
they provide experience and reliability for your circuit The rugged, boxed chassis holds up well under
board needs. constant usage and is styled with a dynamic appeal that
makes it look fast and agile — even just sitting still.
Here are a few of the benefits of ordering your circuit Users can easily implement autonomous behavior via
boards through PCBexpress.ca: features that include an integrated wheel encoder system,
Sharp™ infrared sensor mounts, and differential drive
• First online quote and order e-commerce site of its kind motors. The wheel encoder system provides 0.187” of
for Canada’s PCB industry. linear resolution and is used to provide speed and distance
• Quick turn prototype circuit boards available in hours, information to the user’s controller.
rather than days. The Botster’s differential drive design allows it to pivot
• Boards manufactured and shipped WITHIN Canada. around its center to easily navigate out of tight spaces. The
• All prices calculated in Canadian dollars. (No more conver- included heavy duty hobby servos power the Botster and can
sion headaches.) be controlled from any controller featuring two Pulse Width
• Option for centimeters or inches. Modulation (PWM) ports. The Botster’s weight is supported
• Two to six layer circuit board prototypes — up to 25 pieces. by the drive wheels and the heavy duty steel ball caster.
• Online pricing and simplified ordering. The rear vertical deck folds down for access to the
• Never a tooling charge. inner cavities of the Botster and can accommodate the
• PCBs routed to any shape. following controllers:
• Excellent customer support, including live help.
• PDA (largest currently available)
Try out their seamless order process and receive two • PC104 controller
free boards (when you order four or more). Just enter in • Small single board computer
“2for4” as your gift certificate code when placing your • Up to two microcontrollers
orders.
For further information, please contact: The front vertical deck can be used to mount sensors,
recharging circuitry, or an optional breadboard that can be
Website: www.pcbexpress.ca or used for robotic circuit experiments. The horizontal decks
PCBexpress www.pcbexpress.com
(for small orders of prototypes) can be used to mount communication modules, microcon-
www.pcbpro.com trollers, sensors, or more power supplies.
(higher production volumes)
www.pcb123.com (PCB design software) A fully integrated turret is also available as an option.
Circle #26 on the Reader Service Card. It bolts into the middle deck and comes in two versions: a

62 SERVO 01.2005
JanNewProducts.qxd 12/9/2004 9:42 AM Page 63

New Products

CMUcam2 version and a generic version. The generic version In its more advanced form, software developers can
can be use to mount various robotic components, such as take advantage of RoboEye’s open sourced image trans-
sonar ranging modules, digital cameras, and more. New mission protocol for further decision making and analysis
holes can be easily drilled into the chassis decks to mount on a computer. This is done using an OCX application and
extra sensors, components, or controllers. intercepting a data packet stream that describes pixel
Botster’s dimensions are 5.5” W x 5.5” D x 7.25” H. Fully colors and location. This type of use is similar to the
laden (PDA, microcontroller, batteries, wiring, CMUcam2, popular CMUcam, except that image analysis can be done
and breadboard), the Botster weighs approximately 3.2 lbs. with PC software instead of the BASIC Stamp.
The Botster kit starts at $99.95 and comes in several
configurations of controllers, sensors, and turrets. Parts included in the kit:
For further information, please contact:
1 RoboEye Sensor module
P.O. Box 998
Summerour Braselton, GA 30517 1 RoboEye USB module
Robotics Corp. Tel: 770•314•1577 1 3-pin 10” female/female cable (white, red, black)
Email: sales@roboticsconnection.com
Website: www.roboticsconnection.com 1 Lens and lens holder (black plastic)
Circle #38 on the Reader Service Card.
2 Right-angle aluminum bracket parts
4 4/40 1/4” screws
4 4/40 nuts
2 M2 x 10 screws
SENSORS Note:This part requires a USB cable to interface from this
unit to a PC (not included). This cable can be ordered
from Parallax, Inc., part number 805-00007.
The RoboEye Sensor
P arallax has introduced the
RoboEye Sensor. It pro-
vides both a simple and sophis-
RoboEye PC software and BASIC Stamp source code is
available in the downloads section at www.parallax.com

ticated method of robotics Note: Once you have received your RoboEye, please
vision and control. In its simple pay close attention to the setup process described in the
form, the RoboEye Sensor printed documentation on installation of the USB driver.
sends a 168 x 110 pixel image The setup of the RoboEye Sensor Module and configura-
over a 2.4 GHz wireless band tion works best if done in a particular order.
for display on your PC using For further information, please contact:
the RoboEye software. An additional serial I/O line may be 599 Menlo Dr. #100
used to send control commands or data between the Parallax Rocklin, CA 95765
RoboEye software terminal and a BASIC Stamp. The wire-
Incorporated Tel: 888•512•1024
Email: sales@parallax.com
less data link includes built-in error checking. This device is Website: www.parallax.com
suitable for the Boe-Bot, as well as your own custom robot. Circle #45 on the Reader Service Card.

SERVO 01.2005 63
MrRoboto.qxd 12/8/2004 9:10 AM Page 64

Our resident expert on all things


robotic is merely an Email away.
roboto@servomagazine.com

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

by
Pete Miles

Q .I would like to be able to program a PC to control


several servos for a robotic Halloween display I want
to make for next year. The problem is that I have no
idea where to start. Do you have any suggestions on how I
could go about doing something like this?
a fog-making machine.
Figure 1 shows a simple Form layout for a Visual Basic
5.0 program example. Two horizontal scroll bars are used for
moving the servo positions. The check boxes are for special
relay switching options. The telephone and stopwatch icons
— Paul Gear are for establishing serial communications and servo position
via Internet update timing. In this application, the Visual Basic program
itself will be used to maintain the servos’ 50 Hz position

A .This sounds like a fun project. Okay, there are several


different ways to go about solving this problem. One of
the more common ways to do this is to use a serial
servo controller. These controllers hook up directly to a serial
port on your computer and — with some software that
update timing instead of the BASIC Stamp. This simplifies
synchronizing the timing between the Stamp, PC, and
the servos.
If you are not familiar with using Visual Basic, just follow a
couple of the tutorial examples and you will see how quickly
comes with the controller — you can control your project. this Form can be put together and running. Figure 2 shows
Table 1 has a few servo controllers that you can take a what the graphical user interface looks like when the
look at. program is running.
This column got me thinking about how I could make a The Visual Basic program listing shown here is all that
custom application to directly drive R/C style servos. So the is needed to make this application talk to a BASIC Stamp,
rest of this is a more generic approach to solving this problem control two servos and four outputs, along with selecting
with Visual Basic from Microsoft (www.microsoft.com) and which serial port to use when controlling the BASIC
a microcontroller from Parallax. Stamp.
The example shown here only uses two servos, but can The Form_Load() subroutine is used to initialize all the
be modified to include additional servos. Also, to make things variables and the appearance of the user interface. This is
a little more interesting, I added four check boxes that can be why you see several differences between Figures 1 and 2.
used to turn on and turn off external relays. The relays could Figure 2 shows that the Com port was set to a value of 6.
be used for things like turning on red eyes, a sound box, or This just happened to be an open Com port on my computer
when I wrote this program. It will most
Servo Controller Company Website likely be different on your computer, so
you can change the default value in
Parallax Servo Controller Parallax, Inc. www.parallax.com the program to what is normally open
on your computer. The Command1
Mini SSC II Scott Edwards Electronics, Inc. www.seetron.com button is used to open and close the
Com port.
SSC-12 Lynxmotion, Inc. www.lynxmotion.com
When running the program, you
Quad Serial Servo Controller Phigets www.phigets.com must open the Com port in order for
the program to talk to the BASIC
ServoPod USB New Micros, Inc. www.newmicros.com Stamp. When this button is pressed,
the Command1_Click() subroutine is
Table 1. Serial servo controllers. executed. This routine is used to verify
64 SERVO 01.2005
MrRoboto.qxd 12/8/2004 9:11 AM Page 65

that the Com port selected is


valid. It has a simple error trapping
routine to test if the Com port is
open or being used by another
application.
If the Com port is available, it
will open it for use or alert you to a
problem. It will then change the
name of the button to “Close Port”
so that it will close the port when
you press the button again. Figure 2. Final user front end
The meat of this entire program Figure 1. Visual Basic Form layout. for this project.
is in the Timer1_Timer() subroutine.
At the end of the Form_Load() subroutine, the variable For simplicity, the accessory byte is configured to
Timer1.Interval is set to 15. This causes the Timer1_Timer() output its results as a four bit binary number. Additional
subroutine to execute every 15 ms. This value can be data can be transmitted just by adding additional
changed up or down a little based on your needs, MSComm1.output commands to the program. For example,
but shouldn’t exceed 20 ms, since this could have you could include variable data — such as time or tempera-
adverse effects on how well your servos will maintain their ture — so that your project does something different based
positions. on this information.
The first thing this subroutine does is check to see if the Figure 3 shows a wiring schematic for this project. The
Com port is open. If it is, then the MSComm1 object is Check Box outputs are wired to LEDs to visually see the
executed four times. Each time the MSComm1.output results when the Check Boxes are clicked and unclicked. The
command is executed, one byte of data at a time is sent to 470K Ω resistor and LED can be replaced with the relay
the serial port. Since this command sends ASCII characters, control circuit shown here for turning on and turning off
the CHR$() command is used to convert numerical BYTE data higher voltage/current devices.
into its ASCII equivalent. This is very important to remember When working with serial communications, it is
when modifying this program. All data is transmitted as extremely important to make sure that the data that is
ASCII characters. being transmitted is in the exact same format that
The first character that is sent is the ASCII equivalent to the microcontroller is expecting to receive. This is the num-
the number 255. This is used to synchronize the Stamp to ber one problem people have when working with serial
the PC. At 9600 baud, this can be viewed, in essence, as communications.
outputting a 1 ms pulse for the Stamp to look for before First, make sure that the baud rate, number of data bits,
accepting any further serial data. The next two bytes of data and number of stop bits are identical in the transmitting and
that are being sent are positions of the two servos based receiving programs. In this application, the serial data is
on the current position of their respective horizontal scroll being transmitted at 9600 bits per second (BAUD), eight
bars and the final byte of data that is sent is the option data bits, and one stop bit.
(accessory) byte. Second, make sure the receiving program is expecting

Figure 3. Project schematic drawing.


+5V SERVO POWER

Vdd 2

1
BASIC
STAMP
2 11 +5V
470 ohm

SERIAL DATA IN 15 12 5V SPDT RELAY


470 ohm SERVO #1 SERVO #2

SERIAL GROUND
13 IN4001
470 ohm

14
Vcc
470 ohm
STAMP I/O PIN

1 Kohm RELAY CONTROL


2N2222A

SERVO 01.2005 65
MrRoboto.qxd 12/8/2004 9:15 AM Page 66

Third, the data needs to be synchronized


Microcontroller RS-232
so that — when the serial input routine starts —
Logic State Logic State Voltage State Logic State Voltage State
it will start when the first byte of data is being
transmitted. When first programming this,
Low (0) 0 — Low 0V 0 — Space +3 to +12 V start by transmitting one byte of data and use
a debug window to verify that it is receiving the
High (1) 1 — High +5 V 1 — Mark +3 to -12 V proper data, then transmit two bytes, then
three bytes, and so on.
Table 2. Serial communication signal levels. The other sources of problems include
determining whether the transmitting signal
to receive the same number of data bytes that are being is inverted or not inverted or how the receiving unit is
transmitted. interpreting the binary states of the serial data stream. Table
2 shows the various logic states for a data stream for a
RS-232 to TTL converters microcontroller and standard RS-232 signal. Standard
RS-232 calls a Low state a “Space” and a High state is called
Acroname, Inc. www.acroname.com a “Mark.” What is interesting to note here is that the
voltage levels between the two systems are inverted. The
Team Half-Life, Inc. www.superdroidrobots.com RS-232 voltage polarities are reversed when compared to
digital voltage polarities and their magnitudes are signifi-
Progressive Resources, LLC www.prllc.com cantly higher. Since the PC will output true RS-232 voltage
levels, they need to be converted to digital logic levels for
Kevin Ross www.kevinro.com
the microcontroller to safely handle.
USB to TTL converters Table 3 shows several companies that sell low cost
RS-232 into TTL voltage signal level converters. Also included
Pololu Corporation www.pololu.com in the list is Pololu; they have a nice little USB to TTL signal
converter.
Table 3. Serial to TTL signal converters. The other part of the conversion process that you need
to know is whether or not the voltage level converter inverts
the signal. Many of them do invert the signal. A voltage level
converter will convert the negative (-3 to -12 V) signal to 0 V
and the positive (+3 to +12 V) signal to +5 V. Under standard
2005 RS-232 rules, though, a +5 V signal will still be a “Space” or
March 6–10, 2005 a logic 0; a 0 V signal will be a “Mark” or a Logic 1. This is
Austin Hilton Austin, TX opposite of normal digital logic.
T P
HE REMIER Since microcontrollers interpret a +0 V signal as a logic 0
and a +5 V signal as a logic 1, they will interpret the standard
GLOBAL EVENT RS-232 input signal as being inverted. This causes a lot of
people many nights of frustration trying to figure out why
IN POWER things don’t work until they finally realize that the signal is
inverted. Many of the RS-232 to TTL signal converters will
ELECTRONICS invert the signals for you, but you still need to know that
Visit the conference before you use them. Once you know that, you can tell
web site below for the microcontroller on the receiving side to receive the data
continual updates as either inverted or non-inverted (True) so that it properly
interprets the data.
www.apec-conf.org The BASIC Stamp 2 family of Stamps receives its serial
programming via the Sin pin (pin 2). The circuitry on this pin
www.apec-conf.org
The MicroMouse Contest converts the voltage levels of the incoming RS-232 signals
to safe levels for the Stamp to receive. It also inverts this
Monday, March 6 starting signal. Internally, the Stamp is programmed to interpret this
at approximately 8:00 PM inverted data as “True” serial data.
So, why is this important? When receiving serial data
through the Sin pin, all you have to do is tell the Stamp that
SPONSORED BY
it is receiving a “True” RS-232 serial signal. When the serial
data is connected to one of the regular 16 I/O pins of the
Stamp, remember that there is no signal conditioning
circuitry on these pins, so the incoming Serial data is not
inverted. Since the Stamp is programmed to assume that
66 SERVO 01.2005
MrRoboto.qxd 12/8/2004 9:15 AM Page 67

“True” serial data is actually inverted, then


you have to tell the Stamp to receive the
TO STAMP I/O PIN
data as Inverted data so that it will be 22 Kohm
received correctly.
Figure 4 shows a schematic for a simple
serial adapter for hooking a RS-232 serial 1 2 3 4 5
cable to a BASIC Stamp. This schematic is
based on the one shown in the BASIC Stamp 6 7 8 9
manual. This cable will not invert the incom-
ing serial data, thus the Stamp needs to
receive the serial data as Inverted data (the DB-9 MALE
only exception is if you are hooked up to the (CONNECTOR SIDE)

Sin pin on the Stamp).


The Stamp program shown here is based Figure 4. Simple RS-232 for connecting to a BASIC Stamp.
on using a BS2p Stamp. As you can see,
there is not a lot of programming required to receive serial Stamp program only looks at the first four bits of that byte of
data. The WAIT(255) command in the serial input line (Serin data and lights the LEDs accordingly.
command) tells the Stamp to wait until it receives a byte of That is about all there is to it. Once you have the serial
data that is equal to the numerical number 255. This is the communication protocols setup properly, writing these types
same synchronization byte that is sent first in the Visual of programs is not that time consuming and the programs
Basic program. can be easily customized for your exact application. In this
Once the Stamp receives the 255 value, the program will program, moving the slider bars back and forth causes
then look for three more bytes of data. The next two bytes the servos to move back and forth and pressing the option
of data tell the servos the commanded position they are buttons will cause the corresponding LEDs to light.
supposed to go to. Since the Visual Basic program sent Hopefully, the information shown here is enough to get
the Accessory Options Byte as a four-bit binary number you started in making your animatronic project a success for
(representing which check box was checked), the BASIC next year. SV

Affordable Motion Control Products


Robot Building
Blocks

Motor Speed
Control

PID Motor
Position
Control
Solutions Cubed
3
Phone 530-891-8045
www.solutions-cubed.com Solutions
Circle #111 on the Reader Service Card.
SERVO 01.2005 67
Robytes.qxd 12/8/2004 8:56 AM Page 68

Robytes by Dave Calkins


’m back! I escaped from the The bot has eight MFCs, each filled with configurations — snake, roller, or walker.
I snarling, fire-breathing robots that
wouldn’t let me finish my column.
raw sewage (the robot is autonomous
and it smells good!). Bacteria in the slurry
As for batteries, each segment has
its own, but can share power when
Dreadful, you say! If readers had eat the flies and release electrons into connected to the whole. They can also
sent me items, this wouldn’t have the MFCs as the flies are metabolized. disconnect from the group and move
happened: david@robotics-society. The MFCs are so efficient that the robot on their own. Using infrared, they can
org Many thanks to Dan and Alexa worked for five days on just five bugs. always find each other and re-connect.
for filling in for me last month. On the plus side (for the current, The units each have their own
— David Calkins human leaders of the world), it takes independent Atmel ATMega 128
three hours for the robot to move processor, as well as a two-axis
75 cm (30 inches), so — for the near accelerometer for sensing tilt. For further
Robots Move Towards True future — you’ll probably be able to external sensing, an ATRON module
Autonomy outrun it when it comes for you. can put its infrared communication
into a special sensing mode that func-
tions as primitive distance sensors to
tell if a neighboring cell in the lattice is
Shape Shifting Robots! occupied or not. The distance sensing
offers all information needed in order
to recognize dead modules, external
obstacles, or modules to connect with.

Robots Clean Up!


Got pollution? Shanghai certainly
Photo courtesy of the University does. As one of the fastest growing
of the West of England. cities on the planet, it’s got all the
Photo courtesy of usual problems associated with big
Yeah, yeah, yeah, robots are going Henrik Hautop Lund. cities and one of the biggest is pollu-
to take over the world — just as long as tion. The major type of pollution is air
they can do it within the four hour Who wants a robot that just pollution — indoor air being filled with
charge of their batteries. Unless, of walks? Or one that just rolls on cigarette smoke, shoddy home decora-
course, they don’t NEED batteries. Solar wheels? Even one of Gavin Miller’s tions, factory spewage, and so many
power is nice and all, but it doesn’t do cool snake robots can be limited. Gosh of the other things that make modern
so well at night. So, what’s a power- dangit, I want a robot that does it all! living so much fun. Many health
hungry robot to do? Why, run off of Well, Henrik Hautop Lund of the experts blame toxic indoor fumes in
decomposing bodies, of course. Yes, my Maersk Institute in Denmark has made Shanghai for the country’s rising prob-
paranoid followers of Bill Joy — the my Christmas wish come true! His new lems with lung cancer and leukemia.
future is one step closer to not needing robot — ATRON — is a re-configurable So, robots to the rescue! In
us. The University of the West of robot made up of approximately 100 November, the Shanghai Environment
England has developed a robot called spheres, each about 5 inches in Protection Industry Association started
EcoBot II that derives its energy supply diameter. “The two connectors are a promotion for this robot, which offi-
from decomposing bugs. The robot uses held together by two joints, allowing cials say will purify poisonous fumes —
microbial fuel cells (MFCs) to accomplish the connectors to yaw and pitch with such as formaldehyde, cigarette
this magic. Chris Melhuish — head of the respect to each other. Using this smoke, and other toxic fumes. The
project — has designed the robot so that approach, a number of modules may robot acts as a dust collector and can
it can catch flies and “digest” them in form snakes, six-legged walkers, snake- emit negative ions to absorb toxic
the MFC-powered robot “stomach.” wheels, and many other structures.” particles in the air while consuming
MFCs are bio-electrochemical Each sphere is split into two very little electric power, according to
transducers that convert bio-chemical segments and can rotate along its axis Wang Fang, Secretary General of the
energy to electrical energy in roughly with the internal motor. The spheres association’s indoor division.
the same manner as a normal fuel cell. then join together in many different “The robot or other air purifying

68 SERVO 01.2005
Robytes.qxd 12/8/2004 8:57 AM Page 69

Robytes

facilities will become a trend as people Martian terrain, allowing a single Mars
are paying more and more attention Rover a far greater ability to explore!
to their living quality,” said Ma Keqin, Who needs wheels, anyway?
Vice General Manager of Gree New
Technology Institute Company.
Can they make a robot that
will clean up the poisonous fumes
Robot Cleans Up the Past
emanating from my laundry pile?

Mars Robots Go BOING!

Photo courtesy of the


University of Southampton.

The great thing about the web is


that you can access information from
just about anywhere on the planet.
The bad news is that you can only
Photo courtesy of access information that's on the web.
Pioneer Astronatuics. You can't access a 300 year old tome in
a crusty library. Well, not yet. The
The problem with extraterrestrial University of Southampton in England
robots is their range. Of course, the has developed a robot scanner that will
Mars Explorers are cool and we learned put their entire paper archives online.
an amazing amount from them. This includes many legal documents
However, they never went much farther from the British Parliament, going back
than 30 feet from their landing places. to the 18th Century. The £1.4 million
Wouldn’t it be cool if we could send (that’s more than $2.5 million) project is
something to Mars that would go all funded by the Joint Information Systems
over the place? Enter Pioneer Committee (JISC) and is part of an
Astronautics, a tiny little company ambitious £10 million digitization
making robots for NASA. They’ve come program made up of all UK further and
up with the Mars Gas Hopper — a cool higher education funding bodies and
way for robots on Mars to use indige- financed by the government. The robot
nous carbon dioxide from the Martian uses lasers to detect the edges of pages
atmosphere as a propellant to provide a and a vacuum arm to turn them after
Mars explorer with greatly enhanced scanning. Unlike pesky grad students
mobility. The Gas Hopper acquires CO2 who want to be paid, fed, and given
from the Martian atmosphere and then sleep breaks, this bot scans 600 pages
stores it in an onboard canister. When an hour, 24 hours a day. They hope to
the robot is done exploring a given area scan a million pages a year.
of Mars, the propellant tank is heated Stanford University has one as
and then the gas is released through well, and the two universities are
directional nozzles to provide thrust! working together to bring once
It can also provide enough power for exclusive information to the masses.
altitude control and controlled landings I guess the grad students will have
under Mars’ reduced gravity. The robot to stick to founding dot coms. SV
can potentially go as far as 100 km over

SERVO 01.2005 69
RoboResources.qxd 12/8/2004 8:58 AM Page 70

Robotics Resources:

BY GORDON McCOMB
ou’d think that — with the vast a lot of time “surfing” the Internet; budgets to spend and the search
Y informational resources of the
Internet — printed books and maga-
there are better ways! In this column,
I’ll look at several tools you can use to
results can be both misleading and
unproductive.
zines would by now be obsolete. That find information on the Internet. Some A few search engines are different.
hasn’t happened for a number of of it may seem obvious, but there are At the top of the list are Yahoo! and
reasons. On the top of the reasons list still some tricks to make your research Google. Both are different in that they
is a simple matter of numbers: the more relevant. strive to deliver quality results first and
Internet has grown too big for itself profits second (though making money
and the best information is getting Search Engines — is a key aim for both services). For
hard to find. several years running, Google has been
Search engines like AltaVista, The Big, the Bad, and the champ among search engines —
Google, and Yahoo! provide a window the Ugly boasting a clean, uncluttered interface
to the Internet world, but they’ve lost and text-only ads.
some of their effectiveness because of The basic tool for finding things However, because of Google’s
the sheer volume of websites and on the Internet is the search engine — popularity, it has been the subject of
pages. You must choose search terms a web-based program that collects intense scrutiny by webmasters seeking
carefully or else you’ll be swimming in data about other pages. Search to “game the system” — they figure out
a sea of worthless links. engines catalog websites, assigning how Google ranks pages so that
Careful exploitation of the “keywords” to them so you can locate their sites appear at the top of the
Internet’s resources can be rewarding what you want among the millions of list. It’s not uncommon for many
on many levels. With the Internet, pages available. The trouble is, most searches to result in nothing more than
you can find almost any piece of search engines on the Internet are websites with links to other websites —
information, part, or supplier, but rubbish. They’ve become nothing particularly auctions on eBay and
knowing how to look is as important as more than cheap advertising vehicles books on Amazon.
knowing where to look. You can waste for the companies with the largest These searches are commonplace
70 SERVO 01.2005
RoboResources.qxd 12/8/2004 9:01 AM Page 71

ROBOTICS RESOURCES
because both Amazon and eBay offer
referral fees for attracting customers. Trimming Web Page Fat
The websites are set up to simply refer So-called meta tags — text embedded for trying other tricks — like hiding text by
visitors to other places. As a business, in a web page, but not visible to the giving it the same color as the back-
they flourish when they appear first in user — used to be a popular way for ground — search engines don’t catch it
the search results; therefore, the web- webmasters to describe what their site all. This is why you sometimes click on a
masters of these sites do everything was all about. Trouble is, too many link from a search result, only to see a
they can to maintain a high ranking. people abused the feature, so many page that has nothing to do with what
I’m not against this as a business — search engines ignore these meta tags. you were looking for. Odds are, they’ll
everyone has a right to earn an Most search engines nowadays look only try to direct you to a pornography site or
income. for text that is visibly displayed. someone selling drugs to combat male
However, sales referral sites can
Though webmasters can be penalized impotency. Oh, the tricks they play!
significantly slow down research when
that’s your aim.
Knowing this, you can more readily in a search, you narrow down the
Search, but Search search for companies, products, or possible results. It’s better to do several
Wisely information by using search terms that small searches than one big one. For
are most likely to appear in the title of example, instead of searching on
All search engines have a text box web pages. Those web page creators robotics — and the eight million pages
where you enter a search term (called that use undisrupted titles or leave you get as a result — try “robotics kits”
a keyword) to find the information you them blank will be ranked much lower or “robotics schools” or whatever your
want. The keyword (or keywords) you in the search results. That’s too bad interest is.
use greatly influence the relevancy for them. There’s no reason to limit yourself
and effectiveness of your searches. to just two keywords. Try three, four, or
Enter “robotics” into the Google Using Multiple Search more. The more keywords you use, the
search bar and you’ll get something Terms narrower your search will be. If you
on the order of eight million web find the search is too narrow and you
pages! As you can imagine, robotics is One of the best ways to insure don’t get any results, try removing one
a popular field, but using a common quality search results is to use multiple or two of the keywords and searching
search phrase such as this will get you search terms. By using multiple terms again.
nowhere, fast.
Fortunately, search engines FIGURE 1. Google.com provides the Big Picture. Use its features carefully to
provide a number of ways to find what you need.
narrow your search so that you
have a greater chance of finding
what you want. The following tips
and observations specifically apply
to Google, but they work on many
other search engines, as well.
Like most search engines,
Google uses keywords to match
your search phrase with the
content of a web page. Keywords
can be contained in the title or the
text of the page. How Google
ranks the relevancy of the
keywords it finds on pages is a
closely guarded secret, but —
through observation — it’s pretty
clear that Google tends to favor
sites where the keyword(s) you’re
searching for appear in the title of
the page. Therefore, if a page says
“ Robotics Stinks,” it will likely be
ranked highly among pages on
robots, simply because the word
“robotics” is in the title.
SERVO 01.2005 71
RoboResources.qxd 12/8/2004 9:03 AM Page 72

ROBOTICS RESOURCES
known only to Google’s program-
mers) — searching for “robots
mars” (no “of”) will yield some-
what different results. Go figure!
There are some more
advanced tricks to combining
keywords that are detailed below.

Set Phasers to
Ignore
You can tell the search engine
to ignore keywords if they don’t
appear in the title, thereby limiting
the search to only words that
appear in the titles of pages. You
do this with the intitle modifier (or
its close cousin, allintitle). Use:

intitle:robotics

to find web pages where robotics


appears only in the title. Note the
colon after “intitle.” Also note
FIGURE 2. The MSN.com website offers a search facility within its there is no space between the
all-in-one portal design. colon and the keyword. Why does
this work? You may find that at
Do note that some common words for “robots of mars” will result in the least some of the so-called “hits”
— like a, the, of, and so forth — are word “of” being left out as a search Google provides are not about
ignored by the search engine. A search term, though — crazily enough (perhaps mechanical robots, but about the US
Robotics brand of modems, fax
modems, and early Palm Pilots.
FIGURE 3. Buyer’sIndex.com searches online vendors, but not all results are relevent. Unless you tell it otherwise, Google
doesn’t know the difference
between robots that roll or walk on
the floor and products made by
the US Robotics Company.
There is another simple way to
remove these kinds of irrelevant
pages: use the minus (-) character
to tell Google to skip any web page
that contains a given keyword.
Here’s one way:

robotics -us

This fetches all web pages with the


word “robotics,” then omits all
those pages with the keyword
“us.” This works, but “us” is, unfor-
tunately, a common word. The
better way is to use quotes to form
a keyword phrase, like this:

robotics -”us robotics”

This time, only those pages that


72 SERVO 01.2005
RoboResources.qxd 12/8/2004 9:04 AM Page 73

ROBOTICS RESOURCES
contain “us robotics” as a complete robot + about or characters.
phrase are omitted. Not good (space between + and However, the search engine allows
It’s often handy to search for about) you to construct phrases to look for
multiple keywords, such as “robotics multiple forms of words by using the
and vision.” With few exceptions, No Wildcards, but ... OR search modifier.
Google does not use Boolean searches
— “robotics AND vision,” for example — Many web search engines — +robotics eye OR eyes
like some other search engines. Google included — don’t support wild-
Google’s syntax is a lot easier, yet isn’t cards. Wildcards are special characters Note OR in capitals. Google
limited. (like ? and *) that denote any character searches are not case sensitive, but you

+robotics +vision
Newsgroups — Information Beyond the Web
Finds pages with both of the word Newsgroups were born in the days portion of your web browser to sepa-
forms long before the Internet became a rately log into these private newsgroup
global marketplace. A newsgroup is a servers; they are not part of the public
robotics vision discussion group or bulletin board for newsgroups provided by your ISP.
Same as above posting and reading messages. Unlike
chat, newsgroups are not real time; you Manners and Etiquette in Newsgroups
“robotics vision” don’t directly communicate with others Newsgroups can be a horrendous
Finds pages with the specific phrase while everyone is online. Newsgroups — sink of time and energy. Take my advice
robotics vision. which are part of the Internet some- — avoid using them as a soapbox
times referred to as Usenet — can be and avoid getting involved in a heated
Except for the whole phrase excellent sources of information and discussion. People say things in a news-
“robotics vision,” the keywords in a feedback. group that they’d never say in person,
multiple keyword search do not have to As newsgroups are the result of the simply because folks are protected
appear next to each other on the web early Internet, their structure follows sitting behind a computer screen.
pages. something of a gear head’s design of the
That is, robotics can appear at the world and some aspects of them may be Here are some other tips:
beginning of a paragraph and vision confusing and cryptic. However, it’s not
later in the paragraph. That said, complicated once you learn your way • If you include your Email, use a “throw-
Google appears to give precedence to around. away” Email account that you can close
those pages where the keywords are should the spam (unsolicited commer-
found closer together. What’s a Newsgroup? cial mail) get too abundant.
Note the plus (+) character in one First and foremost is that news-
of the examples. Google automatically groups are divided into two main forms: • If you read a message that angers you,
ignores very common words and does public and private. Public newsgroups don’t reply immediately. Flag it and
not include them in the results. Adding are open to anyone and, most likely, return to it a day later. If you still want to
a + character to the word ensures that your Internet service provider (ISP) main- reply, don’t add to any possible “flame
Google considers it in your search. tains computers just for the purpose of war.” They consume way too much time.
While both robotics and vision are not storing newsgroup messages. Your ISP’s
common words and will not be computers are connected to all the • Unless you are an adult, don’t reveal
ignored, it’s a good practice to include other public newsgroup computers your age. If you’re old enough to
the + character whenever you want to around the globe and they constantly read this column, you’re old enough to
ensure the word is considered in the
trade messages back and forth. The end understand why.
search.
result is that — even though you may
When using the + character,
“connect” to a newsgroup via your local • Sexual harassment is still a problem,
be sure to add a space before it and
ISP — you are reading the messages of particularly in public newsgroups where
to type the keyword immediately
others worldwide; if you post a message “joy riders” and “trolls” only stick around
following:
of your own, it will circulate around the to cause trouble. So, if you’re female, I
globe within a few hours. suggest you use a male name for your
robot +about
Private newsgroups are set up by login. Obviously, this isn’t a huge
Good
companies or organizations to support problem in groups frequented mostly by
robot+about their products or agendas. They may or women, but harassment is known to be a
Not good (no space between + and may not be open to the public. In most bigger issue in male-dominated interest
either word) cases, you must use the newsreader groups.

SERVO 01.2005 73
RoboResources.qxd 12/8/2004 9:06 AM Page 74

ROBOTICS RESOURCES
simple way of finding pages when
you want to look for multiple word
forms — robotics or robot, for
instance — is to perform separate
searches.
For example, the first search
below looks for robotics with eye
or eyes. The second for robot with
eye or eyes:

robotics eye OR eyes


robot eye OR eyes

Additional
Advanced Searches
Google (and other search
engines) supports an Advanced
Search page where you can specify
a number of special qualifiers,
including limiting the found pages
to a given language or to those
that have been updated within a
certain period of time. Similarly,
FIGURE 4. Yahoo.com is becoming an alternate favorite to Google with deep you can also look for just HTML
search results and lots of web pages. web pages, Adobe Acrobat PDF
files, or many other common file
must capitalize OR in order to use it as those pages with either eye or eyes. types.
a search modifier. This phrase looks for Some searches will require a When using Google, there are
all pages with robotics, then matches couple of different alternatives. One several handy search tricks you’ll want
to know about. Be sure to read
FIGURE 5. Teoma.com is the choice of many academic researchers — a good thing to the Help pages on the Google site
know for researching your next project. for more information. If you like a
different search engine better, be
sure to read up on using its
advanced features in the Help or
FAQ pages.

Reversing the
Order of Keywords
Search engines often rank the
relevance of pages from the order
of the keywords in your search
phrase. You get about the same
pages no matter what order you
use, but the pages that appear at
the beginning of the list are altered
by changing the keyword order. For
example:

robots mars
Returns pages that favor robots.

mars robots
Returns pages that favor Mars, but
also contain the word robots.
74 SERVO 01.2005
RoboResources.qxd 12/8/2004 9:08 AM Page 75

ROBOTICS RESOURCES
More Than Just AltaVista; my favorite is Google, so they are tuned to address a more
we’ll talk about that first. To translate a specific market, like shopping or non-
Web Pages web page, go to www.google.com US searches.
/language_tools and enter the full
The Google search engine is not URL, including the portion of the About — www.about.com
limited to just web pages. You can also web page you want to view, in the AltaVista — www.altavista.com
find images, Usenet newsgroups, appropriate text box. AOL — search.aol.com
news, shopping pages, and more. Select the “from” and “to” Ask Jeeves — www.ask.com
languages, such as Spanish to English Buyer’s Index — www.buyersindex.
• The Groups search lets you sift or French to German. The translation com (mail order shopping search engine)
through years of archives of news- takes anywhere from a few seconds to Direct Hit/Teoma — www.directhit.com
group messages. over a minute, depending on the Dog Pile — search.dogpile.com
length of the page. Euroseek — www.euroseek.com
• The Directory search provides web Note that only normal text is trans- Hotbot — www.hotbot.com
links to submitted and approved sites. lated. Text in a graphic image is not Infospace — www.infospace.com
Some of these may be paid advertise- translated and is shown in the original LookSmart — www.looksmart.com
ments; nevertheless, it’s a good way of language. Lycos — www.lycos.com
locating major suppliers. AltaVista’s similar offering is MSN — www.msn.com
available at babelfish.altavista.com Public Internet Library — www.ipl.org
• The Catalogs feature lets you search It works in a similar fashion to Google’s Search Hippo — www.searchhippo.
hundreds of mail order catalogs, translation page and offers additional com
including many of interest to robot languages, such as Korean, Russian, Worldpages — www.worldpages.com
builders. Be sure to try this one! and Chinese. Yahoo! — www.yahoo.com SV

• The University search lets you limit Other Search Engines Author Bio
searches to the websites of any of a
couple hundred universities. With this Of course, there are other search Gordon McComb is the author
tool, you can look up relevant research engines on the web — some good and of several best sellers. In addition, he
data posted by professors, post-grads, some terrible. Here is a listing of some operates a small manufacturing
and students at the Massachusetts additional general-purpose search company dedicated to low cost
Institute of Technology, Carnegie- engines. amateur robotics at www.budget
Mellon, and several other schools Some of these are “powered by robotics.com He can also be
that are known for their robotics Google,” meaning that they use reached at robots@robotoid.com
departments. Google’s database of pages. Typically,

• Use the Froogle search if you


specifically want to find products for
sale. The results are specific products
that match the search terms you’re
HobbyEngineering
The technology builder's source for kits, components, supplies, tools, books and education.
looking for and you can change the
order of the listings by price.
Robot Kits For All Skill Levels ICs, Transistors, Project Kits
En Francais, Anyone? Motors, Frame Components
Page Translations and Scratch Builder Supplies.
Robotics isn’t limited to just those
Order by Internet, phone, fax or mail.
who speak English. You’ll find plenty
of web pages in a variety of www.HobbyEngineering.com
languages. Several free services offer
Books and 1-866-ROBOT-50
text translation from and to the 1-866-762-6850
Educational K 1-650-552-9925
world’s most common languages. The
1-650-259-9590 (fax)
translations are not perfect, but they sales@HobbyEngineering.com
are often close enough to allow you to 180 El Camino Real
get the gist of what the web page is all BEAM Kits and Components Millbrae, CA 94030
about. Visit our store near SFO!
Among the better web page
language translators are Google and Most orders ship the day received! World-wide shipping. Convenient payment options.

SERVO 01.2005 75
TwinTweaks.qxd 12/8/2004 9:19 AM Page 76

NEW !
UMN
COL

THIS MONTH:
Attack of
the Monster
Robot Dog!

H
ello, SERVO readers! We’re Evan Our robot building moved up to followers (but, unfortunately, not partici-
and Bryce Woolley. You may recall the next level when — at the end of pants) in the DARPA Grand Challenge
our names from the series of arti- our middle school years — we acquired and Tetsujin competitions. Through
cles on Team 1079 and the FIRST a CAG (California Association for these endeavors, we have met such engi-
Frenzy experience. Why are we back the Gifted) grant for $1,000.00 to neering greats as Dave Lavery and Dean
again, you ask? Well, it is not for FIRST. jumpstart an independent learning Kamen and have listened to people like
Although FIRST has been a significant endeavor involving robotics — combat Tony Tether (the Director of DARPA) and
experience in our budding engineering robotics, to be exact. Red Whitaker (a robotics genius from
careers, we actually have quite an We had watched the robotic com- Carnegie-Mellon University) in person.
impressive background. bat shows on television and thought it To share our hobby with other
We began at a very early age by would be fun to participate ourselves. students, we started the Robotics Club
playing with Z-bots (little plastic robot So, we built 60 and 30 pound robots at our high school in our freshman
toys). Eventually, we graduated to for the BotBash competition. (They are year. As you already know, we are
LEGO Mindstorms robots, which we not vapor bots; they have competed actively involved in FIRST, in which we
have used in various events, including quite successfully.) have participated in for over two years.
high school science competitions. More recently, we have been devout We have been apprentices at the Palo
Alto Research Center (PARC) through
The pre-hack robot dog has Can RoboSapien do this? IEA (the Institute for Educational
amazing flexibility! Advancement), where we worked
on modular snake robots for urban
search and rescue with professional
engineering mentors (for more on
PARC, see the August, 2004 issue of
SERVO Magazine). The list goes on ...
In short, we have some credibility.
What this column will do is detail
our modifications to certain robotic
products. These modifications will have
a connection to a larger concept in
robotics. It is just for fun, but you just
might learn something in the process!
This month, we’ll study the
76 SERVO 01.2005
TwinTweaks.qxd 12/8/2004 9:21 AM Page 77

Attack of the Monster Robot Dog!

transformation of a Joinmax Robot truly better suited to program hacks,


Dog into a Tyrannosaurus Rex. Before but it definitely has room for mechanical
beginning any type of project, though, hacking, as well.
it is imperative to know what you’re
dealing with. In this case, that would The Plan
be the Joinmax Robot Dog.
We had several ideas for hacks
The Joinmax Robot with this robot. Our first choice — a
Dog robot guard dog complete with stun
gun — would be illegal, so we decided
The Joinmax Robot Dog is a midsize, to do the next best thing and turn it
servo-driven robotic canine companion. into a Tyrannosaurus Rex. That would
The dog came to us already assembled, involve getting the dog to walk on
but some technical difficulties led us to two legs. This was certainly a noble
do some reassembly. Constructing the engineering goal, we thought. As with
dog is fairly straightforward, especially most projects, though, this hack
with the 3-D instructional video on the evolved with time.
accompanying CD. All of the motor parts At first, we thought that making
are socketed and all of the pieces are the dog walk on two legs would be a
attached with screws, making reorgani- good hack. As we tested the dog, we
zation of the pooch’s bodily attributes found that the servo motors weren’t Bipedal motion is easy!
and motions into simple tasks. terribly strong. One hindrance this try the macarena!
The range of motion on the servos caused was in balance — the servos in
is considerable, making the Joinmax the legs didn’t seem up to the task of make the dog lighter.
dog able to perform all the tricks a supporting the whole dog. An easy Since the idea was to make the dog
normal dog can and then some. With solution to this problem was to give walk on just its two hind legs, getting rid
15 servo motors (there is room for 16) the unsteady canine another point to of the two forelegs seemed like a logical
and 15 degrees of freedom, this dog is support itself — on its tail. choice. After visualizing what such a
agile enough to learn all sorts of tricks. To do that effectively, we had to creation would look like — an upright
All it takes is some patience with the lengthen the dog’s tail. Another issue walker with a long tail and short, stubby
programming. with the power of the servos was that arms — we decided that the dog would
The Miniservo Explorer used to the dog itself was fairly heavy for the no longer really be a dog; it have would
program the dog is kind of like chess — two legs alone to move. The size of the become a Tyrannosaurus rex.
it takes a minute to learn and a lifetime hind legs compared to the dog’s body
to master. Actually, it is very easy to is disproportionate, to say the least. The Hack
learn and it just takes a lot of patience Most creatures that walk on two legs
to program more complex movements. have fairly long legs (like ostriches and One of the first steps of the hack
Each joint is controlled individually, humans), so the robot dog’s short, was to get well acquainted with the
either by typing in values between O weak legs were simply a
and 253 on the movement table or by design challenge: solution — The Tyrannosaurus Rex dog gets wider feet
adjusting as a scrollbar. The for better bipedal balance and motion.
graphical user interface is easy The robot gives its arms a
to navigate and downloading a goodbye kiss.
program is as easy as clicking a
button (since that’s actually all
you have to do).
While this individual con-
trol of the servos can allow for
fine motion control, it also
makes complex movements
difficult, since you have to
coordinate all of the servos.
The robot dog was originally
designed for studying the
gaits of four-legged robots, so
its real forte is in its versatile
software. The robot dog is
SERVO 01.2005 77
TwinTweaks.qxd 12/8/2004 9:22 AM Page 78

Twin Tweaks ...


tion — the only tool we needed toward actually walking. We had the
was a small Phillips screwdriver. dog stand to attention with its neck
Without the forelegs, the dog down (from the normal dog position),
could actually balance on its hind hind legs vertical, and tail angled acutely
legs. It slouched, though, and we towards the ground. The first gait
decided that an extension on the we tested involved some deep knee
tail would give it better posture. A bending, but the dog fell down
broad end on the tail would without making any forward progress
provide a solid point for balance — back to the drawing board.
and we thought that an arrow-
head-shaped tail fit better with Modifications
cool factor engineering than a
lame spatula shape. After some As the dog picked up one leg to
quick work with a jigsaw, the dog
move forward, we noticed that it
had a shiny, new aluminum tail.
was unable to balance on the other leg
Now, a point of balance and the tail. To solve this problem, we
would be useless without crafted some extensions for the feet.
Wiring up the kit. friction, so we attached a piece
The robot dog itself has fairly small
of rubber to the arrowhead to feet, which is okay when it has four of
Miniservo Explorer program. A keep the dog from slip-sliding away. them to stand on. For the purpose of
RoboSapien may make walking look Some spray-on adhesive gave the tail two-legged walking, tiny feet just don’t
like a piece of cake, but it really some grip via a new rubber sole. With cut it.
isn’t. The movements of all four legs a couple of holes in the dog’s tail, the Looking at other walking robots —
for a walking gait were very difficult new extension could be attached with like RoboSapien — for guidance, we
to coordinate. That illustrates one tie wraps. The tie wraps even gave thesaw that most walkers have fairly large
advantage of two-legged walking — it tail a ridged look like a Tyrannosaurus
feet. Spray-on adhesive would be kind
would be a lot easier to program! rex — cool factor can be found in someof messy in this application, so we
The dog’s first major surgery was unusual places, if you take the time to
simply duct-taped the aluminum
the amputation of its two forelegs. look. extensions we designed onto the feet.
Don’t worry; we replaced them by Now that we had a two-legged Now it was a real robot!
fitting stubby Tyrannosaurus rex arms dog that could balance, it was time to Another design feature of the
from a suitable donor — and old Godzilla make it walk. dog that was ideal for four-legged
toy. This is hacking, not fabricating; you and not two-legged walking was that
have to work with what you have. First Tests it literally had balls on its feet. Self-
The ease in construction with the adhesive foam helped to level the
robot dog translates to ease in deconstruc- We knew that a reliable standing dog’s feet and give it some much-
position would be the first step needed stability.
The Tyrannosaurus rex dog and its The final problem was
prehistoric cousin. Quite a family The dog can stand on two feet, that the tail kept sliding
resemblance! but it can’t walk, yet! back while the dog shuffled
forward, contributing to its
eventual fall.
As a solution, we
attached some self-adhesive
foam to obstruct this
unwanted path of motion.
The foam proved to be too
squishy, so we taped on a
square of plastic, instead.
Trial and error is a wonderful
thing.

Final Product
With these modifications
completed, all that was left
was some programming. In
78 SERVO 01.2005
TwinTweaks.qxd 12/8/2004 9:25 AM Page 79

Attack of the Monster Robot Dog!

its own way, this robot Tyrannosaurus engineers who may call the
rex dog is representative of robotics tail a third leg; two-legged
projects in general in that a knowledge humanoid walking is, after
of all aspects of the project is all, the holy grail of robotics.)
necessary. Even so, what balances
Robotics is perhaps the most while standing may not bal-
cross-disciplinary field in all of engi- ance while walking, as the first
neering and it demands engineers that tests of the robot dogasaurus
know their ways around both hard- illustrated. Walking is a com-
ware and software. The programming plex problem and all of the
in this hack was considerably simplified factors must be considered at
by working with only two legs, but once for an effective solution.
that is not to say that making the The second consideration
Tyrannosaurus rex dog walk on two is control. The Tyrannosaurus
legs was easy. rex dog hack was done
The first successful gait we had without any sensory feedback
was a kind of shuffling, jerky walk. It — just pure mechanics. This
wasn’t graceful, but it worked. After means that we were The Joinmax Robot Dog is rather easy
some more effort, we were able to programming blind; we didn’t to assemble and disassemble.
improve upon this gait to make the know how little changes
dog take distinct steps, which we might affect the final gait. need to be coordinated, so every
consider to be the requirement that Also, the dog could not adjust degree of freedom adds a layer of
makes it a true walker. It still wasn’t itself; it had only the program to rely complexity.
graceful, but it most definitely on. It still walked, but with a kind of Our hack of the Tyrannosaurus rex
walked. shuffling, jerky gait. dog shows that making a walking
The robot dog was no longer a High dollar walkers get feedback robot can be relatively easy, but its
dog — it was a Tyrannosaurus rex. from every joint so as to fine-tune shortcomings demonstrate that the
When it is placed next to a toy weight distribution on the fly. These task of walking on two legs is difficult
Tyrannosaurus rex, one can see that robots have impressive gaits that to perfect, no matter how easy the
the resemblance is, indeed, striking. approximate human motion to an RoboSapien makes it seem.
almost unnerving degree.
Significance Another aspect of control is the Final Thoughts
number of joints that are being worked
The Tyrannosaurus rex dog is not with. The RoboSapien essentially only That was fun, wasn’t it? We hope
simply the belated synthesis of fond has one powered joint per leg at the that we have inspired you to try
childhood memories (we played with hip — the knees move reflexively. This experiments of your own with walking
dinosaurs before Z-bots), it also has makes for simpler control, since fewer robots (especially two-legged walkers).
relevance to some issues in the greater joints are in play. Now, you can see how simple things —
world of robotics. The Tyrannosaurus rex dog had like a robo-dog and old Godzilla
The trials and tribulations of the three joints per leg, making control a parts — can create an engineering
Tyrannosaurus rex dog illustrate the more complex proposition for us. microcosm for more significant issues
difficulties in making an effective More joints mean that more motions in the world of robotics. SV
two-legged walking robot. The
Tyrannosaurus rex dog hack may have
been simple and it may have worked,
Special Thanks
but its walking motion did not nearly SERVO Magazine would like to for everything from joints and servos
have the grace of other walkers, like thank E-Clec-Tech (www.e-clec-tech. to hexapods and robotic arms.
Asimo or even RoboSapien. Simply put,
com) for their generous donation of If you are a manufacturer or
walking is harder than it looks.
Walking takes balance and control. the Joinmax Robot Dog for this vendor with a robot or kit that you
In the case of the robot dog, balance month’s “Twin Tweaks” column. Take would like to see hacked beyond all
was the easy part — at least for just advantage of their limited-time recognition, contact us at editor@
standing up. To get anything to balance, special — exclusively for SERVO servomagazine.com The column is
all you really have to do is give it big subscribers — on the Joinmax Robot bi-monthly, so we’ll have plenty of
feet and maybe a few extra supports, Dog at E-Clec-Tech. Also, browse their time to plot the “evolution” of your
like a tail. (This may, however, be selection of other robot kits and parts product!
frowned upon by the more strict
SERVO 01.2005 79
Appetizer.qxd 12/8/2004 9:51 AM Page 80

Robots and Generations


at RoboNexus
by Dr. Pete Markiewiez

n October 2004, I attended They recently confounded portion of the test. By the time 12-year
I RoboNexus (www.robonexus.com),
the first commercial US show for
experts by reversing numerous
negative social trends long associated
old Millennials reach college, they’re
likely to reverse the anti-science and
consumer and service robots. While I with youth. Among teens today, engineering trends.
was prepared to see a lot of robots, crime is at the lowest rate in 30 years
I was stunned by another kind of and out-of-wedlock births are at the A “Robotic”
participant — the literally thousands of lowest rates ever recorded. Drug use
kids who attended the Expo, usually is down to levels comparable to the Generation Turns
with their parents. early 1960s. You wouldn’t know it to the Real
In retrospect, I shouldn’t have from the media, but Millennials seek
been surprised. These kids are part the social norm — and are even a bit Why should this new generation
of the Millennial or Echo Boom more straight arrow, compared to be specifically interested in robots? The
generation, recently featured on the older groups. answer lies in patterns of popular
CBS program 60 Minutes and Most importantly, this new culture. Typically, waves of new
described by generational experts generation is showing renewed interest technology in the US last 18-25 years
William Strauss and Neil Howe of in science and technology. While and are closely associated with the rise
Lifecourse Associates1 as the “next interest in tech-related fields has been of a new generation.
greatest generation.” They’re the post declining for years at colleges, SAT At the end of the era, a new
GenY group2, product of a second scores among younger Millennials are generation appears and replaces the
baby boom, aged 0-20 years old. going up — especially in the math former one’s youth culture. During this

Figure 1. The Echo Boom. Adapted from Millennials Rising1.

Tes tSSAT
scores
AT Scores
Scores of
beg in aound
of College-B
s low
College-Bound
craw l
Seniors,
Se ni ors,
The “Echo Boom” upward 1975-2001
as oldest
1975-2001 Millennials
(1975=100)
(1975=100)
Total U.S. Births, in Millions 1.04
1.04
reach teen years around 1996
4.5 1.03
1.03
Boomers Millenials
"Echo Boom"
1.02
1.02
Gen-X
S AT--Math Only
1.01 SA T--Math Only
4.0 1.01
Mi llions of B irths

SA T--Combined
SA T--Combined
1.00 Score
1.00 Score

0.99
3.5 Gen-Y 0.99

0.98
0.98
0.97
3.0 0.97
1950 1955 1960 1965 1970 1975 1980 1985 1990 1995 0.96
0.961975
Source: U.S. Bureau of the Census (2000) 1975 1977 19801981
1979 1985
19831985 1987 19901991
1989 1995
19931995 1997 20002001
1999 Source: Colleg e Board (2001)
Source: Colleg e Board (2001)

80 SERVO 01.2005
Appetizer.qxd 12/8/2004 9:52 AM Page 81

changeover, the new generation


Computer Training
breaks with old patterns and Teen/young adult in Generation Received in School
establishes its own unique voice in
technology and culture. 1970s Boomers Mainframe/timeshare (college)
The last two US generations
emphasized virtual technology. 1980s Gen-X (“Atari wave”) Personal computers, video games
During the 1960s and 1970s, 1990s Gen-X/Y (“Nintendo wave”) Internet, animation, games
technically-inclined Boomers saw
the mainframe sheltered behind 2000s-2010s Millenial Internet, robots
glass at college and envisioned
computers as the disembodied, Figure 2. Tech waves and generations.
Hal-9000 intelligence of the classic
movie, 2001. Parents Encourage the 1980s and early 1990s) are now
In the 1980s and 1990s, considered by social scientists to be the
Generation X came of age when Interest in Robots most supportive and protective
personal computers and the Internet parental generation in decades. So it’s
invaded public schools and the public The parents of Millennials (mostly no surprise that many a young
mind. Their vision of technology was a Boomers and Xers) are also unique. Millennial at RoboNexus explored the
virtual, simulated world that was Admissions officers at colleges have world of robots with “intentionally
united in a ghostly, networked already dubbed them a generation of bald” or pierced parents, eager to
cyberspace, embodied in video games “helicopter parents”3 due to their further their children’s interest in the
and websites, and artistically expressed ongoing, extremely close relations with world.
in the virtual reality of the Matrix series their kids. Concerned about their In response to parental demand,
of movies. future, these soccer moms and dads more and more robot training camps
For a young Millennial born in actively (over) schedule their kids’ lives and nontraditional schools teaching
1990, however, PCs and video games with educational enrichment programs robotics are opening nationwide. Case
have “always” existed and are simply that might enhance college applica- in point: In November 2004, the High
part of school work and everyday life. tions. They tend to support their kids’ Tech High-LA center opened at
Ditto for the Internet, Email, instant robotic tinkering, even if they don’t Birmingham High School in Van Nuys,
messaging, and other technologies so fully understand it. CA4. This charter school’s college-prep,
hot in the 1990s. Older Millennials (13-20) usually math- and science-oriented curriculum
In contrast, real robots have begun have Baby Boomers for parents, while draws students from across Los
to appear outside labs during their life- younger ones (8-12) usually have Xer Angeles — including many from minority,
times. The FIRST robotic competition moms and dads. This latter generation, low income neighborhoods. The new
and LEGO Mindstorms were created. now 30-somethings (once derided as center is loaded with computers and
Honda’s humanoid Asimo went on a “slackers” during their own youth in huge flatscreen “blackboards” — and is
tour of US schools. Mobile robots
began to enter middle and high school
education and hobby robotics References
flourished.
None of these was a simple exten- 1. Millennials Rising: The Next Great Stuart Silverstein, Los Angeles Times in
sion of PC and Internet technology. Generation , Neil Howe and William “The State”, November 28, 2004.
Robots are fundamentally different Strauss, Vintage Books (Random
from both: instead of creating a virtual House), New York (2000). Website:
world humans must enter, a robot www.lifecourse.com 4. “A Dream School Becomes
strives to enter our real world. Reality: Efforts of Ex-Trustee Wintraub
This “turn to the real” tech wave is Come to Fruition as Charter Campus is
perfect for the new generation.
2. “Who’s Filling Gen-Y’s Shoes?,” Dedicated.: Jean Merl, Los Angeles
According to generational theory, each
Dr. Pete Markiewicz, Brandchannel Times, November 18, 2004.
new generation strives to break from
previous ones by adopting different (Division of Interbrand) Website, May
ideas, icons, and values that manifest 2003. Web link at: www.brand
during their youth. Most Boomers and channel.com/start.asp?id=156 5. “Robots Invade Santa Monica.”
Xers outside the academia and hobby Phil Wayne, The LookOut News Online,
communities still don’t know the Nov. 29, 2004. Web link at: www.surf
robots are rising. 3. “Colleges Are Learning to Hold santamonica.com/ssm_site/the_
In contrast, school-aged Millennials Parents’ Hands: The Same Baby Boomers lookout/news/News2004/Nov2004
know them intimately from their Who Cast Off Family Ties When They Left /11_29_04_Robots_Invade_Santa_
classes, FIRST robotics competitions,
Home Just Can’t Let Go of Their Kids,” Monica.htm
and hobby groups.
SERVO 01.2005 81
Appetizer.qxd 12/9/2004 9:57 AM Page 82

kids’ knowledge of the RoboNexus growing up, Millennials will have little
Movie Link exhibits — until they found out they use for the Frankenstein fantasies of
were building robots in school. earlier generations. Instead of running
See the RoboNexus movie! – This from the Terminator, they’ve said hello
hyperlink will take you to a short
RoboNexus movie by the author,
How the New to Asimo.
By the time this trend is underway
featuring both robots and their Generation Will in the next decade, PCs, the Internet,
Millennial friends. Affect the Future of and wireless gadgets will seem like
http://www.plyojump.com/ Robotics electrical wall sockets do today —
movies/tradeshows/robonexus/ essential, but hardly the breaking wave
2004/robonexus_plyojump.wmv How will Millennials affect the rise of tech. Robots will be the hip, “in,”
of the robots? Here’s a recent quote and young technology — just like the
(Windows Media File)
from Toshitada Doi, Vice President of PC and Internet were in other eras.
Sony Corporation: Millennials will want real robots — the
literally crawling with student-built virtual robots in games and movies that
robots. “The 90s was the era of the PC entertained earlier generations just
A few weeks later, on the other and the Internet. The first decade of won’t cut it.
side of Los Angeles, Santa Monica the 21st century will be dominated by So, have at those robots! If you’re
College (a two-year community robots.” a part of the Millennial generation,
college regarded as a “finishing be proud that generational experts
school” for students planning to The oldest Millennials are just expect great things from you. If you’re
attend universities) announced it will graduating from college and the main from an older generation, get busy
begin teaching Mobile Robotics in wave of their generation will become mentoring kids with your robotic
spring 20055. Both schools have young adults 2009-2015. As these knowledge and get ready to see an
recognized the generational trend and kids move out of school and into their extraordinary new generation bring on
are catering to an increasingly robot- first jobs, they will remember playing the robotic age. SV
aware youth culture. with robotic toys and building robots
Evidence that Millennials know in school. It is only natural that they
robots better than the “next up” gener- will embrace robotics as the next big
Author Bio
ation was evident in audience ages at thing. Dr. Pete Markiewicz has a degree
RoboNexus. There will be two aspects to the in Biology, but was co-founder of one
While the 25er Internet junkies Millennial interest in robotics. One
of the first commercial websites in
and 30ish video game-meisters will be a boom in consumer robotics
weren’t entirely absent, they were low — Millennials will see it as natural and early 1994. He currently teaches
in number compared to the 8-16 year even inevitable that a robot mower programming at the Art Institute of
olds swarming the booths. Hardly a will replace a manual one, while California, Los Angeles. His company
piercing, skateboard, or Avril Lavigne older generations may resist (until — Indiespace (www.indiespace.com)
getup was to be seen. Instead, necessity forces robotic elder care — specializes in consulting in new
RoboNexus featured Boomers and on them). technology from a generational per-
Xers as mentors accompanying their Even more importantly, Millennials spective. His website documenting
Millennial kids. will also shift the pop culture mindset the rise of the robots may be found
I suspect more than a few of regarding robots. Having favorable
at www.plyojump.com
these parents were stunned by their experiences with real robots while

Advertiser Index
All Electronics Corp. ....................................37 Jameco ..........................................................83 Pololu Robotics & Electronics ....................47
APEC 2005/MicroMouse Contest ..............66 Lemon Studios .............................................45 ROBOlympics ...............................................63
Cleveland Institute of Electronics ...............13
Lynxmotion, Inc. ...........................................69 Rogue Robotics ............................................21
CrustCrawler ...................................................7
Net Media .......................................................2 Solutions Cubed ...........................................67
Cyberbotics ..................................................27
NUBOTICS .....................................................37 Sozbots..........................................................49
Enigma Industries ........................................37
Parallax, Inc. ...................................Back Cover Technological Arts .......................................28
Garage Technologies, Inc. ...........................37
HiTec .............................................................29 PCB123/PCBexpress ......................................3 Vantec ...........................................................35

Hobby Engineering .....................................75 PCB Fab Express ...........................................33 Zagros Robotics ...........................................37

82 SERVO 01.2005
CoverInside.qxd 12/9/2004 3:33 PM Page 2

Circle #60 on the Reader Service Card.

SERVO 08.2004 83
Circle #32 on the Reader Service Card.
Cover.qxd 12/9/2004 3:54 PM Page 84

Vol. 3 No. 1
SERVO MAGAZINE
HACK-A-SAPIEN WINNERS
January 2005

U.S. $5.50 CANADA $9.25


0 1>

0 74470 58285 4
Circle #106 on the Reader Service Card.

Vous aimerez peut-être aussi