You are on page 1of 84

Were Semi Nuts

Weve got semis on the brain. Jameco offers more major brands of semiconductors than anyone almost twice as many as these catalog distributors.* Its another Jameco advantage.

Mouser
Atmel Semiconductor Avago Technologies Cypress Diodes INC. Fairchild Semiconductor Freescale Semiconductor Intersil Lattice Semiconductor Lite-On Semiconductor NEC Sharp Microelectronics ST Microelectronics Texas Instruments

Allied
Analog Devices Atmel Semiconductor Avago Technologies Freescale Semiconductor Infineon Technologies Integrated Devices Intel Corporation Intersil Lattice Semiconductor Maxim National Semiconductor NXP (formerly Philips) ST Microelectronics Texas Instruments

Newark
Altera Analog Devices Avago Technologies Cypress Fairchild Semiconductor Freescale Semiconductor Integrated Devices Intel Corporation Intersil Lattice Semiconductor Maxim National Semiconductor ST Microelectronics Texas Instruments

Jameco
Altera Analog Devices Atmel Semiconductor Avago Technologies Cypress Diodes INC. Fairchild Semiconductor Freescale Semiconductor Infineon Technologies Integrated Devices Intel Corporation Intersil Lattice Semiconductor Linear Technologies Lite-On Semiconductor Maxim Micron Technologies Microsemi National Semiconductor NEC NXP (formerly Philips) Renesas Technology Sharp Microelectronics ST Microelectronics Texas Instruments Toshiba

10

15

20

Free shipping on these and 79 other brands. Call for details.


25

OTHER JAMECO ADVANTAGES:


I More major passive, interconnect and electro-

mechanical brands than other distributors. I 99% of catalog products ship the same day. I Lowest prices guaranteed, or we pay 10%. I Major brand names and generic equivalents for even greater cost savings.

Order 24 hours a day, 7 days a week

www.Jameco.com
Or call 800-831-4242 anytime
Jameco Electronics. *According to their web sites on August 28, 2007. Trademarks are the property of their respective owners.

:cignaZkZaXdcigdaaZg hj^iZYidhbVaagdWdi^Xh VcYXdcigdaVeea^XVi^dch

B^XgdbdjhZX]Vhh^h

GdWdcdkV"&

;^ghi"XaVhhXjhidbZghZgk^XZ###
Ndj ]VkZ egdk^YZY eda^iZ! YZiV^aZY hjeedgi l]Zc > ]VkZ cZZYZY^i!]VkZWZZcbdgZi]VcVXXdbbdYVi^c\l]Zc^iXdbZh idejgX]Vh^c\Vhh^hiVcXZVhlZaaVhegdk^Y^c\bZl^i]a^\]ic^c\ [VhiZbV^agZhedchZh!egdbeiYZa^kZgnVcY]VkZbZiVcY\gZVian ZmXZZYZYbnZmeZXiVi^dc[gdbVgZiV^aZg^cZkZgngZ\VgY GdWZgi<dgYdcJc^kZgh^in!6WZgYZZc DG9:GDCA>C:/ LLL#68I>K:"GD7DIH#8DBI:A/ ))%&,+&'(.'+,

:VhnHiZe(%%%!VYkVcXZY hiZeeZgbdidgYg^kZVcY XdcigdahnhiZb

GdWdiX]Vhh^h!eVgih VXXZhhdg^Zh

=D@JNDJG<"%)AMhiViZd[ i]ZVgiaVhZggVc\Z cYZg

=D@JNDE7H"%(?C >c[gVgZYgVc\Z cYZg[dg ^cYddgZck^gdcbZcih

HZchdgBdjci^c\=VgYlVgZ

6JI=DG>H:9=D@JND9:6A:G

PAGE 10

Columns
08 10 14 68 72 78 79
Robytes
by Jeff Eckert

PAGE 39

Departments
06 20 21 22 74 75 82
Mind/Iron Events Calendar Robotics Showcase New Products Robo-Links SERVO Webstore Advertisers Index

Stimulating Robot Tidbits

GeerHead

by David Geer

Robot Roof Inspector Holds its Footing

Ask Mr. Roboto

by Pete Miles

Your Problems Solved Here

Robotics Resources
by Gordon McComb

Holding it All Together

Lessons From The Lab


by James Isom

NXT Packbot

Appetizer

by Pete Smith

Scots wha hae!

Then and Now


Robot Power

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

ENTER WITH CAUTION! 24 The Combat Zone


4
SERVO 10.2007

PAGE 46

10.2007
VOL. 5 NO. 10

Features & Projects


32
CAN Networking Miniature Style
by Fred Eady Learn everything you need to know to code the tricky Firgelli miniature linear actuator into the electromechanical side of your robotic designs.

48

Target Practice for Robotics Class

PAGE 26

by Michael Chan Turn an old printer into a shooting range and learn basic electronic principles to apply in future robot builds.

39

M-BOT
by Ron Hackett Part 2: Take a detailed look at M-bots circuitry and learn two useful yet simple software routines.

52

Build a Vex Wireless Joystick Controller


by Daniel Ramirez Utilize this device to bring Hollywood-style special effects to your next build.

43

Building an Android Arm


by Mark Miller Part 1: Complete arm assembly to begin the transformation into a working limb.

61

GPS
by Michael Simpson Part 1: A beginning look at incorporating GPS into your robot projects.

46

NEEMO 12
by Doug Porter Telerobotic surgery below the sea is good practice for telerobotic surgery in space.

SERVO 10.2007

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

Mind / Iron
by Bryan Bergeron, Editor When it comes to robotics, believing is seeing. Unlike scientific areas where researchers and enthusiasts happen upon novel processes or compounds, robots are the product of focused work. As such, its possible to approximate the trajectory of robotics with fairly good accuracy. My crystal ball? Military spending. Although there is a substantial commercial footprint in robotics, the US military is the traditional and largest backer of risky, future-oriented developments. The most accessible window into the militarys investment in the future of robotics is the series of DOD Small Business Innovation Research (SBIR) solicitations that are posted every few months at www.acq.osd.mil/osbp/ sbir/. The SBIR program provides up to $850,000 in early-stage R&D funding directly to small technology companies, including individual entrepreneurs who form a company. The program is competitive, with 10300 applicants per topic, and at most a handful of recipients. Obviously, the odds of eventual commercialization are much better for a DOD-backed robotics technology than for a robotics project without the additional, nostrings-attached funding. As an example of what the DOD funds in robotics, consider the SBIR solicitation that closed September of 2007. Using the DOD Topics Search Engine at www.dodsbir.net/Topics/ Default.asp, searching for robot retrieved seven solicitations: one from the Air Force, one from the Navy, and five from the Missile Defense Agency (MDA). The Air Force solicitation was for a human/machine perceptual sensing technology to aid the wearer in detecting an emerging threat, based on multi-source sensor fusion. The effect on the future direction of robotics products is clear in this solicitation. You can probably imagine an urban protective suit that warns pedestrians, cyclists, or police officers of impending danger, whether from motorists, potential muggers, or simply inclement weather. The Navys solicitation was for an unmanned surface vehicle (USV) at-sea refueling system. The goal was to develop a refueling system that can provide fuel for USVs with minimal risk to personnel or the environment. Spin-offs could one day autonomously refuel your hybrid car while you drive. No need to pull over to fill up or plug in to the power grid. The solicitations from the Missile Defense Agency ranged from space component miniaturization, interceptor algorithms, and sensor data fusion to the application of game theory in modeling and simulation. Space component miniaturization, with an emphasis on micro-electro-mechanical systems (MEMS) and lightweight, high-efficiency motors, has obvious relevance to the future of robotics. Lighter, more efficient motors will allow for more compact robot designs, including more compact batteries and power supplies. Although intended to thwart ballistic missiles, the MDAs solicitation for new interceptor algorithms will likely result in new algorithms for robot navigation and object avoidance, among others. Sensor fusion has been an important topic in robotics, ever since the introduction of the Kalman filter in the 1960s. The MDAs call for more advanced, multiMind/Iron Continued

Subscriptions Inside US 1-877-525-2539 Outside US 1-818-487-4545 P.O. Box 15277 North Hollywood, CA 91615 PUBLISHER Larry Lemieux publisher@servomagazine.com ASSOCIATE PUBLISHER/ VP OF SALES/MARKETING Robin Lemieux display@servomagazine.com EDITOR Bryan Bergeron techedit-servo@yahoo.com CONTRIBUTING EDITORS Jeff Eckert Tom Carroll Gordon McComb David Geer Pete Miles R. Steven Rainwater Michael Simpson Kevin Berry Fred Eady Doug Porter Mark Miller Ron Hackett Daniel Ramirez Michael Chan Pete Smith Chad New Paul Ventimiglia James Isom CIRCULATION DIRECTOR Tracy Kerley subscribe@servomagazine.com MARKETING COORDINATOR WEBSTORE Brian Kirkpatrick sales@servomagazine.com WEB CONTENT Michael Kaudze website@servomagazine.com PRODUCTION/GRAPHICS Shannon Lemieux Michele Durant ADMINISTRATIVE ASSISTANT
Debbie Stauffacher

SERVO 10.2007

Copyright 2007 by T & L Publications, Inc. All Rights Reserved All advertising is subject to publishers approval. We are not responsible for mistakes, misprints, or typographical errors. SERVO Magazine assumes no responsibility for the availability or condition of advertised items or for the honesty of the advertiser.The publisher makes no claims for the legality of any item advertised in SERVO. This is the sole responsibility of the advertiser. Advertisers and their agencies agree to indemnify and protect the publisher from any and all claims, action, or expense arising from advertising placed in SERVO. Please send all editorial correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879.

sensor data fusion algorithms will likely result in technology that will eventually appear in commercial robots. Furthermore, modeling and simulation are increasingly relied on for testing new algorithms and platform designs before physical robots are constructed. Advanced, innovative models for the evaluation and optimization of sensors have obvious applications in the robotics design process. How long before the innovations requested by the DOD leave the laboratory or workbench to become commercial realities? Probably years. But there is a continuous stream of similar DOD solicitations, dating back decades. Many of the DOD-funded innovations are just coming on line now, in the form of affordable sensors, components, and algorithms. Even if you dont intend to apply for a grant, its fun to read through the dozens of DOD-funded SBIR solicitations that appear every few months, and then try to imagine the likely effect on the evolution of robotics. SV

by J. Shuman

STEER WINNING ROBOTS WITHOUT SERVOS!

erform proportional speed, direction, and steering with only two Radio/Control channels for vehicles using two separate brush-type electric motors mounted right and left with our mixing RDFR dual speed control. Used in many successful competitive robots. Single joystick operation: up goes straight ahead, down is reverse. Pure right or left twirls vehicle as motors turn opposite directions. In between stick positions completely proportional. Plugs in like a servo to your Futaba, JR, Hitec, or similar radio. Compatible with gyro steering stabilization. Various volt and amp sizes available. The RDFR47E 55V 75A per motor unit pictured above. www.vantec.com

Order at (888) 929-5055


SERVO 10.2007

Robytes
Strength Record Set

by Jeff Eckert

Professor Joskowicz demonstrates equipment for probing your brain. Photo courtesy of Hebrew University of Jerusalem. Photo by Sasson Tiram.

The MIT Media Labs powered ankle-foot prosthesis in action. Photo by Webb Chappell.

KUKAs Titan is billed as the worlds largest and strongest six-axis industrial robot. Photo courtesy of the KUKA Robot Group.

Back in May, Germanys KUKA Roboter GmbH introduced Titan, which apparently has secured (at least for now) the title of worlds strongest robot in the Guiness Book of World Records. The machine is powered by nine motors that give it a 1,000 kg (2,200 lb) payload capacity, and it has a reach of 3.2 m (10.5 ft) and a work envelope of 78 m3 (2750 ft3). At full stretch, Titan reaches a height of more than 4 m (13 ft). According to the company, this monster is capable of moving entire car bodies all by itself and can withstand a static torque of 60,000 Nm (or 44,000 ft-lb, roughly 100 times the torque generated by your fathers Oldsmobile). Titan is intended for various applications in the building materials, automotive, and foundry industries. Details are available at www.kuka.com.

University of Jerusalem (www.huji. ac.il/huji/eng/). The apparently unnamed device was developed to improve keyhole surgical procedures in which tiny instruments are inserted into your brain through a small hole. Doctors already can make use of CT or MRI images, but there is still a risk of misdirecting the surgical instruments and causing hemorrhaging or severe neurological damage. But Joskowicz and some associates have developed an image-guided system that, based on a robot that is programmed using electronic scans of the patient, can provide better precision and dexterity than a surgeons hand. During surgery, the robot is clamped onto the patients skull, after which it automatically and accurately positions itself with respect to surgical targets. Once positioned, the robot locks itself in place and serves as a guide for insertion of a needle, probe, or catheter to carry out the procedure. The invention won Prof. Joskowicz the Kaye Innovation Award (named after and established by Isaac Kay, a British pharmaceutical mogul).

They have developed an ankle-foot device that, driven by a small batterypowered motor, allows amputees to walk normally again. In operation, the energy produced from the wearers forward motion is stored in a power-assisted spring and then released as the foot pushes off. Additional mechanical energy is provided for momentum. According to Herr, This design releases three times the power of a conventional prosthesis to propel you forward and, for the first time, provides amputees with a truly humanlike gait. And he should know, being a double amputee who tested his own invention. Herr created the device under the auspices of the Center for Restorative and Regenerative Medicine (CRRM), a collaborative research initiative that includes the Providence VA Medical Center, Brown University, and MIT. Commercial versions may be available by the summer of next year.

Bluegill Inspires UAV Design


Also from MIT, over in the BioInstrumentation Systems Laboratory (bioinstrumentation.mit.edu), is a robotic fin design that someday could be used to propel UAVs in functions ranging from ocean floor mapping to surveying shipwrecks, as well as military tasks such as mine sweeping and harbor inspection. An underwater bot

Getting Into Your Head


At the other end of the spectrum is a small bot invented by Professor Leo Joskowicz, of the Hebrew

Robot Ankle Developed


A less unsettling breakthrough comes from Professor Hugh Herr and his team of researchers at the MIT Media Lab (www.media.mit.edu).

SERVO 10.2007

Robytes
TAWHNN, SOTAWHNN, and the Headless Hornsmen. C!BRs 10-year anniversary spring tour ended in June, but presumably the act will go on the road again someday. In the meantime, you can hear samples, watch video clips, and even buy CDs at www.capturedbyrobots.com. But be warned that, with tunes like Torture, I Hate Your Techno, and I Just Peed Your Waterbed, this aint exactly Peabo Bryson. Its more like Chuck E. Cheese from Hell.
Four-legged prototype of the Jesus lizard. Photo courtesy of Carnegie-Mellon NanoRobotics Lab.

A bluegill sunfish swims in a laboratory tank near a prototype of a robotic fin it inspired. Photo by Donna Coveney.

driven by fins could prove to be more maneuverable and energy efficient than its propeller-driven counterparts. The researchers picked the bluegill sunfish because of its unusual swimming motion, in which it generates a constant forward thrust without creating backward drag. The latest design is based on a flexible polymer that replicates two critical motions: the forward sweep and the simultaneous cupping of the upper and lower fin edges. When an electric current is run across the base of the fin, it sweeps forward, just like the fish. When the direction of the current is changed, the fin curls to create the cupping action. Future research will focus on other aspects of the sunfishs movement, including interactions between its fins and body.

Walking on Water Almost


Apparently, there is this thing called a basilisk lizard, a member of the iguana family, that hangs out in Central and South America eating insects, plants, and small vertebrates. Its main claim to fame is that it can flap its web-like feet up to 10 times per second, which allows it to walk (run, actually) on water for distances of up to 20 m (~66 ft); hence the nickname Jesus lizard. Now some students at the Carnegie-Mellon NanoRobotics Lab,

working with Professor Metin Sitti, are attempting to build a robotic version on the theory that a bot that can travel across water without being submersed may offer more efficient movement by eliminating viscous drag. Its still in the prototype stage, but you can monitor the critters progress and even see videos at nanolab.me.cmu.edu/projects/wat errunner/. SV

Robotic Punk Music


His real name is Jay Vance, but he goes by the moniker of JBOT when performing with his band, Captured! By Robots (C!BR). According to the official story, JBOT spent a few years playing in some awful ska groups but back in the late 90s decided to build his own backup band. He collected some scrap metal, pulleys, and pneumatic actuators, and the result was DRMBOT0110, GTRBOT666, AUTOMATOM,

JBOT and the band: not everyones cup of hemlock.

SERVO 10.2007

by David Geer

Contact the author at geercom@alltel.net

Robot Roof Inspector Holds its Footing


Former Worcester Polytechnic Institute (WPI, Worcester, MA) students Nick McMahon and Sam Feller designed and built a roof inspection robot to help keep flesh and blood roof examiners from precarious and injurious positions. (Both McMahon and Feller graduated from WPI this year with Bachelor of Science degrees in Mechanical Engineering.)
icholas McMahon a current engineer at iRobot (where he is proudly working on the iRobot Packbot project) took a few minutes to fill in the details about his roofinspecting electro-mechanization.

Robotic Goals, Rooftop Got-yas


Roboticists are problem-solvers. They solve problems of physics, physi-

cal mechanics, electronics, and robotics to create moving solutions to seemingly immovable problems. A key challenge for Nick and partner Sam Feller was to create a robot that could perform practical, quality roof inspections while maintaining balance and mobility in an environment of steep inclines and treacherous twists and turns. The duo had to design the robot around maintaining stability and traction on steep surfaces (i.e., 45-degree slopes),

The roof inspection robot (top-side, on faux roof). At the bottom, see if you can find the pan/tilt X10 camera. Can you find the potentiometer in the center? Can you tell which way it is going? Which way is it looking right now?

according to McMahon. The stability problem required a low center of gravity. The roboticists used CAD modeling techniques and live testing scenarios to design and validate the robots low center of gravity. In order to be a suitable replacement for human inspectors, the robot must not tip or get hung up in this most inhibitive of environments. Traction was another matter. The traction problem meant experiment upon experiment with varying materials of differing levels of friction to create wheel surfaces that would maintain contact with the roofing. Not just any material would do. We started with traditional conveyor belt material. Other candidates were Scotch Brite pads and various foams and rubbers. We settled on EPDM (ethylene

LESSONS LEARNED
According to former WPI student and now graduate Nick McMahon, he and former student Sam Feller learned how robotics rely on software engineering, mechanics, and electronics to work properly. They also learned about time management, team work, and working with customers to get their input. Travelers Insurance, their customer for this robot research, sponsored the roof robot project, McMahon explained.

10

SERVO 10.2007

GEERHEAD
propylene diene monomer) rubber, says McMahon. EPDM has several properties including density, durability, and resistance to abrasion. McMahon and Feller used force gauges and friction testing to calculate the coefficient of friction on asphalt shingles to determine the best material for the job from among all the candidates. The roboticists attempted to add to the surface area of the wheel that would actually make contact with the roof by using substrates layers of material on the wheels. In theory, surface area doesnt matter in friction calculations, says McMahon, but we found that the more weight you have per area, the more likely the shingle is to fall apart from the rotation of the wheels. Spreading out the contact area helps spread the weight of the robot across more area so the shingles dont crack. according to McMahon. The body of the robot uses a special joint that allows it to drive onto one plane of the roof from another plane and sit half on one at one angle and half on another at another angle, if necessary. Basically, the front and back of the robot are divided into two independent segments that can turn up and down and left and right to navigate the planes of a roof Here is a side angle. Why is it looking to its rear? where they meet without the wheels or other parts of the robot getting hung up. So, it can robots maneuverability and center of operate on two planes without losing gravity on an 8 x 8 test roof built contact with the roof, says McMahon. inside a WPI lab. The test roof had The robots controls allow each the necessary 45-degree slope and a wheel to move at the speed necessary right-angle section to test the valley to maintain its rolling contact with traversing capabilities. the roof, dependent upon the angle of The two young scientists drove the the wheel joint. This arrangement robot in every possible orientation and avoids loss of traction and roof angle to test the limits of its configuradamage simultaneously. The operator tion and software code, according to uses command and control and a video McMahon. Of course, robots seldom camera to inspect the roof and to drive score 100 the first time around. the robot around. Too fast a speed or too twisted a turn and off the makeshift roof the robot flew. For instance, as it went around the corner, the body would Into every roboticists life, a few parts twist and the center of gravity would must fall, smash, crack, bang, and bend. move causing the whole robot to fall McMahon and Feller tested the over and off of the roof. No significant

Peak Navigation Performance


Talk about difficult terrain the robot would need to straddle roof peaks and negotiate the valleys between them without getting stuck or leaving hidden places it couldnt reach to inspect. The first part was resolved by leaving the underbody of the robot open to allow for the cresting of peaks,

What Goes Up...

WPI students conduct MQPs or Major Qualifying Projects in their Senior year at WPI. This is an example of a WPI search and rescue robot project. Here, the robot is seeking out the candle.

Take a look at the WPI search and rescue robot on a test rescue mission.

SERVO 10.2007

11

GEERHEAD
RESOURCES
Worcester Polytechnic Institute www.wpi.edu First college major in Robotics Engineering www.wpi.edu/News/Releases/20067 /rbemajor.html WPI Robotics Engineering www.wpi.edu/Academics/Majors/RBE

use the misguided feedback to try to keep the joint in position, oscillating the joint, according to McMahon. Other times, bits of phantom code would cause the joint motor to suddenly come on full power and slam the two body halves together, McMahon explains.

damage ever occurred but we had some bent parts that needed to be straightened out, says McMahon. McMahon also recounts how the robot would literally try to destroy itself. This flaw required adjustments around potentiometer feedback. This particular potentiometer tracks body rotation angle. On rare occasions, the feedback signals looped. The robot, responding to the feedback, went into convulsive joint oscillations, gyrating its two halves continually until the roboticists reset it. This happened at varying points in the testing phase for different reasons. In the beginning, the potentiometer wasnt properly secured to the joint it was measuring. When the potentiometer slipped, the software code would

Parts and Configuration Unique to the Problem at Hand


For the roof robot construction, McMahon and Feller used leftover window motors from FIRST competition robot projects, a McMaster-Carr gear motor, and IFI Victor speed controllers. The motors are Nippon Densos, like those shipped with the FIRST robotics competition kits, according to McMahon. We chose them because they suited our power and speed requirements, comments McMahon. McMahon and Feller bought a generic 12V motor with gear reduction to drive that infamous joint in the center of the robot. The motor drives the two halves of the robot mechanically when the wheels dont get traction, explains McMahon. The Victor speed controllers also

Precision CNC Machining


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

Tormach PCNC 1 100 Features:


Q Q Q Q Q Q

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

$6800
plus shipping

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

come from the FIRST robotics competition kit and control the speed of the wheel motors. The two roboticists also used potentiometers, encoders, and Sharp IR sensors for edge detection. The potentiometer tracks the joint position. This information helps the wheels to each move at the right speed to maintain contact with the roof. The encoders are actually beam interrupters modified to read the speed of each wheel independently. The robot feeds the encoder information back to the microcontroller. The microcontroller uses software to make sure the wheels dont slip and that each wheel is powered at the right time to keep them touching the surface, according to McMahon. The Sharp IR sensors reflect a beam off the surface of the roof and back to the sensor. When the sensor doesnt see its reflection, it knows it has reached the edge of the roof and the robot stops so as not to fall off. All of the mechanical pieces were designed and fabricated by us in the schools machine shops, says McMahon. These include chassis panels, motor mounts, joint parts, the belly pan and the pan tilt tower used for the camera, according to McMahon. Everything is held together with threaded fasteners, he adds. McMahon and Faller also used an X10 camera for the video and a VEX microcontroller for the robots brain. The VEX masterminds the edge sensing, course of direction, velocity, and joint angle; it also negotiates command and control instructions from a human operator. The pan/tilt tower forms the foundation for the X10 camera. This makes it possible for the operator to maneuver the camera, to catch every glimpse of the roof for a thorough inspection. Nickel metal hydride batteries power the robot, giving it an hours worth of locomotive and inspection capabilities. The robot is currently sitting in storage at WPI where it can be used for parts for future Major Qualifying Projects (MQPs); MQPs are WPIs moniker for senior design projects. SV

12

SERVO 10.2007

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

roboto@servomagazine.com

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

by

Pete Miles
. Here is a tough question for you to chew on. I have seen you write articles about the PS2 controller and the bluetooth modem from SparkFun, but can you make the PS2 controller a wireless controller using these two parts? Right now, I have a regular Futaba R/C controller to drive my robot around, but it doesnt have any switches for turning on lights and sounds. The PS2 controller has 12 buttons for turning things on and off and two joysticks for driving my robot. Can you help me here? Will Harrison

. Sounds like you have a fun robot project, and converting a Playstation 2 controller into a

wireless controller isnt that difficult, especially if you are using the BlueSMiRF Bluetooth serial modem from SparkFun Electronics (www. sparkfun.com). There are two different things that you have to build: a serial interface for the Playstation 2 controller and a serial interface for your robot. In the January 07 issue of SERVO Magazine, I showed how to interface a regular wireless Playstation 2 controller to a BASIC Stamp from Parallax (www.parallax.com). This may be the simplest way to go since all you would need is one of the wireless PS2 controllers, such as the Madcatz (www.madcatz.com) or the PS2 robot controller from Lynxmotion

(www.lynxmotion.com), a microcontroller, and a controller interface cable. (I included the above reference for anyone who may have missed that issue of SERVO Magazine.) I am going to do something a little different here. In the previous article, the communication timing between the wireless PS2 controller and the BASIC Stamp needed to be at high speeds, which limited the selection of the BASIC Stamps to their faster processors. For this article, I am going to make the PS2 interface using a Scenix SX-28 microcontroller (www.para llax.com/SX), mainly because it is faster than the BASIC Stamp (up to 75 MHz), and it uses the SX/B program-

Figure 1. Playstation 2 controller interface hardwired to a BASIC Stamp for testing.


+5V +5V

Vdd RTCC 10 K MCLR +5V OSC2 OSC1 SOUT SIN ATN VSS RES VDD VIN 4 MHz RC.7 RC.6 RC.5 RC.4 RC.3 RC.2 RC.1 RC.0 Vdd GND RB.7 RB.6 RB.5 RB.4 RA.3 P15 P14 P13 P11 P10 P9 VSS P8 220 RA.2 RA.1 RA.0 Vss RB.3 RB.2 RB.1 RB.0 4.7 K 4.7 K CLOCK ATTN CMD DATA +5V +9V ACK

VIOLET N/C BLACK BLUE YELLOW RED/SHIELD GREEN ORANGE BROWN

ACKNOWLEDGE NOT CONNECTED CLOCK ATTENTION Vdd (+3V to +5V) GROUND +9V FOR VIBRATION MOTOR POWER COMMAND DATA

SX28AC/DP

BASIC STAMP 2 FAMILY

P0 P1 P2 P3 P4 P5 P6 P7

LYNXMOTION PS2 CONTROLLER ADAPTER CABLE. AS VIEWED FROM THE FEMALE END

14

SERVO 10.2007

ming language which is very similar to the BASIC Stamp programming language. As a side note, the SX family of microcontrollers are the core microcontrollers for most of the BASIC Stamps. To make this project one step easier, I borrowed some of the work that Jon Williams developed for the Playstation 2 controller interface using the SX-28 chip from the Stamp Applications column in the January 06 issue of Nuts & Volts Magazine (www.nutsvolts.com). As with all wireless development activities, the first thing that needs to be done is to make sure that the two devices can communicate directly with each other without the wireless connection. The reason for this is to make sure that the two devices are individually working properly and that they are properly communicating with each other. It is much easier to diagnose hardwired problems than wireless problems. Figure 1 shows a simple schematic for connecting the PS2 controller to an SX-28AC/DP microcontroller. The SX microcontroller receives a serial command to read the current state of the PS2 controller, then converts the data to be transmitted via a serial output. One serial input line is used for receiving the data and a second serial line is used for outputting the data. Two lines were used since the BlueSMiRF uses two separate serial lines for receiving and transmitting data. For testing purposes, a BASIC Stamp is connected to the SX microcontroller to transmit and receive data with the SX microcontroller and display the PS2 controller results on a debug window on a computer. Here, the BASIC Stamp is simulating the main microcontroller on a robot. The key to obtaining reliable communications between two serial devices is to make sure that they are synchronized to each other. A synchronous serial communication protocol can be used, but this will require four communication lines, two data lines, and two handshaking lines. The other method is to use an asynchronous method. Here, data will go back and forth at their own timing rates. Receiving data in midstream is often a problem with asynchronous serial communication methods. One way to get around this is to have the master device transmit a command that it is ready to receive data. Then, the slave device is programmed to continuously monitor the input serial line, looking for the ready to receive command. When the slave receives the command, it then collects the data and transmits the results back to the master device. In the meantime, the master device is waiting to receive the data. When it receives the data, it processes the data, and when it is ready to collect a new set of data, it repeats this process again. For this project, the asynchronous communication is synchronized when the BASIC Stamp sends a four character instruction, !PSX, to the SX microcontroller (see the Main BASIC Stamp Loop program that follows). The main loop in the SX microcontroller is looking for the same set of characters (see the Main SX PSX Controller Loop program). Once the SX microcontroller receives these characters, it will then read the current state of the Playstation 2 controller,

and then serially transmit this data back to the BASIC Stamp. During this time, the BASIC Stamp is waiting for a response from the Playstation controller. When it receives the data, the BASIC Stamp displays the results on a computers debug window. The BASIC Stamp is using a 200 ms timeout in the serial input command so that the main robot doesnt get stuck waiting for some data that may never come if the input signal is lost (i.e., the BlueSMiRF loses its radio connection link or bad interference occurs in the signal).
Main Basic Stamp Loop Main: SEROUT S_cmd, Baud, [!PSX] SERIN S_Data, baud, 200, Main, [psxID,psxStatus,psxThumb1,psxThumb2, psxJoyRX,psxJoyRY,psxJoyLX,psxJoyLY] DEBUG CRSRXY, 8,0, IHEX2 psxID, CRSRXY, 8,1, IHEX2 psxStatus, CRSRXY, 8,2, BIN8 psxThumb1, BIN8 psxThumb2, CRSRXY, 8,3, DEC3 psxJoyRX, CRSRXY, 8,4, DEC3 psxJoyRY, CRSRXY, 8,5, DEC3 psxJoyLX, CRSRXY, 8,6, DEC3 psxJoyLY GOTO Main Main SX PSX Controller Loop Main: char = RX_BYTE IF char <> ! THEN Main char = RX_BYTE IF char <> P THEN Main char = RX_BYTE IF char <> S THEN Main char = RX_BYTE IF char <> X THEN Main Get_Status: WAIT_MS 1 READ_PSX if psxStatus = $00 then PSX_Config READ_PSX endif TX_OUT psxID TX_OUT psxStatus TX_OUT psxThumb1 TX_OUT psxThumb2 TX_OUT psxJoyRX TX_OUT psxJoyRY TX_OUT psxJoyLX TX_OUT psxJoyLY GOTO Main

Program Listing 1 is the entire program for the SX-28 chip to communicate with the PS2 controller and Program Listing 2 is the entire BASIC Stamp program for communicating with the SX-28 microcontroller and displaying the results on a computers debug display (both are available on the SERVO website; www.servomagazine.com). When the two devices are hooked up and programmed properly, the computer will display which buttons on the PS2 controller are being pressed, and what the joystick values are when the controller is in analog mode. Once you have this working, you will be ready to install the BlueSMiRF serial modems. Figure 2 shows how the BlueSMiRF modems are installed SERVO 10.2007

15

Bits per Second 9600 Data Bits 8 Parity None Stop Bits 1 Flow Control None

Table 1. Initial com port settings.


in this circuit to make this into a wireless Playstation 2 controller. As you can see, Figures 1 and 2 are essentially the same except there is a pair of BlueSMiRF serial modems between the BASIC Stamp and the SX-28 microcontroller instead of the two serial hardwires. The only other thing that is new in this circuit is the serial bypass switch between the BASIC Stamp and the BlueSMiRF modem. The serial bypass switch was added so that the BlueSMiRF modems can be configured in the circuit. Configuring the two BlueSMiRF serial modems to talk to each other is probably the trickiest part of the whole project. To do this, a TTL voltage level (0-5V) RS-232 cable

needs to be attached to the master BlueSMiRF serial modem. The master BlueSMiRF serial modem is the one attached to the BASIC Stamp, and the RS-232 cable is attached to the bypass switch. As a reminder, the TX line on the RS-232 cable connects to the RX line on the BlueSMiRF, and the RX line on the RS-232 cable connects to the TX line on the BlueSMiRF. Using a computer, open the HyperTerminal program (or any other serial port terminal program) and put the com port settings to the 9600 baud rate shown in Table 1. This is the default baud rate setting for the BlueSMiRF. To see the characters being typed on the screen from the keyboard, set the ASCII character sending parameter to Echo Characters Locally. Apply power to both circuits, and open the com port to the master BlueSMiRF serial modem. Type these three characters +++ on the HyperTerminal screen and hit the carriage return key. Then type the two characters AT and hit the carriage return. The text, OK, should be displayed on the HyperTerminal window. At this point, the BlueSMiRF modems are ready to be configured.

Figure 2. Wireless Playstation 2 controller test circuit.


BlueSMiRF Modem

+5V +5V
TX-0 RX-I RTS-0 CTS-I PWR

SOUT SIN ATN VSS

VDD VIN RES 220

BASIC STAMP 2 FAMILY


VSS

P0 P1 P2 P3 P4 P5 P6 P7

P15 P14 P13 P12 P11 P10 P9 P8

220

TTL SERIAL OUTPUT EXTERNAL MODEM CONFIGURATION TTL SERIAL INPUT

+5V

+5V

Vdd RTCC RC.7 RC.6 RC.5 MCLR RC.4 +5V RC.2 RC.1 RC.0 Vdd GND RB.7 RB.6 RB.5 RB.4 RA.3 RA.2 RA.1 RA.0 Vss RB.3 RB.2 RB.1 RB.0 4.7 K 4.7 K CLOCK ATTN CMD DATA +9V ACK

VIOLET N/C BLACK BLUE YELLOW RED/SHIELD GREEN ORANGE BROWN

ACKNOWLEDGE NOT CONNECTED CLOCK ATTENTION Vdd (+3V to +5V) GROUND +9V FOR VIBRATION MOTOR POWER COMMAND DATA

16

BlueSMiRF Modem
+5V
TX-0 RX-I RTS-0

10 K

SX28AC/DP

OSC2 OSC1 4 MHz


CTS-I PWR

LYNXMOTION PS2 CONTROLLER ADAPTER CABLE. AS VIEWED FROM THE FEMALE END

SERVO 10.2007

There are three different ways to get the two BlueSMiRF modems to connect to each other: Manually send commands via RS-232 cable and using HyperTerminal every time the circuit is powered up. Having the BASIC Stamp issue the various connection commands to the Master BlueSMiRF serial modem and analyze the responses from the slave BlueSMiRF modems. Having the master BlueSMiRF serial modem automatically connect to a specific slave BlueSMiRF serial modem on its own. The easiest way to go about this is to have the master BlueSMiRF serial modem automatically connect to the slave modem. The only drawback to this is that the main microcontroller wont know if the communication link is connected or not connected, lost, or corrupted. The microcontroller is capable of monitoring the connection status, making a connection, and reconnecting if a problem occurs, but this will take a lot of software to do. For this project, an automatic connection approach was used. When the BlueSMiRF modem receives the three character escape sequence (+++), it is put into a configuration mode. It will no longer transmit or receive wireless data. Remember to make sure that the bypass switch is toggled to the external RS-232 data cable, or the BlueSMiRF wont accept the +++ command since its mixing it with the data from the BASIC Stamp. To configure the BlueSMiRF for automatic connection, first clear the master radio with the ATUCL command. Then perform an inquiry to determine what the Bluetooth address to the slave modem is (if you dont already know it). The following shows what is typed in the HyperTerminal window and the replies from the master BlueSMiRF radio.
Send: Reply: Send: Reply: ATUCL<cr> //Clear master radio <cr_lf>OK<cr_lf> ATDI,1,00000000<cr> //Look for only 1 device <cr_lf>00A0961D2023<cr_lf> <cr_lf>DONE<cr_lf>

Baud Rate 4800 9600 19200 38400 57600

ASCII Value 20 39 79 157 236

Hex Value 14 27 4F 9D EC

Table 2. BlueSMiRF baud rate programming values.


off and the red LED will turn on. At this point, the two BlueSMiRFs are now connected together and the master BlueSMiRF will exit the configuration mode. The two modems will start transmitting data back and forth wirelessly with each other. Now change the serial bypass switch to connect to the BASIC Stamp, and the BASIC Stamp terminal window will start displaying the Playstation 2 controller information (just like it did when the testing configuration from Figure 1 was used). The default baud rate for the BlueSMiRF modems is 9600 bps. At 9600 bps, it takes about 1 ms to transmit one byte of data. Since 12 bytes of data is being exchanged between the two devices, about 12 ms of time is required to query the PS2 controller to determine its current state. This may or may not be a problem for your application, but if you need a faster response, then the baud rates in the two programs will need to be increased, and the BlueSMiRF modems will need to be reconfigured individually with the new baud rate. The following sequence of commands are used to change the BlueSMiRF baud rate to 19200 bps. Remember that the RS-232 serial cable needs to be hooked up and the serial bypass switch changed to the external serial data source.
Send: Send: Reply: Send: Reply: +++<cr> //Enter configuration mode AT<cr> //Verify you are in conf mode <cr_lf>OK<cr_lf> ATSW20,79,0,0,1<cr> //set baud rate to 19200 bps <cr_lf>OK<cr_lf>

The ATDI is an inquiry command; the 1 means look for only one device. The 00A0961D2023 is the Bluetooth address for the slave BlueSMiRF modem connected to the SX microcontroller. Next, set the master BlueSMiRF to autoconnect mode, and then tell the master BlueSMiRF what the address is to the slave BlueSMiRF. The following shows what is typed in the HyperTerminal window and then replies from the master BlueSMiRF radio.
Send: Reply: Send: Reply: ATSW25,1,1,0,0<cr> //Set autoconnect mode <cr_lf>OK<cr_lf> ATSMA,00A0961D2023,1101<cr> //Set slave address <cr_lf>OK<cr_lf>

The command ATSW20 is the command to change the baud rate. The 79 is the code for the specific baud rate of 19200 bps. Table 2 shows the codes for other baud rates. Once the ATSW20 command is executed, the baud rate is immediately changed. To continue to communicate with the BlueSMiRF, the baud rate for the HyperTerminal program must be immediately changed to the same baud rate that is now programmed into the BlueSMiRF. You need to remember this baud rate, since BlueSMiRF will be operating at the baud rate until reprogrammed, even after powering up the device again. To verify the current baud rate settings, execute the following command:
Send: ATSI,8<cr> //Verify current baud rate settings Reply: <cr_lf>OK<cr_lf> <cr_lf>004F,0000,0000<cr_lf> // Above are the current baud settings in HEX

About one second after executing the ATSMA command, the green flashing LED on the BlueSMiRF will turn

SERVO 10.2007

17

Figure 3. Lynxmotion Playstation controller adapter cable.


An important command to remember if things get messed up is the ATFRST command. This will cause the BlueSMiRF serial modem to reset back to the original factory settings. In order to execute this command, you must be sending data at the same baud rate that is currently programmed into the BlueSMiRF. At this point, you have all the information needed to make a wireless Playstation 2 controller for your robot using the

Figure 4. Wireless SX-28 microcontroller interface prototype for the Playstation 2 controller.
BlueSMiRF serial modems. One thing that might help you with your project is the PS2 controller cable from (www.lynxmo tion.com). This cable costs less than $5, and it has the proper female connector for your Playstation controller and simple plugs for connecting to your electronic project. Figure 3 shows a photo of this handy cable. Figure 4 shows the wireless SX microcontroller interface to the Playstation 2 controller to show the simplicity of the wiring. SV

18

SERVO 10.2007

SERVO 10.2007

19

Send updates, new listings, corrections, complaints, and suggestions to: steve@ncc.com or FAX 972-404-0269 Know of any robot competitions Ive missed? Is your local school or robot group planning a contest? Send an email to steve@ncc.com and tell me about it. Be sure to include the date and location of your contest. If you have a website with contest info, send along the URL as well, so we can tell everyone else about it. For last-minute updates and changes, you can always find the most recent version of the Robot Competition FAQ at Robots.net: http://robots.net/rcfaq.html R. Steven Rainwater

20

Franklin Institute Robot Conflict Institute Science Museum, Philadelphia, PA Remote-control vehicles destroy each other. www.nerc.us Chibotica Donald E. Stephens Convention Center, Rosemont, IL Chibotica returns with even more events: maze solving, line-following, mini Sumo, Robo-One, a robot talent show, and remote-controlled vehicle combat. www.chibots.org Hyatt Regency Tech Center, Denver, CO Held in conjunction with MileHiCon. See robot combat by the folks who invented robot combat competitions. www.milehicon.org

21

O c tober
5-7
MindSpark College of Engineering, Pune, India MindSpark includes a standard Micromouse event and a competitive pick-and-place event called Dogfight. MindSpark will also host a region IITB Techfest Nexus event called Vertigo that requires cooperation between a remote-controlled machine and an autonomous robot. Working together, the two machines must move a number of blocks from one location to another. www.robotics.mind-spark.org Woodside High School, Woodside, CA This years event will be a recreation of the FIRST Robotics 2007 Rack and Roll contest. www.wrrf.org/Events/index.php

26-28 Critter Crunch

26-28 Korea Intelligent Robot Contest


Pohang Indoor Gymnasium, Pohang City, Korea Several events are planned for autonomous robots including Micromouse, MIROzSOT games, and intelligent robot demonstrations. http://irc.piro.re.kr

12-13 Cal Games

N ov e m b e r
10
DPRG RoboRama Museum of Nature and Science, Dallas, TX The usual assortment of events including Quick Trip, T-Time, wall-following, line-following, and can retrieval. Check the website to verify the date and venue as they were still be finalized as this month's list went to press. www.dprg.org UH Manoa Duke Kahanamoku Aquatic Complex, Oahu, HI ROVs built by university and high school students compete in this event, which is part of the MATE (Marine Advanced Technology Education) series of contests. www.marinetech.org/rov_competition

17-20 Russian Olympiad of Robots


Moscow, Russia Russian robots compete in Sumo, fire-fighting, line-following, and RoboCup events. There is also a cross-country robot race and remote-controlled vehicle combat to keep things interesting. http://intronics.bogorodsk.ru

23-24 Hawaii Underwater Robot Challenge

19-21 Elevator:2010 Climber Competition


Event Center, Greater Salt Lake City, UT Autonomous climber robots must ascend a scale model of a space elevator using power beamed from the base. www.elevator2010.org

20

SERVO 10.2007

I M S e r v ic e
V o ic e : 8 8 8 -4 5 1 -1 6 7 0 o r : 2 4 8 -4 8 6 -3 6 0 0

P .O . B o x 1 4 2 , N e w H u d s o n , M I 4 8 1 6 5

D e s k to p C N C S o lu tio n s
1 2 x 1 2 x 4 9 0 o r 1 7 5 ip m 1 2 x 2 4 x 4 N E W 4 0 0 ip m
S e r v o C N C R o u te r s S ta r tin g a t $ 1 9 9 5
D e s k C N C

6 UH ROGH TX U L LUH QJ G 

7KH(VFDSH 5RERWVEXLOWLQ PLFURSURFHVVRU HQDEOHVLWWR WKLQNRQLWVRZQ .65 

7KHURERWIURJPRYHVIRUZDUG ZKHQLWGHWHFWVVRXQGDQG UHSHDWVVWDUW PRYHIRUZDUG !


VWRS!OHIWWXUQ!VWRS!ULJKW WXUQ!VWRS .65 

PP:KLWH ZDWHUFOHDU /('9 PFG $% 

 VHFRQGYRLFHUHFRUGHUSOD\EDFN PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH


ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH SUHDVVHPEOHG  $  7KH9HOOHPDQ3HUVRQDO6FRSH LVQRWDJUDSKLFDOPXOWLPHWHU EXWDFRPSOHWHSRUWDEOH RVFLOORVFRSHDWWKHVL]HDQG FRVWRIDJRRGPXOWLPHWHU +36  QGV 7KRXVD PVRQ PRUHLWH LWH V E H RXUZ

i m s r v .c o m

Robotics Showcase
The Power SchmartModule will power up your circuits with your choice of -9, -12, +2.5, +3.3, +5, +9, and +12 volts.

THOUSANDS OF ELECTRONIC

PA R T S A N D S U P P L I E S

VISIT OUR ONLINE STORE AT

www.allelectronics.com
WALL TRANSFORMERS, ALARMS, FUSES, CABLE TIES, RELAYS, OPTO ELECTRONICS, KNOBS, VIDEO ACCESSORIES, SIRENS, SOLDER ACCESSORIES, MOTORS, DIODES, HEAT SINKS, CAPACITORS, CHOKES, TOOLS, FASTENERS, TERMINAL STRIPS, CRIMP CONNECTORS, L.E.D.S., DISPLAYS, FANS, BREADBOARDS, RESISTORS, SOLAR CELLS, BUZZERS, BATTERIES, MAGNETS, CAMERAS, DC-DC CONVERTERS, HEADPHONES, LAMPS, PANEL METERS, SWITCHES, SPEAKERS, PELTIER DEVICES, and much more....

O R D E R TO L L F R E E

Very Schmart! www.schmartboard.com


SERVO 10.2007

$15

1-800-826-5432
Ask for our FREE 96 page catalog

21

New Products

N E W P RO D U C T S
ROBOT TOYS High Tech Hero

earning Curve Brands, Johnny Lightning Boys Division has created a new high tech hero just in time for the 2007 holiday season. The radio controlled V_BOT transforms from a sleek street vehicle into a giant robot with a touch of a button, and is loaded with action moves like the signature V Chop. An internal concept, V_BOT came with big engineering challenges and from those challenges came big rewards, said Holger Kraetschmer, Senior Managing Director at RC2 Corp. V_BOT is a truly revolutionary radio control toy that captures kids imaginations with a giant robot that they can control, transform, and drive. Thats a big payoff. V_BOT is a 15-inch radio control robot which also has a plug-in for an MP3 player. V_BOT comes with a handheld controller featuring six action buttons and three preprogrammed action buttons. V_BOT will be available nationwide at leading retailers this fall for $129 SRP.

and weapons can be interchanged between Battle Wheel warriors to outfit the ultimate champion. Play one-on-one, or as a team with the multiband feature allowing up to six warriors to battle at the same time. Characters include: VUL, the savage protector of Venus; TYR, the cold arm of Plutos justice; BASHAMON, the silent enforcer of Saturns law (pictured), and KAGI-TSUCHI, the fury of Mercurys fire. Cost is approx. $30, and each warrior will be available this fall. For further information on all toys mentioned, please go to:

RC2 Corporation

Website: www.rc2.com

SENSORS Ultrasonic Rangefinders Feature Custom Beam Width

Battle Wheels Radio Control Action Figures


attle Wheels Johnny Lightnings newest addition to this seasons radio controlled toys are fully articulated, highspeed remote controlled warriors that crash and spin into each other, knocking off each others armor, and ultimately their opponents head to claim victory. These warriors are action based and have multiband controllers allowing up to six warriors to battle at a time using two frequencies. Each Battle Wheel warrior comes with five removable pieces of armor, two weapons, a controller, and a cardboard training dummy. The fully articulated warriors can be strategically positioned for attack or defense, depending on the style of combat chosen. Five removable pieces of armor (two shoulder pads, two wheel blades, and a shield), as well as the individual characters battle weapons, accompany each warrior into battle. Body armor

sers of ultrasonic rangefinders have found that the beam widths of low cost ultrasonic sensors do not always match their application. Wider beam width (and more sensitivity) is better suited for obstacle detection, people detection, collision avoidance, detecting small objects, and more robust detection in the central beam area. Narrower beam width (and less sensitivity) is useful for clutter rejection, high acoustic noise environments, directional ranging, room mapping, or using an ultrasonic sensor to locate an opening such as a door. Some users require very long detection and ranging, while others only care about performance out to one meter. In addition, users of ultrasonic sensors even sensors that have a narrow beam width still desire detection of small objects within the central beam, stable range measurements (even when ranging moving objects), small size, low power, and the sensor must be easy to use. Both narrow or wide beam sensors can be useful for all of the mentioned uses but, in general, a specific beam width will perform better than another for a given user application. The beam width of the LV-MaxSonar sensor line-up is factory calibrated and precisely controlled. This allows the precision beam angles that users of the EZ1 have

22

SERVO 10.2007

come to depend on. The beam width of the LV-MaxSonarEZ1 balances robust people detection ability with a narrow beam width. This compromise does not fit all users as some users have reported that, for their application, they desire either a wider or narrower beam. To address this, MaxBotix, Inc., has added four additional ultrasonic rangefinders to the LVMaxSonar sensors; each calibrated to a specific beam width. This allows users to select the sensor that provides the beam width of choice. The sensor beam width is widest for the EZ0 where it is well suited to users desiring a high sensitivity or a wide beam width. Each sensor the EZ1, EZ2, EZ3, and EZ4 is progressively narrower. For example, the EZ4 provides users with a narrow beam width for much better clutter or acoustic noise rejection. The LV-MaxSonar ultrasonic rangefinders operate over the voltage range of 2.5V to 5.5V (2 mA typical), provide three simultaneous user outputs (analog voltage, pulse width, and serial), fill a volume less than one cubic inch, and weigh only 4.3 grams. The rangefinders cost $29.95 and are RoHS compliant. For further information, please contact:

MaxBotix, Inc.

4613 County Road 8 Brainerd, MN 56401 Tel/Fax: 2187642489 Email: info@maxbotix.com Website: www.maxbotix.com

SERVO 10.2007

23

Featured This Month


Participation 24 A Day in the Life Of
by Kevin Berry

25 Family Corner: Legendary


Robotics
by Kevin Berry

Feature 25 New Big Bots

PARTICIPATI N
A Day in the Life Of
by Kevin Berry
Middleweight Heavy Metal Noise presents lots hen designing a bot, of safety opportunities as it awaits its turn in the arena at Battle Beach. certain safety rules are in play. We all know per the tech regs we need a power cutoff switch, a power indicator, power return isolated from the frame, and weapon restraints. What we often forget in the process of laying out and fabricating the bot, is to put some thought into how we will activate and safely deactivate our latest outside those in the event safety monster. procedures. A lively debate on the RFL One technique that can be forum recently showed that used during design is simulating just like bellybuttons all a day in the life of the bot. Walk builders have opinions on bot through, in discussion with activation and safing, but no another team member, each step two are alike. The permutafrom connecting the batteries in tions of powering up the the pit, moving it to the box, transmitter, turning on the activating it, fighting it, safing, bot, handling restraints, powering it down, removing, and and moving the machine recharging it. Ask questions like, into the box are endless. If the weapon happened to go Toss in the unique design off while I was pulling the safety of each machine and there bar, where would my hands be? are few hard answers Would the safety bar go flying?

by Kevin Berry

Technical Knowledge 28 Mounting the Solarbotics


Gearbox
by Chad New

Events 27 Results Jul 15 - Aug 12 30 Upcoming Oct & Nov Product Review 29 Team Delta Powerdrive Kit
by Paul Ventimiglia

24

SERVO 10.2007

Think about and discuss ahead of time what would be done if batteries start to smoke during charging. What happens if we drop a wire and short out a pack? Is there any way we could accidentally bypass the power contactor? Then, work these answers into the

design. Maybe your spinning disk needs a couple of more holes, so a safety restraint can easily be dropped in, no matter what position the disk stops in. Maybe you need an insulating pad under the batterys power terminals. Perhaps a laminated checklist, so excited

drivers and wranglers dont miss a crucial step. Its far better to spend an hour thinking about What could go wrong ahead of time, than hundreds of hours thinking How could we have let that happen? after the accident! SV

Family Corner: Legendary Robotics


by Kevin Berry
aking some editorial license, (meaning I sort-of forgot to put out a call for Family Corner items to the community), lets pretend I had really planned to talk about my team/family this month, anyway. Legendary Robotics is myself and three of my children: Collin, Morgan, and Holden. We started in the sport at Robocide in January 2003, when 14-year-old Collin and I shredded our first bot. We then pulled in the younger two, and started building insects. We became regulars on the active Florida Insect circuit under SECR. Three quick stories one per kid showing how greatly this sport has helped them. At Battle Beach 2, Collin a young teen took our well ranked wedge beetle, Fir Darrig, up against Team Whyachis new spinner, 3A. He was nervous for days at the thought of fighting one of Terrys bots. Turns out, a few hits into the match, 3As spinner died and Collin had his way with it. Hes a quiet sort, but later that night I overheard him saying to himself, Yes! I beat Team

Whyachi! It may have only been a wedge against a beta version spinner in an insect class, but to him, it was the day he beat a giant. Morgan after four years in the sport took charge of her middle school Odyssey Of The Mind team last year in building mannequins of the Three Stooges. Using parts cannibalized from her antweight, she built a moving arm complete with eyepoking fingers for one Stooge, and a head slapping hand for another. Her part in the skit was Beauty Queen. After the skit, the judges asked about the technical element. Dressed in her costume (a pink prom dress, heels, and a tiara), she proceeded to give them a SERVO quality lecture on hacking servos, the advantages of NiMH batteries, fulcrum positioning on Class 1 vs. Class 3 levers, and the speed vs. torque tradeoff problem. Eyes glazed, they awarded her team first place. Holden started fighting bots when he was eight. In 2005, when he was nine and a veteran of dozens of fights, he went up against Team

Legendary Robotics at The Capital Offense, July 2003.

Ninjas Pirhana, one of the top ranked and most vicious spinners in the sport. Our little antweight box bot, Babe, was getting killed. After many pieces had flown off and Babe had spent more time in the air than on the floor, Mike Emerson, the driver, backed off to let us tap out gracefully. Holden, ever the showman, turned around to the crowd, held up his hands, and informed them dont worry, folks, Ive got him right where I want him! To the roar of the crowd, he turned back to the box and motioned to Mike, bring it on! Of course Babe got pasted, but that day, Holden was a winner to the whole community. SV

Team Moon and Combots Promote NEW BIG B TS


by Kevin Berry

ts long been known that quantities of Heavy and Super Heavyweight bots are on the decline. The attraction of builders to smaller bots is obvi-

ous, with less cost, quicker builds, ease of transport, and less back strain from lugging them around in the shop. For the spectator, though, the

bigger the bot, the better. I remember standing next to the arena at Robocide, watching Countach and Eradictor over a quarter ton of

SERVO 10.2007

25

What Chewy means by the biggest mess. Red Barron and Mulch show why wood isnt good armor against Megabyte. Photo by Steve Judd.

The days of art bots are long since over, the game is kill or be killed. Billy Bucks helped to defer the costs of entrance fees and consumables like wood. Without his outlay, this just-for-fun bot would have never been built. I take pride in the idea that winning isnt a prerequisite to being a crowd favorite, and that I hold the distinction of making the biggest mess inside the box. Photo by Steve Judd.

nasty lock together and skid across the arena, crashing with such force I watched the steel I beams of the arena bow out nearly a foot. A few folks are trying to counter this decline, however. One of the focus areas for Combat Zone is encouraging people to build big. Big Combat Bots Bargains or Bankruptcy? (August 06), the build report for Tombstone in the same issue, and our August 07 Heavy Power Month focus were all attempts to show how it can be
Artros. Photo courtesy of www.buildersdb.com.

done without going bankrupt. While this author uses words, (cheap and easy!) two other individuals have put their money where their mouth is to rebuild these weight classes ranks. Billy Moon and Dave Calkins recently sponsored a cash prize for builders bringing new big bots to events. Billy previously a sponsor of Battle Beach 4 stepped up first. This March, he offered a cash prize of $200 for a new Heavyweight, and $300 for a Super Heavy, up to 10 bots, if they competed at a recognized event in the next 12 months. Judge Dave immediately stepped up to match this offer. With an incentive of $400 or $600, interest soared. Within two days, nine bots had been declared as in the race. It began to look like maybe the limit of 10 was going to be reached, with others left out. Once again, Billy decides to be a hero. (Horrible 1970s bad music pun, left to the reader to look up). He declared that he would pay the bonus to ANY number of qualifying
Defyer 2. Photo courtesy of www.builders db.com.

bots that showed up at the next four events: Combots Cup, RoboGames, MechWars 10, and WBX IV. In May, he sweetened the pot even more, adding in his own teams winnings to the MechWars qualifiers! Ultimately, 14 bots declared, and seven of those qualified for the bonus money. The rules were: 1) The sponsorship is available only to experienced teams that have competed in a previous RFL event. 2) The robots must represent a serious attempt to make a competitive machine and must pass all RFL technical and safety regulations. 3) Teams may construct and enter as many robots as they wish (no limit to the number of robots per team). 4) Robots must be entered in one of the following events: Combots Cup, RoboGames, Triangle City Mechwars 10, or WBX -IV. 5) Robots must be new. They can either be a total rebuild of an old robot or a complete new design. This sponsorship does not cover existing robots that have previously competed at an event. One exception is that for a Super Heavyweight, the robot may be composed as a multi-bot made up partially or completely from existing bots. This rule only applies to Super Heavyweight robots. 6) Teams are encouraged to announce their intention to claim a sponsorship by posting their intention to do so to the RFL forum under the Big Bot Sponsorship thread. Additionaly, teams are encouraged to report on their build status under

Wewe was built out of used wheelchair parts and wood. The Mooney Money was used to buy batteries/parts for the flame thrower and some of the entry fee to the event. The rest of Wewe was found/scrounged. The biggest hurtle to getting into the bigger bots was battery/entry fee costs. With the Moon money, this became a non-problem. I have been helping to put on Mechwars for a number of years and have had light weights/show bots and beetles before, but this let me move up. The event was great and we went one win and two losses. I took home a robot that needed minor work on the speed controllers (Replaced switches with real ESC units) and nothing else. Given another close event, we should compete again. Dean Hoyt.

26

SERVO 10.2007

Enforcer X was not ready for Combots due to being overweight. Between Combots and Robogames, I reduced weight and brought what amounted to a skeleton of what I would have liked. While making a poor showing for its first time out, I was happy with the gear boxes that use the 7 Mag Motor. We made them ourselves in a fashion as to make them available for sale. In the photo are Joe Murawski and my wife Pam. Our team name is Team-X-Bots and we are starting our eighth year of robot fighting. Since I had it and wanted to do better, I brought Enforcer X to WBX IV where it won second place and is qualified to go to Nationals.

Websites
www.team-moon.com www.combots.net
the progress reports thread. 7) Teams will be paid via check or PayPal one week following their first event. In order to be paid, teams must send their team name, robot name, robot weight class, and event that they are first competing at along with either their shipping address or PayPal account information. 8) We reserve the right to list all sponsored robots on this and other sights to help promote the sport of robot combat. There are no other strings attached. The winning bots were: SUPER HEAVYWEIGHTS RoboGames The Red Barron Team Tiki: Micah Leibowitz, a.k.a., Chewy.

Speed Bump Xtreme fought at WBX IV where it took third place (losing to Enforcer X for second and a chance at first). Joe Murawski.

HEAVYWEIGHTS Triangle City MechWars 10 Wewe Team Love Bots: Dean, Sean, and Chris Hoyt. Artros & Defyer 2 Team Raging Brits, Mike, Martin, and Jay OByrne; Mel Michalchuk. RoboGames Enforcer X Team X Bots: Joe Murawski. Mulch Team PITA: Will Evans. WBX-IV Speed Bump X Team X Bots: Joe Murawski. SV
I had always dreamed about building a big robot and here was my chance. Being only 16, I was on a very serious budget. I made the frame from 4 x 6 pine timbers and wrapped the frame in old car tires. The motors were from an old electric wheelchair. Even though much cheaper and using crude materials, Mulch managed to go 1-2 in the competition and even survived being slammed into Megabyte in the Rumble. Will Evans, Team P.I.T.A. Photo by Steve Judd.

EVENTS
RESULTS July 15th - August 12th
North America
BX-IV Bushwacked was presented by War-Bots Xtreme in Saskatoon, Saskatchwan on 7/21-22/2007. Results are as follows: Ants 1st: Kitbot, Fingertech; 2nd: Glitch 2, Chaos Robotics; 3rd: Iron Lotus, Rumble Robotics. Kilobots 1st: Swiss Chef, Fingertech; 2nd: Bot and Paid For; 3rd: Roadbug, Chaos Robotics. Beetles 1st: Limblifter, Guavamoment; 2nd: Hoot, Acme Robotics; 3rd: Mowbot, Inner Logic. Mantisweights 1st: GIR, Chaos Robotics; 2nd: Wedgely Brickleson, Fingertech; 3rd: Papillion, Guavamoment. Lightweights 1st: Agent 7, Team-X-Bots; 2nd: Modern Day Catastrophist, Inner Logic.

Middleweights 1st: Maddgoth; 2nd: Black Betty, Junk Propulsion Laboratories; 3rd: The Disorganizer, Team-X-Bots. Heavyweights 1st: Tourbillon; 2nd: Enforcer X, Team-X-Bots; 3rd: Speed Bump Xtreme, Team-X-Bots.

Europe

he European Featherweight and Raptor Championships were presented by Robo Challenge in

SERVO 10.2007

27

Cannock, England on 7/21-22/2007. Results are as follows: Featherweights 1st: Beauty; 2nd: Push N Shove. Raptors 1st: Pro-lodjo; 2nd: Nebelwerfer.

Fairford on 7/14-15/2007. Event results not available at press time. Middleweight 1st: Touro, Team RioBotz; 2nd: Orion, Team Triton; 3rd: Estepe, Team Omegabotz. Hobbyweight (12 lb) 1st: Tourinho, Team RioBotz; 2nd: Lasca Bit, Team Proteus; 3rd: Spectrum, Team Factronic. SV

South America

oaming Robots held an event at the Royal Air Tattoo at RAF

oboCore Winter Challenge 2007 was presented by Guerra de Robos in Amparo, Brazil on 7/2829/2007. Results are as follows:

TECHNICAL KN WLEDGE
Mounting the Solarbotics Gearbox
by Chad New
his is a little how to article which I hope will give you a little advice on how one can simply and cheaply modify some standard Solarbotics parts for use on a weightconscious combat antweight or fairyweight robot. On these smaller robots, it is often hard to make sure we stay under the weight limit. However, I found a great way to help with that. Sound like something you could use? Give it a read! In this particular case, I chose to go with the new Solarbotics 35:1 drive units because of their small size, light weight, and good performance numbers. Get Flippen, the bot they are used in, needs extra weight for armor due to the amount of fragile components that need protecting, so I needed a light alternative to the usual 24:1 BaneBot gear motors. The one odd thing about this motor is that the gearbox is offset with the motor which makes a simple flat mount rather hard to do without
PHOTO 1

misaligning something. I started out with four of the gear motors as shown here. You can also see the offset in the photo. I thought about many different mounting options to overcome the offset; a piece of 90 degree angle, CNC a box type mount that would enclose the whole thing, and a motor clamp. But all of the previous ideas would weigh too much, cost too much, and take too long to build. So, while eyeballing the motor, I saw that the offset was not that much, just about 1/16 or so. Therefore, if I were to glue something that was roughly 1/16 thick to the bottom of the gearbox, it would negate the offset! I happened to have a piece of 1/16 plastic lying around, so I quickly cut it into shape and shoe good it to the side of the gearbox where the gears are furthest away from the edge. When gluing, be very careful not to get any inside the gearbox.

Only use a small amount at this point. You will use a lot more when you attach the unit into its final spot. Apply a little goo to the front and back of the spacer plate and attach it to the gearbox; then use a clamp to hold it in place until it is dry. While the motor spacers are drying, you can make a set of neat-o small and light wheels that I also made from a Solarbotics product. You need to start with a set of the Solarbotics RW2 wheels. Once you have the wheels, take off the stock rubber tire and set it aside for future use. These are great wheels as they are, but on a bot such as Get Flippen where weight is tight, the thick rubber wheel is a little too weighty. Now that you have the wheel off, you will see a nice aluminum hub that has two deep grooves in it that are perfect for a set of double O ring wheels or even O ring tank treads, should you so desire. But again, due to weight, I only need one O ring as
PHOTO 3

PHOTO 2

28

SERVO 10.2007

a wheel, so the other groove may get cut off. Take the hub and cut off the urthest groove. You can do this with a Dremel, hack saw, sander, or grinder, whatever you have. I took the hub, put it into a vise, and then cut it off with a hack saw. Once I was finished with all of them, I gave them a ride on the belt sander to even the cut and to make them look shiny. Then all you have to do is find some appropriate-sized O rings and pop them into the grooves. Presto! You have a small, light, strong set of custom wheels that get good traction! Now that you have the spacers all glued to the gearboxes and a brand new set of wheels, go ahead and mount the whole thing to your

PHOTO 5

PHOTO 4

robot. Make sure you mark out where you want the motors to go so everything is in correct alignment. I chose again to use shoe goo to mount the units to my base plate. Shoe Goo is easy to work with, cheap, gives good support by filling in all the voids, and can easily be replaced and fixed. Dab a generous amount of goo onto the motor and

place it onto the mounting point. Wiggle the motor around so that you get goo onto all areas of the motor. Again, make sure that you DO NOT get any goo inside the gearbox! Then clamp the gearbox into place and leave it alone until its dry. Then wire it up and take it for a test drive. See, that was not hard at all! Easy as pie! SV

PRODUCT REVIEW Team Delta Powerdrive Kit


by Paul Ventimiglia
remember reading about the drill motors used by Battlebots on the Internet. They were powerful and small, but were very hard to work with. Drills were designed to fit inside drill cases surprisingly, and not combat robots! Luckily for us, Dan Danknick of Team Delta sells a complete driveline solution designed by robot builder Peter Abrahamson. The kit consists of an 18V Dewalt motor and matching gearbox, an aluminum mount, and a steel shaft that mates with the gearbox. One complete Powerdrive Kit costs $170 from TeamDelta.com with individual spare parts priced appropriately. I have used these motors for years, and they have driven my 120 lb robots to victory several times. They are excellent drive motors for 30 lb to 120 lb robots. Those motors are tiny, so they cant be very powerful, right? Wrong! Running one of these motors at its native 18V produces almost 3/4 horsepower, but it only weighs in at just over 1 lb! Additionally, these motors handle some over-volting well. Most builders run them at 24V

and get over 1 horsepower out. The gearbox offers two different reduction ratios because it was designed to run in a drill with high and low speed. With the motor run at 24V, low provides 600 rpm and an impressive stall torque of 530 in-lbs, while high gear runs at 1,930 rpm with a stall torque of 165 in-lbs. Included in the kit is a machined aluminum spacer which is easily installed in the gearbox to ensure no shifting takes place during the harsh shock loads of combat a nice touch! The most valuable part of the kit is the motor mount. It only weighs 3 oz, but it contains the gearbox externally to prevent it from breaking apart and provides a simple and strong way to incorporate the motor into your robot. There are four tapped holes on the bottom and front of the mount, depending on whether you mount the motor to your base plate or a frame rail. The mounted motor and gearbox is still compact enough to fit inside a two inch space perfect for small 30 lb robots. Completing the kit is a 1/2 inch

steel keyed shaft with a hardened end that mates with the gearbox. It is ready to directly drive a wheel after you support the shaft with two ball bearings. The entire kit weighs under 2 lbs, leaving you extra weight for your killer plasma gun weapon. SV
Dewalt motor kit with a custom rear mount added for motor support.

Almost complete MW named Brutality, which uses four Dewalts in low gear to 3.5 inch wheels.

SERVO 10.2007

29

EVENTS
UPCOMING October and November
US Events
ranklin Institute Robotic Conflict will be presented by North East Robotics Club in Philadelphia, PA on 10/10/2007. The Franklin Institute Science Museum & NERC have teamed up to host a 12 lb, 30 lb, and 30 lb Sportmans class event. Matches will take place in a 16 x 16 wooden floored arena. Registration closes on 9/17/2007. Go to www.nerc.us for more information.

ORD Fall 2007 will be presented by the Ohio Robot Club in Brecksville, OH on 11/3/2007. This event is for Fairy, Ant, and Beetleweight combat robots. It will be held at the Cuyahoga Valley Career Center (CVCC south east of Cleveland). For complete details including rules, safety forms, release forms, maps, and local hotels, see the website at www.ohiorobot club.com.

007 Halloween Robot Terror will be presented by California Insect Bots in Gilroy, CA on 10/27/2007. This is open to Fleaweights, Antweights, and Beetleweights. There will also be a bot costume contest thats right! You have to put a costume on your fighting bot. The costume contest will take place during a break in fighting and the audience will decide the winner. There will be prizes for the 1st, 2nd, and 3rd place bot costume winners. Held at Gilroy Hobby. Weigh-in starts at 10:00 AM and fighting starts around Noon. The entry fee will be $20 per fighting bot with prizes for 1st, 2nd, and 3rd place in each fighting weight class. Go to www.calbugs. com for more information, including fight rules.

UK Events

oaming Robots Winter Tour Round 2 will be held in Portsmouth on 10/6-7/2007. This event will take place at the Mountbatten Centre, Alexandra Park, Twyford Avenue, Portsmouth. Please visit www.roamingrobots.co.uk for more information.

R 2

oaming Robots Winter Tour Round 3 will be held in Birmingham on 11/10/2007. Venue TBA. 007 Roaming Robots Winter Tour Final will be held in Maidstone on 11/24/2007. This event will take place at the Maidstone Leisure Centre in Kent. SV

30

SERVO 10.2007

CAN Networking
Last time, I mentioned that I may be able to get my hot little hands on a happen to have in my possession the ONLY Firgelli L12 miniature linear tricky Firgelli miniature linear and all you need to know about how to
Firgelli Miniature Linear Actuators
Firgelli Technologies currently offers five variants of its L12 miniature linear actuator line in +5 VDC and +12 VDC voltage configurations. The miniature linear actuator variants differ in intelligence, gearing, stroke length, and linear force. The Firgelli miniature linear actuator you see in Photo 1 is a +12 VDC model with a gear reduction ratio of 100 and a 30 mm stroke. The peak force that my L12 can produce is 23N (newtons) or 5.175 pounds. The maximum force you can obtain with an L12 actuator is 67N (15.075 pounds) of force using a gear reduction ratio of 298. In addition to being powerful, the L12 gives you a positional accuracy of 0.1 mm. Intelligence as far as their product is concerned is measured by the additional electronics that may be crammed into the actuators internal structure. For instance, you can get an L12 that is simply a mechanical device. Apply power and it moves. Thats it. In our case, my L12 is equipped with an integral linear potentiometer. The pot
PHOTO 1. The Firgelli L12 series of miniature linear actuators are small enough and powerful enough to work side-by-side with standard hobby servos. This puppy is the dog you turn to when you need that extra bit of thump.

allows me to always know where the actuator piston is relative to its extents. If you look closely at Photo 2, you can make out the flexible mechanics of the linear pot flowing out into the actuator piston area at the top of the shot. While youre focused on Photo 2, also note the motor, gear train, and lead screw in this shot. If you desire, you can take the L12 miniature linear actuator intelligence factor one step further by ordering an L12 fitted with a standard R/C servo interface. As you would imagine, the basic Firgelli L12 miniature linear actuator is a two-wire device. Applying a positive voltage to one of its motor leads while grounding the other power lead will extend or retract the actuator piston, depending on the polarity. Applying a positive voltage to the motor V+ (RED) motor lead and grounding the Motor ground (BLACK) lead will cause the actuator to extend. Reversing the voltage source connections will result in the retraction of the actuator piston. With the basics of the Firgelli L12 understood, lets add a feedback potentiometer to the mix. The feedback potentiometer, in this case, acts as a simple voltage divider. We simply apply +5 VDC to the feedback potentiometers positive reference pin and ground the feedback potentiometers negative reference pin. The voltage returned at the feedback potentiometers wiper is proportional to the position of the actuators stroke. The L12 actuators internal feedback potentiometer is linear with a resistance of 2.75K/mm.

Building Miniature Linear Actuator Driver Hardware


If all you need to do is extend and retract the actuator piston between its extents, all you need is a +12 VDC power source and a DPDT toggle switch. To really exploit the advantages of the Firgelli miniature actuator, youll need an intelligent motor driver. That may sound like a tall order, but in reality, its pretty simple to
PHOTO 2. Any closer and I would have caught the camera lens up in the gear train. This is where the work is done. Note the flexible printed circuit board that is most likely the potentiometer that is used to sense the position of the actuator piston.

32

SERVO 10.2007

Miniature Style
by Fred Eady

miniature linear actuator. Well, youre in luck. As of this very moment, I just actuator in the world. Before were done, youll have the low-down on the code it into the electromechanical side of your actuator robotic designs.
do with todays microcontroller technology. Our miniature linear actuator motor driver design will be built around the Microchip PIC18F2685 CAN-enabled PIC microcontroller. Pulling CAN into the miniature linear actuator motor driver design will enable us to externally manipulate the motor control electronics by way of another CAN-enabled intelligent device. Well definitely want to be able to move the miniature linear actuators piston in both directions. However, instead of using that DPDT toggle switch, well use the electronic equivalent: an H-bridge. From previous experiences (and SERVO articles), we all know that an H-bridge needs steering logic to be useful. So, instead of designing the steering logic from scratch, well take a technological shortcut and employ the services of the Allegro Microsystems A3953 motor driver IC. The A3953 is a full-bridge motor driver with integral steering logic. Using the A3953, we can extend and retract the miniature linear actuator piston and apply the brakes at the end of our moves. Only three A3953 control lines are needed to master the miniature linear actuator and each A3953 control line is under the care of the PIC18F2685 microcontroller. The A3953 emulates the DPDT toggle switch and throws in a center-off feature. Basically, the A3953 applies voltage to the L12 actuators motor power pins to drive the miniature
+5VDC +5VDC +5VDC U4 R10 10K FWD/REV ENABLE BRAKE 14 7 8 1 2 3 13 4 5 12 MODE PHASE ENB BRAKE REF RC GND GND GND GND A3953 VCC VLOAD VLOAD OUTA OUTB SENSE 6 9 16 10 15 11 R12 0.56 1W POT + MOTOR GND MOTOR + POT WIPER POT C10 .01uF BLACK RED LINEAR ACTUATOR MOTOR C7 .1uF +12VDC +12VDC C8 .1uF C9 .1uF

linear actuator and removes power from the motor power pins to stop the motor. Braking turns off the source drivers and turns on the sink drivers in the full bridge to dynamically brake the brushed miniature linear actuator motor. The polarity of the voltage applied to the miniature linear actuator motor leads and thus the direction of the miniature linear actuator piston is determined by the state of the A3953 PHASE pin. The A3953 circuitry is very simple as you can see in Schematic 1. Theres nothing remarkable about the contents of Schematic 2, either. However, note that I have reserved two PIC analog inputs for a pair of potentiometers in addition to the miniature linear actuator feedback potentiometer. Ive done this to illustrate how one can set the extents or preset an actuator position by simply adjusting the extend limit and retract limit potentiometers. Heres how that works. The Firgelli actuator driver firmware is constantly monitoring the position of its piston as it moves towards its designated stop point. If we desire, we can read the appropriate extent potentiometers value prior to the actuator move. Then, we simply compare the value returned from the miniature linear actuators feedback potentiometer with the value of the extent or retract potentiometer we read prior to the move. When the feedback potentiometer value

R11 10K

C6 680pF

R9 30K

SCHEMATIC 1. Ill let you read the A3953 data sheet for yourself. Its rather obvious that deploying the A3953 is a very easy job to undertake.

5 4 3 2 1

LINEAR ACTUATOR CONNECTOR TABLE PIN 1 - ORANGE - POT NEGATIVE REFERENCE PIN 2 - PURPLE - -POT WIPER PIN 3 - RED - MOTOR + PIN 4 - BLACK - MOTOR GND PIN 5 - YELLOW - POT POSITIVE REFERENCE

FIRGELLI CONNECTOR

SERVO 10.2007

33

+5VDC R1 10K U1 1 MCLR/Vpp VCC PGD/RB7 PGC/RB6 RB5 RB4 RB1 RB0 11 12 13 14 15 16 17 18 RC0 RC1 RC2 RC3 RC4 RC5 RC6/TX RC7/RX RA5 RA4 RA3 RA2 RA1 RA0 20 28 27 26 25 22 21 7 6 5 4 3 2 +5VDC F/R C1 .1uF C2 .1uf C3 .1uF C5 10uF

ICSP CONNECTOR 10 8 6 4 2 10 8 6 4 2 9 7 5 3 1 9 7 5 3 1 R2 100

C4 .1

R3 1K R7 330 D1 GRN D3 GRN R5 470 U2 3 7 R4 120 6 CANL VREF RS GND 5 8 2 VDD CANH TXD RXD 1 4 R6 470 +5VDC

R8 10K

R9 10K

LINEAR ACTUATOR POT

D2 RED

OSC1

X1 10MHz

+5VDC

23 24

CAN_TX CAN_RX PIC18F2685

OSC2 GND GND

10 8 19

TO MICROCHIP ICD2 1 3 5 7 9 2 4 6 8 10 6 4 2

MCP2551

1 2 3 4 5 6 7 8 9 10

5 3 1 JF1

TO CAN ICSP CONNECTOR

+12VDC 1 C11 + 680uF

VR1 LM340S-5.0 IN GND OUT 3 C12 .1uF

+5VDC

C13 220uF

SCHEMATIC 2. This circuitry is akin to an amplifier. Applying this technology to control the Firgelli L12 miniature linear actuator results in major gains in terms of movement control for your robotic projects.

matches the extent limit or retract limit potentiometer value, we stop the motor. In fact, we perform this same mechanical potentiometer extent limit process programmatically in the miniature linear actuator driver firmware every time we make an actuator move. As you can see, building up the L12 driver hardware is a walk in the park. If you built up the CAN modules I described in the previous issues of SERVO, you can piggyback this miniature linear actuator circuitry onto those boards. Im always working on the next project and sometimes the design changes after the pretty printed circuit boards (PCBs) are manufactured. Photo 3 is an example of this. I cobbled together the circuitry you see in the schematics onto a CAN-enabled PCB that was really designed for another project. Its ugly, but it works. Now that were done with the hard stuff, lets get moving on the soft stuff.

//******************************************************* // LINEAR ACTUATOR DRIVER DEFINITIONS //******************************************************* #define out 0b00010000 //extend #define in 0b00010001 //retract #define actuator LATB #define cntl_mask 0b00101000 #define brk_actuator actuator &= cntl_mask #define extend_actuator actuator &= cntl_mask; \ actuator |= out; #define retract_actuator actuator &= cntl_mask; \ actuator |= in; #define pnFR LATB0 #define pnENA LATB1 #define pnBRK LATB4 //*******************************************************

Writing the Miniature Linear Actuator Driver Firmware


We will code our actuator application in C using the HITECH PICC-18 C compiler. The first order of firmware business is to write some code to simply retract and extend the piston. The code that follows is built around the A3953 truth table:

To move the actuator, the A3953s BRAKE line must be held logically high. Bringing the BRAKE line low will apply the brake pedal no matter what the state of the other A3953 control lines. You can see the A3953s BRAKE line (LATB4) held logically high in the out and in binary definitions. Since were sharing PORTB pins with the CAN interface, we must be careful not to interfere with the CAN I/O while moving the miniature linear actuators piston. On the other side of that, we dont want the CAN stuff washing over into our motor movement, either. To prevent any contention, we will use a mask (cntl_mask) to preserve the condition of the CAN I/O interface when we make actuator moves using the other PORTB I/O pins. Now that we have the A3953 basic motor movement bit

34

SERVO 10.2007

patterns and the mask bit pattern defined, we can now move the actuator by combining the motor movement bit patterns and the mask bit pattern onto the PORTB I/O latch. As you can see in the linear actuator driving definitions, the bit pattern combinations result in the three commands we need to produce actuator motion (brk_actuator, extend_actuator, and retract_actuator). The higher the gear reduction ratio, the slower the actuator piston will move. Thus, it takes a couple of seconds for the L12 that I have to move from extent to extent. We must compensate for this in our actuator driver firmware. The solution is to code in a firmware real-time clock, which is based on one of the PICs internal timers. Our miniature linear actuator driver firmware design will employ the services of the PICs TIMER3. In the code that follows, Ive configured TIMER3 to interrupt every millisecond based on a 10 MHz system clock. In the meantime, every tick of the firmware clock will provide timing mechanisms we can use to create time delays that range from milliseconds to hours. Our real-time clock code also provides a visual indication that it is running by toggling the miniature linear actuator driver boards activity LED every second. Heres the source code behind our firmware real-time clock:
//******************************************************* //* CONFIGURE AND START TIMER3 //* SET TO OVERFLOW EVERY 1mS //******************************************************* hours3 = 12; mins3 = 0x00; secs3 = 0x00; milliseconds3 = 0; T3CON = 0x00; TMR3H = 0xF6; TMR3L = 0x3C; TMR3ON = 1; //******************************************************* //* CONFIGURE EXTERNAL INTERRUPTS //******************************************************* enable_TMR3int; enable_GLOBALint; //******************************************************* //* INTERRUPT HANDLER ROUTINE //******************************************************* void interrupt TIMERS(void) { if((TMR3IF && TMR3IE)) { TMR3IF = 0; TMR3H = 0xF6; TMR3L = 0x3C; ++msecs_timer3; if(++milliseconds3 == 1000) { milliseconds3 = 0; ++secs3; ++secs_timer3; act_led ^= 1; } if(secs3 == 60) { secs3 = 0; ++mins3; ++mins_timer3; } if(mins3 == 60) { mins3 = 0; ++hours3; } } } //*******************************************************

Up to this point, weve written enough code to successfully move the miniature linear actuators piston from full retract to full extend and vice versa. If we want to precisely position our actuator piston, we must code some firmware to monitor the pistons position relative to the pistons extents. The hardware we will use to monitor the piston position consists of the analog-to-digital (A-to-D) conversion engine that is native to the PIC18F2685. To use the PICs A-to-D hardware, we must configure it and enable it in firmware as I have done in this code snippet:
TRISA = 0b11111111; //PORTA = ANALOG INPUTS TRISB = 0b11001000; //PORTB = DIGITAL I/O PLUS CAN TRISC = 0b11111001; //PORTC = ACTIVITY LED //******************************************************* //* CONFIGURE EEPROM READ/WRITE //******************************************************* EECON1 = 0b00000000; //ENABLE EEPROM FOR READ/WRITE //******************************************************* //* CONFIGURE A2D AND COMPARATORS //******************************************************* ADCON0 = 0b00000000; //SELECTS ANALOG INPUT CHN ADCON1 = 0b00001010; //ENABLE ANALOG INPUTS AD0-AD4 ADCON2 = 0b10111111; //CONVERT ON RC OSC ADON = 1; //POWER ON THE ADC CMCON = 0x07; //DISABLE THE COMPARATORS //*******************************************************

Okay, with the addition of the A-to-D configuration code, we can now programmatically move the miniature linear actuator piston and check on its position and progress. To be able to move the piston within the boundaries of its extents, we must know what those extents are. Otherwise, the firmware will be able to initiate a move to a
PHOTO 3. What you dont see in this shot is the cut lands and point-to-point custom wiring I did on the other side of this board. Otherwise, a few 0 resistors and some clever parts placement made this board a perfect surrogate miniature linear actuator driver board.

SERVO 10.2007

35

point in space that resides beyond the extent boundaries. If this happens, the actuator will drive the piston indefinitely in the direction of the target point. Thats a bad thing. To make sure we never put ourselves into the beyond-the-extents position, we can pool our current firmware resources and build a calibration routine into our firmware. Heres what the miniature linear actuator calibration routine I assembled looks like:
//******************************************************* //* CALIBRATE ACTUATOR //******************************************************* void calibrate_actuator(void) { char x; retract_actuator; secs_timer3 = 0; while(secs_timer3 < 5); for(x=0;x<21;++x) { ADCON0 = 0b00000001; GODONE = 1; while(GODONE); } slider_vals[ee_full_retracthi] = ADRESH; slider_vals[ee_full_retractlo] = ADRESL; extend_actuator; secs_timer3 = 0; while(secs_timer3 < 5); for(x=0;x<21;++x) { ADCON0 = 0b00000001; GODONE = 1; while(GODONE); } slider_vals[ee_full_extendhi] = ADRESH; slider_vals[ee_full_extendlo] = ADRESL; brk_actuator; retract_actuator; delay_secs3(5); brk_actuator; write_slider_ee_vals(); read_slider_ee_vals(); full_retract = make16(slider_vals[ ee_full_retracthi], slider_vals[ee_full_retractlo]); full_extend = make16(slider_vals[ee_full_extendhi], slider_vals[ee_full_extendlo]); } //*******************************************************

piston to reach full extension, I kick off another A-to-D read of the feedback potentiometer wiper. This value is stored as the full-extend feedback potentiometer wiper value (ee_full_extendhi, ee_full_extendlo). As with the full-retract value, the ee preceding the full-extend value means that the full-extend value is also stored in EEPROM, just in case we need to retrieve it later. With both extent values in hand, I brake the miniature linear actuators motor and retract the piston to the retract extent. I then write the extent values to the PICs EEPROM and read them back before committing their values to their respective program variables (full_retract, full_extend). One would be led to believe that the extents would run from zero (0x0000) to the maximum count (0x03FF) that the PICs 10-bit A-to-D can render. Thats not true. My Firgelli L12 actuators full_extend value is 0x00C9 and the full_retract value is 0x03E5. (Ill always use A-to-D ticks in this discussion. If you wish to convert A-to-D ticks to voltage, multiply the A-to-D values by 0.005 volts.) It is important to remember that although every Firgelli L12 miniature linear actuator will be physically identical, they most likely wont be electrically identical. I happen to have a pair of Firgelli L12 miniature linear actuators and the second units full_extend value is 0x00B9 and its full_retract value is 0x03E2. The calibration routine simply moves the actuators piston to their extents and takes a voltage reading. We must provide a more accurate method of moving the actuator piston between the extents. The way we will do this is by taking multiple A-to-D readings and using their average as the result. Note that in the calibration routine we took multiple readings, but did not average them. In both cases averaging and not averaging we are filtering the A-to-D input voltage by performing a number of readings on the voltage source. If youve worked with A-to-D stuff before, you know that sometimes the voltage you read can spike or fade with single A-to-D reads. Reading the voltage several times filters out the peaks and valleys. By trial and error, I believe reading the voltage at least 20 times is very reliable. The code to obtain an accurate actuator piston position looks like this:
//******************************************************* //* GET LINEAR ACTUATOR POSITION //******************************************************* unsigned int get_actuator_position(void) { unsigned int rc; sum = 0; for(rc=0; rc<20; ++rc) { ADCON0 = 0b00000001; GODONE = 1; while(GODONE); sum += make16(ADRESH,ADRESL); } rc = sum / 20; return rc; } //*******************************************************

Lets walk through the logic in the calibrate_actuator function. As a starting point, we retract the actuator to its retract extent. Recall that moving the actuator piston takes time that we must compensate for. In the code Ive provided, five seconds is ample time to move the actuator piston from one extent to the other. Once the actuator piston is at its retract extent, I kick off an A-to-D read of the feedback potentiometer wiper. The 10-bit feedback potentiometer wiper value is then stored as the full-retract feedback potentiometer wiper value (ee_full_retracthi, ee_full_retract lo), which will be stored into the PICs EEPROM for later use. With the retract extent value in the memory bank, I then command the miniature linear actuator to extend its piston to the extend extent. After allowing enough time for the

Okay, now that we can compute the actuator piston position accurately, lets use all of the firmware stuff weve written thus far to fabricate a precision move routine.

36

SERVO 10.2007

SCREENSHOT 1. Note that the actuator_loc value matches the adc_set_hi value. Thats a good thing.

Heres what I came up with:


//******************************************************* //* MOVE ACTUATOR TO VECTOR ROUTINE //******************************************************* void move_actuator(unsigned int vector) { actuator_loc = get_actuator_position(); if(actuator_loc < vector) { retract_actuator; do{ actuator_loc = get_actuator_position(); }while(actuator_loc != vector); brk_actuator; } else { extend_actuator; do{ actuator_loc = get_actuator_position(); }while(actuator_loc != vector); brk_actuator; S} } //*******************************************************

//******************************************************* //* GET ACTUATOR POSITION AND POT VALUES //******************************************************* void get_pot_positions(void) { char x; for(x=0;x<20;++x) { ADCON0 = 0b00001101; GODONE = 1; while(GODONE); } adc_set_hi = make16(ADRESH,ADRESL); for(x=0; x<20; ++x) { ADCON0 = 0b000010001; GODONE = 1; while(GODONE); } adc_set_lo = make16(ADRESH,ADRESL); } //*******************************************************

Walking through the MOVE ACTUATOR TO VECTOR ROUTINE, you immediately see me use the get_ actuator_position function we just wrote to provide a value for the actuator_loc variable. The argument (vector) of the move_actuator function is the desired position in A-to-D ticks that we want to move the actuator piston to. The A-to-D tick count increases as the actuator piston moves towards the full-retract extent and decreases as the actuator piston moves towards the full-extend extent. With that bit of physical knowledge, we can determine which way to move the actuator piston by examining the A-to-D tick count of its current position. Thus, if our desired final vector value is greater than the actual location of the actuator piston, we know to retract to the desired vector. Conversely, if we find that the vector actuator piston A-to-D tick count is less than our current piston location, we extend the actuator piston to reach the new target vector. We can actually stop here as our miniature linear actuator driver firmware work is done. Thats no fun. So, lets put together a small application and use those extra potentiometers I mounted on that PCB. Before we look at the miniature linear actuator application, I need to show you a couple of macros I whipped up to make the delay timing easier:
#define delay_msecs3(msecdelay) msecs_timer3 = 0; while(msecs_timer3 < msecdelay); #define delay_secs3(secdelay) secs_timer3 = 0; while(secs_timer3 < secdelay); \ \

I used the bang-the-heck-out-of-it A-to-D method to obtain the A-to-D tick values of the potentiometer pair. The variable adc_set_hi is used in our application as the retract extent value. That leaves the adc_set_lo variable to set the extend extent. Now I can show you the little application I put together:
void main(void) { //******************************************************* //* INITIALIZE //******************************************************* init(); //******************************************************* //* MAIN SERVICE LOOP //******************************************************* calibrate_actuator(); do{ get_pot_positions(); move_actuator(adc_set_hi); delay_secs3(5); move_actuator(adc_set_lo); delay_secs3(5); }while(1); } //*******************************************************

Remember, the PICs real-time firmware clock is always running. That allows me to collect milliseconds and seconds in the msecs_timer3 and secs_timer3 variables for use in the macros I just introduced to you. One more thing before we examine the actuator positioning application. It may help to be able to read the extent potentiometer values. Heres that code:

Take a look at Screenshot 1. The results of the calibrate_ actuator function are shown in the full_extend and full_retract values. This set of calibration values tells you that Im using the second Firgelli L12 miniature linear actuator. The extent limit SERVO 10.2007

37

SCREENSHOT 2. I love it! I ran this program over and over with consistent results like this. If you like blinking lights, youll love watching the Firgelli L12 miniature linear actuator move that piston at your command.

results are displayed in Screenshot 2. Again, the actuator piston sought out the new position vector and went there.

You CAN Do This Too


If you got the chance to read the recent SERVO CAN articles, you are already thinking about how to embed the necessary codes into the CAN messages to utilize the Firgelli actuator driver routines Ive presented here. For instance, you could send a two-byte CAN message M 0x100. The M could be interpreted to mean call the move_actuator function with the 0x100 being the move_actuator functions vector value. On the other side of that, you could load up a CAN message with the actuator_loc value and report the current position of the actuators piston to any CAN nodes that request it. I had a bunch of fun with this project. Ive supplied the full Firgelli L12 miniature linear actuator driver source code listing so you can have some fun too. Take a look at the CAN drivers I presented in previous SERVO articles and mix in the actuator driver code you have access to this month on the SERVO website at www.servomagazine.com. Youll find that you really CAN put the Firgelli L12 miniature linear actuators to work for you. SV
Fred Eady can be reached via email at fred@edtp.com

potentiometer A-to-D tick values are displayed as adc_set_hi and adc_set_lo. I resumed the actuator piston position application and stopped after the actuator piston was repositioned. The

SOURCES
Firgelli Technologies, Inc. (www.firgelli.com): Firgelli L12 Miniature Linear Actuators HI-TECH Software (www.htsoft.com): HI-TECH PICC-18 C Compiler Microchip (www.microchip.com): PIC18F2685 Allegro Microsystems (www.allegromicro.com): A3953

HE8EJIFH;<;H>?J;9)0'
.EW2OBOT3ERVOS
>_j[Y Ej^[h8hWdZ

+656*
6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV

+656*
6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV

+657*
6SHHGVHF 7RUTXHR]LQ 7LWDQLXP

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

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

38

SERVO 10.2007

M-BOT
PART 2
by Ron Hackett

ast month, in Part 1 of this series, we assembled the chassis and power supply circuitry for M-bot, an autonomous robot which uses the eight-pin PICAXE-08M microcontroller as its only processing power. This month, we will take a detailed look at M-bots circuitry. In addition, we will present two simple software routines that will enable M-bot to avoid obstacles, and to respond to visible light levels in its environment. Finally, we will suggest a couple of possible modifications and improvements you might want to consider as you carry out your own experiments with M-bot. Hopefully by now, you have been able to obtain all of the necessary parts and are ready to tackle M-bots electronics and software. In order to facilitate the discussion and construction of M-bots circuitry, the complete schematic is presented in Figure 1 and a photo of the completely wired breadboard area is presented in Figure 2.

PICAXE-08M Circuitry
Two aspects of the PICAXE circuitry presented in Figure 1 are worth mentioning. First, if you are familiar with the

standard PICAXE programming circuit, you may be surprised to see the five-pin header. I now make all my PICAXE programming cables using nineor 10-pin ribbon cable with a female DB9 IDC connector on the PC end, and a 2x5 female IDC connector on the PICAXE end (which mates with the five-pin header in the schematic), because its easy to make these cables without needing to solder or crimp individual wires. If you are interested in making this type of PICAXE programming cable, you can see the construction details on my website (www.JRHackett.net). If you prefer to use the standard threepin connection, feel free to make the change (pins 1 and 4 on the five-pin header arent used, anyway). The second thing you may have noticed is that there is a 220 resistor in series on the serout programming line (output0, pin 7). The PICAXE standard specifies 180 for this, but that size resistor is harder to locate, and I have found that 220 works fine. If you have 180 resistors available, you could certainly use one in place of the 220 resistor.

DC Motor Control

Circuitry

Lets begin with M-bots motor con-

trol subsystem, which essentially consists of two geared DC motors and a dual Hbridge motor driver chip. R/C-type servo motors do have one advantage over DC motors: they can be driven directly from a PICAXE I/O pin. DC motors, on the other hand, require additional driver circuitry capable of handling the current requirements of the motors, which can be several amps or more for larger motors. One of the common choices for driving DC motors is the integrated H-bridge chip, which contains the necessary power transistors and related circuitry to get the job done. For M-bot, we will be using the SN754410 motor driver chip; it can handle the small Tamiya motors without a heatsink, and its easy to interface with the PICAXE. You could just as easily use an L293D motor driver if you have one to spare; its pin-for-pin compatible with the 754410. In fact, thats what I did (because I had an extra one), but the L293D is considered obsolete at this point, so I put the 754410 in the parts list. The 754410 (available from Pololu and elsewhere) is a quadruple half-H driver, which means that it is capable of driving two independent DC motors. If you read the data sheet (available on the Pololu website; www.pololu.com) which is always a good idea when adding any chip to your design you will see that

FIGURE 1. M-bots schematic diagram.

SERVO 10.2007

39

M-BOT
FIGURE 2. M-bots completed breadboard assembly.

INPUT 2 INPUT 1 High Low High Low High Low High High
FIGURE 3. 74HC00 quad NAND gate truth table.

it requires three inputs for each motor (pins 1, 2, 7, 9, 10, and 15 in Figure 1). If we were using a larger processor than the PICAXE-08M, it wouldnt be a problem to reserve six pins for motor control. However, on the 08M we only have five I/O pins to begin with, and we need two of them for IR obstacle detection and one for the LDR sensor, so we need to find a way to reduce the 754410s I/O requirements from six to two pins. In order to do so, lets look at the 754410 connection requirements in more detail (see Figure 1). The chip controls each motor via three pins: one pair of pins controls the direction of each motor (pins 2 and 7 for one motor or 10 and 15 for the other) and a third (Enable) pin (pins 1 and 9) controls the power to each motor. So, considering the direction control of the motor controlled by the pins on the left side of the chip, for example, we see that a high level on pin 2 and a low level on pin 7 runs the motor in one direction, while a low level on pin 2 and a high level on pin 7 runs it in the opposite direction. To see how we can conserve one 08M I/O pin for each motor output, consider M-bots left motor, which is

connected to the 08M output 4 (pin 3) in the schematic in Figure 1. First, output 4 is connected to both inputs (pins 9 and 10) of one 74HC00 NAND gate and then to pin 2 of the SN754410. The output of the NAND gate (pin 8) is connected to pin 7 of the SN754410. If you look at the NAND gate truth table presented in Figure 3, you can see that a NAND gate with its two inputs tied together functions as an inverter; two high inputs produce a low output, and vice versa. Of course, we could use a hex inverter chip to accomplish the same thing, but as we will soon see, we still need three additional NAND gates for M-bots circuitry, so we will stick with our implementation of an inverter from a NAND gate and meet all our logic needs with one IC. With the NAND gate connected as described above, when the 08Ms output 4 is high, pin 2 of the SN754410 is high and pin 7 is low, so the left motor turns in one direction. On the other hand, when the 08Ms output 4 is low, pin 2 of the SN754410 is low and pin 7 is high, so the motor turns in the opposite direction. In other words, we can now control the motors direction with only one 08M I/O pin. Since the same holds true for the circuitry connected to the 08Ms output 0 (pin 7 right motor), we have reduced the necessary I/O connections to the SN754410 from six to four, but we still need to free up two more 08M I/O pins. The solution I finally arrived at involves a sacrifice, but its a small one I decided to give up the ability to run M-bot in reverse. You may wonder how M-bot will ever be able to get out of a jam without being able to back up. The answer is simple turn around! In fact, this is actually an advantage in disguise. If M-bot could back up, we would need another set of sensors pointing to the rear to avoid bumping into things; by turning around instead, we avoid the additional complexity and expense. Essentially, what we are going to do is to convert reverse to stop. In order to understand how this works, we need

to examine how motor rotation relates to M-bots movement. If we connected the SN754410s two enable pins (pins 1 and 9, Figure 1) to +5 volts, the two motors would always be rotating in one of the following four combinations: forward rotation of both motors results in M-bot moving forward; forward rotation of the left motor and backward rotation of the right motor results in M-bot turning in place to the right; backward rotation of the left motor and forward rotation of the right motor results in M-bot turning in place to the left; and a command for backward rotation of both motors results in M-bot moving backward. So, what we need to do is to convert the last possibility into a command for backward rotation of both motors results in M-bot stopping, and we can use a third NAND gate to do exactly that. As you can see in Figure 1, the NAND gate that has pins 1 and 2 as inputs has one input connected to the inverted direction control output for one motor, while the other input is connected to the inverted direction control output for the other motor. This NAND gates output (pin 3) is connected to both SN754410 Enable inputs (pins 1 and 9, Figure 1). If you look again at the NAND truth table in Figure 3, you can see that the two Enable pins are high for three of the four possible combinations of 08M motor outputs; the one exception occurs when both 08M motor outputs are low. When and only when this happens, the two inverted NAND outputs (pins 8 and 11) are high. Therefore, the two inputs (pins 1 and 2) of the third NAND gate are also high, which is the only combination that produces a low output at pin 3 of the gate. Since this output is connected to both SN754410 Enable pins (1 and 9), we get the result we want: when the 08M issues a forward, turn left, or turn right command, the M-bot dutifully obeys; when the 08M says reverse, the M-bot defiantly stops! We can now navigate the M-bot around its environment using only two 08M I/O lines.

IR Obstacle Detection
Now that we have covered M-bots motor control circuitry, we can turn our attention to the IR obstacle detection

40

SERVO 10.2007

M-BOT
circuitry. Its very similar to the stand-alone 08M IR obstacle detection project presented in Robots Little Helper (SERVO Magazine, October 06, pp. 40-43), so I wont repeat the details. Essentially, M-bot emits a short PWM pulse on the IR LEDs attached to output 2 (pin 5), and listens for the echo on input 3 (pin 4). If an obstacle is detected, evasive action is taken. The only unusual feature of M-bots IR circuitry is that the two Panasonic IR detectors are connected to the inputs (pins 4 and 5) of the one remaining NAND gate. Since we only have one 08M I/O pin left for IR obstacle detection, we cant connect each IR detector separately, but in spite of this, its still helpful to use two IR detectors because it gives us wider coverage to detect obstacles in front of M-bot. The Panasonic IR detectors are active low, which means that their outputs go low whenever an obstacle is detected. If you refer once more to the NAND truth table in Figure 3, you can see that the gates output is high whenever either (or both) inputs are low. So, if either IR detector spots an obstacle, the 08Ms input 3 goes high and evasive action can be taken. When you assemble the IR detection circuit, be sure to completely cover the sides of the two IR LEDs with heat shrink tubing (or black tape), as shown in Figure 2. Otherwise, the IR detectors will pick up the direct IR emissions from the LEDs, and M-bot will continually spin around helplessly! The LDR that I used is from a properly, it might help to temporarily RadioShack five-piece variety pack. Its remove the LDR from pin 6 of the 08M, resistance varies from approximately modify the software to make the pin an 20K in relative darkness down to 1K output by changing the dirs command when a lit flashlight is pointed directly to dirs = %00010111 (see the PICAXE at it. As a result, the analog voltage at manual, part 2, for documentation on input 1 varies roughly between one volt the dirs command), and attaching a in darkness and four volts in bright light. visible LED and current limiting resistor The minimum and maximum resistto the pin. Then you can insert a simple ance values for the LDR are not at all code fragment to blink the LED whenevcritical, but choosing one with a er an obstacle is detected to provide relatively large variance will also visual feedback for debugging. produce a large swing in the input The second sample program analog voltage. You can wire either (M-bot.bas) available on the SERVO end of the voltage divider to +5 volts, website implements simple lightbut if your LDR is the same as the one seeking behavior. M-bot turns in place I used (i.e., resistance is inversely to locate the brightest direction. When proportional to light-level), connecting he finds it, he heads in that direction it to +5 volts (and the fixed resistor to until an obstacle is detected and then ground) results in the analog voltage again scans his environment to locate a being directly proportional to the light light source. In a dimly-lit room, whenevlevel, which simplifies computations. er a flashlight is turned on and pointed in If your LDR has different minimum his direction, M-bot will head toward it. and maximum values, heres a handy Both programs are fairly simple, and formula to determine the value of are intended as springboards for your the fixed resistor that will result in own ideas. We may have fairly well the largest possible variance in the maxed-out the PICAXE-08Ms hardware input analog voltage: Multiply the LDRs capabilities but as M-bots CPU, but there minimum and maximum values together and take M-bots Parts List the square root of the ITEM DESCRIPTION PART NO. product. For example, DC motors and gearbox Tamiya #70168 double gearbox using my values of 20K Wheels (2) Tamiya #7010 truck tire set and 1K, 20K times 1K is Ball caster Tamiya #70144 ball caster Custom laser-cut (or DIY) 20M, and the square Base (bottom) (top) Custom laser-cut (or DIY) root of 20M is 4.47K, so Base 6-32 threaded rod (or 1-1/2 inch standoffs) 4-40 bolts (4) RadioShack #64-3011 4.7K is close enough.

Visible Light Detection


M-bots visible light detection circuitry is all that remains to discuss. It employs a cadmium sulfide (CdS) photocell, also known as a light dependent resistor (LDR), and is super simple. The basic idea is to connect the LDR in series with a fixed resistor with one end of the two-resistor circuit connected to +5 volts and the other end connected to ground. The junction of the two resistors is connected to the 08Ms input 1 (pin 6), and the analog voltage produced by this basic voltage divider circuit is measured using the 08Ms readadc command.

M-bot Software
There are two sample software programs available on the SERVO Magazine website (www.servo magazine.com). The first, M-bot_IR.bas demonstrates M-bots obstacle avoidance capabilities. Download it and use the Programming Editor software (www.picaxe. co.uk) to transfer the software to M-bot. If you have difficulties getting it to function

4-40 nuts (4) 9V battery 9V battery Connector 9V battery Holder AA battery (4) AAbattery pack holder SPST toggle switch SPST toggle switch Breadboards (2) Jumper wires C1 C2 IRin1, 2 IR-LED1, 2 LDR R1 R2 R3 R4 R5 U1 U2 U3 U4 100 F (35V) elect. cap 10 F (35V) elect. cap IR detector IR LED Light dependent resistor Resistor, 4.7K, 1/4 watt Resistor, 22K, 1/4 watt Resistor, 10K, 1/4 watt Resistor, 220, 1/4 watt Resistor, 470, 1/4 watt PICAXE microcontroller Quad NAND-gate Motor driver LM7805 voltage regulator

RadioShack #64-3018 RadioShack #23-875 RadioShack #270-324 RadioShack #270-326 RadioShack #23-873 RadioShack #270-383 RadioShack #275-612 RadioShack #275-324 Pololu #0351 Breadboard Pololu #0354 Jumper Wire Kit RadioShack #272-1028 RadioShack #272-1025 Panasonic #PNA4620M Various RadioShack #276-1657 (assorted) RadioShack #271-1330 RadioShack #271-1339 RadioShack #271-1335 RadioShack #271-1313 RadioShack #271-1317 PICAXE-08M 74HC00 SN754410 RadioShack #276-1770

LINKS

Pololu www.Pololu.com; JR Hackett www.JRHackett.net; RadioShack www.radioshack.com

SERVO 10.2007

41

M-BOT
is still plenty of room for software modifications and improvements. Experiment with M-bot and see what you can create! One final note as I was experimenting with M-bot, I learned two important facts concerning the Tamiya double gearbox. First, it helps to follow Tamiyas directions to lubricate the gears. I initially skipped this step, and before long, M-bot was behaving sluggishly. I thought I had possibly depleted his motor battery pack, but that wasnt the case. It took me a while to figure it out, but once I did apply Tamiyas included lubricant, M-bot was as good as new! Secondly, I also discovered that its a good idea to seal the large open areas in the double gearbox wide masking tape works well. At one point, M-bot began behaving erratically veering off in one direction and then another. At first, I thought it was a software problem, but after a while I discovered a fairy substantial fuzz-ball lodged in one set of gears. After removing it with tweezers (which was harder than it sounds), I taped up the openings and M-bot has been wellbehaved since then. Maybe my next project should be a vacuuming robot for my basement work area!

Conclusion
We have accomplished our goal of creating an intelligent, autonomous robot using the PICAXE-08M as its only processing power. That alone is quite an accomplishment, but its only the beginning. There is ample space on Mbots breadboards to accommodate considerable variations on the theme. The most obvious approach to expanding M-bots capabilities is to replace the 08M microcontroller with a larger processor. For example, the recently released PICAXE-14M chip with 11 I/O pins would enable us to eliminate the 74HC00 quad NAND gate and directly interface the CPU with the SN754410 motor driver chip. Another possibility would be to develop a multiprocessor-based bot. For example, we could use an 08M for the IR obstacle detection system (see Robots Little Helper in the October 06 issue of SERVO Magazine) and a PICAXE-28X processor (which has two independent PWM outputs) to implement variable speed control for our bots DC motors. Or, you could even take M-bot in an entirely different direction. For example, in the process of writing this article, I tested a second version of M-bot, which isnt autonomous at all; M-bot becomes a completely remote-controlled vehicle using an ordinary TV remote in conjunction with the 08Ms infrain2 command. If you come up with your own version of M-bot, I would love to hear about it so send me an email! Of course, you may already be thinking about an M2-bot or an M3-bot; I know that I am. In fact, an M3-bot with full PWM speed control of both motors is already in the works! SV

Contact the Author


You can reach Ron via email at Ron@JRHackett.net or visit his website at www.JRHackett.net

42

SERVO 10.2007

ANDROID ARM
Part 1

Building an
by Mark Miller

Building robotic limbs is the double whammy of engineering problems. You need the design to offer strength to be useful, yet lightweight to be practical. Then theres the issue of compactness. Fortunately, I have managed to come up with some reasonable options that are both affordable and functional. The arm presented here will have three powered joints, with the capability to add a fourth degree of freedom (DOF) later.

tend to build larger robots, so I need an arm able to lift at least a pound or two. The arm well be building will be about 19 inches long. You will have the option of adjusting the length, however, to fit your specific design.

Gears and Motor Selection


Common issues that come up involve a motor shaft of one size (odd, metric, etc.) and gears of a completely different size bore. The key element to resolve these matters is to have some form of standardization. I use four basic motors in just about all my projects which have shaft sizes ranging anywhere from 3/32 to 1/4 inch. However, I tend to bore hubs to a logical size or made adapters, which unfortunately takes loads of time to get just right. In meshing gears, fine pitch demands a precision fit, so if you are just getting started in gearing, play with some 24 or 48 pitch sizes since they are pretty forgiving in tolerances and mesh.

If you browse the American Science and Surplus mag, you will find sets of gears on a sprue of four, plus a few small shaft adapters or bushings attached. These may not be the most compact on the market, but they are incredibly easy to use. The gears include a 12, 20, 30, and 40 tooth gear. The smallest has a bore of .074; the rest are .187 (3/16). The plastic used in these gears is rigid, durable and best of all forgiving. I ordered a few sets, just to sample them and found a secondary benefit:

they can be used as a spur or bevel gear. Figure 1 shows the basic set of gears, which come in a random color sampling. While there is no color choice, you can mix and match them in your projects. Youll need to cut the gears off the sprue with a sharp razor/knife to make a clean edge.

The Gear to Motor Shaft Connection


I hand-pressed three larger gears
FIGURE 1

SERVO 10.2007

43

FIGURE 2

FIGURE 3

onto shafts from .19 to about .22, which covered my stepper motor shaft. You really have to push the motor down with a good deal of pressure against a hard surface to get the gear seated, but at least it wont slip or pull off without equal and opposite force. (I use a claw hammer to get the gears back off when I need to remove them.) I pressed the smallest gear in the set onto a .076-.081 shaft, so it is non-slip and workable. For 1/8 shafting, the bushing provided can be pressed onto the shaft then, in turn, pressed into the 20, 30, and 40 tooth gears, providing flexibilty in making some nice reduction gearboxes of your own ratio choice. Figure 2 shows a random assortment of motors, with odd and standard shafts. The gears are securely attached just by pressure fitting them to the shaft without tools. In the case of the 1/4 shaft, I was able to drill out the bore with a hand drill to 15/64 and press it on the motor shaft

44

FIGURE 4

shows the blank starting plate, then the drilled plate to mount the motor with the applied gear to. This plate will ultimately become the androids upper arm, and will be required to tow all the mechanical assemblies below it, including the forearm, wrist, and end effector. The plate measures 2.5wide by 6 long. It can range in thickness from .070 to .090. (You can also use thicker plastics including Plexiglas for these types of assemblies.) For mine, I used a Kp4m4 stepper motor. These are cheap, plentiful, and easy to drive. (Electronic Goldmine offers these at approx. $2.95 each). If you would like extra information about the motor itself, just Google kp4m4. It has been around for years. Figure 5 shows a linear gear layout across the panel which helps to maintain a low profile, building torque along Bicep Layout the way. The first gear moving against Once you have a motor with an outthe motor is a 50 tooth compound put gear, mounting them in a practical gear. It is attached to the mounting arrangement is straightforward. Figure 4 plate using a 6-32 screw, one inch long with a stop nut underneath, and a locking nut under FIGURE 5 the chassis. As an added measure, you can also tap the mounting plate to 6-32 for an even more secure fit. Normally, I make a bushing for plastic gears using brass tubing (K&S) so the screw threads dont ride against the plastic gear bore. If you tighten the screw down, it allows the gears to turn freely on the tubing. Gears can be easily drilled

(again, a super, non-slip fit). This does require some good force to accomplish and you need to watch your fingers while pushing. The force required for the gear to slip on the motor shaft is at least three times the available torque the motor could supply and to date I have not experienced any problems. Figure 3 shows the 1/4 shaft motor fitted with the 20 tooth gear, as well as the tiny 12 tooth gear on a 3/16 shaft motor. These gears are all 24 pitch very standard in the world of gears. The neat feature about these gears is the elastic nature of the plastic. They also are capable of moving multiple pounds of mass in straight or right angle directions.

SERVO 10.2007

out to accommodate standard tubing sizes. Brass tubing is sold in 12 lengths and the sizes telescope inside each other for perfect bushing coverage. You can cut the tubing by scoring the tube with a file, then snapping it off to length if you dont have other methods. You can also use shoulder bolts if available. Utilize any ratio or combination of gears to acheive the torque desired for the motor you choose (or the load you intend to lift). An easy way to perfectly mesh these gears is by making a paper thickness gauge. Use a 1/2 wide strip off 110 lb. paper and force the gears to mesh with this strip between them. Mark the hole to be drilled you get a perfect mesh every time. This mesh level has been tested effectively up to 80 RPM and around 15 pounds of load. I have never lubricated these gears on any design. The 50 tooth output gear has been fitted with a 3/16 steel shaft which protrudes through the plate and a journal to keep it square and turning accurately. This was made from a small piece of 3/4 aluminum round stock. Drill a center hole for the shaft to turn in, and a couple of holes around it that can be tapped and tightened against the mounting plate. The final drive shaft needs to be at a 10:1 ratio from the input gear. The flat layout of the gears provides a tight, compact package necessary for the bicep. The small amount of shaft above the gear can be fitted with a position sensor or encoder. The output of this shaft will be fitted later for an offset crank that will raise and lower the forearm with a pushrod.

FIGURE 6a

FIGURE 6b

Please note that once the tubing is pressed in, it cannot be removed. The 7/32 tubing slips neatly into a 1/4 tubing now, and makes a nice smooth journal for the wrist and end effector to rotate on (and thus easily motorize). A shorter piece of 1/4 tubing is pressed into the wrist mount; the gear with the axle is slipped inside; then the hub is pressed on completing the working assembly. Figures 6a and 6b show the before and after assembly of a wrist joint made with tubing/gears mounted to the forearm plate (six inches long, two inches wide). The end effector mount shown can be used for a gripper or an articulated hand. Because the axle is hollow, mechanical linkage, power, and/or sensor wires can be fed straight through. You can also feed tendon pull cables and mount the drive motor for the end effector back in the forearm. The wrist joint mount itself, as well as the end effector mount, are made from resin. (Other materials may be used, if you prefer.)

It will be easy to mount an encoder disk to this assembly later for tracking the position of the end effector. Also, the wrist is capable of 360 degrees of motion. The wrist motor (SMS-40) is compact and will drive the assembly nicely. Its a small flat package design (as well as being lightweight), so it can be easily fitted with the small gear supplied in the set (see far right in Figure 2). The wrist motor can be mounted offset to the output gear which leaves the opening into the journal bore clear. This is important as a drive linkage will be placed through the bore for articulation of the end effector. You can also just add a readily available servo driven gripper. Shop around to find one that has the desired opening/closing size, as well as the weight class for your application. With two assemblies now complete, the arm can begin transformation into a working limb. Next time, I will detail the jointing and final assembly of a functioning, usable arm. SV

Forearm and Wrist


For a wrist joint, the same gears may be used, again with K&S brass tubing. The largest 40 tooth gear is attached to a two inch long 7/32 tube axle as a compression fit, using a hammer. Place the gear on a flat piece of hardwood, line the tubing on the bore of the gear, and tap smartly several times. Dont try and hit it like you are driving a nail; rather, strike it like you are starting a nail. If you hit the tubing squarely, it will cleanly press into the gears bore.

PARTS LIST
ITEM GEARS Set 92657 Set GR-86 SUPPLIER/PART NO.

American Science and Surplus All Electronics (www.allelectronics.com)

MISCELLANEOUS K & S Metals Available at your local hobby shop Resin joints, humanoid robotic components, including a complete kit of parts (mechanical structure) to build this arm, email: Theandroidman@aol.com STEPPER MOTORS Elbow and shoulder Wrist motor

Electronic Goldmine/KP4M4-G14781 (www.goldmine-elec.com) Alltronics/SMS40-2401-A (www.alltronics.com)

SERVO 10.2007

45

NEEMO 12
Telerobotic Surgery Below the Sea
NASA has sent missions to the farthest reaches of our solar system, exploring the planets with probes and robotic rovers. The dream is that someday humans will follow.

by Doug Porter

Photo courtesy of the University of Washington Bio Robotics Laboratory.

pace can be a dangerous place and the Moon and Mars are too far away for a quick 911 call. How will NASA deal with medical emergencies in space? That is one question that Dr. Timothy Broderick, MD, a surgeon with the University of Cincinnati is trying to answer. Dr. Broderick is part of a research mission called NEEMO 12. NEEMO stands for NASA Extreme Environment Mission Operations, which are analog missions. That is,
Conceptual design of the mini surgical robot CAD drawing.

missions that simulate conditions in space or on another planet to prepare for manned space exploration. Dr. Broderick and a crew made up of astronauts Heidemarie Stefanyshyn-Piper and Jose Hernandez, as well as NASA flight surgeon Josef Schmid and crewmembers James Talacek and Dominic Landucci, spent 12 days this May, at the bottom of the sea. Not as astronauts, but as aquanauts. The crew spent their time in an undersea habitat called Aquarius. Aquarius is a 45 foot

46

SERVO 10.2007

NEEMO 12
long, 13 foot diameter research habitat owned by the National Oceanic and Atmospheric Administration (NOAA). The habitat rests 62 feet (19 meters) below the surface of the ocean just a few miles off the coast of Key Largo, FL. While many different types of studies were done during this mission, Dr. Brodericks goal was to continue to develop robotic telesurgery procedures for future space missions. Telesurgery is the ability of a surgeon to do robotic surgery on a patient in another location. A medical expert in the United States for example, could be called in to do surgery on a soldier on a battlefield halfway around the world, or potentially on an injured astronaut on Mars. The surgeon operates the robot by placing rotating hand grips in each hand and twisting and turning them to manipulate the handles of a controller. The surgeons movements are then transmitted to the robot which then moves thin surgical probes. The probes are similar to those used in laparoscopic surgery in many hospitals. The probes have small grippers on the end of them that are used to grasp tissues or to hold surgical blades and suture needles. The surgical robots used on Aquarius were the Raven from the University of Washington and the M7 from SRI International. Experiments have shown that telerobotic surgery over hundreds and even thousands of miles can be done successfully, but trying to do the same thing on the Moon presents additional challenges, such as dealing with the time delay. I recently had a chance to attend a live teleconference from Aquarius, as Dr. Broderick talked to a gathering of middle school students and others at the Cincinnati Museum Center. Dr. Broderick explained, as he spoke over an Internet link between Cincinnati and Key Largo, that the time lag we were having in our conversation was not noticeable. In experiments where a two second time lag was added to simulate the time lag in communications between the Earth and the Moon, telesurgery became much more difficult. Dr. Broderick explained that, A surgeon could normally sew up an incision in about 30 seconds, but doing the same thing with a two second lag time took 10 minutes. Trying to do the same thing on experienced by the probes are transmitted back to the telesurgery handles. Mars could mean up to a 20 minute delay The greatest problem the students in transmissions each way. He explained seemed to struggle with was depth that this would make telesurgery from perception. Determining when they Earth very difficult, if not impossible. were over the Petri dish or directly over Part of the NEEMO 12 mission was a piece of sponge took some practice. to try to solve some of the time lag problems. One way to solve this is While the students worked, a to program the robot to do some cluster of fish could be seen out the procedures autonomously. During the porthole spinning and gliding in the operation, the surgeon would signal brightly lit turquoise water. The task was the robot to sew up an incision. not easy, but each student managed to Instead of the surgeon controlling each complete their work. With a little more stitch, the robot would execute the practice, it would be easy to imagine programmed procedure on its own. these same students performing teleroProgramming the robot to do certain botic surgery on another planet with the procedures autonomously would also landscape of an alien world visible out greatly speed up robotic surgery. A similar the station porthole before them. SV plan is being developed for future Mars rovers where many of their tasks will be autonomous, increasing the amount of terrain covered and the number of experiments performed in a given period of time. While the tour that Dr. Broderick gave everyone of Aquarius was fascinating, the real treat was when several of the students in the audience had the opportunity to teleoperate the M7 RAVEN robot on Aquarius. Grasping the telesurgery A two-armed remotely controlled surgical robot handles, the students manipulated from the University of Washington known as them while watching the motion of Raven is photographed inside the undersea habitat for the 12th NASA Extreme Environment the probes on a computer monitor. Mission Operations (NEEMO) mission. The students turned and moved the probes to delicately pick up small pieces of sponge and place them in a Petri dish. The robot is designed with haptic feedback, so that forces

For Additional Information, Go To ...


NASA NEEMO 12 website and images www.nasa.gov/mission_pages/ NEEMO/index.html University of Washington: Raven Telerobotic Surgical Robot website and images http://brl.ee.washington.edu/ Research_Active/Surgery/ Project_07/Project_07.html M7 SRI International Robot www.military-medical-tech nology.com/print_article.cfm? DocID=1886

SERVO 10.2007

47

TARGET PRACTICE for ROBOTICS CLASS


Turn a dusty, old printer into a fun shooting range and learn some basic electronic principles you can apply to future robot builds.

by Michael Chan

miss the old days as a kid at carnivals. In particular, I always enjoyed knocking over the ducks in the shooting range. To mix things up a bit for the students in my robotics class, I came up with the idea of turning an old matrix printer into a shooting gallery. I felt this would be a great training exercise that would demonstrate basic electronic principles and show that you can turn junk into just about anything. Perhaps you'll be able to teach your kids (or yourself!) some basic skills to apply on future robot projects!
eyes. Therefore, no one should look directly into the laser or point a laser at someone elses eyes. Figure 1 shows a cheaper style of laser pointer. detection schematic circuit. Basically, phototransistor Q1 is the target. It monitors any presence of laser beams as hits. When it detects light, it will latch relay RL1 on through SCR Q3, thus activating the printer paper-out signal. The message will then freeze the printer movement signaling a target strike. There is no critical choice for the phototransistor because the incoming laser beam from the pointer is very concentrated and focused. Resistor R1 controls the sensitivity of the circuit and could be varied according to working conditions (see Figures 3 and 4).

Safety First
Along with using a printer for the shooting range, we will make use of a cheap laser pointer as our shooting gun. This way, we manage to avoid complications of shooting mechanics and projectiles in conventional ways. However, it is important to recognize that laser beams can cause great harm to human

Printer Range Control Circuit


A printer provides a convenient system for our purpose. While the printer head serves as an excellent target platform, the lateral and vertical line-feed motors of the printer provide a sturdy framework for our target movement. In addition, the paper-out sensor port gives us a perfect feedback loop to freeze upon target hits. It absolutely amazes me to see such an ideal compatibility between the printer and our range application. Figure 2 shows the shooting range

Laser Shooting Circuit


We used a $1 laser pointer for the shooting gun. What is incredible about the pointer is that the laser beam

FIGURE 1. A laser pointer. It is hazardous!

48

SERVO 10.2007

FIGURE 3. Detection circuit.

produced is fully focused and could easily reach up to a range of 30 feet. As a safety precaution to avoid overexposure of laser light, a monostable timer circuit is used in the controlling circuit to limit the on-time of the beam to just a fraction of a second. A decade counter is used to record and display the number of shots. Output at pin 5 of the counter is used to disable the counter at the sixth shot. As a result, we have a total of five SCR latching LED tallies for five shots in a game. To simulate charging at the end of each shot, the push button S2

FIGURE 2

has to be pressed to unlatch SCR U1 so that the timer is ready again for the next shot. Push button S3, on the other hand, resets the counter to simulate loading a new round of ammunition. We also used a buzz module retrieved from a cheap toy to add sound effects on the trigger. In general, the laser circuit

FIGURE 4. Range assembly.

FIGURE 5. Gun schematic diagram.

SERVO 10.2007

49

In this project, we used vector boards for our circuits RESISTORS since they are very simple. It R1: 100K R2,R3, R5-R8, R11-21: 1K also helps to build and check R4,R9,R10: 10K the circuits module by module in the process. We DIODES FIGURE 7. created a 3D rotation for the D1: Laser emitter A shooting D2: 1N4148 diodes target by using a belt drive model. D3-D10: red LEDs across the line-feed roller in FIGURE 8. Our addition to the lateral movement of the printer head. SEMICONDUCTORS shooting range The printer paper-out sensor was found easily at a IC1: 555 timer prototype. IC2: MC14017B counter small opening under the paper roller. Cable from the IC3: 7805 voltage regulator sensor leads to the jumper port (three pins) on the Q1-Q2: 2N3904 transistors printer motherboard. Use a multimeter to identify U1-U7: C106B SCR the +5V line and the paper-out signal line. When the MISCELLANEOUS printer sees a +5V at the signal line, it will assume there C1: 100 nf cap is paper and is ready for action. BUZ1: 5V buzzer On the shooting side, scavenge for casings and sound S1: SPST switch generators from available toys. We wasted a few laser S2,S3: Push button (N.O.) employs 4.5V as its power pointers in an effort to take the laser module out. We did finally supply, whereas we use a common 9V battery in our gun arrived at a simple solution though. The pointer can be pushed circuit. A voltage regulator IC is therefore necessary to into a marker tube. An empty marker fits nicely to house the interface between the two circuits, or we might burn out the pointer. It not only engages the push button of the pointer, but laser pointer (see Figures 5 through 7). also insulates the pointer metal case from the rest of the circuit. Instead of soldering, drilling, and taking things apart, we made the power connections to the pointer by using two alligator clips to connect the battery spring and the metal case of the pointer (negative for the spring and positive for the case). The power supply for the sensor circuit, as well as the target hit LEDs, can be readily tapped from the printer status indicator panel (see Figure 8).

Parts List for Gun Circuit

FIGURE 6. Assembly inside the gun case.

Construction Tips

Conclusion
In our project, we simply print lines of text to provide our target movement. To take things up a notch, programming could be used to control the target to go to specified locations and, at the same, time display scores and animations on a Parts List for screen. One could also raise the Target Sensor level of difficulty of the game by reducing the exposure time of the RESISTORS laser beam. Needless to say, this R1: 1M simple project can turn into an R2,R3,R5,R6: 1K R4: 2.2K advanced game, much like a simple robot can be built upon to LEDs make it do all kinds of cool things. D1-D3: Red LEDs Maybe even shoot at ducks SEMICONDUCTORS autonomously! SV
Michael Chan, Ceng. Miee, graduated in 1980 with a Master Degree (MSEE) in Electrical Engineering. He teaches Mathematics/Computer Technology/Robotics at Albert Campbell C.I. in Scarborough, Ontario. Details of his works can be found at www.geocities.com/keensd.

Q1: Phototransistor Q2: 2N3904 transistor Q3: C106B SCR MISCELLANEOUS RL1: 5V relay S1: Push button (N.C.)

50

SERVO 10.2007

9l`c[% :iX]k% ?XZb% GcXp% DXb\%

8LJK@EFZkfY\i)')(#)''. KI8M@J:FLEKP<OGF:<EK<I =8@I>IFLE;J J=98P8I<8DXp*+#)''/ J8ED8K<F=8@I>IFLE;J

=<8KLI@E>1D8B<GcXp;Xp# 8ljk`e:_`c[i\ejDlj\ld# JnXg$F$IXdX$IXdX#Xe[dfi\

DXb\i=X`i\%Zfd
SERVO 10.2007

51

Build a Vex Wireless

JOYSTICK CONTROLLER
by Daniel Ramirez
he Vex wireless joystick controller shown in Photo 1 features the capability to send joystick positions and button states to a nearby robot or animatronic device using a Maxstream XBee PRO Wireless UART running at 115200 baud, 8N1. The enclosure shown is made from a large plastic box with an LCD display, two Vex analog joysticks, two keypads, and one potentiometer (motor speed control), along with an array of switches and LEDs. A wireless controller provides a safe way to train robots at a distance for various movements. You can also attach the controller to a laptop to run obstacle avoidance and navigation algorithms. If your robot has an arm
PHOTO 1. The wireless joystick controller in a plastic enclosure which houses two joysticks, two keypads, switches, and LEDs.

Utilize Hollywood-style special effects like slow motion, fast forward, and single step that will bring your robot to life!

and/or wrist and gripper, the controller will provide a way to operate these remotely to pick up objects. A future enhancement to the wireless joystick would be to have it sense the tilt of the joystick box itself using XYZ accelerometers (Freescale SARD; see Sources). These tilt angles would then be scaled and converted to servo and motor commands and transmitted to the robot via the XBee PRO wireless UART. The block diagram in Figure 1 shows the main system components that include a Microchip-based dsPIC30F6014 microcontroller as the main processor and the Maxstream wireless UART (WiFi). This board is used to send commands from the wireless joystick to the robot. The controller and UART are shown side-by-side in Photo 2. The Vex robot in Photo 3 is my Hero 2007 which was inspired by the original 1980s era Heathkit Hero. I constructed it from Vex sets originally

sold at RadioShack, who unfortunately has since dropped this product line. Vex merchandise is still sold on the web at www.vexlabs.com, and a new Vex construction kit will be marketed by Revell (www.revell.com). My Hero 2007 robot shown in Photo 4 with the original Vex R/C remote uses a drive train (motion subsystem) that includes four Vex motors with gearboxes and uses the large wheels that came in the kit. The four Vex motors are wire-wrapped to the Parallax Serial Servo Controller (PSC). The XBee PRO wireless UART and the PSC boards are connected to the onboard laptop controller via USB cables which are ready to accept commands from the wireless joystick controller. You can see lots of robot models designed by other builders on the Vex forum (www.vexforum.com).

How it Works
To use the wireless Joystick, just toggle switch S19, to the Record position and start making all the movements with the joystick. The Record LED will remain lit until the entire serial
PHOTO 2. Here is the wireless joystick controller side-by-side with the XBee wireless UART. I used the wire-wrap method in combination with a TQFP80 adapter board for construction of the joystick controller board.

52

SERVO 10.2007

PHOTO 3. A snapshot of my Hero 2007 robot, which was built from Vex robot construction sets and is being used as a test platform for this project.

EEPROM memory buffer has been filled or Record is switched OFF. If it is not switched OFF, then it will start recording at the beginning again, overwriting the previous animation sequence. Next, toggle the switch S20 to the Play position, and the animation sequence will be repeated. The servos or DC motors will be active during both these operations while the live action is taking place. The Play function will remain in an infinite loop unless it is switched OFF. On PC style joysticks, the Fire and Trigger LED indicators change state whenever a button is pressed (or toggled). These LEDs are handy when debugging the hardware or verifying if
PHOTO 4. My Hero 2007 robot has a drive train (motion subsystem) that uses four Vex motors with gearboxes and a rotating sensor platform, also driven by a Vex motor.

FIGURE 1. Block diagram of the basic wireless joystick system configuration that I am currently using. It includes the wireless joystick controller, the two XBee PRO modules, and the Parallax serial servo controller.

SERVO 10.2007

53

a toggle switch or button command has been accepted. They light up during startup indicating that the joysticks are calibrated. They also light up as indicated whenever the Record, Play, or Calibrate switch is turned ON. The joystick controller takes the positions read from the joysticks and maps them to commands suitable for the motor controllers using the following equation sets: 1) The following general equation is used to compute scale factors for the x and y joystick pots that map raw joystick positions to scaled joystick positions or actuator commands in order to obtain their widest dynamic range. The window coordinates are entered during calibration and the minimum and maximum joystick positions and scale factors are determined when the joysticks are calibrated by toggling the S23 switch.

Scale = ((JoystickMax - JoystickMin) / (WindowMax - WindowMin)) 2) These next general equation maps the selected raw x and y counts to scaled joystick positions or actuator commands each time the joystick is sampled during an animation and sends them to the selected Vex controller (or R/C servo controller) via the serial RS-232 using the XBee wireless UART. In practice, I take advantage of the dsPICs floating point capabilities to perform all scaling calculations. Joystick = ((JoystickRaw - JoystickMin) / Scale + WindowMin) The joystick positions are mapped to servo or DC motor commands. Individual servos to be controlled by the joystick are selected via the keypad.

ADDITIONS AND UPGRADES


The following list shows several capabilities that can be added to the joystick controller:
Control up to 16 servos and motors using a Parallax Serial Servo Controller or control up to eight servos using a Pololu Serial Servo Controller (SSC) or a Scott Edwards Mini-SSC. Issue PWM DC motor commands to a high performance two DC motor controller that is used to position a tilt/ pan sensor platform. Add WiFi modules for extended range. Include a robust fault tolerant design using message checksums for reliable command transmission of command messages and reception of status, sensor, and diagnostic messages. A teaching pendant/learn mode record, play, fast forward, slow motion, reverse, stop, jog, or single step using serial EEPROM for recording and playing back motion scripts. Add a serial LCD display that shows important status, commands, and error messages. Incorporate pushbutton switches to select menu options for the User Interface (UI). Use two hex keypads to enter commands and data. Have 16 analog inputs used to interface joysticks, pots, flexible resistors, XYZ accelerometers, sensors, and many other analog devices using the dsPICs 12-bit ADC. Utilize a motion script language using algebraic notation (AOS) entered via the keypads. Send wireless DDT messages to a Vex microcontroller. Install a Freescale SARD XYZ accelerometer board that will measure the tilt angles of the controller box. Install Freescale Pressure sensors used for tactile feedback during tele-presense experiments. Incorporate a Vex or Mattel PowerGlove which allows the operator to move fingers and push the buttons during remote operation. May be used for virtual reality (VR) experiments. Have a portable Vex servo controller to receive messages from the wireless joystick, unpack, and process them, instead of using a laptop. Add an SD card reader for even greater motion recording capacity.

Multiple servos may be linked together (also using the keypad) for 2WD or 4WD control of mobile platforms. The joystick trains the robots with a series of complex motion sequences. These are digitized by the PIC using the C language equivalent of the Parallax BS2 PBASIC rctime command as shown in Listing 1. More and more, a PCs game port is being abandoned in favor of the USB port. This is too bad since the game port is such a useful device for game and sensor input. Because of this trend, however, there are lots of joysticks for sale at surplus electronics stores that are available at bargain prices. Office supply stores and RadioShack also have good deals on these older joysticks when theyre still in stock. There are several websites dedicated to Joystick customizations that use the game port. In fact, www.tiac. net/ten10ths/the_wheel.html is a great website dedicated to using joysticks (and steering wheels) for racing car simulators. Any R/C-based input device can be substituted for the joystick in this project as long as it meets the PC joystick interface specifications for the game port adapter. Having trouble finding PC joysticks? A custom joystick can easily be made using 100K pots and some discrete components as shown in the joystick section of the schematic available on the SERVO website (www.servomagazine.com). This joystick design is compatible with the original PC game board adapters that are used for popular computer based video games. It will also work great with the wireless joystick controller since it can use the dsPICs timers to measure an RC time constant in order to determine the joystick positions. The 0.1 F capacitor across each axis connection and ground is used as an RC circuit where the time is measured by how long it takes for the capacitor to discharge to 0 volts using the dsPICs 32bit high resolution timer. Although this joystick worked well returning the positions, I found that the readings were too noisy for controlling servos, so I used two Vex analog joysticks instead. (I recycled from a surplus Vex R/C remote.) These are available from All Electronics for under $25 (see Sources). The analog joysticks actually provided a faster

54

SERVO 10.2007

response and much better resolution using the dsPICs 12-bit ADC. The custom-made joysticks can be used for car pedals, music generation, volume controls, servo position, and motor speed controls using pots as shown in the schematic. Analog racing car wheels may also be connected to the controller as long as they use a DB-15 game port connector. These analog joysticks may not provide Fire and Trigger buttons, so I have added extra pushbutton switches to be assigned to these functions (shown in the schematic). Listing 2 shows how to read the two analog joysticks and (up to) four pots using a subset of the dsPICs 16 ADC ports. Other kinds of analog devices and sensors such as flexible resistors (used in the Mattel Power Glove), XYZ accelerometers, and temperature sensors can also be connected to the dsPICs analog inputs. Gordon McComb provides many examples of DIY robot mechanisms in the Robot Builders Bonanza [1]. Digital filtering of the joystick readings is possible, and Microchip provides a digital filtering tool that works with the dsPIC30. I didnt use digital filtering in the application presented here since just averaging a few readings during each sample interval seemed to work fine. Listing 2 shows where to customize the interface commands for various kinds of motion controllers. The listing shows how commands are sent to the PSC controller via the serial RS-232 interface. A wealth of information on calibration algorithms for sensors and even joysticks is found in Fred Martins book, Robotic Explorations [2]. The joystick controller polls dsPIC I/O lines to detect if a Calibration, Record, or Play switch has been toggled, or if a joystick Trigger or Fire button has been pressed. It also uses LED(s) connected to dsPIC I/O lines as
LISTING 1. The joystick positions are digitized by the dsPIC using the C language equivalent of the BS2 PBASIC rctime command.

LISTING 1
//******************************************************************************** //* ReadJoystick - Reads the selected joystick using the rctime function and //* returns the raw x and y axis counts for it. //******************************************************************************** void ReadJoystick(byte JoystickID, unsigned long *XCount, unsigned long *YCount) { byte PinValue; byte State; State = 0; if (JoystickID == JOYSTICK_1) { // Get counts for Joystick #1 // Read Joystick X axis using RC circuit code XJoystickDir1 = OUTPUT; XJoystickPin1 = 0; pause(JOYSTICK_DELAY); // Set X joystick #1 pin to output // Discharge the capacitor // Allow time for discharge

// Make the selected BS2 pin an input //input(Pin); XJoystickDir1 = INPUT; // Set the 1 second timer // Close 32-bit Timer 23 CloseTimer23(); // Configure 32-Bit Timer 2/3 here with no interrupts //ConfigIntTimer23(T3_INT_PRIOR_3); // Clear 32-Bit timer 2/3 WriteTimer23(0); // Setup Timer 2/3 for 1 second delay (works!!) T23_Match_Value = TIMER_32_COUNT_1S; OpenTimer23(T2_ON & T2_GATE_OFF & T2_IDLE_STOP & T2_PS_1_1 & T2_SOURCE_INT, T23_Match_Value); WriteTimer23(0); while(XJoystickPin1 == State); // wait for Pin to equal state *XCount = ReadTimer23(); // read timer 1 // Reset timer 1 // Set X joystick #1 pin to input

// Restore 1 millisecond timer // Close 32-bit Timer 23 CloseTimer23(); // Clear 32-Bit timer 2/3 WriteTimer23(0); // Setup Timer 2/3 for 1 millisecond delay (works!!) T23_Match_Value = TIMER_32_COUNT_1MS; OpenTimer23(T2_ON & T2_GATE_OFF & T2_IDLE_STOP & T2_PS_1_1 & T2_SOURCE_INT, T23_Match_Value); // Read Joystick Y axis using RC circuit code // Make the selected pin an output to charge capacitor for RC circuit time YJoystickDir1 = OUTPUT; YJoystickPin1 = 0; pause(JOYSTICK_DELAY); // Make the selected BS2 pin an input YJoystickDir1 = INPUT; // Set Y joystick #1 pin to output // Discharge the capacitor // Allow time for discharge // Set Y joystick #1 pin to input

continued ...

SERVO 10.2007

55

visual cues and turns them ON or OFF, depending on the state of the Record, Play, and Calibrate switches. Pressing the Joystick Trigger and Fire buttons also causes corresponding LED(s) to be toggled ON and OFF. The large knob on the wireless joystick controller is attached to the 100K Pot 1 currently used as a motor speed control, although it can be reassigned for other control purposes.

Building the Wireless Joystick Controller Boards


Recording motion is like recording movies to film. Long dance sequences may be choreographed and carefully re-played, and movie scenes may need to be retaken in exactly the same manner. The joystick controller does this by storListing 1 continued ...
// Set the 1 second timer // Close 32-bit Timer 23 CloseTimer23(); // Clear 32-Bit timer 2/3 WriteTimer23(0);

ing the motion commands for later replay by the animation hardware to a serial EEPROM or to a host PC (or laptop) for diagnostics and calibration applications. The prototype dsPIC30F6014-based joystick controller board is made from a Bellin Dynamic Systems TQFP80 adapter board. It is used to interface up to two joysticks, four joystick buttons (two Trigger and two Fire buttons), and three pushbutton toggle switches used for Record, Play, and Calibrate functions. Two PC-style or analog joysticks can be connected to two DB-15 D shell connectors shown in the schematic with the jumpers in. Two analog joysticks can be connected to the same I/O lines with the jumpers out. These joysticks allow the operator to independently control two actuators (servos, DC motors, stepper motors), and up to four relays (con-

// Setup Timer 2/3 for 1 second delay (works!!) T23_Match_Value = TIMER_32_COUNT_1S; OpenTimer23(T2_ON & T2_GATE_OFF & T2_IDLE_STOP & T2_PS_1_1 & T2_SOURCE_INT, T23_Match_Value); WriteTimer23(0); while(YJoystickPin1 == State); // wait for Pin to equal state *YCount = ReadTimer23(); // read timer 1 // Reset timer 1

// Restore 1 millisecond timer // Close 32-bit Timer 23 CloseTimer23(); // Clear 32-Bit timer 2/3 WriteTimer23(0); // Setup Timer 2/3 for 1 millisecond delay (works!!) T23_Match_Value = TIMER_32_COUNT_1MS; OpenTimer23(T2_ON & T2_GATE_OFF & T2_IDLE_STOP & T2_PS_1_1 & T2_SOURCE_INT, T23_Match_Value);

} . . . }

nected to the Trigger and Fire buttons). The number of actuators and relays can be increased if they are slaved or mixed to one another or a method can be devised to multiplex them with select control lines. (Presently, I only use one of the analog joysticks for this application, but I plan to take advantage of the second joystick in the future.) Optional features include the addition of XYZ accelerometers (tilt sensors) to measure the joystick control box orientation, which provides even more control of Vex-based robots (or even any R/C servo-based applications using an accelerometer board). Tactile feedback to the operator can also be sensed using pressure sensors. The joystick controller runs at 120 MHz (30 MIPS). A MAX233 serial driver IC provides the serial interface between the dsPIC30F6014 and the wireless UART at 115200 baud (although this baud rate may be changed in firmware to obtain other standard rates for direct connection to a PC or laptop). I selected the dsPIC because it provided the necessary processing speed and memory capacity to handle all the functions of the wireless controller, with additional room for future enhancements. An alternative to making the controller board (which can save time) is to purchase the Microchip Development Board. Just make the necessary connections to the corresponding pins brought out on the boards I/O pin header. The advantages of purchasing this board are the built-in graphics LCD display and 24LC256 serial EEPROM. Just solder 0.001 pin headers to the I/O pin holes in the board and wire-wrap the remaining wireless joystick hardware directly to the board. To build the controller board yourself, use the schematic available on the SERVO website. Parts placement and board fabrication techniques are not crucial. Wire wrap, point-to-point, and printed circuit board (PCB) construction can all be used for this project. I used the wire-wrap method in combination with a TQFP80 PC

56

SERVO 10.2007

adapter board. The Bellin TQFP80 accomplished by connecting the first UART1 AND UART2 adapter socket made it possible for me XBee Wireless UART to the laptops Connector (X1, X2) to hand solder the dsPIC30F6014 COM3 serial port. The second XBee microcontroller to standard 0.001 inch Inside the dsPIC30F6014, there are UART connected to the dsPIC UART2 pin headers using a 40X surplus actually two UARTs that make it capausing the 115200 baud, high-speed microscope. I was able to wire-wrap ble of handling two serial ports. This is serial port. The TX, RX, and GND pins the prototype board with all the accomplished by using the on-chip are connected to two DB9 RS-232 connecessary hardware, so that it would fit addressable UART hardware (also nectors (X1, X2) enabling a host micronicely in my enclosure. known as the Serial Communications controller, PC, or laptop to talk to the I was also able to successfully Interface SCI on other microprocesdsPIC. solder another postage stamp-sized, 80 sors). Without the UART interface, compin microcontroller onto the TQFP80 munications to the dsPIC30F6014 Serial LCD Display adapter board by using the information would be severely limited. A MAX233 provided in an excellent Seattle provides the voltage level translation The LCD display provides the operRobotics Society Encoder article titled from logic levels to standard RS-232 levator with a portable user interface (UI) Have you seen my new soldering els. For debugging and testing purposto display menus, messages, and Iron? by Kenneth Maxon. The es, a laptop serial port may be connectdebug output, and it also allows the Encoder article may be found at ed to the dsPICs UART1 serial port. user to input commands and data. The (www.seattlerobotics.org/encoder/ Communication between the lapserial LCD display is similar to the one 200006/oven_art.htm). top mounted on my Hero 2007 robot sold by Scott Edwards Electronics. It is Another construction alternative is and the wireless joystick controller was connected to UART1. the SchmartBoard SMT development system. SchmartBoards are LISTING 2 easy to solder using their unique //******************************************************************************* SMT construction system.

Power Supply (JP1)


The power requirements for the wireless joystick controller boards are quite modest since I designed this board to be used for small mobile robot applications. Jumper JP1 is used to connect the 3.3 volt/5 volt power supply shown in the schematic in Figure 2. A separate +5 volt lab power supply connected to VSS and VDD may also be used. A power LED connected between the VDD and VSS using a 220 to 470 ohm resistor in series to limit the current provides an indication of when the board is powered up. Either SMT or standard discreet components may be used to make the power supply, depending upon your own sizing requirements. You may want to use a separate voltage supply and extra filter and bypass capacitors since large voltage drops and voltage spikes could inadvertently reset the dsPIC30F6014.
LISTING 2. This code segment shows how to read various analog sensors and joysticks, and pots using the dsPICs 12-bit, 16 channel ADC.

// Main Wireless Joystick Controller application - Send Hex or binary servo // commands to laptop at 38400 or 115200 Baud so that the laptop can format // them and send them to the Parallax Servo Controller (PSC). //******************************************************************************* // Read joysticks and display the values. while(1) { Nop(); i = 0; while( i <16 ) { ConvertADC12(); while(ADCON1bits.SAMP); while(!BusyADC12()); // Read the ADC for selected channels result[i] = ReadADC12(i); i++; // Small delay to help with conversion for (j=0; j<CONVERSION_DELAY; j++); } XJoystickRaw[JoystickID] = result[11]; YJoystickRaw[JoystickID] = result[12]; Works!!!

// Scale the joystick x and y axis raw pot values map_viewport_to_window(XJoystickRaw[JoystickID], YJoystickRaw[JoystickID], &X_Joystick, &Y_Joystick); // Works!!! // Return scaled joystick positions and pushbutton states to the Host. JoystickMessage.JoystickCommand.X_Position_1 = (word) X_Joystick; JoystickMessage.JoystickCommand.Y_Position_1 = (word) Y_Joystick; JoystickMessage.JoystickCommand.Button_1 = JoystickButtonState; // Send the joystick commands via the XBEE Pro Wireless UART Send_Joystick_Commands(); }

SERVO 10.2007

57

Joystick Adapter Connectors (JP6, JP7)

The I2C interface is used to store data I used two standard PC joystick in the 24LC512 Serial EEPROM by taking cables with DB-15 sockets which I advantage of the dsPICs built-in I2C hardmounted on the wireless joystick conware and library. The dsPICs I2C Master troller enclosure and connected them Mode works well in both the 100 kHz to JP6 and JP7. These pin headers are, (slew off) and 400 kHz (slew on) modes in turn, connected to the dsPIC I/O Pins to access the serial EEPROM (I2C slave). shown in the schematic. They provide a The dsPIC board provides access to convenient connection to PC-style the I2C interface using jumper, JP5. It Joysticks (JP8, JP9, JP14, JP15) with connects the SCL, SDA, and GND jumpers or analog joysticks connected signals to an I2C slave device and it uses in a similar manner without jumpers. the Master Synchronous Serial Port (MSSP) peripheral hardware to support the I2C seven-bit and nine-bit communiICSP/ICD2 RJ-11 cation protocols in both master and Connector (JP4) slave configurations. The I2C interface is The ICSP/ICD2 connector, JP4, is handy for reading and writing to and from serial I2C EEPROMS. It is also used for connecting various I2C LISTING 3 devices commonly found in robot//******************************************************************************* ics, such as sensors and controllers. //* Send_Parallax_Commands - This routine computes checksum and packs and sends The biggest feature that makes I2C //* servo commands from the Wireless Joystick Controller to the Parallax Servo //* Controller (PSC) using the scaled joystick positions via the XBEE Pro devices appealing for robotics //* Wireless UART using the selected servo at the specified ramp rate. applications is that they can be //* SEROUT Sdat, N38400+$8000,[!SC, ch, ra, pw.LOWBYTE, pw.HIGHBYTE,CR] networked via a two-wire bus using //******************************************************************************* void Send_Parallax_Commands(void) only two pull-up resistors. { I have also been able to access int i; multiple devices for larger motion word LocalChecksum = 0; // Message checksum script storage capacity. With // Compute message checksum appropriate pull-up resistors ranging from 2.2K to 4.7K, you can connect LocalChecksum = 0; // Initialize local checksum almost any I2C serial EEPROM, using for (i=0; i<MESSAGE_BUFFER_SIZE-2; i++) only the dsPIC30F6014 SCL and { SDA I/O pins. Be careful to assign // Compute local checksum each I2C device a unique address LocalChecksum += ServoCommandMessage.Message.Data[i]; } rather than using the default address if more than one I2C device ServoCommandMessage.ServoPositionCommand.Checksum = LocalChecksum; is connected to the I2C bus. // Copy the entire servo message generated by the wireless joystick The software required to // controller to the UART Tx Buffer for wireless transmission. It may access the I2C interface is available // include sensor data, telemetry and status information and is received either by the Microchip Maestro I2C // concurrently with each message that the joystick controller sends. memcpy(Uart_Tx_Buffer, &ServoCommandMessage.Message, drivers at the Microchip website or sizeof(ServoCommandMessage.Message)); the dsPIC I2C library accessed with the i2c.h C header file. The dsPIC library currently supports the //****************************************************************************** //Send the generated servo commands to the XBEE Wireless here Master I2C mode, but does not //****************************************************************************** support the I2C slave mode at this time. I have not been able to get it for (i=0; i<MESSAGE_BUFFER_SIZE; i++) { working reliably in C, and it is a task // Process the Servo Position command messages that is further complicated because SendByte2(Uart_Tx_Buffer[i]);
// Delay for 115200 Baud using XBEE Pro and GNAT Ada 95 pause(2); } }

used to connect the board to the Microchip In-Circuit Debugger (ICD2) using the VPP/MCLR, RB1/PGC, RB0/PGD, VSS, and VDD pins. In addition to debugging dsPIC applications, the ICSP allows you to program the dsPIC microcontroller directly using InCircuit Serial Programming (ICSP). (This is much easier than removing the microcontroller to erase and program it.) The connector simply attaches to the ICSP pin headers on the TQFP80 board, while insuring that pin 1 is aligned correctly. I use a short wiring harness with an RJ11 6P6C socket and 6 leads that I connected to jumper, JP4, that allow me to program the microcontroller without having to remove it.

I2C Interface (JP5)

LISTING 3. This code segment shows how to customize the interface messages for various kinds of motion controllers including the Parallax serial servo controller, the Scott Edwards Mini-SSC, and the Pololu serial servo controllers.

58

SERVO 10.2007

I2C slave modes require interrupt service routines to handle the incoming data. Microchips AN734 app note is an excellent introduction to the I2C protocol [5].

The Power Supply


A 3.3 volt power supply is required to power the optional Freescale XYZ accelerometers. Otherwise, just build the five-volt supply since it will be used to power the dsPIC joystick controller board and the PSC board. Check for +5 volts output when the nine-volt battery is connected to the power input terminals. Also check for +6 volts used to power the R/C servos. Try to isolate the +6 volts servo power supply from the +5 volts logic power supply. Include bypass and filter capacitors and diodes, as required, in order to suppress voltage spikes generated by collapsing electromagnetic fields from the DC motors (if used). My Hero 2007 uses a surplus, sixvolt sealed lead acid (SLA) battery to power the R/C servos and the Polaroid 6500 sonar ranger board. A separate Vex, nine-volt rechargeable battery used for the +5 volts power supply is required by the joystick and PSC controller boards.

(OEM RF Module) provides all the benefits of the ZigBee standard in a design that yields three times the range of traditional ZigBee solutions. All of this hardware is provided in a board that measures only 24 mm by 27 mm, which helps it to fit into an enclosure without taking up too much space. The wireless UART used for this application provides telemetry to the nearby client device such as a laptop, a robot, or other animatronic device. The XBee PRO UART is configured with the wireless UART application using standard Hayes Modem AT commands with the serial port protocol set at 115200, 8N1. The power supply required for this board is 2.8 volts to 3.4 volts, so the 3.3-volt power supply circuit shown in Figure 2 works great. If you decide to purchase the Maxstream Development Kit, you can use the connections shown in the block diagram in Figure 1. The advantages of purchasing the kit is that the serial connectors and RS-232 voltage level translations, along with the power supply and cables, are supplied, including one board that directly connects to the USB port on a laptop.

WORKING WITH SMT COMPONENTS


Building surface mount technology (SMT) boards requires special equipment and handling. Some tools that you will need when working with SMT devices include: a dental pick or Xacto knife used to check for loose pins and remove bits of solder; a small set of vacuum tweezers to pick up miniature SMT components; a very thin tipped soldering iron to solder individual SMT pins or to remove solder bridges; and a 40X microscope or electronic magnifier to examine the fine pitch traces and SMT pins for solder bridges and loose pins. Materials needed to work with SMT parts include pin headers, water soluble solder paste, and an application syringe.

Maxstream XBee PRO Wireless UART


The Maxstream 2.4 GHz XBee PRO ZigBee/802.15.4 RS-232 RF Modem

Controller Range
The 100 mW XBee PRO provides up to one mile range (1.6 km) and its RS-232 connectivity makes integration simple. The range of this controller

exceeds that of the standard Vex controller since the line-of-sight range is the same as the one specified in the Zigbee protocol. Maxstream XBee PRO provides the maximum range of 300 feet line-of-sight indoors. The actual range depends on many factors including direct line-ofsight, antenna length, walls, and windows that can block the low power ZigBee signal. The standard antenna is built into the board, but Maxstream does sell other options. The Maxstream wireless UART can be easily configured using the standard AT modem commands and includes a
FIGURE 2. The 3.3-volt and five-volt power supply circuits.

SERVO 10.2007

59

SOURCES
Maxstream www.maxstream.net Pololu www.pololu.com Microchip Technology, Inc. www.microchip.com Scott Edwards Electronics, Inc. www.seetron.com Parallax, Inc. www.parallax.com Bellin Dynamic Systems www.beldynsys.com SchmartBoard SMT Development System www.schmartboard.com Freescale www.freescale.com All Electronics www.allelectronics.com

al configuration (see Figure 2). A virtual SARD consisting of just the XY and Z accelerometer boards can be directly connected to the ADC as long as the 3.3-volt and five-volt supplies and voltage references are taken into account.

Virtual Keypad
Two keypads form a 4 x 8 virtual keypad to be used for selecting various servo and motor control options and data entry using the UI and the serial LCD display. It provides a handy simulated Texas Instruments TI-59 programmable calculator using an Algebraic Operating System (AOS) similar to the original TI-59s. The keypads provide the operator data entry capability to enter motion script commands in order to train a robot or animation prop.

Noise Immunity
Noise can be a critical factor when using R/C servos for robots, which is one reason why it is important to use filter and bypass capacitors. This is due in part to the sensitivity of the internal electronics which can cause the servo motor to move unexpectedly when power supply spikes occur. Noise picked up by the R/C servo wires that act as antennas can cause the R/C servos to move unexpectedly. Radio frequency interference (RFI) from nearby R/C remotes and cell phones can also cause problems. This is a safety concern when they are connected to a mechanical actuator that could injure someone. For this reason, make sure that no one is close to an R/C servo actuated mechanism. The strong torque produced by these servos and the speed at which they move is also a concern. These same issues apply to powerful DC geared motors and stepper motors, as well. Sources of noise can include the R/C servos themselves, the antenna effect of the servo wire connections, and spikes induced by other brushed DC motors, stepper motors, solenoids, relay contacts, and switches. The noise may be minimized by using capacitors to filter the power lines and by also using short lengths of twisted pair wire to connect the R/C servos to the controller.

Development Tools
The Microchip ICD2 in-circuit debugger/programmer is required to Flash the dsPIC firmware since it works directly with Microchips MPLAB. In addition, the dsPIC C30 C compiler (student edition) was used to develop the wireless joystick firmware. Both MPLAB and the C compiler are available as a free download from the Microchip website.

utility to configure the modem channel and baud rate as required by the application.

Hardware Improvements
Future hardware improvements to the wireless joystick include adding a SD card reader to provide for longer animation scripts. This application could also be used for security and telepresence applications for manipulating a tilt/pan camera platform. I also plan to integrate a PIC based relay controller board that I recently designed so that I can switch high power relays, solenoids, valves, and Muscle Wire.

Tilt Sensor
As mentioned previously, the optional tilt sensor used here is the Freescale ZigBee XYZ accelerometer (SARD) connected to the dsPIC joystick controller board using UART1. It can also function as a motion input device by using it to measure the actual control box orientation. It uses the ADC or UART at 38400 baud, 8N1, as the seriPHOTO 5. This is how I mounted the Parallax serial servo controller and the XBee wireless UART on my Hero 2007 robot.

Action!
Using the wireless joystick controller, I was able to integrate many commercial and DIY motor controllers into my various robotic projects. Although I was only experimenting with it, I was able to carry out serious animations with this system. I hope other readers will enjoy building this project and using it for their own animations. SV
Daniel Ramirez can be reached by email at mgatron@aol.com.

FOOTNOTES
[1] McComb, Gordon, Robot Builders Bonanza, Second Edition, McGrawHill Professional Book Group, 2001. [2] Martin, Fred, G., Robotic Explorations: A hands-On Introduction to Engineering, Prentice Hall, Inc., 2001 [3] Bowling, Stephen, AN734: Using the PICmicro SSP for Slave I2C TM Communication, Microchip Technology Inc., document #DS00734A-, 2000.

60

SERVO 10.2007

by Michael Simpson

ach of the modules can be used with your desktop PC, laptop, Pocket PC, or a microcontroller. All the units output the National Electrical Manufacturers Assocation (NEMA) 0183 protocol, as do many GPS modules. Later, I will give you a walk through NEMA 0183 protocol.

EM-406A
Lets start by looking at the EM-406A module, manufactured by USGlobalSat, as shown in Figure 1. Of the three modules we will examine, this is the only one that has a development board which is perfect if you are going to interface to a desktop, laptop, or Pocket PC. This makes the EM-406A a perfect starting point in the GPS series. Lets take a quick look at the feature set of the EM-406A: 20 channel receiver Built-in antenna High sensitivity: -159 dBm

30 positional accuracy/25 with WAAS Hot start: 8 seconds Warm start: 38 seconds Cold start: 42 seconds 70 mA power consumption 4.56.5 volt operation Outputs NEMA 0183 and SiRF binary protocols Small foot print: 30 mm x 30 mm x 10.5 mm Built-in LED status indicator Six-pin interface cable included We are going to start by connect-

ing the module to our PC using the EM-406 evaluation board shown in Figure 2. This board will allow you to use a standard AC adapter and nine-pin cable to connect the EM406A to your PC of choice. SparkFun Electronics also sells a USB EM-406 evaluation board. You may use this board as well, as it sets up a com port that you can use once its connected to your PC or laptop. You cant use the USB board with your Pocket PC or microcontroller. In order to secure your EM-406A to the evaluation board, I recommend

FIGURE 1 SERVO 10.2007

61

FIGURE 2

FIGURE 3 FIGURE 4

the hole for the board. This is easily done by placing the board on top of the plastic and tracing the holes. Once the holes are drilled in the bottom piece, use it to mark the top piece of plastic. Insert four, #4 x 3/8 machine screws through the bottom of the base plastic piece and secure them with four nuts. I recommend adding four small nylon washers for insulation. Next, place the module on top of the screws as shown in Figure 6. STEP 5: Place four more nylon washers on top of the machine screws, then attach four, 1/2 standoffs to the screws. Next, place the top piece over the standoffs and attach with four, #4 x 3/8 machine screws as shown in Figure 7.

FIGURE 5 the following steps: STEP 1: Tape some double stick foam to the underside of the EM-406A. I recommend four small pieces rather than one large piece as shown in Figure 3. This will make it easier to remove later. One of the reasons we are using foam tape is to keep the metal bottom of the module from shorting out any of the evaluation board connections. STEP 2: Remove the backing from the foam tape and affix the module to the evaluation board as shown in Figure 4. Its okay if some of the foam tape is on top of a couple of the small components. STEP 3: You need to keep the bottom of the evaluation board from shorting out. One way to do this is to place small standoffs on the board as shown in Figure 5. Note that I added small nylon washers on the top to prevent the screws from shorting out any of the pads on the evaluation board. STEP 4: The standoffs mentioned in Step 3 are fine for bench top testing or mounting on a larger surface. If you plan on using your evaluation board in your car, I recommend sandwiching the board between two pieces of plastic. Start by marking

EM-408
The EM-408 module shown in Figure 8 is also manufactured by USGlobalSat. While it does not have its own evaluation board, you can use the Copernicus evaluation board available from SparkFun. The EM-408 has a built-in antenna, but also sports a MMCX connector for attaching an external antenna. EM-408 features include: 20 channel receiver Built-in antenna High sensitivity: -159 dBm 30 positional accuracy/25 with WAAS Hot start: 8 seconds Warm start: 38 seconds Cold start: 42 seconds 75 mA power consumption 3.3 volt operation Outputs NEMA 0183 and SiRF binary protocols 30 gram weight Built-in LED status indicator Five-pin interface cable

FIGURE 6

FIGURE 7

62

SERVO 10.2007

included External MMCX antenna connector In order to plug the EM-408 into the Copernicus evaluation board, you need to add a couple of headers to the five-pin connector that comes with the EM-408. Even if you dont plan on using the Copernicus board, you will still need to mount the headers if you plan on connecting to a microcontroller. I will detail this later in this series. STEP 1: Refer to Figures 9 and 10 and add a three-pin header attaching the Enable, Vcc, and Gnd leads as shown. Mark them with different colored heat shrink so you can identify the pins later when you plug it into the evaluation board. Notice that the gray colored wire is the Enable lead. Next, connect the two outside pins on a three-pin header to the RX and TX leads as shown in Figure 10. STEP 2: Plug the male headers into the female headers on the evaluation board as shown in Figure 11. STEP 3: Take some double stick foam tape and attach them as shown in Figure 12. I recommend using two pieces on each one to double the thickness. STEP 4: Peel the backing from the tape and attach the EM-408 as shown in Figure 13. Make sure you do not cover the mounting holes. STEP 5: As I showed in the EM-406 instructions, cut two pieces of plastic and mount the Copernicus board as outlined. The plastic should be at least 3.5 x 2.5. When finished, it should

FIGURE 8

FIGURE 9

look like the module shown in Figure 14.

Testing the Modules


FIGURE 10 You now have a nice platform for testing your EM-406A and EM-408. All you need to do is apply power to the 2.1 coax and connect the nine-pin connector to your PC with a cable. For power, I used a small 9V wall wart I had lying around (center positive). (SparkFun sells both the AC adapter and cable if you dont already have them.) Note that on the Copernicus board we use Port A. Once you apply power to the evaluation board, there is a small switch that needs to be turned on. Once on, the main power LED on the board will light. On the EM-406, the small status LED on the module will light, as well. Both the EM-406A and the EM-408 outputs its data at 4800 baud, 8N1. I have included a program called QuickTerm_DT.exe in the downloads (available at www. kronosrobotics.com). This is a simple terminal program that will FIGURE 13

FIGURE 11 FIGURE 12

SERVO 10.2007

63

FIGURE 14

NEMA 0183 Protocol


FIGURE 15 allow you to see the raw NEMA 0183 data that the GPS unit is transmitting. Once you connect your module to your PC, laptop, or Pocket PC, you should see a form that looks something like Figure 15. If you dont, make sure you set the comport using the Settings menu. Even if you are deep in your basement, you should still see this data coming from the module. Please note that if you are using a Pocket PC, you need to use the QuickTerm_PPc.exe file (included in the downloads). You will also need a null modem (Tx and Rx crossover). FIGURE 16 In the old days, there were as many GPS protocols as there were GPS manufacturers. Even today, my Magellan Meridian has three different output protocols available. However, the NEMA 0183 protocol has evolved to become the protocol of choice for most software applications. Just about any GPS module or receiver now supports it. NEMA has defined a series of messages. These messages are referred to at the NEMA 0183 protocol. You can download a complete NEMA 0183 reference manual at www.sparkfun.com/ datasheets/GPS/NMEA%20Referen ce%20Manual1.pdf. Lets take a closer look at the NEMA 0183 protocol. Table 1 shows some of the NEMA messages that we will be looking at. A NEMA 0183 message begins with a $GP and ends with a carriage return. It looks something like this: $GPGSV,3,1,12,20,00,000,,10,00,00 0,,25,00,000,,27,00,000,*79
Message GGA GSA GSV RMC Description Time, position, fix type.

The message name which is also referred to as the option is the characters just following the $GP. Each data element is separated by a comma. The data elements are terminated by the * character, followed by the checksum. There is an eight-bit XOR of each character between the $ and * to form the checksum. The last two characters in the message are a hex representation of the calculated checksum. Once you supply power to your GPS module, it will attempt to acquire and track satellites. The GPS module needs to track at least three satellites in order to report its position. There are two commands the protocol uses to relay the current satellite tracking status. GSA Field 1, Mode (M=Manual, A=Auto) Field 2, Fix (1=No Fix, 2=2D, 3=3D) Fields 3-14, The satellite numbers used to calculate position Field 15, PDOP (Position Dilution of Precision) Field 17 , HDOP (Horizontal Dilution of Precision) Field 18, VDOP (Vertical Dilution of Precision) The main field we are interested in is Field 2 (Fix). If this field value is a 1, then not enough satellites can be tracked to get a signal. If it is 2, then the module is in 2D mode. This means that only the X and Y positions can be reported. If the value is 3, then the module is in 3D mode and X, Y, and Z axis positions can be reported. GSV Field 1, Number of Messages (1-3) Field 2, Current Message Number (1-3) Field 3, Satellites in View Field 4-7, Satellite Number (1-32), Elevation (0-90), Azimuth (0-359), SNR (0-99)

GPS receiver operating mode, satellite used in the position solution, DOP values. The number of GPS satellites in view, satellite ID numbers, Elevation, Azimuth, SNR values. Time, date, position, course, speed.

TABLE 1

64

SERVO 10.2007

Fields 8-11, Satellite Number (1-32), Elevation (0-90), Azimuth (0-359), SNR (0-99) Fields 12-15, Satellite Number (1-32), Elevation (0-90), Azimuth (0-359), SNR (0-99) Fields 16-19, Satellite Number (1-32), Elevation (0-90), Azimuth (0-359), SNR (0-99) The GSV message reports the number of satellites in view and the actual signal values of any of those satellites that it is able to track. The third field reports the number of satellites in view. After that, four fields for each of the satellites in view report the satellite number, Elevation, Azimuth, and SNR. I have provided a program called Satellites_DT.exe that will plot each satellite being tracked as shown in Figure 16. I have also included the ZeusPro source code with the download files so that you can see how I parsed the data. I have included the compiled Desktop and Pocket PC programs, as well as the ZeusPro source code so that you can see how I parsed the data. As this series continues, I will add programs and source code for you to experiment with. The main function called proc nema (shown in Program 1) is where I test for the particular output messages and make the appropriate call to the message handler. In this segment, I have also provided an example of the GGA handler.

NAVIBE 611 Sport GPS ule or standalone receiver, you want as many channels as possible. You The NAVIBE 611 shown in Figure also want a module or receiver that 18 is a small GPS module. It runs supports the NEMA 0183 protocol. If off of two AA batteries, or can be you are going to connect to a microcontroller, you Program 1 should also look for some sort of TTL level func procnema(lndat as string) dim msg as string serial output. Before I close this article, its important Print message to console that I point out that print lndat,len(lndat),asc(mid(lndat,1,1)) there are literally hunif calcchecksum(lndat) = 0 then dreds of GPS modules print Checksum Error and receivers that are exit() available. Here are two endif that I have used. Holux GPSlim236 The Holux GPSlim236 module (Figure 17) supports a Bluetooth wireless interface. I use it with my Pocket PC and laptop for most of my trip navigation. The connector is actually a non-inverting TTL serial interface that we will explore later when interfacing to microcontrollers. The GPSlim236 has a built-in battery that will power the GPS for up to 10 hours. You can also supply power to the connecter that will both charge and power the unit. This receiver will run you between $60 and $100, depending on where you purchase.
Get msg type msg = replace(getword(lndat,1,1,,),$GP,) select case msg case GGA procGGA(lndat) case RMC procRMC(lndat) case GSA procGSA(lndat) case GSV procGSV(lndat) endselect

endfunc Global Positioning System Fixed Data Populates GGA_UTC, GGA_Latitude, GGA_NS GGA_Longitude, GGA_EW, GGA_FIX GGA_SATS, GGA_Alt, GGA_AltUnit func procGGA(lndat as string) global GGA_UTC as string global GGA_Latitude as string global GGA_NS as string global GGA_Longitude as string global GGA_EW as string global GGA_FIX as string global GGA_SATS as string global GGA_Alt as string global GGA_AltUnit as string

Final Thoughts
When you purchase a GPS mod-

GGA_UTC=getword(lndat,1,2,,) GGA_Latitude=getword(lndat,1,3,,) GGA_NS=getword(lndat,1,4,,) GGA_Longitude=getword(lndat,1,5,,) GGA_EW=getword(lndat,1,6,,) GGA_FIX=getword(lndat,1,7,,) GGA_SATS=getword(lndat,1,8,,) GGA_Alt=getword(lndat,1,10,,) GGA_AltUnit=getword(lndat,1,11,,)

FIGURE 17

FIGURE 18

endfunc

SERVO 10.2007

65

Parts List
The following is a breakdown of sources for all the components needed for Parts 2 and 3 of this project. SPARK FUN ELECTRONICS

Nine-Pin Serial Cable www.sparkfun.com/commerce/pro duct_info.php?products_id=65 6V AC Adapter www.sparkfun.com/commerce/pro duct_info.php?products_id=737 External Antenna with SMA Connector www.sparkfun.com/commerce/pro duct_info.php?products_id=464 SMA to MMCX Adapter Cable www.sparkfun.com/commerce/pro duct_info.php?products_id=285
KRMICROS

EM-406A GPS Module www.sparkfun.com/commerce/ product_info.php?products_id=465 EM-406 Evaluation Board www.sparkfun.com/commerce/ product_info.php?products_id=653 EM-408 GPS Module www.sparkfun.com/commerce/pro duct_info.php?products_id=8234 Copernicus Evaluation Board www.sparkfun.com/commerce/pro duct_info.php?products_id=8145

powered via the rear connector. I picked one of these little gems up from an eBay store for $24 new. It displays current and max speed in the small display window and spits out the NEMA 0183 protocol via a small connector. The connector supplies both a serial and USB interface. This unit also has the ability to log GPS data for later retrieval.

Whats Next
Alright, so next month, we will look at interfacing a couple more SparkFun modules and take our NEMA 0183 interface to the next level. I will show you how to pull the positional data from the NEMA messages. Be sure to check for updates and downloads for this article at www.kronosrobotics.com/Projects /GPS.shtml. SV

ZeusPro www.krmicros.com/Development/ ZeusPro/ZeusPro.htm

Robot Controllers
Wiring Robot Controller
Atmel ATMega 128 128k Memory 43 Digital I/O Pins 8 Analog Inputs 8 External Interupts 6 PWM Channels 2 Serial Ports including Bi-Directional USB The Wiring Programming Language The Wiring language provides a simplified subset of C or C++ that hides more advanced concepts like classes, objects, pointers (while still making them accessible for advanced users). You get the power of C or C++ with the ease of a language like Basic. Programs execute at full C++ speed on the board.

Programmable Robot Kits


INEX MicroCamp Mega8
Atmel ATMega8 Dual DC motor drivers 2 Buttons, 2 LEDs Serial port 5-Analog ports for sensors +5V switching power supply No soldering required Supports In-system Programming via ISP connector with included PX-400 Serial Programmer Includes eveything you need to build a simple mobile robot. Add your own additional sensors for even more complex robots.

$69.95 ARC1.1 Robot Controller


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

$59.95 MicroBric Viper


Also Available:
Electronic Components Servos Motors Hardware Wheels & Tires and More! More New Products on the way! Screw-together Assembly BasicAtom Microcontroller 2 motor modules Bump sensor modules Switch Modules IR Remote & Receiver Module With microbric, you can build complex electronic devices with little or no prior electronics knowledge. As no soldering is involved and the parts are fully reusable, you can build and rebuild programmable robots as many times as you like.

/ Assembled $41.95

$89.95

MaximumRobotics.com
66
SERVO 10.2007

1-800-979-9130

Give the gift that lasts all year!

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

Go to

U.S. Prices
1 Yr $24.95 2 Yr $45.95 3 Yr $65.95

Subscribe online at: www.servomagazine.com


or call: 877-525-2539 (toll free) / 818-487-4545 (outside US)

Tune in each month for a heads-up on where to get all of your robotics resources for the best prices!

Holding it All Together


like keeping things together. Literally. Ive never been a fan of whats called rubber band and bubble gum construction building techniques that may be quick and easy, but are only temporary and usually more frustrating in the long run. With temporary construction, things are apt to get misaligned or even fall off. Fasteners are those things that are meant to keep one thing attached to another. The most common type of fastener is the screw, but there are others, such as rivets and clamps. Well take a short excursion through the fastener jungle, and cover hardware fasteners.

Screws and Nuts


Screws come in many different forms. Two of the most common are the tapered screw and the machine screw. Tapered screws are most often self-tapping, and combine the action of a miniature drill bit and fastener in one. Tapered screws are available for a variety of materials, including wood and sheet metal. Their construction differs and each one is best at the job its intended for. You should always match the screw to the job. Machine screws (usually) require a ready-made hole. Slip in the screw, and secure it with a nut or other threaded retainer on the other end. If the material being joined is threaded, the screw can be secured directly. Machine screws are sometimes referred to as bolts, and when a nut is included, theyre commonly known as stove bolts. Speaking of nuts, the most com-

mon is the hex nut, so called because the nut has six sides (a hexagon). The nut is fastened using a wrench, pliers, or hex nut driver. Hex nuts are the most common form out there, and they are the cheapest. However, there are other types as well, including square nuts and T-nuts, also called blind nuts. Theyre for wood and soft plastics. For robotics use, youll also want to be familiar with the locking nut. These are standard hex nuts, but with a nylon plastic insert. The nylon helps prevent the screw from working itself loose. Complementing the screw and nut is the washer, designed to spread out the compression force of the fastener. Under load and without a washer, damage may occur when the small surface area of the machine screw head or nut digs into the material. The washer doubles or even triples the surface area, spreading out the force. Washers are available in diameters to coincide with the size of the screw. Choices include tooth washers both internal tooth or external tooth and split lock washers. These provide a locking action that helps prevent the nut from unloosening.

hardware fasteners youll want to be aware of: Stainless steel. Provides added strength and resistance against rusting or corrosion. They dont need to be plated because the material already resists rust and other corrosion. Brass. Softer metal thats most often used for looks. No plating is necessary. Some steel fasteners are only plated brass. Aluminum. Used when a metal fastener is desired at lower weight. Threads are more prone to stripping. Titanium. Supreme strength for its weight. Only modestly heavier than aluminum, but with the strength of steel. Nylon. Lighter than steel or other metals, but not nearly as strong. Typically available in natural, white, or black.

Have Your Pick of Sizes and Shapes


Machine screws come in standard lengths, though you can often specialorder screws to an exact length (which costs a lot extra). When you need a screw of a particular length, you can always cut down a longer one. Or, you can use an all-thread rod which is a long machine screw without a head on it. Allthread is sold in one to six foot lengths. You secure the materials using

Metal or Plastic?
Go into any hardware store and the vast bulk of hardware fasteners are made of zinc plated steel. These are made to resist (but not prevent) rust. Their main benefit is that they are affordable, even in small quantities. There are other materials used in

68

SERVO 10.2007

nuts on both ends. Apart from making your own custom-length screws, all-thread is good for making shafts and linear motion actuators. The myriad of sizing choices can be confusing for those new to the art and science of hardware fasteners. Screws, nuts, washers, and other hardware is available in either of two sizing structures: metric or standard. Metric sizing is self-explanatory, and the hardware is expressed in millimeter lengths. Standard, or SAE, uses a number classification system in which the smaller the number, the smaller the size. For machine screws and nuts, and for both metric and SAE, the fastener is denoted by diameter and thread pitch. For example, a fastener with a thread size of 6-32 has a diameter referred to as #6, with 32 threads per inch. Diameters under 1/4 are indicated as a # (number) size; diameters 1/4 and larger are usually indicated as a fractional measurement 3/8, 7/16, and so on. The pitch (number of threads per inch) can be either coarse or fine for standard fasteners. Therefore, not all #6 fasteners have 32 threads to the inch. This is typical for #10 screws and nuts, which you can often find at the hardware store either with both 24- and 32threads per inch. They cannot be mixed. Metric fasteners are a bit different. Screw sizes are defined by metric diameter, and the thread pitch is the number of threads per millimeter. In the case of a machine screw, for example, M4 x 0.7 x 10 means the screw is 4 mm in diameter, has a pitch of 0.70 threads per millimeter, and has a length of 10 mm. (The standard pitch is typically omitted so in this example, you would see it referred to as a 10 mm long M4 screw.) Screws differ in the shape and size of the head (the part you use with the screwdriver), and then theres the type of driver used with the screw. The three most common are: slotted, for a flatbladed screwdriver; Philips, for a crossshaped screwdriver; and combination, where you can use either a flat-bladed or Philips screwdriver. Additional specialty types, such as Torx and hex socket, provide for more grip when tightening the screw, but require specialty driver bits. The shape of the screw head great-

ly contributes to the amount of torque that can be applied to the screw when tightening it. Round, pan, and flat head screws are by far the most common, and they tend to be the least expensive. Pan. Good general use. Round. Taller head provides greater depth for screwdriver bit. Flat (or countersunk). Used when head must be flush with the materials surface. Oval. Often used as a substitute for flat head screws, but used when the head requires extra depth. The top of the oval head is semi-rounded. Fillister. Extra deep head for very high torque. The top of the head is rounded. Hex bolt. Uses no slot, and requires a wrench to tighten. Used in highest torque applications.

Taking Stock of Metal Rivets


If bridges, buildings, and airplanes can be assembled using rivets, certainly robots can too. A rivet is a metal rod with a rounded head on one end. The straight portion of the rivet is inserted into the holes of the materials to be fastened together. With the pieces positioned, the straight portion of the rivet is deformed to create a second head. The two heads on either end keep the materials together, while the body of the rivet swells into the clearance holes to really make everything snug. Heavy-duty steel construction uses hot rivets that are pounded into shape with a jack-hammer. For small robots, the Pop or blind rivet is the more common form of rivet construction. These use specially-made rivets and a riveting tool, and are constructed using a soft sheath metal surrounding a nail-like center post. The rivet is first inserted and locked into place into the tool. The center post is pushed through the materials to be joined. Squeezing the handle of the rivet tool mushrooms the two ends of the metal sheath, creating a firm fastened

joint. The center post then breaks off, leaving only the mushroomed sheath. Blind rivets come in various sizes and lengths. You choose the length of the rivet based on the thickness of the materials to be joined. Bigger diameter rivets are used when you need extra holding power. Blind rivets are easy to use, but their main disadvantage is that they restrict disassembly. If you need to take things apart, you have to drill out the rivet, thus destroying it and possibly enlarging the mounting holes. A similar idea but not as permanent is the plastic push rivet. These are constructed out of plastic (obviously!), using a head on one end and a bifurcated or pronged shank on the other. To use, you press the parts of the shank together, and push through the holes of the material you wish to join. Assuming the correct length of rivet, the prongs spread out on the other end of the material, locking things into place. To work properly, the length of the rivet must precisely match the thickness of the materials being joined. If the rivet is too short, the prongs would spread out and the rivet will not lock into position. If the rivet is too long, the materials wont be firmly joined. Another option in plastic rivets is the screw type. These can be either permanent or non-permanent. Screw rivets are single piece, and combine a screw with an expanding plastic outer sheath. The rivet holds the materials together using the compression of the sheath. These types of fasteners are popular in car interiors and other applications where you dont have access to the back side of the material.

Other Fasteners You Can Use


Another useful permanent but easy-to-use construction technique is the tie and base clamp. These are normally used in wire management applications, where you tie up a bunch of wires to keep things need and clean. The tie grabs and holds all the wires together. The tie goes through the clamp, which may be stuck, glued, or fastened to some base. In our case, the base of the body or frame of the robot. Most clamps and ties are made SERVO 10.2007

69

Fuller Metric Parts www.fullermetric.com


Metric fasteners; all sizes and styles, including pins, threaded spacers, and socket head screws. Check out their tech info pages.

ITW Fastex www.itw-fastex.com


Various types of plastic fasteners, including plastic rivets.

Maryland Metrics www.mdmetric.com


Something of a one-stop-shop, Maryland Metrics carries bearings, linear bearings, fasteners, rods, gears, pneumatics, more.

McFeelys Square Drive Screws www.mcfeelys.com


Atlantic Fasteners carries fasteners in tens of thousands of varieties.

Fasteners, tools, adhesives. Check out the technical information about screws.

of durable nylon. The larger clamps and ties can be used to hold things down like motors and even wheels and wheel shafts. Select a larger size tie for the bigger stuff; a 1/8 thick by 1/4 wide nylon tie can hold 50 or more pounds of weight. Slip the loose end of the tie through a base clamp, then secure the clamp to the robot. Most base clamps come with a self-adhesive that is acceptable for very light weight applications. For a more secure construction, I advise applying the base using epoxy or a couple of hardware screws.

Barnhill Bolt Co.,Inc. www.barnhillbolt.com


Fasteners for all occasions, including all-thread, threaded couplers, thumb screws, roll pins, rings, retailer, and the usual nuts, bolts, and washers. In zinc, steel, stainless, brass, nylon. Metric and standard.

Micro Fasteners www.microfasteners.com


Fasteners (machine screws, nuts, lock washers, rivets, etc.) predominately in petite sizes. US and metric threads.

Micro Plastics, Inc. www.microplastics.com


A major manufacturer and seller of plastic fasteners, including clips, cable ties, hose clamps, plastic stand-offs, panel fasteners, whole plugs, threaded rod, and the usual screws, nuts, and washers. Standard or metric sizes.

Bolt Depot www.boltdepot.com


Bolt Depot carries wood screws, sheet metal screws, machine screws, hex bolts, carriage bolts, lag bolts, socket head cap screws, nuts, and washers standard and metric sizes. Sales by individual pieces or small quantity boxes.

Sources
Aarons General Store www.aaronsgeneralstore.com
Portal to a number of online specialty fastener stores. The machine screws website sells Phillips, slotted, hex, screws, bolts, SAE washers and nuts. Steel and stainless steel industrial fasteners.

MSC Fasteners www.mscfasteners.com


Fasteners: body washers, button head, socket cap screws, lag screws, carriage bolts, levis pins, cotter pins, drive screws, flat head socket cap screws, hex head cap bolts, more.

Fastenal Company www.fastenal.com


Fasteners, as well as industrial components and parts (casters, etc.). Local outlets in many US states.

Small Parts, Inc. www.smallparts.com


Variety of components including a large inventory of fasteners. SV

Atlantic Fasteners www.atlanticfasteners.com


Fasteners in tens of thousands of varieties, with pictures for your convenience. A downloadable catalog in Adobe Acrobat PDF is available.

Fastener-Express www.fastener-express.com
Fastener assortments, socket screws, metric fasteners, aluminum fasteners, servo and flange screws, machine screws, sheet metal screws, nuts, washers, and nylon fasteners.

CONTACT THE AUTHOR


Gordon McComb can be reached via email at robots@robotoid.com

70

SERVO 10.2007

Founding Sponsor

www.robodevelopment.com
Gold Sponsors

Corporate Sponsors & Exhibitors

The International Technical Design and Development Event for the Personal, Service and Mobile Robotics Industry

October 25-26, 2007 San Jose McEnery Convention Center San Jose, CA
The RoboDevelopment Conference & Exposition is the industrys rst event focused on the technical design and development of commercial robotic products. This unique and unprecedented event will draw over 1,000 robotics industry personnel from across the globe and will feature:
Q
Breakfast Keynote Sponsors

Q Q

Q Q Q

Keynote presentations by Tandy Trower, General Manager, Microsoft Robotics Group; Paolo Pirjanian, President and CEO, Evolution Robotics; Lloyd Spencer, CEO, Coroware; and Dan Kara, President, Robotics Trends Over 30 technical sessions delivered by leading robotics and development professionals Three conference tracks including Design, Development and Standards, Tools and Platforms, and Enabling Technology Bonus Microsoft Robotics Studio Development Track Robotics Evening Network Reception Expo Hall featuring products, tools and technology from around the world

Premier Media Co-Sponsor

Media Co-Sponsors

REGISTER TODAY AT www.robodevelopment.com or call 800-305-0634


Analysts, Associations & Academic Co-Sponsors

SPECIAL EXTENSION: EXTENSION: SPECIAL Register by by October October 5th 5th Register and Save Save $200 $200 and

Produced by:

// castling bonuses B8 castleRates[]={-40,-35,-30,0,5}; //center weighting array to make pieces prefer //the center of the board during the rating routine B8 center[]={0,0,1,2,3,3,2,1,0,0}; //directions: orthogonal, diagonal, and left/right from orthogonal for knight moves B8 directions[]={-1,1,-10,10,-11,-9,11,9,10,-10,1,1}; //direction pointers for each piece (only really for bishop rook and queen B8 dirFrom[]={0,0,0,4,0,0}; B8 dirTo[]={0,0,0,8,4,8}; //Good moves from the current search are stored in this array //so we can recognize them while searching and make sure they are tested first

LESSONS FROM THE LABORATORY


by James Isom

A bi-month column foly r kids!

NXT Packbot
-Robots Packbot is well known to anyone interested in robotics. It has been widely used for surveillance and reconnaissance purposes by both the military and law enforcement. Our friend Brian

Davis was inspired by its robust design to make a version using the NXT. I built one based on some pictures Brian sent me and the beast will climb over just about anything it can get its treads on. Brian

suggested I share it, so over the next several articles will be the steps to make and program your very own NXT Packbot. This time around well focus on the core portion of the chassis.

STEP 1:
Parts:

STEP 2:
Parts:

STEP 3:

Parts:

STEP 4:

STEP 5:

Parts:

72

SERVO 10.2007

STEP 6:

Parts:

STEP 7:

Parts:

STEP 8:

STEP 9:

Parts:

STEP 10:

Parts:

STEP 11:

Parts:

STEP 12:

Parts:

STEP 13:

Parts:

STEP 14:

Parts:

STEP 15:

STEP 16:
Parts:

STEP 17:

Parts:

SERVO 10.2007

73

STEP 18:

Parts:
Thats all for now. Sorry to leave you hanging like this, but itll be worth it in the long run. Well finish up in December. Happy building! SV

Electronic Parts & Supplies Since 1967

C Stamp Controller

www.c-stamp.com

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 Toll-Free: 1 (800) 985-AWIT

Plug in the p o

Help Adap ing you t tech to new nolo gy Adapt9S12C


w e

Standard Features: CAN, SPI, SCI RS232 10-bit A-to-D 32K or 128K Flash PWM Input Captures Output Compares www.technologicalarts.com 3V/5V Operation

I M S e r v ic e
P h o n e : 8 8 8 -4 5 1 -1 6 7 0 o r : 2 4 8 -4 8 6 -3 6 0 0

P .O . B o x 1 4 2 , N e w H u d s o n , M I 4 8 1 6 5

of

12 9S

D e sk to p C N C S o lu tio n s

i m s r v .c o m

Hobby Engineering
Robot Kits, Parts, Tools and Books
www.HobbyEngineering.com

For the finest in robots, parts, and services, go to www.servomagazine.com and click on Robo-Links.

74

SERVO 10.2007

The SERVO Webstore


Attention Subscribers ask about your discount on prices marked with an *
by Karl Williams

Insectronics

This complete project book delivers all the stepby-step plans you need to construct your own six-legged insect-like robot that walks and actually responds to its environment. Using inexpensive off-the-shelf parts hobbyists can build a better bug and at the same time have loads of fun honing their knowledge of mechanical construction, programming, microcontroller use, and artificial intelligence. $19.95

This book looks at 30 different robot designs all based on the same chassis, and provides indepth information on the inspiration and the technology that went into build! ing each of them. NEW Each robot is featured in 6-8 pages providing readers with a solid understanding of how the robot was conceived and built. There are sketches, interim drawings, and process shots for each robot. $39.95

by Vince Wilczynski / Stephanie Slezycki

FIRST Robots: Aim High

123 Robotics Experiments for the Evil Genius


If you enjoy tinkering in your workshop and have a fascination for robotics, youll have hours of fun working through the 123 experiments found in this innovative project book. More than just an enjoyable way to spend time, these exciting experiments also provide a solid grounding in robotics, electronics, and programming. Each experiment builds on the skills acquired in those before it so you develop a hands-on, nuts-and-bolts understanding of robotics from the ground up. $25.00

by Myke Predko

The fourth edition of this inventioninspiring engineering resource covers the past, present, and future of mechanisms and mechanical devices. Youll find drawings and descriptions of more than 2,000 components that have proven themselves over time and can be incorporated into the very latest mechanical, electromechanical, and mechatronic products and systems. Overviews of robotics, rapid prototyping, MEMS, and nanotechnology, along with tutorial chapters on the basics of mechanisms and motion control, will bring you up-to-speed quickly on these cutting-edge topics. $89.95

by Neil Sclater / Nicholas Chironis

Mechanisms and Mechanical Devices Sourcebook

Robot Builders Sourcebook


Fascinated by the world of robotics but dont know how to tap into the incredible amount of information available on the subject? Clueless as to locating specific information on robotics? Want the names, addresses, phone numbers, and websites of companies that can supply the exact part, plan, kit, building material, programming language, operating system, computer system, or publication youve been searching for? Turn to Robot Builders Sourcebook a unique clearinghouse of information that will open 2,500+ new doors and spark almost as many new ideas. $24.95

by Gordon McComb

If you want your robot to have more brains than microcontrollers can deliver if you want a truly intelligent, high-capability robot everything you need is right here. Linux Robotics gives you step-by-step directions for "Zeppo," a super-smart, single-boardpowered robot that can be built by any hobbyist. You also get complete instructions for incorporating Linux single boards into your own unique robotic designs. No programming experience is required. This book includes access to all the downloadable programs you need, plus complete training in doing original programming. $34.95

by D. Jay Newman

Linux Robotics

CNC Robotics gives you step-by-step, illustrated directions for designing, constructing, and testing a fully functional CNC robot that saves you 80 percent of the price of an off-the-shelf bot and that can be customized to suit your purposes exactly, because you designed it. Written by an accomplished workshop bot designer/builder, this book gives you everything you need. $34.95 We accept VISA, MC, AMEX, and DISCOVER Prices do not include shipping and may be subject to change.

by Geoff Williams

CNC Robotics

SERVO 10.2007

75

To order call 1-800-783-4624


Building Robots with LEGO Mindstorms NXT
by Mario Ferrari, Guilio Ferrari

! NEW 7 0 N U J
The Ultimate Tool for MINDSTORMS Maniacs, the new MINDSTORMS kit has been updated to include a programming brick, USB cable, RJ11-like cables, motors, and sensors. This book updates the robotics information to be compatible with the new set and to show how sound, sight, touch, and distance issues are now dealt with. $39.95

NEED MORE INFO? Go where SERVE goes!


The online store @ www.ser v omagazine .com
Robot Builders Bonanza Third Edition

BasicX and Robotics


This book is written around the wheeled robot called the Mouse. The Mouse is manufactured by Robodyssey Systems. This exciting company based in Trenton, NJ has created an entire fleet of high-quality, intelligently designed robots to satisfy the curiosity of the hobbyist as well as the educational needs of the classroom. Unlike many robotic toys, the Mouse does not operate with a remote control (although you can program it do so!). $44.95*

by Chris Odom

Everybodys favorite amateur robotics book is bolder and better than ever and now features the fields grand master Myke Predko as the new author! Author duo McComb and Predko bring their expertise to this fully-illustrated robotics bible to enhance the already incomparable content on how to build and have a universe of fun with robots. $27.95

by Gordon McComb / Myke Predko

Take This Stuff and Hack It!


Transform common household items into really cool stuff. You don't need to be an electronics genius to get started turning everyday items into high-performing wonders. With how-to guru Dave Prochnow's step-by-step directions and fully illustrated plans, even beginners can hack their way to a high-tech home, cooler toys, and less yard work. Certain to fire your imagination and start you plotting new, original, and even more creative wonders you can make from ordinary household items, Take This Stuff and Hack It! is the perfect gift for your inner inventor. $27.95

by Dave Prochnow

Great ! a Gift Ide ! $19.95

From HomoSapien to RoboSapien

For men and women

SERVO Magazine T-Shirts

Before R2D2 there was R1D1

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.

76

SERVO 10.2007

To order call 1-800-783-4624


Or order online www.servomagazine.com
NEW! THE SERVO STORE NOW OFFERS DVDS!

The Day the Earth Stood Still


An alien (Klaatu) with his mighty robot (Gort) land their spacecraft on Cold War-era Earth just after the end of World War II. They bring an important message to the planet that Klaatu wishes to tell to representatives of all nations. Directed by: Robert Wise Actors: Michael Rennie, Patricia Neal Run Time: 92 minutes $14.95

In a cyberpunk vision of the future, man has developed the technology to create replicants, human clones used to serve in the colonies outside Earth but with fixed lifespans. In Los Angeles, 2019, Deckard is a Blade Runner, a cop who specializes in terminating replicants. Directed by: Ridley Scott Rated: R Violence $19.95

Blade Runner (The Directors Cut) (1982)

A starship crew goes to investigate the silence of a planets colony only to find two survivors and a deadly secret that one of them has. Dr. Morbius and his daughter Altaira have somehow survived a hideous monster which roams the planet. Directed by: Fred M. Wilcox Run Time: 98 minutes $26.95

Forbidden Planet: 50th Anniversary Edition

BACK ROOM SPECIALS

The Official Robosapien Hacker's Guide


The Robosapien robot was one of the most popular hobbyist gifts of the 2004 holiday season, selling approximately 1.5 million units at major retail outlets. The brief manual accompanying the robot covered only basic movements and maneuvers the robot's real power and potential remain undiscovered by most owners until now! This timely book covers all the possible design additions, programming possibilities, and "hacks" not found any place else. $24.95 Sale Price $14.95 Pub date: August 17, 2005

by Dave Prochnow

Concise Encyclopedia of Robotics


Written by anaward-winning electronics author, the Concise Encyclopedia of Robotics delivers 400 up-to-date, easy-to-read definitions that make even complex concepts understandable. Over 150 illustrations make the information accessible at a glance and extensive cross-referencing and a comprehensive bibliography facilitate further research. $19.95 Sale Price $11.95 Pub date: November 12, 2002

by Stan Gibilisco

by Edwin Wise YOU DON'T NEED ARTIFICIAL INTELLIGENCE TO LEARN ROBOTICS! Now anyone with an interest in robotics can gain a deeper understanding without formal training, unlimited time, or a genius IQ. In Robotics Demystified, expert robot builder and author Edwin Wise provides an effective and totally painless way to learn about the technologies used to build robots! $19.95 Sale Price $13.95 Pub Date October 20, 2004

Robotics Demystified

H-racer-and-Hydrogen-station

SERVO'S CUSTOM EMBROIDERED HAT

With this kit, you now can see and feel the future of energy generation in your own hands!
This is one good looking hat, with its stone washed blue cap and bright yellow/gold stitching. There's no better way to show everyone that you're well endowed with a bigger - than - average brain then by proudly displaying your affiliation with SERVO Magazine. $ 14.95* Recently named as one of the Best Inventions of 2006 by Time Magazine, the H-racer is now the best selling fuel cell product in the world. The H-racer is a micro-version of what engineers and scientists have been dreaming about for real cars: combining hydrogen with oxygen to generate a DC current to power an electric motor. Unlike a gas-powered car engine, the only byproducts of this electrochemical process are electricity, heat, and pure water. With the H-racer, you can witness the power of new energy technology in the palm of your hand. Horizon has created this unique, patented miniature fuel-cell car and hydrogen refueling station. All you need to do is add water. Only $115.00 plus S/H

SERVO 10.2007

77

Scots wha hae!


by Pete Smith

y son (Andrew, age 14) and I have been involved in combat robotics for about nine years now. The BBC Robot Wars TV series was very popular back in our native Scotland in the late 90s and I had persuaded my company to sponsor me and a couple of colleagues in a local community college event. Andrew was very interested in the build process and greatly enjoyed it when we convincingly won the event. We had planned to take part in the next BBC series when our lives were all turned upside down. My employer decided to close the local R&D facility and asked me to move to Raleigh, NC. We arrived in early 2000 and once we were settled in, I started to look into what was happening in the sport locally. I found that there were two local competitions and the

Battlebots TV show was still running. I joined the local robotics club and found that a couple of members were interested in helping. We built a heavyweight spinner and competed at a few events without much success, but learned a lot in the process. In 2003, my son expressed an interest in taking part. Together, we assembled an armored RC car, CheepShot, for him to enter the 12 lb class. He lost both his first fights but still said it had been the best day of his life! Now that he was hooked, we decided to move into smaller bots, building much more sophisticated 12 and 30 lb robots.

Father and son. These were more successful, and we started winning some matches. Andrew got our first 30 lb championship at RCRAII in the autumn of 2004. Since then, we have won the 12 lb and 30 lb 2006 Nationals and most recently took first place in 12 lbers at the 2007 RoboGames. Andrew does most of the driving now (he is much better than his old Dad!) and recently did most of the design work on a new Beetle. His rapidly improving mechanical skills have also allowed him to take a much bigger share of the builds and also the repairs at events. You can follow our progress at www.teamrollingthunder.com. I have enjoyed competing with (and sometimes against!) Andrew and the sport has helped both of us get out and see America. Its really helped Andrew to build self-confidence and abilities which will stand him in good stead whether he continues in combat robots or moves on to other interests. SV

78

SERVO 10.2007

Then NOW
ROBOT POWER
b
ypical of all the list servers that the different robotics groups sponsor, the Seattle Robotics Societys server (SeattleRobotics@yahoogroups.com) draws some lively discussions on different facets of robotics. Some postings recently were about legs not wheels for robots and numerous solutions for power of rather large robots included everything from batteries to super caps to pulse jets. Generally, when we think of power for our robots, basic batteries come to mind first. We take power for granted as we design our robots, but, were it not for a reliable source of power, our best robotic creation will just stand there on our workbench and stare at us, albeit with lifeless eyes. Im going to focus on batteries, but I will discuss some other power sources, as well. Batteries have been around for almost a century, but there are sources that were used long before our modern day battery systems. Many of us saw the giant steam-powered robot crab-thing that was featured in the Will Smith movie Wild, Wild West that the villain used to crawl across the western desert of the late 1800s. Of course, this was a computer generated robot, but there are some actual working steam robots that I have mentioned in previous columns, such as the various CrabFu creations.

a n d
C

Early Spring-Powered Robot Automatons


Some of the earliest mechanical

devices built to resemble humans lithium polymer battery pack inside, we or animals were powered by water. must remember that these 18th The mechanical creations of the 18th and 19th century marvels were and 19th centuries are some of the powered by simple wound-up springs most elegant ever constructed. The and revolving cams. unique automatons built by Henri Maillardet and Jaquet-Droz such as The Scribe, The Draughtsman, and The Musician are powered by wound-up springs; the same power used for Lets jump back a millennium or most watches and clocks well into the two before the spring-wound and 20th century. steam creations to the earliest part of The Scribe was built in 1770 and is the electrical age and the chemical a child-formed automaton that dips a battery. Yes, people knew of electricity quill pen in ink and moves it over paper long ago, especially static electricity. to write. The Musician actually plays a However, it is the Baghdad Battery of working organ and the automatons 250 BC that is considered to be the first fingers depress each key to produce battery (see Figure 3). the notes. Its breast rises and falls to In 1936, several earthenware jars simulate breathing and the body, eyes, were excavated near Baghdad that and head sway and move in rhythm contained a copper cylinder with a with the music. sealed copper disk at the bottom. An The Scribe, Draughtsman, and iron rod was suspended inside the copMusician are still in working condition per cylinder and insulated by an asphalt and are on display in the Musee dArt stopper. The iron rod shows evidence et dHistore in Neuchatel, Switzerland, of corrosion (possibly by vinegar or where they are operated occasionally. similar fluid) and the construction and Henri Maillardets Philadelphia Doll, shown in FIGURE 1. The FIGURE 2. Cams in Philadelphia Doll. the dolls back. Figure 1 was built in 1811 and is on display at the Franklin Institute in Philadelphia. This automatons movements were controlled by a set of hand-filed cams driven by a spring-powered clockwork escapement shown in Figure 2. When we feel a bit of pride in our microcontroller based machines with a

The Age of the Battery

SERVO 10.2007

79

FIGURE 3. Baghdad battery.

insulation of the two metals shows definite evidence of the devices use as a battery. Their probable use was for silver plating and most likely delivered anywhere from a half volt to a volt each. Several were on display at the Baghdad State Museum and were stolen during the raids after Baghdads capture in the war.

Early Battery Experimenters


Weve all read about Benjamin Franklins experiments with electricity, especially the foolhardy experiment of flying a kite with a conductive string in a thunderstorm. Well, he didnt get fried by a lightning bolt and became fairly famous in American history. He did coin the term battery in 1748 for an array of electrically charged glass plates, more of what we would call
FIGURE 4. Voltaic pile.

today as a series-connected bank of capacitors. In the 1780s, Luigi Galvani delved deeper into this new electrical phenomenon and provided the basis for experimenters to come. The terms galvanic reaction and galvanometer were derived from his name. In 1800, Alessandro Volta made the first device to produce electricity in a practical manner the voltaic pile. It literally was a pile of alternating discs of zinc and copper separated by pieces of cardboard soaked in a brine solution (see Figure 4). This was the first battery to produce an electrical current (voltage) of over a volt or so. This wet cell battery could produce a reliable and steady voltage that experimenters later used to develop electric motors and other devices. The term volt was derived from his name. A volt is a unit of measure of electromotive force or difference in potential between two points in an electric field that requires one joule of energy to move a positive charge of one coulomb from the point of lower potential to the point of higher potential. Rather than trying to remember all of this and look up all these other terms, we just pull out our trusty multimeter and turn the dial to volts, place the two probes on the two different points, and read the potential on the LCD screen. A hundred years ago, experimenters used a galvanometer housed in a fancy wood case to determine voltage; its a piece of cake these days. Many types of battery technologies were developed, both in the wet cell types that we still use today as car batteries, and electrolytes that were in paste form. In 1866, a French engineer, Georges Leclanche developed the carbon-zinc battery later referred to as the Leclanche Cell. Many improvements followed in this design, and it gradually evolved to the familiar 1-1/2 volt dry cell flashlight battery that some of us may remember from the 60s and earlier. This cell used a paste of manganese dioxide in a zinc cylinder with a positive electrode carbon rod down the center. These cells were produced in many variations, the first being the familiar D size. Many farms

of the 50s and earlier did not have electricity and used battery-powered radios for entertainment. Since these were the days before low voltage transistors, huge battery packs were used that contained 60 D or C sized cells to produce 90 volts for the B voltage required for the plates of the tubes, and four to eight larger cells in series for the A voltage for the tubes filaments. There were even 510 volt batteries that photographers used for strobe lamps before transistor switchers allowed the use of a few dry cells to produce the same voltage.

The Use of Transistors Brings About Design Changes


The advent of transistors changed the entire battery industry and certainly made a great impact on mobile robot designs. The common nine volt battery was developed that virtually all consumer transistorized devices began to incorporate in their designs, along with a few six and 12 volt configurations. Alkaline batteries soon took the place of traditional battery chemistries as consumers desired longer battery life and were willing to pay the premium price. Alkaline batteries are what is known as primary batteries not rechargeable. Their initial low cost is nice, but they end up costing a lot more when you toss the dead ones out. Once experimenter robots came to the marketplace, any robot larger than a pound seemed to eat an endless supply of alkaline AA cells. Robot experimenters needed a cheaper way to feed their creations and the machines that they bought ready-made.

Rechargeable Batteries
There is no way any serious robot experimentation could take place without the use of some sort of electrical source that was cheaply replenished. Rechargeable batteries take center stage as a mobile robot power source, even with the cheaper fuel cells

80

SERVO 10.2007

becoming available to the experimenter. Lets review whats available.

Lead Acid and SLA Batteries


The lowly lead acid battery has been around for more than a century and still starts virtually all of our cars today. These batteries have the advantage of being readily available and are fairly cheap. They can deliver quite a bit of current, but are heavy and are filled with one of the most wicked fluids ever discovered sulfuric acid. If you dont think that spilled battery acid can do damage, try turning one over in your robot. I saw a single battery that accidentally got turned on its side that not only ate through a robots base plate, but ate a hole in the bottom of the van that the robot was sitting in. It also scarred the garage floor where the van was parked. Were talking aluminum and steel, here; just imagine what it can do to electronic circuit boards and your skin. Even the vapors released when charging can do a lot of damage. Enter the sealed lead acid battery, or SLA. These batteries have the advantage of not leaking acid even if upsidedown. Most use a gelled electrolyte that does not run out like a liquid even if the battery is punctured; a situation that happens in combat robotics. The term gel cell came from the gelatinous electrolyte makeup. These are the least expensive batteries for their current output, but designers find their weight excessive and small number of charge-discharge cycles limiting. Hawker and Power Sonic brands of SLA batteries seem to have developed a good following from the combat robotics community. Batteries never were developed to undergo the tremendous discharge strain that combat robotics places on them. Instead of the typical 20 hour discharge period that most batteries are rated at, a full-on robot battle can deplete a battery in as little as five or six minutes. Most experimenters dont demand such a current draw from their robots batteries as is found in combat robotics. One might be tempted to assume

that a 12V, 20 AH battery can deliver 20 amps at 12 volts for one hour, when, in fact, it is rated at one amp for 20 hours and maybe only five to six amps for one hour. The cell voltage is a bit over two volts, so six and 12 volt configurations are the most popular. A 12 volt battery typically has a no-load voltage of 13.2 volts when fully charged, and 10 volts when discharged and is replenished at around 14.7 volts. Battery chemistries vary widely and internal plate construction, venting, and other design characteristics can make seemingly similar batteries react very differently under similar charge and discharge situations. Always check the manufacturers spec sheets for charging and use requirements.

Nickel Cadmium Batteries


The nickel cadmium or NiCad battery has been around many years and has found its way into virtually every type of portable power tool in existence. The C or sub-C sizes are the most popular for power tools and experimenters have used these in all types of robots, many extracted from old power tools. Smaller robots have used the AA sizes built into packs. At 1.2 volts per cell, 10 cells make up a typical 12V NiCad battery pack. NiCads have the advantage of lower cost, even lower than many lead acid types. They have up to three times the energy density of SLA batteries, can be charged and discharged up to 1,000 times, and are easy to fit within a small robots internal cavities. They do lose up to 1% of their charge per day; they exhibit what is known as the memory effect when partially discharged and then re-charged; and they contain the toxic element cadmium which requires proper disposal. As always, go to the various manufacturers sites and learn more about these workhorses of the battery world.

battery is a newer technology that is finding its place in hand power tools, computers, and mobile robots. D cell NiMH packs usually exhibit a slightly lower peak current output capacity, but can source a steady 40 amps and spikes up to 100 amps. There are standard and fast chargers available for the typical robot hobbyist and the combat enthusiast, but it is never recommended to use a NiCad charger for charging NiMH batteries as they will probably suffer permanent damage. These batteries have the greatest power density of the more common types of rechargeable batteries; can be recharged over 300 times; have a fairly flat voltage discharge curve; have no memory effect; and are not toxic to waste dumps. They are fairly expensive though, and have an even greater level of self-discharge at up to 5% per day. They also require a bit of careful monitoring and maintenance.

Lithium Ion and Lithium Polymer Batteries


Lithium ion is even newer than the NiMH types and has a fairly high energy density if discharged at a moderate rate. This caveat does not always work well with most robot designs that sometimes draw an excessive amount of power if the robot, for instance, happens to traverse a thick carpet or lawn. The shelf life is fairly short at two years. Lithium Polymer batteries are the new kid on the block, having found their way into electrically-powered model aircraft in a big way. This battery technology was introduced in the late 1990s and stores less energy per pound than lithium ion but is a bit more flexible. Lithium polymer uses a gelled electrolyte rather than liquid. The individual cell voltage is about 4.2 volts, a bit too low for some five volt circuits. Robot experimenters have used these batteries for a few years now, however, several horror stories have arisen. Some of the less expensive brands of both types of lithium SERVO 10.2007

Nickel Metal Hydride Batteries


The Nickel Metal Hydride or NiMH

81

batteries have been known to explode and burn for no apparent reason. A lithium-fueled fire can be wicked. Laptop computers have caught fire and burned up cars; robots have incinerated themselves. It is recommended that experimenters remove the batteries from their robots when not in use for this reason. As always with my column, I do not and cannot cover the myriad of types of products or the many

manufacturers of products that I discuss. This certainly applies to the science and engineering aspects of batteries for which there are literally thousands of books on the subject and a million or more hits on the Internet. Battery technology involves too many aspects to cover in a single article. An omission by me of a type or brand is in no way a negative feeling by me about that brand anymore than an inclusion is indicative of my choices.

I am absolutely convinced, however, that a properly selected power source for your robot design is one of your most important decisions. Use this magazine and other reputable sources to learn from others just what power system is best for your design. SV

CONTACT THE AUTHOR


Tom Carroll can be reached via email at TWCarroll@aol.com.

Advertiser Index
Active Robots .............................................3 All Electronics Corp. ..........................21, 74 AP Circuits/e-pcb.com ............................50 AWIT ..........................................................74 Budget Robotics ......................................78 CrustCrawler .............................................19 Electronics123 ..........................................21 Futurlec ......................................................74 Hitec ..........................................................38 Hobby Engineering ..................................74 IMService ............................................21, 74 Jameco ..................................................2, 74 Lorax Works ........................................21, 74 Lynxmotion, Inc. .......................................13 Maker Faire ................................................51 Maxbotix ...................................................74 Maximum Robotics ............................66, 74 Net Media .................................................83 Parallax, Inc. ...............................Back Cover PCB Pool ..............................................42, 74 Pololu Robotics & Electronics ...........18, 74 Robo Development 2007 ........................71 Robotis Co. Ltd. .......................................23 RobotShop, Inc. .................................74, 82 Schmartboard .....................................21, 23 Solarbotics/HVW .....................................42 SORC ............................................................7 SPSU ...........................................................31 Technological Arts ...................................74 TORMACH .................................................12 Vantec .........................................................7 Yost Engineering ......................................30

82

SERVO 10.2007

You might also like