servo magazine 2007-12

84
Vol. 5 No. 12 SERVO MAGAZINE HERO SERVOS SPARE THE ROD, SPOIL THE BOT TASK PRIMITIVES December 2007

Upload: api-3776285

Post on 13-Nov-2014

151 views

Category:

Documents


21 download

TRANSCRIPT

Page 1: Servo Magazine 2007-12

Vol. 5 N

o. 12

SERV

OM

AG

AZIN

EH

ERO•

SERVO

S•

SPAR

E THE RO

D, SPO

IL THE BO

T•

TASK

PRIM

ITIVES

Decem

ber 2007

Cover.qxd 11/6/2007 3:46 PM Page 84

Page 2: Servo Magazine 2007-12

Order 24 hours a day, 7 days a week

www.Jameco.comOr call 800-831-4242 anytime

©Jameco Electronics. *According to the line cards on their web sites on August 28, 2007. Trademarks are the property of their respective owners.

OTHER JAMECO ADVANTAGES: More major brands of semis than any other catalog. 99% of catalog products ship the same day. Lowest prices guaranteed, or we pay 10%. Major brand names and generic equivalents

for even greater cost savings.

5

10

15

20

We’re passive aggressiveWhen it comes to passive products, we don’t pullany punches: we stock more major brands ofpassive components than any other major cata-log distributor.* So whatever brands you need—

from AMP or AVX to Vishay or Wakefield—you’re more likely to find them all at Jameco.Check our “stats” below and see for yourself. It’s another Jameco advantage.

Jameco® Digi-Key® Mouser® Newark®

AMP AMP AMP AMPAstec Power Astec Power Astec Power Astec PowerAugat AVX AVX AVXAVX Bourns Bourns BournsBourns Cherry Cherry CherryCherry Corcom Condor Power CorcomCondor Power CTS Corcom Elco ConnectorCorcom Elco Connector Elco Connector GrayhillCTS Fox Electronics Fox Electronics Int’l RectifierElco Connector Grayhill Int’l Rectifier KemetFox Electronics Int’l Rectifier Kemet MolexGrayhill Kemet Molex OsramInt’l Rectifier Molex Panasonic PanasonicKemet Osram Potter & Brumfield Potter & BrumfieldMolex Panasonic Teledyne Relays VishayOsram Potter & Brumfield Vishay WakefieldPanasonic Power-One WakefieldPotter & Brumfield VishayPower-One WakefieldTeledyne RelaysVishayWakefield

Free shipping on theseand 83 other major brands.Call for details.

CoverInside.qxd 11/1/2007 3:10 PM Page 2

Page 3: Servo Magazine 2007-12

SERVO 12.2007 3

Full Page.qxd 11/1/2007 3:16 PM Page 3

Page 4: Servo Magazine 2007-12

4 SERVO 12.2007

SERVO Magazine (ISSN 1546-0592/CDN Pub Agree#40702530) is published monthly for $24.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL ENTRY MAILING OFFICES. POSTMASTER:Send address changes to SERVO Magazine, P.O. Box15277, North Hollywood, CA 91615 or Station A, P.O.Box 54,Windsor ON N9A 6J5; [email protected]

Departments06 Mind/Iron

07 Bio-Feedback

18 Events Calendar

19 Robotics Showcase

20 New Products

66 Robo-Links

73 SERVO Webstore

82 Advertiser’s Index

Columns08 Robytes by Jeff Eckert

Stimulating Robot Tidbits

10 GeerHead by David GeerTortuga — From Isle of Pirates to Underwater Spy

14 Ask Mr. Roboto by Pete MilesYour Problems Solved Here

60 Lessons From The Labby James IsomNXT Packbot: Part 2

68 Robotics Resources by Gordon McCombUsing Lasers With Your Robots

76 Appetizer by Daniel AlbertTransitioning Sequencer Using Static Frames for Biped Control

79 Then and Now by Tom CarrollServos

PAGE 79

TOC Dec07.qxd 11/5/2007 4:08 PM Page 4

Page 5: Servo Magazine 2007-12

12.2007VOL. 5 NO. 12

SERVO 12.2007 5

ENTER WITH CAUTION!22 The Combat Zone

31 Votrax SC-01 to SpeakJet Translatorby Robert DoerrBreak the language barrior with yourHERO robot.

36 GPSby Michael SimpsonPart 3: Parse positional data from the NEMA protocol.

43 Spare the Rod ... Spoil the Botby Karla ConnRewards and punishments can serve as fundamental motivations for your robot to learn by.

46 Programming by Demonstrating RobotsTask Primitivesby Alexander Skoglung and Boyko LlievUsing imitation to teach robots isn’t as straightforward as you’d think, but it can be done.

51 Using FRAM for Non-Volatile Storageby Fred EadyIf EEPROM densities are too small for your robotic application and you don’t want to design in a hard drive or battery-backed SRAM, then FRAM is your answer.

Features & Projects

PAGE 14

TOC Dec07.qxd 11/5/2007 4:08 PM Page 5

Page 6: Servo Magazine 2007-12

Published Monthly By T & L Publications, Inc.

430 Princeland CourtCorona, CA 92879-1300

(951) 371-8497FAX (951) 371-3052

Product Order Line 1-800-783-4624www.servomagazine.com

SubscriptionsInside US 1-877-525-2539

Outside US 1-818-487-4545P.O. Box 15277

North Hollywood, CA 91615

PUBLISHERLarry Lemieux

[email protected]

ASSOCIATE PUBLISHER/VP OF SALES/MARKETING

Robin [email protected]

EDITORBryan Bergeron

[email protected]

CONTRIBUTING EDITORSJeff Eckert Tom CarrollGordon McComb David GeerPete Miles R. Steven RainwaterMichael Simpson Kevin BerryFred Eady Robert DoerrAlexander Skoglund Boyko LlievKarla Conn Dan AlbertJames Baker Chad NewPaul Ventimiglia James Isom

CIRCULATION DIRECTORTracy Kerley

[email protected]

MARKETING COORDINATORWEBSTORE

Brian [email protected]

WEB CONTENTMichael Kaudze

[email protected]

PRODUCTION/GRAPHICSShannon LemieuxMichele Durant

ADMINISTRATIVE ASSISTANTDebbie Stauffacher

Copyright 2007 by T & L Publications, Inc.

All Rights ReservedAll advertising is subject to publisher’s approval.We are not responsible for mistakes, misprints,or typographical errors. SERVO Magazineassumes no responsibility for the availability orcondition of advertised items or for the honestyof the advertiser.The publisher makes no claimsfor the legality of any item advertised in SERVO.This is the sole responsibility of the advertiser.Advertisers and their agencies agree toindemnify and protect the publisher from anyand all claims, action, or expense arising fromadvertising placed in SERVO. Please send alleditorial correspondence, UPS, overnight mail,and artwork to: 430 Princeland Court,Corona, CA 92879.

True AutonomyWhen roboticists talk of

autonomy, it’s generally understoodthat this elusive goal will be achievedthrough advances in computationalmethods, such as artificial intelligencealgorithms, more powerful processors,and increasingly powerful andaffordable sensors. However, achievingtruly autonomous robots will requiremore than simple computationalevolution. It’s a misnomer to call a robot that can navigate a room without human assistance‘autonomous’ when the duration ofautonomy is limited to perhaps a halfhour because of battery life. Otherthan simplistic stimulus-responseBEAM robots (see Figure 1), the Marsrovers are perhaps the best examplesof computationally and energeticautonomous robots. However, eventhe rovers are controlled remotely byscientists at NASA.

The advances in batterytechnology, fuel cells, and power

management chips haven’t kept pacewith computational advances inenergy management, such as behaviormodification. Unfortunately, behaviortactics such as resting, altering speedor path to reflect remaining energystores, and shutting down unnecessarysensors can only go so far in extendingthe operating time of a robot. Newsources of energy must be identifiedand perfected.

Although there is amplecommercial pressure to develop highercapacity energy sources and moreeffective energy management devices,there are also significant incentivesfrom the military. According to theDOD, soldiers of the near future areexpected to be assisted by electronicdevices ranging from audio, video,and data communications equipment,night vision gear, and wearablecomputers, to exoskeletons. And thesedevices will require an unprecedentedamount of portable power.

In response to this need, theDepartment of Defense Research and

Mind / Iron

by Bryan Bergeron, Editor

Mind/Iron Continued

6 SERVO 12.2007

FIGURE 1. Solar poweredlight-seeking BEAM robot.

Mind-Feed Dec07.qxd 11/5/2007 4:34 PM Page 6

Page 7: Servo Magazine 2007-12

Engineering Wearable Power Prize is offering $1M for thefirst place winner for the best wearable electric powersystem prototype. The competition — which is open toindividual US citizens 21 or older — will be held in the fall of2008. The grand prize goes to the developer of thetechnically superior power vest that weighs 4 kg or less,operates continuously for four days, and provides 20Waverage and 200W peak. See www.dod.mil/ddre/

prize/topic.html#7 for details on the competition.Even if you don't take part in the competition, consider

the energy autonomy of your next robot design. While youprobably don't have access to Sterling isotope thermalgenerators or other esoteric energy sources available to militaryrobotics designers, there are numerous promising technologiesthat you are free to explore. One that I've followed for severalyears is illustrated by the predatory robot EcoBot II, developed

by the University of the West of England in Bristol.The EcoBot II uses a microbial fuel cell to generate

electricity from flies. Bacteria in the microbial fuel cellsmetabolize sugars in the flies, releasing electrons in theprocess. The robot isn't yet up to the capabilities of theMr. Fusion Home Energy Reactor-equipped De Loreanfeatured in “Back to the Future” — top speed is 10centimeters per hour. However, the EcoBot II can travelfor five days on just eight flies. If you have an aversionto flies and other decaying organic matter, you can tryyour hand at extending the basic BEAM robots,available from several vendors featured in SERVO. SV

Dear SERVO:In reference to the September ‘07 Robytes ... Holy cow! $69

million for an RC airplane? Wow, where can I sign up? I think as atax payer I should feel screwed! Who am I? I used to fly RC planesbefore I became a pilot. I’ve built a four seat airplane, and beenpresident of an EAA (experimental aircraft association) chapter. Iknow a bit about what airplanes are, and what they cost.

One of the members of our EAA chapter built a Lancair 4,which would be a 300 mile per hour airplane.He went top shelfon it, and spent about $400,000 on it. Sure, it only has half thepayload of the MQ-9 (1,550 lbs), but itseems like for not a lot more, one couldbuild it bigger, and get the payload.

Looking at an Epic Dynasty, it has3,300 lbs payload, and is priced under $2million; it’s capable of 340 knots. Thespecs might be misleading with the emptyand max takeoff weights but that is withan interior, and equipment for people.Strip all that out and you can have a UAV.

Basically, the remote control issome extra wiring to the auto pilotservos. I am to believe that is worth 50some million dollars?

So, maybe someone might say I amcomparing “toy” airplanes to somecommercial aircraft. How about a Boeing737? Well, right from Boeing, ready to fly,they list at $49 million. I guess a $20million conversion would be reasonable(probably not). But this aircraft is capableof hauling over 30,000 lbs (about 10X theMQ-9). It can also cruise at over 500 mph.

I am very sad to hear the way things are going in the UAV market.

People claim the UAVs are supposed to be cheaper andsafer, but it still takes a crew of two to fly this MQ-9, where anF-35A lightning II will only cost about $50 million and takes acrew of one. It’s capable of carrying 18,000 lbs and flying pastmach 1 in a stealth mode carrying smart weapons. Thismanned aircraft is clearly a more useful aircraft.

Tom BrusehaverDallas,TX

SERVO 12.2007 7

Resources• EcoBot II — Self-sustaining killer robot creates a stink. New Scientist, September 9, 2004.www.newscientist.com/article.ns?id=dn6366

• EcoBot II in action. www.youtube.com/watch?v=1Nuw654pFbU

• BEAM Robots. www.solarbotics.net; www.solarbotics.com;www.geocities.com/SouthBeach/6897/beam2.html

• How Fuel Cells Work. How Stuff Works.www.howstuffworks.com/fuel-cell.htm

Mind-Feed Dec07.qxd 11/5/2007 4:35 PM Page 7

Page 8: Servo Magazine 2007-12

8 SERVO 12.2007

Fooling Virtual Robots

A highly abstract but interestingconcept has emerged from the UniversityCollege London (www.ucl.ac.uk),where Dr. Beau Lotto and otherresearchers have been experimentingwith “virtual robots” to understand whyhumans can be fooled by visual illusions.

Some folks at the UCL Institute ofOphthalmology trained artificial neuralnetworks (essentially, virtual toy robotswith tiny virtual brains) to “see” correctly(i.e., as we do). They trained the virtualcritters to predict surface reflectance in avariety of 3D scenes such as found innature. When the bots examined a rangeof grey scale illusions, they often madethe same mistakes that humans do.

Among the study’s conclusions isthat “it is likely that illusions must beexperienced by all visual animals regard-less of their particular neural machin-

ery.” For details and some entertainingillusions, visit www.lottolab.org.

Concept Car IncludesCompanion Bot

At the latest Tokyo Motor Show,Nissan (www.nissanusa.com) unveiledthe Pivo 2 electric concept car, evolvedfrom the original three-seater that firstappeared in 2005. It is mechanically asstrange as it looks, given that the wheels(each of which is powered by its ownmotor) can turn up to 90°, and the cabincan rotate 360°, so you can drive it for-ward, sideways, or backward and neverneed a reverse gear. It’s powered by lithi-um-ion batteries and uses “by-wire” con-trol technologies rather than mechanicalsystems for braking and steering.

But possibly the strangest featureis the “Robotic Agent” that rides withyou everywhere you go. It’s basically a bobbling head, located near thesteering wheel, that communicateswith you in either English or Japanese.Aimed at making “every journey lessstressful,” the Agent speaks in a “cuteelectronic voice” and provides a link toeverything from basic vehicle functionsto searching for a parking spot.

According to Nissan, the head cansense the driver’s mood by analyzingfacial expressions (it has digital eyesand a microphone) and deliver prepro-grammed phrases that might include“Relax, don’t worry,” “You’ve drippedBig Mac sauce into your lap,” and “Putaway that gun.” At this point, the car is

fully functional but — alas — is still tooexpensive for the commercial market.

Fortune Teller in a Bowl

Also too expensive for the com-mercial market but there anyway, isthe Swami Conversational Robot, avail-able from Neiman Marcus (www.neimanmarcus.com). This goes waybeyond the old mechatronic gypsy for-tune teller machines of penny arcadefame, although, peeping out from hisglass dome, he does bear some resem-blance to Zoltar. Under the control ofa laptop running special AI software,this guy generates facial expressionsusing some 30 micromotors and canwatch you via eye-mounted cameras.

Apparently, you can teach him torecognize family members, havemeaningful conversations with you,and answer questions intelligently.That’s probably more than the afore-mentioned family members can do,but the catch is that this thing costsmore than my first house: $75,000.

Give ‘em the Bird forChristmas

On a level that will allow it to fityour Christmas budget is Squawkers

In this image, it appears that the darkstripes on top are darker than thewhite stripes on the front of the

object. But a mask placed over theimage reveals that the “white” stripes

in the foreground are exactly thesame as the “grey” ones on top.

Thanks to Beau Lotto/UCL.

Nissan’s Pivo 2 concept car. Photocourtesy of Nissan Motor Company.

The Swami Conversational Robot.Photo courtesy of Neiman Marcus.

by Jeff EckertRobytes

Robytes.qxd 11/1/2007 11:16 AM Page 8

Page 9: Servo Magazine 2007-12

McCaw, recommended for children over5 years and very lonely people of allages. Widely available on the Internetfor about $55, it talks, squawks, and isnearly as annoying as a real parrot. Hecan repeat any words spoken to him,give appropriate responses to prepro-grammed commands, and learn newresponses. Put him in dance mode, andhe will sashay to whatever music youplay or even provide his own music.

In terms of mechanics, Squawkerscan move his head, flap his wings, eat acracker, and even give you a smoochwhen you touch his beak. Probably thebest feature is that he goes to sleepwhen his eyes are covered or the roomgets dark. You can see him at www.hasbro.com or in your local toy store.

Robot Plays the Theremin

As most readers will already know,the theremin — invented by LeonTheremin in 1919 — is one of the earliest

completely electronic musical instrumentsand the first to require no physical contactwith the “musician.” As far as I can verify,it was played only by human beings untilabout 2003, when Ranjit Bhatnagar builtLev specifically for that purpose.

Lev, the product of a floor lamp,some metallic junk, and a few micro-processors, has been a solo act sincethen but is now accompanied by a few“thumpbots,” which provide a rhythmicbackground to the theremin’s notorious-ly unappealing sound. If you’re curious,a video of the band playing a tune thatis said to be Gnarls Barkley’s “Crazy”(but sounds more like belly dance music)can be viewed at www.youtube.com/watch?v=19RJEnNUg1I.

Mini Chopper Fights Fires

Most unmanned surveillance seemsto be performed by fixed-wing aircraftthese days, but the West Midlands FireService, over in Birmingham, U.K., is trying out a small chopper, which it hasdubbed the Incident Support ImagingSystem (ISIS). The device doesn’t actually put out fires, but it does providelive video from above the incident scene and aids firefighters in planningan emergency response.

Such incidents can also includegeneral rescue operations, inspectionof water supplies and gas cylinders,and so on. ISIS is actually a modifiedMD4-200 vertical takeoff and landing(VTOL) micro aerial vehicle (MAV) builtby Microdrones GmbH (www.microdrones.com) over in Germany.

The composite shell provides lowerweight and EMI shielding and housesinstruments that can include a GPS,accelerometers, gyroscopes, a magne-tometer, a still or video camera, and pres-sure, temperature, and humidity sensors.The unit weighs only about 2 lbs (900 g)and carries up to nearly 0.5 lbs (200 g).Depending on the payload, the four battery-powered rotors can keep it aloftfor up to 20 min. In spite of the $60,000price tag, Microdrones has sold 250 ofthem 16 months after their introduction.

Biped Bot Responds toPS2 Controller

Closer to home, Dallas-basedKumoTek (www.kumotek.com) is abuilder of custom and standard bots foreducation, research, entertainment, andsome industrial applications. (Kumo, incase you were wondering, is Japanese for“spider.”) The news there is the introduc-tion of the model KT-X, billed as the firstlow-cost bipedal root platform that canbe controlled via a wireless PS2 controller.

The 13-in, 2.9-lb robot can walk,run, do somersaults, and stand up froma face-up or face-down position. KT-Xhas 17 degrees of freedom, is driven bya 60 MHz HV processor, and comes with75+ preprogrammed motions. As of thiswriting, the unit is still under develop-ment, but it should be commerciallyavailable “within a few months.” SV

Robytes

Squawkers McCaw, the latest in the Furreal Friends lineup.Photo courtesy of Hasbro.

Lev the musical robot now performswith “thumpbot” friends. Shown witha Moog Etherwave instrument. Photo

courtesy of www.moonmilk.com

A special version of the MD4-200is being evaluated for fire and

rescue operations. Photo courtesyof Microdrones GmbH.

SERVO 12.2007 9

The new KT-X.

Robytes.qxd 11/1/2007 11:17 AM Page 9

Page 10: Servo Magazine 2007-12

10 SERVO 12.2007

The competition is sponsored bythe Office of Naval Research(ONR), as well as by AUVSI,

according to a Robotics@Maryland aca-demic paper, “Tortuga: AutonomousUnderwater Vehicle,” authored by several club members and advisors.

The competition “tasks” eachrobot with six challenges:

• Maintain a straight course and head-ing through the starting gate.

• Locate the flashing “start” buoy.

• Ram that buoy “to free it.”

• Locate the first “orange pipeline segment.”

• Follow the orange pipeline until itmeets a second flashing buoy, which itmust also ram.

• Follow two more pipelines, locate asonar beacon, and follow it to the“treasure octagon.”

Team members based the robot’sdesign and construction on the bestpossible completion of these tasks.

Tortuga Design andConstruction

A serviceable aluminum chassissurrounds and supports Tortuga’smechanics, as well as an 18.5” long by8” diameter clear acrylic tube, whichhouses the watertight components.The team members selected the chassisdesign for ease of access to the robot’sfunctional parts, electronics, and other“innards” and attachments.

The robot uses an inertial navigation system (INS) to establish itslocation and maintain its heading. The system is comprised of sensors,processors, and software. These enablethe vehicle to establish and changelocation by adjusting its velocity.

The INS includes the followinghardware and software:

1) Three magnetometers (to measurethe Earth’s magnetic field).

2) Three gyroscopes (to measure angu-lar acceleration).

3) Three accelerometers (to measure

Contact the author at [email protected] David Geer

Tortuga — From Isle ofPirates to Underwater Spy

The Isle of Tortuga, Haiti — once a haven for pirates — lives on as the namesake forthe University of Maryland Robotics Club’s submersible competition robot.

Tortuga — the Club’s entry in the Association for Unmanned Vehicles and SystemsInternational’s (AUVSI’s) annual Autonomous Underwater Vehicle (AUV)

competition — first appeared in the yearly event in Autumn 2007.

Tortuga was the first robot that theUniversity of Maryland entered into theAssociation for Unmanned Vehiclesand Systems International’s (AUVSI’s)annual Autonomous UnderwaterVehicle (AUV) competition, accordingto Scott Watson, a University ofMaryland student and Robotics Clubmember. This is a close-up, aft (tail,stern) angle view of Tortuga.

The AUV is equipped with fourSeabotix thrusters (three of four are visible) to control depth, pitch, yaw,

and horizontal translation, according to students who crafted the submersible robot. Rollis statically stabilized with a careful distribution of foam, small weights, and putting heavyelectronics (such as the batteries) at the bottom of the pressure hull, Watson notes.

The AUV uses a MacMini to interface with all its sensors and motor controllersthrough USB ports.

Photos are courtesy of Scott Watson,University of Maryland student and

Robotics Club member.

Geerhead.qxd 11/4/2007 6:32 PM Page 10

Page 11: Servo Magazine 2007-12

GEERHEAD

linear acceleration).

4) An inertial measurement unit (IMU)houses the aforementioned nine sensors.

5) Closed-loop controller software toprocess force vector equations.

The combination of sensors andsensor data are relied on for navigationbecause GPS signals don’t travel underwater.

Attaining ObjectivesTo get through the starting gate

properly, Tortuga uses a combinationof position confirmations from its forward camera and output from anonlinear adaptive controller.

A nonlinear adaptive controllertakes sensor data as input and uses itto calculate the orientation (location,position) of the robot and how that ischanging, according to Scott Watson,University of Maryland student andRobotics Club member.

“It does some calculations andthen determines how best to use theactuators available (thrusters, in ourcase) to do something desirable, likemaintain heading, depth, pitch, roll,and velocity,” explains Watson.

The nonlinear aspect means thatthe controller can take the many differ-ent forces acting on the robot intoaccount, according to Watson. If theteam could guarantee that only oneforce contributed to the robot movingup and down in the water and, similar-ly, that only one thruster was able toaffect that up and down motion, thenthe robot would only need a linearcontroller, explains Watson.

“But, in nature,” Watson says,“forces tend to constructively anddestructively interfere with eachother in a way that may not be deter-minable from the available sensors.”

The adaptive aspect meansthe controller knows that the input(parameters) it receives from thesensors isn’t necessarily 100 per-cent accurate and that it is permit-ted to intelligently adjust those

parameters, by use of its pro-gramming, according to Watson.

“For example, it’s impossible tomeasure buoyancy or roll moments per-fectly, but an adaptive controller will, ina sense, learn how to adjust theseparameters to more successfully controlthe vehicle by depending on sensormeasurements,” illustrates Watson.

Next, we have buoy ramming.Buoy ramming sounds like fun

and, in this instance, it is a carefully cal-culated maneuver. The buoy is a flash-ing light housed in a watertight enclo-sure. The robot’s task is to locate thisbuoy and run directly into it to knock itloose from its mooring, according toWatson. “This demonstrates vehiclecontrol, valid image processing, and

SERVO 12.2007 11

This University of Maryland student and Robotics Club member Matt Bakalar is check-ing for air bubbles that might emanatefrom the watertight enclosure thatprotects the AUV’s electronics.

Devastating leaks can comefrom the o-ring seals, as well as thewet-matable connectors drilled intothe aluminum end caps of the pres-sure hull. If all goes well, the leadcontroller programmer will secureshell (SSH, a form of connectioninterface) into the MacMini to begintesting the robot’s stability underactive control, according to Watson.

University of Maryland student and Robotics Club member Stepan Moskovchenkosubmerges the watertight pres-sure hull to watch for air bubblesand water accumulation beneaththe electronics and batteries.

“The first leak in the lifetimeof the robot was discovered minutes earlier due to user errorwith the homemade underwaterFireWire connector,” says Watson.

The straps hold aluminumCNC’d end caps with piston styleo-ring seals in place on an 8” diameter acrylic tube, Watson explains.

Three student team members check whether the inertial measurement unit(IMU) is level within the vehicle. While hanging from the team tent at the competi-

tion in San Diego, the studentsattempt to calibrate the internalmagnetometer and tweak gainsin the controller code.

“The team uses aMEMSense Nano IMU withMicro -E lec t ro -Mechan ica lSystems (MEMS) technology.This affords a relatively low costand lightweight solution forinertial measurements and totrack the course of the robot,”says Watson.

Geerhead.qxd 11/4/2007 6:33 PM Page 11

Page 12: Servo Magazine 2007-12

12 SERVO 12.2007

artificial intelligence,” explains Watson.The robot employs two Unibrain

Fire-I cameras for object recognition.These cameras stream video viaFireWire connection to the MacMini(1.83 GHz dual core, 2 GB RAM),which is the robot’s onboard computer.Image processing algorithms on theMacMini, written in C++, use the

OpenCV image processing libraryto identify competition objects

like the buoy (and, of course, theorange pipelines it must follow),according to a Robotics@MarylandTortuga academic paper.

The artificial intelligence comesfrom the robot’s “higher level autonomysoftware” in the robot’s hardware brain.A gigabit Ethernet tether stretches thedistance between Tortuga’s onboard

MacMini computer and a com-puter on dry land. “We usually

communicate with the onboard computer over a shell session, that is,over the Linux console,” says Watson.This is especially useful during testing.

To aid the robot in recognizing andfollowing the pipelines, the team usescolor filters to bring out the orange,according to Watson. “Then we run anedge detection algorithm that gives usa collection of points that belong toedges in the image. Finally, we feedthese points into another algorithmcalled a Hough transform, which picksout straight lines from those edgepoints,” Watson continues.

“Marker dropping” is another taskin the AUVSI competition. In this case,the robot drops six inch by half inch redPVC pipe sections into target boxes asmarkers at two points in the competi-tion. A weight in the PVC makes sure itdrops, according to club members andstudents.

Team members mount these PVCpipe sections inside Tortuga’s deploy-ment tubes, which are fitted with permanent and electromagnets to holdand deploy the markers. When the robotenergizes the electromagnet, it cancelsthe permanent magnet’s magnetic field,releasing the marker over its target.

The team mounted the markertubes next to the ventral video camerain order to minimize positioning error.The ventral camera is the one onTortuga’s belly, specifically designatedto watch for targets and for the orangepipelines, according to Watson.

The robot uses sound to help itlocate its “treasure” in the final task ofthe competition. A sonar, seatedbeneath the octagonal treasure target,creates the sounds. A three sensorhydrophone array on the robot’s sidesenses these underwater sounds like asingle microphone. A series of micro-controllers and analog filters determinethe frequency and time of arrival of thesounds to pinpoint the location of thesonar, according to Watson.

System SupportA microcontroller network offloads

low-level tasks from the MacMini andsupports the robot. “For example,

GEERHEAD

UM students and Robotics Clubmembers Stepan Moskovchenko [left]and Joe Gland [right] inspect thethruster and camera housing cables fordamage after a competition-qualifyingrun that knocked the camera housingloose.

The external frame, made of80/20 tubing, performed one of itsdesign functions by protecting all theelectronics and cabling during the“jolt.” A little bit of rope and the teamis ready to go straight back to testingcode to get the robot back in thewater for another run, Watsonexclaims!

UM students and Robotics Club members take a moment to pose behind theAutonomous Underwater Vehicle (AUV) they designed and built — in nine months — for

the Association for UnmannedVehicles and Systems Internationalannual competition.

The Maryland students fin-ished 13th out of a field of 27 teamsin this their first year, winning a$500 prize. “They are proud of theiraccomplishment and look forwardto spending more time developingthe artificial intelligence code andrefining sensor systems to bettercompete with more experiencedteams in 2008,” Watson says.

Robotics Club member NathanDavidge waits at Reagan NationalAirport with the team’s AUV robot.

All the electronics and parts forthe AUV fit in the travel case on theseat to the right of Nathan. “Even atthe airport, the student team wasworking on integrating a new binaryprotocol for more reliable communi-cation to the motor controllers fromMacMini,” says Watson.

Geerhead.qxd 11/4/2007 6:33 PM Page 12

Page 13: Servo Magazine 2007-12

collecting hundreds of voltage measurements from a sensor,averaging them together, and performing small calculationsthat the main computer can ask for without worrying aboutthe electrical details of how it was done” is an optimizationof the architecture, as Watson explains.

A sensor PCB contains most of the microcontrollers and they have a parallel bus (8 bits wide) that coordinatesinformation flow and job instructions.

ConclusionAUVSI held this year’s competition July 11-15 at the

Space and Naval Warfare Systems Center TRANSDEC Facilityin San Diego, CA. The University of Maryland expects to seeTortuga or its ‘offspring’ competing again next year. SV

Department of Electrical and Computer Engineering, A. James Clark School of Engineering, University of Maryland

www.ece.umd.edu

Robotics@Maryland Club — http://ram.umd.edu/trac

Replacement thrusters — www.seabotix.com

AUVSI — www.auvsi.org

RESOURCES

SERVO 12.2007 13

GEERHEAD

Geerhead.qxd 11/4/2007 6:34 PM Page 13

Page 14: Servo Magazine 2007-12

14 SERVO 12.2007

Q. Do you know of anyhumanoid robot kits that cost less than a $1,000? I like

the ROBONOVA and KHR-1 bodydesigns with all of the motors and flexibility, but it costs way too muchmoney for me. I was wondering if youhappened to know of any cheaperrobots out there.

— Andy Kerns

A. When it comes to fully articulatedhumanoid robots, the ROBONOVA(www.robonova.com) and the

Kondo KHR-2HV (www.kondo-robot.com or visit www.trossenrobotics.com) can be purchased for around$1,000. The Kondo KHR-2HV is the nextgeneration of the KHR-1 and is a littleless expensive than the KHR-1.

Since humanoid robots are becom-ing more popular,there are new robotdesigns coming outeach year. A couplethat I am aware of arethe I-Sobot (www.isobotrobot.com) whichcosts around $300 andthe RoboPhilo (www.robophilo.com) whichcosts about $500. Idon’t have any personalexperience with eitherof these two robots,but from what I can see

from the videos on their websites, theyare very impressive. The I-Sobot is currently available from several places,such as Amazon (www.amazon.com).The RoboPhilo kit should be available byDecember 2007. Table 1 shows a fewbasic specifications for these two robots.

Another option to consider is theBRAT from Lynxmotion (www.lynxmotion.com) which costs less than $300for the basic kit. This is a very basicbipedal robot kit that has a total of six servos (three for each leg). It requiresassembly and a connection with a PC to control the robot. If you add your own electronics and develop your ownwalking routines, the BRAT can becomeautonomous.

For those people that want a challenging project, the BRAT is aninexpensive route to get started. All ofthe parts on the BRAT are interchange-able and expandable, so at a later time,the BRAT can be reconfigured withsome additional parts to make a 17 or19 degree of freedom robot.

On the subject of reconfigurablerobot kits, you might want to take a lookat look at the Bioloid (www.tribotix.com) robotics kit. This is a very good general-purpose robot kit which allowsyou to build many different types ofrobots, such as dogs, spiders, six-servowalkers like the Lynxmotion BRAT, andeven the big 17+ servo humanoid robots.The Bioloid robots use the Dynamixel servos, which are some of the mostadvanced robotics servos on the market.

To be able to build a humanoid

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

byPete Miles

Our resident expert on all things robotic is merely an Email away.

[email protected]

Figure 1. I-Sobot. Figure 2. RoboPhilo.

Specification I-Sobot RoboPhilo

Height 6.5 inches 13 inches

Weight 12 oz. 38 oz.Servos (degrees

of freedom) 17 20

Power 3 AAA NiMH 6V NiMH

Remote Control Infrared Infrared

Special FeaturesBuilt-in Gyro, Voice Recognition,

Speaker, Pre-programmedMotions, Programmable

Pre-programmedMotions,

Programmable

Approximate Costs $299 ~$500

Table 1. I-Sobot and RoboPhilo Humanoid Robot Specifications.

MrRoboto.qxd 11/5/2007 3:58 PM Page 14

Page 15: Servo Magazine 2007-12

robot, you would need the comprehen-sive kit, which has 18 servos, brackets,and a microcontroller for controlling theentire robot. The approximate $900price is a bit higher than the robots previously discussed, but it has a lot ofdifferent projects and robot designs tobuild. There is a beginner set which con-sists of four servos, power supply, micro-controller, and construction bracketswhich costs about $350 that will helpyou to start learning how to control theservos and program the microcontroller.

Both the BRAT and the Bioloid kitsrequire assembly and knowledge abouthow to build and program robots.Developing walking routines on your owncan be rather challenging. These kits arenot recommended for those who want afully functional robot right out of the box.It may take several days to weeks to getone of these robots to do the same thingsas the I-Sobot and the RoboPhilo.

Q. I have been searching theInternet for several monthslooking for an inexpensive logic

analyzer. My main need is for somethingto analyze serial data between my laptopand various microcontrollers. I have seenprices range from $500 to over $3,000for the different logic analyzers, and thisis way outside my budget. Do you knowof any low price logic analyzers?

— Bill T.Salt Lake City, UT

A. It is amazing to see how muchlogic analyzers cost relative tooscilloscopes. One would think

that with all of the digital electronicsin use today, there would be dozensof low cost, budget logic analyzersavailable on the market.

Several months ago, I stumbledacross a very nice and inexpensivelogic analyzer from Parallax (www.parallax.com) called the BASICStamp Logic Analyzer (part #30010).Check out Figure 5. It is a veryimpressive little tool for $79. With asampling rate of 2Ms/s on 16 I/Olines, it should be able to accuratelymonitor all of your serial communica-tion data with 0.5 µs resolution.

It will store a minimum of 1 milliondata points to well over 30 million data

SERVO 12.2007 15

Figure 6. BASIC Stamp 2px24 mountedon the BASIC Stamp Logic Analyzer.Figure 5. BASIC Stamp Logic Analyzer.

Figure 4. Bioloid humanoid configuration.Figure 3. Lynxmotion BRAT.S

X28A

C/D

P

Vss RB.0

Vdd

RB.1RB.2

RB.4RB.3

RB.7RB.6RB.5

RC.0

RC.3RC.2RC.1

RC.5RC.6

RC.4

RC.7

RA.3

RA.0

RA.2RA.1

MCLR

OSC2

OSC1

RTCC

4 MHz

10 KΩ

+5V+5V

P1

P5

P7P6

P3P4

P2

P0

SINSOUT

BA

SIC

STA

MP

LOG

IC A

NA

LYZE

R

P14

P10

P8P9

P12P11

P13

P15VddRESVss

+5V

BASIC STAMP LOGIC ANALYZER

(Basic Stamp not required)EXAMPLE

MICROCONTROLLER

Figure 7. BASIC Stamp Logic Analyzer wiring example.

MrRoboto.qxd 11/5/2007 3:59 PM Page 15

Page 16: Servo Magazine 2007-12

points (the manual states that the maxi-mum storage limit is based on how muchavailable RAM is on your computer). Withtrigger points set at 0.8V and 1.8V, bothCMOS and TTL circuits are supported.

The one requirement to use theBASIC Stamp Logic Analyzer isthat your computer must havea USB 2.0 connection.

This BASIC Stamp LogicAnalyzer is designed tomount directly under a BASICStamp microcontroller (see

Figure 6). It gets its power from thesame power supply to the Stamp, andit will monitor all 16 of the Stamp’s I/Opins, along with the Vdd, RES, Sin, andSout pins. I haven’t tried this, but the

BASIC Stamp Logic Analyzer shouldwork with other microcontrollers thatuse the same footprint.

Like with all electronic circuits, theycan be used in a different applicationthan they were originally designed for.This particular logic analyzer can be usedas a stand-alone device. All that isrequired is a +5V and GND power sourceto the logic analyzer and wires to connectto the signal that you want to monitor.

Remember you will need to provide a common ground betweenthe BASIC Stamp Logic Analyzer andthe system under test. Figure 7 showsa simple schematic illustrating how towire the BASIC Stamp Logic Analyzerto another microcontroller, and Figure8 shows a photo of the setup.

Figure 9 shows the graphical userinterface for the BASIC Stamp LogicAnalyzer. This has some pretty power-ful features, such as setting the triggerlevels for beginning the data storage,setting the maximum data storagelength, cursors for measuring the signals, zoom in and out control, anddecoding serial, SPI, and I2C signals.Figure 10 shows you an example of theasynchronous serial data decoder.

I haven’t tried testing the signalvoltage limits to the BASIC Stamp LogicAnalyzer. The manual doesn’t statewhat the voltage limits are, so I wouldassume that you are limited to 0-5V signals to the logic analyzer. If you havevoltages outside this range, I would recommend that you implement somesort of a voltage signal conditional thatchops/scales the voltage signals to the0-5V range. Also, if you do not connectany of the unused signal pins to ground,then the signal on them will float andmay either copy an adjacent signal pin,or bounce between logic 0 and 1.

This is a pretty nice, little inexpen-sive logic analyzer, and I have used itsuccessfully to diagnose a multitude ofprojects, and reverse-engineered othersignals from other devices I wanted touse in my projects. SV

16 SERVO 12.2007

Figure 8. BASIC Stamp Logic Analyzer mounted ona Parallax Professional Development Board and

connected to an SX28 microcontroller.

Figure 9. BASIC Stamp Logic Analyzer software.

Figure 10. Asynchronousserial data decoder.

For those of you who are interestedin further reading on a similar topic,Nuts & Volts (www.nutsvolts.com) will be featuring a project in the

January 2008 issue on a Low Cost RF Impedance Analyzer.

MrRoboto.qxd 11/6/2007 2:24 PM Page 16

Page 17: Servo Magazine 2007-12

Full Page.qxd 11/1/2007 3:17 PM Page 17

Page 18: Servo Magazine 2007-12

Know of any robot competitions I’ve missed? Is yourlocal school or robot group planning a contest? Send anemail to [email protected] and tell me about it. Be sure toinclude the date and location of your contest. If you have awebsite with contest info, send along the URL as well, so wecan tell everyone else about it.

For last-minute updates and changes, you can alwaysfind the most recent version of the Robot Competition FAQat Robots.net: http://robots.net/rcfaq.html

— R. Steven Rainwater

DDeecceemmbbeerr7-8 South’s BEST Competition

Beard-Eaves Memorial Coliseum, Auburn University, Auburn, ALRegional BEST teams from multiple states competein this regional championship.www.southsbest.org

8 Penn State Abington Robo-HoopPenn State Abington, Abington, PAThe Penn State Abington Robo-Hoop is anautonomous robot basketball event in which robotsmust pick up foam balls and shoot or dunk theminto a basket.

www.ecsel.psu.edu/~avanzato/robots/contests/robo-hoops

JJaannuuaarr yy 2200008825-27 TechFest

Indian Institute of Technology, Bombay, IndiaLots of events for autonomous and remote controlled robots including standard Micromouseand several events unique to TechFest: Pixel, acontest for vision-equipped bipeds; Full Throttle:Grand Prix, remote-controlled, internal combustionpowered cars race on a concrete track; Vertigo, aremote-controlled robot and an autonomousrobot must work together to move blocks around;Prison Break, remote-controlled robot mustclimb out of a pit and survive a fall to escaperobot-jail; U-571, an obstacle avoidance contestfor underwater robots.http://techfest.org/competitions/department

FFeebbrruuaarr yy24-28 APEC Micromouse Contest

Austin Convention Center, Austin, TXAmazingly fast little autonomous robot critters race

to solve a maze. If you’ve neverseen one of these events, go seethis one. You won’t believe howfast these things are.www.apec-conf.org

28-Mar 2 PragyanNational Institute of Technology, Trichy, IndiaEvents in this competition includestandard Micromouse and Sym-Bot, a contest in which aremote controlled robot mustguide an autonomous robot tothe starting line of a course —then the autonomous robot mustcomplete the course by itself.www.pragyan.org/08/home/events/

Send updates, new listings, corrections, complaints, and suggestions to: [email protected] or FAX 972-404-0269

18 SERVO 12.2007

Events.qxd 11/5/2007 4:37 PM Page 18

Page 19: Servo Magazine 2007-12

! " #

$ $ " %

$ $ & ' " %

ThePower SchmartModule™

will power up yourcircuits with your choiceof -9, -12, +2.5, +3.3,+5, +9, and +12 volts.

$15Very Schmart!

www.schmartboard.comAsk for our FREE 96 page catalog

VISIT OUR ONLINE STORE ATwww.allelectronics.comWALL TRANSFORMERS, ALARMS,FUSES, CABLE TIES, RELAYS, OPTOELECTRONICS, KNOBS, VIDEOACCESSORIES, SIRENS, SOLDERACCESSORIES, MOTORS, DIODES,HEAT SINKS, CAPACITORS, CHOKES,TOOLS, FASTENERS, TERMINALSTRIPS, CRIMP CONNECTORS,L.E.D.S., DISPLAYS, FANS, BREAD-BOARDS, RESISTORS, SOLAR CELLS,BUZZERS, BATTERIES, MAGNETS,CAMERAS, DC-DC CONVERTERS,HEADPHONES, LAMPS, PANELMETERS, SWITCHES, SPEAKERS,PELTIER DEVICES, and much more....

ORDER TOLL FREE1 - 8 0 0 - 8 2 6 - 5 4 3 2

THOUSANDS OF ELECTRONICP A R T S A N D S U P P L I E S

SERVO 12.2007 19

Robotics ShowcaseRobotics Showcase

ShowcaseDec07.qxd 11/4/2007 6:42 PM Page 19

Page 20: Servo Magazine 2007-12

Resistance Soldering Systems

Heavy-duty resistance sol-dering systems for solder-

ing tasks such as large militarypin connectors where the solder joint quality must be exceptional have been introduced by American BeautySoldering Tools of Clawson, MI.

American Beauty UltraHigh Heat Plier-Style ResistanceSoldering Systems provideinstantaneous, localized heat from cold to >1,000°F in lessthan one second, depending upon the application.Featuring plier-style hand pieces, the heat is concentrateddirectly at the solder joint and these footswitch-actuatedsystems allow “cold fixture” setup before soldering.

Ideal for soldering large single wire terminations up to 0 AWG into terminal lugs, electrical splices, and multi-pin connectors, American Beauty Ultra High HeatPlier-Style Resistance Soldering Systems avoid heat damage to the wire’s insulation. Hand pieces are lighterthan conventional irons and are offered in a variety ofsizes for confined spaces and special applications.

American Beauty Ultra High Heat Plier-Style ResistanceSoldering Systems are priced according to the power supply wattage and hand piece design. Literature and pricing are available upon request.

For further information, please contact:

Digital Compass

Anew, low-cost, three-axis, tilt-compensated, solid-statedigital compass that provides “drop-in compatibility”

with most popular digital compasses has been introducedby OceanServer Technology, Inc., of Fall River, MA.

The OS3000 Digital Compass is a three-axis, 1.4” x1.8” PCB and includes RS-232 and USB connectivity, and a24-bit A/D converter with digital filters for easy integrationinto a wide range of applications. Accurate to 1° azimuth,with 0.1° resolution, tilt-compensation up to ±60°, and

0.1° resolution for roll and pitch,the compass components have a50,000 G shock rating.

Providing a programmableupdate rate from 0.1 to 20 Hz, an ASCII interface, and hard-iron calibration, the OS3000 DigitalCompass can be easily embeddedinto another device and providesprecise heading, roll and pitchdata, and is ideal for rapid attitudemeasurement. It incorporates athree-axis Honeywell Magneto resistive sensor, a MEMSaccelerator, and is RoHS compliant.

The OS3000 Digital Compass sells for $249 each or$199 ea. for 10; larger quantity discounts are available.

For further information, please contact:

NeuroArm Educational Edition

NeuroRobotics — a British based manufacturer ofrobotic arm products with models of varying

complexity and functionality — has just added theNeuroArm education edition to its range of robot armproducts. This education edition teams up the NeuroArmEducational Edition 5 DOF Revolute Robotic Arm kit withthe popular Webots 5.0 EDU Simulation and Programmingsoftware from Cyberbotics. This enables a vast array ofteaching applications and experiments. Everything neededto build and operate the robot is included in the kit. No soldering or electronics PCB assembly is required.

Using the supplied NeuroArm Webots model, you canprogram the arm to carry out virtually any imaginable taskon the computer simulation. Then when you are happy withthe simulation, just download the program to the real robotand watch it perform the same tasks as in the simulation.

The joint drives on this robot provide less torque, speed, and lower gripper force than the moreadvanced NeuroRobotics models, but still achieves a reachcomparable with an adult human arm.

For further information, please contact:

New Products

ACCESSORIES AND TOOLS

NNEEWW PPRROODDUUCCTTSS

20 SERVO 12.2007

1177 West Maple Rd.Clawson, MI 48017-1059

800•550•2510 Fax: 248•280•2878Email: [email protected]

Website: www.americanbeautytools.com

American BeautySoldering Tools

151 Martine St.Fall River, MA 02723

Tel: 508•678•0550 (x103)Fax: 508•678•0552

Email: [email protected]: www.ocean-server.com

Ocean ServerTechnology, Inc.

Website: www.neurorobotics.co.ukNeuroRobotics

Dec07NewProd.qxd 11/5/2007 4:28 PM Page 20

Page 21: Servo Magazine 2007-12

Full Page.qxd 11/1/2007 3:19 PM Page 21

Page 22: Servo Magazine 2007-12

Featured This MonthArticles22 Feather Weight Armor

by James Baker

24 Armor Guidelinesby Chad New

26 Advanced Materials in InsectArmor by Kevin Berry

27 Armor Considerations inLarge Robotsby Paul Ventimiglia

Events29 Results and Upcoming

Armor is a subject all combat robot builders will

have an opinion on. Manyhave written in detail aboutthe theory of robot armormaterials, with formulae andspecification tables galore.All of this is must-readmaterial if you plan to survive in this sport.

With so many knowl-edgeable people offering

articles containing suchdetailed material science, I

think this article needs to focuselsewhere. Instead of trying to tell you what you should do and offering mathematical reasoning, Iwill simplify the issue, based onmy experiences, to the game ofRock/Paper/Scissors.

Rock

Rock is solid, it’s hard, it doesn’t bend. Rock is strong.Traditionally, a robot builder looking to fend off all attacks will

22 SERVO 12.2007

FEATHERWEIGHTARM R

by James Baker

As we do periodically (sorry — pun alert), this month’s Combat Zonedeparts from our usual format to focus on a topic of interest to all builders— armor. From my own experience and that of many other veterans, thisis the single most misunderstood area when new builders attempt their first bot. SERVO put out a call to the community, asking for tips andtechniques from builders on this tough subject (sorry, the puns just keepon a'coming). Four builders answered the call, and we hope theirthoughts will be useful to all builders, new or veteran.

Combat Zone is meant to be a resource to the robot fighting community.We welcome builder’s stories, requests for topics of interest, build reports,and feedback on how to make this even more useful. — Kevin Berry

CombatZone.qxd 11/5/2007 4:06 PM Page 22

Page 23: Servo Magazine 2007-12

SERVO 12.2007 23

build their machines with heavy,thick, solid armor. This is especiallytrue at the moment in the feather-weight class in the UK. We currentlyhave a very high number of robotsbuilt using Hardox, a very strongwear resistant steel.

One example of the rock solution is my own featherweight,“Unity” which is a zero compromisearmored steel tank without weaponsand with moderate drive power. Myteammate has a similar robot called“Bloody-L” machined from a solid billet of high-grade aluminium withstainless steel skin.

It is obvious where the advan-tages and disadvantages lie withthese. All but the most extreme ofspinning weapons are unable to evenscratch the outside, but inside thecomponents are shaken to pieces.The rock is very good against crush-ing, cutting, and piercing weapons,but the solid robot transmits impactsfrom spinning and impact weaponsdirectly to the components inside,causing unseen failures.

Having heavy armor also reducesthe other capabilities of the robot,such as reduced speed or lackingweapons, which means it can be lessthan exciting in rock vs. rock fights.When rock breaks, it usually breaksbadly, leaving distorted, sharp sections of very visible damage.

Paper

Paper is light. It’s flexible, andeasy to cut and shape. Paper absorbsenergy. The analogy of the paperrobot is not one built of cardboard,but one of deformable materials suchas polycarbonate, polypropylene,HPDE, wood, or even rubber. Thecharacteristics of the paper robot arethe opposite of the rock. By allowingthe energy from the opposingweapon to deform and damage thearmor, almost all of the energy isused up or displaced, leaving less torattle the internal components.

This type of armor works very

well against axes or impact weapons,but does not do very well against crushing, cutting, or piercingweapons. Because of the relativelight weight of this type of armor,more weight can be allocated todrive power and weapons, makingfor fast and exciting fights, taking small amounts of damageconstantly, but sometimes ending incatastrophic failure.

The paper robot (how strangedoes that term sound?) is usually acrowd pleaser. It is also easy to workwith, allowing new builders to getinto the sport without spending afortune on tools and metalworkingequipment. I run a number of robotswith chassis and armor made entirely of plastic, which I found hasanother, often overlooked advantage— I can keep my antenna inside the robot as it is transparent to radiosignals.

Scissors

Scissors are hard and strong, butthey can move and change shape. Itis a bit of a stretch to call a strong,but flexible robot “scissors,” but the termrefers to the armorbeing rock-like in itsresistance to cutting or penetration, but paper-like in its energyabsorption capabilities.It is a middle ground,giving good levels ofprotection against alltypes of weapons, butstill being more vulnera-

ble than a zero compromise solution.Rubber mounted steel, for exam-

ple, fits this description. Titanium isalso a good example of scissors-typearmor. It is very resistant to cutting,but flexes well to absorb energy.Titanium is not the indestructiblematerial many people think, but it is avery good compromise betweenstronger, heavy steels and light plas-tics. It is expensive and hard to workwith, but in the featherweight class, itis common and works very well. Myheavyweight robot “Wheely BigCheese” is made entirely of titanium,as is the featherweight version. Therereally is nothing like it for solving somany problems with just one product.

Aluminium is also a scissors type— more paper than rock — but weuse it very effectively in our heavy-

The spinning disk weapon that tore Bloody-L’sstainless steel armor destroyed itself doing so.

Edgehog uses sacrificial armor that takesa lot of visible damage, but saves the

internals from shock damage.

Building a robot from titaniumgives excellent strength andenergy absorption, but they areexpensive and hard to build.

CombatZone.qxd 11/5/2007 4:06 PM Page 23

Page 24: Servo Magazine 2007-12

24 SERVO 12.2007

Let me ask you: Would you walkinto a hail storm without any sort

of protection/armor for your body? Iam going to guess not unless, of

course, you want to get pelted todeath. So, would you create a combat robot without armor, whichis going to face other robots that are

armed to the teeth with variousdestructive weapons that are capable of ruining the creation thattook you so many hours to build?

Again, I would hope that theanswer to that would be no.

Armor is one of the most critical aspects you must accountfor when you are designing yourcombat robot. If you do not havearmor of some sort, what is goingto protect the expensive and critical places inside your robotfrom being destroyed by youropponents? In this article, I will

weight robot “Edgehog” The armortakes a lot of damage, but keeps theopponent’s axes from doing internaldamage. We have many aluminiumfeatherweights who require a lot ofrepairing after events, but they workvery well.

Rock Beats ScissorsBeats Paper BeatsRock ...

It is a very black and white subject, or so it would seem fromwhat I have written so far. You canhave indestructible robots that cannot beat anyone (as they have noavailable weight left) or awesomeweapons on fragile robots that fallapart with the slightest impact, oryou can spend a fortune on middle

ground materials and machining. Ofcourse, it is never really black andwhite. What happens if we put heavysteel under polycarbonate, or havestainless steel parts of the robot,with aluminium elsewhere?

A hybrid robot made of lightmaterials, using heavy, strong materi-als in specific areas, is one solution.Laminate armor — using layers of dif-ferent types of material — can haveadvantages, as well. Bonding theselayers can help them; sometimesthey work better if not bonded.

One very cheap solution toimproving the capability of yourarmor is to correctly shape it.Crushers love a flat lid, spinners lovevertical sides and catching edges.Shape your armor to maximize itsnatural properties. If it needs to flex,

give it room to do so. If itmust not bend, support itproperly. Slope as manysides as possible. If youhave thick, super strongarmor all around yourobot, do you need internal structure at all?Why not put teeth on thearmor and spin it?

Armor is a subjectthat should be given as muchthought as weapons or drive. Thereis no perfect solution. Some peoplechoose to turn their armor intoweapons, such as ram-bots or shellspinners. Others have armor as anafterthought, relying on huge offen-sive weapons to ward off attackers.

Whatever you choose to do, itwill always be a compromise, unlessyou live in the UK right now. We justhad our weight limit raise from 12 kg(26.4 lbs) to 13.6 kg (30 lbs) to meetthe American standard, so all of ourweapon-focused robots can have 1.6kg of extra armor, and our weapon-less rock-bots can have 1.6 kg ofweapons. Does that make them allscissors now? Then, I guess it’s timeto build a new 30 lb rock or paperrobot. SV

Spatula showsheavy damagemainly becauseof the vertical andrigid mounting.

150g robot Pookie usesshaped titanium to

deflect the attacks ofopposing robots.

ARM R GUIDELINES by Chad New

Even super strong ram-bots likeUnity take damage sometimes.

CombatZone.qxd 11/5/2007 4:07 PM Page 24

Page 25: Servo Magazine 2007-12

SERVO 12.2007 25

explain what I believe to be the most critical aspects of yourarmor configuration; forinstance, the type, howyou mount it, its shape,and attachments. Bythe end of this article, itis my hope that you willbe able to utilize thisinformation and improve the armor-ing techniques on your robots.

Mounting

We will start with mountingbecause I believe this to be one ofthe most important aspects of yourentire armor layout. You can havethe best and most expensive armorever created, but unless you mount itcorrectly, it will be useless. If youhave an armor ‘shell’ that mounts tothe base plate or frame, you need tohave very strong attachment points.If your 1/4” titanium shell is heldonto your 1/4” titanium base plateby 1/8” aluminum brackets, there is agood chance that it will be torn offor bent in short order.

Consider the forces involved inthe class that you are going to enter.Use appropriate sized hardware thatwon’t distend under high loads andconsider using armor mounts thatare just as strong as the armor itself.You might also want to considershock mounting your armor. Shockmounting usually involves rubber ofsome sort which provides a cushion.When it’s impacted, it allows someof the force to be absorbed into the mounts.

If your robot’s armor is theframe itself, you need to plan for thearmor getting bent and damaged.Allow tolerance for components to work even with a damagedframe/armor panel. Consider layering the outer area with UHMW or even a thin shock mounted strip of metal to shield theimportant pieces.

TypeThe type of armor that you are

going to use depends on the goal ofyour robot. If you want a robot thatis going to be able to withstandattacks from the most destructivecompetitors, then you are obviouslygoing to need strong and thickarmor that is mounted very securelyto the frame. If weight is not a concern, you might as well use cheapmetal such as steel; many robotshave even used wood as armor withpositive results.

If your robot uses a weapon, youwill likely not have the weight to allocate towards an impenetrablesetup such as steel. You may have toconsider materials that are able toabsorb shock well or have a highstrength-to-weight ratio. Materialssuch as UHMW, aluminum, and titanium work well in this instance.

Shape

I believe that a robot’s armorshould be built around the chassis.Once you have decided the basic bitsof your robot, you need to begin tothink about how you are going toarmor it. Are you going to boltit flush onto the frame, bend apiece of plastic around thewhole thing, or perhaps evenuse a shaped piece of wood toprotect the robot?

When you design yourarmor, you also need to keepthe shape of it in mind. Why

mount it vertically which givesspinning robots a wonderful surfaceto grip and impact on when youcan design your armor with aslope so that the angles will help todissipate some of the force (whichwill give you a distinct advantagewhen facing your opponents)? Tryto design your armor so that it willaid your design. Do not think of itas something that has to be onlydefensive. If possible, attempt toincorporate it into the offense side of your bot.

Attachments

If after you have completed yourrobot and you find that you haveweight left over, you might want toconsider making some attachmentsfor weapons that you might face.Even if you don’t have extra weight,it might be worth it to take off awheel, lose a motor, or cut back on the batteries to give you theadvantage of some added armor.

If you are going to fight a horizontal spinner, you might wantto add extra armor at the height ofthe blade. That way, it will be less

Rocket, a 60 lb launch bot, usesits shape, shock mounting,and attachments to protect

itself from opponents.

Get Flippen, an ant weight, uses the shapeof its armor to keep damage to a minimum.

A great example of what can happento even the best designed robots ifthe mounting is not strong enough.

CombatZone.qxd 11/5/2007 4:07 PM Page 25

Page 26: Servo Magazine 2007-12

26 SERVO 12.2007

Our team, Legendary Robotics, hasbuilt (or done major upgrades to)

almost 50 insect class bots (150gram, one pound, three pound, orsix pounds), and their armor has runthe gambit. We’ve had bots with noarmor (all offense), ones mostlymade of armor (all defense), andmany in between.

Until the advent of major spinners in the last few years, we hadgreat success with 1/8” aluminum,which was easy to work, absorbedhits well, and was inexpensive. Onceant or beetle spinners started cuttingthrough it, however, we knew wehad to move to something else. Inthis sport, you either stay ahead ofthe “death spiral,” or it screws youinto the ground.

At one event, we were talkingwith Team Barracuda about theirantweight, Flounder. It was made of

a novel carbon fiber honeycomb.Exhibiting the sportsmanship thatdefines our sport, they directed us totheir favorite bot supply place, AcmeIndustrial Surplus in Sanford, FL(www.acmeindustrialsurplus.com). Well, we hit the mother lode.Besides the CF honeycomb, they alsocarry a Kevlar honeycomb material,in thicknesses from 3/32” to 1”. Infact, they have aluminum honey-comb in all kinds of various sizes. We knew we just had to build a botout of this stuff!

Babe The Blue Bot, anantweight, was our first (and mostsuccessful) build. Using this material,along with titanium from TitaniumJoe (www.titaniumjoe.com), wedeveloped a bot that has survivedbattles with some of the Southeast’s(and Texas’, as well) most viciousspinners.

Our strategy was to combinethe chassis and armor, using a fairlyclassic wedge/box design. The topand bottom are just the rawKevlar, while the sides have a layerof 0.014” titanium over them.This light, stiff, strong material left us plenty of weight for a 0.040”titanium plow.

We started with spacer/screwsinks/corner braces made of wood,but after having several split by amassive hit from superspinnerPirhana, we upgraded those toUHMW (also from Acme). All cutswere made with hand tools. TheKevlar cuts well with a hack saw orcoping saw, and the titanium withsnips. The plow, of course, was harder to work, but by wearing out ahacksaw blade, it was done by hand also. The Kevlar basically workslike plywood, except it takes hits

likely to rip through and damageyour armor. If you are fighting avertical, think about a wedge ofsome sort, or the ever-popular “keepaway” stick which can be used forjust about any type of spinner. Thepoint is that anything you can addfor a specific opponent is somethingthat will give you an advantage; tryto allocate weight for attachments.

ConclusionIn wrapping up, remember how

important it is to keep the armor designat the forefront of your mind whendesigning your robot. Try to incorporateit as an offensive part of your robot anddon’t “half ass” it during the last-minuterush getting ready for the event. I alsothink it is very important to keep in

mind that offense and defense are bothhuge factors for the success of yourrobot. Again, take note of how you willmount your armor, what type of armoryou are going to use, the shape of it,and perhaps some special attachmentsto better equip yourself against certainrobots. If you do all of this, chances areyour robot will be in much better shapeat the end of an event! SV

ADVANCED MATERIALSIN INSECT ARM R

by Kevin Berry

Babe’s top shows Pirhana damage, while the bottom exhibits theresults of a 30 second ride on SWARC’s kill saw.

Battered but functional, Babe’s aluminum bracket, zip tie, and UHMW spacerconstruction provides nine ounces for motors, battery, ESC, and receiver.

CombatZone.qxd 11/5/2007 4:08 PM Page 26

Page 27: Servo Magazine 2007-12

SERVO 12.2007 27

There are some nasty weaponsfound in today’s combat robots,

especially in the 120 lb-340 lb weightclasses. If your armor isn’t up to thetask, you will not only lose thematch, but your expensive robotinnards will be defenseless. Havingthe proper armor for a match is just as important as having that killer weapon, and often it is moreimportant.

Know Your Constraints

To maximize your chance of

success, you must plan ahead carefully. You should first decide howmuch weight you have allottedfor armor. The most importantdesign factor is surface area; inorder to maximize protection,you must minimize surfacearea. If you reduce the lengthor width of an armor pane,then you can increase thethickness of that piece whilekeeping the weight constant.

Remember, your robot should nothave to be taller than the largest

extremely well.We bought some 5/8”

thick material for our light-weight, and plan to layersome 0.030” titanium overthat (if we ever get it finished). We’ve also usedthis 3/32” as the chassis forour beetle John Henry, and it’sproven just as tough in the beetleclass with 0.018” titanium overlay.We’ve seen the carbon fiber honey-comb used in antweights as well,and it seems to perform just fine.

When we bought it, the 3/32”ran about 10¢ per square inch, orabout $5 for Babe. The 0.014” titani-um ran about $1 for every sixsquare inches, or about $18.The plow, made from 0.040”costing about $1 for every fourinches, cost around $3. So, ourchassis and armor cost $26. Ofcourse, we bought the materialin bigger sheets, but withthrifty layout, we use every possible bit with no waste.Table 1 shows sizes, material,

and weight for all six pieces.I strongly recommend this

approach for any small bot, andwould like to see someone experiment in a mid-sized machine.Babe has survived dozens of nastybattles, and while sometimes losingthese fights — and often parts — hersoft creamy center has never been

violated. Knock on wood (or maybeKevlar)! SV

ARMOR CONSIDERATIONSIN LARGE ROB TS

by Paul Ventimiglia

While the 0.040” titanium plow isbarely scratched, the thinner

0.012” does get a bit dinged up.No marks or penetration to the

Kevlar underneath, however.

“Exploded view” of Babe’s side construction.When using wooden spacers, this was how

it looked coming out of the arena, also!

Front view shows the plowattachment. The screws are lefta bit loose so it “bounces” over

arena irregularities.

Heavyweight Verbal Abuseillustrates the rubber shock

mounting technique where itsarmor will attach to all sides.

Photo courtesy of Dick Stuplich.

Material Size (in) Weight (oz)

Top Kevlar 6 x 6 1.4

Bottom Kevlar 6 x 6 1.4

Side Kevlar/Ti 1 x 6 0.5

Side Kevlar/Ti 1 x 6 0.5

Rear Titanium 1 x 6 0.2

Plow Titanium 2 x 6 1.2

TABLE 1 TOTAL 5.2

CombatZone.qxd 11/5/2007 4:08 PM Page 27

Page 28: Servo Magazine 2007-12

component inside!Always consider the application

of what you are designing. Youmight not be able to predict whateach of your opponents will look like at an event, but you know historically what types of robots havecompeted. This is an area to takesome design risks in how you chooseto distribute your allocated weight.For example, “there are many heavy-weight spinners, but almost no hammer or crushing weapons.”Using that assumption, I am makinga potentially risky tradeoff as I shiftweight from my top/bottom armorto the rest of my robot.

Importance of Shape

When designing your armor,look at the most powerful robotsthat exist and ask yourself, “Do I feelcomfortable letting them hit each

part of my robot?” At a minimum,you should plan to receive an attackfrom a horizontal spinner such asMegabyte or Last Rites, a hammerrobot such as The Judge, and a vertical disk spinner such asNightmare. The energy of thoseattacks can be deflected if yourarmor is sloped at an angle.

Megabyte, Last Rites, andBrutality have all placed holes in the1/2 inch thick steel arena bumpers.Does that mean your robot musthave better than 1/2 inch steel armoreverywhere? No — of course not — itis all about the shape of your armor.

Thin aluminum and plastic caneasily render a spinning weapon useless if it is mounted at a low angle(below 30 degrees) to the floor.Similarly, having a one inch thicksteel front bumper will do you nogood if a spinner can “catch” onto itsedge. Often an entire armor panelcan be torn off from a solid hit. Thatis why the corners of your robot arethe most vulnerable area; any seam

or edge can be caught by agood spinner.

Material Selection

The most common robotarmor materials are alu-minum, steel, polycarbonate,and titanium. Your budget

and tools will often be the mainlimiting factor in your selectionprocess.

Steel offers the best protectionfor your dollar. Mild steel (such as1018) offers good strength andcomes in any shape and size. Highcarbon steels (such as 4130 and toolsteels) have the added advantage ofthe ability to be hardened, becomingmany times stronger and harder to penetrate.

A simple steel wedge is yourbest chance of fending off that bigspinning weapon, but plan to have itat least 3/16 inch thick at a lowangle, and almost 3/8 inch thick asthe wedge approaches 45 degrees.For armor in less vulnerable areas,you can get away with 1/4 inch thickness, if you don’t mind a fewlarge gashes and holes.

Aluminum is the most common-ly used robot building material. Itcomes in a variety of alloys; 6061 hasabout half the strength of mild steel,but that comes at about a third ofthe weight. More exotic alloys suchas 7075 obtain similar strengths tomild steel, but they can be veryexpensive. Additionally, the strongeraluminum will generally fail in a brittle way by cracking, but 6061 is asofter metal that will bend.

Polycarbonate (or Lexan) is a surprisingly resilient material. It is oneof the lightest materials you can usefor armor, and is available in sheetsup to about one inch thick. Althoughit has low strength in tension and it

The 1/4 inch steel wedge is being weldedupside-down to steel hinges on WPI’swinning middleweight entry at BotsIQ 2006.Note the use of many large fasteners.Photo courtesy of Paul Ventimiglia.

The 340 lb robots from Robogames2007. The Judge tries to sentenceZiggy who has added additionalshock-mounted panels by removingthe side armor just for this fight.Photo courtesy of Brian Benson.

The 120 lb robots fromRobogames 2007.

Subzero shows off itsshock-mounted armor

and titanium wedgedeflecting the hits from

the drum of Touro.Photo courtesy of

Brian Benson.

28 SERVO 12.2007

CombatZone.qxd 11/5/2007 4:09 PM Page 28

Page 29: Servo Magazine 2007-12

can be cut fairly easily, it performswell during impact forces. This is dueto its ability to flex and still return toits original shape.

Some care must be taken whendesigning to use polycarbonate however, because it is prone to cracking in areas such as sharp corners and near holes. Additionally,this plastic does not block radiowaves, and it can give your robot anice look because it is transparent.

Titanium offers the higheststrength-to-weight ratio of thesematerials, but with a very costly pricetag. Alloys such as 6AL-4V have morestrength than many steel alloys.Super heavyweights such as Ziggyand The Judge are clad in titanium allaround; it is necessary to keep their

weight down while covering theirlarge surface areas. I personally donot feel it is worth the price to usetitanium armor in the large classes,so instead I try and allow extraweight to use steel.

Mounting Your Armor

If your armor is rigidly secured toyour frame by welds or bolts, it willresist bending well. The front of yourrobot will take the most abuse, souse the largest and highest qualityfasteners you can find. Reinforce alllong spans with gussets and multipleattachment points. If armor panelsare mounted on hinges, make surethey are steel, and bigger than youthink is necessary. (I use 1/4 inch

thick walled, 5/8 inch pin steelhinges on Brutality.)

Alternatively, many buildersswear by “shock-mounting” theirarmor. Large rubber washers ormetal studs encased in rubber completely isolate an armor panelfrom a robot’s frame. By using thistechnique, the energy of an impact ismore slowly absorbed and thereforeyour robot will not be damaged as easily. I prefer to save weight overall by making my frame a part ofthe armor.

Whatever you choose, remem-ber to make it easily repairable orbring spares. Steel can always bewelded at an event, but good luckgluing back together your shatteredpolycarbonate! SV

Table 1Material Density (lbs/in^3) Best Used For Other NotesMild Steel 0.284 Front wedge, high impact areas, sides Easily machined and welded; welded

with MIG and TIG.High Carbon Steel 0.284 Front wedge, high impact areas Has to be machined in annealed state;

must be hardened for best results.6061 Aluminum 0.098 Sides, top, bottom Easily machined, difficult to weld in

thicknesses above 3/8 inch.7075 Aluminum 0.098 Sides, top, bottom Easily machined, cannot be welded.Polycarbonate 0.043 Top, sides against non-spinners Very easily machined, should not be

tapped; mount with bolts and washers.Titanium 0.161 Works well in all areas Difficult to machine, welds only with

TIG and heavy shielding.

Robothon RobotCombat 2007

was presented byWestern AlliedRobotics in Seattle,WA, on 9/22/2007.Go to www.westernalliedrobotics.com for moredetails. Results are asfollows:

12 lb Hobbyweight Class — 1st:Death Dealer, Team DMZ; 2nd:

Raven, Team DMZ;3rd: Fiasco, TeamVelocity.

3 lb BeetleweightClass — 1st: HurtyGurty, Team Deathby Monkeys; 2nd:Altitude, TeamVelocity; 3rd: Mission

Mayhem, Team Wildcard.

1 lb Antweight Class — 1st: MeltyB 2.0, Spam Butcher; 2nd: Baby

Blaster, Ghetto Logic Robotics; 3rd:Green Hornet, Robo-Yasha.

Roaming Robots held an event inPortsmouth at the Mountbatten

Centre on 10/6-7/2007. Go towww.roamingrobots.co.uk for

EVENTSResults and Upcoming Events

SERVO 12.2007 29

CombatZone.qxd 11/5/2007 4:10 PM Page 29

Page 30: Servo Magazine 2007-12

more details.

RoboCore was held in Brazil on10/6-7/2007. Go to

www.robocore.net for moredetails. Results are as follows: Middleweight — 1st: Touro, TeamRioBotz; 2nd: Orion, Team Triton;3rd: Team ThunderRatz.

Hobbyweight (12 lb) — 1st:Puminha, Team RioBotz; 2nd:Butcher, Team Uai!rrior; 3rd: TeamBotville.

Upcoming Events forDecember 2007 andJanuary 2008

BotsIQ Boston Regional, “RumbleAt The Rock,” will be presented

by: BotsIQ Boston in Plymouth,MA on 12/1/2007. Go towww.botsiq.org for more details.

The Plymouth North andPlymouth South High School

Engineering Teams in cooperationwith BOTSIQ and The BostonTooling and Machining Association,will host a 15 lb BOTSIQ RobotCombat Competition at theEngineering Lab at Plymouth NorthHigh School — 41 Obery Street,Plymouth, MA.

Wreck-The-Halls will be present-ed by Carolina Combat

Robots in Greensboro, NC, on

December 28 and 29, 2007. Goto www.carolinacombat.com formore details.

Carolina Combat Robots is havingits second event in Greensboro,

NC. The arena is a 16 ft x 32 ftsteel structure with 1/4” steel floorand 1/2” of Lexan for the walls.The event will include robots from150 g Fairyweight to the 120 lbMiddleweights.

RoboChallenge will present theirThinktank Christmas Special

December 28th and 29th inBirmingham, England. Go towww.robochallenge.co.uk formore details. SV

MaximumRobotics.com1-800-979-9130

Wiring Robot Controller· Atmel ATMega 128

· 128k Memory· 43 Digital I/O Pins· 8 Analog Inputs

· 8 External Interupts· 6 PWM Channels

· 2 Serial Ports including Bi-Directional USB· The Wiring Programming Language

The Wiring language provides a simplified subset ofC or C++ that hides more advanced concepts likeclasses, objects, pointers (while still making themaccessible for advanced users). You get the powerof C or C++ with the ease of a language like Basic.Programs execute at full C++ speed on the board.

$69.95

Robot Controllers

ARC1.1 Robot Controller• Atmel ATMega16• 1k SRAM, 16k Flash• Dual 1.1 amp motor drives• Supports motors up to 25V• Dual quadrature encoder support• Programming cable included with kit• No additional hardware needed• Works with BASCOM and AvrDude programming softwareIdeal for controlling your small robot. With a Microcontrollerand onboard motor controllers, you get all the electronicsthat you need (except sensors) on one board.Kit $37.95 / Assembled $41.95

Programmable Robot KitsINEX MicroCamp Mega8· Atmel ATMega8· Dual DC motor drivers· 2 Buttons, 2 LEDs· Serial port· 5-Analog ports for sensors· +5V switching power supply· No soldering required· Supports In-system Programming via ISP connectorwith included PX-400 Serial ProgrammerIncludes eveything you need to build a simple mobilerobot. Add your own additional sensors for evenmore complex robots.$59.95

MicroBric Viper· Screw-together Assembly· BasicAtom Microcontroller

· 2 motor modules· Bump sensor modules

· Switch Modules· IR Remote & Receiver Module

With microbric, you can build complex electronicdevices with little or no prior electronics knowledge.As no soldering is involved and the parts are fullyreusable, you can build and rebuild programmable

robots as many times as you like.$89.95

Also Available:Electronic Components

ServosMotorsHardware

Wheels & Tiresand More!

More New Products on the way!

30 SERVO 12.2007

CombatZone.qxd 11/5/2007 4:10 PM Page 30

Page 31: Servo Magazine 2007-12

It is the voice for the Heathkit HERO1 and HERO Jr robots, the RB5Xrobot, some arcade games, and

several other devices. Many will alwaysremember hearing this chip asking if“Dr. Falken” would like to play a gameof chess in the classic “War Games”movie. The SC-01 had a long run, butthese days they are getting hard tofind. I was concerned about this andwanted to ensure there was some sortof replacement option that would beavailable for the future.

Finding a suitable replacement forthis chip proved to be an interesting

project. It highlightsthe many differentproblems that come upin the robotics hobby.What seemed at first tobe a very straightforwardendeavor ended up covering a lot ofground. I’ll try to review all the ups anddowns and share some knowledgealong the way.

Currently, there is no direct drop-inreplacement for the SC-01 speechsynthesizer, so I decided to go aboutcreating one. At least a hybrid onefor now!

The LanguageBarrier

First, let me start with how the SC-01 generates its speech. Somespeech chips (or modules) accept regular ASCII text strings and others actlike a sound recorder which play back

The SC-01 speech chipwas one of the most

popular speech chips inuse during the ‘80s ...

The SC-01 speech chipwas one of the most

popular speech chips inuse during the ‘80s ...

b y R o b e r t D o e r rb y R o b e r t D o e r r

SERVO 12.2007 31

Doerr.qxd 11/1/2007 11:02 AM Page 31

Page 32: Servo Magazine 2007-12

32 SERVO 12.2007

stored phrases. The SC-01, however, is aphoneme based synthesizer whichbuilds words from small sound fragments called phonemes. With this in

mind, I looked to see what other phoneme-basedspeech chips are out there.After looking at the fewavailable chips, it seemedthat the closest matchwould be the SpeakJet(SpeakGin) chip. Althoughit too is phoneme based,that is about all it has incommon with the SC-01chip (except that they areboth in DIP packages).

In the SC-01, there are64 of these phonemes

defined. The SpeakJet has 72 (allo-phones) plus a variety of sound effects.The first part of the project was to seeif this idea had merit and was possible.

All of the codes for each phoneme aredifferent for each chip. I went throughand made a lookup table for what Ithought would be a good mapping of each SC-01 phoneme to SpeakJetallophone. With this conversion table in hand, I had some speech stringsfrom the HERO 1 that I ran through the table.

Initially, I had a SpeakJet wired upto an old Handyboard for testing. I thentook the translated string of phonemecodes and with an Interactive ‘C’ program, sent them all to the SpeakJet.The results of that first test were inspiring and showed that this could bea viable option. Some of the wordssounded exactly the same while othersneeded work. (More to follow ...)

The original SC-01 chip.

Schematic for the translator.

Doerr.qxd 11/1/2007 11:03 AM Page 32

Page 33: Servo Magazine 2007-12

The Protocol BarrierNow that the SpeakJet could sound

like the good old SC-01 (provided theright codes were fed into it), the nextstep was handling the protocol it usesto talk to the host. These days, a lot ofperipheral devices can be told what todo using a single serial line with perhapsa handshaking line or two.

The SC-01 and many earlierdevices are from when most peripheraldevices were parallel based. The SC-01accepts six parallel bits of phonemedata, two bits of inflection data, andhas a couple control lines to latch thedata and acknowledge (busy) that itwas received. This added one morething to deal with for a translator. TheSpeakJet, on the other hand, expectsto receive all the allophones sent as aserial data stream.

Too Much PowerAnother oddity about the SC-01 is

its source of power. Instead of just +5Vthat most devices seem happy with,this chip was commonly run at +12V.Even so, it had a nice feature in thatthe data lines had 5V compatibleinputs to make it easy to interface tostandard 5V systems. A hybrid modulewould also need an onboard 5V regulator to bring the supply down to asafe level.

Enter the TranslatorTo fit in with the idea of drop-in

replacement for the SC-01, the wholething had to plug into the odd 22-pinDIP socket and act just like an SC-01.Lately, I’ve been working with theParallax SX series of microcontrollersand found that the SX28 was ideal forthis project. The translator programwas written in SX/B (BASIC compiler)to make it easy for everyone readingthis article to follow the code. TheSX28 acts as the hardware protocoltranslator, phoneme translator, andhandles all the handshaking signals. Inorder to do this, it must:

• Accept the parallel phoneme andpitch data meant for the SC-01.

• Acknowledge to the hostthat it was received.

• Perform a lookup todetermine what the equiv-alent SpeakJet phonemeshould be.

• Send any special codesto the SpeakJet.

• Send the new phonemeto the SpeakJet (if buffer isnot too full).

• Set the acknowledge line high to signalthat host can send another phoneme.

The HardwareTo jumpstart the project, this

whole prototype was built upon anSX28 protoboard that Parallax offers. Itcontains a SX28AC/SS-G surface mountchip, voltage regulator, prototype area,and a header for the programmingadapter. Programming the SX serieschips also requires the use of an SX-Keyor SX-Blitz. The ability to quickly Flashthe SX28 processor with new versionsof the translator code really helpedspeed the development process along.

The SX28 is available in both a 28-pin SSOP package and a 28-pin DIPpackage. An important point to note isthat pins 1 through 14 are not the sameon both package styles. Make sure tonote which package is used in anyschematic that uses the SX28 chip! Carehas to be taken whenswitching package styles toensure the wiring is correct.In the example schematic,a surface mount SX28SSOP package was used.

The SX28 chip sitsbetween the 22 pin SC-01socket and the SpeakJetchip to translate all the signals. The only exceptionis the voice out signalwhich the SpeakJet

handles and goes out through pin 21of the 22 pin socket. Port A of theSX28 handles the serial data to andalso gets the status back from theSpeakJet. Port B is used to get thestrobe from the host since that portcan generate interrupts. This will allowfor an alternate version of the transla-tor to be written as interrupt driven.

A portion of port B can also act as ananalog converter and that pin is wired topin 16 (MCRC) of the 22 pin SC-01 socket. It can eventually look at the riginal SC-01 timing signal and adjust the translation speed accordingly. Theremaining pins on port B are used to getconfiguration information from a DIPswitch. Port C is used to get the phonemeand inflection data from the host.

To ensure the serial timing to theSpeakJet would be accurate, a 4 MHzresonator is used. Although the internalRC clock of the SX28 is fine for manyprojects, an external resonator or crystalshould be used when timing is critical.

SERVO 12.2007 33

The custom DIP adapter.

Original SC-01 amp board withthe DIP adapter replacing

the SC-01 microchip.

Doerr.qxd 11/1/2007 11:04 AM Page 33

Page 34: Servo Magazine 2007-12

34 SERVO 12.2007

Issues That CameUp (and wereovercome)

As a real world test, I pulled out thegenuine SC-01 chip from the Speechboard of my HERO 1 robot and pluggedin my translator gadget.

The original power source for this

prototype originated fromthe supply pin of the SC-01socket. The HERO 1 can shutdown parts of itself to savepower and as a result thepower on the speech boardwould cycle on and off this12V supply whenever therobot tried to talk. It alsomade downloading newtranslator program code achore since the board wouldnormally be off.

As a temporary solution, I suppliedpower to the prototype board from the+5V connection on the HERO 1 bread-board. The amplifier section on the HERO1 speech board would still power up anddown to save power. Later, the 5V regula-tor will take the 12V from pin 1 on the 22pin socket for power so that all the con-nections are directly to the SC-01 socket.

The default behavior of the SpeakJetis to announce ‘READY.’ It is also whatthe HERO 1 says when you first powerhim up. When the power was firstapplied, it would say READY but it wasmisleading. I knew it wasn’t going to bethat easy! It only did it the first time itwas powered up and following that, all itmade was a sort of sick ‘Ehhh’ soundrepeating a bit before going silent.

Well, that isn’t supposed to hap-pen! It was pretty obvious what wasgoing on with the READY announce-ment, so I took another look at thesource code. I found a typo for the vari-able name used for the index to lookup the SpeakJet allophone in the table.As a result, it was always pointing tothe first phoneme in the table (thathappens when your index is always 0)so that explained it. I fixed that andstarted to hear a few new phonemes.

I could make out some of thephonemes and portions of words but itwas way off. I knew that the lookuptable would need work but thought “Ican’t be that far off!” A little trou-bleshooting work quickly uncoveredwhat had happened. I had used a 22 pinDIP socket to make the plug-in adapterto go into the original SC-01 socket. Theleads are fairly thin as it was a standarddual leaf socket. You may have already

guessed what had happened.Two of the six data leads used to

send the phoneme data to the SC-01on my custom connector had foldedunder instead of going into their appropriate pins in the socket below.That left two of the six data bits usedto select a phoneme open and in afloating state. Usually when somethingis open it floats high, so it meant thatsome phonemes would never be usedand other incorrect ones would beselected in their place! Once that wasfixed, it started to sound a lot better.

The robot would speak a portionof what it was supposed to but wouldbe truncated before it could finish. TheSC-01 would accept a single phonemeat a time and would be ready to acceptthe next while speaking so the speechwould be continuous. This ended upbeing another issue.

The SpeakJet is nice enough tooffer a 64 byte buffer for incomingcommands/allophones. The robotwould send along all its phonemeswhich were being buffered by theSpeakJet. Once transferred, the robotwould assume the speech was doneand shut down power to the speechboard, shutting off the sound amplifier.(Hmm, that’s a problem!)

To confirm that was the case, I threwin a small delay after each phoneme wasreceived and sent over to the SpeakJet. Itdefinitely showed this was it and thenbrought up the issue of how to deal withit. The SpeakJet provides a few handshak-ing signals. It can signal if it’s ready, it cantell you if it is actively speaking, and it cantell you if the 64 byte buffer is half full.Unfortunately, it has no easy way of letting you know when there is only onebyte left in the buffer.

This is something that would havebeen extremely useful in its role ofimpersonating an SC-01. Instead ofsending all it could take and using thebuffer half full as a handshaking signal,I wanted to spoon-feed the chip andprovide it the allophone codes one at atime so I would know about when itwould be done. I did try using thespeaking line as the handshake, but theproblem was there ended up being apause between each phoneme whichwas unacceptable. It seemed that it

www.robotworkshop.comAuthor’s website, home for the HERO

robots and vintage robot Guru(Pre-programmed SX28 chips with

resonator available here).

www.parallax.comProvider of the SX series processors.

Offers free software development tools like SX/B.

http://forums.parallax.com/forums/Online user forum for SX series

microcontrollers.

www.speechchips.comProvider of SpeakJet chips.

www.redcedar.comGreat historical reference and

data on SC-01.

groups.yahoo.com/speakjetOnline user group for SpeakJet chip.

www.speakjet.comWebsite for the SpeakJet chip.

www.soundgin.comWebsite for the SpeakGin and

SoundGin chips.

www.rbrobotics.comHome of the RB5X robot.

SpeakJet-basedreplacement board.

References

Doerr.qxd 11/1/2007 11:05 AM Page 34

Page 35: Servo Magazine 2007-12

would either take too much or too little.Unfortunately, none were just right ...

Luckily, an elegant little solution hitme. Why not just go ahead and sendcodes to the SpeakJet using the bufferhalf full as a throttle. Then as a way tosync up the timing, I could use theSpeaking handshake line whenever theSC-01 was sent a pause or a STOP. It justso happens that the convention used inthe HERO 1 is such that all the speechsent to the speech board ends with aSTOP to ensure the board would finishspeaking before it was powered off. Thiswas PERFECT! An audible pause betweenphonemes might normally be a problem,but if the phoneme was a silent one,then no one would notice. This is justwhat I needed to make it work on HERO1 and it got around the power issue.

After that, some more work wentinto the translation table for the SC-01phonemes to SpeakJet allophones. Extracode was added to consider the twoinflection bits. If they changed state fromthe last phoneme, then the program willsend out a code to the SpeakJet tochange its inflection to improve the emulation. It’s still not perfect, but keepsgetting better with each revision.

One of the last minute additionsinto the code was to send a smallpause phoneme to the SpeakJet wheneverything was first powered up.Without this, the first phoneme thatwas translated and sent to theSpeakJet was garbled. Adding thatdelay cleared up the problem and noweverything sounds just as expected.

The ExtrasFinally — just for fun — I wanted to

use some of the extra features of theSpeakJet and put a few of the extraunused pins on the SX28 chip to gooduse. One of the unused bits on port B (RB.5) can send debugging info to a serial port for monitoring thetranslation process. A small DIP switchwas added to configure the way the translation is handled. Alternately,instead of a DIP switch, an output porton the robot or another device couldbe used to control these settings.

In the example program provided,DIP switch 1 is used to enable R2/Bio

sounds instead of regular SC-01phoneme translation, DIP switch 2enables extra status info to be sent outthe debug port, and DIP switch 3enables a small section of code to ini-tialize a fresh SpeakJet chip by disablingits startup READY announcement.

Now, by merely flipping a DIPswitch, I can have HERO speak just likeR2D2 since it translates real phonemes toequivalent R2 sounds. I don’t know if thereal R2 would understand it but everyonethat hears it seems to like it! So, not onlywill this project effectively emulate an SC-01, but also adds value by leveragingsome extras within the SpeakJet.

Ideas forImprovement• Better matching of audio output circuitry here.

• Monitor RC circuit that sets SC-01timing and adjust overall timing ofemulation.

• Tweak phoneme lookup table.

• Add another mode to enable morespecial SpeakJet features like soundeffects.

• Make another version to translate

from the SC-02 (SSI263) to the SpeakJet.

It should be noted that either theSpeakJet or SpeakGin chips can be usedinterchangeably as the target speechchip with this project. For those thatmay not be aware, these two devicesare actually the exact same chip. The co-developers decided to pursue differentmarkets and each have their own brandname for this particular speech chip.

Eventually, this can all be put on alittle hybrid module as a nice tidy plug-in replacement package. For thoseof you interested in trying out thetranslator yourself, preprogrammedSX28 chips with a resonator will beavailable from the author. SV

SERVO 12.2007 35

Robert has been working on personalrobots since building one of the earlyHERO 1 robot kits when they came out. He enjoys repairing/rebuilding/upgrading all the robots from that era. Itcan be challenging at times, but it isrewarding to keep these old robots going.

About the Author

The source code for the translator isavailable on the SERVO website at

www.servomagazine.com.

Note

Tormach PCNC 1100 Features:Table size 34" x 9.5"

R8 Spindle 1.5 hp variable speed to 4500 RPM

Computer controlled spindle speed and direction

Precision ground ballscrews

Digitizing and tool sensing support

4th axis and high speed spindle options

3 Axis Mill

$6800plus shipping

When you’re serious about hardware, you need serious tools. Whether milling 0.020” traces on prototype PCBs or cutting ½” steel battle armor, this CNC mill can do it all. Weighing in at more than 1100 lbs, the PCNC can deliver the hardware end of your combined hardware & software projects.

Precision CNC Machining

Mill includes Control, CAD and CAM software. Optional stand, coolant system, computer and accessories are extra.

Product information and online ordering at www.tormach.com

Doerr.qxd 11/1/2007 11:07 AM Page 35

Page 36: Servo Magazine 2007-12

36 SERVO 12.2007

More on the NEMA0183 Protocol

Back in Part 1, we looked at theGSV and GSA NEMA commands.While those commands are invaluablefor determining your GPS lock status,they won’t yield any positional data, which you will need in order togenerate a nifty plot like that of Figure1. Let’s take a look at two additionalcommands:

• GGA: Time, Position, Fix Type• RMC: Time, Date, Position, Course,

Speed

Remember you can download acomplete NEMA 0183 reference manual at www.sparkfun.com/datasheets/GPS/NMEA%20Reference%20Manual1.pdf.

Just To Recap:A NEMA 0183 message begins

with a $GP and ends with acarriage return. It looks somethinglike this:

$GPGSV,3,1,12,20,00,000,,10,00,000,,25,00,000,,27,00,000,*79

The message name — which isalso referred to as the option —comprises the characters just following the $GP. Each data element is separated by a comma.The data elements are terminatedby the * character, followed by thechecksum. There is an eight-bitXOR of each character between the$ and * to form the checksum. The

last two characters in the message area hex representation of the calculatedchecksum.

GGA: Global Positioning SystemFixed Data

• Field 1, UTC Time in the format of hhmmss.sss

• Field 2, Latitude in the format of ddmm.mmmm

• Field 3, N/S Indicator (N=North, S=South)

• Field 4, Longitude in the format of dddmm.mmmm

• Field 5, E/W Indicator (E=East, W=West)

• Field 6, Position Fix Indicator (0=No Fix, 1=SPS Fix, 2=DGPS Fix)

• Field 7, Satellites Used (0-12)• Field 8, Horizontal Dilution of

Precision• Field 9, MSL Altitude• Field 10, MSL Units (M=Meters)• Field 11, Geoid Separation• Field 12, Geoid Units (M=Meters)• Field 13, Age of Diff Correction in

seconds• Field 14, Diff Reference

by Michael Simpson

FIGURE 1

GPSPART 3

Simpson3.qxd 11/5/2007 3:45 PM Page 36

Page 37: Servo Magazine 2007-12

RMC: Recommended MinimumSpecific GNSS Data

• Field 1, UTC Time in the format of hhmmss.sss

• Field 2, Status (A=Valid Data, B=Invalid Data)

• Field 3, Latitude in the format of ddmm.mmmm

• Fields 4, N/S Indicator (N=North, S=South)

• Field 5, Longitude in the format of dddmm.mmmm

• Field 6, E/W Indicator (E=East, W=West)

• Field 7, Speed over ground in knots• Field 8, Course over ground in

degrees• Field 9, Date in the format of ddmmyy• Field 10, Magnetic Variation in degrees• Field 11, Mode (A=Autonomous,

D=DGPS, E=DR)

Both the GGA and RMC fields willgive you the Longitude and Latitude,but only the GGA will report theAltitude and Fix Type. The RMC command will report your course andspeed. So, it’s clear that we need toparse both of these commands to

gain all the information.

Data Logger

To help you understand the GGAand RMC commands a little better,let’s start out by building a data logger. Data loggers are invaluablebecause they let you collect test datathat you can later use to help youtest and refine your projects withouthaving to resort to field tests.

As shown in Figure 2, the datalogger is straightforward. I have

included both PC andPocket PC versions that will handle allthe modules and receivers discussed inthis series. You select the device usingthe Device menu shown in Figure 3.This will set the correct baud rate andenable special setup commands neededfor the Etek and Copernicus modules.

You start the data collection byhitting the start button shown inFigure 4. The program will then openthe com port indicated and initializethe GPS module, if needed. Collecteddata will be saved to the file indicated.If you want to save the file into thesame directory as the GPSDataLoggerprogram, precede the filename with adecimal point as shown in Figure 4.

As data is collected and saved, it isalso parsed. The NEMA commandsGGA, GSV, GSA, and RMC are allparsed. The pertinent information is

FIGURE 2 FIGURE 3

FIGURE 5

FIGURE 6

FIGURE 4

SERVO 12.2007 37

Simpson3.qxd 11/5/2007 3:48 PM Page 37

Page 38: Servo Magazine 2007-12

38 SERVO 12.2007

displayed on the form as shown in Figure5. The actual number of bytes capturedand saved will also be displayed. If you see the captured number go up but none of the data fields are updated,you have selected the wrong device.

Data Plotter

You will want to view the datayou collected. I have created two

programs to allow you to do just that.The GPSLogDisplay program shown inFigure 6 will display all the pertinentinformation. You select the log filecaptured with the GPSDataLoggerprogram by selecting the File Menu asshown in Figure 7.

You have the option of displayingthe data as fast as your computer canprocess the data, or in real time bysetting the RealTime menu shown in

Figure 8. When in real time,the data will be processedbased on the UTC time stampin the message. What theprogram does is look for differences in the seconds inthe UTC field. When it sees adiscrepancy, it delays the program for one second.

For actual plotting, youcan use the program calledGPSLogPlot shown in Figure 9.This program will allow you toplot your actual trip. By default,the program sets the scale to200. This divides plot points by200, thus shrinking the plot tofit on the display. You canchange this using the settingsmenu. When plotting short distances, use a smaller scale.

When you start the plot,the first valid point becomesthe reference starting pointthat will be — by default — thecenter point on the display.You can change this point bychanging the Start x and Starty points in the settings menu.The actual plot area is a 1000x 1000 grid. You can changethe view of this grid by usingthe small pad on the formshown in Figure 10. The center button will center theview to its default.

The plots shown in Figure11 were all captured with theGPSDataLogger and my pocket PCusing the BT359W shown in Figure 12.This is the most accurate GPS I haveever owned. The main reason I have notshowcased it in this series is that it is aBluetooth only receiver. You can use thesame interface program as the HoluxGPSLim236. Unlike the GPSLim236, theBT359W does supports WAAS.

GPS Parsing Software

While I have included thecompiled version of the pro-grams presented in this article, Ihave also included the sourcecode for those that may want to

Function Variable Populated

procGGA

GGA_UTCTimeGGA_LatitudeGGA_NSGGA_LongitudeGGA_EWGGA_FIXGGA_FIXtxtGGA_SatsGGA_HDOPGGA_AltValueGGA_AltUnitGGA_SepGGA_SepUnitsGGA_AgeGGA_Diff

procRMC

RMC_UTCRMC_StatusRMC_LatitudeRMC_NSRMC_LongitudeRMC_EWRMC_SOGRMC_COGRMC_DateRMC_VariationRMC_Mode

procGSV

GSV_SATSINVIEWGSV_NOMGSV_MSGGSV_SATIDS(x)GSV_SATELE(x) GSV_SATAZ(x)GSV_SATSNR(x)

When GSV_NOM = GSV_MSG thenall data has beencollected. At that point you shouldset GSV_NOM = 0

procGSA GSA_SATMODEGSA_SATCOUNT

TABLE 1

FIGURE 7

FIGURE 8

FIGURE 9

FIGURE 11FIGURE 10

Simpson3.qxd 11/5/2007 3:48 PM Page 38

Page 39: Servo Magazine 2007-12

roll their own. Each of the programsparse the GGA, RMC, GSV, and GSANEMA commands. The main NEMAprocessor function is called ProcNEMA.This function calls four functions tohandle the parsing of these commands.Each function populates a set of globalvariables as shown in Table 1. Thesevariables map to the fields in the NEMAspecification. One exception is theGGA_FIXtxt variable, which contains anactual description of the FIX type.

Take a look at the Dispit functionshown in Program Snippet. Thisis the heart of the GPSLogDisplayprogram. This function is calledwhen the Start button is pressed. Thefunction opens the log file you haveselected, then enters a processingloop. In each iteration of the loop,the abort button is checked and a lineof data is retrieved from the log file. Ifthe end of the file is reached or the

‘———————————————‘Get and display the data‘———————————————func Dispit()

dim tstr as stringdim newtime as stringdim oldgpstime as string

FormMenu(0,0,0,””)FormButton(Disp_Start,-1,-1,-1,-1,”Abort”)

‘First Open the Fileif FileOpen(1,gfname,Open) = 0 then

msgbox(“Unable to open file: “+gfname,0,”Open File”)FormMenu(0,0,1,””)FormButton(Disp_Start,-1,-1,-1,-1,”Start”)exit()

endif

‘============================================================‘——- Main Data Display Loop ———————————————-loop:

if FormButton(Disp_Start,0) > 0 thenFileClose(1)FormMenu(0,0,1,””)FormButton(Disp_Start,-1,-1,-1,-1,”Start”)exit()

endif

if FileEOF(1) = 1 thenFileClose(1)Print “End of Data”FormMenu(0,0,1,””)FormButton(Disp_Start,-1,-1,-1,-1,”Start”)exit()

endif

‘——- Read a Line of data from Log File —————procNEMA(FileReadLine(1))

‘——- If we get a GGA message lets update the displaystrif NEMAmsg = “GGA” then

newtime=converttime(GGA_UTCTime,-5))FormLabel(Disp_time,-1,-1,-1,-1,newtime)Formlabel(Disp_Fix,-1,-1,-1,-1,GGA_FIXtxt)Formlabel(Disp_mode,-1,-1,-1,-1,GSA_SATMODE)Formlabel(Disp_sats,-1,-1,-1,-1,GSA_SATCOUNT)GSV_NOM=0GSV_MSG=0

if GGA_Fix <> 0 thenFormlabel(Disp_Longitude,-1,-1,-1,-1,GGA_Longitude+GGA_EW)Formlabel(Disp_Latitude,-1,-1,-1,-1,GGA_Latitude+GGA_NS)Formlabel(Disp_Alt,-1,-1,-1,-1,GGA_AltValue+GGA_AltUnit)Formlabel(Disp_Course,-1,-1,-1,-1,RMC_COG)Formlabel(Disp_Speed,-1,-1,-1,-1,Format(float(RMC_SOG *

1.1508),”.0”)+” mph”)else

Formlabel(Disp_Longitude,-1,-1,-1,-1,””)

Program Snippet

FIGURE 12

FIGURE 13

SERVO 12.2007 39

continued ...

Simpson3.qxd 11/5/2007 3:51 PM Page 39

Page 40: Servo Magazine 2007-12

40 SERVO 12.2007

abort button is hit, the file is closedand the function exits. Each lineretrieved from the log file is passed tothe procNEMA function and onlywhen a GGA message is received doesthe display get updated.

The plotit function in theGPSLogPlot program is very similar tothe dispit function, with the exceptionof how the GPS information is pre-sented. The plotit function uses a spe-cial command built into the Zeus lan-guages called GPSCVTLongitudedecand GPSCVTLatitudedec to convertthe GPS positional string data to aninteger value in degrees * 100000.This is a whole number that can beused for plotting.

One final variation of the dispitfunction is the StartCapture functionused in the GPSDataLogger program. Inthis function, a com port is opened andits parameters areset based onthe actual device

selected. The function also calls varioussetup functions to place the device intothe correct mode when needed. Insteadof calling the procNEMA function directly, data from the device is addedto a global variable called rxdat when it is received. A call is then made to a function called procdata. This functionpulls a single line (one at a time) fromthe rxdat variable and passes them tothe procNEMA command as before.

Sending Log Data

Plotting and displaying data iscool to play with, but the main reasonwe want to capture the data is so thatwe can simulate an actual GPS mod-ule or receiver. I have included a pro-gram called GPSLogOutput shown inFigure 13. GPSLogOutput allows youto play back the captured log data toa serial port. The program looks andoperates much like the GPSLogDisplayprogram, but also sends a copy of thecaptured data to a serial com port.You select the com port via theSettings menu shown in Figure 14.You can also set the baud rate andflag the data to be sent in real time.

Using the LogData with aMicrocontroller

Next month, when we startto interface the GPS modulesto a microcontroller, theGPSLogOutput program will beindispensable. In addition to

your PC, you willneed a DiosPro

‘DiosProg1.txtfunc main()

dim valhsersetup baud,HBAUD4800,start,txon

nodata:hserin nodata,valdebug val

goto nodata

endfunc

Program 1

FIGURE 14

FIGURE 15

FIGURE 16

Program Snippet continued ...

Formlabel(Disp_Latitude,-1,-1,-1,-1,””)Formlabel(Disp_Alt,-1,-1,-1,-1,””)Formlabel(Disp_Course,-1,-1,-1,-1,””)Formlabel(Disp_Speed,-1,-1,-1,-1,””)

endif

‘—- Used for realtime display optionstrif oldgpstime <> newtime then

oldgpstime = newtimeif realtime = 1 then pause(1000)

endif

endif

goto loop

endfunc

Simpson3.qxd 11/5/2007 3:51 PM Page 40

Page 41: Servo Magazine 2007-12

microcontroller and a carrierboard. I will be using theDios Workboard Deluxeshown in Figure 15. TheDiosPro has a UART builtinto the chip that has a TTLinterface. This is perfect forthe modules, but in order touse our PC as a simulator, youwill need an EZRS232 interface shownin Figure 16.

In order to use the GPSLogOutputprogram, you will need two serialports on your PC. One port will con-nect to the program port on theWorkboard and the other will connectto the EZRS232 module. Connect thefollowing pins on the EZRS232 module to the Dios Workboard asshown in Figure 17.

EZRS232 Pin 1 — Workboard VSSEZRS232 Pin 2 — Workboard VDDEZRS232 Pin 3 — Workboard Port 8EZRS232 Pin 4 — Workboard Port 9

Load code shown in Program 1into the DiosPro compiler and program the chip. Once loaded, startthe GPSLogOutput program and loadup one of the LogData files I haveincluded. Set the GPSLogOutput comport to the one that is connected tothe EZRS232 module. Set the baudrate to 4800 as shown in Figure 18.

Once this is done, hit the startprogram. You should see NEMA datain the debug terminal of the Dios compiler as shown in Figure 19.

It just so happens that theDiosPro already has a library calledDiosNEMA. It is automatically loadedwhen you place a call to theprocNEMA function in your Dios

program as shown inProgram 2.

This library willbreak down theGGA and RMC com-mands and load up a

FIGURE 19

FIGURE 20

‘Dios NEMA Proccessorfunc main()

clearhsersetup baud,HBAUD4800,start,txon,clearprint “Mode Lat Long Alt Speed Dir”print “—— ——- ——— ——- ——- ——-”

loop:procNEMA()

if NEMAcmd = 3 then ‘GGAif NEMAfix > 0 then

print NEMAfix,”:”,NEMAsats,” “,-6.0 NEMAlatmin,” “,NEMAlongmin;print “ “,6.1 NEMAaltitude,” “,4.1 NEMAspeed,” “,NEMAdir

elseprint “No Fix “,NEMAfix,”:”,NEMAsats

endifendif

goto loop

endfunc

include \lib\DiosNEMA.lib

Program 2

SERVO 12.2007 41

FIGURE 17

FIGURE 18

Simpson3.qxd 11/5/2007 3:52 PM Page 41

Page 42: Servo Magazine 2007-12

set of global variables that you canuse in your own program. In Program2, I used the print command to sendvarious pieces of NEMA data to thedebug terminal shown in Figure 20.

What’s Next

Next month, I’m going to showyou how to connect the various GPSmodules to the microcontroller and

how to parse the data.Be sure to check for updates

and downloads for this article atwww.kronosrobotics.com/Projects/GPS.shtml SV

The following is a breakdown of sourcesfor all the components needed forParts 1 through 4 of this project.

SPARK FUN ELECTRONICSEM-406A GPS Modulewww.sparkfun.com/commerce/product_info.php?products_id=465

EM-406 Evaluation Boardwww.sparkfun.com/commerce/product_info.php?products_id=653

EM-408 GPS Modulewww.sparkfun.com/commerce/product_info.php?products_id=8234

Copernicus Evaluation Board

www.sparkfun.com/commerce/product_info.php?products_id=8145

Nine-Pin Serial Cablewww.sparkfun.com/commerce/product_info.php?products_id=65

6V AC Adapterwww.sparkfun.com/commerce/product_info.php?products_id=737

External Antenna with SMA connectorwww.sparkfun.com/commerce/product_info.php?products_id=464

SMA to MMCX Adapter Cablewww.sparkfun.com/commerce/product_info.php?products_id=285

KRMICROSZeusProwww.krmicros.com/Development/ZeusPro/ZeusPro.htm

KRONOS ROBOTICSEZRS232www.kronosrobotics.com/xcart/product.php?productid=16167

DiosPro Chipwww.kronosrobotics.com/xcart/product.php?productid=16428

Dios WorkBoard Deluxewww.kronosrobotics.com/xcart/product.php?productid=16452

Parts List

42 SERVO 12.2007

Simpson3.qxd 11/5/2007 3:53 PM Page 42

Page 43: Servo Magazine 2007-12

Rewards and punishments can serve as fundamental motivations for learning. Think

of how you train your dog throughtasty treats or the occasional knockon the nose. Your robot isn’t much different. You can reward a robot forstaying on target or punish it for gettingout of line in much the same way.

Dogs already know how good atreat is and can associate the rewardwith their behavior. Robots, however,need to be taught what a rewardis and how to relate it to their actions. Reinforcement learning (RL) isa technique for educating your robotabout actions that are beneficial ordetrimental.

Let’s work with a barebones example. Say you want to teach your

robot to stop at a goal one foot in frontof it. You could program that behaviordirectly, but that approach could gettedious or tricky with more complexscenarios. What if you want the robotto find its way through a maze? Whatif you want the robot to find the quickest path through a range of terrains? Or the most opti-mal grip for an assortmentof drinking cups? Or theoptimal tilt angle to shoot aprojectile? RL can help.

First, you have to definea goal, actions, states,rewards, a policy for choos-ing actions, and a valuefunction for the states. In

general, for each time step t, an actiona is taken, the state s is updated, andreward r is given (Figure 1).

Let’s go back to the example ofstopping at a goal one foot in frontof a starting point. We will need asensor (e.g., odometry) that can returnhow far the robot has moved. Next,

by Karla Conn

SERVO 12.2007 43

FIGURE 1. Basic relationbetween a robot and

an RL environment.

Conn.qxd 11/1/2007 11:10 AM Page 43

Page 44: Servo Magazine 2007-12

44 SERVO 12.2007

we need to define the scenario (seeTable 1).

A program flowchart and the cen-tral loop of the corresponding examplecode are shown in Figure 2. Go towww.servomagazine.com to down-load RL_stand_alone_example.cpp forthe full C++ code. To begin the RL algorithm, we initialize the odometry,starting state, starting action, reward,and the values of the states. The robotwill begin stopped (a2) at a locationaway from the goal (s2) and then usethe policy to select actions. With eachaction taken, the state is updated anda reward is given based on the newstate. The objective is to take actionsthat lead to the current state matchingthe goal (s1).

While the current state is not the

goal, the robot takes actions basedon the policy (e.g., randomly). Then,sensors are used to determine thenew state and a reward is given. Valuesof the states (value_s1, value_s2)are updated based on the rewarduntil the search for the goal issatisfied. Once the goal is found, therobot can stop.

In the above example, say the firstaction randomly chosen is stop. Theodometry would be updated (i.e., lessthan one foot), and the state would beupdated based on the definitions (sinceodometry < one foot, new state = notgoal, represented by s2). Therefore,the reward given for the state wouldbe zero, and the value function wouldupdate the state value by addingthe current state value to the reward

(s2 = 0 + 0).Say the next action

randomly chosen is moveforward and the robotmoved at least a foot,then the odometry wouldread at least one foot ormore. The updated statewould be set to s1 (i.e.,since odometry ≥ onefoot, new state = goal).Therefore, the rewardgiven would be one, andthe value function wouldupdate the state value (s1= 0 + 1). The while loopwould be satisfied andsince the robot has foundthe goal, it can stop. Theresult is an educated set

of state values that can be used in later runs of the program to improveperformance.

Intrigued with how the algorithmworks? Impressed? Unimpressed?Perhaps. The above example outlines amere foundation for a valuable way toteach a robot. RL is valuable because itcan adapt to so many different situations and remains flexible enoughto accommodate a variety of goalsand/or state definitions.

In the remainder of this introducto-ry article, I will touch on some waysyou can compound on the basics setup so far and give examples of whereto try your own RL ideas. First, a bit offair warning. Your robot may need lotsand lots of iterations (maybe hundredsor thousands of runs, depending onthe application) before the RL algorithm settles on an optimal solution. So schedule adequate timefor your robot to learn, but don’t letthat word of caution stop you from giving your robot the means to learnon its own. Don’t be confined to thedefinitions in the above basic example,either. There are plenty of ways toexpand on the RL parameters.

For example, instead of randomselection, the policy can choose to

Start

Initialize Parameters

Goal Found?

Stop

Use Policy to Choose Action

Take Action

Update State Value

Update State

Give Reward

//Goal Found? while (current_state != s1) //Use Policy to Choose Action if (random_number < 5) current_action = a1; else current_action = a2; //Take Action if (current_action == a1) //execute move forward action else //execute stop action //Get new Odometry value in units of feet //Update State if (odometry >=1) new_state = s1; else new_state = s2; //Give Reward if (new_state == s1) reward = 1; else reward = 0; //Update State Value if (new_state == s1) value_s1 = value_s1 + reward; else value_s2 = value_s2 + reward; //Replace Current State with New State current_state = new_state; //Once current_state is the goal, stop current_action = a2; //execute stop action

Y

N

FIGURE 2. Programflowchart (left) andcentral while loop ofRL_stand_alone_example.cpp (right).

Goal: When odometry ≥ one footActions (a1, a2): a1 = move forward

a2 = stopStates (s1, s2): s1 = goal

s2 = not goalReward: If current state = not goal, reward = 0

If current state = goal, reward = 1Policy: Random selectionValue: New state value = current state value + reward

Table 1

Conn.qxd 11/1/2007 11:11 AM Page 44

Page 45: Servo Magazine 2007-12

move into states with the highestvalue. Preference could also be setto choose moving forward, turningleft, etc. Modifications can certainlybe made to the definitions for statesand actions. Also, initializing thestate values to zero is common, butassigning specifically-chosen values orrandomly populating state values ispermitted.

Rewards can also be negative(punishments) to penalize states thatmove away from the goal, and anypiece of data which you wish to maximize or minimize can be used aspart of the reward function. Forinstance, what if you want your robotto learn to choose actions which findthe goal quickly? Incorporate a variableto represent time or the number ofsteps taken to find the goal in a negative reward function (reward = -full_reward*time_step). A slightly negative step-based reward is like giving your robot a little kick at eachstep toward the goal, training it tohurry up and find the goal faster.

A constructive addition to an RLalgorithm is the combination of statesand actions into state-action pairs. Thisconcept is called Q-learning, whereQ(s,a) represents the value of takingaction a in state s. This way, the rewardfunction rewards the state-action pairthat caused the action to move from anon-goal state into the goal state.

Multiple runs can develop theQ(s,a) values for all state-action pairs in

a task until the optimal solution isfound. Even if the optimal solution isnot found (due to equivalent solu-tions), each run can refine the Q(s,a)values towards closer representationsof the true value of taking action a instate s.

Table 2 shows a set-up for an RLalgorithm with (i) a policy with a pref-erence for moving forward, (ii) multiplestates besides the goal, and (iii) aslightly negative step-based rewardfunction. A full example of this C++code (RL_expanded_example.cpp),including a random population of thestate values and state-action pairs, canalso be downloaded from www.servomagazine.com.

Once mastered, you can use thisalgorithm in loads of applications. Yousimply need a task with a goal. Thenyou define your states, actions,rewards, policy, and value function. Sayyou want your robot to learn how tocoordinate its leg movements to crabwalk. Define plausible states andactions, and set a reward functionbased on forward movement. Then letyour robot loose to learn. Give yourrobot plenty of chances to find thegoal, and you’ll have a self-sufficientrobot in no time.

Once your robot can learn to associate rewards with its actions, challenge it to a duel of who can findthe quickest path through a maze orover rough terrain. Reward yourselfand your robot accordingly. SV

SERVO 12.2007 45

Goal: When odometry ≥ two feetActions (a1, a2, a3): a1 = move forward

a2 = stopa3 = move backward

States (s1, s2, s3, s4): s1 = goal (odometry ≥ two feet)s2 = not goal (two feet > odometry ≥ one foot)s3 = not goal (one foot > odometry ≥ zero feet)s4 = not goal (zero feet > odometry)

Reward: If current state = s4, reward = -8*time_stepIf current state = s3, reward = -4*time_stepIf current state = s2, reward = -1*time_stepIf current state = s1, reward = 100

Policy: 60% move forward, 30% highest state-action pairvalue, 10% random

Value: New state-action pair value = current state-actionpair value + reward

Table 2

Conn.qxd 11/1/2007 11:11 AM Page 45

Page 46: Servo Magazine 2007-12

46 SERVO 12.2007

It is an appealing thought to have arobot that can be instructed how toperform a task by simply showing it

what to do. It would save a lot of timeotherwise spent on programming therobot. The concept to simplify robot pro-gramming by giving the robot abilities tomimic tasks shown by the user is calledProgramming by Demonstration, or PbD.

In future applications whererobots are assumed to be found everywhere in our life it would also beadvantageous to give them instructionson exactly how we want a task performed simply by showing the task.Another reason to try simplifying robotprogramming is that smaller enterpris-es with shorter production series might

then become interested in automatingtheir production.

Motion Capturing

The first step in the PbD process is tocapture the data. That is, record and storethe motions performed by the humandemonstrator and their impact on theenvironment. Several options usingdifferent measurement principles areavailable for this purpose. If a vision-based system is used, the human canmove without too many constraints Thesesystems require rather heavy imageprocessing, though. In most cases, thesystem tracks different markers attachedto certain body parts and the limb motion

is reconstructed with the help of akinematic model of the human body. It isalso possible to extract human bodymotions directly from raw image data.

Another option is to use a dedicatedwearable motion capturing system(popular for movie making and analyzingmotion in sports). The measurementsystem is firmly attached to the areas ofthe body that need to be captured. Thistype of system requires less dataprocessing, however, the user cannotmove as freely. Another catch is the price;for example, a reliable six degree offreedom tracker starts at about $10,000!

Another issue with a wearable datacapturing system is that the informationthe sensors can pick up is limited to a

Programming By Demonstrating Robots

TASK PRIMITIVES

It iis rrelatively eeasy ffor hhumans tto iimitate aa ttask sshown tto uus. TThis aability ttoimitate iis wwell ddeveloped bboth iin uus aand iin oother pprimates, bbut rrarely ffound iin

other aanimals. TThink oof aa ppet; iit iis nnot sstraightforward tto jjust sshow yyour ddog hhowto ffetch tthe nnewspaper. SSo, iit sshould bbe nno ssurprise tthat iit hhas bbeen vvery hhard

to ddesign aa rrobot wwith tthe ssame iimitating ccapabilities aas hhumans.

by Alexander Skoglungand Boyko Iliev

Skoglund.qxd 11/5/2007 4:01 PM Page 46

Page 47: Servo Magazine 2007-12

specific area. For example, a glove willonly provide data on the finger’sconfiguration; no data will be availableon hand position and orientation, orobjects in the sensor’s vicinity. Basically,the sensor is ”blind” to the environment.

Data fusion — to combine severalinputs into a single source — is oftennecessary in order to gather informationsurrounding the motion capturingdevice. In structured environments(such as factory lines), CAD models canbe used to aid the data capturinginstead of using more sensors.

Task Primitives

Another important aspect toconsider is what your robot is capable of.The mechanical structure of the robotwill determine what tasks and motions itcan perform. For example, Figure 1shows a six degree of freedom robotarm with the elbow in an up position.

It is important to distinguishbetween tasks and motions. Returningto the example of a dog fetching yournewspaper, the dog can perform therequired task, but in a different way (ormotion) than you would since dogsdon’t have hands. (Of course, youcould do it the same way as your dog).The difference between human androbot body configurations means thatthe robot may be able to perform atask, but not with the same motion asa human. Therefore, the human needsto know how the robot behaves.

To approach the problem ofdifferent body configurations, there aretwo assumptions to be made that willsimplify the process. First, the human’sand robot’s end effectors (the human’shand and the robot’s gripper) can beassociated with each other. Second, thetask can be seen as a set of subtasks.

In the the case of subtasks,consider a fairly general task such asPick-and-Place commonly performed byindustrial robots. Break the task downinto smaller building blocks: Move-To-Point, Move-Linearly-To-Point, Move-Along-Path, Approach-Object, Grasp-Object, Release-Object, and so on.Given a clever design of these buildingblocks, a great number of tasks can bedescribed by a small set of task

primitives. Each of these buildingblocks can be seen as small robotprograms that — when put in sequence— will produce a full task.

One of the big challenges in PbD ishow to map the demonstrated task tothese primitives. Researchers arecurrently trying to solve the dauntingchallenge of how a robot should learncompletely new and novel tasks from aset of predetermined primitives. For anindustrial robot that only performs Pick-and-Place operations, learning noveltasks is clearly requesting too much.

A number of basic facts about thetask are usually known in advance. In a Pick-and-Place operation, the robotstarts from a certain position, moves toan object, grasps the object, moves theobject to a new location, releases the

object, and moves away from it. It isour belief that future manipulatorsshould be simple to program and havethese basic behaviors built in.

To simplify mapping from thedemonstration of primitives, we make theassumption that the robot’s end-effectoris corresponding to the demonstrator’shand; by doing so, we indirectly tell therobot that only the human’s endeffector’s trajectory is of importance.

Besides recording the endeffector’s motion path, the velocityprofile (Figure 2) provides importantinformation about where the motionsegments start and end.

In a Pick-and-Place task, we knowthe order of sub-tasks (illustrated inFigure 2). The first detected point isassociated with the location to pick up

FIGURE 1. The manipulator in our experimentalsetup, an ABB IRB140 equipped with a vacuumgripper. A video of the task being performed is available at AASS Learning Systems Lab’swebpage: www.aass.oru.se/Research/ Learning/.

SERVO 12.2007 47

Skoglund.qxd 11/5/2007 4:02 PM Page 47

Page 48: Servo Magazine 2007-12

48 SERVO 12.2007

an object; the second location is whereto place the object. The trajectorybetween these two locations should beimitated, but the start and end pointsare not important since they are notactually parts of the task. However, thesegment on the trajectory just beforethe grasp and after the release shouldbe imitated to preserve the way thegrasp is performed.

When the different variables (suchas locations, velocities, and orientations)of the task are determined, thesequence of instructions is transferred tothe robot controller. The sequence couldlook like this:

1) <Move-To-Point 640,30,80> 2) <Grasp-Object 640,30,20> 3) <Move-Along-Path 648,25,87> 4) <Move-Along-Path 647,28,90>

By doing so, we assume the lowercontrol levels of the manipulator, suchas inverse kinematics, constraints ofthe workspace, generation of thetrajectory with a higher granularity,etc., to execute the requestedcommands in the proper way.

It is important to note that otherprimitives than these can be used.For example, some tasks require therobot to reorient an object, turn anobject several times (assembly tasks),and so on. Consider the capabilitiesof the robot; what motions can therobot do and what motions areimpossible?

The primitives are small pieces ofprogram code that should reflect whatthe robot can do and how it would doit, and the human demonstrations putthese pieces together in a sequence.

A comparison can be made to aprogramming language, made up by asmall set of instructions, from whichlarge programs can be written. In thiscomparision, these task primitives arean attempt to add some high-levelfeatures to robot programming.

An Example ScenarioLet’s look at how to teach an

industrial robot equipped with avacuum gripper to execute a Pick-and-Place task. Inside the gripper, a springwith a switch is mounted to detectresistance when picking or placing anobject (illustrated in Figure 3). Thesteps from the demonstration to arobot program would be:

1) A human demonstration is capturedand transformed into the robot’sreference frame.

2) Trajectories are segmented toextract the points where the motionsstart and end.

3) Extracted motions are decomposedinto task primitives.

4) Each task primitive is automaticallytranslated into robot-specific code.

5) The complete task is executed by the robot.

It is important to note for Step 4that the task is known in advancewhich makes it possible to describe thetask as a predetermined sequence oftask primitives. These task primitivesare designed specifically for the robot,but can be executed on most sixdegree of freedom serial manipulators.

The primitives controlling thegrasp and release are specific to the

0 1 2 3 4 5 6 7 8 9 100

100

200

300

400

500

600

700

Mea

n S

qu

ared

Vel

oci

sty

(mm

)

Time (sec)

GraspObject

MoveToPoint MoveToPoint

MoveAlongPath

MoveAlongPath

MoveAlongPath

ReleaseObject

First motion Second motion Third motion

d

uSet point

Starting point

l

Gripper

Spring

FIGURE 2. The blue line is the meansquared velocity from a humandemonstrator, recorded from thefingertip at 12 Hz. The green verticallines are the detected start of a motion,where the velocity profile is over acertain threshold and the increase is overa certain level. In a similar way, the redvertical lines are the end of a motion.

FIGURE 3. The vacuumgripper with the springswitch; d is the distancebetween the target pointand the starting point,and is dependent of thesensor inaccuracy, u. Whenthe spring is compressedand the switch turned on,the downward motionimmediately stops and thesuction is turned on.

Skoglund.qxd 11/5/2007 4:02 PM Page 48

Page 49: Servo Magazine 2007-12

type of gripper used. Furthermore, we assume that the demonstrator isaware of the manipulator’s structure,such as workspace boundaries andpossible motions.

The demonstration is done underthe assumption that the teacher’s indexfinger is associated with the suction cupof the gripper. During demonstration,the fingertip is tracked by a motioncapturing device, shown in Figure 4.

Initially, the demonstrator movesfrom a starting point, P0, to the desiredpick-point, Ppick (Figure 5). Then, he/shemoves along a certain path towards thedesired place-point, P0, and finally, backto the end position Pw(t).

The collected data consists ofposition coordinates used for twopurposes: to detect the Pick-and-Placepositions, Ppick and Pplace, and toreconstruct the desired trajectory thatthe robot should travel from Ppick to Pplace.

The decomposition of a Pick-and-Place task into task primitives isillustrated in Figure 2. By using primitivesreflecting the commands available in therobot language of the manipulator, weachieve a simple implementation. In thisparticular scenario, the followingprimitives are used:

• Move-Linearly-To-Point moves themanipulator’s end effector linearly(Cartesian space) to the desired pointin the workspace.

• Move-To-Point moves themanipulator’s end effector to the pointwhere it can ”hook on” to thedemonstrated trajectory.

• Move-Along-Path follows ademonstrated trajectory by taking asequence of points with relativelyhigh granularity as the input, andthen executing an interpolated motionbetween these points.

• Grasp-Object moves towards anobject using a ”search” motion (due tothe uncertainty of the object’s location)and grasps the object. A search motionmoves the gripper slowly towards the object until contact is detected by the touch sensor and the motion is stopped.

• Release-Object is similar to Grasp-Object, but releases the objectinstead.

The two first primitives aretypically implemented on standardindustrial manipulators as instructions,since most manipulators would be oflimited use without such basicinstructions. The last three primitivesare not normally part of theprogramming language for industrialrobots, so it’s a benefit to add them tothe repertoire.

A “Primitive” ExampleNow let’s take a closer look at the

task primitive Grasp-Object. Beforeperforming a grasp operation, the

For those interested, check out the coverage listed below on the subject ofrobot learning from demonstration:

• Robotics and Autonomous Systems,vol. 47, no. 2&3 (2004).

• Robotics and Autonomous Systems,vol. 54, no. 5 (2006).

• Neural Networks, vol. 19, no. 3 (2006).

• IEEE Transactions on Systems, Man, andCybernetics, vol. 37, no. 2 (2007).

Visit the AASS Learning Systems Lab’swebpage at www.aass.oru.se/Research/Learning/. More details on the subjectin this article can be found in the paper:

A. Skoglund, B. Iliev, B. Kadmiry, and R.Palm. Programming by Demonstration ofPick & Place Tasks for IndustrialManipulators using Task Primitives in theProceedings of the IEEE InternationalSymposium on ComputationalIntelligence in Robotics and Automation(CIRA), Jacksonville, FL, 2007.

Further Reading

0

w(t)

Pplace Ppick

L (t)w

L0

P

P

FIGURE 4. The 6D-tracker mountedon a data glove that was used tocapture the human demonstration.

FIGURE 5. The dottedline is the demonstratedpath, starting at P0 goingto P0w (t)$, via Ppick and

Pplace. The solid line isthe robot path with the

different starting location,L0, executing the graspand release primitives

just above the Pick-and-Place points, respectively.

SERVO 12.2007 49

Skoglund.qxd 11/5/2007 4:02 PM Page 49

Page 50: Servo Magazine 2007-12

approach phase of the gripper towardsthe object must be performed. Theposition and orientation of the tableare known since the manipulator ismounted on a table, like the robot inFigure 1. However, the height of theobject to be grasped is unknown dueto the uncertainty of the sensor, thusthe approach primitive has to deal with uncertainty.

When performing a grasp

operation, the manipulator is given agoal position to move towards theobject and search for contact with it.When a certain resistance is detected(that is, a compliant spring iscompressed to a certain length) themotion stops. The starting point isdetermined by the distance, d, derivedfrom the inaccuracy of the sensor thatperforms the motion capturing. Theretracting motion is the same as the

approach but in reverse.Since the grasp and release

primitives are actually the same — butwith one binary input variable todecide whether to grasp or release —this pays off in the design process.

Conclusion

Task primitives link high-levelhuman instructions to particularrobot/gripper functionalities. By usingtask primitives, the programming of arobot becomes faster and simpler,which is one goal of the PbD concept.

One drawback to PbD is thatmotion capture systems with highaccuracy are expensive. Either PbDneeds to become less sensitive toinaccuracies (for example, by use ofinformation from additional sensors andintelligent environments) or the pricefor accurate sensors needs to drop.

Another problem is that manymotion trackers use magnetic fields forpositioning and therefore suffer fromdegrading accuracy when they’re closeto large metal objects or electricmotors generating magnetic fields.

Alternative trackers are vision basedor use optics instead of magnetic fields.Intelligent environments containing RFIDtags, passive location sensors, and othersensory units can be a complement to motion capturing sensors wheninterpreting the environment.

One can also think of solutionswhere more than one primitive can beactive at the same time.

For example, a gripper can havetwo primitives for approaching anobject from two orthogonal directions.By blending them, one can achievereaching motions that approach theobject from an arbitrary direction.

Some of the current research on the topic addresses the problem of action classification where the motionsperformed by the demonstrator arerecognized automatically. However, thedesign of various task primitives is stillneeded. The challenge of designing fullyautonomous robots is finding a way toenable the robot to generate new taskprimitives through learning, development,and interaction with humans and thesurrounding world on its own. SV

50 SERVO 12.2007

Skoglund.qxd 11/6/2007 1:53 PM Page 50

Page 51: Servo Magazine 2007-12

Whether they be fact or fiction,you don’t see many thingsrobotic moving about with

trailing AC line cords. As a matter offact, if you classify today’s smartweapons as ‘bots, the only seriousmobile mechatronic devices that I canthink of that may still trail a wire arethe early wire-guided anti-tank missiles.

Will Robinson’s buddy didn’t draga cable around. Come to think of it, oldRobby didn’t have a “tail,” either.That’s because Will and Robby lived ina time when battery technology wasvery good. You are fortunate as ourbattery technology today isn’t tooshabby, either. However, even with thebest of batteries, there is a possibilitythat you can lose important pieces ofdata that your mechatronic creation

has learned or sensed when its “lightsgo out.”

On the other hand, if your rovingpile of mechanical parts and transistorsis not a hunter-gatherer, you will come to find it a royal pain to reload those special parameters andconfiguration data that are kept in therobot’s volatile SRAM every time thebattery goes south.

In many instances, EEPROM is theanswer. However, if you have tochange your precious data too often,you’ll eventually wear out the EEPROMcells. And, even though EEPROM is agood way to store nonvolatile data,sometimes there just isn’t enough EEPROM available to do the job.

If EEPROM densities are too smallfor your application and you don’t

want to design in a hard drive or battery-backed SRAM, the real (and simple) answer to reliable nonvolatilestorage is Ferroelectric Nonvolatile RAM.

The RAMTRON FM21L16

We are about to embark upon aproject that will tie a RAMTRONFM21L16 Ferroelectric NonvolatileRAM (FRAM) device to a 16-bitPIC24FJ128GA010. The FM21L16 isorganized as 128K x 16. This 16-bitFRAM configuration melds well withthe 16-bit PIC24FJ128GA010. If yourapplication does not require or cannothandle a 16-bit data bus, the FM21L16can be configured to run in eight-bitmode, which doubles the availableFRAM to 256K x 8.

SERVO 12.2007 51

Put a new memory technologyto work in your robot!

Using FRAM FRAM forNon-Volatile

Storage

Using forNon-Volatile

Storage

by Fred Eady

Eady.qxd 11/6/2007 9:34 AM Page 51

Page 52: Servo Magazine 2007-12

RS-

232

CO

NN

ECTO

R

NO

TES:

1. 1

0MH

z os

cilla

tor =

DIG

I KEY

490

-119

6-1-

ND

2. V

CAP

= D

IGI K

EY 5

11-1

447-

1-N

D3.

Y1

IS O

PTIO

NAL

AN

D IS

NO

T IN

STAL

LED

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10

A11

A12

A13

A14

A15

A16

DQ

0D

Q1

DQ

2D

Q3

DQ

4D

Q5

DQ

6D

Q7

DQ

8D

Q9

DQ

10D

Q11

DQ

12D

Q13

DQ

14D

Q15

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10

A11

A12

A13

A14

A15

A16

DQ

0D

Q1

DQ

2D

Q3

DQ

4D

Q5

DQ

6D

Q7

DQ

8D

Q9

DQ

10D

Q11

DQ

12D

Q13

DQ

14D

Q15

WE

OE

CE

UB

LB

WE

OE

CE

LB UB

PGC

PGD

MC

LR

RXI

N

TX

TXO

UTTX RX

TXO

U TR

XIN

RX

3.3V

DC

3.3V

DC

3.3V

DC

3.3V

DC

C11

.1uF

+C

1022

0uF

C12

.1uF

U2

FM21

L16

1920212224252627

17 40

42434412345

641

7 298 309 3110 3213 3514 3615 3716 38

3918

11 33 12 3428 23

A15

A14

A13

A12

A11

A10A9A8

WE

UB

A7A6A5A4A3A2A1A0

CE

OE

DQ

0

DQ

8

DQ

1

DQ

9

DQ

2

DQ

10

DQ

3

DQ

11

DQ

4

DQ

12

DQ

5

DQ

13

DQ

6

DQ

14

DQ

7

DQ

15

LBA1

6

VDD

VDD

VSS

VSS

ZZ NC

C2

.1uF

C3

.1uF

C4

.1uF

C9

.1uF

C5

.1uF

C8

.1uF

C6

.1uF

C7

.1uF

U3

SP32

32

13 8 10 11 1 345

2612 9 14 7 15

16R

1IN

R2I

N

T2IN

T1IN

C1+

C1-

C2+C2-

V+V-

R1O

UT

R2O

UT

T1O

UT

T2O

UT

VSS

VDD

R1

10K

Y1 OPT

ION

AL

C17

.1uF

U1

PIC

24FJ

128G

A010

1

23 4 5 6 7 8 910 11 12

1516 17

18

30 31

32 33 34 35

3637

4849 50

51 52535455 9175 92

9798 99 100 71

64

57

272928

706981 8014

65

82

40

41 42 43 44

4546

477978777619 202122232425

26

72 73 749594

6766 6362 61605958

6890 89

888786 85

84

38

83

39

56 9693

13 52 51R

G15

VDD

RE5

RE6

RE7

RC

1R

C2

RC

3R

C4

RG

6R

G7

RG

8

VSS

VDD

RA0

RE8

AVD

D

AVSS

RB8

RB9

RB1

0R

B11

VSS

VDD

RD

15

RF4

RF5

U1T

X

U1R

X

RF8

RF7

RF6

RA6

VSS

RA7

RG

13

RE2

RE3

RE4

RD

11

OSC

2

RG

2

RB7

/PG

D

RA1

0R

A9

RD

10R

D9

RD

4

RD

13

RG

9

VSS

RD

5

RF1

2

RB1

2R

B13

RB1

4R

B15

VSS

VDD

RD

14

RD

12

RD

3R

D2

RD

1

RE9

RB5

RB4

RB3

RB2

RB1

RB0

RB6

/PG

C

RD

0

RC

13R

C14

RG

14

RE1

RA1

5R

A14

OSC

1

VDD

RA5

RA4

RA3

RA2

RD

8

RG

0R

G1

RF1

RF0

ENVR

EG

VCAP

RD

7

RA1

RD

6

RF1

3

RG

3

RG

12

RE0

MC

LR RF2

RF3

ICSP

CO

NN

ECTO

R

123

456

123

456

R2

100

+C

110

uF

C13

.1uF

C16

.1uF

C14

.1uF

R3

1K

C15

.1uF

DB9

FEM

ALE

12

34

56

78

9

12

34

56

78

9

52 SERVO 12.2007

SCHEMATIC 1. As you can see,there are plenty of open pinsjust waiting for you to connectthem to something in yourFRAM project.

Eady.qxd 11/6/2007 9:34 AM Page 52

Page 53: Servo Magazine 2007-12

As you’ve probably already ascer-tained, the FM21L16 does not requirea battery to retain the data containedwithin its memory cells. Otherwise, theFM21L16 reads and writes just like apiece of standard volatile SRAM. Oncethe power is removed from theFM21L16, it can hold on to the data inits possession for a minimum of 10years. Before you decided to put yourFM21L16 into a deep sleep, you canissue up to 100,000,000,000,000read/write cycles to the device with no concern for loss of data due tomemory cell damage.

I still have fond memories of hang-ing 2KB chunks of SRAM from the pinsof 8748 and 8751 microcontrollers.The very first of Microchip’s PIC17CXXseries of microcontrollers I wasexposed to were supported with standard UV-erasable EPROM devices,whose pin layouts resembled theirSRAM counterparts. So, I’m glad to seethat the FM21L16 has followed in thetraditional footprint path that was initiated back in the day by Intel’s lineof industry standard EPROM devices.The FM21L16’s industry standard padlayout allows the FM21L16 to bedropped into the space that a standard128K x 16 volatile SRAM device wouldtake up.

In addition to being durable, theFM21L16 is fast; 60 ns reads can be initiated using the FM21L16’s active-low CE pin or by simply changing theaddress. To prevent accidental datacorruption, the FM21L16 utilizes a lowvoltage monitor that blocks access tothe FM21L16’s memory array whenthe power rail drops below a specifiedvoltage.

If you don’t want your FRAM-equipped mechanical device’s computing device to overwrite critical

data within the FM21L16, you have theability to write protect any of theFM21L16’s eight uniform 16K x 16memory blocks. The FM21L16 is toughenough to ride in the electronic compartment of an automobile. Thatmeans it would prove to be a verymacho part inside of your mechanicalanimal, as well.

Designing the FRAMController

I don’t know about you, but I loveto put electronic stuff together fromscratch. So, let’s design and build aPIC24FJ128GA010-based controllerthat is equipped with a serial port anda FM21L16 FRAM device. Before we

begin, it might be a good idea toexamine the FM21L16’s pinout andunderstand what we need to design into read and write to the FM21L16’smemory cells. I’ve provided a schematic for you to reference as wediscuss the FM21L16’s control pinsand I/O lines.

Naturally, we will have to deal withassigning the FM21L16’s 17 addresslines to PIC24FJ128GA010 microcon-troller I/O pins. The PIC24FJ128GA010does not support 17-bit I/O port configurations. However, there are acouple of 16-bit ports and a few otherI/O ports with a minimum of 10 available I/O positions. The trick is toselect the port that is easiest to accessin relation to the FM21L16’s address

SERVO 12.2007 53

SCREENSHOT 1. Using a four-layer printedcircuit board eliminates the need to

route power and ground connections toeach hardware device. The latest version

of ExpressPCB allows the inner layers tobe cut into areas. Being able to separate

the inner power and ground layers isgreat if you have to run multiple

voltages or separate ground planes.

SCREENSHOT 2. Every power andground connection has been assigned to

a power or ground plane in this shot.

Eady.qxd 11/6/2007 9:35 AM Page 53

Page 54: Servo Magazine 2007-12

pin layout. Also, we’ll need to get as many address lines from a single PIC24FJ128GA010 I/O port aspossible. Following some brain bash-ing, I selected the PIC24FJ128GA010’sPORTE for the first 10 bits of theFM21L16’s 17-bit address require-ment. The remaining seven bits of PORTB will be used to complete the PIC24FJ128GA010’s 17-bit address bus.

The PIC24FJ128GA010’s PORTB isa 16-bit I/O port. However, I’ve usedseven of its bits as address lines.Fortunately, I still have a complete 16-bit I/O port that I can apply to theFM21L16’s 16-bit data bus. As you cansee in the schematic, I’ve assigned thePIC24FJ128GA010’s 16-bit PORTD I/O

port to handle the FM21L16 data bus duties.

The FM21L16’s CE (Chip Enable)pin is used to select the device andbegin a new memory access. Takingthe FM21L16’s CE pin low while holding the FM21L16’s ZZ input highwill kick off a memory access event.The ZZ (Sleep) pin is an important oneif your project needs to conservepower. I decided not to dedicate aPIC24FJ128GA010 I/O pin to the ZZinput, which also eliminates us fromhaving to write some ZZ code to support it. If you decide to use the ZZpin, be sure you understand how itrelates to the FM21L16’s CE pin.

The FM21L16 datasheet recom-mends that the ZZ input be tied to Vdd

when it is not utilized. As you can seein the schematic, I follow directionsvery well. The address data on theFM21L16’s address bus is latched internally on the falling edge of theFM21L16’s CE. The FM21L16 has aspecial feature that allows page modereads while the CE pin is low by manipulating the two least significantbits of the address bus. I simply chose the most convenientPIC24FJ128GA010 I/O pin for theFM21L16’s CE line. Since we canchoose to manipulate the CE pin or tieit to a logic low level, I designed in ajumper that connects the FM21L16’sCE pin to the PIC24FJ128GA010 ordirectly to ground.

As with the CE pin selection, thereis absolutely no science behind myselection of the FM21L16’s WE (WriteEnable) line connection. A FM21L16write cycle is initiated when the active-low WE pin is driven to a low logiclevel. Data on the FM21L16’s data busis written into the FM21L16’s memorycells on the rising edge of the WEpulse. The initial high-to-low logic leveltransition of the WE pin is used to latchin the new column address for pagemode write cycles.

I decided to control the FM21L16’sOE (Output Enable) line simply becauseI can. The FM21L16’s active-low OE lineallows the contents of the FM21L16’sdata bus to be exposed to thePIC24FJ128GA010’s PORTD I/O pinsduring read operations. Driving theFM21L16’s OE line to a high logic levelwill tri-state the FM21L16’s data bus.

In this project, I could have simplytied the OE line low. I figure we’ll writethat one instruction to drive RG3 lowand never touch the I/O pin again. Ifyou have other things competing forthe PIC24FJ128GA010’s data bus, you must utilize the FM21L16’s OE control pin.

The UB (Upper Byte) and LB

SCREENSHOT 3. The FRAM is located on the far right of this shot. Note that Iattempted to route all of the top traces(red) horizontally and all of the bottomlayer traces (green) vertically.

SCREENSHOT 4. The hard work is done.All of the 17 address lines and 16 datalines are in place in this shot.

54 SERVO 12.2007

Eady.qxd 11/6/2007 9:35 AM Page 54

Page 55: Servo Magazine 2007-12

(Lower Byte) FM21L16 control pins arevery interesting. Depending on howyou drive UB and LB, you can read andwrite the most significant byte only orread and write the least significant byteonly or read and write all 16 bits of theFM21L16’s data bus. Taking theFM21L16’s UB pin high will tri-state themost significant byte (DQ15:8) of theFM21L16’s 16-bit data bus. Conversely,a high logic level applied to the LB control pin will tri-state the least significant byte (DQ7:0) of theFM21L16’s 16-bit data bus. There wasno way I was not going to put somePIC24FJ128GA010 control behindthese two FM21L16 control bits.

The FM21L16 wants to see a volt-age rail that resides between 2.7V and3.6V. The absence of a voltage regula-tor circuit in the schematic leads one to the conclusion that I’m supplyingthe FRAM’s and PIC24FJ128GA010’spower via a 3.3V wall wart.

We’ll have no way of knowingwhat’s inside the FRAM without havingsome way of communicating the stateof the data at a certain address to ahuman. I’m still on the fence aboutthrowing away my RS-232 interface fora USB interface. So, what you see inthis design is a standard 3.3V RS-232interface driven by a tried and trueSP3232 circuit.

All that’s left to do is assign a 0.1µF power supply bypass capacitor toeach Vdd pin in the design and con-nect the PIC24FJ128GA010’s internalvoltage regulator capacitor betweenVcap and ground. Note that thePIC24FJ128GA010’s ENVREG (EnableVoltage Regulator) pin is tied logicallyhigh to enable the PIC24FJ128GA010’sinternal voltage regulator circuitry.

It all looks good on paper. So, let’stranslate the schematic’s contents to aphysical device.

Building up theController

I used the services of ExpressPCBto design and fabricate our FRAM controller printed circuit board (PCB).To make things easy, I opted to put the FRAM hardware down on a four-layer PCB.

The very first thing I do after determining a preliminary layout is assign and make the power connec-tions to the PCB’s inner planes.Connecting pins to the power andground planes of a four-layer PCB is asimple ExpressPCB procedure. Take alook at Screenshot 1. I’ve laid in a0.026” via, connected it to the appropriate PIC24FJ128GA010 power

pin, selected the via, right-clicked onthe via, and assigned the via connec-tion to the power plane of the PCB. Iperformed the power and groundassignment task against all of thePIC24FJ128GA010, FRAM, SP3232,and ICSP power pins. The entire set ofFRAM controller power plane connec-tions can be seen in Screenshot 2.

The schematic really organizesthings nicely. However, you’re readinga technical magazine and I know youwant the skinny on the actual PCBdesign. So, I’ve chronicled the FRAMPCB layout process in a series of screencaptures for your enjoyment.

After I laid in the power andground connections, I took on the taskof routing the 17-bit address bus. Note

SERVO 12.2007 55

SCREENSHOT 6. This is a shot of the MPLABWatch window following a run of the

MAIN ROUTINE. If you take a pencil tothe PORTB and PORTE bits, you’ll see thattogether they form an address of 0x1FFFF.

SCREENSHOT 5. Sometimes even a blindhog finds an acorn. Everything fits andeverything is connected. The next step

involves getting the board manufacturedand getting it populated.

Eady.qxd 11/6/2007 9:36 AM Page 55

Page 56: Servo Magazine 2007-12

that in Screenshot 3 I attempted wherever possible to routethe top layer traces horizontally in relation to the bottomlayer traces, which are routed vertically. You can see thatattempting to route in power and ground traces would havemade this PCB design task take on a certain odor of ugly. Another advantage to using a four-layer PCB is that theinternal ground plane reduces electronic noise in the FRAMcontroller’s circuitry.

Screenshot 4 folds in the 16-bit data bus connectionsbetween the PIC24FJ128GA010 on the left and theFM21L16 on the right of the shot. You never know until youget deep into it if your preliminary device layout will actuallywork out. From the looks of Screenshot 4, we may havelucked out.

The rest of the connections to the FRAM control pins,the RS-232 port, and the ICSP programming/debugging portcan be seen in the full-board capture represented inScreenshot 5. Four days later, everything that you now see aspaper and electronic images becomes reality in Photo 1.

I check my PCB designs over at least 10 times before submitting them for manufacture. As it turned out, I foundthree minor mistakes that I corrected after photographingthe FRAM controller board. The ExpressPCB PCB layout file I have provided for you via the SERVO website (www.servomagazine.com) incorporates all of the corrections. Be aware that the FRAM controller PCB you see in Photo 1 is aprototype version. If you want the pretty silkscreen and solder mask, order a production version of the FRAM PCB. Also, before submitting your FRAM controller PCB formanufacture, remove or move the silkscreen legends I placedon the pads of the resistors and capacitors to allow for reliable soldering.

Now that we’ve taken our FRAM controller from paperto printed circuit board, let’s give it some smarts.

FRAM Cram

Although you see a ceramic oscillator module in Photo 1,we won’t be using it. Instead, we will use the

PIC24FJ128GA010’s internal Fast RC Oscillator (FRC). We’ll boost the PIC24FJ128GA010’s native FRC from itsdefault 4 MHz to 16 MHz using the PIC24FJ128GA010’sinternal 4X PLL.

The Microchip C30 C compiler will be our firmware vehicle and we’ll use the Microchip REAL ICE as our programming/debugging platform. Both the C30 C compilerand the REAL ICE will fall under the command of Microchip’sMPLAB IDE. Let’s begin the firmware creation process by assigning firmware variables to the actual hardware connections. Here’s the code:

//******************************************************//* FRAM CONTROL PINS//******************************************************#define WE LATGbits.LATG2#define OE LATGbits.LATG3#define CE LATCbits.LATC14#define LB LATFbits.LATF4#define UB LATFbits.LATF5

//******************************************************//* DATA BUS DEFINITIONS//******************************************************#define data_in PORTD#define data_out LATD#define data_lo 0#define data_hi 1#define rd_data TRISD = 0xFFFF#define wr_data TRISD = 0x0000

//******************************************************//* ADDRESS BUS DEFINITIONS//******************************************************#define addrlo LATE#define addrhi LATB

This is pretty simple stuff that will save you lots of timewhen you start coding. Rather than trying to remember whatpin does what, I have given each pin a logical name that relates to its function. We’ll use the data_lo and data_hidefinitions when we write the code to read the FRAM ineight-bit mode. The rd_data and wr_data definitions willallow us to easily put the PIC24FJ128GA010’s data bus portinto input or output mode.

We already know that we’ll have to test this puppy. So,why not go ahead and put aside some variables that willstore what we read from the FM21L16. Here they are:

unsigned int framdata16;char framdatalo, framdatahi;

We’ll use framdata16 to read the 16-bit data value andframdatalo/framdatahi to store the results of eight-bit reads.

We now have enough stuff tied down to begin seriously

56 SERVO 12.2007

PHOTO 1. If you look closely, you can see my boo-boos. I missedplacing a via to the CE jumpers and I rotated a trace all the waythrough the ICSP resistors and capacitors. What you can’t seeis a switched address line on the bottom layer of the board. Ifixed all of these errors after I took this shot. Note the 0603 0.1 µFcapacitors surrounding the PIC24FJ128GA010 and the FM21L16.The rest of the passive components are 0805 SMT devices.

Eady.qxd 11/6/2007 9:37 AM Page 56

Page 57: Servo Magazine 2007-12

writing our FRAM I/O routines. Since the very first thing onewould do to access the FM21L16 is write the desired addressto the FRAM address pins, let’s put together a routine towrite the memory cell address to the FRAM’s address bus.Recall that we split the PIC24FJ128GA010’s address busbetween the E and B I/O ports. Therefore, we must do someminor bit manipulation to get the correct address out ontothe PIC24FJ128GA010’s address bus. No problem:

//******************************************************//* WRITE FRAM ADDRESS//******************************************************void wr_fram_addr(unsigned long addr)

addrlo = addr & 0x000003FF;addrhi = (addr & 0x0001FC00) >> 1;

The addrlo alias is actually PORTE of thePIC24FJ128GA010. Since PORTE only consists of 10 bits, weprovide a mask value of 0x3FF to capture all of the PORTEaddress information. If you count the “1” bits in the addrhimask, you’ll come up with seven. That’s how many more bitswe need to assemble to complete the 17-bit FRAM address.The most significant seven bits of PORTB are represented bythe alias addrhi and we need to put the most significant bitof the FRAM address into the most significant bit of addrhi.That explains the one-bit shift to the right.

We have the option of performing three types of readoperations. Here’s the code for a 16-bit FRAM read:

//******************************************************//* 16-BIT FRAM READ//******************************************************unsigned int rd_fram16(void)

unsigned int data;rd_data; //PIC24FJ128GA010 data bus = input modeUB = 0; //enable upper byte of FRAM data busLB = 0; //enable lower byte of FRAM data busWE = 1; //make sure write is disabledCE = 0; //begin the read accessNop(); //access time waitdata = data_in; //read the data into the PICCE = 1; //terminate the read cyclereturn data;

Before we do anything else, we must put thePIC24FJ128GA010’s data bus (PORTD) into input mode.That’s what the rd_data macro does for us. Putting both theUB and LB FRAM control lines at a logic low level enablesthe full 16-bit FM21L16 to the PIC24FJ128GA010’s PORTD.We are clocking the PIC24FJ128GA010 at 16 MHz, whichmeans we have a 125 nS cycle time. Thus, one NOP (NoOperation) instruction is plenty of time for the FM21L16 to respond to a read operation. We also have enough timefor a full FRAM write cycle, which has a maximum durationof 110 nS.

Performing eight-bit FRAM reads is just as easy as pulling

off a 16-bit read operation. Using the UB and LB FRAM control pins allows us to read either the high byte or low byteof the FRAM data bus. I wrapped both read types into a single function:

//******************************************************//* 8-BIT FRAM READ//******************************************************unsigned int rd_fram8(char mode)

unsigned int data;rd_data;switch(mode)

case data_lo: //read the low data byte onlyUB = 1; //kill the FRAM upper byte LB = 0; //enable the FRAM lower byteWE = 1; //make sure write is disabledCE = 0; //begin read processNop(); //read access timedata = data_in & 0x00FF; //get dataCE = 1; //terminate read operationbreak;

case data_hi: //read the high data byte onlyUB = 0; //enable the FRAM upper byte LB = 1; //kill the FRAM lower byteWE = 1; //make sure write is disabledCE = 0; //begin read processNop(); //read access time//read and adjust FRAM datadata = (data_in & 0xFF00) >> 8; CE = 1; //terminate read operation

break;return data;

To use the eight-bit read, you must enter the mode(data_lo or data_hi) as an argument to the rd_fram8 function. Nothing to it, right? That’s it for the FM21L16 read functions. Let’s move on and do the FRAM write function coding.

I’m sure you have a good grasp of what to do here. Seehow close you came in your mind to writing the same 16-bitFRAM write code I’ve presented here:

//******************************************************//* 16-BIT FRAM WRITE//*******************************************************void wr_fram16(unsigned int data)

wr_data; //PORTD = output modeUB = 0; //enable upper FRAM byteLB = 0; //enable lower FRAM bytedata_out = data; //put the data on PORTDCE = 0; //access the FRAM WE = 0; //begin the write cycleNop(); //write cycle waitWE = 1; //terminate write cycleCE = 1; //terminate FRAM accessrd_data; //return PORTD to input mode

Again, the eight-bit writes are no more difficult than the16-bit write. And, again, I’ve combined the upper and lowereight-bit write functions into a single routine:

SERVO 12.2007 57

Eady.qxd 11/6/2007 9:37 AM Page 57

Page 58: Servo Magazine 2007-12

//******************************************************//* 8-BIT FRAM WRITE//******************************************************void wr_fram8(char data, char mode)

wr_data;switch(mode)

case data_lo:UB = 1; //kill the FRAM upper byteLB = 0; //enable the FRAM lower bytedata_out = data & 0x00FF; //data on PORTDCE = 0; //access the FRAM WE = 0; //begin the write operationNop(); //write cycle timeWE = 1; //terminate the write cycleCE = 1; //terminate FRAM accessbreak;

case data_hi:UB = o; //enable the FRAM upper byteLB = 1; //kill the FRAM lower byte//put data out onto PORTDdata_out = (data & 0xFF00) >> 8;CE = 0; //access the FRAM WE = 0; //begin the write operationNop(); //write cycle timeWE = 1; //terminate the write cycleCE = 1; //terminate FRAM accessbreak;

rd_data;

Note that the FRAM’s OE pin is never accessed in theread routines. That’s because I set OE to a logical low at thebeginning of the FRAM read/write program:

int main(void)

CLKDIV = 0; //no clock divisionOE = 0; //set OE active

Since we’re already there, let’s continue with the FRAMread/write main program flow:

//******************************************************//* INITIALIZE I/O PORTS //******************************************************

//make PORTB data bus pins digitalAD1PCFG = 0xFE00;LATB = 0x01FF;TRISB = 0x01FF;LATC = 0xFFFF;TRISC = 0x4FFF;LATE = 0x0000;TRISE = 0x0000;LATF = 0xFFFF;TRISF = 0xFFCF;LATG = 0xFFFF;TRISG = 0xFFF3;

This is standard PIC stuff. All you really need to payattention to here is the disabling of the PORTB analog functionality on the PORTB pins we are using to support theaddress bus.

It’s always a good idea to control your own destinywhen it comes to initial logic levels. In the code snippet thatfollows, I made sure that all of the FRAM control pins were in a state that disabled any read or write access to the FRAM:

//******************************************************//* INITIALIZE FRAM//******************************************************

CE = 1;WE = 1;OE = 1;

If we’re going to use the FRAM controller’s RS-232 port,we’ll need to support it with some code. I used the C30 Ccompiler’s mathematician to compute the RS-232 port baudrate divisor:

#define YFREQ 4000000 //internal FRC frequency#define PLLMULT 4 // PLL multiplier#define FCY YFREQ*PLLMULT //PLL clock frequency#define BAUDRATE 57600 //desired baud rate

//compute the baud rate divisor value#define BRGVAL ((FCY/BAUDRATE)/16)-1

Recall that the PIC24FJ128GA010’s internal FRC defaultsto 4 MHz at reset. I simply used the PIC24FJ128GA010’s configuration bits to set up the FRC and turn on the PLL:

_CONFIG1(JTAGEN_OFF & GCP_OFF & BKBUG_ON &COE_OFF & ICS_PGx2 & FWDTEN_OFF)

_CONFIG2(IESO_OFF & FNOSC_FRCPLL & FCKSM_CSD-CMD & OSCIOFNC_OFF & POSCMOD_NONE)

If you’re not familiar with the _CONFIGx language, justview the PIC24FJ128GA010.h include file, which is part ofthe Microchip C30 C compiler package. Once the compilerhas ciphered BRGVAL, all I have to do is plug it in. The restof the UART registers default to the standard RS-232parameters and only require bits to be set to enable theUART circuitry:

//******************************************************//* INITIALIZE UART1 //******************************************************

U1BRG = BRGVAL;U1MODE = 0x8000; // Reset UART to 8N1 and enable U1STA = 0x0400; // Rst status reg, enable TX,RX_U1RXIF=0; // Clear UART RX Interrupt Flag

I decided to show you the UART interrupt flag eventhough we’re not going to use UART interrupts in this project. If you decide to expand upon the FRAM controllerproject, you’ll most likely need to use the UART in interruptmode.

We’re at the top of the hill now. All of the FRAMread/write functions are in place and the UART is ready foraction. Let’s run a 16-bit FRAM write cycle and utilize all ofthe read modes as a test case:

58 SERVO 12.2007

Eady.qxd 11/6/2007 9:37 AM Page 58

Page 59: Servo Magazine 2007-12

//******************************************************//* MAIN ROUTINE//******************************************************

framdata16 = 0; //clear the variable

//put 0x1FFFF on the FRAM address buswr_fram_addr(0x001FFFF);

//write 0x1234 to address 0x1FFFFwr_fram16(0x1234);

//read the address we just wrote toframdata16 = rd_fram16();

//read the lower byte of address 0x1FFFFframdatalo = rd_fram8(data_lo);

//read the upper byte of address 0x1FFFFframdatahi = rd_fram8(data_hi);

// Print values to terminal emulatorprintf(“\r\n0x%04X”,framdata16);printf(“\r\n0x%02X”,framdatahi);printf(“\r\n0x%02X”,framdatalo);while(1); //loop here

forever

The terminal emulator I refer to in the MAIN ROUTINEcode snippet is called Tera Term Pro. Tera Term Pro is a freedownload from the web.

The results of running the MAIN ROUTINE code areshown in the MPLAB Watch window capture you see in

Screenshot 6. The printf statements also wrote the contentsof the Watch window variables out to the Tera Term Pro terminal emulator window.

It’s Your Data

So, put a RAMTRON FM21L16 to work for you. To makeimplementing a RAMTRON FM21L16 a bit easier for all of you,I have provided a copy of the code and the ExpressPCB layoutfiles for you on the SERVO website. The PIC24FJ128GA010 hasplenty of analog-to-digital converters, PWM, and digital I/Othat I didn’t touch. Use my ExpressPCB layout to expand uponthe design to meet your robotic needs. See you next time. SV

Perform proportional speed, direction, and steering withonly two Radio/Control channels for vehicles using two

separate brush-type electric motors mounted right and leftwith our mixing RDFR dual speed control. Used in manysuccessful competitive robots. Single joystick operation: upgoes straight ahead, down is reverse. Pure right or left twirlsvehicle as motors turn opposite directions. In between stickpositions completely proportional. Plugs in like a servo toyour Futaba, JR, Hitec, or similar radio. Compatible with gyrosteering stabilization. Various volt and amp sizes available.The RDFR47E 55V 75A per motor unit pictured above.www.vantec.com

STEER WINNING ROBOTS

WITHOUT SERVOS!

Order at (888) 929-5055

SERVO 12.2007 59

• Microchip (www.microchip.com)PIC24FJ128GA010; MPLAB; C30 C Compiler; REAL ICE

• RAMTRON (www.ramtron.com) FM21L16

• ST Micro (www.stmicro.com) SP3232

Sources

Fred Eady can be reached via email at [email protected].

Contact the Author

Eady.qxd 11/6/2007 9:38 AM Page 59

Page 60: Servo Magazine 2007-12

60 SERVO 12.2007

// castling bonusesB8 castleRates[]=-40,-35,-30,0,5;

//center weighting array to make pieces prefer//the center of the board during the rating routineB8 center[]=0,0,1,2,3,3,2,1,0,0;

//directions: orthogonal, diagonal, and left/rightfrom orthogonal for knight movesB8 directions[]=-1,1,-10,10,-11,-9,11,9,10,-10,1,-1;

//direction pointers for each piece (only really forbishop rook and queenB8 dirFrom[]=0,0,0,4,0,0;B8 dirTo[]=0,0,0,8,4,8;

//Good moves from the current search are stored inthis array//so we can recognize them while searching and makesure they are tested first

by James Isom

Abi-monthlycolumn for

kids!LESSONSFROM THELABORATORY

LESSONSFROM THELABORATORY

NXT Packbot:Part 2

STEP 1:

STEP 4:

STEP 7:

Parts:

Parts:

Parts:

Parts:STEP 2:

Parts:STEP 5:Parts:

Parts:

STEP 3:

STEP 6:

Let’s pick up where we leftoff in October and add the

shoulders and a few otherpieces to the NXT Packbot.

Left Shoulder:The shoulders are mirror imagesof one another. I included bothsets of steps just in case youdon't like puzzles.

LessonsFromTheLab.qxd 11/5/2007 4:19 PM Page 60

Page 61: Servo Magazine 2007-12

SERVO 12.2007 61

STEP 8:

STEP 10: Parts: STEP 11:

Parts:STEP 9:

Parts:

Parts:

STEP 13:

STEP 16:

Parts:Parts:STEP 12:

STEP 15:STEP 14:

Parts:Right Shoulder: Parts: Parts:

LessonsFromTheLab.qxd 11/5/2007 4:19 PM Page 61

Page 62: Servo Magazine 2007-12

62 SERVO 12.2007

STEP 17:

STEP 20:

STEP 23:

STEP 26:

Parts:

Parts:

Parts:

Parts:

STEP 18: Parts:

Parts:

Parts:

STEP 19: Parts:

STEP 22:

STEP 25:

Parts:

Parts:

STEP 21:

STEP 24:

LessonsFromTheLab.qxd 11/5/2007 4:20 PM Page 62

Page 63: Servo Magazine 2007-12

STEP 29:

STEP 32:

STEP 35:

Parts: Parts:

Parts: STEP 28:

STEP 31:

STEP 34:

STEP 27:

STEP 30:

STEP 33:

SERVO 12.2007 63

Add Treads:Place two treads around the front wheels. The backportion of the treads will eventually be attached to arear assembly that will be covered in a future article.

Attach the Shoulders:The shoulder placement is a bit tricky, so have a look at the following images to make sure you get theplacement right.

Building andConnecting theFront Strut:

LessonsFromTheLab.qxd 11/5/2007 4:21 PM Page 63

Page 64: Servo Magazine 2007-12

64 SERVO 12.2007

STEP 36:

STEP 39:

Adding the Arm Brackets:Build an arm bracket using the following steps for each shoulder. I have colored the model whitefor these steps so the new parts are easier to see.

Parts:

STEP 37:

Parts:

STEP 38:

Parts:

That’s it for this installment. There’smore to come in February. Your NXTPackbot should now look like this. SV

LessonsFromTheLab.qxd 11/5/2007 4:22 PM Page 64

Page 65: Servo Magazine 2007-12

SERVO 12.2007 65

Page65.qxd 11/5/2007 2:44 PM Page 65

Page 66: Servo Magazine 2007-12

66 SERVO 12.2007

Electronic Parts & Supplies Since 1967

C Stamp™ Controller• LOW COST - High Pin Count

• 48-Pin Module with Analog

• High Speed, Large Memory

• Professional SW Dev. Tools

• Easy to Connect Accessories

• Free Expert Technical Support

www.c-stamp.comToll-Free: 1 (800) 985-AWIT

HobbyEngineering

www.HobbyEngineering.comRobot Kits, Parts, Tools and Books

For the finest in robots,

parts, and services, go to

www.servomagazine.com

and click on

Robo-Links.

Robolinks.qxd 11/5/2007 4:29 PM Page 66

Page 67: Servo Magazine 2007-12

Subscribe online at: www.servomagazine.com or call: 877-525-2539 (toll free) / 818-487-4545 (outside US)

Go towww.servomagazine.com

to enter your gift order!Be sure to use promotion code Y7WXMS when ordering.

U.S. Prices 1 Yr – $24.952 Yr – $45.953 Yr – $65.95

Give thegift thatlasts all

year!

Give thegift thatlasts all

year!

SV-GiftSubAd2007.qxd 11/1/2007 3:38 PM Page 67

Page 68: Servo Magazine 2007-12

68 SERVO 12.2007

When I was growing up, two tech-nologies captivated both science

and science fiction: robots and lasers.Both started out expensive and compli-cated, but today, these technologiesare within reach on any budget. This isespecially true of lasers, which just ageneration ago were laboratorycuriosities and the stuff of adventure

novels. Now they are such an integralpart of our lives we have all but forgotten about them. We’ve lost theappreciation of how useful they can be.

Thanks to advances in semiconduc-tor technologies, you can purchase afully functioning laser for just a fewdollars. Given their low cost, and theunique properties and capabilities oflaser light, you may want to considercombining these two stalwarts of sci-fidom into your next project. Whatfollows are some ideas to pique yourinterest and, of course, a listing ofonline sources you can check out tofurther your education and experimen-tation into the world of lasers.

Lasers 101Though there are many types of

lasers, they all do pretty much the samething: Lasers amplify a source of photonsinto an intense beam of light. The wavelength of the light varies across the visible, infrared, and ultraviolet spectrum. Most people are familiar withthe ruby-red light of the common laserpointer. These operate at about 650-670nanometers (nm), depending on theirdesign. A newer class of laser pointersput out a green beam (about 530 nm),

which is useful because the human eye is most sensitive to light of this wave-length. The green lasers are more expen-sive to manufacture, so they cost more.

Many devices such as CD and DVDplayers use infrared lasers that put out aninvisible beam in the 750-780 nm range.While you can’t see the beam, aninfrared laser is nevertheless quite useful,especially when combined with sensorsthat are most receptive to light in theinfrared region. These include most typesof phototransistors and photodiodes, andboth CMOS and CCD image arrays.

And, of course, there are lasersthat emit light in the deep blue andeven ultraviolet region. These are fairlyexpensive, finding typical uses in such things as high definition DVDplayers, and validating the authenticityof paper currency.

The vast majority of lasers todayare the semiconductor variety. They aretypically constructed of a sandwich ofsemiconducting material that has beencleaved at exactly the right angle toallow a pinpoint of amplified laser lightto be emitted. At low currents, thelaser operates like a light emittingdiode (LED); with the proper operatingcurrent, the device emits true laserlight, described below.

Semiconductor lasers can be furtherclassified by their operating mode. Mostof the devices we are most familiar withare designed for continuous light output. These are operated within a con-trolled region of current; if the current istoo low, the light that is emitted lacksthe laser characteristics. If the current istoo high, the device will overheat and

burn up. To maintain the proper operat-ing output, a sensor inside the laser collects a portion of the emitted lightand a control circuit varies the current tokeep it within the prescribed range.

Other semiconductor lasers —capable of much higher light outputs —operate in a pulsed mode. They areoperated by applying a series of pulses,each one of a short enough durationthat the device will not overheat. Theintensity of the laser is controlled byvarying the duty cycle — the ratio of ontime versus off time — of the pulses.

Diode lasers may be self con-tained, or they may require separatedriver electronics. Self-contained diodelasers include the laser itself, as well asits control circuitry. You need onlyapply power. This is the case with laserpointers. Diode lasers without circuitryrequire a separate driver board. Theboard provides the correct voltage andcurrent to the laser diode at all times.

One advantage to getting a laserdiode and separate driver board is theextra flexibility in operating the laser.With a separate driver board, you oftenhave more control over the intensity ofthe laser output. The better driverboards have a separate modulationinput that allows you to use an externalsignal to turn the laser on and off veryquickly. Modulation speeds of 5-10 kHzare common.

The older style of laser (still foundon the surplus market) uses a tubefilled with various gasses. A familiarversion is the helium-neon laser, whichemits a red beam of 632 nm. The laseritself is constructed of a glass tube

Using Lasers WithYour Robots

Tune in each month for a heads-up onwhere to get all of your “roboticsresources” for the best prices!

RoboResources.qxd 11/4/2007 6:36 PM Page 68

Page 69: Servo Magazine 2007-12

filled with a mixture of helium andneon gasses. A high voltage is appliedto terminals on either end of the tube.Carefully positioned mirrors on eitherend serve to amplify the light thatbounces back and forth. One of themirrors is fully reflective; the other ispartially reflective. Once suitably ampli-fied, the light escapes the partiallyreflective mirror and exits the tube.

There are yet more methods ofproducing lasers, including various crys-tals such as ruby and YAG, plasma, andeven Jello. I’ll leave it to you to researchthese if the subject is of interest to you.

The Properties ofLaser Light

Laser light is special for a numberof reasons. First is that unlike most lightsources, the beam from a typical laser iscomposed of a single wavelength, orcolor. The single wavelength makes itpossible to isolate the color, and ignoreall others. For example, if you’re designing a sensor that is only sensitiveto the light of your laser source, you canfilter out all but that light. You knowwhatever remaining light your sensor ispicking up is probably from your laser.

(In actuality, many lasers emit sev-eral specific wavelengths, called main-lines. These may be selectively filteredor split to obtain the desired color. Forexample, an argon gas laser emits botha green and a weaker blue light. A simple prism may be used to separatethe mainlines of a laser, while notreducing the light output of the beam.)

Recall from high school physicsthat while light is made up of photons,the photons travel as a wave. Becausea laser beam is made up of the samewavelength of light, the photons exitthe laser and travel in synchronism.This is called coherence. One strikingbenefit of coherence is the effect ofreflections of the laser light. Thesereflections cause the waves of light tointerfere with one another. What wasonce practically a “solid” beam of light is now a mish-mash of light raysthat commingle in measurable ways.Such so-called local interference forms the basis for a number of sens-ing techniques. I’ll cover a few in a bit.

Another useful property of laserlight is the limited degree to which itspreads as it travels through space. Thisis due to the nature of coherence,described above. All light eventuallyspreads out, but with the right laser andthe right optics, it’s possible to focuslaser light into an extremely thin beamthat stays thin for a longer distancethan regular light. Without this proper-ty, we would not have CDs or DVDs.

For robots, we can use this propertyto ensure a small pinpoint of lightregardless of the distance between thelight source and its target. The spotcaused by the laser beam will remain relatively small and compact whether thelaser is a foot away from the target or 20feet away. Simple collimating optics canfurther control the spread of the beam.

Last, and certainly not least, is thesheer intensity of a laser beam. A smallpocket laser, operating on a couple ofwatch batteries, can emit a light as brilliant as noon day sun. Of course,the area of the light is limited to a smallspot, but that works to our advantage.Even in average lighting conditions, it’srelatively easy for people and sensorsto spot the light of a laser beam.

Uses for Lasers inRobotics

Some applications for lasers inrobotics are obvious, and some are not.First to mind are decorative uses — dress-ing up the bot with colored lasers thatflash on and off as the machine drivesdown a darkened hallway. Combine alaser beam with a reflective diffractiongrating, and the beam is split into multiple sub-beams that dance aroundthe room as the robot travels. You can get metalized diffraction grating material at any party store. Just look forthe stuff that makes a rainbow whenyou look at it under ordinary light.

More practical applications for usinglasers with robots involve some type ofsensor. Light-based sensors are alreadypopular solutions in all types of robots,but the majority of these use standardnon-laser (i.e., non-coherent) infrared orvisible light. Such sensors work bydetecting the amount or direction oflight. The coherent nature of laser light

permits additional sensory techniques.One notable approach is to rely on

the local interference of a laser beamreflected off a surface. To the nakedeye, the local interference appears as“speckle,” a grain-like pattern thatmoves as the light or the surfacemoves. You could use this idea as away to measure movement and evendistance. Point a laser toward theground, and pick up the reflectionsusing a suitable sensor. As the robotmoves, the pattern of the speckle alsomoves in direct proportion to the direc-tion and distance of that movement.

Systems of these types that rely onlocal interference typically warrant amulti-cell sensor array. A single lightsensor is insufficient to detect themotion of the speckle pattern.However, sensor arrays, such as linearCCDs or even low-resolution CMOScamera chips, can be used to measurefinite differences in the speckle pattern.

Lasers also find use in various beacon and landmark systems used forrobotics. One or more lasers pointedupward from a stationary “lighthouse”are used to project a pattern of beamsor lines onto a white ceiling. A tradi-tional CMOS or CCD camera is pointedtoward the ceiling, and with the rightfiltering, sees only the dots/lines of thelaser. The unique orientation of thedots or lines reveals the location of therobot within the room. This is basicallythe same concept as the celestial navigation techniques used for centuries by mariners. It’s already usedin some commercial and experimentalrobotic navigation systems.

Recall above that because of theproperty of coherence, a laser beamwill keep its pencil-thin shape for alonger distance than ordinary light.With appropriate optics, a single sensorcan focus onto the same area that thelaser beam is being projected onto.Using a variety of timing techniques, it’spossible to construct a laser-based distance measurement device that canscan a room and build a 3D map ofobjects in front of the sensor. This is thebasic idea behind the expensive laser-based rangefinder systems build byGerman electronics manufacturer SICK.

Determining the distance between

SERVO 12.2007 69

RoboResources.qxd 11/4/2007 6:36 PM Page 69

Page 70: Servo Magazine 2007-12

70 SERVO 12.2007

laser sensor and target can be accom-plished in a variety of ways. With fastenough electronics, it’s possible tomeasure distances using time of flightof the light itself, which travels about186,000 miles per hour. Perhaps amore common method that does notrequire fast switching electronics is to modulate the laser beam with a fairly low frequency sine wave. The difference between the phase of thesource laser beam modulation and itsreturned reflection indicates distance.

Laser SafetyThe light from a laser is highly

intense, and when aimed directly intosomeone’s eyes can cause severe painand optic damage. In the UnitedStates, lasers are regulated by the Foodand Drug Administration, or morespecifically, an FDA unit known as theCenter for Devices and RadiologicalHealth, or CDRH.

Lasers are roughly classified by thepotential damage they can cause; thisdamage is defined by relying on simplemetrics, such as whether the beam isvisible or invisible to the human eye, ifthe light of the laser is ever exposedoutside of the device it’s used in, the

power output of the beam (usuallyexpressed in milliwatts or watts), andwhether the beam is stationary or constantly in motion.

As noted on the FDA website, laserdevices are separated by class. Thelower class numbers are the least dan-gerous. Each of these classes has itsown warnings and restrictions for use.

• Class I products include laser printersand CD players where the laser radiationis usually contained within the product.

• Class II and IIa products include barcode scanners.

• Class IIIa products include laser pointers.

• Class IIIb and IV products includelaser light shows, industrial lasers, andresearch lasers.

The vast bulk of lasers available toconsumers is Class IIIa. Note that thelaser in a CD player is ordinarily a ClassI device (but that’s when it’s used insidethe player where its light is neverexposed). Used outside — you’vehacked a CD player and raided its optics— the laser is most likely a Class IIIa.

Also note that the FDA limits Class

IIIa devices to five milliwatts, as indicat-ed by a light meter specifically designedto measure laser output levels. It’s tech-nically possible to operate some laserpointers with a higher-than-normal voltage, or even to pulse them with significantly higher voltages. The resultis an increase in power output thatmakes these devices non-compliant.

Class IIIa and lower lasers are gen-erally considered safe, but only in theirintended application. Whether or notthe laser light may be harmful to peopleor animals depends on the outputpower of the laser, whether the laser isvisible, and if the beam is held station-ary for a long enough period of time. I’drecommend never using anything abovea Class IIIa laser in a robotics project,and then only use a visible light laser.

The beam of an infrared laser canbe damaging to the eyes, and whenstrapped to a robot, an unsuspectingperson or animal may be inadvertentlyexposed to the effects of the beam.When an infrared laser must be used,consider only employing it in a fashionwhere its beam is pointed down to theground, and not out or up.

If you must use a higher powerlaser, do so only with appropriateresearch and safety training, and besure to follow all laws and regulations.If your goal is to design a mobile lightshow robot, employing high power 10watt diode lasers, do so only after youhave fully immersed yourself into thestudy of laser safety.

Be aware that operating certainClass IIIb and above lasers in public without the appropriate safety measures may be against the law, andcould expose you to severe fines.

Finally, should you opt for olderfashioned tube lasers on your robot,know that these require high voltagesto operate. These voltages — typicallyin the 1-2 kilovolt range — can causenasty shocks. Be sure all wiring is covered. Lasers with glass tubes (likehelium neon) should be suitably protected in plastic or metal enclo-sures, to avoid the risks of broken glass.

SourcesIn addition to the sources listed

American Science and Surplus often carries optics and sometimes laser components.

RoboResources.qxd 11/4/2007 6:36 PM Page 70

Page 71: Servo Magazine 2007-12

here, be sure to check out the regularadvertisers in both SERVO and Nuts &Volts, as many of them carry surpluslasers and optics.

Almaz Opticswww.almazoptics.com

Even lasers need the occasionallens. This outfit sells optics for conven-tional and laser light applications.

American Science and Surpluswww.sciplus.com

Variable surplus merchandise, socheck their catalog. Often carriesoptics and sometimes laser compo-nents. Low prices.

Anchor Opticswww.anchoroptics.com

Low-cost optics and laser (diodeand gas) products.

Coherent, Inc.www.cohr.com

Leading manufacturer of industri-al, educational, and laboratory lasers.The site contains numerous applicationnotes and other useful information.

Industrial Fiber Opticswww.i-fiberoptics.com

Manufacturer of educationalgrade lasers. Check out their informa-tional pages.

Information Unlimitedwww.amazing1.com

Lasers, laser products, and opticsfor all sizes and types of interestingprojects.

Instaparkwww.instapark.com

Online retailer of laser pointersand diode laser modules. Fairly lowprices, even for the green lasers.

Jamecowww.jameco.com

Small — but impressive — selectionof diode lasers and laser pointers.

Laser Glowwww.laserglow.com

Red, green, yellow, and even bluelaser pointers and diode laser modules.

Laser Surplus Saleswww.lasersurplus.com

Laser Surplus Sales carries lasersand optics, at surplus prices. This includes variety of gas, solid-state,and crystal (e.g., ruby) lasers, and

upporting optics.

Melles Griotwww.mellesgriot.com

Maker of laser components,optics, and complete laser systems,

Jameco has a small — but impressive — selection of diodes and laser pointers.

SERVO 12.2007 71

Another established company, Midwest offers a number of higher powereddiode lasers, including Class IIIb units of 40 mW and more.

RoboResources.qxd 11/4/2007 6:37 PM Page 71

Page 72: Servo Magazine 2007-12

from educational to industrial. Checkout their online tutorials, such as thesection on fundamental optics.

Meredith Instrumentswww.mi-lasers.com

Meredith Instruments is one of the

oldest names in hobby and educationallasers. Good selection of low-cost reddiode lasers, collimating lenses, andline-producing optics.

Midwest Laser Productswww.midwest-laser.com

Midwest Laser Products is anotherestablished company, offering a number of higher powered diodelasers, including Class IIIb units of 40 mW and more.

US Food and DrugAdministration CDRH websitewww.fda.gov/cdrh

Main portal to the CDRH pages atthe United States Food and DrugAdministration. Plenty of useful information and factoids about lasers,laser use, and laser safety. SV

72 SERVO 12.2007

Gordon McComb can be reachedvia email at [email protected]

CONTACT THE AUTHOR

RoboResources.qxd 11/4/2007 6:38 PM Page 72

Page 73: Servo Magazine 2007-12

Robot Builder’s Sourcebookby Gordon McComb

Fascinated by theworld of robotics butdon’t know how totap into the incredibleamount of informa-tion available on thesubject? Clueless asto locating specificinformation on robot-ics? Want the names,addresses, phonenumbers, and websites of companies thatcan supply the exact part, plan, kit, buildingmaterial, programming language, operatingsystem, computer system, or publicationyou’ve been searching for? Turn to RobotBuilder’s Sourcebook — a unique clearing-house of information that will open 2,500+new doors and spark almost as many newideas. $24.95

123 Robotics Experimentsfor the Evil Genius

by Myke PredkoIf you enjoy tinkeringin your workshop andhave a fascination forrobotics, you’ll havehours of fun workingthrough the 123experiments found inthis innovative projectbook. More than justan enjoyable way tospend time, theseexciting experiments also provide a solidgrounding in robotics, electronics, andprogramming. Each experiment builds onthe skills acquired in those before it so you develop a hands-on, nuts-and-boltsunderstanding of robotics — from theground up. $25.00

FIRST Robots: Aim Highby Vince Wilczynski / Stephanie

SlezyckiThis book looks at30 different robotdesigns all based onthe same chassis,and provides in-depth informationon the inspirationand the technologythat went into build-ing each of them.Each robot is fea-tured in 6-8 pages providing readers with asolid understanding of how the robot wasconceived and built. There are sketches,interim drawings, and process shots for eachrobot. $39.95

2007 CD RomPre-order before December 20th and get

free shipping (U.S. Only) $24.95

Order other CDs with your 2007 copy ofSERVO or NV (of any combination) and pay

only $21.95 each.Plus get the free shipping!

All orders will ship mid December.

Mechanisms and MechanicalDevices Sourcebook

by Neil Sclater / Nicholas ChironisThe fourth edition of this invention-inspiring engineeringresource covers thepast, present, andfuture of mechanismsand mechanicaldevices. You’ll finddrawings anddescriptions of morethan 2,000 compo-nents that haveproven themselves over time and can be incorporated into the very latestmechanical, electromechanical, and mecha-tronic products and systems. Overviews ofrobotics, rapid prototyping, MEMS, andnanotechnology, along with tutorial chapterson the basics of mechanisms and motioncontrol, will bring you up-to-speed quicklyon these cutting-edge topics. $89.95

We accept VISA, MC, AMEX, and DISCOVERPrices do not include shipping and

may be subject to change.

CNC Roboticsby Geoff Williams

CNC Robotics gives youstep-by-step, illustrateddirections for designing,constructing, and testinga fully functional CNCrobot that saves you 80percent of the price of anoff-the-shelf bot — andthat can be customizedto suit your purposesexactly, because you designed it. Written by an accomplished workshop bot designer/builder, this book gives you everything you need. $34.95

The SERVO WebstoreInsectronics

by Karl WilliamsThis complete projectbook delivers all the step-by-step plans you needto construct your ownsix-legged insect-likerobot that walks andactually responds to itsenvironment. Using inexpensive off-the-shelfparts hobbyists can “build a better bug” and at the same time have loads of fun honing their knowledge of mechanical construction, programming, microcontrolleruse, and artificial intelligence. $19.95

Attention Subscribers ask about your discount on prices marked with an *

NNEEW!W!

SERVO 12.2007 73

WebstoreDec07.qxd 11/5/2007 3:25 PM Page 73

Page 74: Servo Magazine 2007-12

Get your very own limited-edition SERVO Magazine T-shirt. Shirts come in sizes S, M, L, and are available in either black or white.

All shirts are 100% preshrunk cotton.

SERVOMagazineT-Shirts

For men and women

GreatGreat

GifGift Idea!t Idea!

$19.95!$19.95!

From HomoSapien to RoboSapien Before R2D2 there was R1D1

Take This Stuff and Hack It!by Dave Prochnow

Transform commonhousehold items into real-ly cool stuff. You don'tneed to be an electronicsgenius to get started turn-ing everyday items intohigh-performing wonders.With how-to guru DaveProchnow's step-by-stepdirections and fully illustrated plans, evenbeginners can hack their way to a high-techhome, cooler toys, and less yard work.Certain to fire your imagination and start youplotting new, original, and even more creativewonders you can make from ordinary house-hold items, Take This Stuff and Hack It! is theperfect gift for your inner inventor. $27.95

Building Robots with LEGOMindstorms NXT

by Mario Ferrari, Guilio Ferrari

The Ultimate Tool forMINDSTORMS®Maniacs, the newMINDSTORMS kit hasbeen updated toinclude a program-ming brick, USB cable, RJ11-like cables,motors, and sensors. This book updates therobotics information to be compatible withthe new set and to show how sound, sight,touch, and distance issues are now dealtwith. $39.95

NNEEW!W!

JUN-07JUN-07

Forbidden LEGO by Ulrik Pilegaard / Mike Dooley

Build the ModelsYour ParentsWarned You Against.

Forbidden LEGOintroduces you tothe type of free-style building thatLEGOs masterbuilders do for funin the back room. Using LEGO bricks in com-bination with common household materials(from rubber bands and glue to plasticspoons and ping-pong balls) along withsome very unorthodox building techniques,you’ll learn to create working models thatLEGO would never endorse. $24.95

Robot Builder’s BonanzaThird Edition

by Gordon McComb / Myke PredkoEverybody’s favoriteamateur robotics bookis bolder and betterthan ever — and nowfeatures the field’s“grand master” MykePredko as the newauthor! Author duoMcComb and Predkobring their expertise to this fully-illustratedrobotics “bible” to enhance the alreadyincomparable content on how to build —and have a universe of fun — with robots.$27.95

NEED MOREINFO?

Go whereSERVE’goes!

The online storThe online store @e @wwwwww.ser.ser vvomagazineomagazine .com.com

To order call 1-800-783-4624

NNEEW!W!

74 SERVO 12.2007

WebstoreDec07.qxd 11/5/2007 3:26 PM Page 74

Page 75: Servo Magazine 2007-12

To order call 1-800-783-4624Or order online www.servomagazine.com

BACK ROOM SPECIALS

The Official RobosapienHacker's Guideby Dave Prochnow

The Robosapien robotwas one of the mostpopular hobbyist giftsof the 2004 holidayseason, selling approxi-mately 1.5 million unitsat major retail outlets.The brief manualaccompanying therobot covered onlybasic movements and maneuvers — therobot's real power and potential remainundiscovered by most owners — until now!This timely book covers all the possibledesign additions, programming possibilities,and "hacks" not found any place else.$24.95 Sale Price $14.95Pub date: August 17, 2005

Concise Encyclopediaof Robotics

by Stan GibiliscoWritten by anaward-win-ning electronics author,the Concise Encyclopediaof Robotics delivers 400up-to-date, easy-to-readdefinitions that make evencomplex conceptsunderstandable. Over150 illustrations make theinformation accessible at aglance and extensive cross-referencingand a comprehensive bibliography facilitatefurther research.$19.95 Sale Price $9.95 “Only 2 Left”Pub date: November 12, 2002

SERVO'S CUSTOMEMBROIDERED HAT

This is one good looking hat, with its stonewashed blue cap and bright yellow/goldstitching. There's no better way to showeveryone that you're well endowed with abigger - than - average brain then by proudlydisplaying your affiliation with SERVOMagazine. $ 14.95*

Hydrogen Powered Racer and Hydrogen Station

Recently named as one of the Best Inventions of 2006 by Time Magazine, the H-racer is now thebest selling fuel cell product in the world. The H-racer is a micro-version of what engineers andscientists have been dreaming about for real cars: combining hydrogen with oxygen to generatea DC current to power an electric motor. Unlike a gas-powered car engine, the only byproductsof this electrochemical process are electricity, heat, and pure water. With the H-racer, you canwitness the power of new energy technology in the palm of your hand. Horizon has createdthis unique, patented miniature fuel-cell car and hydrogen refueling station. All you need to dois add water. Only $115.00 plus S/H

Robotics Demystified by Edwin Wise

YOU DON'T NEED ARTIFICIAL INTELLIGENCETO LEARN ROBOTICS!Now anyone with aninterest in robotics cangain a deeper under-standing — without for-mal training, unlimitedtime, or a genius IQ. InRobotics Demystified,expert robot builderand author Edwin Wiseprovides an effective and totally painlessway to learn about the technologies used to build robots! $19.95 Sale Price $13.95Pub Date October 20, 2004

The Day the EarthStood Still

An alien (Klaatu) with hismighty robot (Gort) landtheir spacecraft on ColdWar-era Earth just afterthe end of World War II.They bring an importantmessage to the planetthat Klaatu wishes to tellto representatives of allnations. Directed by: Robert WiseActors: Michael Rennie, Patricia NealRun Time: 92 minutes $14.95

Forbidden Planet:50th Anniversary Edition

A starship crew goes toinvestigate the silence of aplanet’s colony only tofind two survivors and adeadly secret that one ofthem has. Dr. Morbius andhis daughter Altaira havesomehow survived ahideous monster whichroams the planet. Directed by: Fred M. WilcoxRun Time: 98 minutes $26.95

Blade Runner(The Director’s Cut) (1982)

In a cyberpunk vision ofthe future, man has devel-oped the technology tocreate replicants, humanclones used to serve in thecolonies outside Earth butwith fixed lifespans. In LosAngeles, 2019, Deckard is aBlade Runner, a cop whospecializes in terminating replicants.Directed by: Ridley ScottRated: R — Violence $19.95

NEW! THE SERVO STORE NOW OFFERS DVDS!

With this kit, you now can see andfeel the future of energy generationin your own hands!

SERVO 12.2007 75

Order now and getyour Hydrogen Racer

before Christmas

WebstoreDec07.qxd 11/5/2007 3:27 PM Page 75

Page 76: Servo Magazine 2007-12

My first impression of a Robo-1 style biped was one ofamazement. It walked, performed tricks, and could

battle in competition.WOW! So, I bought a Kondo KHR-1, spent many hours

building it. And there it was. Now what to do with it!?I programmed in moves I downloaded from the Internet

and impressed my friends. I created new moves andsequences and taught it to climb a small staircase. (Not veryeasy for movements based on static positions!) Out of thebox, the robot needed to be tethered. There was a kludgyremote available from Kondo, but I opted not to buy that.

I’ve been a programmer since the late ‘70s, so, ofcourse, I had to try to improve the interface. I spent the nextfew months hacking the communications protocol and wrotea PDA remote controlled WiFi interface. That’s when the disappointment hit. The robot could only run pre-programmed sequences of static frames. If the surfacewas tilted, the robot fell over. If the surface was rough, therobot fell over. Drat!

As with most technical things, there are always innovations. The Hitec RoboNova soon came along. It wasprogrammable via an onboard RoboBasic interpreter.Optional gyros even helped stabilize its movements.

COOL! So I bought a RoboNova, spent many hours building it. And there it was. Now what to do with it!?

I programmed in moves I downloaded from the Internetand impressed my friends. There was also a decent PC program for creating new static positions. So, like most other RoboNova hobbyists, I built RoboBasic programs. Iteven had an “out of the box” I/R TV style remote. But thegeneral limiting algorithm was the same:

• Receive a command from the remote control.• Run a sequence.• Loop.

I wanted to make the robot walk more like a human.Rather than just run one sequence after another, what I really needed were dynamic movements. However, most of

the math involved is beyond the people reading this article,including myself. Not to mention that the RoboNova only hasan Atmel ATmega128 MCU running at 7 MHz.

I decided to develop a better static model framesequencer. One that can transition sequences when commonframes exist in both. First, I tried to do this in RoboBasic. I hitso many limitations with the compiler that I gave up andwrote MOOSE (My Own Operating System Executive) toreplace the RoboBasic operating system (kids, don’t try thisat home). Yet, I want to point out that a clever Basic programmer can still make this design work.

And now a pearl of wisdom:

“Define your task and build the database prior to writingany code.”

A wisely designed database set ultimately reduces theamount of code needed to perform a given task. Below is alist of the features and record type definitions included in theMOOSE sequencer database.

1) Use the vendor’s existing static position builder program.2) Communicate with existing programs.3) Have variable length sequences.4) Allow adjustable velocity between frames.5) Point-to-point servo movement between frames6) Independence of footedness, play left footed or right footed.7) Symmetry flag, indicating a frame is identical left footedor right.8) Play a sequence forwards or backwards.9) Hold at critical places in the sequence momentarily (forstability).10) Transition sequences at closest similar frame. 11) Auto-repeat sequences, if desired.12) Change footedness of sequence on auto-repeat, ifdesired.13) Change direction of sequence on repeat, if desired.14) Work with my wireless serial based PS2 style controller.

Transitioning SequencerUsing Static Frames for

Biped Controlby Daniel Albert

76 SERVO 12.2007

Appetizer.qxd 11/4/2007 6:30 PM Page 76

Page 77: Servo Magazine 2007-12

// Record Types// P: single static Position (Long name, servo // positions[24])// S: sequence (Long Name, ID, Flags)// Sequence Flags:// (R)epeat sequence over, change footedness.// (r)epeat sequence over verbatim.// directional changes only go forward!// (D)irectional change at end of seq, change// footedness & continue// (d)irectional change at end of seq. and // continue// F: looping frames within seq. (Position Long Name, // bit flags)// Frame Flags:// (V)elocity V0 - V3 (V0 = slowest)// (A)mbidextrous - can change footedness from // left to right if need // (J)ump - play this move during a sequence // change, else skipped// (H)old - Hold when moving forward into this // position// (h)old - Hold when moving backward into this // position// (S)ymmetrical - This move can be played either // way

FreeLoader — a PC based program I wrote to accompany MOOSE — parses the following example textfile and loads the EEPROM of the RoboNova. Record typesprecede the colon. Flags trail.

P:Zero,100,76,144,96,101,100,101,30,81,100,100,100,101,30,81,100,100,100,100,76,144,96,101,100P:Lean,69,79,133,101,113,100,105,45,71,100,100,100,101,37,71,100,100,100,117,96,118,100,94,100P:ON1Foot,59,73,136,107,117,100,105,45,71,100,100,100,100,37,71,100,100,100,116,77,143,98,90,100P:LeanWide,67,102,114,92,116,100,106,51,83,100,100,100,98,40,65,100,100,100,106,139,80,89,107,100P:KneeUpInCenter,87,113,74,130,93,100,105,30,84,100,100,100,101,33,90,100,100,100,108,109,83,128,112,100P:KneeUpInFront,86,124,76,152,94,100,67,35,67,100,100,100,125,37,82,100,100,100,114,110,88,111,107,100P:ShortPlantWeightBk,84,10,182,121,95,100,67,40,73,100,100,100,112,36,72,100,100,100,109,134,67,120,105,100P:ShortPlantWeightCt,100,63,121,130,102,100,67,43,64,100,100,100,120,43,64,100,100,100,100,117,138,71,102,100P:ShortPlantWeightFw,105,113,78,128,108,100,72,43,68,100,100,100,135,48,68,100,100,100,80,107,172,43,93,100P:LongPlantWeightCtr,100,44,121,151,100,100,67,43,64,100,100,100,120,43,64,100,100,100,100,130,138,47,100,100P:KneeUpInBack,114,110,88,134,107,100,60,47,70,100,100,100,144,34,81,100,100,100,86,124,76,53,94,100P:LongPlantFw,117,134,58,142,102,100,66,43,68,100,100,100,139,46,65,100,100,100,83,114,181,43,97,100P:LongPlantBk,90,09,161,132,99,100,81,42,78,100,100,100,116,42,59,100,100,100,106,152,54,101,103,100P:WidePlantBk,85,15,167,121,113,100,73,42,78,100,100,100,129,42,59,100,100,100,109,136,53,121,106,100P:WidePlantFw,117,154,35,132,111,100,78,42,78,100,100,100,134,29,77,100,100,100,77,115,183,25,103,100P:bigKneeUpFw,95,18,143,137,115,100,64,34,81,100,100,100,131,47,70,100,100,100,113,133,87,67,87,100P:bigKneeUpBk,100,98,96,45,105,100,144,34,81,100,100,100,60,47,70,100,100,100,109,96,127,108,97,100P:BU1,100,130,120,80,110,100,150,160,10,100,100,100,150,160,10,100,100,100,100,130,120,80,110,100P:BU2,80,155,85,150,150,100,185,40,60,100,100,100,185,40,60,100,100,100,80,155,85,150,150,100P:BU3,75,165,55,165,155,100,185,10,100,100,100,100,185,10,100,100,100,100,75,165,55,165,155,100P:BU4,60,165,30,165,155,100,170,10,100,100,100,100,170,10,100,100,100,100,60,165,30,165,155,100P:BU5,60,165,25,160,145,100,150,60,90,100,100,100,150,60,90,100,100,100,60,165,25,160,145,100P:BU6,100,155,25,140,100,100,130,50,85,100,100,100,130,50,85,100,100,100,100,155,25,140,100,100

//S:Stand,01,r

F:Zero,S,V3,AF:Lean,V5,J,A

//S:ShortStepFwdBck,11,R //(R)epeat sequence

// with changed footednessF:Lean,V6,J,AF:KneeUpInFront,V6F:ShortPlantWeightBk,V6,HF:ShortPlantWeightCt,V6F:ShortPlantWeightFw,V6,hF:KneeUpInBack,V6

//S:ShortStepTurn1way,15,R //(R)epeat sequence with

//changed footednessF:Lean,V6,J,AF:KneeUpInFront,V6F:ShortPlantWeightBk,V6,HF:ShortPlantWeightCt,V6F:LongPlantWeightFw,V6,hF:KneeUpInBack,V6

S:ShortStepTurnOtherway,17,R //(R)epeat sequence with// changed footedness

F:Lean,V6,J,AF:KneeUpInFront,V6F:LongPlantWeightBk,V6,HF:ShortPlantWeightCt,V6F:ShortPlantWeightFw,V6,hF:KneeUpInBack,V6

//S:ShortStepLftRgt,E3,D //(D)irection and footedness

// changed at end. Repeatable // at start

F:Lean,A,V5F:KneeUpInCenter,V5F:ON1Foot,V5

//S:RotateInPlace,69,r //(r)epeat sequence verbatim

F:Lean,V3,AF:LongPlantWeightCtr,V3F:Stand,V3,S,A

//S:UpFromBack,B6 //runs once and stops at Stand

F:Lean,V3,J,AF:BU1,V6F:BU2,V6F:BU3,V6F:BU4,V6F:BU5,V6F:BU6,V6F:Zero,S,A,V6

END

MOOSE starts out on boot-up by playing the first sequence;in this case, “S:Stand.” The serial port waits for a data packetindicating the status of the wireless PS2 controller. MOOSE converts the joystick and button data to a requested sequenceID, direction, and footedness. If it finds an “S” that matches therequested ID, it will then search both the current sequence andthe requested sequence for the best transition point.

You may notice several things about the S:Standsequence. It has two static frames: F:Zero and F:Lean. In addi-tion, it is has the “r” flag indicating it will repeat at the end.

Why would you want to lean in a stand sequence?Normally, you wouldn’t. The F:Lean frame has a “J” flagindication that it is merely a jump point and will only beplayed — if necessary — during a transition to anothersequence. So, until you jump away from the S:Standsequence, the F:Lean is ignored.

Now the Fun Begins!

Let’s say that we want to transition to the

SERVO 12.2007 77

Appetizer.qxd 11/4/2007 6:30 PM Page 77

Page 78: Servo Magazine 2007-12

“S:ShortStepFwdBck” sequence with a forward direction, startingwith the left foot. MOOSE sees that there is a common frameF:Lean in both sequences. It plays the F:Lean in the S:Standsequence, followed by the next desired frame “F:KneeUpInFront.”

Had the direction requested been backwards, MOOSEwould see that S:ShortStepFwdBck can be repeated andwould run the sequence in reverse starting withF:KneeUpInBack. Upon reaching either end of a repeatingsequence that requires a change of footedness, MOOSE willchange from left to right foot and continue the sequence. Afull backwards/forwards or left footed/right footed walk canbe achieved from six static frames.

Now, Let’s Turn While Walking!

We don’t need to know where we are in a sequence andwe don’t need to finish the sequence in order to transition.Going from S:ShortStepFwdBck to “S:ShortStepTurn1way”can transition on any of the four common frames. MOOSEwill immediately switch sequences on the next frame if it can.If not, it will find the next best jump point. I know there aresome really sharp readers out there are saying, ”What if theleft knee is up and we want to transition to the right knee up... they are the same frame ... can it hop?”

No problemo! Even though the RoboNova can’t hop, MOOSEcontinues the sequence until it finds either a symmetrical frame where it can just switch current footedness to requestedfootedness with no delay (i.e., S:Stand) or an ambidextrous framewhere it can play it twice (i.e., “Lean” left then “Lean” right).

Sequences with the direction flag set like S:ShortStepLftRgtplay forward only from their first frame up to the last, canswitch footedness if needed, and play backwards down to thefirst. They can then repeat from the first frame if the repeat flag is set. One time sequences like S:UpFromBack get playedforward once and stop at the last frame.

Frames with the (H)old and (h)old flag pause momentar-ily to allow the robot to settle. These flags are directionalsince it may be critical to hold during the bounce that occurswhen placing a foot to the ground but not hold in the reversedirection of picking the foot off the ground.

Well, that’s all there is to giving your biped some dynam-ic like sequences without using dynamic model programming.

If you have a RoboNova and would like to test driveMOOSE and FreeLoader, please contact me.

MOOSE emulates much of your original Basic program’sserial command protocol. It can communicate with RoboBasic’sservo motor real time control in order to create the static framesand even adjust and store the zero settings. MOOSE andRoboBasic cannot exist concurrently. If you try to upload a Basicprogram, you will wipe out MOOSE and reload RoboBasic. Iwould be happy to assist any brave, savvy RoboBasic program-mer that wants to try to emulate this sequencer in RoboBasic.

Support for a five degree of freedom IMU (InertialMeasurement Unit) is currently under development. SV

78 SERVO 12.2007

Dan Albert can be reached via email at [email protected].

CONTACT THE AUTHOR

Appetizer.qxd 11/4/2007 6:31 PM Page 78

Page 79: Servo Magazine 2007-12

Servos? Just what is a servo (or a servomotor or servo mechanism, as they

are sometimes called)? Is that a year’scollection of this magazine? Most of uswho have built robots have used one ormore of these in our creations, but not allrobots use servos. Most of the larger vari-eties of robots don’t use servos thoughthey might employ shaft encoders to provide some sort of positional feedbackto a controlling microcontroller or computer. Most combat robots (like theones that seem out of control) don’t useany form of them, so why do so manyexperimenters utilize them?

Who would have ever thought thatthese small plastic boxes would have hadsuch an impact on experimental robotics? I remember playing with a fourchannel R/C system years ago, trying tofigure out how I could use it in a robot.Most of my robots were usually ratherlarge and the tiny servos could do littlemore than move small ‘special effects’appendages. Cute ‘decorations’ reallyserved no useful function, so I decided to

hack one to see what I could do with it.I believe that first thing I made was

a linear actuator. Pulling the 4.7K potout, cutting off the stops from the output gear, I attached a 25 turn leadscrew and a 25 turn 5K trim pot (in theplace of the other one) to the outputshaft and had an amazingly powerfulpush-pull actuator. Other experi-menters in our robotics group wereattaching them to arm and leg joints,and driving the servos with 555/556timer circuits or 6502 microprocessors,and a few started to use them as drivemotors for small robot’s wheels.

Typical Servos Usedin Robotics

The three servos shown in Figures1a, 1b, and 1c are just a tiny fraction ofthe many types, torque capacities, sizes,and weights available from the manymanufacturers today. Servos are quiteoften the only motive force of manyexperimenter’s robots. Most of the

beginner’s kits from Parallax and othersuse similar servos in small robots.

Tabletop robots can make use ofthe little motor/gearbox to drive a set of wheels and the associated electronics to receive the pulse trainsfrom a microcontroller and convertthem to drive signals. This is a cheapand effective way to get a robot designfrom a few sketches to a workingmachine in a few hours.

As robot experimenters, we thinkof those little black boxes that were originally developed for model airplanes as the only ‘servo’ that we’refamiliar with. Many of us have boxes ofthem; some hacked, some in pieces,and some actually in one piece.

Servo FeedbackWith the advent of specialized ICs

and electronics, modern servos haveemerged as marvels of mechanics andelectronics. Servos have been used inindustrial applications for years, long

Then NOWan

d

SERVOSb y T o m C a r r o l l

FIGURE 1a. JR servo. FIGURE 1b. HiTec robot servo. FIGURE 1c. Futaba coreless servo.

SERVO 12.2007 79

Then&Now.qxd 11/5/2007 4:29 PM Page 79

Page 80: Servo Magazine 2007-12

80 SERVO 12.2007

before model aircraft found them usefulto move various surfaces to change thedirection of flight. Newer applicationsare popular for CNC machine tool use.

Figure 2 shows three servos usedto move the three axes of a millingmachine by Servo Products. Way backin 1787, James Watt used a servo-likedevice — the flyball governor — to reg-ulate the speed of his steam engines.Figure 3 from the cover of a 1952Scientific American Magazine shows aclassic drawing of the flyball governor.It certainly was not what we think oftoday as an electrical/electronic servo,but it could be set in different positionsto control the speed of a steam engine.

The revolving set of balls was directly connected to the engine’s outputshaft and as the speed increased, centrifugal force caused the balls to moveoutward, pulling down the upper ringand connected lever. As this ring moveddownward, it would slowly shut downthe flow of steam by moving a valve, thusslowing the engine and revolving balls.

At one point, a stable speed wasdeveloped. By manually changing thedistance between the ring and wherethe valve cut down the steam flow, onecould set the engine’s speed whereverdesired. A relief valve was set to openat a specific pressure, thus preventingan exploding boiler.

No, this certainly is not a typicalservo that we’re familiar with, but it didutilize feedback to control a machine.

No 1.0 to 2.0 millisecond pulses weresent remotely to Watt’s engine to control speed, just a simple mechanicaladjustment by a human operator.

What is a Servo?Just like the definition of a robot is

so different to so many people, a servohas many definitions. Allow me to pres-ent four definitions of the term servothat I found at random through Google:

A servo is: “An electromechanicaldevice that uses feedback to provideprecise starts and stops for such functions as the motors on a tape driveor the moving of an access arm on adisk (PC Magazine).”

A servo is: “An automatic deviceused to correct errors in the operationof machinery, used in satellite-trackingsystems, power-steering systems onsome cars, and to control robots andkeep ships on course (encyclopedia).”

A servo is: “A small mechanisminside the RC vehicle, the servo is a devicewith a motor, gears, and circuits that con-trols things like steering and speed. Atypical RC car has a steering servo tomake the wheels turn and a speed con-trol or throttle servo to make it go fasteror slower. Other types of servos may bepresent to control other functions (radio-control car enthusiast’s definition).”

A servo is: “An electro-mechanicaldevice that is used to convert thereceived signal into mechanical move-ment. Servos are used to move controlsurfaces, throttles, retractable landinggear, or auxiliary functions (model airplane enthusiast’s definition).”

Servo is: “The name of a greatrobot experimenter’s magazine.” (Sorry,I just had to put that in.) If you Google‘servo,’ you’ll find most definitions andhits are about the model airplane types.

How Does a ServoWork?

Are you really any closer to knowing just what a servo is? So manyarticles in this magazine (includingsome of mine) have gone over how atypical model aircraft servo works. Themore popular and certainly cheapermodels utilize a pulse width modula-tion pulse train from the R/C receiver.

The pulse train consists of 50 to 60pulses per second with each pulsebeing one to two milliseconds long,though experimenters have used 0.8 to2.2 ms pulses to drive the servo furtherthan the typical 90 to 120 degrees oftravel. A shorter series of pulses willdrive the servo’s output shaft onedirection, and the longer pulses willdrive the other way — with positions inbetween for pulses closer to 1.5 ms.

In these older servos that havebeen used for years, there are threewires to the servo: a signal wire (for thepulse train) that can be a number ofcolors; a 4.8 to 6 volt power wire thatis usually red; and a ground wire that isusually black or brown. Note that thereis no output wire to inform an operatoror microcontroller just where theservo’s shaft is positioned.

Early Model AircraftServos

One of the first R/C systems that Iused was by Kraft. Figure 4 shows an ear-lier analog Kraft system with three servosmounted in the airplane, lying behind the transmitter and receiver in the foreground. Back in the ‘80s, several ofus from the Robotics Society of SouthernCalifornia were invited down to the Kraft

FIGURE 3. Flyball governor on thecover of Scientific American.

FIGURE 2. Three axis milling machineset up by Servo Products.

Then&Now.qxd 11/5/2007 4:30 PM Page 80

Page 81: Servo Magazine 2007-12

plant in Vista, CA and were given a tourof the facility. The guy leading us aroundthe Kraft facility gave us a lot of servos,receivers, and battery packs just for goodwill; maybe he saw that the end wasnear. Futaba from Japan was starting toreally hurt the US manufacturers andKraft’s days seemed numbered.

Experimenting with them at home,I found the Kraft servos to be quite wellmade. I also had an old Heathkit R/Csystem that I built that used two PS-4servos made by Orbit (remember kits?).Kraft later came out with the smallerKPS-12 servos that some people I knewbuilt into robot joints for walkers. I laterbegan to frequent the Hobby Shack(now Hobby People) in Fountain Valley,CA and found that Futaba and HS’Cirrus line of R/C equipment to be a lotcheaper for my R/C projects.

One of my first R/C robots for amovie used a Hobby Shack AeroSportfour channel system with two Vantecspeed controllers for the two wheelsand two very large Cirrus servos for thetwo arms. I used coil springs to compen-sate for the arm’s weight and the littlerobot could easily pick up over a pound.

Futaba took the lead severaldecades ago and is still one of the morepopular R/C systems with a full line ofservos for all applications, including servos designed specifically for robots.HiTec of Korea also has a line of servosspecifically designed for robots, as doesthe Robotis Bioloid line of Dynamixelservos (actuators), also from Korea.

Servo SelectionYou may be wondering just what

type of servo that you’ll need for yourproject. For economy’s sake, you canstart with the cheaper analog servoswith a three pole cored motor, plasticgears, and bushings for the shaft. Thesewill work great for almost all applica-tions where you need to study the basicsbefore advancing to your final design.

The next step for tougher applica-tions is to buy a metal geared servowith ball bearings on the main shaft.Coreless motors have quicker changesin speed over the three and five polecored motors. The most advanced arethe digital servos with an embeddedmicrocontroller to deliver a greater

number of PWM pulses to the motorfor quicker response, greater accuracy,and torque with less deadband. Theydo draw a bit more power to operate,but that is usually not too much of aconcern for robot builders.

Of course, servos vary widely intheir torque, weight, and size. The CirrusCS-3 Micro Joule SX servo weighs onlythree grams (its four channel receiverweighs a bit less), yet it only has sevenoz. in. of torque (see Figure 5). Monsterservos can weigh over a pound and putout 10 foot pounds of torque or more.It all depends on what you need.

This single paragraph certainly cannot narrow down the right servofor your application; you need to go to the Internet or to manufacturer’swebsites and do some research.

Servo Feedback vs.Feedback to aMicrocontroller

This magazine takes its name from

these devices that so many of us haveused in our robots for years, yet servosoffer no built-in intelligence. They onlytake commands from a microcontrolleror R/C receiver and move to a certainpoint and stop. But hack the little suckers and you have an intelligentdrive motor of sorts.

After reading my August columnon Robot Arms, Alex Dirks ofCrustCrawler wrote SERVO concerningwhat he felt were incorrect statementsthat I made concerning servos used inmany experimenter’s robots — thetypes used with radio controlled modelairplanes to move various wing andrudder surfaces. He referred to the following statements that I made concerning their use with robot arms:

“The advantage of using R/C servos is the positional feedback.“Potentiometric feedback, as in R/C ser-vos, allows the controlling computer toknow where each joint is positioned.”

Alex countered with the following:

FIGURE 4. Early Kraft radio.FIGURE 5. Cirrus CS-3 Micro

Joule SX servo.

FIGURE 6. Robotis Dynamixel AX-12. FIGURE 7. Robotis Dynamixel RX-28.

SERVO 12.2007 81

Then&Now.qxd 11/5/2007 4:30 PM Page 81

Page 82: Servo Magazine 2007-12

“There are no feedback mechanismsbuilt into any standard servo today withthe exception of the AX-12+ (the servofrom Robotis and several others in thatline) and a few specialized servos usedin biped type robots.” Alex knows servos as President of CrustCrawler, abusiness he started six years ago withthe HexCrawler and QuadCrawler.

The products he feels have themost promise today are probably theAX12 Smart arms designed around theRobotis smart servos that I’ll discusslater. However, it is CrustCrawler’s andthe other well-known suppliers ofready-to-roll robots and kits that havesteered the servo manufacturers intodesigns that are made specifically forrobot experimenters.

I felt that the best way to under-stand where he was coming from wasto talk with him personally. “When Italk about servo feedback,” he toldme, “I mean feedback to an externalcontroller. Feedback that is limited tothe servo itself without feedback to anexternal controlling/monitoring devicesuch as a microcontroller or host computer limits the usefulness of theservo motor substantially.” I convincedhim that I was speaking of the feedback of the internal potentiometer

to the internal circuitry, not to the outside world. Its internal feedback potserves only to tell the internal circuitryjust where the servo horn is positioned.

I feel that this is an advantage overthe use of a stepper motor as a steppercan become stuck and the microcon-troller will assume that it still hasmoved the required number of turns. Amicrocontroller connected to a typicalservo will send the appropriate seriesof specific width pulses and the servowill continue to try to move to the rightspot until it is there.

Intelligent ServosAlex feels that the standard servo

of today — whether analog or digital —will soon be phased out for walkingrobots, especially the higher end kitsand ready-builts. The ‘Robot ExclusiveActuator Dynamixel’ from Robotis isone of the most innovative servos tocome out in years. The Robotis line ofrotary actuators (as they call them)have some very good features forrobot experimenters. They certainlycommand a premium price buthumanoid builders will find one featurevery useful in their designs — the abilityto be daisy-chained rather that have

three leads from each of, say, 18 ser-vos leading back to a controller board.

Dynamixel actuators, such as theAX-12+ (Figure 6), speak to each otherthrough a TTL line, and units such as the RX-28 (Figure 7) communicatethrough the popular RS-485 protocol.CrustCrawler has developed the AX12Smart arm that uses the RobotisDynamixel actuators for the arm’s joints.Each servo in the daisy chain is assignedan address for control and feedback pur-poses. Yes, these devices have true feed-back to the controlling microcontroller,such as an Atmel or BASIC Stamp.

Most of the larger manufacturersand dealers of robots and robot kits inSERVO Magazine have numerous styles,costs, and capabilities of servos in theirlineups. Figure 8 shows a line of servosfrom Pololu. The Seattle Robotics Society([email protected]) hasexcellent sources for hacking and modifying servos as do many othergroup’s sites. R/C and model aircraftsites offer much useful information.

In the two months that I havebeen working on this article off andon, I have come across so much information on the subject of servosand many of the articles are complete-ly contradictory with others. So, don’ttake everything that you read as fact.Talk with fellow robot experimentersand just take one apart and determinehow it works and what you’re going todo with it next. Modern servos are atrue bargain. SV

FIGURE 8. Line of servos from Pololu.

Tom Carroll can be reached via emailat [email protected].

CONTACT THE AUTHOR

All Electronics Corp. ..........................19, 66AP Circuits/e-pcb.com ............................13AWIT ..........................................................66Budget Robotics ......................................16CrustCrawler ...............................................3Electronics123 ..........................................19Floatation Center — Art Gallery ..............65Futurlec .....................................................66Gears Educational Systems, LLC ............50Hitec ..........................................................13

Hobby Engineering .................................66IMService ............................................19, 66Jameco .................................................2, 66Lorax Works ........................................19, 66Lynxmotion, Inc. .......................................17Maxbotix ...................................................66Maximum Robotics ............................30, 66Net Media .................................................83Parallax, Inc. ...............................Back CoverPCB Pool .............................................66, 72Pololu Robotics & Electronics ..........42, 66

Robotis Co. Ltd. .......................................78RobotShop, Inc. .................................66, 72Schmartboard .....................................19, 65SCON .........................................................19Solarbotics/HVW .......................................7SORC ..........................................................59SPSU ...........................................................21Technological Arts ...................................66TORMACH ................................................35Vantec .......................................................59Yost Engineering ......................................45

Advertiser Index

82 SERVO 12.2007

Then&Now.qxd 11/5/2007 4:31 PM Page 82

Page 83: Servo Magazine 2007-12

Order 24 hours a day, 7 days a week

www.Jameco.comOr call 800-831-4242 anytime

©Jameco Electronics. *According to the line cards on their web sites on August 28, 2007. Trademarks are the property of their respective owners.

OTHER JAMECO ADVANTAGES: More major brands of semis than any other catalog. 99% of catalog products ship the same day. Lowest prices guaranteed, or we pay 10%. Major brand names and generic equivalents

for even greater cost savings.

5

10

15

20

We’re passive aggressiveWhen it comes to passive products, we don’t pullany punches: we stock more major brands ofpassive components than any other major cata-log distributor.* So whatever brands you need—

from AMP or AVX to Vishay or Wakefield—you’re more likely to find them all at Jameco.Check our “stats” below and see for yourself. It’s another Jameco advantage.

Jameco® Digi-Key® Mouser® Newark®

AMP AMP AMP AMPAstec Power Astec Power Astec Power Astec PowerAugat AVX AVX AVXAVX Bourns Bourns BournsBourns Cherry Cherry CherryCherry Corcom Condor Power CorcomCondor Power CTS Corcom Elco ConnectorCorcom Elco Connector Elco Connector GrayhillCTS Fox Electronics Fox Electronics Int’l RectifierElco Connector Grayhill Int’l Rectifier KemetFox Electronics Int’l Rectifier Kemet MolexGrayhill Kemet Molex OsramInt’l Rectifier Molex Panasonic PanasonicKemet Osram Potter & Brumfield Potter & BrumfieldMolex Panasonic Teledyne Relays VishayOsram Potter & Brumfield Vishay WakefieldPanasonic Power-One WakefieldPotter & Brumfield VishayPower-One WakefieldTeledyne RelaysVishayWakefield

Free shipping on theseand 83 other major brands.Call for details.

CoverInside.qxd 11/1/2007 3:10 PM Page 2

Page 84: Servo Magazine 2007-12

Vol. 5 N

o. 12

SERV

OM

AG

AZIN

EH

ERO•

SERVO

S•

SPAR

E THE RO

D, SPO

IL THE BO

T•

TASK

PRIM

ITIVES

Decem

ber 2007

0 474470 58285

12>U.S. $5.50 CANADA $7.00

Cover.qxd 11/6/2007 3:46 PM Page 84