Вы находитесь на странице: 1из 84

Cover.

qxd 1/5/2005 4:20 PM Page 84

Vol. 3 No. 2
SERVO MAGAZINE
RECYCLABLE ROBOT SOFTWARE
February 2005

Circle #106 on the Reader Service Card.


CoverInside.qxd 1/4/2005 9:42 PM Page 2

Remember when...
...electronics stores were stocked to the rafters

with every component imaginable and there was ALWAYS


a knowledgeable person there to help you?

Think those days are gone?


Well they’re not! 1-800-455-6119
You just need a little Jameco@Home.
Call for a FREE catalog today.

We have the electronic components and knowledgeable


Technical Support people who can help bring back the fun
in your electronics hobbies, inventions, and DIY projects.

Circle #60 on the Reader Service Card.


Be sure to visit our new website at Jameco @ Home
www.Jameco.com/nvb —where electronics is still fun!
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 1/4/2005 4:46 PM Page 4

Departments Columns
6 Publisher’s Info 6 Mind/Iron
7 Bio-Feedback 8 Rubberbands
44 New Products 12 Robotics Resources
50 Robo-Links 17 Assembly Line
62 Events Calendar 24 Brain Matrix
63 Robotics Showcase 43 Menagerie
70 SERVO Bookstore 64 Robytes
82 Advertiser’s Index 66 Ask Mr. Roboto
72 Lessons From the Lab
78 GeerHead
81 Appetizer

Take a Sneak Peek!


Thanks to Sozbots
(www.sozbots.com)
for the photo of RoboOne
on the cover!

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
W alk This W ay, Ey! OFFICES. POSTMASTER: Send address changes
to SERVO Magazine, 430 Princeland

Coming 3.2005 Court, Corona, CA 92879-1300 or


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

4 SERVO 2.2005
TOC.qxd 1/4/2005 8:13 AM Page 5

SERVO 2.2005VOL. 3 NO. 2

Features & Projects

19 Recycle Your Robot’s Code


by Steven Grau

26 Step Up and Get Motorvated!


by Peter Best

37 A Cut Above
by Michael Simpson

46 PIC Your Speed


by Dennis Volrath

51 The Core of the Atom, Part 2


by Kerry Barlow

57 Hats Off to RoboSapien


by Henry Pfister

SERVO 2.2005 5
JanPages6&7.qxd 1/5/2005 8:41 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

Mind / Iron www.servomagazine.com

Subscription Order ONLY Line


1-800-783-4624
by Alexandra Lindstrom Œ

PUBLISHER
I’ve seen creative writers refuse to transformation. In order to accomplish Larry Lemieux
discuss their new work until it’s safely in such a goal, the minds of the publisher@servomagazine.com
print. At races and car shows, I have community have to share their
witnessed people acting as if their hoods inspirations, failures, and successes. To ASSOCIATE PUBLISHER/
VP OF SALES/MARKETING
were hermetically sealed. Academics paraphrase Marleen Barr, the noted
Robin Lemieux
often neglect to teach about a new critic of science fiction literature, only robin@servomagazine.com
thought until they have safeguarded by questioning the established
their intellectual property. Yet, robot knowledge and practices of a MANAGING EDITOR
builders will practically gut their community can we ever hope to move Alexandra Lindstrom
creations in order to show someone how beyond the present knowledge base alexa@servomagazine.com
to replicate their builds. They publish and advance to the goals we all claim
their code and parts lists online and in to support and work toward. CIRCULATION DIRECTOR
Mary Descaro
the pages of this magazine. That sentiment finds its validation subscribe@servomagazine.com
This trait, at first, seems at odds in the upcoming robotic generation.
with the sentiments Dave Calkins writes Almost any given issue of SERVO WEB CONTENT/STORE
about in this month’s “Appetizer.” Dave highlights the successes of those who Michael Kaudze
discusses the competitive programming aren’t even old enough to vote, yet find michael@servomagazine.com
of the human race and, therefore, new ways to push the boundaries of
robot builders. As I read Dave’s article, the field. In addition, the people behind PRODUCTION/GRAPHICS
Shannon Lemieux
I agreed with him wholeheartedly; High Tech High saw a need to open a
robotic events offer the best means to new campus in Los Angeles, CA, that COVER ART
learn, be inspired, and meet like- caters to lower-income students who Michele Durant
minded individuals. I began to wonder would, otherwise, not be able to access
why — in such a competitive hobby as such an intensive eduction in robotics STAFF
robotics — the community remains so and technology. Kristin Rutz
open about the methods used to create As a community, we see that Dawn Saladino
the prize-winning bots seen at these young minds which haven’t yet learned
OUR PET ROBOTS
events. what we say can’t be done are, in fact,
Guido
When you think about it, is the basis of our future. As we share our Mifune
competition really at odds with the trade secrets, they will take us up on
open exchange of ideas? I don’t believe the challenge of moving forward, using Copyright 2005 by
it is. A true competitor will tell you that the knowledge and information that T & L Publications, Inc.
winning only counts when the found its root in others. All Rights Reserved
challengers are evenly matched. Still, it When that day comes where the
can’t be that simple; even in a relatively robotics revolution has firmly taken All advertising is subject to publisher's approval.
We are not responsible for mistakes, misprints,
young field — like robotics — skilled hold, it may be those who now look or typographical errors. SERVO Magazine
competitors can be found. forward to being old enough to assumes no responsibility for the availability or
Upon reflection, I believe that this compete in FIRST who lead the way, condition of advertised items or for the honesty
openness in the robotic community but their inspiration and education will of the advertiser.The publisher makes no claims
stems from a common goal to further be founded on what others shared for the legality of any item advertised in SERVO.
the field. We all know that robotics will, openly in an effort to create a well- This is the sole responsibility of the advertiser.
one day, revolutionize the world as we rounded community of equally Advertisers and their agencies agree to
indemnify and protect the publisher from any
know it and we want to be a part of matched and like-minded individuals
and all claims, action, or expense arising from
that wave of social and cultural who are at the robot events today. SV advertising placed in SERVO. Please send all
subscription orders, correspondence, UPS,
overnight mail, and artwork to: 430 Princeland
Court, Corona, CA 92879.

6 SERVO 02.2005
JanPages6&7.qxd 1/5/2005 11:19 AM Page 7

Dear SERVO, Dear SERVO, two pages of captioned pictures and a


From what I have read, I think I like I enjoyed Jack Buffington's vague promise of more to come (of
SERVO Magazine better than Nuts & “Rubberbands and Bailing Wire” article which I see nothing in the January issue).
Volts. I have never subscribed to N&V, regarding the addition of an LCD to a The electrical engineering journal
but I have purchased it from time to robot (January 2005). It was well we subscribe to at work covered the
time from a local Border’s bookstore. written and had some good tips. event almost as well as you have (they
SERVO Magazine seems more My biggest comment is simply that gave it a whole two sentences). I'm not
appealing to me. these displays (parallel) are a pain in sure what else I expected from the
While I am not an active robotics the butt! Yes, they have a few good coverage of this event, but it was
enthusiast, I do like controlling things points, which were mentioned in the definitely more than I've gotten from
with embedded microcontrollers. That article. However, for the novice builder your last two issues.
is the reason for my main interest in using a display for the first time, I Thanks for your time.
SERVO Magazine. would highly recommend starting out
I am not particularly a BASIC Stamp with a serial display. Jason Urban
fan. I prefer the MC68HC11 and the Granted, they are a little more via Internet
Atmel AVR breeds of microcontrollers expensive, but they are much easier to
but, what information SERVO provides is use and only take up one pin on the Dear Jason,
directly applicable to those other kinds PIC (or STAMP or whatever). If you In our goal to provide interesting
of microcontrollers, too. don't have an "official" serial port on and informative reading for our diverse
the processor, you can always do some audience, we decided to spread the
Carl W. Livingston, bit banging. coverage of Tetsujin over several issues
via Internet Keep up the good work. rather than one. Future issues will
feature articles by or interviews with
Dear SERVO, Paul Kafig the Tetsujin competitors. These articles
Great magazine and excellent via Internet will contain details about their builds
articles! I’m looking forward to some and the successes and trials they found
Roomba hacks. I just hope you don't go Dear SERVO, along the road to Tetsujin. The
"tango uniform" like the other I must say that I am a bit December issue of SERVO featured an
magazines I used to receive. disappointed in your coverage of your “Appetizer” column by Tetsujin winner
much promoted and anticipated Tetsujin Alex Sulkowski as a forerunner of the
Steven Canning competition. As an avid reader, I must content to come.
via Internet admit I was expecting a bit more than — Editor

Circle #70 on the Reader Service Card.


SERVO 02.2005 7
Rubberbands.qxd 1/3/2005 4:14 PM Page 8

by Jack Buffington

Bars and Batteries:


Displaying Your Robot’s Battery
Level on an LCD Display

Thisexpands
month’s column is a bit of a mixed bag. The first part
on last month’s column, which described how to
To create a special character, you will need to issue a
command to set the character generator RAM address.
communicate with an alphanumeric LCD display. This month, There are 64 bytes of character generator RAM. Each char-
you’ll learn how to create custom characters. Using these acter is built by using eight of those bytes, which represent
characters, you’ll learn how to draw bar graphs. The second the pixel rows in the characters. Only the lowest five bits
part of this column will use one of the bar graphs and a are used. If you set a bit high, its corresponding pixel
little extra circuitry connected to your microprocessor to will turn black when that character is displayed. To build a
allow you to monitor the battery voltage of your robot. character, you will specify the first character generator
Let’s dive right in and start with custom characters. A RAM address that you want to write to and then you
custom character is any character you might create that is will send data corresponding to the pixel rows for that
not part of the standard character set. As you can see in character. Each byte sent will represent a lower row of
Figure 1, there are plenty of different characters to choose pixels in the character.
from, but — if you can’t find the character that you want — Figure 2 shows a character and the data that you would
then the HD44780 can let you create up to eight special char- send to define it. If you sent a character generator address
acters of your own design to be displayed. These characters of zero and then wrote eight bytes of data, then you will
are mapped into the spots on the left side of the chart in have completely defined the first character. If you send an
Figure 1. Some potential uses for custom characters would additional byte, then you will have written to the top row
be to display things such as a square, diagonal arrow, Greek of the second character. You can change the character
letters, a moving clock icon, or bar graphs. generator address at any time, so you could choose to write
to the first character and
Figure 1. The standard characters of the Figure 2. A smiley face and the bytes that you then skip to the third char-
HD44780 and their character codes. can use to create it. acter, if you wanted to.
Our first example will
be to create special charac-
ters that will let you create
vertical bar graphs of any
height. To make this easy
to integrate into a program,
the bar graph code is imple-
mented in two subroutines
and one look-up table. The
look-up table holds
Figure 3. A look-up table for a vertical bar graph.
the bytes of data
used to initialize
const int8 vGraphBytes[] = {0,0,0,0,0,0,0,31,
0,0,0,0,0,0,31,31, the characters, the
0,0,0,0,0,31,31,31, first subroutine
0,0,0,0,31,31,31,31, writes those bytes
0,0,0,31,31,31,31,31, to the character
0,0,31,31,31,31,31,31,
0,31,31,31,31,31,31,31, generator RAM,
31,31,31,31,31,31,31,31}; and the second
subroutine draws
8 SERVO 02.2005
Rubberbands.qxd 1/3/2005 4:16 PM Page 9

Rubberbands and Bailing Wire

a bar graph for you.


The vertical bar graph routine will draw a bar graph up void lcdMakeVbarGraphCharacters()
{ // vertical bar graph
to four characters high on the column that you specify. This int8 temp8;
routine accepts an eight-bit value for its magnitude, which it
scales for you to the appropriate value that it needs. It makes output_low(RS);
reference to a subroutine called lcdMoveTo(). You can find output_low(RW);
output_high(E);
details about this routine in last month’s column. portB = 0b01000000;
You can pack a lot of vertical bar graphs into an LCD delay_us(20);
screen, but you can only display 32 different values this output_low(E);
way, so you may want to use a horizontal bar graph. With a lcdBusy();
horizontal bar graph, you can display 200 different values. for(temp8 = 0; temp8 < 64; temp8++)
This can give you a clearer indication of an eight-bit value. {
Here are the look-up table and subroutine that draw a lcdPutChar(vGraphBytes[temp8]);
horizontal bar graph. }
}
So far, you have been shown how to draw bar graphs,
but nothing has been said about how you could go about Figure 4. A subroutine that sets up the characters for
using them. Some ways that you could make use of a bar the vertical bar graph.
graph could be as a sound level meter, a speedometer, a
graph of how many times something has happened over a result in the voltage of the battery being divided in two,
certain duration, or as a progress indicator for lengthy which shifts the voltage into a range that the PIC’s A/D
calculations. If you used multiple vertical bar graphs, converter can read. If you are using the circuit in Figure 7,
you could build a strip chart to show the value of some then you will start to lose accuracy as the battery voltage
variable over time. The example shown here will be how to drops near 5 volts. At this point, the voltage regulator will
use a bar graph to display the current level of your robot’s start to output a voltage less than 5 volts, which throws off
batteries. the calculation. Still, if the voltage has dropped to 5 volts,
You might think that having your robot measure the then the battery is very close to dead anyway.
state of its own batteries would be a tricky process, but it is Let’s look at how you can calculate and display the
actually quite simple. All that it requires is that you have one battery’s voltage on your LCD display. The A/D value that is
free analog to digital (A/D) input pin and two resistors! The read is an eight-bit value. Since the processor is running at
example here shows how to measure the state of a 9 volt 5 volts and the circuit is using a voltage divider that divides
battery, but other voltages can be measured using simple the input voltage by two, the maximum voltage that can be
changes to the circuit and program.
To create the circuit, you will take two resistors and Figure 5. A subroutine that draws a vertical bar graph.
connect them together to create a voltage divider, as shown
in Figure 7. The PIC in the example is running at 5 volts. The void vBarGraph(int8 magnitude, int8 column)
PIC can use its input voltage as the reference voltage for { //draws a vertical bar graph. Magnitude is 0-255
its A/D converter, so — in this set-up — it will be able to int16 temp16;
measure from 0 to 5 volts. In this example, the voltage level int8 temp8;
of a 9 volt battery is being measured, so a voltage divider temp16 = magnitude;
that has two equal value resistors is being used. This will temp16 *= 32;
temp16 /= 255; // temp16 now contains 0-32

TECH TIDBIT for(temp8 = 4; temp8 != 0; temp8—)


{
Do you keep burning your table or workbench lcdMoveTo(temp8,column);
if(temp16 > 7)
with your soldering iron? Here’s an easy-to-make holder {
that you can build that works just like the ones in lcdPutChar(7); // solid block
expensive soldering stations. Go to your local craft temp16 -= 8;
or hobby store and ask for }
else if (temp16 > 0)
aluminum armature wire. You {
can get it in several diameters, lcdPutChar(temp16 - 1); // partial block
but 1/4” seems to work the best. temp16 = 0;
}
Wrap the armature wire around else
a broomstick or dowel rod to lcdPutChar(32); // space character
create the spiral and then bend }
the base by hand. }

SERVO 02.2005 9
Rubberbands.qxd 1/3/2005 4:16 PM Page 10

Rubberbands and Bailing Wire

read is 10 volts. If you divide 10 volts into 256 equal parts, writing the C code easy, since floating point automatically
then you will be able to resolve the battery’s voltage to within figures out the decimal point for you and you can simply use
.039 volts. That is sufficient for most things, but you could a printf() statement to get your result. To find the voltage,
also set up the PIC to read analog voltages with 10-bit you could simply use the following equation: read voltage =
precision, which would let you resolve your battery voltage (reading/255) * the maximum readable voltage. In this case,
to within .009 volts. That is overkill for this application, so the maximum readable voltage would be 10 volts.
eight-bit resolution will be used. The BIG downside of using floating-point math is that it
There are three ways that you can calculate your battery’s compiles into a gargantuan amount of machine code.
voltage. There is no right or wrong way to do it, but there are Floating-point may be perfectly fine on a desktop computer,
better and worse methods. Let’s look at the obvious first but — on a PIC with very limited resources — you will find that
choice, which is to use floating-point math. This makes using floating-point math is an option of last resort, since it
will run slowly and will take up
Figure 6. The look-up table and subroutine to draw a horizontal bar graph. much of the ROM space that
const int8 hGraphBytes[] = {16,16,16,16,16,16,16,16,
you could otherwise use for the
24,24,24,24,24,24,24,24, rest of your program.
28,28,28,28,28,28,28,28, A much faster and more
30,30,30,30,30,30,30,30, compact method of arriving at
31,31,31,31,31,31,31,31}; the battery’s voltage is to use
integer math. Figure 8 shows
void hBarGraph(int8 magnitude, int8 line) how you would convert
{ between your A/D value and a
int8 temp8a; value of 0 to 1,000, which repre-
int16 temp16a;
// draws a horizontal bar graph the width of the screen on the specified line sents 10.00 volts. This method of
// pass 0-255 in magnitude calculating the voltage is simple,
lcdMoveTo(line,0); compiles to a small amount of
code, and runs quickly. There is
temp16a = magnitude;
temp16a *= 100; one problem with it, though.
temp16a /= 255; // scale it to the range of 0-85 The variable ‘volts’ needs to be a
32-bit variable. This is because
temp8a = 0; you will get overflow errors in
while(temp16a >= 5) // draw in the solid bars first
{
the ‘volts’ variable as temp8a
lcdPutChar(4); goes higher than 65. Using a
temp16a -= 5; 32-bit variable may not be a
temp8a++; problem if you have lots of RAM
}
available, but — if you don’t —
switch(temp16a) // make the last character be the right number of vertical bars
{ there is a third method that
case 0: only requires a 16-bit variable to
lcdPutChar(32); // space calculate the battery voltage.
break; Figure 9 calculates the
case 1:
lcdPutChar(0); voltage without the need to
break; worry about overflow errors. In
case 2: this case, the code is multiplying
lcdPutChar(1); by the fraction 125/32, which is
break;
case 3: really a simplified version of
lcdPutChar(2); the first equation, where the
break; numerator and denominator
case 4: were both divided by eight. This
lcdPutChar(3);
break;
version will not overflow past
} the limits of a 16-bit variable.
temp8a++; You may still have a few
questions about why the A/D
while(temp8a < 20) // overwrite remaining characters in the row with spaces
{
reading was multiplied and
lcdPutChar(32); divided by the numbers that we
temp8a++; used. Let’s look at what these
} numbers are doing. Since Figure
} 8 is the unsimplified version of
10 SERVO 02.2005
Rubberbands.qxd 1/3/2005 4:17 PM Page 11

Rubberbands and Bailing Wire

the fraction, we’ll use it for this example. It might be simpler


to think of the order of operations as dividing the reading volts = temp8a;
by 256 and then using that value to multiply by a number volts *= 1000;
representing the maximum voltage. volts /= 256;
Let’s first look at how the value is divided by 256. This is
because the A/D reading divided by 256 will result in a value Figure 8. Calculating
the battery voltage
from 0 to 1 (actually .996 because the maximum A/D value using integer math.
is 255). If you multiply this value with another value that
represents your maximum measurable voltage, then you will
arrive at your answer. For example, in Figure 8, if 2,250 was volts = temp8a;
used instead of 1,000 on the second line, then that would volts *= 125;
volts /= 32;
represent 22.50 volts. You would need to adjust the values
of your voltage divider to output 5 volts when the input was Figure 9. Calculating
22.5 volts, as well, in order to measure up to 22.5 volts. The Figure 7. The wiring needed to the battery voltage
reason that the multiplication happens first is because — if measure your battery’s voltage. using a 16-bit variable.
you divide your A/D value by 256 — you will always have a
result of 0, since you are working in integer math. integer = 0;
You now are able to have your microcontroller figure while(volts > 99)
out its battery voltage. If you are simply using this figure for {
volts -= 100;
internal calculations, then you could stop here. If you want integer++;
to be able to display it on your LCD screen, then you will }
probably want to add a decimal point to the value so that it decimal = volts;
is more easily understood.
Figure 10 shows a chunk of code that lets you figure out hBarGraph(temp8a,1);
lcdMoveTo(2,0);
an integer portion and a decimal portion of the value and printf(lcdPutChar,”%u.%02u volts”, integer,decimal);
then print it out on the screen. It also prints out a horizontal
bar graph above the reading as a quick way that you can Figure 10. How to display the battery voltage.
visually read the battery voltage.
As a final wrap-up on this topic, here are two other ways by 57, you get 4.49, which is the voltage of your battery.
of measuring battery voltages. If you are looking to measure A 1 volt reference makes the calculation easy, but the
the voltage of a battery that does not power the processor, math isn’t too much harder if you use a different voltage
you just need to tie its ground to the processor’s ground. This reference.
will allow you to measure its voltage. If you are trying to This month’s column showed you how to draw bar graphs
measure the voltage of a battery that is powering your and how to measure your robot’s battery’s voltages. Now, you
processor directly without a voltage regulator between the can build robots that have an actual user interface and that
battery and the processor, then you will need to use a circuit can know when their batteries are getting low so that they
like the one shown in Figure 12. can seek out a way to recharge or at least shut down grace-
This circuit uses a fixed voltage reference as the input fully. This should give you quite a bit to play around with until
to the A/D converter. A voltage reference of 1 volt or some next month’s column, where we’ll show you how to give your
other low voltage will work fine. As your battery voltage robot speech output so
drops, the A/D reading will increase. Let’s say that that it can talk to you! SV Figure 12. Measuring the
you were using a voltage reference of 1 volt voltage when the battery
powers the processor directly.
and your A/D reading was 57. If you divide 256 Figure 11. The final result.

RESOURCES
www.ccsinfo.com
Source of the C compiler for PIC processors
used in this column.

www.digikey.com
Source for electronic parts.

www.mpja.com
Sells the LCD module used in this article.

SERVO 02.2005 11
RoboResources.qxd 1/3/2005 1:24 PM Page 12

Robotics Resources:
BEYOND THE
FIVE SENSES
by Gordon McComb

A robot without sensors is just a


fancy machine. If “clothes make
the man” (this applies to women,
special types worthy of their own
future column.

too, of course), then sensors make General Sources for


the robot. Many robots have basic
mechanical and optical sensors — Sensors
touch switches for detecting a collision Here are sources for general
with an object, for example, or infrared industrial sensors, which include
sensors that sense nearby objects. mechanical and electronic (usually
In this column, you’ll find sensors peizoelectric) gyroscopes, ultrasonic
that extend beyond basic touch and sensors, inductive sensors, and impact
infrared. There’s a whole world of sensors. Most of these sources are
unique sensors — originally designed manufacturers and offer fairly high end
for medicine or industry — that can be products for medical and industrial
applied to robotics. These sensors applications (think $$$).
can be quite expensive and several However, even if you can’t afford a
high-end variations are listed in the $450.00 gyro, you can read through
sources that follow. the application notes and spec sheets
However, most of the resources for ideas.
presented here are either on the
affordable end of things or offer con- Baumer Electric, Ltd.
cepts (with data sheets and application www.baumerelectric.com
notes) that you can study as you learn Baumer makes industrial sensors:
how the various sensor technologies inductive capacitive, photoelectric,
work. retro-reflective, thru-beam, ultrasonic,
Note that, while some sensor proximity, and rotary encoders. This
manufacturers will sell directly to the stuff isn’t cheap, but — if you need
public, those that do often have quality — this is where you’ll find it.
minimum order requirements. If you The web page is in English and
see a sensor that you’d like to try, German.
consider contacting the manufacturer
and asking for a sample. Try their website Carlo Gavazzi Holding AG
for a list of distributors and be sure to www.carlogavazzi.com
check out the usual sources of elec- High end industrial automation
tronics parts, including Jameco, components. Sensors (proximity,
Mouser, Acroname, BG Micro, Digi-Key photoelectric), solid-state relays, and
and other advertisers in this magazine. motor controllers.
You’d be surprised what goodies you
can find if you dig deep enough. Crossbow Technology, Inc.
Some sensor categories that aren’t www.xbow.com
included are tilt and accelerometer (see Crossbow is into industrial sensors.
“Robotics Resources,” June 2003 in Among their product line are inertial
Nuts & Volts Magazine). We’ll also skip and gyro systems, accelerometers,
video vision sensors and incremental wireless sensor networks, tilt sensors,
encoders this time around, as these are and magnetometers.
RoboResources.qxd 1/3/2005 1:26 PM Page 13

ROBOTICS RESOURCES
Davis INOTEK module can be connected to almost Sunx Sensors USA
www.inotek.com any computer or microcontroller www.sunx-ramco.com
Sensors (Omron proximity, others), and provides real time, continuous Specialty miniature sensors for
test equipment, and RFID. distance measurements using industrial control applications: photo-
ultrasonics. The measurement values electric, fiber optic, inductive proximity,
Entran Devices, Inc. are sent as digital signals and are micro-photo, laser beam, color and
www.entran.com selectable between microseconds, mark detection, ultraviolet, ultrasonic,
Manufacturer of strain gauges, millimeters, or inches. pressure, and vacuum. Spec sheets are
load cells, accelerometers, and in Adobe Acrobat PDF.
pressure sensors — not cheap. The SensComp
website is in English, French, German, www.senscomp.com Vishay Intertechnology, Inc.
and Spanish. Ultrasonic sensors, including www.vishay.com
(what were) the Polaroid electrostatic Vishay is a leading manufacturer
Honeywell International, Inc. transducers and driver boards. of all sorts of electronic components,
www.honeywell.com SensComp bought out the Polaroid including motion sensors, optical
Honeywell is a manufacturer of division that made these transducers sensors, conductive plastic rotation
automation and control products. and is now the source for these sensors, and more. Their website lists
Several of their products are available excellent products. the major categories of products —
through distributors. The company also complete with PDF data sheets. Spend
sells some products direct. Sensors, Inc. a few hours browsing and you’re sure
www.sensorsincorporated.com to find some interesting stuff!
Measurement Specialties, Inc. Sensors, what else? Online retailer/
www.measurementspecialties. distributor for Hohner (encoders), GPS Sensors
com Carlo Gavazzi (proximity), Cutler-
Measurement Specialties makes Hammer, SICK, and others. GPS stands for global positioning
and sells sensors, particularly peizo satellite, a system of special communi-
sensors using Kynar plastic. These SICK, Inc. cations satellites used to pinpoint loca-
sensors can be used for such things www.sickoptic.com tions on the ground. Though once
as ultrasonic measurement, touch or SICK is a manufacturer of high strictly for use by the military and
vibration sensors, and as accelerome- end industrial sensors and electronic select commercial applications, GPS
ters. The company provides online measurement systems, including laser systems are now routinely available for
buying, but the minimum order is proximity scanners, barcoders, and 2-D consumer use. Several GPS receivers
$100.00. Some of their products are laser radar. Technical white papers are come ready-made for connection
also sold by other distributors. available on the site. directly to a computer, which — with

Murata Manufacturing Co.


www.murata.com
Makers of pyroelectric infrared
sensors, peizoelectric gyroscopes,
yEngineering
HobbyEngineering
The
The technology
technology builder's
builder's source
source for
for kits,
kits, components,
components, supplies,
supplies, tools,
tools, books
books and
and education.
education.
peizoelectric ceramics sensors, thermis-
tors, magnetic pattern recognition sen-
sors, shock sensors, and peizoelectric Robot
Robot Kits
Kits For
For All
All Skill
Skill Levels
Levels ICs,
ICs, Transistors,
Transistors, Project
Project Kits
Kits
sound components.
Lots and lots of data sheets. Motors,
Motors, Frame
Frame Components
Components
and
and Scratch
Scratch Builder
Builder Supplies.
Supplies.
Offices are in Japan, North America,
and Europe.
Order
Orderby
byInternet,
Internet,phone,
phone,fax
faxor
ormail.
mail.

Robot Electronics www.HobbyEngineering.com


www.HobbyEngineering.com
www.robot-electronics.co.uk
Books
Books and
and
1-866-ROBOT-50
1-866-ROBOT-50
Robot Electronics — also known as 1-866-762-6850
1-866-762-6850
Devantech — manufactures unique Educational KK 1-650-552-9925
1-650-552-9925
1-650-259-9590
1-650-259-9590 (fax)
(fax)
and affordable robotic components, sales@HobbyEngineering.com
sales@HobbyEngineering.com
including miniature ultrasonic sensors, 180
180 El
El Camino
Camino Real
Real
an electronic compass, and a 50 amp ponents
BEAM Kits and Components Millbrae,
Millbrae, CA
CA 94030
94030
H-bridge for motor control. Visit
Visit our
our store
store near
near SFO!
SFO!
The company’s SRF08 high
performance ultrasonic rangefinder Most
Most orders
orders ship
ship the
the day
day received!
received! World-wide
World-wide shipping.
shipping. Convenient
Convenient pay
payment options..

SERVO 02.2005 13
RoboResources.qxd 1/3/2005 1:29 PM Page 14

ROBOTICS RESOURCES
proper software — can interpret the positioning satellite (GPS) equipment,
positioning signals. GPS receivers can including receivers, antennas,
be used with outdoor robots to give differential GPS modules, OEM GPS
them a sense of exactly where they are kits, and books. They also provide
in the world. seminars on GPS.

Garmin, Ltd. Synergy Systems, LLP


www.garmin.com www.synergy-gps.com
Garmin is a major manufacturer OEM and board level GPS
of GPS systems, including OEM systems, using Motorola modules. Sells
modules. A popular GPS unit that is starter kits for quick prototyping
used in robots is the eTrex miniature and developing.
GPS handheld.
You can buy accessories (data Optical Sensors
cables, mounting brackets, etc.) from
Garmin, but the GPS units themselves Optical sensors use light to detect
are only sold through resellers. Online objects. Depending on the sensor
resellers include GPS City, GPS technology used, it’s possible to use
Discount, and others. light to not only determine if an object
is near (proximity), but also how far
GPS City away an object is (distance).
www.gpscity.com These resources specialize in
Sells GPS units for all occasions. optical sensors, which include infrared,
Among many products, they sell the passive infrared (like the kind used in
Garmin GPS 35 OEM sensor, which motion detectors), and ultraviolet.
can be connected to any PC or micro- Each variation has its own unique
controller through an RS-232 serial applications.
interface.
Glolab Corp.
Lowrance Electronics, Inc. www.glolab.com
www.lowrance.com Glolab manufactures and sells
Lowrance is in the business of GPS multi-channel wireless transmitters and
and sonar devices. Check out their GPS receivers, along with encoder and
Tutorial. decoder modules (to permit controlling
more than one device through a
Magellan/Thales Navigation wireless link).
www.magellangps.com They also provide pyroelectric
Manufacturer of GPS systems. infrared sensors and suitable Fresnel
lenses. An amplifier and hook-up
National Marine Electronics diagram for the PIR sensor are available
Association (NMEA) on the site.
www.nmea.org
A technical association that helps Hamamatsu Corp.
set standards for marine electronics. www.hamamatsu.com
One such standard of importance to The main Japan office is listed;
amateur robot builders is NMEA- the web page is provided in many
0183. This is a voluntary standard languages and local offices are in many
followed by many manufacturers of countries, including the US, France, the
global positioning satellite receivers. It UK, Germany, and Italy.
allows the GPS module to interface Provides: photonics detectors,
with other electronics, such as a flame detectors, photo-multiplier
computer. tubes, imaging systems, and optical
linear arrays. Products are available in
Navtech Seminars and GPS limited sample quantities and are sold
Supply through distributors. Some items of
www.navtechgps.com particular interest are (app notes
Navtech is a reseller of global provided for many sensor types): flame
Circle #25 on the Reader Service Card.
14
RoboResources.qxd 1/5/2005 10:47 AM Page 15

ROBOTICS RESOURCES
sensors (UV TRON), CdS photoconductive cells, infrared RFID, Inc.
detectors, and photo ICs. www.rfidinc.com
Makers and sellers of RFID receivers and transponder
Leica Disto tags. Offer relatively inexpensive starter kits with sampler
www.disto.com tags and receiver.
Manufacturers of handheld laser range finders. The cost
isn’t exactly cheap, but reasonable for a high end bot. Part of Strain Gauges and Load Cells
the worldwide Leica Geosystems group (address provided is
for the US office); products are available from distributors Strain gauge sensors — and their close cousin, the load
or online. cell — are used to measure a variety of physical attributes,
including pressure, torque, tension, and bending. They are
RFID Sensors routinely used in commercial products, such as bathroom
scales and automotive digital torque wrenches.
RFID stands for radio frequency identification, which is Though industrial strain gauges and load cells are
a kind of sensor that is similar in purpose to barcodes, but quite expensive (upwards of $500.00 for even a basic
is meant to operate over longer distances, and even unit), there are a number of sources for low precision
through other objects. (Implantable biochips — like the sensors that are quite well-suited for robotics. These
kind used for pets and now people — are miniature RFID and other sources for strain gauges and load cells are
units.) provided here. (However, note that possible minimum
Applications in robotics are both obvious and numerous: order requirements exist.)
you can use RFID for robot-to-robot identification, robot-to-
human identification, navigation, beacon systems, and much Interlink Electronics, Inc.
more. A benefit of RFID is that the sensitivity of the reader www.interlinkelec.com
electronics can be varied, so that you can directly control Touch sensors and pads for laptop mice. The touch
maximum working distances. In this way, a room could be sensors use strain gauge (they call it a force sensing resistor)
full of RFID elements, yet your robot will only “see” the one technology. They sell developer’s kits online (though they’re
closest to it.
As yet, there are few RFID systems within affordable
reach of most amateur robot builders; still, it’s an interesting
technology and it’s only a matter of time (perhaps just
months) before affordable entry-level solutions become
available. If nothing else, you can use the resources to learn
more about this technology.

CopyTag Limited
www.copytag.com
Makers of RFID receivers and tags (transponders).

Microchip Technology
www.microchip.com
Microchip makes a broad line of semiconductors,
including the venerable PICmicro microcontrollers. Their
website contains many data sheets and application notes on
using these controllers and you should be sure to download
and save them for study.
The company is also involved with RFID, selling readers
and tags, as well as developer’s kits.

OMRON Corp
www.omron.com
Omron is a multi-talented company, manufacturing a
wide array of sensors and semiconductors. Of note are their
RFID tags and readers and machine vision products:

RFID — www.omron.com/card/rfid/
Machine vision — http://oeiweb.omron.com/machine-
vision.shtm
Circle #37 on the Reader Service Card.
15
RoboResources.qxd 1/3/2005 1:31 PM Page 16

ROBOTICS RESOURCES
a bit expensive) and provide free Semtech Corporation The popular 1490 outputs eight digital
literature on how it all works. The www.semtech.com compass positions (N-NE-E-SE-S-SW-W-
company also manufacturers and sells Makers of encoders for “pointing NW). The 1525 sensor outputs a
(via their online store) consumer prod- stick” style laptop strain gauge continuous analog sine/cosine signal
ucts, including keyboards and mice. pointing devices. The website offers capable of being decoded to any
data sheets and application notes. degree of accuracy.
Measurement Systems, Inc. Items are available in sample quantities
www.measurementsystemsinc. and from distributors. Figaro USA, Inc.
com www.figarosensor.com
Manufacturer of joysticks and Miscellaneous Makers of toxic gas and oxygen
miniature joysticks. sensors.
Sensors
OMEGA Engineering, Inc. The following are makers and PNI Corp./Precision Navigation
www.omega.com sellers of miscellaneous sensor types, www.pnicorp.com
Omega makes sensors and data such as optical mouse sensors, mag- PNI makes compass, radar, magne-
acquisition equipment. Of primary netic sensors, and toxic gas sensors. tometer, and inclinometer sensors.
importance to us robo-builders are
their line of low cost, general-purpose Agilent Technologies, Inc. TAOS
strain gauges. These miniature sensors www.semiconductor.agilent.com www.taosinc.com
can be used to indicate stress or strain Makes and sells unique optical sen- TAOS manufactures low cost
on an object, like the pad of a foot in a sors for use in desktop computer mice. optical array and colormetric sensors.
walking robot. Their linear sensors can be used in such
The sensors are sold in packs of Banner Engineering Corp. applications as line following, pattern
10 and their per-piece cost is $5.00 www.bannerengineering.com recognition, and odometry. The color
to $8.00 for many sizes. This is Manufacturer of industrial photo- sensors detect the color of objects and
considerably less than the average electric and fiberoptic sensors. can be used for rudimentary object
strain gauge that is designed for recognition. Parallax (www.
super-precise industrial measurements. Dinsmore Instrument Co. parallax.com) packages the TAOS
The company website provides copious www.dinsmoresensors.com TCS230 color sensor on a convenient
amounts of data sheets, app notes, Dinsmore manufactures inexpensive project board for use with the BASIC
and engineering articles. digital and analog compass sensors. Stamp and general robotics projects.

FIGURE 1. TAOS provides a variety of unusual (yet reasonably priced) Xilor, Inc.
imaging and color sensors. www.rfmicrolink.com
Check out their ZOFLEX ZL series
material — a pressure-activated conduc-
tive rubber. According to the website,
the resistance change with pressure is
very drastic. The material is at high
resistance (30 Mohms) when pressure
is below the actuation pressure.
Resistance drops to 0.1 ohms or less
when the material is at or
above the activation pressure. The
pressure required is too much for a
“soft touch” sensor, but other
applications are possible. SV

About the Author


Gordon McComb is the author of
several best-sellers about robotics. In
addition to writing books, he
operates www.budgetrobotics.com
which is dedicated to low-cost
amateur robotics. He can also be
reached at robots@robotoid.com

16 SERVO 02.2005
AssemblyLine.qxd 1/3/2005 1:17 PM Page 17

by James Antonakos

Part Inspection — Round # 1:


The Miniature Components

L
ast time, we examined the five W light bulb. With the surface of the construct the photocell is receptive to
requirements for the Uno robot photocell facing the light bulb, the the photons that make up light. More
design — an update of a 1950s resistance measured 7.6K ohms. photons mean more energy, which
light-sensing, collision-detecting robot. Leaving the photocell alone, the 40 W leads to more current flow (and, thus,
Two of the five requirements devel- bulb was replaced with a 100 W less resistance).
oped for the Uno robot project are bulb. The new photocell resistance With all lights off, the photocell
listed in Table 1. These two require- measured 4.4K ohms. The resistance measured 300K ohms. As we might
ments both utilize miniature electronic dropped due to an increasce in the now expect, the dimmest light has
components. light intensity. produced the largest resistance. Table
One source of electronic compo- Grabbing a very bright flashlight 3 summarizes these intensity results.
nents is Jameco Electronics and shining it directly into the photocell The initial intensity results from
(www.jameco.com). Jameco’s online from only inches away caused the Table 3 show what we might expect
catalog makes it easy to locate any photocell resistance to drop to 150 to see as a maximum range of opera-
item in their large inventory. Table 2 ohms. Again, the brighter the light tion for the photocell. Remember that
shows the Jameco information for the intensity, the smaller the resistance. Uno will be in a room with at least one
miniature components identified in This is because the material used to bulb illuminated, so we will never
Table 1.
Figure 1 shows the actual size of Requirement Uno Component
the two components. Their miniature
A photoresistor for sensing brightness.
nature suggests that care should be Seek a light source An analog-to-digital converter will digitize
used when working with them. This the intensity level.
includes handling (dropping them or
bending the leads excessively), Tilt switch used to detect the bump of a
React when encountering an obstacle
collision with an obstacle.
construction (lead soldering time and
temperature must be limited), and Table 1. Two miniature-sized components used in Uno’s construction.
operation (proper amount of biasing
current). Component Part Number Description Price
When the parts arrived in the mail
from Jameco, it was too tempting to CDS (Cadmium Sulfide)
Photocell 202366 Photocell 90 mW, 150 $1.69
resist playing with them. In particular, a
Vp. 0.3 M min dark
series of tests was performed on the
photocell, all designed to watch its Switch,Tilt,Vibration
resistance change in relation to the Tilt Switch 235926 sensor SPDT 0.5 A, $1.49
24 VDC
amount of light presented.
A digital ohmmeter was connected Note that Jameco refers to photocells and not photoresistors,
but that these two terms are interchangeable.
across the photocell and the photocell
was placed 6 feet from an ordinary 40 Table 2. Jameco Electronics catalog information.

SERVO 02.2005 17
AssemblyLine.qxd 1/4/2005 12:59 PM Page 18

THE ASS EMB L Y L INE

Light Intensity Photocell Resistance


Dark room 300K ohms
40 W bulb at 6 feet 7.6K ohms
100 W bulb at 6 feet 4.4K ohms
Flashlight from inches away 150 ohms
Table 3. Initial intensity versus resistance test results.
Figure 1.To the left of the dime is the tile switch sensor.
On the right is the CDS photocell. 6 feet during the test. biasing circuit so that the maximum
Table 5 shows the results. power delivered to the photocell is
approach the dark resistance of 300K Clearly, light must fall directly on always less than 90 mW. If we limit the
ohms. the photocell to have the greatest power to 45 mW (operate at half-load
A second test was performed on effect. It was interesting to see that — to extend the device’s life), we can
the photocell to see how resistance even with the photocell facing totally solve the power equation backward to
changed as a function of distance. In away from the 40 W bulb — there was find the maximum voltage allowed
this test, a single 40 W bulb was used. still only 23 K ohms of resistance, much across the photocell (for its 100 ohm
The photocell was moved to various less than the 300 K ohms when there operating point at high intensity):
distances and its resistance was is no light at all.
recorded. These values are shown in One more aspect of the photocell V = √P•R = √45 mW•100Ω = 2.1 V
Table 4. requires investigation. Recall from
The nice spread of resistance Table 2 that the rated power for the Knowing the limits, we can then
indicates that we will easily be able photocell is 90 mW. Let us think about design the biasing circuit in a way that
to sense when the light intensity is what this means. Suppose you want to protects the photocell while still leaving
changing. put the photocell into a 5 volt biasing it sensitive to light.
The last test performed on the pho- circuit and the design allows all of the The tile switch is a fascinating
tocell checked its response to the angle 5 volts to develop across the photocell. device. If its body is tilted above the
of light rays striking its surface. Here, Furthermore, suppose we are shining horizontal axis, its internal switch closes
the photocell was moved so that light a bright light on the photocell and there is a low resistance (around
struck it at 0°, 30°, 45°, 60°, and 90°. when there is 5 volts across it. The low 1 ohm) between the device terminals.
A 40 W bulb was kept at a distance of resistance of the photocell (100 ohms, However, tilt the body of the device
see Table 4) will cause 250 mW of down so that its axis is below the
Photocell power to be delivered: horizontal and the switch opens up.
Distance
Resistance (Ohms) Thus, we have a straightforward binary
V2 5V2
P= = = 250 mW condition: Tilted = Closed, Not-tilted =
2 inches 100 R 100Ω Open. The leads of the tilt sensor are
1 ft 675 springy. This will allow us to mount
That will surely do a nice job of it so that any collisions will cause it
2 ft 1.1K burning up the unfortunate photocell, to temporarily spring into the tilted
which is only rated for 90 mW, maxi- position, then spring back to its
3 ft 2.5K
mum. Thus, care must be used in our normal, untilted position.
4 ft 3.6K Next up will be the motors and
Angle (Degrees) Photocell Resistance the microcontroller and all of the
5 ft 5.8K required interfacing. When the
6 ft 7.8K 0 5K ohms hardware interface is finished, the
software design will take over. SV
7 ft 8.7K 30 5.1K ohms

8 ft 10.7K 45 5.8K ohms ABOUT THE AUTHOR


9 ft 11.3K 60 6.2K ohms James Antonakos is a Professor in
the Departments of Electrical
10 ft 13K 90 9.5K ohms Engineering Technology and Computer
Studies at Broome Community College.
20 ft 35K 180 23K ohms You may reach him at antonakos_j@
Table 4. Resistance change for each foot Table 5. Effect of angle of incidence on
sunybroome.edu or visit his website at
of distance from photocell. photocell resistance. www.sunybroome.edu/~antonakos_j

18 SERVO 02.2005
Grau1.qxd 1/3/2005 3:03 PM Page 19

by Steve Grau

W hen it comes to building hobby robots, there are many


great resources and products you can rely on for the
mechanics and electronics that will become your robot.
delving into the
Figure 1
mechanical and electronic aspects of building robots. An
Whether it’s a chassis, wheels, motors, a compass, a range assembled IntelliBrain-Bot is shown in Figure 1.
sensor, or a controller board, there is no shortage of The IntelliBrain robotics controller will provide the
products to choose from. However, when it comes to the brain-power for our RidgeWarrior II robot. This controller will
software that will form your robot’s intelligence, the choices allow us to implement software using a modern, object-
are much more limited. Few plug-and-play software compo- oriented programming language — Java. In addition to its
nents exist. Without pre-built software components, you object-oriented nature, Java has built-in support for
must either write all of your robot’s control software from multi-threading and floating point arithmetic — both features
scratch or cobble it together by modifying and integrating that will facilitate creating interesting robotics software
various snippets of code others have published. components that are reusable.
With the advent of several object-oriented programming
languages — Java™ and C# (pronounced C sharp) — the A Little Background
software industry has made great strides in moving toward
industry-wide reuse of pre-built components. Both of these The RidgeWarrior II robot we will be developing is a follow
languages provide the ability to build and package software -up to the original RidgeWarrior robot, which was modeled
components that can be used in a wide range of applications after the Rug Warrior robot discussed in the book Mobile
without modification. Robots: Inspiration to Implementation by Jones, Flynn, and
This is the first in a series of tutorials on building reusable Seiger. The Rug Warrior robot was based on the Motorola
robotics software components. In each article, we will 68HC11 microcontroller and the Interactive C programming
develop new components that add to the intelligence of a language to implement a behavior-based robot. The original
robot named the RidgeWarrior II. A few of the interesting RidgeWarrior robot used the MIT Handy Board controller,
components we will develop are: a shaft encoder to measure also based on the 68HC11 microcontroller, but it was
wheel rotation using an infrared photoreflector sensor, programmed in Java using the RoboJDE™ robotics software
an odometer to keep track of a robot’s position, and a development environment instead of Interactive C.
navigator to successfully move a robot from place to place. For the RidgeWarrior II robot, we will use the IntelliBrain
We will strive to make the components reusable, so you can robotics controller, which is similar in functionality to the
put them to use in other robotics projects. Handy Board, but is based on the Atmel ATmega128
microcontroller. The IntelliBrain controller has significantly
The Robot Platform more computing power and memory than the Handy Board,
which will allow us to take greater advantage of Java’s
The focus of this series is building software components; object-oriented programming and multi-threading features.
therefore, we will use an off-the-shelf kit — the IntelliBrain™- The IntelliBrain-Bot kit is the combination of the Parallax
Bot kit from RidgeSoft (www.ridgesoft.com) — as the Boe-Bot™ chassis and the IntelliBrain robotics controller. As
chassis and controller for the RidgeWarrior II, rather than we program the RidgeWarrior II, we will build on software
SERVO 02.2005 19
Grau1.qxd 1/3/2005 3:05 PM Page 20

Creating Reusable Robotic Software Components

components that already exist in the RoboJDE library and we be built once, packaged, and shared without end users
will create our own new software components. needing to be concerned about any of these things.

Creating Reusable Software Enough Theory!


Components Okay, you’re probably ready to get on with creating some
Our goal is to create software components that are both components. We will skip over the robot assembly and other
useful and easy to reuse in future robotics projects without “getting started” steps, as these things are described in detail
modification. Three keys to achieve this goal are: in the IntelliBrain-Bot Assembly Guide, the IntelliBrain User
Guide, and the RoboJDE User Guide, all of which come on CD-
1. Creating components that are cohesive and provide useful ROM in the IntelliBrain-Bot kit and are also available on
functionality. RidgeSoft’s website. Throughout this series, we will develop a
number of interesting software components for the
2. Creating the components such that they have minimal RidgeWarrior II robot. Let’s start by developing a few compo-
interdependencies — in other words, they are loosely coupled nents to create a user interface framework. By developing the
to the rest of the system. user interface framework first, we will be able to use it through-
out the project to test and debug other components we build.
3. Designing generic interfaces to components that promote
interchangeability. User Interface Requirements
The hobby servo is a wonderful electromechanical example As with anything, there are many ways to implement a
of a reusable hardware component exhibiting these three user interface. For this project, we will implement our user
characteristics. A motor, gears, electronics, and packaging interface based on the following requirements:
form a cohesive component: a servo. It provides a very useful
function — a controllable means for converting electrical 1. Display output using the IntelliBrain controller’s two line
energy to motion. While the servo packs a lot of functionality LCD module.
into a small package, it does so in a way that allows it to be
loosely coupled to the rest of the robot. Furthermore, servos 2. Provide for multiple screens displaying different groups of
implement a simple, generic interface to other components of data.
the system: three wires for power and control, a rectangular
case with four mounting tabs, and an output shaft with 3. Allow the active screen to be selected using the IntelliBrain
splines. The simplicity and utility of this interface has facilitated controller’s thumbwheel while the program is running.
a multitude of interoperable and interchangeable products.
Unfortunately, there aren’t many robotics software com- 4. Periodically update the currently displayed screen without
ponents that hobbyists can incorporate into their projects as interfering with what the robot is otherwise doing.
easily as they can incorporate hobby servos and other popular
mechanical and electronic components. To date, many of 5. Allow the robot operator to select one of several pre-
the most popular robotics software development tools and programmed functions for the robot to perform.
languages have lacked built-in features to facilitate creation
and reuse of software components. Fortunately, Java does! The RoboJDE class library — which contains foundation
software components (Java classes) — provides a class named
Java and Software Reusability “Display.” This class interfaces to the IntelliBrain’s LCD display
and provides a method for printing text strings to either of the
Java was designed from the ground up to support object- two lines of the display. We need to add the ability to create
oriented programming, a software development paradigm multiple screens. Each screen must have the ability to display its
that is ideal for developing cohesive software components data on the screen when it is told to update the display. To
and loosely coupled software systems. In addition to being accomplish this, the screen interface only needs one function
object-oriented, Java supports multi-threading, making it much — or “method,” as they are typically called in object-oriented
easier to implement multi-tasking, real time systems — such as programming languages. We will name this method “update”
a robot — with minimal coupling between components. and create the following generic definition for a “Screen” class:
Java has a built-in mechanism for defining and using soft-
public interface Screen {
ware interfaces, allowing a variety of software components
public void update(Display display);
that implement an interface to be used interchangeably. }
Java also provides a means to share pre-built software
components without dependencies on vendor specific develop- With Java, the source code for a class or interface is nor-
ment tools — like a compiler or assembler — or dependencies on mally stored in its own file with a “.java” extension. Therefore,
a specific microcontroller. Instead, pre-built components can our newly defined interface should be in its own file, named
20 SERVO 02.2005
Grau1.qxd 1/4/2005 2:02 PM Page 21

“Screen.java.” We can create this file with RoboJDE using the a division of Edmund Optics

Yo ur
FY ings!
File->New Class menu item and entering the name “Screen”
as the class name. One other thing we have to do is let the
N I v
Java compiler know where to import the Display object from.
MAtGical Sa
Op
We do this by adding an import statement at the beginning
of the file. The complete code for the class is:
!
import com.ridgesoft.io.Display; NEW
public interface Screen {
public void update(Display display);
}

Now that we’ve defined the Screen interface, it’s time to


l for
create a class that implements it. Let’s create a screen class that line or cal log!
on- cata
just displays two lines of unchanging text. This will enable us to Order ree optics
EXPERIMENTAL
f
have the program display its name and version number. We can & COMMERCIAL
do this by again using RoboJDE’s File->New Class menu item GRADE LENSES
and creating the “StaticTextScreen” class, as follows: ✓ Start Up
✓ Research
import com.ridgesoft.io.Display; ✓ Prototype
✓ Single Unit Applications
✓ Educational Applications
public class StaticTextScreen implements Screen { ✓ Initial Run Requirements
private String mLine1;
Over 5000 seconds, overruns & overstocks ready for delivery at big savings!
private String mLine2;
ANCHOR OPTICAL SURPLUS www.AnchorOptical.com .
public StaticTextScreen(String line1, String line2) Dept. B051-X914, 101 E. Gloucester Pike, Barrington, NJ 08007
{ Tel:1-856-573-6865 Fax:1-856-546-1965 E-mail:cust_srvc@AnchorOptical.com
mLine1 = line1;
mLine2 = line2; Circle #44 on the Reader Service Card.
}
screens and allow selection among screens to display while
public void update(Display display) {
display.print(0, mLine1); the program is running. We will create a Java class named
display.print(1, mLine2); “ScreenManager” to do this. We will extend Java’s “Thread”
} class, which is part of the base Java class library. This
} will allow the screen updating code to be implemented
independent of other portions of the program.
Because this class declares that it implements the Running different parts of a program on different
“Screen” interface, it is required to implement the “update” threads really makes it much easier to create components
method defined by the Screen interface. Our update method that are loosely coupled and easy to reuse. Java’s threading
simply prints predefined text strings to each line of the system takes care of scheduling when each thread runs and
display. In addition to the required method, our class also allows higher priority threads to preempt lower priority
defines two member variables: threads. In a single threaded system, we would need to write
code to manage the scheduling and prioritization of the
private String mLine1; robot’s activities. We would also need to write the program
private String mLine2;
in such a way that screen updates wouldn’t interfere with
other more important and time critical tasks, like avoiding
which refer to each of the strings and a constructor: running into a wall. Instead, we will just give the
ScreenManager thread a low priority, so it will only execute
public StaticTextScreen(String line1, String line2) when there isn’t anything more important to do.
{
mLine1 = line1;
We will need to create the ScreenManager class, similar
mLine2 = line2; to how we created the StaticTextScreen class. We will need
} to declare that the ScreenManager extends the Thread class
as follows:
which allows an instance of a StaticTextScreen to be created
and initialized. public class ScreenManager extends Thread

Managing Multiple Screens We also need to create member variables to keep track
of the Display object, the list (array) of screens that can be
Our next step is to create a class that will manage several displayed, and the input that will be used to select which
SERVO 02.2005 21
BrainMatrix.qxd 1/3/2005 3:30 PM Page 24

budget digital multimeters


Pr
od

C
D

AC
D

AC

ap
Re
C
uc

A
A

ac
C

sis
tN

cc

cc
cc

cc
Vo
Vo

ur

ur
M

ita
ta
ur

ur
ur

ur
lta
lta

re
od
am

re
SUPPLIER

nc

nc
ac

ac
ac

ac
ge
ge

nt

nt
el

e
e

y
y

y
BK 2704B Tool Kit
2704B 1,000 0.5 750 1.5 200 mA 1 2A 1.2 20 Mohm 20 µF
B&K Precision DMM
www.bkprecision.com
Mini-Pro Multimeter 2405A 600 2 600 2.9 10 A 3 N/A N/A 20 Mohm N/A

Digital Multimeter M-1700 600 0.9 600 1.9 10 A 1.5 10 A 2.5 20 Mohm 20 µF
Elenco
www.elenco.com
Digital Multimeter M-2785 750 0.5 750 1 20 A 1 20 A 1.5 200 Mohm 200 µF

MV110 MultiView Series MV110 1,000 0.5 750 0.8 2A 1.2 2A 1.8 200 Mohm N/A
Extech Digital Multimeter
www.extech.com
MultiPro Multimeter MT310 1,000 0.5 700 1.5 20 A 1.2 20 A 2 40 Mohm 100 µF

Fluke Fluke 110 Digital 9,999


110 600 0.7 600 1 20 A 1 10 A 1.5 40 Mohm
www.fluke.com Multimeter µF

3-3/4 Digit 3,200 Count


Value-Priced DMM D980 1,000 0.5 750 1.2 300 mA 1.2 300 mA 2 30 Mohm N/A
Protek With Bargraph
www.protektest.com
2,000 Count,
410 1,000 0.8 750 1 10 A 1 10 A 2 20 Mohm N/A
Advanced DMM

15 Range Digital 2 Mohm


22-810 500 0.8 500 1.5 200 mA 2 N/A N/A N/A
Multimeter

RadioShack 29 Range Digital 40 Mohm


22-813 600 0.8 600 1.2 10 A 1.5 10 A 2 N/A
www.radioshack.com Multimeter

42 Range Digital
Multimeter With Electric 22-811 600 ±0.8% 600 ±1% 10 A 1 10 A 1.2 4 Mohm 400 µF
Field Detection

5XP Digital Multimeter 5XP 1,000 1 750 1.5 200 mA 1.5 200 mA 2 20 Mohm N/A
Wavetek
www.metermantesttools.com
4,000
35XP Digital Multimeter 35XP 1,000 0.5 750 1.5 2A 2 2A 2.5 40 Mohm
µF

24 SERVO 02.2005
BrainMatrix.qxd 1/4/2005 12:48 PM Page 25

by Pete Miles

Upcoming topics include SBCs and H-bridges, sensors, kits, 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.

St
an
Ba
C

D
da
tt
on

im
A
Tr ata
er

rd

W
tin

ut
Te
D

en
an
yT

ei
A
i

o
ui
od

D
Fr

gh
sio
sis

cc
es

Li
O
ty

pe
e
eq

es

t,

st
to ld
tU

ff

ns
C
C

ra

oz
Po
so
ue

M
rT

Pr
,m
H
he
h

nd

tu

od

rie
ec

w
nc

es

ic
(g
ck

m
re
er

er
k

e
e
y

)
Test Leads, Battery,
15 MHz Yes Yes No No No Yes No 9V 150 x 79 x 33 9 (250) $59.00
Rubber Boot Protection

N/A Yes No Yes No No No No Test Leads, Battery 9V 143 x 68 x 47 7.3 (200) $27.00

Holster,Test Leads,
20 MHz Yes Yes No No No Yes No 9V 151 x 70 x 38 7 (200) $49.95
Fuse, Battery

20 MHz Yes Yes No No Yes Yes 30 min Test Leads, Rubber Holster 9V 90 x 190 x 35 12 (340) $66.50

N/A Yes Yes Yes No No Yes 15 min Test Leads 9V 189 x 85 x 32 9.7 (300) $39.00

10 MHz Yes Yes No No Yes No 30 min Test Leads, Rubber Holster 9V 88 x 178 x 33 11 (315) $79.00

Holster,Test Leads,
50 kHz Yes Yes No No Yes No 20 min 9V 460 x 960 x 160 12 (350) $109.00
Battery

N/A Yes Yes No No Yes No No Test Leads, Holster 2 x AAA 165 x 76 x 38 11 (300) $75.00

Test Leads with


N/A Yes Yes No Yes Yes Yes No Aligator Clips,Type K 9V 178 x 84 x 33 9 (250) $31.00
Thermal Couple

N/A Yes No No No No No 30 min Test Leads, Case 12 V 118 x 80 x 18 3.5 (100) $19.99

N/A Yes Yes Yes No Yes No 30 min Test Leads, Fuse 3 x AAA 150 x 74 x 38 6 (170) $29.99

4 MHz Yes Yes No No Yes No 30 min Test Leads, Fuse 9V 161 x 80 x 39.5 6.8 (195) $49.99

Holster,Test Leads,
N/A Yes Yes Yes No Yes No No Battery, Fuse, 9V 155 x 72 x 32 7.4 (210) $39.95
Magnetic Strap
Holster,Test Leads, Battery,
40 MHz Yes Yes No Yes Yes No 10 min Fuse, Magnetic Strap,Type K 9V 155 x 72 x 32 14 (400) $79.95
Thermal Couple

SERVO 02.2005 25
Best.qxd 1/5/2005 2:45 PM Page 26

Step Up to the Motorvator. Step Up to the Motorvator. Step Up to the Moto


Best.qxd 1/5/2005 2:47 PM Page 27

p to the Motorvator. Step Up to the Motorvator. Step Up to the Motorvator.

STEP
Up to the
Motorvator by Peter Best

riving a stepper motor with a microcontroller is pretty much old


D hat these days, as there are a multitude of Internet entries that
tell you exactly how to make that happen. That’s great if just wildly
turning the shaft of the stepper motor is all you want to do. If you plan
to use the stepper motor in an application that requires precision con-
trol of the angular motion generated by the stepper motor, you’ll have
to add a bit more code to those basic sequence-oriented motor driver
routines that you downloaded from the net. In addition to writing some
pretty hairy stepper motor driver code, you’ll have to put on your high-
voltage-high-current-analog-digital hardware designer’s hat, as well.

For precision applications, just driving a MOSFET or transistor switch circuit for each
stepper motor winding with basic stepper motor sequence code won’t cut it. You’ll need
some extra external hardware to make sure the stepper motor goes where you want it to go
and stops where you want it to stop. Also, you’ve got to do this without burning up the
motor windings or smoking your motor drive electronics. The burden of designing an X-Y
stepper motor driver system is doubled as your application is running both X and Y axes,
which requires two motors, two motor drivers, plus the common driver firmware, and the
microcontroller or pair of microcontrollers to oversee it all.
If precision positioning in two dimensions is your goal, chances are you’ll need a
minimum of two stepper motors, which dictate the use of the equivalent of a pair of stepper
motor drivers. For those of you out there who have visions of home-brew precision X-Y
tables, getting past the electronic hardware design can be just as tough as writing the
firmware for your mechanical X-Y table design. I can’t help each of you with the unique
mechanics of your particular X-Y table design, but I can “step” you through the design and
realization of a dual microstepping stepper motor driver based on a pair of Allegro
Semiconductor’s A3977SED Microstepping DMOS Driver/Translators.

SERVO 02.2005 27
Best.qxd 1/3/2005 2:36 PM Page 28

Step Up to the Motorvator. Step Up to the Motorvator. Step Up to the Moto

The A3977SED the range of +3.0 VDC to +5.5 VDC and draw very little
current. That makes the A3977SED compatible with most
Although the bulk of the on-chip A3977SED analog and any microcontroller you want to include in your stepper
digital subsystems are important support structures for motor driver design.
driving the A3977SED’s pair of internal low rDS(on) DMOS Being able to easily drive your stepper motor in full step
H-bridges, the A3977SED translator subsystem puts the mode has advantages in certain situations. However, the ability
A3977SED in a stepper motor driver IC class of its own. The to microstep your stepper motor is an absolute necessity if
A3977SED translator subsystem eliminates the need for you want to move an axis of your X-Y table with extreme
additional microcontroller firmware and I/O lines that must precision. So, in addition to being capable of driving a
be incorporated to realize complete control of motor step stepper motor in its native full step mode, the A3977SED
and direction when using other stepper motor driver ICs. translator provides a pair of microstepping inputs (MS1 and
Without a translator, the stepper motor driver designer MS2) that — when stimulated with a predetermined pattern
must incorporate DACs (Digital to Analog Converters), of logical input voltages — force the bipolar stepper motor
comparators, and various low-pass filters to regulate and being driven to operate in full-, half-, quarter-, or eighth-step
control PWM (Pulse Width Modulation) current flow to the modes. The microstepping truth table for the MS1 and MS2
stepper motor being driven. Incorporating the A3977SED translator inputs is shown here:
into your stepper motor design virtually eliminates the need
for the external components and circuitry I just mentioned. A MS1 MS2 Resolution
simple low-to-high logical transition applied to the L L Full Step
A3977SED’s translator STEP input pin results in a single step H L Half Step
or microstep of the bipolar stepper motor under tow behind L H Quarter Step
the pair of A3977SED DMOS H-bridges. H H Eighth Step
Changing the stepper motor’s rotational direction using
an A3977SED is just as easy. Clockwise or counterclockwise The A3977SED translator is also capable of shutting
motor rotation is achieved by presenting a logical high or down the DMOS H-bridge outputs and setting itself to a
logical low to the A3977SED’s translator DIR input pin. The known state, which is referred to as the home state in the
A3977SED logic subsystems can be powered by voltages in Allegro documentation. This is done by applying a logical low
to the translator’s RESET pin.
FIGURE 1. This is a simplified block diagram of the A3977SED internals. While in the RESET mode
It looks busy until you understand what everything really does. (RESET pin held low), the trans-
lator’s HOME output signal
CP2

CP1

LOAD SUPPLY
goes low and all STEP inputs are
VREG

2V
ignored. The A3977SED HOME
REGULATOR VCP signal is not really a physical
VDD
UVLO AND FAULT CHARGE PUMP
BANDGAP “position,” but is a unique state
VBB1
in which the stepper motor coil
REF
DAC
SENSE1
positive phase currents are
DMOS H BRIDGE balanced evenly. HOME is also
+

the logical starting point for the


VCP

RC1
STEPPER MOTOR
translator. Changes to step
4
PWM TIMER OUT1A mode can be made while in the
STEP
OUT1B
HOME state, as doing so will
TRANSLATOR

DIR

RESET not disrupt the integrity of the


CONTROL LOGIC

MS1
driving current waveform.
GATE DRIVE

MS2

HOME SENSE1
The rest of the A3977SED’s
VBB2 tweakable knobs are linked
SLEEP

SR
directly to its internal control
ENABLE logic subsystem. An active low
PFD
ENABLE input enables all of the
OUT2A

PWM TIMER OUT2B


DMOS H-bridge outputs. Since
RC2
the ENABLE input is under con-
4 trol of the A3977SED’s control
logic subsystem, all of the trans-
DMOS H BRIDGE
lator motion control inputs
+

SENSE2
DAC
(STEP, DIRECTION, MS1, and
MS2) are active, even when the
ENABLE pin is presented with a
28 SERVO 02.2005
Best.qxd 1/3/2005 2:38 PM Page 29

p to the Motorvator. Step Up to the Motorvator. Step Up to the Motorvator.


logical high, which disables the DMOS H-bridge outputs.
By allowing the disabled state to coexist with an active
translator state, you can step the stepper motor to a particular
point in the physical X-Y axis movement program and then
reenable the DMOS outputs at that point. In addition to the
ENABLE input, the control logic subsystem is responsible for
initiating SLEEP and WAKEUP states for the A3977SED’s inter-
nal logic. An active low SLEEP input to the on-chip control logic
subsystem gives the stepper motor driver designer full control
of the SLEEP and WAKEUP features of the A3977SED.
Probably the most important job the control logic
subsystem has is the management of the sequencing of the
individual DMOS devices. This sequence management
process is called synchronous rectification and is enabled by
presenting a logical low to the control subsystem’s SR input
pin. In most cases (including the design we will be discussing PHOTO 1. The Motorvator PCB includes pads for external
in this article), synchronous rectification eliminates the need current steering diodes and a fully pinned out PIC18F8520
for external current steering diodes. for those that want to walk on the wild side.
There are many other A3977SED internals we need to
talk about and the best way to describe them is to examine than its fixed-voltage cousins. The A3977SED is designed to
them as we assemble some A3977SED-based stepper motor drive a stepper motor from incoming motor voltages as high
driver hardware that I call the Motorvator. as +35 VDC at motor currents up to ±2.5 Amperes. With
input motor voltages ranging from +8 VDC to +35 VDC, a
Designing and Building the pair of filter and bypass capacitors along with a couple of 1%
Motorvator tolerance resistors are all that you need to set the output of
the LM317 at a rock-solid +5 VDC.
The Motorvator is centered around a PIC18F8520 that The LM317 is capable of delivering up to 1 A of current
holds court over a pair of Allegro Semiconductor A3977SED to a load, when properly heatsinked. The Motorvator’s
stepper motor driver ICs. The PIC18F8520 is a member of LM317 is mounted on a heatsink pad on the Motorvator PCB
Microchip’s 80-pin high-performance microcontroller family. (printed circuit board). The PIC18F8520, the pair of
Running at 40 MHz and packing
32K of program Flash, the FIGURE 2. The idea here is to convey that the step angle of the phase currents has
PIC18F8520 has more than absolutely nothing to do with the step angle of the stepper motor shaft.
enough I/O, data memory, analog-
RADIUS = 1
to-digital converter inputs, and
timers to control and even pick sin(0°)=0.0
up after the pair of A3977SED cos(0°)=1.0 0.0°
0.0°

stepper motor drivers. sin(45°)=0.7071067811


45.0°
Home State = 45°
As most of the motor cos(45°)=0.7071067811 45.0°
driving work will be done by the
sin(90°)=1.0 90.0°
A3977SED ICs, the PIC18F8520 cos(90°)=0.0
will be primarily concerned 90.0°

with providing logic levels to PHASE 1


CURRENT
the A3977SED subsystems and (cos)
acting as an interface between
external controls (switches,
potentiometers, etc.), the step-
per motor driver ICs, and the
stepper motors.
Power for the A3977SED
PHASE 2
logic and the PIC18F8520 is pro- CURRENT
vided by an LM317 adjustable (sin)

voltage regulator, which receives


its raw input voltage from the
motor power supply. The LM317
was chosen because of its ability
to handle higher input voltages
SERVO 02.2005 29
Best.qxd 1/3/2005 2:40 PM Page 30

Step Up to the Motorvator. Step Up to the Motorvator. Step Up to the Moto


sheet (www.allegromicro.com)
SLOW-DECAY MODE FAST-DECAY MODE
and using it to supplement the
BVB BVB
A3977SED information that I will
provide for you in this discussion.
A B A B
A = OFF B = OFF A = OFF B = OFF Within the A3977SED data sheet,
you will find some familiar concepts
that we’ve already discussed, such as
C D C D
the translator and the control logic
C = OFF D = ON C = OFF D = OFF subsystems. With that, follow along
using the A3977SED functional
SENSE SENSE
block diagram in Figure 1 as I
continue to describe the remaining
Toff Toff Toff design points we’ll need to cover to
bring the Motorvator to life.
Tfd
At power-up or with the initiation
Itrip Itrip Itrip
of a reset via the RESET pin, the trans-
lator uses its pair of four-bit DAC con-
trol lines to force the output of the
pair of DACs into the home state.
Motor phase current polarities for
SLOW DECAY MIXED DECAY FAST DECAY
each motor phase are also set to their
home state conditions and the current
regulators for both of the motor
FIGURE 3. You can clearly see here that the slow-decay mode ripple is very low
when compared to the fast-decay mode current ripple. The A3977SED uses phases are set to mixed-decay mode.
the best of both decay worlds to produce a sinusoidal current drive to the The idea here is to step the
stepper motor attached to its pair of H-bridges. motor as smoothly as possible. This
smooth stepping action is achieved
A3977SEDs, and all of the Motorvator’s LEDs and voltage when the motor is driven with a sinusoidal current waveform.
dividers don’t even come close to taxing the LM317’s current Within the A3977SED, this sinusoidal waveform is quadrature
output capacity. During testing of the Motorvator, I found in nature, meaning that the phase current waveforms are 90°
that — at low input voltages (+12 VDC to +18 VDC) — out of phase. I’ve put together a graphic in Figure 2 that
the LM317 never got much more than warm to the touch. The gives you a feel as to how the motor phase currents relate to
same goes for the A3977SEDs, which are heatsinked by the each other and the A3977SED HOME state.
massive amount of ground plane area on the Motorvator PCB. If you visualize the phase current waveforms as sine and
The A3977SEDs are attached to the PCB heatsink/ground- cosine functions and relate that to what the A3977SED
plane by 12 internally grounded heatsink pins. calls the HOME state, the math in Figure 2 says it all. HOME
A look at my Motorvator in Photo 1 reveals the state is defined as a point in the sinusoidal phase current
PIC18F8520, the 40 MHz oscillator, the LM317 logic power waveforms where both motor phase current levels are
supply, and the 10-pin Microchip ICSP programming/debug- 70.71% of the maximum phase current value. Check our
ging socket sandwiched between an identical pair of math against the A3977SED data sheet and you’ll find that
A3977SED stepper motor drivers designated logically as Driver HOME state is located at the 45° position of each of the
A and Driver B. The four six-pin right-angle header assemblies phase current waveforms. Don’t confuse the 45° position
closest to the quartet of 10-turn trimmer pots form a micro- with an angle on the motor shaft. This position is an angular
controller input portal for all of the external control inputs. position in the phase current waveforms. For instance, if we
External control inputs can be just about anything the move 45° positively away from HOME position, the PHASE1
user deems necessary to gain control of the movement of the CURRENT level is at 0 while the PHASE2 CURRENT level is at
stepper motors via the PIC18F8520. Motor and logic input 100% of the maximum phase current.
power is obtained from the center pins of either of the single Since the HOME position is the translator’s beginning
six-pin right-angle stepper motor interface headers that point in a step sequence and 360° constitutes a full cycle, it
surround the LM317 voltage regulator. A single ULN2003 would be safe to say that we’ll end up at the 45°, or HOME
Darlington array is used instead of discrete transistor position, at the end of one full cycle.
switches to drive the Driver A and Driver B, HOME LEDs, and In full step mode, a two-phase stepper motor requires
an auxiliary SPDT +5 VDC coil relay. four steps to complete one full phase cycle. That’s 90° per
I’ve supplied a full schematic depiction of the step. If the stepper motor is running in half-step mode, the
Motorvator. However, to help make things a bit clearer as number of steps required to move from HOME position to
I describe the details of the Motorvator hardware the next HOME position is eight steps. Get the idea? A
and firmware, I suggest downloading the A3977SED data stepper motor running in eight-step mode needs 32 steps to
30 SERVO 02.2005
Best.qxd 1/3/2005 2:40 PM Page 31

p to the Motorvator. Step Up to the Motorvator. Step Up to the Motorvator.


traverse the 360° between adjacent HOME positions in the out its body diode through the SENSE resistor to ground.
phase current waveform. The current can also flow in the same manner — but in the
The A3977SED automatically employs mixed-decay opposite direction — by energizing DMOS devices B and C.
mode, which results in a motor current waveform that closely The A3977SED H-bridges are driven by a fixed-off-time
approximates the ideal sinusoidal current waveform we need PWM current control circuit. The load current limit (ITRIP) is
to smoothly power our stepper motor. Mixed-decay mode is also controlled by the PWM current control circuit. Another
the product of slow-decay mode and fast-decay mode. Decay look at Figure 1 shows us that the A3977SED DAC output
is defined as the time it takes to get the recirculating current voltages and the voltages across the H-bridge current-sense
out of a motor winding. The weird noises you hear coming resistors are fed into current-sense comparators that report
from stepper motors are caused by distortions in the sinu- to the A3977SED’s PWM generators. When the voltage
soidal current waveform. The distortion is caused by the across the sense resistor equals the voltage that is being
improper selection of a decay mode during a particular angular generated by the DAC, the PWM latch within the PWM Timer
time within the sinusoidal current flow. Let’s take a look at subsystem is reset.
what decay is and how it is handled by the A3977SED. At this point, the H-bridge enters one of the decay
Figure 3 depicts typical H-bridge configurations with VBB modes. The motor current will recirculate and decrease until
representing the incoming motor power. To apply current the fixed-off time expires. The act of automatically routing
across the motor winding, the DMOS devices are activated the recirculating motor winding current using the DMOS
diagonally. For instance, by turning on the A and D DMOS device’s body diodes and one of the decay modes is synchro-
devices, current can flow from the VBB source through the A nous rectification. When the A3977SED’s translator SR input
DMOS device, which has shorted out its body diode, through pin is presented with a logical low, synchronous rectification
the coil and across DMOS device D, which has also shorted is automatically performed by the logic within the A3977SED.

SCHEMATIC 1. The PIC18F8520 has much more I/O, program memory, and data memory than a basic Motorvator needs.
The good news is that there are plenty of microcontroller resources left for you to do with as you please.

+5VDC
+5VDC J5
C19 C14
1 .1uF
MCLR 2
R10
3 1 8
4 NC VDD .1uF
10K
PGD 5 40MHz
6 4 5
C20 PGC 7 GND CLKOUT
D9 8
.1uF
CURLIMBA

1N5819 9
ENABLEA
CURLIMB

RESETA

10
SLEEPA
HOMEA
RELAY

STEPA
AUXO

MS1A
MS2A

ICSP
DIRA

SRA

U2
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61

+5VDC
1 60
R10 - R21
STOP STOP
RE2
RE3
RE4
RE5
RE6
RE7
VDD
RH1
RH0

RD0

RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
VSS

START 2 RH2 RJ2 59 START


CONST 3 RH3 RJ3 58 CONST
REV1 4 RE1 RB0 57 REV1
5 RE0 RB1 56 UND1
+5VDC 6 RG0 RB2 55 AUTO
7 RG1 RB3 54 UND3
8 RG2 RB4 53 UND2
9 RG3 RB5 52 UND5
10 MCLR PIC18F8520 RB6 51 UND4
11 RG4 VSS 50 LS1
12 VSS OSC2 49 +5VDC LS2
UND1 13 VDD OSC1 48
RF7 VDD
C16
.1uF
AUTO 14 RF6 RB7 47
C15
10K PULLUP RESISTORS
UND3 15 RF5 RC5 46 ENABLEB
UND2 16 45 DIRB .1uF
UND5 17 RF4 RC4 44
RF3 RC3 HOMEB
+5VDC UND4 18 43 MS1B
AVDD
AVSS

LS2 19 RF2 RC2 42


VDD
RH5
RH4

VSS

RC1
RC0
RC6
RC7
RA3
RA2
RA1
RA0

RA5
RA4
RF1
RF0

RJ4
RJ5

LS1 20 RH7 RJ7 41


RH6 RJ6
ROTARY MOTION SPEED
21
22
23
24
25
26
27
28
29
30
31
32
33
34
RESETB 35
STEPB 36
37
SLEEPB 38
39
40

+5VDC
+5VDC
VBB VR1 +5VDC
MS2B
SRB

C18 LM317
.1uF 1 3
VIN VOUT
+ C21 R13
ADJ

R11 10uF 470


.1uFC17 C22 240
LINEAR MOTION SPEED .1uF
2

COMMON PWR LED


U3
HOMEB 1 IN1 OUT1 16 HOMEB_LED K1
2 IN2 OUT2 16 4 NC R12
3 14 +5VDC 5 715
IN3 OUT3 6
4 IN4 OUT4 13 NO
AUXO 5 IN5 OUT5 12 AUXO_PIN 1
RELAY 6 IN6 OUT6 11 3
HOMEA 7 IN7 OUT7 10 HOMEA_LED
8 GND CLMP 9 RELAY SPDT

SERVO 02.2005 31
Best.qxd 1/3/2005 2:44 PM Page 32

Step Up to the Motorvator. Step Up to the Motorvator. Step Up to the Moto


Slow-decay mode is entered when the source drivers (A the following transconductance function:
and B) are turned off and the sink driver D is turned on. The
current in the motor coil is dissipated slowly by being forced ITRIP max = VREF / (8Rs)
to recirculate through the resistances offered by the coil itself
and the body diode of DMOS device C. If you’re wondering Substituting a value of 2.5 A for ITRIP maximum and a
if DMOS device C can be energized and conducting in this value of 0.2 ohm for Rs yields a maximum value of 4.0 volts
mode, the answer is yes, but it’s not necessary, as the DMOS for VREF. If you’re wondering where the eight multiplier for
device C body diode allows the current to circulate through the sense resistor value comes in, take a look at Figure 1. The
the motor winding. Since back EMF from the motor winding voltage applied to the A3977SED REF pin is divided by 8
can override the operation of slow-decay mode on the falling before being handed to the DACs.
slope of the current sine wave and cause distortion of Take another look at the Figure 2 graphic. The phase
the current waveform (which causes the motor to chatter), current sine waves appear to be smooth. In reality, there are
slow-decay mode is employed on the rising quadrants of the very tiny steps all along the phase current sine waves that
sinusoidal current waveform. represent a function of the DAC output voltages versus a
Turning off all of the DMOS devices puts the H-bridge percentage of the ITRIP max value. The ITRIP current at each
into fast-decay mode. Fast-decay mode allows for the rapid step along the way of the phase current sine waves can be
dissipation of the latent motor winding current. As you can calculated with the following formula:
see in Figure 3, the body diodes of diagonal pairs of DMOS
devices form the escape path for the recirculating motor ITRIP = (%ITRIP max/100) x ITRIP max
current. Fast-decay mode produces much more current ripple
than slow-decay mode and, thus, heats the motor a bit more A table of ITRIP max percentages versus their appear-
than slow-decay mode does. ance in the phase current sine wave is provided in the
The ideal situation would be to have the power to mix A3977SED data sheet.
the slow-decay and fast-decay modes to fine-tune our Let’s get back to exercising our little bit of control over the
sinusoidal current waveform that is driving our stepper decay mode process. Another quick look at Figure 3 shows us
motor. This condition would produce a tradeoff between the that the fixed-off time of the PWM current control circuitry is
high and low ripple currents and provide enough recovery defined as TOFF. The PWM fixed-off time is determined by an
speed to help drive the stepper motor with a pretty accurate external RC circuit tied to a one-shot within the PWM current
sinusoidal current waveform. The good news is that we do control circuitry. A minimum fixed-off time of 30 µS is specified
have the power and the resultant mode is called mixed-decay by the A3977SED data sheet. To meet that minimum fixed-off
mode. As you have already surmised, mixed-decay mode is an time, I mounted a pair of RC circuits to the A3977SED’s RC1
optimal mixture of slow-decay mode and fast-decay mode and RC2 pins. I determined the values of the components you
and — eventhough mixed-decay mode is automatic with the see in the Motorvator schematic with the following formula:
A3977SED — we have some control over how it operates.
Let’s begin by determining the value of the H-bridge sense TOFF = R2C2 for RC1 and TOFF = R4C4 for RC2
resistors, which directly affects the maximum ITRIP current
value. Since the A3977SED can handle a maximum of ±2.5A, Do you recall my mention of additional low pass filtering
let’s set up our H-bridge current sense resistors to meet the that would be needed if we were not going to implement the
maximum current value that the A3977SED can process. The A3977SED? The A3977SED gets around having to include a
value of the sense resistors is computed as follows: filter between the sense resistor and the current sense
comparator by blanking the output of the current sense
Rs = 0.5/ ITRIP max comparator when the current control circuitry switches the
outputs. The blanking function is dependent upon the value
Where: Rs = sense resistor value of the capacitor in the fixed-off time RC circuitry and is
ITRIP max = 2.5A approximated as follows:

Rs = 0.2Ω TBLANK = 1900 x (C2 or C4)

The only “gotcha” to watch out for is to make sure you TFD in Figure 3 represents the fast-decay time of the
select a sense resistor that has very low inductance. I’ve spec- mixed-decay mode. As you can see in the mixed-decay graphic
ified a suitable resistor for the Motorvator in the Parts List. portion of Figure 3, TFD is the time within the PWM current
Now that we’ve chosen a sense resistor value, we can control fixed-off time that the fast-decay mode will be invoked.
use a voltage divider consisting of a standard 10-turn 10K Fast-decay mode begins when the ITRIP threshold is reached
ohm pot to provide a voltage to the A3977SED REF pin that and remains in effect until the voltage on the RCx pin decays
will dial in our desired amount of current limiting that can be to the voltage presented at the PFD pin. Once the fast-decay
less than, but not greater than, our ITRIP max value of 2.5A. time is depleted, the decay mode switches to slow-decay mode
The desired current limit reference voltage is calculated using for the remainder of the PWM current control fixed-off time.
32 SERVO 02.2005
Best.qxd 1/3/2005 2:47 PM Page 33

p to the Motorvator. Step Up to the Motorvator. Step Up to the Motorvator.


TFD is a function of the PWM current control fixed-off and their resultant component values. The remainder of
time and a voltage applied to the A3977SED’s PFD input pin, the A3977SED’s supporting components are specified in
which feeds both of the PWM timers. The setting of the PFD the A3977SED data sheet and are reflected in the
voltage depends on how you want to run your stepper Motorvator schematic. So, let’s write some HI-TECH PICC-18
motors. So, to provide an easy means of adjusting the TFD C code to put all of that stepper motor driver theory
timing threshold, I’ve placed another 10-turn 10K ohm pot and hardware to work.
across the PFD pin. The following formula, actual voltage,
and component values I used on my version of the The Motorvator Firmware
Motorvator will give you an idea of what my Motorvator TFD
value looks like: Writing the Motorvator firmware was loads of fun. I’ve
written some code to demonstrate some of the concepts we
TFD = R2C2(ln(0.6Vcc/VPFD) discussed in the early stages of this article. I’m not going to
post all of the code I wrote here, but will instead provide it
Where: R2 = 30K Ω to you as a download from the SERVO website (www.servo
C2 = .001 µF magazine.com). However, I will give you a jist of what I did
Vcc = 5.0 VDC and show you how to use the HOME position output signal
VPFD = 2.5 VDC to back-up what I told you about how the translator uses the
HOME state.
TFD = 5.47 µS The very first thing I did was to assign a meaningful C
name to each of the A3977SED interface pins. I then related
That does it for things that we can control using formulas the names of the A3977SED pins to the pins that they

SCHEMATIC 2. This is a schematic of the A-side motor driver. All of the components that support the A3977SED
in this depiction match those found in the B-side motor driver schematic.
MG1
BIPOLAR STEPPER MOTOR
+5VDC OUT1A 1
OUT1B 2

DRIVER A
LED1

OUT2A 3

OUT2B 4
U3 HOME A
1 16
2 IN1 OUT1 16 +5VDC VBB
3 IN2 OUT2 14
4 IN3 OUT3 13 C6 10uF C12 100uF
IN4 OUT4 R9
5 12 332
6 IN5 OUT5 11
+

7 IN6 OUT6 10 C9
IN7 OUT7
8
GND CLMP
9 C5 C13 D1-D8 NOT MOUNTED WHEN SR IS ACTIVE
C23 .1uF .1uF .22uF C11 .22uF
.1uF VBB

U1
16

43
VBB1 25

36

37

38

D2 D4 D1 D3
C10 .22uF
VBB2

VCP

CP1

CP2
VDD

4 32
RD1 5 HOME VREG
RD0 26 DIR
RD6 27 SR 6
RD7 31 RESET OUT1A 18
+5VDC RD4 41 STEP OUT2A 40
RE7 42 *ENABLE A3977SED OUT1B 28
PFD RD2 20 *SLEEP OUT2B
R1 10K RD3 19 MS1 3
RD5 9 MS2 SENSE1 21 D6 D8 D5 D7
C1 10 PFD SENSE2
C2 14 RC1
2 GND
44 GND
GND

12 GND
13 GND
GND

23 GND
24 GND
GND

34 GND
35 GND
GND

.1uF R2 15 REF
.001uF 30K C4 RC2 C8 R8 C7 R7
R4
11

22

33

.001uF 30K .1uF .02 .1uF .02


1

+5VDC

R5
20K

RH1
REF
R3 10K

C3
.1uF

SERVO 02.2005 33
Best.qxd 1/3/2005 2:48 PM Page 34

Step Up to the Motorvator. Step Up to the Motorvator. Step Up to the Moto


attached to on the PIC18F8520. For instance, Driver A’s In a similar manner, the RESET function of the A3977SED
RESET pin is designated as pRESETA and defined as LATD7, can be simplified with the following code:
while Driver B’s RESET pin is identified as pRESETB attached
to LATC1 on the PIC18F8520. Any C reference that begins #define RESET_A pRESETA = 0; \
Delay_ms(50); \
with a “p” denotes that the reference is actually a physical pRESETA = 1;
pin on either the PIC18F8520 or the A3977SED. To keep
things from getting too confusing, I used the actual #define RESET_B pRESETB = 0; \
A3977SED data sheet pin names in my descriptions where I Delay_ms(50); \
could. pRESETB = 1;
Once all of the pin assignments were defined, I went
about putting together simple macros that used the pin I needed a delay source for both the RESET and STEP
definitions to form functional blocks of code. For example, functions. So, I implemented a millisecond timer using
pRELAY is attached to LATE6 of the PIC18F8520. A logic high the PIC18F8520’s TIMER0. At 40 MHz, each instruction
applied to pin 6 of the ULN2003 drives pin 11 of the cycle accounts for 100 nS of time. That means that every
ULN2003 low and provides a ground path for the relay microsecond of delay time I need requires me to expend 10
coil. The following code definitions can be used in your instruction cycles. One millisecond is 1,000 microseconds.
application code to control the relay: So, I need to expend 10,000 instruction cycles for every
millisecond of delay I need in my routines. By dividing or
#define RELAY_ON pRELAY=1; prescaling the timer clock cycles by 16, my multiplier for
#define RELAY_OFF pRELAY=0; 1 millisecond of delay time is 625.

SCHEMATIC 3. Here’s a schematic depiction of the B-side motor driver. Note the differences in the PIC pins
that drive the A3977SED and the U3 drive for the HOME B LED. Every other component is identical
to the ones used by the A-side motor driver.

+5VDC MG1
BIPOLAR STEPPER MOTOR
OUT1A 1

DRIVER B OUT1B 2
LED1
U3 HOME B
1 16 OUT2A 3

OUT2B 4
2 IN1 OUT1 16 +5VDC VBB
3 IN2 OUT2 14
4 IN3 OUT3 13 R9 C6 10uF C12 100uF
5 IN4 OUT4 12 332
6 IN5 OUT5 11
+

7 IN6 OUT6 10 C9
IN7 OUT7
8 GND CLMP 9 C5 C13 D1-D8 NOT MOUNTED WHEN SR IS ACTIVE
C23 .1uF .1uF .22uF C11 .22uF
.1uF VBB
U1
16

43
VBB1 25

36
37

38

D2 D4 D1 D3
C10 .22uF
VBB2

VCP
CP1

CP2
VDD

4
RC3 5 HOME VREG 32
RC4 26 DIR
RF0 27 SR 6
RC1 31 RESET OUT1A 18
+5VDC RC0 41 STEP OUT2A 40
RC5 42 *ENABLE A3977SED OUT1B 28
PFD RC7 20 *SLEEP OUT2B
R1 10K RC2 19 MS1
RC6 9 MS2 SENSE1 3 D6 D8 D5 D7
C1 10 PFD SENSE2 21
C2 14 RC1
2 GND
44 GND
GND

12 GND
13 GND
GND

23 GND
24 GND
GND

34 GND
35 GND
GND

.1uF R2 15 REF
.001uF 30K C4 RC2 C8 R8 C7 R7
R4
11

22

33

.001uF 30K .1uF .02 .1uF .02


1

+5VDC

R5
20K

RH0
REF
R3 10K
C3
.1uF

34 SERVO 02.2005
Best.qxd 1/4/2005 4:52 PM Page 35

p to the Motorvator. Step Up to the Motorvator. Step Up to the Motorvator.


The PIC18F8520 timers count positively and overflow to HOME state.
zero. My delay routine simply puts enough counts into
unsigned int stepcount;
the timer to allow it to count up the desired number of void main(void)
milliseconds and overflow. I watch for the overflow using {
the TIMR0IF (TIMER0 Interrupt Flag) bit, which signals the unsigned int j; //used for a breakpoint position
end of my selected millisecond timing period. Here’s what
the delay code looks like: T0CON = 0b10000011; //start Timer0 with a 1:16
//prescaler
INIT_3977(); //init the A3977
void Delay_ms(unsigned int mticks) EIGHT_B; //enable eighth-step mode
{ ENABLE_B; //enable the Driver B H-bridge
//use with prescaler set for 1:16 DIRB_CW; //turn the motor clockwise
WRITETIMER0(0xFFFF -(mticks * 625)); stepcount=0; //zero the step counter
TMR0IF = 0; do
while(!TMR0IF); {
} STEP_Bms(1); //step every 1 millisecond
++stepcount; //increment the step count
}while(pHOMEB); //look for the HOME signal to go
I then integrated the delay timer function into a STEP //low
function. The basic STEP macro looks like this: ++j; //stop here with a breakpoint
}
#define STEP_Ams(x) pSTEPA = 1; \
Delay_ms(x); \
pSTEPA = 0; \
When the motor stops and the breakpoint is reached,
Delay_ms(x); you’ll find that the variable stepcount contains the value
of 32. Replacing EIGHT_B with FULL_B will result in a final
#define STEP_Bms(x) pSTEPB = 1; \ stepcount value of 4.
Delay_ms(x); \ My VEXTA stepper motor steps in 1.8° increments.
pSTEPB = 0; \
Delay_ms(x); Thus, it would take 1,600 steps to complete one shaft
revolution using the eight-step mode. Here’s what should
happen when you compile and run the code below. The
As I alluded to earlier, a low-to-high transition on the Driver B HOME indicator LED will be dark following the
STEP input pin produces a single step or microstep. The initialization routine indicating that the A3977SED
speed of the motor is determined by the length of the delay. translator has put the driver into HOME state. Once the
The A3977SED’s maximum step rate is commanded with an steps start, the HOME indicator LED will blink off as it
interstep delay of 2 microseconds. passes through every successive HOME state (every 32
Here’s a bit of code that counts the number of steps steps). When the 1,600 steps have been taken, the stepper
between successive HOME states. Recall that a stepper motor shaft will have traversed one revolution and the
motor stepping in eighth-step mode will take 32 HOME indicator LED will again go dark indicating that it has
steps between a starting HOME state and the following returned to a HOME state.

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 #63 on the Reader Service Card.
SERVO 02.2005 35
Best.qxd 1/4/2005 4:54 PM Page 36

Step Up to the Motorvator. Step Up to the Motorvator. Step Up


void main(void) DIRB_CW; //turn the motor clockwise
{ while(1){ //do forever
unsigned int i,j; //use j for a breakpoint posi- for(i=0;i<1600;++i) //step 1 full shaft revolution
//tion {
STEP_Bms(1); //step every 1 millisecond
T0CON = 0b10000011; //start Timer0 with a 1:16 }
prescaler if(pDIRB) //check the direction bit and
INIT_3977(); //init the A3977 pDIRB = CW; //reverse the direction
EIGHT_B; //enable eighth-step mode else
ENABLE_B; //enable the Driver B H-Bridge pDIRB = CCW;
DIRB_CW; //turn the motor clockwise }
for(i=0;i<1600;++i) //step 1 full shaft revolution }
{
STEP_Bms(1); //step every 1 millisecond
} Stepping Out
++j; //stop here with a breakpoint
} Before I go and leave you to build your own Motorvator,
I’ve got one more trick I want to show you. Recall that we can
A slight variation on the full shaft rotation code uses the use the voltage at the A3977SED REF input to limit the maxi-
resultant state of the pDIRB translator pin to reverse the mum current we deliver to a stepper motor. With the addition
direction of the stepper motor after one full shaft rotation. of a single resistor and one PIC18F8520 I/O pin, we can dump
a dormant motor into low-current hold and instantly return to
void main(void)
{ our original maximum current value when stepping resumes.
unsigned int i; //use i as a loop counter I placed a 30K resistor in series with the REF pot and
attached a PIC18F8520 I/O line at that junction. When the
T0CON = 0b10000011; //start Timer0 with a 1:16 PIC18F8520 I/O line is an output and is at a logical high,
prescaler
INIT_3977(); //init the A3977 +5 VDC is supplied as usual to the REF pot and the REF pot
EIGHT_B; //enable eighth-step mode voltage divider controls the voltage presented at the
ENABLE_B; //enable the Driver B H-bridge A3977SED REF pin. Transitioning the PIC18F8520 I/O line to
an input state allows the 30K resistor to become part of the
REF voltage divider. This results in a lower voltage presented
to the A3977SED REF pin, which results in a lowered ITRIP
max value. I’ll leave you with the current limit macros:
2005
March 6–10, 2005 #define CURLIMA_OFF TRISH1 = 0; \
pCURLIMA = 1;
Austin Hilton Austin, TX
THE PREMIER #define CURLIMB_OFF TRISH0 = 0;
pCURLIMB = 1;
\

#define CURLIMA_ON TRISH1 = 1;


GLOBAL EVENT #define CURLIMB_ON TRISH0 = 1;

IN POWER For those of you who want to experiment with your own
Motorvator, the PCB and all of the associated parts are available
ELECTRONICS from EDTP Electronics, Inc., at www.edtp.com As always, if
Visit the conference you have any questions or comments, I’m always available to
web site below for you via Email peterbest@cfl.rr.com. See you next time ... SV
continual updates
www.apec-conf.org SOURCES
A3977SED, ULN2003, Allegro Microsystems
www.apec-conf.org
The MicroMouse Contest www.allegromicro.com

Monday, March 6 starting Motorvator printed circuit board, EDTP Electronics, Inc.
at approximately 8:00 PM www.edtp.com

SPONSORED BY HI-TECH PICC-18 Compiler, HI-TECH


www.htsoft.com

PIC18F8520, Microchip
www.microchip.com

36 SERVO 02.2005
Simpson.qxd 1/3/2005 1:02 PM Page 37

by Michael Simpson

I
was working on a book project and needed to create several
walker robot prototypes with several small, curved parts of var-
ious shapes and sizes. I have a large band saw, but it was just too
difficult to cut the small curves and details needed and there was
no way to make the inside cuts required for many of the pieces.
Several years ago, I had a small 15” scroll saw and tried to cut
acrylic, but just could not achieve a smooth cut. The plastic
would melt and fuse back together behind the blade.
Recently, at a local tool show, I managed to talk some of the
scroll saw exhibitors into letting me cut some scrap plastic I had
with me. After a few tips, I was cutting expanded PVC and
acrylic like a pro.

SERVO 02.2005 37
Simpson.qxd 1/3/2005 1:08 PM Page 38

let’s take a look at each saw


and see how all of them
performed the task.

Ryobi SC164VS
This was the least
expensive saw I tested.
While it worked okay and I
was able to build the three
walker bots, I found myself
constantly at odds with this
saw.
The removable key lock
The Ryobi SC164VS. The Dremel 1800. is a nice feature if you have
small children running
I decided it was time to look into purchasing a scroll saw around the shop. The saw is also the lightest and the easiest
and visited a few local retail stores in my area. After a bit of to transport. Unfortunately, these are the only nice things I
research, I found that the following three saws represented a have to say about this saw.
good mix of what was available for $400.00 or less: The blade tension is adjusted at the rear of the saw. I
found this irritating, as I had to reach around the saw to
• Ryobi SC164VS 16” scroll saw tension the blade. I don’t like saws where the power and
• Dremel 1800 18” scroll saw speed controls are located under the table. This makes them
• Dewalt DW788 20” scroll saw difficult to reach in an emergency shutdown.
There are three problems that stand out with this
I decided to purchase all three and give each a whirl. I particular saw:
also picked up several blade types so I could see which ones
would work best for this project. Scroll saw blades come 12 1. There is very little room under the table to access the blade
to the pack and are rated by the number of teeth per inch. clamps and thumb screws. This makes blade changes very
With three saws and 480 blades, I decided to build three difficult.
complete bots on each saw. This would get me past the
learning curve and help me get a real feel for the saw and its 2. The table was very rough. No amount of waxing could
capabilities. smooth it out. This makes turning tight corners difficult. I
Two of the bots would be made from 1/8” Baltic birch eventually made a top out of waxed 1/8” plywood and
plywood — the kind you get from craft stores. This plywood attached it with double-sided tape. While this is not the only
has no voids and finishes up very nicely. It is lighter and solution to the rough surface, it worked quite well for me.
firmer than expanded PVC and is more heat resistant. Even if
you plan to build a robot in expanded PVC or acrylic, I 3. The rubber knob that tightens the table tilt mechanism is
recommend using the Baltic birch plywood for the prototype. very easy to break. The knob on this saw broke with only one
I also cut the parts for a walker bot out of expanded use. Thereafter, I had to use a wrench to loosen and tighten
PVC. I did enough parts for one bot on each saw. Now, the table. This was not much of a problem, since you won’t
be tilting the table with
The custom birchwood insert. The Dewalt DW788. most robotic projects.

This saw repre-


sents the low-end class
for scroll saws. You will
find saws in this class
that are very similar in
size, shape, and design.
Many of them may
have been built in the
same factory. I just
can’t see these or other
low-end saws holding
up to everyday use.
38 SERVO 02.2005
Simpson.qxd 1/3/2005 1:10 PM Page 39

Dremel 1800
Dremel calls this an 18” Scroll Station. While the included
5” disk sander is an added feature, you won’t be using it
much on your robotics projects. I did not use it once on the
three walker bots I built using this saw. You would be better
off purchasing the optional flex shaft and using one of the
Dremel sanding drums. The disk is somewhat of a pain to get
on and off, so you will have to choose one or the other.
Like the Ryobi, this saw will accept both pin and plain-
end blades. There is a hinged access drawer that makes
changing the blades a bit easier than with the Ryobi. The saw
has almost twice the weight of the Ryobi and, with this, it The open design of the Dewalt.
vibrates much less. The table is polished cast iron and only
took four layers of paste wax to get to a silky smooth surface. saw is right for you.
For blade storage, there is a small drawer under the The Dewalt scroll saw has a $399.00 street price and
table, but I don’t recommend it for serious users. Most is the closest thing to the high end saws that I could find
blades are impossible to tell apart, so I suggest some type of locally. The saw is actually manufactured in Canada by the
sorting tubes for your blades. same company that manufactures the Excalibur (high end)
The controls are all up front, on top of the saw, so it’s line of scroll saws.
very easy to access them. One really nice feature is a small All scroll saws vibrate; it’s just a matter of how much.
LED light located on the saw. While it won’t illuminate your From the $60.00 saw to the most expensive $3,000.00 saw,
work surface, it will keep a beam on your saw line. it’s the nature of the beast. The saw’s mass will affect vibra-
The saw has a flexible air tube that puts out quite a bit tion; the heavier saws don’t vibrate as much as the lighter
of air that will keep your saw line free of sawdust. However, weight saws. You can also lower the vibration by bolting the
when I cranked the RPMs up past 1,000, the vibration caused
the flex tube to eventually drop to the table surface. Using a
scroll saw stand or bolting the saw to the table will help
alleviate this problem. STEER WINNING ROBOTS
Another area that is of concern to me was the large
blade insert. It had very large blade grooves and did not sit WITHOUT SERVOS!
flush with the table surface. Luckily, the design was simple
and, by tracing the insert on to 3 mm birch plywood, I was
able to create an insert that I could wax and then drill a very
small hole for blades. This was perfect for the small pieces I
cut for my walker bot projects.
The saw has small vinyl covers on the power and light
switches. These are used to keep dust out of the switch
mechanisms. They both eventually came off during use and I
found it made using the switches much easier.
The saw weighs in at over 50 lbs, so you won’t be toting
it around the shop, but there is a handle on the top just in
case you feel up to it.
I liked this saw. It worked very well on wood, expanded
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
PVC, and acrylic. Dremel also makes a 16” scroll saw with a with our mixing RDFR dual speed control. Used in many
cast iron table and a 45 degree tilt both ways. It’s about successful competitive robots. Single joystick operation: up
$80.00 less, so you may want to look into that one if you goes straight ahead, down is reverse. Pure right or left twirls
want something a bit smaller and less expensive. vehicle as motors turn opposite directions. In between stick
positions completely proportional. Plugs in like a servo to
your Futaba, JR, Hitec, or similar radio. Compatible with gyro
Dewalt DW788 steering stabilization. Various volt and amp sizes available.
The RDFR47E 55V 75A per motor unit pictured above.
A high end scroll saw can cost you well over a www.vantec.com
$1,000.00. Are they worth it? Well, that depends upon your
use of the saw. If you use it once or twice a year, it may be Order at
better to purchase a smaller, less expensive saw. If, on the
other hand, you plan on using the saw everyday, a high end
(888) 929-5055
SERVO 02.2005 39
Simpson.qxd 1/3/2005 1:11 PM Page 40

the fact that the saw weighs in at over 70 lbs and you get a
very smooth running saw.
The Dewalt is the epiphany of simplicity. Things just
don’t get simpler. The open design under the table means
you can access and change a blade in a matter of seconds. If
you check out other high end saws, they all seem to have this
open design. The Dewalt is so open that they have actually
added a small guard in front of the clamp mechanism. This is
to keep you from accidentally pinching a finger while the saw
is running.
Blade clamps are in a fixed position so they are easy to
tighten and loosen. This also means less blade deflection.
The dust blower is sturdy and does not change position
during operation. The table is cast iron and was so smooth
that I only needed two coats of paste wax. The table has a
Clip lights are inexpensive and make your work easier. small hole for the blade, which is perfect for the small pieces
you will be cutting. You won’t have to worry about making a
saw to a heavy table or stand. Design can affect vibration, as new insert.
well. For instance, on the Dewalt, the pivot points for the All controls for the saw are up front and, with this
arms are up front near the blade. This provides for less design, you can adjust the blade tension while the blade is in
moving mass and yields much less vibration. Couple this with motion. The tension lever is also indexed, so you can get
the exact same blade performance each time
MATERIALS you remove and attach a blade — which is very
important for inside cuts.
The three materials I tend to work with the most when building Of the three saws I tested, the Dewalt was
my robots and prototypes are wood, expanded PVC, and acrylic. the only saw with no dust collection port. This did
On occasion, I have also cut softer metals. not bother me, as I had not planned on using a
connected dust collector with any of the saws.
Wood Scroll saws have small blowers that keep the
I used 1/8” Baltic birch plywood for most of the bots in this
project. You can purchase 12” x 24” sheets for $4.00 at most craft Steps to making an inside cut.
and hobby stores.
You can also cut up to 2” thick pine with ease. Hardwoods, such
as oak and maple, will start to get more difficult as the thickness
increases and you will need to use a larger blade.

Expanded PVC
Expanded PVC is very easy to work with. When this material is
cut, the edges will yield a dull, coarse surface. While the finest blade
will create an ultra smooth surface, you will never get the glossy
type finish as you do on the flat surface of the plastic. I use a #1
blade when cutting 1/8” and 1/4” stock. When stacking expanded
PVC greater than 1/4”, you will need to use a #4 or larger blade.

Acrylic
You cut acrylic much like you do expanded PVC. The surfaces of
the acrylic must be covered. When purchased, the surfaces are nor-
mally covered. You can also use masking tape for this. On 1/8”
stock, I use a #1 blade. On 1/4” stock, you have to move up to a #4.

Metal
To cut metal on a scroll saw, you must use special hardened
metal cutting blades. I prefer to use the smaller, thinner blades like
a #0 metal cutting blade. Just slow the saw down and take it slow.
I have cut up to 1/8” aluminum with these blades.

40 SERVO 02.2005
Simpson.qxd 1/3/2005 1:14 PM Page 41

scroll line clear, so they tend to


blow a bit of dust in the air.
The simplest and most effec-
tive solution for dealing with
the airborne dust is to use a
small window fan with a filter
taped to the front of it. This
tends to capture all the air-
borne dust and is fairly quiet.

Saw Choice
Conclusions
The fit and finish on all Sample shape transition pieces. No adhesive required!
three saws was very nice. All
three saws had no problems cutting the wood, plastic, and Techniques
acrylic needed for my walker bots. However, there was no
way my boss (wife) was going to let me keep all three saws, Inside Cuts
so I had to choose only one. Making an inside cut with a scroll saw is very easy:
I decided on the Dewalt saw, mainly because I see myself
using the saw on just about every robot project in the future. Step 1:
This saw features full ball bearings and less overall mainte- Lay out your cut. In this case here, we are cutting a servo
nance than the other saws. Factor this with the ultra low mount.
vibration and my choice was made for me. Had the cost been
more of a factor, I would have chosen the Dremel 1800. Cutting multiple pieces saves time.
If you decide to purchase a scroll saw, here are some of
the features to look for:

• Table finish.
• Variable speed
• Plain-end blade support
• Ease of blade change
• Blower for clearing stock line

You will also want to pick up some sort of light. I like the
inexpensive $7.00 clip-on lights. You can add as many as you
want. Use a 40 watt bulb to keep the heat down.

SCROLL SAW BLADES


Scroll saw blades come with plain-end and pin-end patterns. These range from skip tooth to reverse tooth
configurations. Most high end scroll saws types. There are even spiral blades that will cut
only use the plain-end type. There are many in any direction.
more types of scroll saw blades available in There is a universal number system used to
the plain-end configuration. Generally, reference plain-end blades. Most manufacturers
pin-end blades should be easier to change; use it and it’s a good guide when selecting the
however, on the saws I tested, I found this to finish type and cutting radius of a scroll saw
not be true. The Ryobi and Dremel accept blade. The smaller the universal number, the
both types of blades, but are a bit more thinner the blade and the more teeth per inch.
complicated because they accept both the I have found that a #1 blade works very
blade connectors. nicely in 1/8” plywood or plastic. It leaves a
Once you decide on the blade end very fine finish and requires no clean-up. You
configuration, there are many types of can just about turn in place to cut extremely
blades available in various widths and tooth tight corners.

SERVO 02.2005 41
Simpson.qxd 1/3/2005 1:16 PM Page 42

Step 2: transition to a horizontal piece. In this case, we are making a


Drill a small hole in one of the corners, just touching two of the bot leg that will be connected to a servo. We could apply
sides. This hole should be large enough to insert the saw blade. heat and bend the leg, but bending is not an option in many
As an option, you can drill four holes, one in each corner. situations. For instance, with expanded PVC, it would yield a
leg that’s just not rigid enough to support the weight of the
Step 3: bot. If you are using plywood, heat alone is not enough to
Unclamp the blade at one end. Insert the blade through the bend the leg.
hole and then clamp the blade back in place. You can release In this case, I cut two pieces with slots where the pieces
the top or bottom of the blade; it does not matter. will overlap. The slot is half the length of the overlap. The
width of the slot is the thickness of the stock. Once cut, the
Step 4: pieces are joined together by sliding the slots into each other.
Cut the stock. Once cut, unclamp the blade and remove the This makes for a very strong and rigid leg. In most cases, you
stock. In this case, I drilled the holes with a drill press. won’t even need to use an adhesive to hold them together.
While this technique works well for both wood and
Shape Transitions expanded PVC, it is a bit more difficult when using acrylic.
Acrylic is a little more brittle and will break if the slots are too
There are times when you want a vertical piece to tight. In this case, you are better off cutting the joints a bit larger
and laying down a bead of hot glue.
Saw Model Ryobi SC164VS Dremel 1800 Dewalt DW788
Size 16” 18” 20”
Cutting Multiple
Speeds (SPS) Variable 400-1,600 Variable 500-1,700 Variable 400-1,750
Pieces
There are times you need to cut
Blade Size 5” 5” 5” multiple pieces that are the same shape.
Blade Types Plain, Pin Plain, Pin Plain To do this, stack several of the pieces
together using thin strips of double-
Blade Stroke 3/4” 3/4” 3/4” sided tape. Carpet tape works nicely.
Cutting Capacity 2” 2” 2” If you are cutting expanded PVC or
acrylic, you will also want to coat the top
Table Tilt Right 45 Deg 45 Deg 45 Deg with masking tape. Not only does the
Table Tilt Left N/A 5 Deg 45 Deg
tape aid in the cutting of the stock, but
it also gives you a surface to transfer
Shipping Weight 33 lbs 53 lbs 73 lbs your pattern onto. Once the pieces are
cut, you can do all your sanding while
Motor Amperage 1.2 A 1.6 A 1.3 A
they are still connected.
Motor Voltage 120 V 60 Hz 120 V 60 Hz 120 V 60 Hz There are some disadvantages to
bulk cutting. If you make a mistake, you
Vibration Good Good Excellent
will ruin all your pieces — not just one.
Table Material Aluminum Cast Iron Cast Iron Also, you will have to use a coarser blade,
which will yield a rougher cut. To cut the
Table Surface Poor Good Excellent
stock shown here, I had to use a #4 blade
Blade Insert 3” 3” N/A verses the #1 I normally use. SV
Blade Change Poor Good Excellent
Tension Adjustment Good Excellent Excellent
ABOUT THE AUTHOR
Dust Collection Port Yes Yes No Michael Simpson has been an
avid woodworker for 20 years. He
Air Blower Good Good Excellent
runs the MGS Woodworking site at
Light No Yes Option www.mgsweb.com/woodworking
Disc Sander, Blade Full Ball bearings, He also runs the Kronos Robotics
Other Features Includes six blades drawer, Includes Low maintenance, website at www.kronosrobotics.com
12 blades Includes two blades
Kronos Robotics caters to beginner
Street Cost $87.00 $239.00 $399.00 electronic enthusiasts, as well as
COMPARISON CHART seasoned engineers.

42 SERVO 02.2005
Menagerie.qxd 1/5/2005 8:34 AM Page 43

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

Roverbot
Orestis Kalantzis

Roverbot is an autonomous robotic platform that moves on wheels and


has the ability to be self-guided or remote-controlled (locally or via a wire-
less LAN or the Internet).
Its basic principles are two independent motor wheels (and a third one
— a smaller, free-turning wheel — for support). The speed divergence of the
wheels makes Roverbot turn just like a tracked vehicle, eliminating the need
for the use of a steering gear and, therefore, facilitating spatial placement.
I also found it necessary to use a PC instead of any other computer
system (microcontroller-based or PLC) due to the wide range of developing
software, operating systems, networking capabilities, and peripherals in
general.

Characteristics:

Dimensions:
Length: 22.5 in
Height: 15 in
Width: 22.5 in

Weight: about 88 lbs

Cost: about $864.00 (expected to reach $2,000.00).

History:
I started designing Roverbot in 1992. I wanted to experiment and
acquire some real experience in robotics, but also to build a platform for fur-
ther experimenting in self-direction, automated map-making, and other
applications of Artificial Intelligence and Neural Networks.
Simulation appeared to be an alternative course, but one I had to reject
because of the obvious danger of being driven to wrong or non-applicable
conclusions (due to its inevitable distance from reality), but also because it
would deprive me of the chance of designing/developing electronic and
mechanical hardware.
Beside the subsystems of stepper motors and their drive circuits that I
designed (and built as prototypes) in 1996, all the rest was manufactured
between May and October of 2002.
For more information, please visit http://roverbot.netfirms.com
where you can find photos, videos, VRML 3-D models, and more.

SERVO 02.2005 43
FebNewProducts.qxd 1/4/2005 12:44 PM Page 44

New Products

New Products
to modify servos for wheeled platforms.
MOTORS • Modular mechanical connection — front and side axle
attachments and side and rear mounting points.
Smart Servos Put It All Together Each motor incorporates a microprocessor to support
these capabilities with an easy-to-use interface. Each

G arage Technologies, Inc., has


announced that AI Motors are
now available in the US. AI Motors
motor includes two cables for daisy-chaining and 11 differ-
ent mechanical links. Innumerable configurations are pos-
sible, such as two-wheel platforms, dogs, and humanoids
combine a serial bus control inter- with few or no additional mechanical parts. Both motors
face, modular mechanical connec- operate from 5 to 10 VDC and offer three software-
tions, and position and loading read- configurable range/resolution modes:
out. As true robotics motors, they
provide the functionalities of a servo, • 332° at 1.3° resolution
gear motor, wheel encoder, and • 166° at 0.65° resolution
motor interface. Special capabilities include: • 360° continuous rotation at 15 different speeds.

• Simple serial interface (RS232 at TTL levels) — no need for At 9.5 V, the AI-701 provides 7 kg*cm stall torque and
a multi-channel PWM interface. Up to 31 motors can be a maximum of 80 RPM and the AI-1001 provides 10 kg*cm
placed on a single four-wire bus. torque and 60 RPM. Configuration GUI and example source
• Position readout — no need for a position encoder. code are available for free download. The AI-701 is priced
• Current readout. Motor current provides a reading propor- at $65.00 each and the AI-1001 at $90.00. Complete eval-
tional to mechanical loading. Each motor also provides uation and humanoid robot kits are also available.
overload protection by shutting down in the event of For further information, please contact:
over current. 93 Norton Ave.
• In addition to commanding position and speed, you can set Garage San Jose, CA 95126
over current limits, motion limits, and control-algorithm
Technologies, Tel: 408•347•0556
Inc. Email: jroberts@garage-technologies.com
coefficients individually for each motor. Website: www.Garage-Technologies.com
• Full 360° rotation mode under software control — no need Circle #124 on the Reader Service Card.

Need a small, full-featured robot controller? Meet Orangutan:


Want to build a small robot that doesn’t look like a PCB on
wheels? Orangutan is small enough for integrating into a small (actual size)
robot, rather than being the small robot. With motor drivers, programming
8x2 LCD connector
buttons, display, and buzzer, all you need to add is your own
chassis, sensors, software, ... you know, the fun stuff.
buzzer
Atmel MEGA8/168 three
microcontroller pushbuttons reset
button
1.85” power
dual bidirectional switch
motor driver two motor
ports power LED

2.00” trimmer pot


12 I/O ports with power and LED on I/O line
Find out more at www.pololu.com ground for easy sensor connection
or by calling 1-877-7-POLOLU.
Circle #111 on the Reader Service Card.
44 SERVO 02.2005
FebNewProducts.qxd 1/5/2005 8:37 AM Page 45

ROBOT KITS Take Education Off


Road
Binary Player Robot
O WI introduces the
second generation
R o g u e
Robotics
introduces
of its binary navigat- the new Rogue
ing robot kit. ATR ERS™ (ATR — All
Binary Player Terrain Robot, ERS — Educational
Robot is a very Robotics System) robot kit. This system
predictable two- is the first of its kind for high school
wheeled robot. An classrooms and hobbyists, providing
internal program stored on robotics, electronics, and object-orient-
a memory disk created by the ed programming in one system, while
user ascertains its predictability. offering unparalleled all-terrain mobility.
Therein, however, lies the fun. Binary Rogue ATR ERS features an 8”
Player Robot is easily re-programma- base with rubber tracks, Rogue’s uni-
ble by the controller ... you. versal sensor mount system, dual DC
Binary Player Robot is controlled gear motors, extra level capability for
by black and white patterns on a disk, expansion, and a 1.1 A dual H-bridge
which are read by an infrared sensor. module, extra level capability for
Particular patterns activate either of expansion, a 7.2 V NiCad battery, and
two wheels to turn left, right, for- an OOBoard™ educational develop-
ward, or pause. These on/off com- ment board as its brain. The Rogue
mands illustrate the basic principles of ATR ERS is made from the same laser-
binary coding. To change a move- cut, powder-coated aluminum as the
ment program, the operator simply popular Rogue Blue robot base.
creates a new disk pattern and/or The kit is bundled with a curricu-
changes the speed variation on the lum text full of experiments, a parts
three-speed gearbox. kit, and a plastic storage box to house
This is a good beginner’s robot. the fully assembled robot neatly in a
The battery-controlled kit can teach classroom or under your workbench.
the basic principles of robotic sensing Powering the Rogue ATR ERS is
and locomotion. It features a the OOBoard, with an embedded
pre-assembled printed circuit board OOPIC® object-oriented processor,
(PCB), hardware, and mechanical which can be programmed in C,
drive system that can be handled Java™, or Basic syntax. The kit includes
by almost anyone. Only basic hand a CD ROM that contains the program-
tools are required for assembly. An ming editor for the OOBoard, as well
infrared sensor and PCNB controls the as samples and curriculum materials.
robot. The Rogue ATR ERS is the SUV of
Easy-to-assemble, this OWIKit Educational Robots; small objects,
beginner building level robot makes a uneven floors, and cables are not bar-
great entry for robotic competitions, riers for this robot. The Rogue ATR
science fair projects, robotic work- ERS robot kit sells for $324.95 and
shops, science enrichment camps, the OOBoard sells for $119.00.
and classroom activities. The suggest- For further information, please
ed retail price is $34.95. contact:
For further information, please
103 Sarah Ashbridge Ave.
contact: Toronto, ON M4L 3Y1
Canada
Rogue Tel: 416•707•3745
17141 Kingsview Ave. Robotics Fax: 416•238•7054
OWI, Carson, CA 90746 Email:
Inc. Tel: 310•515•1900 info@roguerobotics.com
Fax: 310•515•1606 Website:
Website: www.owirobot.com www.roguerobotics.com
Circle #135 on the Reader Service Card. Circle #148 on the Reader Service Card.

SERVO 02.2005 45
Volrath.qxd 1/3/2005 2:23 PM Page 46

Build a PICChip
Electronic Speed Control
by Dennis Volrath

odern electronic speed controls microcontroller. This device includes cells (19.2-25.2 volts). The 7 to 21 cell
M (ESCs) incorporate very versatile
microcontrollers — a microprocessor
five analog inputs and two pulse
width modulation (PWM) outputs.
versions will handle 35 amperes contin-
uously, with a peak capacity of 50
type of device that is entirely self The ESC firmware listing is available amperes for 60 seconds. The final ESC
contained. This project describes an through the SERVO website measures 1.9 by 2.5 by about 1/2 inch
ESC that uses the Microchip 16F873 (www.servomagazine.com) and is and weighs about 1-1/4 ounces without
somewhat unusual; it includes lead wires. With the addition of several
The PICChip and connections. eight different functions, as more components and component
described in the Sidebar below. changes, this ESC can be constructed to
This ESC is designed for the handle 40 NiCad cells (48 volts) with a
higher power cobalt brush type maximum current rating of about 35
motors, although any of the can- amps. The addition of heatsinks for the
type motors can also be used. FETs will allow substantially higher
The total cost of all parts — maximum current ratings.
excluding the circuit board — is
about $35.00. The ESC function Build the ESC
can be built in several different
voltage ranges. The standard The three ExpressPCB circuit
range is 7 to 15 NiCad cells (8.4- boards (board layouts are at
18 volts). By exchanging diode www.servomagazine.com)each
D1 for a resistor, R13, it allows have two ESC boards for a total of six
operation from 16 to 21 NiCad ESC circuit boards. The boards must

In-depth Info on the ESC Mode


The ESC mode includes the following 7. Error counting at the rate of 30 1,200 Hz beep.
items: counts per second to a maximum of
65,000 for receiver errors. (Binary 13. Pin 22 changes to 5 volts DC on the
1. Reduction of maximum available error output is on pins 15 and 16.) middle beep.
motor power levels on low battery
condition. 8. Receiver Battery Elimination Circuit 14. Pin 23 changes to 5 volts DC on the
(BEC) for 7 or 8 cell operation. high beep.
2. Switching speed of 2,500 Hz (cycles
per second). 9. Output 0 or 5 volt signal on pin 19 15. Pin 24 changes to 5 volts DC after
for an optional brake function (not an accumulated loss of radio signal of
3. Linear motor POWER versus trans- covered). about 10 seconds.
mitter stick operation for propeller
drive. 10. Valid receiver monitor indicator on 16. Pin 25 changes to 5 volts DC after
pin 27 that reads 0 volts DC for no an accumulated loss of radio signal of
4. Motor power down on wrong signal signal or wrong signal and 5 volts for about 2 seconds.
from RC receiver. valid radio signal.
17. Pin 26 changes to 5 volts DC after
5. Automatic calibration of the low 11. Output on pin 28 that will read 0 an accumulated loss of radio signal of
and high transmitter throttle positions. volts and will change to 5 volts DC about 1/2 second.
after the PICChip is “armed.”
6. Nine volt doubler circuit for the (These status pins can drive an LED
HEXFET gate driver circuit. 12. Pin 21 changes to 5 volts DC on the through a 680 ohm resistor.)

46 SERVO 02.2005
Volrath.qxd 1/3/2005 2:24 PM Page 47

Build a PICChip Electronic Speed Control

be cut in half before assembly. The


simplest way to cut them is to lightly
clamp a steel edge to the middle of
the circuit board. Then use a small
coping saw with a thin blade to cut
against the steel edge to separate the
two ESCs from the board. Make
absolutely certain that the steel edge
is placed such that no copper foil
patterns are cut.
Next, the ESC will be constructed.
Load the “Connections plus
parts.pcb” (at www.servomagazine
.com) into the ExpressPCB program.
Refer to the photograph and parts lay-
out drawing for the location of all
parts. First, insert all parts, installing
the four transistors last. Be especially
careful with the orientation of the
transistors, diodes, and capacitors. Download the “Connections plus parts.pcb” for the PICChip.
The 3 amp diode is “standing on
end.” Switching the 2N2904 (NPN reversed. For the record, a reversed that whatever transistors are used are
switching transistor) with a 2N2906 tantalum capacitor may not fail until configured as “Emitter-Base-Collector”
(PNP switching transistor) or installing months after construction of this project. and are of the TO-18 type.
these transistors backward will cause Note that the 2N2904 and 2N2906 Next, install the HEXFETs. Note
all sorts of troubleshooting problems. transistors have been discontinued. that they have the two outside lead
Also note that the various diodes RadioShack has equivalent transistors wires soldered. The center lead is not
and capacitors must not be accidentally available in bulk. Just make certain used. The two outside HEXFET leads

The schematic for the PICChip Speed Controller.

SERVO 02.2005 47
Volrath.qxd 1/3/2005 2:25 PM Page 48

Build a PICChip Electronic Speed Control

are soldered through the circuit boards with pure alcohol or appropriate 2 of the PIC. Adjust trimmer resistor R1
board. The third connection is solvent. Pay particular attention to to set this voltage to 3.3 volts DC. (The
through the four 4-32 screws, lock the connections around the crystal PIC will not allow the voltage on pin 2
washers, and nuts that hold the resonator and pins 9 and 10 of the to exceed 5.5 volts DC, appx.) The
HEXFET to the circuit board. Note that PIC. Any water or solder flux residue in voltage between the battery minus
the negative motor lead is connected this area can prevent the crystal from and both pins #1 and #20 of the PIC
directly to one of the four 4-40 screws starting, preventing operation of the should measure 5.0 volts DC. If the
that secure the HEXFETs to the circuit microcontroller. Shake off all solvent BEC is being used, check for 5 volts
board. If this ESC is going to be used and blow the board dry with the out- between the black and red wire of the
in a poorly ventilated area, heatsinks put of a vacuum cleaner or hair dryer. servo connector. Disconnect the battery
should be inserted under the HEXFETs. and install the PIC. Do not install the
A small piece of aluminum — a few NOTE: This ESC will be susceptible to PIC upside down. Reconnect the 9 volt
inches wide — will suffice. moisture. If it is to be used in a float battery and verify that the ESC current
Lastly, note that the layout drawing plane, take precautions against water. drain is about 12 mA.
calls for either a small jumper wire or If all looks well, connect the ESC
a small switch for “turning off the Use the following procedure to microcontroller board to the receiver.
ESC.” This same switch will also turn check out the ESC microprocessor If the ESC does not include the BEC
off the battery elimination circuit board. Remove the PIC from the board. connection, connect a four cell NiCad
(BEC) if the ESC is so configured. This Next, connect a 9 volt alkaline battery pack to the R/C receiver. Power-up the
switch completely turns off the ESC to the ESC red and black battery lead transmitter, receiver, and ESC. Check
and will result in zero battery drain. wires. Connect a DC voltmeter for 9 volts between the motor battery
Remove all flux from both circuit between the battery black wire and pin negative black wire and test point “Z.”
This ESC controller was
PICChip’s Built-in Programs designed for use with high per-
formance model airplanes pow-
The different modes of operation have mechanical stops.) ered by electric motors. The typ-
also been assembled on the popular ical motor used involves an
RadioShack perf boards listed in the parts 6. Read-back functions with LCD display that Astroflight Cobalt 40 size motor
list. The wiring and connection diagrams read the error log from items 1 and 2. with a gear box that can be run
are all available through the SERVO on 22-2.4 Ah NiCad cells at cur-
website (www.servomagazine.com). 7. The LCD displays the receiver pulse rent levels of 40 A. This is a very
The PICChip has the following eight width measurement and the receiver significant amount of power;
programs built in: pulse width output from 0.01 to 2.54 the Astroflight motor will turn a
milliseconds with 0.01 millisecond resolu-
13 inch (10 inch pitch) propeller
1. Standard ESC with low battery motor tion.
at about 7,800 RPM. Be aware
power-down and receiver error detection.
8. Servo test mode with LCD display with that this can cause significant
2. Receiver error monitoring with one left, center, and right repeated tests, along injury to the unwary.
PICChip, one ceramic resonator, and one with three different servo ramp-up and Because of this, this ESC
or two other parts. ramp-down rates to test servos. requires an “Arming” process
each and every time the ESC is
3. Battery voltmeter with LCD display with These different modes are configured powered down and powered
a range from 6 to 20.46 VDC with 0.02 volt by the input voltage to three of the PICChip back up by battery power. The
resolution. inputs during power-up. Items 4 through 8 ESC verifies proper receiver
are constructed on one “Hole board” from signal on power-up. After about
4. Servo DRIVER, allowing the PICChip to RadioShack. The different functions are set 1 second of valid signal with the
provide the signals to operate a servo. This up with those little PC shorting blocks, also throttle set at less than 50%,
function has an optional LCD that directly available from RadioShack. the ESC sends a 1,200 Hz very
displays the servo output signal with a The PICChip used in this project can
low power “beep” to the
range from 0.85 to 2.12 milliseconds. be programmed with the PICSTART PLUS
motor. (If the throttle is over
programmer, available from Digi-Key.
5. Servo DRIVER configured for 0.01 to 2.55 The PIC16F873 has a set-up configuration
50%, nothing will happen!)
milliseconds. This mode was used to bit file for the PIC16F873 device. This After this, quickly move the
design the ESC. (Be careful when using configuration file must be set up where the throttle to full throttle, wait for a
the 0.01 to 2.55 millisecond configuration Oscillator function “XT” and everything medium pitched motor beep,
with a servo. It will run the servo past its else is turned off or disabled. then move the throttle to mini-
mum and wait for a high pitched

48 SERVO 02.2005
Volrath.qxd 1/3/2005 2:26 PM Page 49

Build a PICChip Electronic Speed Control

motor beep. The ESC


has just memorized the
PIC 877 Speed Control Parts List
high and low throttle Part ID Part No. Quantity
positions. The next FET (7 to 21 cells) IRL3705N-ND HEXFET (Price reduction at 10 pcs) 4
throttle movement will 5 V REG LM2940CT-5.0-ND 1 A low drop reg 1
run the motor. This C1 272-1029 220 µF cap 1
whole process takes less C2, C4, C5 P2022-ND 2.2 µF cap 3
than 10 seconds. C3, C7 272-134 0.047 µf 1
This ESC was C6, C8 272-123 100 PF cap 1
designed to power an D1 276-1101 1 amp diode (7 to 15 cells) 1
D2, D3 SD103ACT-ND 400 MW 40 V Schottky diode 2
electric motor under pro- D4 (7 to 21 cells) 1N5822-ND 1N5822 3 amp Schottky diode 1
peller loads. The horse PCB Per ESC article
power to turn a propeller PIC PIC6F873-04/SP-ND PICChip (Must be programmed!) ** 1
is related to the RPM Q1, Q2, Q4 2N2904 2N2904 (RadioShack 276-1617) 3
ratio raised to the third Q3 2N2906 2N2906 (RadioShack 276-1604) 1
power. The PIC uses a R1 CT94W203-ND 20 K 10 turn pot 1
look-up table for the R13 470 QBK-ND 470 ohm (16 to 21 cells) 1
pulse width modulation
R2, R12 22K EBK-ND 22 Kohm 1/8 watt 5
output that accounts for R3, R10, R11 47K EBK-ND 47 Kohm 1/8 watt 5
the propeller effect. If R4, R5, R6, R7 150 EBK-ND 150 ohm 1/8 watt 5
this ESC is to be used for R8, R9 10K EBK-ND 10 Kohm 1/8 watt 5
other purposes, the look- XTL PX400MC-ND 4 MHz resonator ** 1
up table can be modified SOCKET 276-1999A 14-pin socket (two end-to-end) 2
to provide any throttle 1
verses power output. Digi-Key (All -ND parts) Remaining parts from
Note that the ESC does 701 Brookes Ave South RadioShack and
Thief River Falls, MN 56701 local hobby shops
not provide motor
800-344-4539
reversing. The web page
includes a linear assem- Resistor Note: Digi-Key minimum order on 1/8 watt resistors is five pieces. ** DO NOT SUBSTITUTE!!
bly file for drives not
involving propellers.
Next, connect the ESC, fully many different functions in robotics the limits are only defined by your
charged motor battery, and motor and other hobbyist applications; imagination. SV
without a prop per the ESC wiring
diagram. Connect a DC voltmeter
between the motor battery black
wire and pin 2 of the PICChip. Adjust
the trimmer resistor R1 to set this
voltage to 3.3 volts DC
The final step is to securely
mount the motor and prop, fire up
the radio and ESC, and run the motor
battery down to about 0.9 volts DC
per cell. Then, adjust R1 so that the
motor battery stays at 0.9 volts per
cell or the low battery voltage of your
choice. The ESC will shut off drive
power to the motor when the
PICChip pin 2 is less than 2.30 VDC. It
allows full power to the motor when
pin 2 is over 2.50 VDC. Between
these two voltage levels, the ESC
allows 20%, 40%, 60%, or 80%
power output.
In conclusion, this project has

Circle #75 on the Reader Service Card.


SERVO 02.2005 49
Robolinks.qxd 1/5/2005 1:17 PM Page 50

T E X A S A R T RO B OT S
H A N D M A D E I N T E L L I G E N C E

UNIQUE LIMITED EDITIONS


INTELLIGENT & AUTONOMOUS
HAND CRAFTED
Electronic Parts & Supplies
.
WWW A RT BOTS COM . Since 1967

Meccanisms TM

Maximum Power
www.gatewayelectronics.com Control 4 Motors, 2 Servos, 3 Relays
6 Analog & 8 Digital Inputs. Adv.
(Electronically Speaking, Gateway’s Got It!) O/S & Development Environment.
Plug-In Connectors, No Soldering

MAIL ORDERS CALL TOLL-FREE-1-800-669-5810 Minimum Fuss


www.meccanisms.com

For the finest in robots, parts, and services, go to


www.servomagazine.com and click on Robo-Links
to hotlink to these great companies.

50 SERVO 02.2005
Barlow2.qxd 1/3/2005 4:27 PM Page 51

— BY KERRY BARLOW —

I n last month’s article, I spoke about many features of the


Atom and I began to talk about how I used the Atom in
my robot (pictured here). This month, I will go into further
Atom processor. To give you some idea of what my program
is doing before I go into detail on the Atom specific code, a
diagram of the program is in order. I encourage readers
detail on code that is specific to the Atom microprocessor to download the full program and keep it on hand while
(see Figure 1). I encourage you to download my program reading this article. It is not my intent to describe the full
examples from the SERVO website or from my own website robot program here, just the sections pertinent to the Atom.
(see the Resources sidebar). The following code summary is laid out exactly as it is
written in the full program:
The Program
Hardware Interrupts initiated and set running in
After spending much time, making many additions to my background
code, and watching the code grow larger with every revision, I
am extremely happy I Main Loop
chose the Check for Interruptflag
If the Hardware Interrupt has been activated,
branch to object detected.

SERVO 02.2005 51
Barlow2.qxd 1/3/2005 4:28 PM Page 52

THE ATOM 24-PIN MICROPROCESSOR

It should be noted that Basic Micro states that the


hardware interrupts will occur between lines of code. This
means that, if you have something like a pause 5000 (5
seconds), the hardware interrupt will not be processed
during this pause routine. A long sound statement or some
similar line of code that takes extra time to run will also cause
the interrupt code to wait while it executes this line.
This is not normally a problem if a person is aware of it
and designs the main loop code to avoid such problems.
For example, if you do need a long pause, then — instead
of a pause 5000 — break this down into a small for-next loop,
such as:
FIGURE 1
for I = 1 to 50
pause 100
Read four SRF04 Sonar and store values into sonar next I
variables
Branch to four subroutines and store values into sonar The Atom interrupts would then be active on each of the
variables. three lines of code and only a pause 100 (.1 second) would
Read GP2D02 and store value in variable then cause the interrupts to be disabled.
Decision statement if range is too low As far as speed of execution, I cannot say empirically
Check if GP2D02 has returned a short range. how fast the Atom is compared to other processors. On
Set up sonar flags into a binary truth table using IF paper it is, indeed, faster (33 K instructions/second), but I am
statements sure the readers would like some real world proof. All I can
If Ldist <= 10, then Lflag = 8. say to this is that, after reading four SRF04 sensors, detect-
Stop tracks if Sonar returns any detection. ing a GP2d02, checking a light sensor, and making decision
If Lflag = 8, c1flag = 4, c2flag = 2, or Rflag = 1, then statements, I notice no lag in object detection whatsoever.
gosub stoptrack. Lag or detection in a program such as this is going to be
If any flags are set, then gosub StopTrack. hard to measure because, sometimes, it is unknown whether
Add all binary values together for Sonar sensors an object simply was not detected or the robot drove past an
Objectflag = Lflag + c1flag + c2flag + rflag. object before its code could detect it. For the hardware inter-
Check Light sensor rupts, I test them while the robot is moving by holding a narrow
Gosub lightincenter and perform subroutine functions. yardstick in the robot’s path. As far as I can tell, the instant I
Check for robot being trapped place the yardstick within range of an edge sensor, I have
If the robot becomes trapped, it may swivel around for detection and the robot code stops the tracks. I know this is
awhile looking for an opening. In this case, gosub back- not scientific, but it is my real world observation.
up and find the proper direction to turn. The final and working version of the robot has the
Do Binary calculation for direction subroutines following hardware installed. The program is available online
If objectflag = 0, then gosub forwardtrack. at the SERVO website or from mine.
If objectflag = 1, then gosub left15.
Additional IF decision lines ... • Four SRF04 sonar range finders using a 4502 multiplexor
Return to Main (see Figure 2).
Hardware interrupts disabled • One GP2D02 range I/R finder.
• Three CDS light sensors using the A/D input (see Figure 3).
Interrupt Loop • One PIR heat sensor: currently not working.
• Six I/R wall edge sensors, interrupt controlled.
The reader should note that, at the same time the main • One speaker.
loop is running, the hardware interrupts are also running. At • One LCD.
any time while the program is within the main loop and an • One rotating sensor head.
IR edge sensor outputs a 0, then the hardware interrupt pin • Dual motor track drive.
will initiate an interrupt to the main loop and send control to
a special subroutine. In this subroutine, I stop all motors and Program Detail
search for an opening around the robot. Once an opening is
found, I resume the interrupt subroutine and continue with Let’s go into detail on sections of the program that are
my main loop’s code. I wish to emphasize that this interrupt unique to the Atom. A few of my program routines may be
occurs in hardware and is much more reliable than software hard to understand, so I will also review sections of the code
solutions to implementing interrupts. that need explanation. The main loop has been detailed
52 SERVO 02.2005
Barlow2.qxd 1/3/2005 4:29 PM Page 53

THE ATOM 24-PIN MICROPROCESSOR

previously, so I will not belabor that point again. I cannot talk may be read in using the pulsin command. A pause 10 is used to
about all of the sections of my program at this time. If ensure that the echo is received properly and to prevent ringing
anyone has questions on the complete robot program, please of the transducers. For an example of using the multiplexor
feel free to write me or post a question on the Nuts & Volts with the SRF04 sensors, please download the SRF04 program.
Forum (www.nutsvolts.com select Bulletin Board).
Servo Code
4052 Multiplexor and SRF04 Code
Using a servo with the Atom is very straightforward. This
As readers may have guessed by now, I was running out was a feature I was very happy to find out about after
of I/O lines quickly. When I decided to use four sonar purchasing the Atom. The entire servo command consists of
sensors, I had to make a design decision. I could have used three statements on one line:
the modern SRF08 sensor on the Atom’s I2C bus; however, I
could not afford the additional price of the sensors. I did not SERVO PIN, ROTATION, REPEAT
have enough I/O lines to waste on four sonar sensors, either.
The 4052 is a four-channel analog chip controlled by two SERVO PIN is the I/O port on the Atom that you want the
logic lines. This was made to order for my application (see servo connected to. ROTATION is a variable or degree you
Figure 2). The connections are straightforward and I am sure wish the servo rotated to (-1,200 to 1,200) and REPEAT is the
all readers will be able to follow the schematic easily. number of times you wish the command repeated internally.
Simply put, the four channels are connected to the input All servos will be different. On my servo, a command of servo
channels, depending on binary logic applied to their A and B 15, 0 will drive the servo on pin 15 to center. This is all that
control lines. For example, if a low or 0 is placed on both the is necessary to drive a servo on the Atom processor. To move
A and B control lines, then the Y and X lines are connected the servo a full clockwise rotation, use the command servo
internally to the Y0 and the X0 lines. In my schematic, this 15, 750.
would be SRF04 sensor 1 enabled. Software code then
would call the SRF04 normally. The 4052 chip will come with GP2D02 CODE
a logic truth table for its four states.
The code to implement an SRF04 on an Atom is a bit The Sharp GP2D02 code is identical to that of the BS2.
different than the code on a BS2. The code will bring the Init Bringing the Sharp’s clock line low will enable the sensor to
line high and then low to initialize the SRF04, then the echo take readings. The Atom’s Shiftin command is then used to

FIGURE 2

SERVO 02.2005 53
Barlow2.qxd 1/3/2005 4:30 PM Page 54

THE ATOM 24-PIN MICROPROCESSOR

In my program, you will see that I have used names for


CODE 1 the command fields as follows:
'CODE1.BAS 10/4/2004 'NOTE higher value is darker loca-
tion
tempax0 var word adin ax0,clk,ad_ron,tempax0
tempax1 var word
tempax3 var word Ax0 refers to the port for A/D. The Clk option sets the sam-
clk con 2
main pling time for the A/D conversion. The name ad_ron is used
adin ax0,clk,ad_ron,tempax0 'a/d port 1 to set up the options available with the ATOM hardware; this
adin ax1,clk,ad_ron,tempax1 'a/d port 2 is described in the Atom documentation. In my example, I
adin ax3,clk,ad_ron,tempax3 'a/d port 3
debug ["one ", dec tempax0, " two ", dec tempax1, " have chosen right justified input to give a real number output
three ", dec tempax3,13] that is easier to read in my program. Tempax0 is a variable
goto main name I have chosen to store my CDS value.

read in the information: Hardware Interrupt Code


shiftin datainput,cl,MSBPOST,[val02] As mentioned previously, the Atom has several interrupt
sources, which can occur from internal or external sources.
Datainput is the Sharp’s output pin and CL would be
the Sharp’s clock input pin. MSBPOST will tell the Atom what External sources:
format to read in the data. In this case, sample the bits after EXTINT: An external interrupt may be detected on Pin 0,
a clock pulse and put this into the variable called val02. either through a high to low change (used in my program) or
through detecting a low to high change.
A/D CODE RBINT: Upon change, an interrupt can occur on P4, P5,
P6, or P7. This interrupt will trigger if a pin state changes
The special built-in hardware-driven A/D code is quite from low to high (or high to low).
easy to use. Basic Micro has a nice demo program in their
documentation. Refer to Code 1 to see my example of using Internal sources:
a CDS light sensor. Refer to Figure 3; you can see how Internal interrupts have many variants. These are exten-
simple the CDS cells connections to the Atom’s A/D pins are. sively documented by Basic Micro. Some of these are:
Code 1 will read all three light sensors and output the
value to the Atom’s debug screen. Pin names for the three TMR0INT, TMR1INT, TMR2INT: An interrupt occurs whenever
inputs are called ax0, ax1, and ax3. This can be confusing at a timer overflows; this is useful for creating a real time clock
times. Pin ax2 can only be used as an I/O port, but — if you on the Atom. There are three internal timers that may be set
wish — you may reference it as ax2 in your software and in the Atom.
enable one extra I/O port on your Atom. This is digital I/O —
no A/D on ax2. Simply call this pad ax2 instead of a different ADINT: ADInt interrupt occurs when A/D conversion finishes.
pin name — such as pin 1 — as you normally would. It is used in conjunction with the ADin command.
The command to read a CDS cell may be shown in a
single line, as follows: RCINT: RCInt interrupt occurs when a byte is received by the
Hardware USART.
ADIN pin, clk, adsetup, var
TXINT: TXInt interrupt occurs when a byte finishes transmitting
from the Hardware.

USART: This interrupt is disabled if you are using


HSERIN/HSEROUT.

CCP1INT, CCP2INT: CCPInt interrupt occurs on


Capture/Compare/Period match.

EEINT: EEInt interrupt occurs when a byte is finished writing


to the onboard EEPROM.

Basic Micro provides a few examples of interrupt usage in


their documentation. One of these examples is a real time
FIGURE 3 onboard clock. In my robot, I used an interrupt on pin 0 for my
edge detectors. Interrupt code must be written in the correct
54 SERVO 02.2005
Barlow2.qxd 1/3/2005 4:31 PM Page 55

THE ATOM 24-PIN MICROPROCESSOR

manner as prescribed by Basic Micro or they say you can have


stack overflow. I can attest to the fact that this is true. I spent
quite awhile initially debugging my robot program and could
not figure out why I was getting resets after 30 seconds of run
time. An astute person on the Atom forum was able to
diagnose my problem and correct it for me. To start using an
interrupt, three lines of code are necessary to enable hardware
interrupts. One line of code is used to disable interrupts below
a certain point in your program. The actual subroutine branch
point and a resume command are the final lines of code
necessary to use External Interrupts. These code lines are:

Oninterrupt interrupt source, label


Oninterrupt is an operator used to tell your program where
to go if a specified interrupt occurs. Interrupt source specifies
what type of interrupt to act on. Label is used to specify the
FIGURE 4
place to jump to in a program if the interrupt occurs.
Enable interrupt is used to turn on the interrupt system.
SetExtInt mode If no interrupt is given, all interrupts set up using ONINTER-
SetExtInt sets the external interrupt pin to input and sets RUPT are enabled. Enable interrupt can be used to turn on
the state that will cause an interrupt (EXTINT must be specific interrupts.
enabled). Mode is the setting that will trigger the actual
interrupt. There are two choices available: Your program code goes here ...
EXT_H2L = Will activate when pin is pulled low (from high).
EXT_L2H = Will activate when pin is pulled high (from low). disable extint ‘ Disable interrupt can be used to turn off
Enable {Interrupt Source} specific interrupts or all interrupts at once. If no interrupt is

Circle #87 on the Reader Service Card.


SERVO 02.2005 55
Barlow2.qxd 1/5/2005 10:43 AM Page 56

THE ATOM 24-PIN MICROPROCESSOR

given, all interrupts are disabled. wend


disable extint ‘ Disable interrupt can be used to turn off
Your subroutines and additional user program code ... specific interrupts or all interrupts at once. If no interrupt is
given, all interrupts are disabled below this line.
ProgInt ‘ This is the subroutine that the interrupt branches User Subroutines ‘These are the additional program codes
you to. and all of your subroutines.
User code ’ This does whatever you wish your subroutine to ProgInt ‘ This is the subroutine branched to after an inter-
do inside this code. rupt occurs.
resume ‘ This returns you to main program flow where the low motora1 ‘ Turn off all my track motors.
interrupt occurred. low motora2
low motorb1
In my robot program, the code is written as follows: low motorb2
resume ‘ Note that this is a special command to tell the
Oninterrupt Extint, Progint ‘ Extint tells the Atom that I will Atom to resume from where the interrupt occurred.
have an interrupt occurring on pin0. Progint is the subroutine
I jump to if an interrupt occurs. You may do anything you wish after an interrupt has
occurred. In this particular program, I set an interrupt flag that I
SetExtInt EXT_H2L ‘ This will generate an interrupt if pin 0 check after returning to my main loop. If this flag is set, then I
goes from high to low. branch to my object detection subroutine and process the code.
Enable Extint ‘ This enables interrupts from this point down
in the program. This line is necessary to actually turn on the Future Plans
interrupt function of the Atom.
Main ‘ The start of your main loop. There is a lot more that can be done with this robot. I still
while 1 have many unused functions on the Atom. Future plans include
better sound functions to show what is actually happening to
The main loop code of your program goes here ... the robot for debug purposes. The LCD display is good, but
hard to read while the bot is moving around. Morse code
or a voice output chip would solve this problem. Onboard
temperature reading is planned for the I2C bus of the Atom.
I hope to someday get a working PIR sensor installed.
Additional sonar and I/R sensors need to be added. I cannot
emphasize this enough: In my experience, you can never
have too many sensors on a robot. There need to be
additional forward sensors, as well as rear side sensors and
more aft sensors. This may require the addition of another
processor or an extra multiplex chip. I hope these articles
have shown you some of the many capabilities of the Basic
Micro Atom 24-pin microcontroller and all the possibilities
that using it opens up. SV

RESOURCES
I/R receiver
www.parallax.com/detail.asp?product_id=350-00014

SRF04, PIR Sensor, and GP2D02


http://acroname.com

SN754410 and CD4052


www.mouser.com

A/D wiring, Program, and Author Contact


http://mntnweb.com/hobby/bolo/

Atom 24 and Manual


www.BasicMicro.Com

SERVO Magazine
www.servomagazine.com

56 SERVO 02.2005
Pfister.qxd 1/3/2005 4:23 PM Page 57

Smart Hat for a Stylish RoboSapien


M y wife gave me a RoboSapien as
a birthday gift in June, 2004. She
found it at Fry’s Electronics in
collection of partially finished projects.
Instead, I considered following a small
set of design goals for the contest
also suits my philosophy of value engi-
neering for low cost experiments,
which translates into “make it cheap
California shortly after they became entry: and cheerful.”
available. After playing with it, I was
convinced it was not just another cute • Make no permanent modifications or The Parts
remote controlled toy. It could form internal changes to the RoboSapien.
the basis for a low cost autonomous For the microcontroller, I used a
mobile robot. • Use only a simple autonomous micro- Kronos Robotics preassembled Dios
Like many other electronic hobby controller programmed using a PC. circuit board that has proved successful
experimenters, in the past I have on many other small projects. This PCB
destroyed a great many devices by • Use only off-the-shelf sensors and is small (2.5 x 3 inches), lightweight,
trying to make them work better, so I actuators — no custom electronics or low power, and very easy to program
was reluctant to experiment on the mechanics. from a PC serial port. It has a very
RoboSapien. Then the August issue impressive 10 Mips PIC microcontroller
of SERVO Magazine announced the • Use only the remote IR optical input with built-in analog to digital
Hack-a-Sapien contest. I decided to to the robot for send-
take a chance and build an ing commands. Figure 1. Smart Hat has side IR sensors, a front servo
autonomous controller for the robot. mounted ultrasonic sensor, and a programmable
controller while keeping the face visible.
The controller would have sensors • Make the final result
to inform the robot, a processor to ana- look good and be in
lyze the sensor data, and a command the style of the
generator to control the RoboSapien in RoboSapien design.
performing autonomous tasks. This
evolved into a Smart Hat that is put on As always, I chose
the robot to let it achieve autonomous to salvage existing
operation. parts from other proj-
At first, I planned to mount every- ects rather than buy
thing inside the robot body by making or build anything new.
extensive changes to the mechanics, This meant I would
sensors, and wiring. This was a huge use components that I
effort and I feared this approach had was familiar with from
the potential of joining my growing other applications. It
SERVO 02.2005 57
Pfister.qxd 1/3/2005 4:24 PM Page 58

SERVO Magazine Hack-a-Sapien Second Place Winner

custom-cut plastic parts. I began to


experiment on part layouts using my
favorite free CAD program, CadStd,
to produce some potential designs.
I looked at other laser cut
projects and plastic parts and began
to simplify my concept. Curved
surfaces were out. I would concen-
trate on a simple, open box style with
four sides and a top. I tried a few
designs, printed them out, and then
cut out paper models to test the fit,
look, and feel. In the end, the CAD
Figure 2. Parts for the Smart Hat — Dios processor, IR sensors, and batteries. design was reviewed and a $16.00
cost quoted by Pololu. It was cut
conversion, serial communication, and function and looks. I had been using once, air mailed in two days, and fit
many other features, such as only it mounted on a standard size hobby perfectly. This may be the first time I
requiring a 9 volt battery to operate servo to scan a 180 degree field have ever had anything I designed
autonomously. of view and was confident in its work on the very first try.
The controller choice drove the performance. The Smart Hat design is a box cut
size of the add-on to the robot. It was By going to a smaller and lighter from 1/8 inch ABS plastic. White
a bit too big to be placed inside the micro servo, I could mount it on the colored ABS often has brown edges
body without major modification. I robot, but this would require another from the laser cutter, so Pololu suggested
experimented with both a backpack battery pack for the servo power — and using black stock with a smooth side
and a waist pack for mounting, but more weight. One night, I dozed off and a textured side. The top is recessed
these displaced the center of gravity pondering different designs. I needed a to mount the PCB, the servo battery
and limited the walking agility of the good idea for mounting the controller, pack of four AAA cells, and the 9 volt
robot. To preserve the existing robot sensors, servo, and batteries. I woke up battery for the PCB; in addition, it
motions, the center of gravity would the next morning with the concept of provides rear access to the serial port
have to be carefully maintained and removing the robot head and replacing and a power connection.
was a definite mechanical constraint it with a new one. Unfortunately, this All hat parts are symmetric so that
on the possible design choices. violated my first design rule. either the smooth side or the textured
For sensors, I planned to use two The simple solution was that I side can be used as the outside surface
Sharp GP2D12 IR range sensors that would not remove the head, but add a of the hat. The accuracy of the laser
interface easily to the microcontroller. hat to the robot instead: a smart and cutter is about 0.01 inch and provides
These give a reasonable range read- stylish hat with sensors, batteries, a a very tight fit with no loose joints. The
ing using an analog signal that is very servo, and a controller that only back of the hat extends into the neck
reliable. My first thought was to sits over the robot head with no slot of the robot and the front extends
mount them on the front of the connections other than an optical IR down to the chest with holes for
robot, but I had one more sensor I transmitter LED for command output. mounting screws.
wanted to use. It would mount directly over the A major control problem is that
This is an SRF08 ultrasonic ranging robot’s center of gravity and would the RoboSapien rocks from side to side
sensor from Devantech that uses an I2C have only a minor effect on the up to 30 degrees as it moves. This
interface bus available on the Dios motion of the robot. makes the side-looking IR range sensor
microcontroller. It was a perfect choice measurements very inaccurate. The
for the front of the robot, both in The Hat Design solution was to use a mercury switch
to detect the upright position of the
Figure 3. Plastic parts for the Smart Hat with a For a while, I have body and to only do the side range
CAD drawing and paper fit test. wanted to use Pololu measurements during the upright time
Corporation’s plastic period. The front-looking ultrasonic
laser cutting design serv- sensor is not as subject to errors from
ice, just to see how it the rocking motion, but it can also use
works. This was my the upright detection data to trigger
chance; since I already the sensor operation.
had all of the other In the final design, connector pins
parts, it was not a big to the Dios ultra board mount to a
investment to buy some RadioShack prototype circuit board.
58 SERVO 02.2005
Pfister.qxd 1/3/2005 4:25 PM Page 59

SERVO Magazine Hack-a-Sapien Second Place Winner

This board holds the micro servo, the Rubberbands can be


SRF08 ultrasonic sensor, a mercury placed under the arms to
switch tilt sensor, an IR LED for commu- provide a solid, stable
nication to the robot, and connectors mounting. The hat does
for the GP2D12 IR sensors. The Dios not touch the robot
board rests on the top plastic panel head and the front hole
with a four cell AAA battery pack lets the robot face and
attached by screws and a 9 volt logic eyes see the world.
battery for the Dios controller. The
GP2D12 IR range sensors are mounted The Program
at the top of each side panel.
The circuit for the Smart Hat consists In 1977, the IEEE
of connecting interface pins to sensors held the first micro
and actuators. No external digital logic mouse contest in New
or analog interfaces are required. York, where the goal
Inputs to the Dios board are two was to produce an
analog channels from the IR range sen- autonomously controlled
sors and a digital line from the mercury robot mouse to find its
switch tilt sensor. Outputs from the way through a maze. By
board are one control line for the using the simple rule of
servo and one control line for the IR hugging the left wall, a
transmitter LED. A logic power plug is mouse can get through
provided along with a screw type inter- a simple maze. This is to
face for the servo battery pack. be the first autonomous
Communication with the ultrasonic test program for the
range sensor is over the built-in I2C bus Smart Hat: to simply
that uses two wires for clock and data. emulate the historic
The final Smart Hat weighs 400 robot mouse. Many Figure 4. Circuit connections to the Dios processor
grams. The robot weighs 900 grams more complex behaviors for the Smart Hat board.
for a total of 1,300 grams or just under will follow, but this first
three pounds. The hat batteries are one is a necessary step for learning 1. Start up and initialize the program and
rechargeable NiMH and last for about about the control characteristics of the activate robot.
an hour with proper sensor manage- robot. 2. Detect if the robot is active by reading
ment. The hat is attached to the robot The structure of the program is the mercury switch.
by sitting in the back neck slot and rest- a simple repeating loop with the 3. Measure the side range distances with
ing on adjustment screws on the front. following steps: the IR sensors.

SERVO 02.2005 59
Pfister.qxd 1/3/2005 4:26 PM Page 60

SERVO Magazine Hack-a-Sapien Second Place Winner

and a rigid syntax. In other useful things.


addition, your design has
to be compatible with the The Future
real time constraints
imposed by the system. I have some future plans and ideas
In the case of the for using the Smart Hat RoboSapien. A
Smart Hat, no severe real simpler first project will be to add a
time constraints exist and standard TV remote IR receiver, as
Figure 5. Robot controller and a simple TV remote the Dios language shown in the circuit diagram. This will
with receive and transmit test circuit. provides an easy program allow the use of a much simpler
development for robot remote, such as my favorite — the
4. Rotate the servo beginning from left control. Best of all, it is provided free six button RadioShack model
to a start angle. for use with the Dios products. URC-1030B01. This will let someone
5. Read the ultrasonic range for the rota- control the Smart Hat robot motions
tion angle. The Operation without having to master the complex
6. Move the servo and repeat step 5 until controller supplied with the
end of rotation. My RoboSapien fitted with a RoboSapien. This interface can also be
7. Based on side ranges and forward Smart Hat is being tested to determine used to provide low rate, low power,
obstacles, choose a command. how well it moves on both carpet and and limited range wireless computer
8. Send a command to the robot using wood surfaces. This requires sensing a communications.
the IR transmitter LED. sidewall, detecting any front obstacles, Another intriguing project is to
9. Wait for a brief period of time and determining the command to transmit make a second Smart Hat RoboSapien
sample tilt switches. to the robot, and then transmitting this and then program the pair to compete
10. Repeat, starting at step 3. command continuously. The Smart Hat and cooperate, similar to the MIT
monitors the movements of the robot 6.270 student autonomous design
This program is implemented and updates the commands as competition class. I plan to use a pair
using the Dios programming lan- required. of proven IR beacon kits from Pololu
guage. The language provides an When it detects a movement for mutual robot location.
extensive library of built-in functions anomaly, it halts the program and Another robot contest is Robo-
for the I2C bus, IR modules, servo stores a diagnostic readout in the Hoops 2004, held at Penn State,
control, LEDs, and switches. A large EEPROM memory for future PC Abingdon in December of 2004. They
amount of sample code is provided to analysis. In general, the robot moves had a special innovation challenge using
make program construction a very slowly on carpet and faster on smooth a RoboSapien that is autonomously
easy task. surfaces. It can turn and maintain a controlled. It must dunk a four inch
I estimate my programming time fixed distance from a sidewall and can foam ball in a 10 inch hoop, located
to be 10 times faster than with C and detect and avoid large, fixed obstacles 12 inches above the ground.
100 times faster than with assembly in its path. The Smart Hat is now ready One definite experimental research
language. As in all object-oriented soft- to autonomously control a robot objective of the Smart Hat is to
ware systems, there is a learning curve and to be programmed to do many develop behavior-based autonomous
robot control programs. The goal is to
The Sources allow the implementation of modern
computing concepts on a PC and
transmit the programs to the Smart
Kronos Robotics Visit the Smart Hat website for Hat for embodied operation. Some
P.O. Box 4441, Leesburg, VA 20175 demonstration programs, mpeg concepts include finite state machines,
www.kronosrobotics.com movies, and detailed technical infor- fuzzy logic, neural networks, and
mation for design and construction. other machine learning techniques for
Pololu Corporation www.sosrobots.com intelligent robotics.
6000 S. Eastern Ave., Suite 5-E, In summary, the combination of a
Las Vegas, NV 89119 CAD Standard drawing program by RoboSapien for under $90.00, along
www.pololu.com John Apperson with a Smart Hat for under $100.00
www.cadstd.com and a PC can provide an experimental
Devantech, Ltd. (Robot Electronics) autonomous robot system with great
Unit 2B Gilray Road, Diss, Norfolk, Robo-Hoops 2004 at Penn State, capability. At this low cost, multiple
IP22 4EU, England Abingdon on December 4, 2004 robots can be used to cooperate
www.robot-electronics.co.uk www.ecsel.psu.edu and compete in a wide range of
experimental environments. SV
60 SERVO 02.2005
Full Page.qxd 1/5/2005 7:56 AM Page 61

"The resounding success of the 2004 conference


Profiting from the is an indication that there is a growing new market
1st New Industry for personal, service and mobile robotics. From its
academic and research nascency, robotics technology
of the 21st Century is moving into a number of diverse consumer and
business-to-business applications."
Colin Angle, Co-founder and Chief Executive Officer, iRobot

SECOND ANNUAL

Conference and Exposition


The Nation’s Premier Business Development Event
for Mobile Robotics and Intelligent Systems

May 10-11, 2005


Hyatt Regency Cambridge
Cambridge, MA
www.roboevent.com
Produced by: Premier Sponsor Corporate Sponsors

Media Sponsors

RoboticsTrends

Association Sponsors

SERVO 02.2005 61
Events.qxd 1/3/2005 3:54 PM Page 62

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

Have you been thinking about participating in the The design problem for this contest is new and
DARPA Grand Challenge this year? If so, don't forget that different each year. Check the website for the latest
February 11 is the deadline for teams to complete part one news and details.
of the five-part application process. Basic team information http://dc.cen.uiuc.edu/
and certification of funding must be completed by the 11th.
The deadline for the next part of the process is March 11th, 19-20 Manitoba Robot Games
when vehicle specifications and a video must be submitted. Manitoba Museum of Man and Nature,
If you're not up for the Grand Challenge, don't worry. Winnipeg, Manitoba, Canada
There are plenty of smaller robot events scheduled for the A variety of events, including sumo, a robot tractor
coming months. pull, and Atomic Hockey.
— R. Steven Rainwater www.scmb.mb.ca/

For last minute updates and changes, you can always find 24-27 ROBOlympics
the most recent version of the complete Robot Competition San Francisco State University, San Francisco, CA
FAQ at Robots.net: http://robots.net/rcfaq.html Lots of events, including sumo, BEAM, Mindstorms,
FIRA, and robot combat.
www.robolympics.net
F e b ru a r y 2 0 0 5
A p r il 2 0 0 5
4-6 Robotix
IIT Khargpur, West Bengal, India 9-10 Trinity College Fire Fighting Home Robot
Organized for students of IIT Khargpur, this Contest
contest includes events for both autonomous Trinity College, Hartford, CT
robots and radio-controlled machines. Could the fire have been set by a robot builder
www.robotixiitkgp.com/ frustrated with the voluminous rules?
www.trincoll.edu/events/robot
19 DPRG Table Top and Fire Fighting Competitions
The Science Place, Dallas, TX 12-14 DTU RoboCup
The DPRG is combining their spring Table Top Technical University of Denmark, Copenhagen,
robotics event with the regional Trinity Fire Fighting Denmark
Robot Competition this year. The Table Top contest Imagine your typical line following contest. Now
offers a variety of events for small autonomous add forks in the line, ramps, stairs, gaps in the line,
robots. shifts from indoor to outdoor lighting, reversals of
www.dprg.org/ the line shading (white to black), and 50 cm "gates"
though which the robot must pass.
www.iau.dtu.dk/robocup/about_robocup.html
March 2005
15 Carnegie Mellon Mobot Races
6-10 APEC Micromouse Contest Wean Hall, CMU, Pittsburgh, PA
Hilton Hotel, Austin, TX The traditional Mobot slalom and MoboJoust
This will be the 18th annual APEC Micromouse event. events.
www.apec-conf.org/ www.cs.cmu.edu/~mobot/

11-12 AMD Jerry Sanders 16 UC Davis Picnic Day Micromouse Contest


Creative Design Contest University of California at Davis, CA
University of Illinois at Urbana-Champaign, IL Every year, UC-Davis has a campus-wide event

62 SERVO 02.2005
Events.qxd 1/5/2005 12:02 PM Page 63

Machine It Yourself &


Save...Guaranteed!
Tired of PAYING for Machining?
Put a COMPLETE
MACHINE
THOUSANDS OF ELECTRONIC
SHOP PA R T S A N D S U P P L I E S
on Your VISIT OUR ONLINE STORE AT
Bench Top! www.allelectronics.com
WALL TRANSFORMERS, ALARMS,
Now 7 FUSES, CABLE TIES, RELAYS, OPTO
known as Picnic Day. Every Models! ELECTRONICS, KNOBS, VIDEO
Picnic Day includes the annual ACCESSORIES, SIRENS, SOLDER
• 3 Tools in 1 – Lathe, Mill Drill ACCESSORIES, MOTORS, DIODES,
micromouse contest. The • Versatile – Machine Metals, Plastic, More HEAT SINKS, CAPACITORS, CHOKES,
event follows standard micro- • Precise – Built to tolerances up to TOOLS, FASTENERS, TERMINAL
mouse rules. 0.0005 inc h
STRIPS, CRIMP CONNECTORS,
• CNC Compatible – Models ma nu factured
w w w. e c e . u c d av i s . e d u / to easily adapt CNC systems L.E.D.S., DISPLAYS, FANS, BREAD-
umouse/ • EASY to Use – Full Instructions & BOARDS, RESISTORS, SOLAR CELLS,
Lifetime Tech Support BUZZERS, BATTERIES, MAGNETS,
23 RoboFest And ONLY the Smithy is... CAMERAS, DC-DC CONVERTERS,
• GUARANTEED to Pay for Itself or HEADPHONES, LAMPS, PANEL
Lawrence Technological Your Money Back! METERS, SWITCHES, SPEAKERS,
University, Southfield, MI Get Your FREE FACT KIT! PELTIER DEVICES, and much more....
A competition and exhibition
of autonomous LEGO robots.
Call Today O R D E R TO L L F R E E
Designed to spur students’ 1-80 0-476-4849
Ask for operator SER 1-800-826-5432
interest in science, engineer-
Ask for our FREE 96 page catalog
ing, programming, and tech-
nology.
http://robofest.net/
Robotics Showcase
27-29 Singapore Robotic Games
Republic of Singapore
An amazing assortment of
events, including pole balanc-
ing, legged robot obstacle
course, legged robot
marathon race, wall climbing
robot race, micromouse,
sumo, robot soccer, robot
gladiator competition, and
the robot colony competition.
http://guppy.mpe.nus.edu.
sg/srg/

M ay 2 0 0 5
10-11 RoboBusiness Conference
Hyatt Regency, Cambridge,
MA
The nation’s premier business
development event for
mobile robotics and intelli-
gent systems, dedicated to
commercialization and appli-
cation of robotic systems.
www.roboevent.com

SERVO 02.2005 63
Robytes.qxd 1/4/2005 12:54 PM Page 64

Robytes by Jeff Eckert


everal weeks ago, shortly In a voyage that ran from the surface to relay its position and
S before Godzilla’s induction to
the Hollywood Walk of Fame
September 11 until early November of
last year, an underwater robot traveled
information about ocean conditions
such as temperature, salinity, and pres-
(coincidence?), Dave Calkins from about 100 miles south of sure via satellite back to the home base.
disappeared, leaving behind only a Nantucket Island, MA, to Bermuda. In theory, Spray has a range of
box of LEGOs, a blown-out pair of Developed by scientists at the Scripps 6,000 km (3,500 mi), which would
K-Mart headphones, and half a Institution of Oceanography (at the allow it to cross the Atlantic Ocean. This
case of Guiness. Sensing the University of California, San Diego) means that it can remain at sea for
gravity of the moment, the SERVO and the Woods Hole Oceanographic months, allowing scientists to observe
Institution, with support from the large-scale changes in the ocean
staff shifted into emergency mode
Office of Naval Research, the “Spray” environment that might otherwise not
and promptly drank the remaining
autonomous underwater vehicle be detected. The vision is to build a fleet
stout. Later, possibly still under the
(AUV) is a 6 ft long ocean glider with of AUVs that can be equipped with cus-
influence, they recruited me to fill
a 4 ft wingspan. tomized arrays of sensors that measure
in for Dave. To submit related press
A perceptive reader will note that such things as dissolved oxygen, carbon
releases and news items, please
no external means of propulsion is dioxide, alkalinity, salinity, turbidity, and
visit www.jkeckert.com And good
visible and, in fact, it needs none. nutrients in the water. For details, visit
luck, Dave, wherever you are. Spray glides up and down through the spray.ucsd.edu
— Jeff Eckert water on a preprogrammed course by
pumping mineral oil between two
AUV Travels from Woods bladders, one inside the aluminum hull
and the other outside. This changes
Robo Dog Gets Video
Hole to Bermuda the volume of the glider, making it Capability
denser or lighter than the surrounding
water and the vehicle floats up and
sinks down while using its wings to
provide lift and forward motion.
Batteries power buoyancy change,
onboard computers, and other electron-
ics. In a typical cycle, it might descend
The Spray ocean glider. 1,000 m (3,300 ft) and travel 5 km (3
Photo courtesy of Scripps mi) laterally in about 10 hrs. Between
Institution of Oceanography. cycles, it spends about 15 minutes on

The Spray ocean glider. Photo courtesy of Scripps Institution of Oceanography.

The AIBO®.
Courtesy of Sony Corp.

So let’s say you’re planning a


romantic evening with Paris Hilton.
You’ve actually taken a shower, put
on something nicer than the stained
cut-offs and Budweiser-soaked Elvis
T-shirt, and slid something in the oven
that doesn’t say “Hungry Man” on it.
The game plan includes candles, soft
music, and a box of fine sangria. It
suddenly occurs to you: there’s no one
to hold the video camera to prove to
your friends that you are capable of
finding a date!

64 SERVO 02.2005
Robytes.qxd 1/3/2005 2:52 PM Page 65

Robytes

Never fear! The latest upgrade to Swarm Intelligence by the IEEE Computational Intelligence
Sony’s AIBO® canine robot includes — Symposium Scheduled for Society, the IEEE Communications
among less important things — video Society, and the IEEE Robotics and
recording capabilities. Using a combi-
June Automation Society, with cooperation
nation of the new AIBO Entertainment A perpetual objective in robotic from the Jet Propulsion Laboratory, it
Player (AEP) and AIBO MIND 2 (a soft- technology has been to expand on will, “focus primarily on theoretical
ware application on 32 MB Memory the machines’ ability to operate foundations of swarm intelligence,
Stick® media), you can actually choose autonomously. However, if your inter- models and analysis of collective
among several customized recording ests lie with the little insect-like robots, behavior in natural societies, and
modes — continuous, time lapsed, you may instead be thinking in terms design, control, and optimization of
motion-activated, and sound-activated. of how large numbers of extremely collective artificial systems based on
The MIND 2 upgrade is available simple “bugbots” might interact to principles of swarm intelligence.”
to existing AIBO owners for about solve complex problems, much like There will also be two panel discus-
$100.00. If you don’t already have the swarms of virtually brainless creatures sions focused on, “growing commercial
digital dog, you can buy him for about in nature somehow pool their mental interests in swarm intelligence applica-
$1,900.00. resources to build sophisticated nests, tions and research funding opportunities
And, yes, he responds to voice com- coordinate mass migrations, establish in government.” (Translation: How to
mands, dances, plays digital music files, schemes for division of labor, and find sell this stuff to industry and suck up
and so forth. I can’t help but wonder, their ways to *NSYNC concerts. more federal bucks.) Participants will
though. If AIBO lifts his leg, do drained If so, check out the 2005 IEEE also have an opportunity to tour the Jet
batteries come out? The answer may be Swarm Intelligence Symposium, sched- Propulsion Lab. For more information,
available at www.sonystyle.com uled for June 8-10, 2005 at the Westin visit www.ieeeswarm.org SV
Hotel in Pasadena, CA. Co-sponsored

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 #94 on the Reader Service Card.
SERVO 02.2005 65
MrRoboto.qxd 1/3/2005 2:56 PM Page 66

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 was wondering if Lithium Ion or Ni-MH cell phone


batteries are of any use to power robots?

— Marcu Knoesen
South Africa
built into them to limit charging and discharging rates. You
should use these circuits if you use these batteries.
Most Lithium Ion cell phone batteries have a 3.6 volt
output and some have a 7.2 volt output. Ni-MH cell phone
batteries have a wider variety of voltages: 4.8, 6.0, 7.2, and
9.6 volts. This requires you to use some sort of a voltage

A .Cell phone batteries happen to be a rather popular


choice for powering smaller-sized robots because of
their size and higher energy densities when compared
to Ni-Cd and Alkaline batteries. Many times, these batteries
are taken apart and their sub-cells are placed in robots that
regulator/conditioner to supply the proper voltage to your
robot’s electronics. To get a good idea on how many
different types of cell phone batteries there are, just visit
eBatts.com (www.ebatts.com). They sell hundreds of differ-
ent cell phone batteries and they also provide a set of simple
fit in the palm of your hand. specifications for the batteries.
First off, you need to determine if the batteries work The main drawback to using cell phone batteries is that
properly. Most cell phones are discarded because their you will have to make a custom battery holder for them
batteries no longer hold a good charge. Lithium Ion batteries because the batteries are designed to fit inside specific cell
are very poplar (to the manufacturing community) because phones. They don’t have any simple physical attachment
of their smaller size and the fact that they have a finite shelf points or electrical connections. You can take them apart to
life of around 2 to 3 years. get to the core battery, but they are still difficult to work with
Ni-MH batteries are more durable than Lithium Ion because they won’t fit in traditional battery holders.
batteries, but they are larger and heavier. These batteries Though cell phone batteries may be difficult to use,
can tolerate heavy current drains and can tolerate rapid they do make good batteries for the smaller-sized robots,
recharging better than Lithium Ion batteries. Lithium Ion especially when they are disassembled and placed inside the
batteries require special charging circuits to safely charge. robot’s small compartments.
Most Lithium Ion cell phone batteries have special circuits

Thickness

1/24” (0.042”)
1/16” (0.062”)
oz/in2

0.267
0.394
gm/cm2

1.173
1.731
10 cm Mini
Sumo
117
173
20 cm 3 kg
Sumo
469
692
Part No. for a 12”
square sheet
9032K111
9032K112
Q .I saw a couple of people
cutting lead sheets to make
weights for their mini sumo
robots at last year’s PDXBot. What I
really liked about this was that it was
3/32” (0.094”) 0.597 2.623 262 1,049 9032K113 a large sheet and it was custom-cut to
shape with scissors. Do you know
1/8” (0.125”) 0.794 3.489 349 1,396 9032K114 where I can get this stuff?
3/16” (0.188”) 1.194 5.246 524 2,098 9032K115 — Josh
Portland, OR
1/4” (0.25”) 1.588 6.978 698 2,791 9032K116

66
1/2” (0.50”) 3.176 13.955 1,396 5,582 9032K117

Table 1. Available lead sheets from McMaster Carr and their impact on sumo robots.
SERVO 02.2005
A .I like to use these lead sheets in
my sumo robots. This stuff is
pretty amazing and easy to
MrRoboto.qxd 1/5/2005 9:42 AM Page 67

work with. Table 1 shows a list of different thicknesses that


are available from McMaster Carr (www.mcmaster.com),
along with masses per unit area in English and Metric units.
The table also includes a couple of columns that give an idea
on how a single layer of the lead will increase the weight of
the sumo robot if the sheet covered the maximum area of
the robot. Lead’s density of 6.352 oz/in3 (10.99 gm/cm3)
makes it an ideal material for adding weight to a sumo
robot.
I purchased a 12” square piece of the 1/24” thickness
for $5.99 several years ago and I am still using it for my
robots. These sheets can be purchased for sizes from 12”
square up to 4’ x 6’. The thinner sheets (1/8” or less) can
easily be cut with regular scissors, the 1/8” to 1/4” thick
sheets can be easily cut with tin shears, and you will
probably want to use a saw to cut the 1/2” thick sheets. This Figure 1. Cutting out lead to make a disk to fit inside
lead can be cut, drilled, bent, folded, and twisted to fit any a mini sumo wheel.
opening inside your robot. For fine-tuning, an X-acto knife
can clean things up. Thickness Ounces Grams
While writing this, a really cool idea came to mind.
1/24” (0.042”) 1.059 30.0
Why not use these lead sheets to make disks that fit inside
the popular mini sumo wheels that most people are using? 1/16” (0.062”) 1.563 44.3
There is a recess that is about 0.10” deep on both sides of 3/32” (0.094”) 2.370 67.2
these wheels. Filling this recess with lead can greatly
increase the weight of the mini sumo and put all the Table 2. Mini sumo wheel weight changes due to adding
weight where it counts the most — on the wheel that is lead disks to their insides.
in contact with the sumo ring, which helps to improve
traction. circuit using a BASIC Stamp 2 from Parallax (www.parallax
Table 2 shows the weight impact of using three of the .com) that I use and it works quite well. The program
different lead sheet thicknesses and Figure 1 shows a photo listing shown in Listing 1 is what I use for controlling the
of the disks being made. Double these values when placing directions of the motors. There’s not much to it.
them on the inside of both mini sumo wheels. Depending Now, with that said, you need to be aware that the
on how much weight you need to reach the maximum L293D does transmit current back to the Stamp through the
weight, you could use different thicknesses or you could input lines when the motor directions are suddenly changed.
make smaller diameter disks. What makes this approach I have measured voltage spikes when there shouldn’t be any.
attractive is that it doesn’t take up any space inside the Every now and then, the Stamp would reset. I don’t know if
robot body and it is out of the way of any maintenance the resetting was due to the voltage spikes or a drop in the
operations.
Figure 2. Motor direction control using an L293D and a BASIC Stamp.

Q .I’ve been think- +5V

ing of using the


L293D H-bridge Vdd 3
IC to control two DC 4
motors for both forward 5
and reverse. Will a
ENABLE 1
BASIC Stamp be able to 0 +V LOGIC
BASIC
drive the IC without any STAMP INPUT 1 INPUT 4
1
other components? Will 2
OUTPUT 1 OUTPUT 4
I be able to go straight 2

from an I/O pin to an 15


input of the L283D? MOTOR GN L293D GN MOTOR

— John Ringenary 470 ohm OUTPUT 2 OUTPUT 3

via Internet Vcc


INPUT 2 INPUT 3

A .The short answer


is yes. Figure 2
shows a simple
+V MOTOR
ENABLE 2

SERVO 02.2005 67
MrRoboto.qxd 1/4/2005 4:50 PM Page 68

voltage supply to the Stamp (yes, the voltage supply to shown up when I take the Enable line low prior to any
the motor was a different source). This problem has never motor direction change and then take it high after the motor
direction has been set.
Listing 1 I have never heard of anyone damaging their
Stamps when using the L293D, but you should be
‘ {$STAMP BS2} aware that it might happen. If you are really concerned
‘ L293D Motor Control Demonstration Program
about protecting your BASIC Stamp, then you
M1_Enable CON 0 ‘ Motor 1 Enable pin, pin 1 on L293D should consider using an Optical Isolator circuit between
M1_Pin1 CON 1 ‘ Motor 1 Input 1, pin 2 on L293D the Stamp’s I/O lines and the L293D. Figure 3 shows
M1_Pin2 CON 2 ‘ Motor 1 Input 2, pin 7 on L293D
M2_Enable CON 3 ‘ Motor 2 Enable pin, pin 9 on L293D
how to do this. Again, I have used the L293D to
M2_Pin1 CON 4 ‘ Motor 2 Input 3, pin 10 on L293D drive small motors for years by directly attaching them
M2_Pin2 CON 5 ‘ Motor 2 Input 4, pin 15 on L293D to my BASIC Stamps and have never damaged them.
HIGH 15 ‘ LED to show that the Stamp to

Q
‘ indicate that the Stamp is on
Init: ‘ Put the motors in a known state .The latest listing of popular gear motors for
GOSUB M1_Stop robotics use was interesting. However, can
GOSUB M2_Stop someone address the issue of units on torque?
Main: ‘ Cycle the motors, forward, reverse, Specifically:
GOSUB M1_Fwd ‘ and stop
GOSUB M2_Rev 1. I’m assuming 1 in/lb torque rating means that it
PAUSE 2000
GOSUB M1_Rev
should be able to lift 1 lb if suspended from a string
GOSUB M2_Fwd wrapped around a pulley 1” in radius. Is that correct?
PAUSE 2000
GOSUB M1_Stop 2. If that is true, is 1 ft/lb = 16*12 oz/in? Obviously, an
GOSUB M2_Stop
PAUSE 2000 oz/in would be much less than a ft/lb, but what’s the
GOTO Main proper conversion factor?

M1_Fwd: ‘ Motor 1 Forward 3. Can you give a decent rule of thumb for how
LOW M1_Enable ‘ Disable Motor before changing directions
HIGH M1_Pin1 much torque is needed for a given robot? Glossing over
LOW M1_Pin2 friction, if I have a 3” diameter wheel on a 6 lb robot and
HIGH M1_Enable ‘ Enable motor to move forward I want it to be able to go over “small” bumps (1/4” or
RETURN less and handle carpet), what torque range would be
M1_Rev: ‘ Motor 1 Reverse reasonable?
LOW M1_Enable
LOW M1_Pin1 Assuming I have two drive wheels and a third castor,
HIGH M1_Pin2
HIGH M1_Enable
I could take a wild guess that each wheel supports
RETURN approximately 2 lbs (more or less). If torque is force x
distance, would I want 3 in/lbs (1.5” radius x 2 lbs dead
M1_Stop: ‘ Motor 1 Stop lift) in each of the drive motors?
LOW M1_Enable
LOW M1_Pin1 I’m guessing the real world isn’t nearly that easy to
LOW M1_Pin2 quantify. So, again, is there a simple rule of thumb for
RETURN how much torque is needed?
— John M.
M2_Fwd: ‘ Motor 2 Forward
LOW M2_Enable via Internet
HIGH M2_Pin1

A .Your understanding for torque is correct.


LOW M2_Pin2
HIGH M2_Enable
RETURN
Technically, torque is defined as the movement
created by a force acting on a body where the
M2_Rev: ‘ Motor 2 Reverse perpendicular distance between the line action of
LOW M2_Enable the applied force and the center of rotation is
LOW M2_Pin1
HIGH M2_Pin2 multiplied by the perpendicular component of the
HIGH M2_Enable applied force. When it comes to wheels (or pulleys), it is
RETURN simplified to force multiplied by the distance of the axle
(in this, case the wheel/pulley radius) to the applied
M2_Stop: ‘ Motor 2 Stop
LOW M2_Enable force.
LOW M2_Pin1 The unit of torque is force multiplied by distance —
LOW M2_Pin2 such as ounces, pounds, and newtons — multiplied by
RETURN
inches, feet, centimeters, and meters. Many times,
68 SERVO 02.2005
MrRoboto.qxd 1/4/2005 10:27 PM Page 69

motor torque is represented as gram-


+5V L293D POWER
centimeter and kilogram-centimeter.
Though technically incorrect, since it is a
mass multiplied by distance (as opposed to
the proper force multiplied by distance), it is 1K

commonly used because converting these


numbers to newton-meter yields a very
large number. STAMP I/O PIN
Table 3 is a conversion table that will 1K

help convert the units of torque from one


system to another. For example, to convert a
L293D LOGIC PIN
5 kg-cm torque motor into inch-pound,
multiply the 5 by 0.8680 (the number under GENERIC
the in-lb column that intersects the same row OPTICAL ISOLATOR
i.e. PS2501-2
as the kg-cm) to get 4.34 in-lb.
Estimating how much torque you will
need for your robot to move always proves
STAMP GROUND
to be more challenging than you think. L293D GROUND

First off, any wheeled vehicle must have


friction to move. Without friction, the Figure 3. Optical isolation circuit.
wheels will just spin in place. The first thing
that you should decide on is whether you want the wheels required to go over a bump is a fairly complicated process
to stall if the robot runs into an immovable object. If you and a good understanding of physics is needed, but here are
allow to wheels to stall, then the motor current draw will couple of general rules of thumb:
be at its maximum and chances of burning out the motors
and the motor controller are very likely. However, this 1. A wheel won’t self-drive over a bump whose height is
stall condition does tell you a lot about your robot’s more than 30% of the wheel radius. Self-drive means that
performance. the wheel is pulling itself over the bump.
Next, estimate how much weight will be on each wheel
(including casters). Your assumption of evenly dividing the 2. If the motor’s stall torque is greater than 70% of the
weight distribution across the wheels and caster is good to robot’s weight on that wheel multiplied by the wheel radius,
use for quick and dirty estimating. The next thing I like to then it will be able to drive over bumps with heights up to
do is assume that the coefficient of friction between the 30% of the wheel’s radius.
wheel and ground is 1.0. This simplifies the calculations
and, in most cases, it represents a worst case situation. A worst case torque estimate (robot weight divided
Thus, the stall motor torque will just be the robot’s weight by the number of wheels in contact with the ground and
on that wheel multiplied by the wheel radius. In your case, multiplied by the wheel’s radius) will enable the robot to go
the 3 in-lbs (1.5” wheel radius x 2 lbs dead lift) is a good over rough terrain. A lower motor stall torque will still
estimate. allow a robot to move around, but smaller bumps will be
Now, if you chose a motor that had a greater stall able to stop the robot much more easily. The motor specs
torque than this, then the wheels will spin if the robot ran shown in the November 2004 issue of SERVO Magazine
into an immovable object. Keep in mind that, as long as the represent the stall torque. If you need more stall torque from
wheels are spinning, you will not be drawing the maximum a motor, then you will have to increase the applied voltage
motor current. Having a motor with more torque than to the motor. SV
this does not improve its pushing ability
or how well it will move, other than oz-in in-lb ft-lb g-cm kg-cm N-m
accelerating faster.
Now, if the motor’s stall torque is oz-in 1 0.0625 0.0052 72.008 0.0720 0.0071
less than this, you will probably stall the
in-lb 16 1 0.0833 1152.1 1.152 0.1130
motors when your robot runs into some-
thing. Remember, all robots will move ft-lb 192 12 1 13826 13.826 1.3558
just fine along flat, smooth surfaces
with motors whose stall torques are g-cm 0.0139 0.0009 0.00007 1 0.001 0.0001
significantly less than the wheel stall
kg-cm 13.887 0.8680 0.0723 1000 1 0.0981
torque described here. I personally use
this as my rule of thumb for sizing N-m 141.61 8.8507 0.7376 10197 10.197 1
motors.
Estimating how much torque is Table 3. Torque unit conversion factors.
SERVO 02.2005 69
BookstoreFeb05.qxd 1/4/2005 1:02 PM Page 70

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 things, even making it
Light Saber. This book makes creating these
• 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
70 SERVO 02.2005
BookstoreFeb05.qxd 1/5/2005 8:10 AM Page 71

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 JunkBots, Bugbots, and Bots on
updated and revised to include detailed professionals will treasure Wheels: Building Simple Robots
directions on using both versions of the this unique and distinctive With BEAM Technology
microcontroller, with no-nonsense sourcebook — the most by Dave Hrynkiw / Mark W. Tilden
recommendations on which one serves thorough — and thoroughly From the publishers of
better in different situations.$29.95 explained — compendium BattleBots: The Official
of robot mechanisms and Guide comes this do-it-
devices ever assembled. yourself guide to BEAM
Robot Builder's Sourcebook Written and illustrated (Biology, Electronics,
by Gordon McComb specifically for people fascinated with Aesthetics, Mechanics)
Fascinated by the world mobile robots, Robot Mechanisms and robots. They're cheap,
of robotics, but don’t !
know how to tap into the
Mechanical Devices Illustrated offers a
one-stop source of everything needed for the
simple, and can be built
by beginners in just a few
NEW
incredible amount of mechanical design of state-of-the-art mobile hours, with help from this expert guide
information available on ‘bots. $39.95 complete with full-color photos. Get ready
the subject? Clueless as to
for some dumpster-diving! $24.99
locating specific
information on robotics? Machine Nature: The Coming
Want the names, addresses, Age of Bio-Inspired Computing
phone numbers, and websites of companies by Moshe Sipper LINUX Robotics: Programming
that can supply the exact part, plan, kit, Despite being marvels of Smarter Robots
building material, programming language, complexity and human by D. Jay Newman
operating system, computer system, or ingenuity, computers are Robotics is becoming an
publication you’ve been searching for? Turn notoriously bad at increasingly popular field
to the Robot Builder’s Sourcebook — a learning new things and for hobbyists and profes-
unique clearinghouse of information that will dealing with new sionals alike. The cost of
open 2,500+ new doors and spark almost as situations. Researchers the mechanics and
many new ideas. $24.95 at the frontiers of electronics required to
computer science have build a robot are low rder
turned to nature for enough that almost P r e - OW !
N O
Robotics Demystified solutions to the anyone can afford it. The
by Edwin Wise problem of machine hardware that used to require government
There's no easier, faster, adaptation and learning. By applying models funding or a large university grant is
or more practical way to of complex biological systems to the realm now available to the average person. At the
learn the really tough of computing machines, they have given rise same time, programming is becoming a
subjects. McGraw-Hill's to a new breed of adaptive software and common skill. This book combines the
Demystified titles are hardware. In Machine Nature, computer most sophisticated parts of robotics and
the most efficient, scientist Moshe Sipper takes readers on a programming to fill a real gap in available
intriguingly written thrilling journey to the terra nova of computing information. Most robotics books today use
brush-ups you can find. to provide a compelling look at cutting-edge microcontrollers as the “brains” of the
Organized as self- computers, robots, and machines now and robots. This approach is fine for smaller,
teaching guides, they in the decades ahead. $24.95 less expensive projects, but has serious
come complete with key points, background limitations. When attempting to build
information, questions for each chapter, and a robot with sophisticated movements,
even final exams. You'll be able to learn more Check out our online bookstore at navigation, vision, and picture-capturing
in less time, evaluate your strengths and www.servomagazine.com for a complete abilities, it is better to use Linux as the
weaknesses, and reinforce your knowledge listing of all the books that are available. controller. This book is available for
and confidence. $19.95 sale February 15, 2005. $34.95
SERVO 02.2005 71
LessonsFromTheLab.qxd 1/4/2005 10:16 PM Page 72

// castling bonuses
B8 castleRates[]={-40,-35,-30,0,5}; A
bi-month

LESSONS
column ju ly
//center weighting array to make pieces prefer
//the center of the board during the rating routine
B8 center[]={0,0,1,2,3,3,2,1,0,0}; st for
//directions: orthogonal, diagonal, and left/right
kids!
from orthogonal for knight moves

FROM THE
B8 directions[]={-1,1,-10,10,-11,-9,11,9,10,-10,1,-
1};

//direction pointers for each piece (only really for


bishop rook and queen
B8 dirFrom[]={0,0,0,4,0,0};
B8 dirTo[]={0,0,0,8,4,8};

LABORATORY
//Good moves from the current search are stored in
this array
//so we can recognize them while searching and make
sure they are tested first

— PART 7 —
The Final Spex Check by James Isom

W hen we last left “The Spectacles”


from the San Rafael Community
Center, it was mid-October and they
design and then take a look at how
they addressed some of the challenges.
flaw in that it couldn’t go straight for
long. This can be a problem with LEGO
robotics; a weak motor, a lack of sym-
were preparing for their FIRST LEGO Changing the Specs metry, or a mistake in programming
League (FLL) local tournament. As I on Spex can cause your robot to drift off course.
write this, almost two months have As fate would have it, Spex quickly
passed, their first local tournament has In any competition where there are became Spex 1.0-CrisisBot and a mas-
come and gone, and a lot has changed objectives in fixed locations, it is impor- sive change to the design took place
in both their strategy and the overall tant for a robot to hit its mark — to be just after the last article went to press.
robot design. able to go where you need it to reliably So, the boys from team #8 would
Before I let you know how they did without error. The Spectacles were very like to say, “Thanks for building our
in their tournament, let’s take a look at excited with their new “uber chassis” robot from the last article, but we
some of the ideas and strategies they that they called “Spex” (profiled in the didn’t end up using it. Sorry.” For infor-
had during the course of this season. December 2004 issue of SERVO). mation on how to build their new
We’ll start with a recap of their robot Alas, their design had one fatal design, please go to their website at

Some of the team analyzing the problem with Spex 1.0. A couple of Spex 2.0 chassis without the RCX.

72 SERVO 02.2005
LessonsFromTheLab.qxd 1/3/2005 3:40 PM Page 73

http://robotics.megagiant.com/fll/
The new design — Spex 2.0 — is a
wider robot that has four wheels
instead of three; more importantly, it
can hit its mark quickly and accurately.
To best describe Spex 2.0, I give
you the words of one of its designers —
Greg: “Our newest chassis has less
than half of the pieces of Walker’s Spex
1.0. This chassis was designed on the
theory that a new bot should have easily The motors were tested in a small jig made from a few bricks and a rotation sensor.
removable motors in case one motor We could then review the graph of how many rotations each motor made over
began to spin slower than another. This 5 seconds and match the motors with the closest values.
was a problem we had with Spex 1.0 in
that, despite its overall symmetry, it still objective. The outcome was five work into the white ring in the center of the
couldn’t drive in a straight line. groups, each of which were assigned one basket.
“In previous seasons, we have used or more of the nine challenge objectives.
a rotation sensor to measure the Work groups were comprised of 2. CD and Glasses — Move the CD from
amount of rotations a motor spins over one to three team members each and its holder into the CD case area of the
a certain number of seconds. We use were responsible for the building and playing field and return to base with
the RCX data logging feature along with programming of their chosen objec- the glasses.
Robolab Investigator to make a graph of tives. As you will soon see, some of the
the motor speeds so that we could find objectives were completed quickly and 3. Bus Stops — Knock down the white
matching motors. The removable motor yet others dogged the team all the way bus stop sign without knocking over
idea proved to be a good one and this into their first competition. either of the red signs.
chassis will be used at the competition.”
With the chassis crisis over, the team The Challenges 4. Cereal Delivery — Deliver the cereal
found itself in mid-October without a to the table.
solid strategy for the game. The team The FLL challenge is comprised of
organized itself into work groups. Each three or more rounds that are 2-1/2 min- 5. Pet Food Delivery — Open the gate
of these groups replicates the chosen utes long. Most challenges consist of and get to the top of the stairs.
chassis design for use in developing objectives that deliver an object to or
their part of the overall game strategy. from a place on the playing field. Each For more information on this year’s
Formulating a strategy is tricky; it round, the robot starts from within the challenge, visit www.firstlegoleague.
takes careful planning and methodical base — a square in one corner of the org
execution to combine the nine objectives playing field. While in base, teams are
of this year’s challenge into the five pro- allowed to touch their robots, change Play Ball
grams the RCX can hold. They will only attachments, and run different pro-
be able to use one robot at the competi- grams. Once the robot leaves base, the This was chosen as the first objective
tion, so they spend quite a bit of time team is not allowed to touch it without because getting the ball in the center
during chassis development making sure incurring a penalty. The playing field ring is worth 50 points (the highest
there are ample places to connect their itself is a 4’ x 8’ rectangle.
attachments for each objective. A major Two teams compete at the FIRST LEGO League Challenge 2004 — “No Limits.”
design change in the middle of objective same time in two back-to-
development can throw the team into back playing fields with one
serious turmoil: a lesson learned from shared objective. This year,
past seasons. Their goal is to reach the it’s “Play Ball” — a basket
end of the season and have each group’s straddles the field edge. The
attachment connect perfectly with the Spectacles’ strategy for the
chassis through this common interface. 2004 challenge was organ-
Once the work groups completed ized by program number and
their individual chassis, the team sat execution order and was:
down and plotted out the likely order in
which they wanted to complete each 1. Play Ball — Deliver a ball

SERVO 02.2005 73
LessonsFromTheLab.qxd 1/3/2005 3:42 PM Page 74

basket with balls; additional balls on


your side of the basket are worth five
points each at the end of the round.
The strategy was to run the program
until the ball was placed in the center
and then continue on to other objec-
tives, returning to it for additional ball
drops at the end of the round, as time
permitted.

Strengths:
1. Simple mechanism.

2. Simple program.

3. Fast.

4. Repeatable.
The genius of the Play Ball block diagram is in its simplicity.
Weaknesses:
individual point value of the challenge) axle and a touch sensor served as 1. Not always accurate. Slamming into
and, since there is only enough room the trigger. A couple of well-placed the basket to drop off the ball can
for one ball in the center ring, our team rubberbands provided tension to the cause problems when dropping the
wanted to be there first. This one came mechanism, allowing it to return to its ball off or coming back to base.
pretty easy. original state after dropping the ball
Greg built a tower the height of off into the basket. 2. Takes time to attach and detach the
the basket with a lever mechanism The program for this objective is mechanism.
similar to something they had used in pretty simple. Go forward until you hit
previous seasons. It consisted of two the basket and then back up into base. CD and Glasses
axles running parallel to one another to This program could be repeated over
hold the ball in place while a vertical and over again as necessary to fill the The CD and Glasses team went
through a variety of ideas
The CD and Glasses block diagram is more complex. before settling in on their final
design. The objective is to
remove the CD from a holder
just outside of base and put it
into a graphic of a CD case a
short distance away on the
mat. This is followed by a
grasping maneuver on the
eyeglasses before the robot
returns to base.
Zach and Jake first built a
forklift that lifted the CD and
placed it on the CD case. This
particular design went
through several variations and
met with some success. Its
biggest drawback was that it
became difficult to control the
CD once it was lifted off the
holder. Sometimes, the CD
would get caught up and flip
off the forklift before they

74 SERVO 02.2005
LessonsFromTheLab.qxd 1/3/2005 3:43 PM Page 75

needed it to and, at other times, it


was difficult to slide the CD off
the forks once they reached the
drop point.
The second design addressed
this problem by wrapping a cage
around the forks to control the CD
more precisely. Despite its early
success, two things led to the
abandonment of this particular
design. First, it was slow; all that
lifting, dropping, and maneuvering
was taking up too much time.
Second, what about the glasses? The Bus Stop challenge presented some difficulties.
This one program had to accom-
plish both objectives in a single run and 2. Depending on the robot’s approach, designed to flip down the bus stop sign
— despite their best efforts — the boys there is a slight chance that the glasses is very simple, although it has gone
were having difficulty placing the forks can slip through the latch mechanism. through many radical changes.
into the eye holes of the glasses. “The flipper started as a long
Sometime during all this head Bus Stops beam with sliding pieces on the bot-
scratching, one of the team members tom and a rack gear on the top. A
floated the idea of popping the CD off Three bus stop signs sit in a line on motor with a 24-tooth gear would spin
the holder and onto the CD case. This top of one of the 2” x 4” edges that and push the beam outward when a
inspiration came from a wayward robot make up one side of the playing field. light sensor sensed white. It was
that had been maneuvering on the Two are red and the other is white. The placed on the top of the RCX. The sen-
field and accidentally ran into the CD, objective is to find the white bus stop sor was stuck on another long beam;
flipping it across the table. sign and knock it off its vertical default this one on the bottom of the robot. It
After several ideas were played position without knocking over either was placed just beyond the wheel, so
with, a sliding plow with two forks was of the red signs. The trick is that the the beam would have enough time to
settled upon. It worked pretty much white sign is placed in one of the three move outward and flip down the sign.
from the start, once a bit of tweaking positions randomly by a judge at the “This worked, but — after almost
to the program was done. To grasp the start of each round. To explain the never-ending problems with the sliding
glasses, Zach built a one-way latch mechanism used in this challenge, I beam system — I went to a much sim-
made from a rotating axle and lever. give to you the words of one of its pler and more reliable design: just a
He used a fixed pin that allowed the creators — Gabe: “The attachment I few beams stuck together to form a
glasses to enter the latch, but not
exit. His program was designed to Jake tackled the Food challenge.
simply run into the glasses hard
enough that they would be caught
behind the latch and carried back to
base.

Strengths:
1. Attaches and detaches quickly.

2. Simple, solid design that performs


both objectives well.

Weaknesses:
1. The program relies solely on timing
and doesn’t have any sensor feedback.
If the robot gets off course, it is off
course for the whole run. Saving the
off course robot can incur penalties.

SERVO 02.2005 75
LessonsFromTheLab.qxd 1/3/2005 3:45 PM Page 76

levels for each motor at 2 (the maxi-


mum is 5). This setting and the timing
provide just the right amount of
momentum to deliver the food to the
table without mishap.

Pet Food Delivery,


Gate, and Stairs
The team knew from day one that
this would be the most difficult of the
programs to complete. It involves three
Spex 2.0 in action at FLL. objectives and the most maneuvering
out of all the programs this season.
long lance. The lance was again stuck from the beginning and stayed with it The first of these three objectives is to
to the top of the RCX, but facing throughout the season. deliver food (three round LEGO pieces)
forward this time — the direction the The mechanism he designed is to a dog and a cat at the far end of the
robot was driving. similar to the one used in “Play Ball” in playing field.
“The robot would drive out of that there is a place to put the tray with These pets are enclosed in an area
base, far from the wall, and make a a trigger hanging below. The idea is surrounded by a stationary fence and a
right turn when it sensed the white to drive into the table and push the large gate. The gate itself is the second
sign, flipping it down with the lance as trigger lever in to drop the food off. objective in the sequence. For full
it turned. It then just drove straight The mechanism as a whole doesn’t points, the gate needs to be opened
back into base without hitting any bend very much — just enough to start completely so that a small latch catches
other signs. the bowl and tray to slide. The momen- the door. The final objective is to drive
“Once I had the final idea, it was tum of the food and tray, combined the robot off the playing field and onto
very easy to create a program around with the robot backing up, is just a set of steps. For full points, the robot
the attachment; it probably took about enough to gently slip the bowl and tray needs to be all the way on the top step
an hour. The final attachment and onto the table. at the end of the round.
program works very consistently and This did not come easily at first. The initial strategy was to build a
very well.” The tray would often get caught up on device similar to the mechanism used
a chair, resulting in the bowl of food in both the “Play Ball” and “Food
Strengths: sliding off the table and onto the floor. Delivery” objectives. The trigger mech-
1. Attaches and detaches quickly. The team eventually decided to anism was attached to the end of a
approach the table at an angle in order long assembly of axles and would run
2. Uses a light sensor to find the objec- to bypass the chair. into the fence and drop the food into
tive. More accurate than just using the pet food area.
timed steps. Strengths: The robot would then make a right
1. Attaches and detaches quickly. turn, slamming the axle assembly into
3. Simple and fast program. the gate door, popping it open, and
2. Simple and fast program. then back up and turn so that it could
Weaknesses: drive to the top of the stairs. All this
1. Occasionally overturns and runs into 3. Stable delivery mechanism. involved a lot of precision movement.
the table on its return trip due to the In order to get where the robot
high speed and width of the chassis. Weaknesses: needed to go, the team decided to use
1. Can easily get caught up on the a rotation sensor. A rotation sensor is a
Cereal Delivery chair or the table. bit like a measuring tape. You can
roll the robot to a destination, note
Just outside the base sits a small 2. If the forward momentum or the number of rotations it took, and
table surrounded by three chairs. The approach is even slightly off, the food program the robot accordingly. They
objective of this challenge is to deliver is thrown to the floor. would simply count the number of
a small tray of LEGO pieces (simulating rotations to each waypoint — in theory,
food) to the top of the table without If you are familiar with Robolab, that is.
spilling it. Jake took this one on almost you will notice that Jake set the power Unfortunately for the team, they

76 SERVO 02.2005
LessonsFromTheLab.qxd 1/3/2005 3:46 PM Page 77

were never able to get this one to work seasons. The competition consists first Best Robot Design Award. Team
the way they wanted it to. Their first of much more than just the game #8 from the San Rafael Community
problem was that the robot was just itself. There is a presentation to be Center finally made it to the state final
too fast to execute turns accurately. made and interviews with judges on competition.
This problem was made worse by the programming and robot design. I would just like to say, as a coach,
long axle assembly sticking out in front The team keeps a journal of their that FIRST LEGO League is a fantastic
of the robot that often acted as a large activity over the season. Each member program for 9 to 14 year olds. Join or
pendulum, swinging it around too far takes turns interviewing fellow team — better yet — start a team in your area
in the direction it was turning. members on their accomplishments today. You won’t regret it. You can go
On those occasions when it did and existing problems at the end of to www.firstlegoleague.org for
work and managed to move on to each practice session. Close to the com- details about next year’s challenge.
hitting the gate, the axle assembly petition day, they take this material and I would like to congratulate my
wasn’t heavy enough to open the gate. form it into a story board of sorts so team and also the rookie year girls’
To make matters worse, the axle that other teams, judges, and onlook- team from Miller Creek Middle School
assembly would get in the way as the ers can see what the team has been up that I helped mentor with eighth grade
robot attempted to climb the stairs. to during the competition season. science teacher Kim Asso. They made
Dozens of variations were devel- This year’s board was dominated it to the state tournament, as well.
oped and tested all the way up to the by their approaches to the challenges, Go RoboChicks!
day of the competition. The lack of along with information on all their The state tournament is looming. To
success with this approach at the chassis designs: Why they built them see how it all turns out, be sure to visit
competition put this idea to rest once and why they abandoned them. All the Spectacles at their website http:
and for all and the team actively began together, the team did an incredible //robotics.megagiant.com/fll/ SV
working on a new idea while there. amount of design and analysis this
However, these things take time and it
wasn’t quite ready to serve them con-
season and it surprised them when
they built this year’s board. AUTHOR BIO
sistently at the tournament. They are, At the Contra Costa local tourna- James Isom is a part-time robotics teacher
however, still working on a solution ment, they were amazed and awed at and general all-around geek. He
and will post the results of their labors some of the other solutions teams had has taught robotics to children and
to their website when it is finished. come up with. Overall, they played teachers in the US and abroad. His
the game well, coming in fifth overall: website with additional
The Tournament a personal best in their book. However, goodies (including the
where they really shined was in MLCAD file of this robot)
FLL competition day is always a big interviews with the judges. can be found at ww.the
day for the team. This is their third local All those problems that had roboticslab.com He can
competition. They have never made it cropped up and all that thinking and be reached at james
to the state competition in previous testing was enough to earn them their @megagiant.com

SERVO 02.2005 77
Geerhead.qxd 1/3/2005 3:22 PM Page 78

by David Geer
geercom@alltel.net

Paparazzi catches Koolio


taking a stroll. Notice the Koolio poses with creators
unassuming look on his face Brian Pietrodangelo and
and his casual style with Kevin Phillipson — three
cap and dreadlocks. buds just being Koolio.

Koolio — Hip Bot, Drink Haven, and Mobile Butler

oolio is a fully autonomous mobile expressions he can muster from books, no time to run down the hall
K bot with an ice-cold refrigerator
for innards. Brian Pietrodangelo and
beneath his long, black dreadlocks.
Koolio’s personality beams across a
to drop quarters in the machine, even
less time to run down the street for a
Kevin Phillipson, students in the 19” LCD monitor screen on which he six pack. What’s a college kid to do
Machine Intelligence Lab (MIL) at the can be programmed to smile, keep a when he or she needs a cold pop
University of Florida at Gainesville straight face, or demonstrate other or beer? Necessity — in this case,
created Koolio to service the third floor moods. perhaps desire — made invention its
of the school’s Benton Hall, where the offspring.
lab, classrooms, and professors’ offices What’s a Thirsty If you’re a college student and
are located. College Kid to Do? you get thirsty, it’s good to be
Not the least of Koolio’s impres- an engineering major, so say Brian
sive characteristics are the facial All that studying, glued to the and Kevin.
78 SERVO 02.2005
Geerhead.qxd 1/3/2005 3:25 PM Page 79

GEERHEAD

Koolio Illustrated Koolio can find his docking station


from anywhere on the third floor
Using Dr. Nechyba — Brian’s and and returns when he feels short on
Kevin’s professor in the Machine electricity.
Intelligence Lab at UF — as a sample
consumer, let’s walk through Koolio’s Koolio’s Fame and
routine on the third floor of Benton Future
Hall.
Let’s say Dr. Nechyba is chained to Koolio’s service to human
his desk with work. He can’t afford kind has not gone unnoticed or
to let it go long enough to get a pop unrewarded; this beverage-hauling
from down the hall. He has another bot has garnered loads of exposure
alternative. He logs on to the network from the press and tons of praise
via the computer at his desk and from a growing fan base. Why?
signals Koolio to bring him a pop. Everybody wants one! Someday,
Koolio hears via wireless card and they may get their wish.
responds. Koolio determines which The two academic roboticists
room houses the computer that the have a start-up company called
message came from. He leaves his RASTA Robotics — Robotic &
docking station and finds his way Automated Systems Technical
down the hall. This is done using a Associates. Though there are no
variety of sensing equipment. immediate plans to mass-produce
Koolio’s “sleeping on the dock of the
Upon delivering the pop to Dr. Koolio, the possibility is very much station, watching his eyes just roll away”
Nechyba, Koolio leaves to return to his alive. or something like that.
docking station. There, he recharges Kevin and Brian are on the
while waiting for his next request. look-out for companies ready to display floors of chains or outlets or
license Koolio and bring him to the to offer him up by some other
Neat Notion’s
Nitty-Gritty RESOURCES
Koolio is a mobile, fully The Koolio website — http://mil.ufl.edu/~brian/Koolio/Koolio.htm
autonomous bot that doles out drinks
or food to the third floor around the From the page above, you can go to a section for the press where you
clock and fills up on juice himself at his will find videos and information about Koolio.
own, private docking station.
Koolio hangs at his dock when The RASTA company website — www.rastarobotics.com with other
he’s not needed for anything, just
projects by Kevin and Brian.
kickin’ and taking in a jolt of volts.

TALKING TECH ON KOOLIO’S SPECS


Koolio may sound simple, but he algorithms to keep the control in the network.
is the result of careful, logical design, the Atmel chip simple. The CPLD is The fridge is a Koolmate40,
using the following hardware better equipped to handle big data which can carry 52 cans of pop or
and software. Koolio uses a Kontron and to do it fast. Left to itself, the beer. Sensors include a Sharp
Embedded PC/104+ Board for Atmel would be in over its head, GP2D12 IR distance measuring
onboard vision processing — detecting slowing performance. sensor, which detects ranges
objects and reading room numbers. Koolio, a big fan of open source between 10 and 80 cm, and a
The board controls the hosting code, runs the Red Hat Linux version Devantech SRF08 Ultrasonic Range
behind a local website that select 9.0 operating system. Other compo- Finder, which determines ranges
users can access. nents include a 266 MHz Pentium between 3 cm and 6 m. The bot
An Altera Max 3000 and Atmel MMX processor, 128 MB DRAM also employs a CMPS03 magnetic
Mega 128 chip make up Koolio’s (RAM), and a Cisco Aironet 350 compass. Its eye is a Creative Video
brains. The Altera CPLD uses VHDL wireless card to communicate with Blaster II web cam.

SERVO 02.2005 79
Geerhead.qxd 1/4/2005 12:51 PM Page 80

GEERHEAD

produced, you keep the larger


project much simpler.
By verifying the success of
each individual module, you
assure the success of the
whole. If something goes
wrong, you know which
module to deal with and you
only have to deal with that
module, often simply by
replacing it. This kind of
approach enables direct and
logical troubleshooting and
debugging.
Lesson two — practice
makes ... Koolio: Koolio was
the result of putting an
education in engineering
into practice. Getting your
hands dirty and actually con-
structing a project based on
Koolio is racing down the hall to answer your new-found knowledge,
someone’s call. Kind of reminds you of teaches you the practical
Batman answering the Bat Signal, except
that Batman wasn’t outfitted with a It’s bottoms up as we get a shot from the applications of what you have
Cisco wireless card. floor to the ceiling of Koolio and creators. learned.

means. Koolio could well follow in room for you to come to it. Adaptations
the footsteps of Roomba, serving
homeowners and fitting seamlessly Hello Class, My Name Koolio can serve schools, homes,
into their lifestyles. Is Professor Koolio offices, factory workers — you name
Koolio could go into the ad it. As long as he doesn’t face the
business, starring in commercials for What can we learn from the challenge of climbing stairs or similar
canned and bottled beverage compa- Koolio project? Lesson one — modular- obstacles, he’s good to go. Koolio
nies. He could also be distributed ity: By taking a look at the larger keeps you from being inconvenienced,
commercially as the new mobile project and breaking it up into waiting on you day and night as no real
Coke, Pepsi, or other beverage proposed modules or perhaps butler could do.
machine that comes to you instead of components that can be easily concep- Koolio may someday be used to
waiting down the hall or in the break tualized, understood, designed, and serve those who are sick or disabled,
as well. SV
WHAT YOU GET FROM GETTING INVOLVED
ABOUT THE INVENTOR
Book learning only goes so far. of electrical engineering.
You get an introduction to some- Every roboticist will commit Brian Pietrodangelo went on
thing, but you don’t necessarily errors now and then; what counts is
to at least two additional projects
become consumed by it. When you finding and correcting the source of
build your own robot, you are invest- those errors. The Machine after Koolio — an autonomous
ing yourself with the goal of success. Intelligence Lab at the University of submarine called the Subjugator —
By getting involved, you learn Florida provides a great deal of www.mil.ufl.edu/subjugator/ and
why analog technologies are still hands-on experience for its students. an independent contract for a
important, why circuits, electronics, It’s highly recommended that serious doctor in Tallahassee, FL.
power, resistors, capacitors, and roboticists find a club or engineering
Having graduated from the
inductors still matter. You learn why lab they can be a part of to get the
University of Florida, Brian intends
it’s important to know computer thrill of that hands-on activity in a
science, digital logic, and the gambit project they can relate to. to go to graduate school.

80 SERVO 02.2005
Appetizer.qxd 1/3/2005 1:21 PM Page 81

We Compete Because We’re


Programmed to Compete — and
That’s a Good Thing!
by Dave Calkins
lot of people ask me why I put on than yours. Or I want to have gotten a attention). For the record, my most basic
A robot events. Most presume it’s
to make money. (The sad truth is that I
better deal on it. At work, we all want
to make a bit more than the other guy,
goal on the first bot I built was to learn
PIC programming. However — like a
know of no event that actually makes work a bit less, and have a bit more great many bot builders — I arrogantly
money; it’s a question of how much power. It’s part of our competitive presumed that I could figure out the
money an organizer can afford to lose.) nature. Of course, to every rule there is basics. My real goal was to build a better
Event organizers put on robot events an exception, so I know that not every- mini sumo than the other ones I saw.
because they love robots. Certainly, one fits into the description above — but I had to study up on servos and
that isn’t the only reason, though. No, the great majority of humankind does. motors and gears — and learn that
most of us put on robot events because What does this have to do with (golly!) not all servos are created equally,
we love people — especially kids. robots? Darn it, Dave, your topics so I should buy the better ones. Then,
When it comes down to it, the wander more than a line follower with I learned that if I doubled the voltage I
people who enter their creations at a bad CDS cell! It has to do with robot put into a servo, I squared the power!
robot events do it because of an internal competitions! Competitions like Hey! This was neat! Soon, using a few
drive. Robot builders are pre- Tetsujin, for example. The prize money simple tricks — and burning out a few
programmed to want to come with was sweet and it was certainly a big PICs and servos — I had a really good
their robots. Like geese flying south for pull in getting people to enter; however, little robot.
the winter, we are driven by internal I’d bet that if the prize money had While a gift certificate from robot
programming. This programming been cut in half — or even by 90 store.com is a nice benefit, taking first
comes down to three basic points. percent — SERVO would have gotten place is a far better thing. In addition,
just as many entries. there’s nothing more humbling than
Competition Oh, yes, we would have! I talked spending a couple hundred dollars to
to all the competitors. Not one of them fly up to Seattle, only to get creamed
It’s more than the governing said that they came “for the money” as by a 12-year-old with his own home-
philosophy of capitalism and sports; it’s their first answer when asked why they made bot.
part of what makes us human — and were there. Oh, it was always number That, however, is why robot
ergo, one of the things that separates two or number three, but what they competitions have become so popular.
us from robots. One reason that I don’t all really craved was to be the best Most builders want to see how they
think robots will take over the world engineer at the show — the smartest measure up against their peers.
is that they’ll simply never be able ones on the block.
to emote on a level which includes As Tetsujin winner Alex Sulkowski Education
that form of competition. They may put it, “I often lack a specific, achievable
function on a level of survival, perhaps, goal and timeline to motivate me to A very close second to beating the
but not fear-based survival which complete my projects. Entering robot other guy is seeing what everyone else
inspires them to compete for space competitions provides this structure and is doing that’s new. I think that the
with us carbon types. But I digress. direction; in addition, it provides an best thing that came out of
We humans are arrogant crea- incentive, knowing that others will be ROBOlympics 2004 was seeing the
tures. We love to show-up the other struggling to solve the same problem.” jaws of US builders drop as they saw
guys. If I buy a car, I want my car to be I cut my chops building mini sumo Robo-One robots for the first time.
faster than yours. Or I want it to haul robots — the 500 gram ones (1.1 You can make that in your garage?
more stuff. Or be more fuel efficient pounds, if you haven’t been paying Yes, Virginia, do-it-yourself androids
SERVO 02.2005 81
Appetizer.qxd 1/3/2005 1:23 PM Page 82

really do exist. as we adults are. They have a much that I can schmooze my way into a
One of my favorite things about cleaner slate and, as such, don’t robotics job, but just because they
any robot competition is seeing all of have tiny subroutines going on in the seem to have much more in common
the new stuff that builders come up backs of their heads, telling them what with me and my wife. Our conversa-
with. Ted Larson and Bob Allen decided cannot be done. tions tend to last long into the night as
to see if they could top Dean Kamen by In judging for FIRST LEGO League, we discuss the future.
building Bender — a self-balancing I’m always amazed at the robots that And so it goes at robot events. The
robot similar to a Segway, only at kids build. When I look at some of the greatest success of competitions like
about a 1/100th of the cost. It does more radical designs, I tend to think ROBOlympics and Tetsujin is getting
the same thing as the more expensive about how it can’t work. I’ve clearly builders from two different robot classes
Segway, only they built it themselves. been programmed to restrict myself to to start talking (say a combat robot
Bob and Ted’s excellent robot was certain designs. However, the kids are builder and a Robo-One builder or a
the first of its kind — but now several good at hacking my internal software sumo robot creator and a Mindstorms
people have made similar bots (see and corrupting those old files. They do hacker). You’d be amazed at how
Francisco Lobo’s project in the July it by making wild designs that work — much they start learning from each
2004 issue of SERVO). things that I would never have thought other. Heck, they are amazed by how
I don’t think it would occur to up and things that many older bot much they learn from each other.
most people to just up and build a self- builders would not have tried. They
balancing, two-wheeled vehicle, but — also become the educators, while I Just Do It
upon seeing Bob and Ted’s — lots of become the student.
people’s mental light bulbs went off. Yeah, yeah, yeah — I’ve become a
The joy of education was transferred Social Programming sneaker billboard. But if you’re a robot
and our pre-programmed lust for knowl- builder and you haven’t gone to a robot
edge kicked in. Keeping in the spirit of No matter how geeky the builder competition, that needs to change!
the competitive sub-routine, Trevor is, we can’t just sit at home. The There is the “Events Calendar“ listing of
Blackwell went and built a self-balancing friends of most robot builders think robot events every month in SERVO.
unicycle! Sure, a lot of people would that we’re a little nutty. While they like Even if you’ve never built a robot
call all of the self-balancers copy-cats, playing with our creations, they just before, go to a show and get inspired.
but most of human knowledge is copy- don’t get the obsession. Compete against the people there.
cat data — just creatively re-applied. “It’s a great way to meet other You can build a better bot! Learn from
“Rubberbands and Bailing Wire” builders,” says Jack. It’s true; you don’t the people who show up. They are
author Jack Buffington likes to compete tend to meet too many robot builders your very best resource for building
because, “it allows me to try out new while shopping at the local strip mall. robots. Meet new people. You already
things without risking failure on a paid I think half of the friends I talk to have something in common!
project.” It also forces him to learn, as regularly are people I’ve met at robot Whether you go to a local monthly
it, “sets a deadline for trying out new events. Be it a small club meeting meeting with five guys showing off a
things. Without a deadline, I’m just not or a world-wide competition like half-completed robot or you fly to San
as motivated.” ROBOlympics, events for combat robots Francisco, CA, to see ROBOlympics,
Most of the real learning goes on or LEGO Mindstorms bots, the people I robot competitions are already in your
with the kids, of course, but not always meet at robot events are just more design. That database between your
in the way you might think. At a typical interesting and have more to offer than ears has far too many empty rows. Fill
show, just as many adults are inspired the ones I meet at the pub (which isn’t up your personal database and then
by the robots that kids design and build to knock hanging out at the pub — man put it to use.
as there are kids being inspired by does not live by bots alone). When we And then watch as my mini sumo
adults’ robots. Kids have the wonderful have guests for dinner these days, they kicks your mini sumo’s batteries to
privilege of not being as programmed tend to be robot builders. It’s not so the curb. SV

Advertiser Index
All Electronics Corp. ....................................63 Jameco ..........................................................83 Robotics Group, Inc. ....................................55
Anchor Optical Surplus ..............................21 Lemon Studios .............................................22 Rogue Robotics ..............................................7
APEC 2005/MicroMouse Contest ..............36 Lynxmotion, Inc. ...........................................45 Smithy.............................................................63
Net Media .......................................................2
Budget Robotics ...........................................56 Solutions Cubed ...........................................65
Parallax, Inc. ...................................Back Cover
CrustCrawler .................................................14 Sozbots..........................................................35
PCB123/PCBexpress ......................................3
E-Clec-Tech ....................................................15 Pololu Robotics & Electronics ....................44 Technological Arts .......................................59
Electronic Goldmine ....................................49 ROBOBusiness Conference & Expo ............61 Vantec ...........................................................39
Hobby Engineering ......................................13 ROBOlympics ...............................................77 Zagros Robotics ...........................................63

82 SERVO 02.2005
CoverInside.qxd 1/4/2005 9:42 PM Page 2

Remember when...
...electronics stores were stocked to the rafters

with every component imaginable and there was ALWAYS


a knowledgeable person there to help you?

Think those days are gone?


Well they’re not! 1-800-455-6119
You just need a little Jameco@Home.
Call for a FREE catalog today.

We have the electronic components and knowledgeable


Technical Support people who can help bring back the fun
in your electronics hobbies, inventions, and DIY projects.

Circle #60 on the Reader Service Card.


Be sure to visit our new website at Jameco @ Home
www.Jameco.com/nvb —where electronics is still fun!
Circle #32 on the Reader Service Card.
Cover.qxd 1/5/2005 4:20 PM Page 84

Vol. 3 No. 2
SERVO MAGAZINE
RECYCLABLE ROBOT SOFTWARE
February 2005

U.S. $5.50 CANADA $9.25


0 2>

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

Вам также может понравиться