Servo Magazine 2007-12

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Servo Magazine 2007-12 as PDF for free.

More details

  • Words: 37,824
  • Pages: 84
Page 84 3:46 PM 11/6/2007 Cover.qxd

Vol. 5 No. 12

SERVO MAGAZINE

HERO • SERVOS • SPARE THE ROD, SPOIL THE BOT • TASK PRIMITIVES

December 2007

CoverInside.qxd

11/1/2007

3:10 PM

Page 2

We’re passive aggressive When it comes to passive products, we don’t pull any punches: we stock more major brands of passive components than any other major catalog distributor.* So whatever brands you need—

5

10

15

20

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

Jameco®

Digi-Key®

Mouser®

Newark®

AMP Astec Power Augat AVX Bourns Cherry Condor Power Corcom CTS Elco Connector Fox Electronics Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Power-One Teledyne Relays Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Corcom CTS Elco Connector Fox Electronics Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Power-One Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Condor Power Corcom Elco Connector Fox Electronics Int’l Rectifier Kemet Molex Panasonic Potter & Brumfield Teledyne Relays Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Corcom Elco Connector Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Vishay Wakefield

Free shipping on these and 83 other major brands. Call for details.

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

for even greater cost savings.

Order 24 hours a day, 7 days a week

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

Full Page.qxd

11/1/2007

3:16 PM

Page 3

SERVO 12.2007

3

TOC Dec07.qxd

11/5/2007

4:08 PM

Page 4

Columns 08

Robytes

10

GeerHead

14

Ask Mr. Roboto

60

Lessons From The Lab

by Jeff Eckert

Stimulating Robot Tidbits by David Geer

Tortuga — From Isle of Pirates to Underwater Spy by Pete Miles

Your Problems Solved Here by James Isom

NXT Packbot: Part 2

68

Robotics Resources by Gordon McComb

Using Lasers With Your Robots

76

Appetizer

79

Then and Now

by Daniel Albert

PAGE 79

Transitioning Sequencer Using Static Frames for Biped Control by Tom Carroll

Servos

Departments 06

Mind/Iron

07

Bio-Feedback

18

Events Calendar

19

Robotics Showcase

20

New Products

66

Robo-Links

73

SERVO Webstore

82

Advertiser’s Index

4

SERVO 12.2007

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

TOC Dec07.qxd

11/5/2007

4:08 PM

Page 5

12.2007 VOL. 5 NO. 12

PAGE 14

Features & Projects 31

Votrax SC-01 to SpeakJet Translator

46

by Robert Doerr Break the language barrior with your HERO robot.

36 43

by Alexander Skoglung and Boyko Lliev Using imitation to teach robots isn’t as straightforward as you’d think, but it can be done.

GPS by Michael Simpson Part 3: Parse positional data from the NEMA protocol.

Spare the Rod ... Spoil the Bot by Karla Conn Rewards and punishments can serve as fundamental motivations for your robot to learn by.

Programming by Demonstrating Robots Task Primitives

51

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

ENTER WITH CAUTION! 22 The Combat Zone SERVO 12.2007

5

Mind-Feed Dec07.qxd

11/5/2007

4:34 PM

Page 6

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 Œ

True Autonomy When roboticists talk of autonomy, it’s generally understood that this elusive goal will be achieved through advances in computational methods, such as artificial intelligence algorithms, more powerful processors, and increasingly powerful and affordable sensors. However, achieving truly autonomous robots will require more than simple computational evolution. It’s a misnomer to call a robot that can navigate a room without human assistance ‘autonomous’ when the duration of autonomy is limited to perhaps a half hour because of battery life. Other than simplistic stimulus-response BEAM robots (see Figure 1), the Mars rovers are perhaps the best examples of computationally and energetic autonomous robots. However, even the rovers are controlled remotely by scientists at NASA. The advances in battery technology, fuel cells, and power

management chips haven’t kept pace with computational advances in energy management, such as behavior modification. Unfortunately, behavior tactics such as resting, altering speed or path to reflect remaining energy stores, and shutting down unnecessary sensors can only go so far in extending the operating time of a robot. New sources of energy must be identified and perfected. Although there is ample commercial pressure to develop higher capacity energy sources and more effective energy management devices, there are also significant incentives from the military. According to the DOD, soldiers of the near future are expected to be assisted by electronic devices ranging from audio, video, and data communications equipment, night vision gear, and wearable computers, to exoskeletons. And these devices will require an unprecedented amount of portable power. In response to this need, the Department of Defense Research and

FIGURE 1. Solar powered light-seeking BEAM robot.

Subscriptions Inside US 1-877-525-2539 Outside US 1-818-487-4545 P.O. Box 15277 North Hollywood, CA 91615 PUBLISHER Larry Lemieux [email protected] ASSOCIATE PUBLISHER/ VP OF SALES/MARKETING Robin Lemieux [email protected] EDITOR Bryan Bergeron [email protected] CONTRIBUTING EDITORS Jeff Eckert Tom Carroll Gordon McComb David Geer Pete Miles R. Steven Rainwater Michael Simpson Kevin Berry Fred Eady Robert Doerr Alexander Skoglund Boyko Lliev Karla Conn Dan Albert James Baker Chad New Paul Ventimiglia James Isom CIRCULATION DIRECTOR Tracy Kerley [email protected] MARKETING COORDINATOR WEBSTORE Brian Kirkpatrick [email protected] WEB CONTENT Michael Kaudze [email protected] PRODUCTION/GRAPHICS Shannon Lemieux Michele Durant ADMINISTRATIVE ASSISTANT Debbie Stauffacher

Mind/Iron Continued

6

SERVO 12.2007

Copyright 2007 by T & L Publications, Inc. All Rights Reserved All advertising is subject to publisher’s 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.

Mind-Feed Dec07.qxd

11/5/2007

4:35 PM

Page 7

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

prize/topic.html#7 for details on the competition. Even if you don't take part in the competition, consider the energy autonomy of your next robot design. While you probably don't have access to Sterling isotope thermal generators or other esoteric energy sources available to military robotics designers, there are numerous promising technologies that you are free to explore. One that I've followed for several years is illustrated by the predatory robot EcoBot II, developed by the University of the West of England in Bristol. The EcoBot II uses a microbial fuel cell to generate Resources electricity from flies. Bacteria in the microbial fuel cells • EcoBot II — Self-sustaining killer robot creates a stink. metabolize sugars in the flies, releasing electrons in the New Scientist, September 9, 2004. process. The robot isn't yet up to the capabilities of the www.newscientist.com/article.ns?id=dn6366 Mr. Fusion Home Energy Reactor-equipped De Lorean • EcoBot II in action. www.youtube.com/watch?v=1Nuw654pFbU featured in “Back to the Future” — top speed is 10 centimeters per hour. However, the EcoBot II can travel • BEAM Robots. www.solarbotics.net; www.solarbotics.com; for five days on just eight flies. If you have an aversion www.geocities.com/SouthBeach/6897/beam2.html to flies and other decaying organic matter, you can try • How Fuel Cells Work. How Stuff Works. your hand at extending the basic BEAM robots, www.howstuffworks.com/fuel-cell.htm available from several vendors featured in SERVO. SV

Dear SERVO: In reference to the September ‘07 Robytes ... Holy cow! $69 million for an RC airplane? Wow, where can I sign up? I think as a tax payer I should feel screwed! Who am I? I used to fly RC planes before I became a pilot. I’ve built a four seat airplane, and been president of an EAA (experimental aircraft association) chapter. I know a bit about what airplanes are, and what they cost. One of the members of our EAA chapter built a Lancair 4, which would be a 300 mile per hour airplane. He went top shelf on it, and spent about $400,000 on it. Sure, it only has half the payload of the MQ-9 (1,550 lbs), but it seems like for not a lot more, one could build it bigger, and get the payload. Looking at an Epic Dynasty, it has 3,300 lbs payload, and is priced under $2 million; it’s capable of 340 knots. The specs might be misleading with the empty and max takeoff weights but that is with an interior, and equipment for people. Strip all that out and you can have a UAV. Basically, the remote control is some extra wiring to the auto pilot servos. I am to believe that is worth 50 some million dollars? So, maybe someone might say I am comparing “toy” airplanes to some commercial aircraft. How about a Boeing 737? Well, right from Boeing, ready to fly, they list at $49 million. I guess a $20 million conversion would be reasonable (probably not). But this aircraft is capable of hauling over 30,000 lbs (about 10X the MQ-9). It can also cruise at over 500 mph.

I am very sad to hear the way things are going in the UAV market. People claim the UAVs are supposed to be cheaper and safer, but it still takes a crew of two to fly this MQ-9, where an F-35A lightning II will only cost about $50 million and takes a crew of one. It’s capable of carrying 18,000 lbs and flying past mach 1 in a stealth mode carrying smart weapons. This manned aircraft is clearly a more useful aircraft. Tom Brusehaver Dallas,TX

SERVO 12.2007

7

Robytes.qxd

11/1/2007

11:16 AM

Page 8

Robytes Fooling Virtual Robots

by Jeff Eckert

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

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

Concept Car Includes Companion Bot

Fortune Teller in a Bowl

Nissan’s Pivo 2 concept car. Photo courtesy of Nissan Motor Company.

In this image, it appears that the dark stripes on top are darker than the white stripes on the front of the object. But a mask placed over the image reveals that the “white” stripes in the foreground are exactly the same as the “grey” ones on top. Thanks to Beau Lotto/UCL.

A highly abstract but interesting concept has emerged from the University College London (www.ucl.ac.uk), where Dr. Beau Lotto and other researchers have been experimenting with “virtual robots” to understand why humans can be fooled by visual illusions. Some folks at the UCL Institute of Ophthalmology trained artificial neural networks (essentially, virtual toy robots with tiny virtual brains) to “see” correctly (i.e., as we do). They trained the virtual critters to predict surface reflectance in a variety of 3D scenes such as found in nature. When the bots examined a range of grey scale illusions, they often made the same mistakes that humans do. Among the study’s conclusions is that “it is likely that illusions must be experienced by all visual animals regardless of their particular neural machin-

8

SERVO 12.2007

At the latest Tokyo Motor Show, Nissan (www.nissanusa.com) unveiled the Pivo 2 electric concept car, evolved from the original three-seater that first appeared in 2005. It is mechanically as strange as it looks, given that the wheels (each of which is powered by its own motor) can turn up to 90°, and the cabin can rotate 360°, so you can drive it forward, sideways, or backward and never need a reverse gear. It’s powered by lithium-ion batteries and uses “by-wire” control technologies rather than mechanical systems for braking and steering. But possibly the strangest feature is the “Robotic Agent” that rides with you everywhere you go. It’s basically a bobbling head, located near the steering wheel, that communicates with you in either English or Japanese. Aimed at making “every journey less stressful,” the Agent speaks in a “cute electronic voice” and provides a link to everything from basic vehicle functions to searching for a parking spot. According to Nissan, the head can sense the driver’s mood by analyzing facial expressions (it has digital eyes and a microphone) and deliver preprogrammed phrases that might include “Relax, don’t worry,” “You’ve dripped Big Mac sauce into your lap,” and “Put away that gun.” At this point, the car is

The Swami Conversational Robot. Photo courtesy of Neiman Marcus.

Also too expensive for the commercial market but there anyway, is the Swami Conversational Robot, available from Neiman Marcus (www.nei manmarcus.com). This goes way beyond the old mechatronic gypsy fortune teller machines of penny arcade fame, although, peeping out from his glass dome, he does bear some resemblance to Zoltar. Under the control of a laptop running special AI software, this guy generates facial expressions using some 30 micromotors and can watch you via eye-mounted cameras. Apparently, you can teach him to recognize family members, have meaningful conversations with you, and answer questions intelligently. That’s probably more than the aforementioned family members can do, but the catch is that this thing costs more than my first house: $75,000.

Give ‘em the Bird for Christmas On a level that will allow it to fit your Christmas budget is Squawkers

Robytes.qxd

11/1/2007

11:17 AM

Page 9

Robytes

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

McCaw, recommended for children over 5 years and very lonely people of all ages. Widely available on the Internet for about $55, it talks, squawks, and is nearly as annoying as a real parrot. He can repeat any words spoken to him, give appropriate responses to preprogrammed commands, and learn new responses. Put him in dance mode, and he will sashay to whatever music you play or even provide his own music. In terms of mechanics, Squawkers can move his head, flap his wings, eat a cracker, and even give you a smooch when you touch his beak. Probably the best feature is that he goes to sleep when his eyes are covered or the room gets dark. You can see him at www.has bro.com or in your local toy store.

Robot Plays the Theremin

Lev the musical robot now performs with “thumpbot” friends. Shown with a Moog Etherwave instrument. Photo courtesy of www.moonmilk.com

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

completely electronic musical instruments and the first to require no physical contact with the “musician.” As far as I can verify, it was played only by human beings until about 2003, when Ranjit Bhatnagar built Lev specifically for that purpose. Lev, the product of a floor lamp, some metallic junk, and a few microprocessors, has been a solo act since then but is now accompanied by a few “thumpbots,” which provide a rhythmic background to the theremin’s notoriously unappealing sound. If you’re curious, a video of the band playing a tune that is said to be Gnarls Barkley’s “Crazy” (but sounds more like belly dance music) can be viewed at www.youtube.com/ watch?v=19RJEnNUg1I.

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

Biped Bot Responds to PS2 Controller

Mini Chopper Fights Fires

A special version of the MD4-200 is being evaluated for fire and rescue operations. Photo courtesy of Microdrones GmbH.

Most unmanned surveillance seems to be performed by fixed-wing aircraft these days, but the West Midlands Fire Service, over in Birmingham, U.K., is trying out a small chopper, which it has dubbed the Incident Support Imaging System (ISIS). The device doesn’t actually put out fires, but it does provide live video from above the incident scene and aids firefighters in planning an emergency response. Such incidents can also include general rescue operations, inspection of water supplies and gas cylinders, and so on. ISIS is actually a modified MD4-200 vertical takeoff and landing (VTOL) micro aerial vehicle (MAV) built by Microdrones GmbH (www.micro drones.com) over in Germany.

The new KT-X.

Closer to home, Dallas-based KumoTek (www.kumotek.com) is a builder of custom and standard bots for education, research, entertainment, and some industrial applications. (Kumo, in case you were wondering, is Japanese for “spider.”) The news there is the introduction of the model KT-X, billed as the first low-cost bipedal root platform that can be controlled via a wireless PS2 controller. The 13-in, 2.9-lb robot can walk, run, do somersaults, and stand up from a face-up or face-down position. KT-X has 17 degrees of freedom, is driven by a 60 MHz HV processor, and comes with 75+ preprogrammed motions. As of this writing, the unit is still under development, but it should be commercially available “within a few months.” SV

SERVO 12.2007

9

Geerhead.qxd

11/4/2007

6:32 PM

Page 10

by David Geer

Contact the author at [email protected]

Tortuga — From Isle of Pirates to Underwater Spy The Isle of Tortuga, Haiti — once a haven for pirates — lives on as the namesake for the University of Maryland Robotics Club’s submersible competition robot. Tortuga — the Club’s entry in the Association for Unmanned Vehicles and Systems International’s (AUVSI’s) annual Autonomous Underwater Vehicle (AUV) competition — first appeared in the yearly event in Autumn 2007. he competition is sponsored by the Office of Naval Research (ONR), as well as by AUVSI, according to a Robotics@Maryland academic paper, “Tortuga: Autonomous Underwater Vehicle,” authored by several club members and advisors. The competition “tasks” each robot with six challenges:

T

• Maintain a straight course and heading through the starting gate. • Locate the flashing “start” buoy.

• Ram that buoy “to free it.” • Locate the first “orange pipeline segment.” • Follow the orange pipeline until it meets a second flashing buoy, which it must also ram. • Follow two more pipelines, locate a sonar beacon, and follow it to the “treasure octagon.” Team members based the robot’s design and construction on the best possible completion of these tasks.

Tortuga was the first robot that the University of Maryland entered into the Association for Unmanned Vehicles and Systems International’s (AUVSI’s) annual Autonomous Underwater Vehicle (AUV) competition, according to Scott Watson, a University of Maryland student and Robotics Club member. This is a close-up, aft (tail, stern) angle view of Tortuga. The AUV is equipped with four Seabotix thrusters (three of four are visible) to control depth, pitch, yaw, and horizontal translation, according to students who crafted the submersible robot. Roll is statically stabilized with a careful distribution of foam, small weights, and putting heavy electronics (such as the batteries) at the bottom of the pressure hull, Watson notes. The AUV uses a MacMini to interface with all its sensors and motor controllers through USB ports.

10

SERVO 12.2007

Tortuga Design and Construction A serviceable aluminum chassis surrounds and supports Tortuga’s mechanics, as well as an 18.5” long by 8” diameter clear acrylic tube, which houses the watertight components. The team members selected the chassis design for ease of access to the robot’s functional parts, electronics, and other “innards” and attachments. The robot uses an inertial navigation system (INS) to establish its location and maintain its heading. The system is comprised of sensors, processors, and software. These enable the vehicle to establish and change location by adjusting its velocity. The INS includes the following hardware and software: 1) Three magnetometers (to measure the Earth’s magnetic field). 2) Three gyroscopes (to measure angular acceleration). 3) Three accelerometers (to measure Photos are courtesy of Scott Watson, University of Maryland student and Robotics Club member.

Geerhead.qxd

11/4/2007

6:33 PM

Page 11

GEERHEAD linear acceleration). 4) An inertial measurement unit (IMU) houses the aforementioned nine sensors. 5) Closed-loop controller software to process force vector equations. The combination of sensors and sensor data are relied on for navigation because GPS signals don’t travel underwater.

Attaining Objectives To get through the starting gate properly, Tortuga uses a combination of position confirmations from its forward camera and output from a nonlinear adaptive controller. A nonlinear adaptive controller takes sensor data as input and uses it to calculate the orientation (location, position) of the robot and how that is changing, according to Scott Watson, University of Maryland student and Robotics Club member. “It does some calculations and then determines how best to use the actuators available (thrusters, in our case) to do something desirable, like maintain heading, depth, pitch, roll, and velocity,” explains Watson. The nonlinear aspect means that the controller can take the many different forces acting on the robot into account, according to Watson. If the team could guarantee that only one force contributed to the robot moving up and down in the water and, similarly, that only one thruster was able to affect that up and down motion, then the robot would only need a linear controller, explains Watson. “But, in nature,” Watson says, “forces tend to constructively and destructively interfere with each other in a way that may not be determinable from the available sensors.” The adaptive aspect means the controller knows that the input (parameters) it receives from the sensors isn’t necessarily 100 percent accurate and that it is permitted to intelligently adjust those

This University of Maryland student and Robotics Club member Matt Bakalar is checking for air bubbles that might emanate from the watertight enclosure that protects the AUV’s electronics. Devastating leaks can come from the o-ring seals, as well as the wet-matable connectors drilled into the aluminum end caps of the pressure hull. If all goes well, the lead controller programmer will secure shell (SSH, a form of connection interface) into the MacMini to begin testing the robot’s stability under active control, according to Watson.

parameters, by use of its programming, according to Watson. “For example, it’s impossible to measure buoyancy or roll moments perfectly, but an adaptive controller will, in a sense, learn how to adjust these parameters to more successfully control the vehicle by depending on sensor measurements,” illustrates Watson. Next, we have buoy ramming. Buoy ramming sounds like fun

and, in this instance, it is a carefully calculated maneuver. The buoy is a flashing light housed in a watertight enclosure. The robot’s task is to locate this buoy and run directly into it to knock it loose from its mooring, according to Watson. “This demonstrates vehicle control, valid image processing, and

University of Maryland student and Robotics Club member Stepan Moskovchenko submerges the watertight pressure hull to watch for air bubbles and water accumulation beneath the electronics and batteries. “The first leak in the lifetime of the robot was discovered minutes earlier due to user error with the homemade underwater FireWire connector,” says Watson. The straps hold aluminum CNC’d end caps with piston style o-ring seals in place on an 8” diameter acrylic tube, Watson explains.

Three student team members check whether the inertial measurement unit (IMU) is level within the vehicle. While hanging from the team tent at the competition in San Diego, the students attempt to calibrate the internal magnetometer and tweak gains in the controller code. “The team uses a MEMSense Nano IMU with M i c ro - E l e c t ro - M e c h a n i c a l Systems (MEMS) technology. This affords a relatively low cost and lightweight solution for inertial measurements and to track the course of the robot,” says Watson.

SERVO 12.2007

11

Geerhead.qxd

11/4/2007

6:33 PM

Page 12

GEERHEAD UM students and Robotics Club members Stepan Moskovchenko [left] and Joe Gland [right] inspect the thruster and camera housing cables for damage after a competition-qualifying run that knocked the camera housing loose. The external frame, made of 80/20 tubing, performed one of its design functions by protecting all the electronics and cabling during the “jolt.” A little bit of rope and the team is ready to go straight back to testing code to get the robot back in the water for another run, Watson exclaims! UM students and Robotics Club members take a moment to pose behind the Autonomous Underwater Vehicle (AUV) they designed and built — in nine months — for the Association for Unmanned Vehicles and Systems International annual competition. The Maryland students finished 13th out of a field of 27 teams in this their first year, winning a $500 prize. “They are proud of their accomplishment and look forward to spending more time developing the artificial intelligence code and refining sensor systems to better compete with more experienced teams in 2008,” Watson says.

artificial intelligence,” explains Watson. The robot employs two Unibrain Fire-I cameras for object recognition. These cameras stream video via FireWire connection to the MacMini (1.83 GHz dual core, 2 GB RAM), which is the robot’s onboard computer. Image processing algorithms on the MacMini, written in C++, use the

OpenCV image processing library to identify competition objects like the buoy (and, of course, the orange pipelines it must follow), according to a Robotics@Maryland Tortuga academic paper. The artificial intelligence comes from the robot’s “higher level autonomy software” in the robot’s hardware brain. A gigabit Ethernet tether stretches the distance between Tortuga’s onboard MacMini computer and a computer on dry land. “We usually Robotics Club member Nathan Davidge waits at Reagan National Airport with the team’s AUV robot. All the electronics and parts for the AUV fit in the travel case on the seat to the right of Nathan. “Even at the airport, the student team was working on integrating a new binary protocol for more reliable communication to the motor controllers from MacMini,” says Watson.

12

SERVO 12.2007

communicate with the onboard computer over a shell session, that is, over the Linux console,” says Watson. This is especially useful during testing. To aid the robot in recognizing and following the pipelines, the team uses color filters to bring out the orange, according to Watson. “Then we run an edge detection algorithm that gives us a collection of points that belong to edges in the image. Finally, we feed these points into another algorithm called a Hough transform, which picks out straight lines from those edge points,” Watson continues. “Marker dropping” is another task in the AUVSI competition. In this case, the robot drops six inch by half inch red PVC pipe sections into target boxes as markers at two points in the competition. A weight in the PVC makes sure it drops, according to club members and students. Team members mount these PVC pipe sections inside Tortuga’s deployment tubes, which are fitted with permanent and electromagnets to hold and deploy the markers. When the robot energizes the electromagnet, it cancels the permanent magnet’s magnetic field, releasing the marker over its target. The team mounted the marker tubes next to the ventral video camera in order to minimize positioning error. The ventral camera is the one on Tortuga’s belly, specifically designated to watch for targets and for the orange pipelines, according to Watson. The robot uses sound to help it locate its “treasure” in the final task of the competition. A sonar, seated beneath the octagonal treasure target, creates the sounds. A three sensor hydrophone array on the robot’s side senses these underwater sounds like a single microphone. A series of microcontrollers and analog filters determine the frequency and time of arrival of the sounds to pinpoint the location of the sonar, according to Watson.

System Support A microcontroller network offloads low-level tasks from the MacMini and supports the robot. “For example,

Geerhead.qxd

11/4/2007

6:34 PM

Page 13

GEERHEAD collecting hundreds of voltage measurements from a sensor, averaging them together, and performing small calculations that the main computer can ask for without worrying about the electrical details of how it was done” is an optimization of the architecture, as Watson explains. A sensor PCB contains most of the microcontrollers and they have a parallel bus (8 bits wide) that coordinates information flow and job instructions.

Conclusion AUVSI held this year’s competition July 11-15 at the Space and Naval Warfare Systems Center TRANSDEC Facility in San Diego, CA. The University of Maryland expects to see Tortuga or its ‘offspring’ competing again next year. SV

RESOURCES Department of Electrical and Computer Engineering, A. James Clark School of Engineering, University of Maryland www.ece.umd.edu Robotics@Maryland Club — http://ram.umd.edu/trac Replacement thrusters — www.seabotix.com AUVSI — www.auvsi.org

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

+656*

+656*

+657*

6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV

6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV

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

SERVO 12.2007

13

MrRoboto.qxd

11/5/2007

3:58 PM

Page 14

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

[email protected]

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

by

Pete Miles

Q

. Do you know of any humanoid robot kits that cost less than a $1,000? I like the ROBONOVA and KHR-1 body designs with all of the motors and flexibility, but it costs way too much money for me. I was wondering if you happened to know of any cheaper robots out there. — Andy Kerns

Figure 1. I-Sobot.

Specification Height

A

. When it comes to fully articulated humanoid robots, the ROBONOVA (www.robonova.com) and the Kondo KHR-2HV (www.kondo-robot. com or visit www.trossenrobotics. com) can be purchased for around $1,000. The Kondo KHR-2HV is the next generation of the KHR-1 and is a little less expensive than the KHR-1. Since humanoid robots are becoming more popular, there are new robot Figure 2. RoboPhilo. designs coming out each year. A couple that I am aware of are the I-Sobot (www.iso botrobot.com) which costs around $300 and the RoboPhilo (www. robophilo.com) which costs about $500. I don’t have any personal experience with either of these two robots, but from what I can see I-Sobot

RoboPhilo

6.5 inches

13 inches

12 oz.

38 oz.

Weight Servos (degrees of freedom) Power

17

20

3 AAA NiMH

6V NiMH

Remote Control

Infrared

Infrared

Special Features

Built-in Gyro, Voice Recognition, Speaker, Pre-programmed Motions, Programmable

Pre-programmed Motions, Programmable

$299

~$500

Approximate Costs

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

14

SERVO 12.2007

from the videos on their websites, they are very impressive. The I-Sobot is currently available from several places, such as Amazon (www.amazon.com). The RoboPhilo kit should be available by December 2007. Table 1 shows a few basic specifications for these two robots. Another option to consider is the BRAT from Lynxmotion (www.lynx motion.com) which costs less than $300 for the basic kit. This is a very basic bipedal robot kit that has a total of six servos (three for each leg). It requires assembly and a connection with a PC to control the robot. If you add your own electronics and develop your own walking routines, the BRAT can become autonomous. For those people that want a challenging project, the BRAT is an inexpensive route to get started. All of the parts on the BRAT are interchangeable and expandable, so at a later time, the BRAT can be reconfigured with some additional parts to make a 17 or 19 degree of freedom robot. On the subject of reconfigurable robot kits, you might want to take a look at look at the Bioloid (www.tribotix. com) robotics kit. This is a very good general-purpose robot kit which allows you to build many different types of robots, such as dogs, spiders, six-servo walkers like the Lynxmotion BRAT, and even the big 17+ servo humanoid robots. The Bioloid robots use the Dynamixel servos, which are some of the most advanced robotics servos on the market. To be able to build a humanoid

MrRoboto.qxd

11/5/2007

3:59 PM

Page 15

robot, you would need the comprehensive kit, which has 18 servos, brackets, and a microcontroller for controlling the entire robot. The approximate $900 price is a bit higher than the robots previously discussed, but it has a lot of different projects and robot designs to build. There is a beginner set which consists of four servos, power supply, microcontroller, and construction brackets which costs about $350 that will help you to start learning how to control the servos and program the microcontroller. Both the BRAT and the Bioloid kits require assembly and knowledge about how to build and program robots. Developing walking routines on your own can be rather challenging. These kits are not recommended for those who want a fully functional robot right out of the box. It may take several days to weeks to get one of these robots to do the same things as the I-Sobot and the RoboPhilo.

Figure 3. Lynxmotion BRAT.

Figure 4. Bioloid humanoid configuration.

Figure 5. BASIC Stamp Logic Analyzer.

Figure 6. BASIC Stamp 2px24 mounted on the BASIC Stamp Logic Analyzer.

Q

. I have been searching the Internet for several months looking for an inexpensive logic analyzer. My main need is for something to analyze serial data between my laptop and various microcontrollers. I have seen prices range from $500 to over $3,000 for the different logic analyzers, and this is way outside my budget. Do you know of any low price logic analyzers? — Bill T. Salt Lake City, UT

+5V

A

+5V

Vdd RTCC

+5V RC.7 RC.6

10 KΩ

RC.5 RC.4

MCLR

OSC2

4 MHz

RC.2

SOUT

RC.1

SIN

RC.0 P0 RB.7

P1

RB.6

P2

RB.5

P3

Vss

BASIC STAMP LOGIC ANALYZER

OSC1

RC.3

SX28AC/DP

. It is amazing to see how much logic analyzers cost relative to oscilloscopes. One would think that with all of the digital electronics in use today, there would be dozens of low cost, budget logic analyzers available on the market. Several months ago, I stumbled across a very nice and inexpensive logic analyzer from Parallax (www. parallax.com) called the BASIC Stamp Logic Analyzer (part #30010). Check out Figure 5. It is a very impressive little tool for $79. With a sampling rate of 2Ms/s on 16 I/O lines, it should be able to accurately monitor all of your serial communication data with 0.5 µs resolution. It will store a minimum of 1 million data points to well over 30 million data

RES Vdd P15 P14 P13 P12

RB.4

P4

RA.3

RB.3

P5

RA.2

RB.2

P6

P9

RA.1

RB.1

P7

P8

RA.0

Vss

P11 P10

RB.0

EXAMPLE MICROCONTROLLER

BASIC STAMP LOGIC ANALYZER (Basic Stamp not required)

Figure 7. BASIC Stamp Logic Analyzer wiring example. SERVO 12.2007

15

MrRoboto.qxd

11/6/2007

2:24 PM

Page 16

Figure 8. BASIC Stamp Logic Analyzer mounted on a Parallax Professional Development Board and connected to an SX28 microcontroller.

Figure 10. Asynchronous serial data decoder. The one requirement to use the BASIC Stamp Logic Analyzer is that your computer must have a USB 2.0 connection. This BASIC Stamp Logic Analyzer is designed to Figure 9. BASIC Stamp Logic Analyzer software. mount directly under a BASIC Stamp microcontroller (see points (the manual states that the maxiFigure 6). It gets its power from the mum storage limit is based on how much same power supply to the Stamp, and available RAM is on your computer). With it will monitor all 16 of the Stamp’s I/O trigger points set at 0.8V and 1.8V, both pins, along with the Vdd, RES, Sin, and CMOS and TTL circuits are supported. Sout pins. I haven’t tried this, but the

BASIC Stamp Logic Analyzer should work with other microcontrollers that use the same footprint. Like with all electronic circuits, they can be used in a different application than they were originally designed for. This particular logic analyzer can be used as a stand-alone device. All that is required is a +5V and GND power source to the logic analyzer and wires to connect to the signal that you want to monitor. Remember you will need to provide a common ground between the BASIC Stamp Logic Analyzer and the system under test. Figure 7 shows a simple schematic illustrating how to wire the BASIC Stamp Logic Analyzer to another microcontroller, and Figure 8 shows a photo of the setup. Figure 9 shows the graphical user interface for the BASIC Stamp Logic Analyzer. This has some pretty powerful features, such as setting the trigger levels for beginning the data storage, setting the maximum data storage length, cursors for measuring the signals, zoom in and out control, and decoding serial, SPI, and I2C signals. Figure 10 shows you an example of the asynchronous serial data decoder. I haven’t tried testing the signal voltage limits to the BASIC Stamp Logic Analyzer. The manual doesn’t state what the voltage limits are, so I would assume that you are limited to 0-5V signals to the logic analyzer. If you have voltages outside this range, I would recommend that you implement some sort of a voltage signal conditional that chops/scales the voltage signals to the 0-5V range. Also, if you do not connect any of the unused signal pins to ground, then the signal on them will float and may either copy an adjacent signal pin, or bounce between logic 0 and 1. This is a pretty nice, little inexpensive logic analyzer, and I have used it successfully to diagnose a multitude of projects, and reverse-engineered other signals from other devices I wanted to use in my projects. SV For those of you who are interested in further reading on a similar topic, Nuts & Volts (www.nutsvolts.com) will be featuring a project in the January 2008 issue on a Low Cost RF Impedance Analyzer.

16

SERVO 12.2007

Full Page.qxd

11/1/2007

3:17 PM

Page 17

Events.qxd

11/5/2007

4:37 PM

Page 18

Send updates, new listings, corrections, complaints, and suggestions to: [email protected] or FAX 972-404-0269 Know of any robot competitions I’ve missed? Is your local school or robot group planning a contest? Send an email to [email protected] 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

December 7-8

South’s BEST Competition Beard-Eaves Memorial Coliseum, Auburn University, Auburn, AL Regional BEST teams from multiple states compete in this regional championship. www.southsbest.org

8

Penn State Abington Robo-Hoop Penn State Abington, Abington, PA The Penn State Abington Robo-Hoop is an autonomous robot basketball event in which robots must pick up foam balls and shoot or dunk them into a basket.

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

Januar y 2008 25-27 TechFest

Indian Institute of Technology, Bombay, India Lots of events for autonomous and remote controlled robots including standard Micromouse and several events unique to TechFest: Pixel, a contest for vision-equipped bipeds; Full Throttle: Grand Prix, remote-controlled, internal combustion powered cars race on a concrete track; Vertigo, a remote-controlled robot and an autonomous robot must work together to move blocks around; Prison Break, remote-controlled robot must climb out of a pit and survive a fall to escape robot-jail; U-571, an obstacle avoidance contest for underwater robots. http://techfest.org/competitions/department

F e b ru a r y 24-28 APEC Micromouse Contest

Austin Convention Center, Austin, TX Amazingly fast little autonomous robot critters race to solve a maze. If you’ve never seen one of these events, go see this one. You won’t believe how fast these things are. www.apec-conf.org

28-Mar 2 Pragyan

National Institute of Technology, Trichy, India Events in this competition include standard Micromouse and Sym-Bot, a contest in which a remote controlled robot must guide an autonomous robot to the starting line of a course — then the autonomous robot must complete the course by itself. www.pragyan.org/08/home/ events/

18

SERVO 12.2007

11/4/2007

6:42 PM

Page 19

I M S e r v ic e

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

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

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

7KH(VFDSH 5RERW¶VEXLOWLQ PLFURSURFHVVRU HQDEOHVLWWR ³WKLQN´RQLWVRZQ .65 

6 UH ROGH TX UL LUH QJ G 

ShowcaseDec07.qxd

7KHURERWIURJPRYHVIRUZDUG ZKHQLWGHWHFWVVRXQGDQG UHSHDWVVWDUW PRYHIRUZDUG !

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

PP:KLWH ZDWHUFOHDU /('9 PFG $% 

 VHFRQGYRLFHUHFRUGHUSOD\EDFN PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH SUHDVVHPEOHG  $ 

i m s r v .c o m

7KH9HOOHPDQ3HUVRQDO6FRSH LVQRWDJUDSKLFDOPXOWLPHWHU EXWDFRPSOHWHSRUWDEOH RVFLOORVFRSHDWWKHVL]HDQG FRVWRIDJRRGPXOWLPHWHU +36  QGV 7KRXVD VRQ P WH L PRUH LWH V E RXUZH

Robotics Showcase

THOUSANDS OF ELECTRONIC

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

VISIT OUR ONLINE STORE AT

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

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....

$15

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

Very Schmart!

1-800-826-5432

www.schmartboard.com

Ask for our FREE 96 page catalog

SERVO 12.2007

19

Dec07NewProd.qxd

11/5/2007

4:28 PM

Page 20

New Products

N E W P RO D U C T S ACCESSORIES AND TOOLS Resistance Soldering Systems

H

eavy-duty resistance soldering systems for soldering tasks such as large military pin connectors where the solder joint quality must be exceptional have been introduced by American Beauty Soldering Tools of Clawson, MI. American Beauty Ultra High Heat Plier-Style Resistance Soldering Systems provide instantaneous, localized heat from cold to >1,000°F in less than one second, depending upon the application. Featuring plier-style hand pieces, the heat is concentrated directly at the solder joint and these footswitch-actuated systems allow “cold fixture” setup before soldering. Ideal for soldering large single wire terminations up to 0 AWG into terminal lugs, electrical splices, and multi-pin connectors, American Beauty Ultra High Heat Plier-Style Resistance Soldering Systems avoid heat damage to the wire’s insulation. Hand pieces are lighter than conventional irons and are offered in a variety of sizes for confined spaces and special applications. American Beauty Ultra High Heat Plier-Style Resistance Soldering Systems are priced according to the power supply wattage and hand piece design. Literature and pricing are available upon request. For further information, please contact:

American Beauty Soldering Tools

1177 West Maple Rd. Clawson, MI 48017-1059 800•550•2510 Fax: 248•280•2878 Email: [email protected] Website: www.americanbeautytools.com

Digital Compass

A

new, low-cost, three-axis, tilt-compensated, solid-state digital compass that provides “drop-in compatibility” with most popular digital compasses has been introduced by OceanServer Technology, Inc., of Fall River, MA. The OS3000 Digital Compass is a three-axis, 1.4” x 1.8” PCB and includes RS-232 and USB connectivity, and a 24-bit A/D converter with digital filters for easy integration into a wide range of applications. Accurate to 1° azimuth, with 0.1° resolution, tilt-compensation up to ±60°, and

20

SERVO 12.2007

0.1° resolution for roll and pitch, the compass components have a 50,000 G shock rating. Providing a programmable update rate from 0.1 to 20 Hz, an ASCII interface, and hard-iron calibration, the OS3000 Digital Compass can be easily embedded into another device and provides precise heading, roll and pitch data, and is ideal for rapid attitude measurement. It incorporates a three-axis Honeywell Magneto resistive sensor, a MEMS accelerator, and is RoHS compliant. The OS3000 Digital Compass sells for $249 each or $199 ea. for 10; larger quantity discounts are available. For further information, please contact:

Ocean Server Technology, Inc.

151 Martine St. Fall River, MA 02723 Tel: 508•678•0550 (x103) Fax: 508•678•0552 Email: [email protected] Website: www.ocean-server.com

NeuroArm Educational Edition

N

euroRobotics — a British based manufacturer of robotic arm products with models of varying complexity and functionality — has just added the NeuroArm education edition to its range of robot arm products. This education edition teams up the NeuroArm Educational Edition 5 DOF Revolute Robotic Arm kit with the popular Webots 5.0 EDU Simulation and Programming software from Cyberbotics. This enables a vast array of teaching applications and experiments. Everything needed to build and operate the robot is included in the kit. No soldering or electronics PCB assembly is required. Using the supplied NeuroArm Webots model, you can program the arm to carry out virtually any imaginable task on the computer simulation. Then when you are happy with the simulation, just download the program to the real robot and watch it perform the same tasks as in the simulation. The joint drives on this robot provide less torque, speed, and lower gripper force than the more advanced NeuroRobotics models, but still achieves a reach comparable with an adult human arm. For further information, please contact:

NeuroRobotics

Website: www.neurorobotics.co.uk

Full Page.qxd

11/1/2007

3:19 PM

Page 21

CombatZone.qxd

11/5/2007

4:06 PM

Page 22

Featured This Month Articles 22 Feather Weight Armor by James Baker

24 Armor Guidelines by Chad New

26 Advanced Materials in Insect Armor

by Kevin Berry

As we do periodically (sorry — pun alert), this month’s Combat Zone departs from our usual format to focus on a topic of interest to all builders — armor. From my own experience and that of many other veterans, this is the single most misunderstood area when new builders attempt their first bot. SERVO put out a call to the community, asking for tips and techniques from builders on this tough subject (sorry, the puns just keep on a'coming). Four builders answered the call, and we hope their thoughts will be useful to all builders, new or veteran. Combat Zone is meant to be a resource to the robot fighting community. We welcome builder’s stories, requests for topics of interest, build reports, and feedback on how to make this even more useful. — Kevin Berry

27 Armor Considerations in

FEATHER WEIGHT ARM R

Large Robots by Paul Ventimiglia

Events 29 Results and Upcoming

● by James Baker

A

rmor is a subject all combat robot builders will have an opinion on. Many have written in detail about the theory of robot armor materials, with formulae and specification tables galore. All of this is must-read material if you plan to survive in this sport. With so many knowledgeable people offering articles containing such detailed material science, I

22

SERVO 12.2007

think this article needs to focus elsewhere. Instead of trying to tell you what you should do and offering mathematical reasoning, I will simplify the issue, based on my experiences, to the game of Rock/Paper/Scissors.

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

CombatZone.qxd

11/5/2007

4:06 PM

Page 23

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

build their machines with heavy, thick, solid armor. This is especially true at the moment in the featherweight class in the UK. We currently have a very high number of robots built using Hardox, a very strong wear resistant steel. One example of the rock solution is my own featherweight, “Unity” which is a zero compromise armored steel tank without weapons and with moderate drive power. My teammate has a similar robot called “Bloody-L” machined from a solid billet of high-grade aluminium with stainless steel skin. It is obvious where the advantages and disadvantages lie with these. All but the most extreme of spinning weapons are unable to even scratch the outside, but inside the components are shaken to pieces. The rock is very good against crushing, cutting, and piercing weapons, but the solid robot transmits impacts from spinning and impact weapons directly to the components inside, causing unseen failures. Having heavy armor also reduces the other capabilities of the robot, such as reduced speed or lacking weapons, which means it can be less than exciting in rock vs. rock fights. When rock breaks, it usually breaks badly, leaving distorted, sharp sections of very visible damage.

Paper Paper is light. It’s flexible, and easy to cut and shape. Paper absorbs energy. The analogy of the paper robot is not one built of cardboard, but one of deformable materials such as polycarbonate, polypropylene, HPDE, wood, or even rubber. The characteristics of the paper robot are the opposite of the rock. By allowing the energy from the opposing weapon to deform and damage the armor, almost all of the energy is used up or displaced, leaving less to rattle the internal components. This type of armor works very

well against axes or impact weapons, but does not do very well against crushing, cutting, or piercing weapons. Because of the relative light weight of this type of armor, more weight can be allocated to drive power and weapons, making for fast and exciting fights, taking small amounts of damage constantly, but sometimes ending in catastrophic failure. The paper robot (how strange does that term sound?) is usually a crowd pleaser. It is also easy to work with, allowing new builders to get into the sport without spending a fortune on tools and metalworking equipment. I run a number of robots with chassis and armor made entirely of plastic, which I found has another, often overlooked advantage — I can keep my antenna inside the robot as it is transparent to radio signals.

Scissors

Edgehog uses sacrificial armor that takes a lot of visible damage, but saves the internals from shock damage.

ble than a zero compromise solution. Rubber mounted steel, for example, fits this description. Titanium is also a good example of scissors-type armor. It is very resistant to cutting, but flexes well to absorb energy. Titanium is not the indestructible material many people think, but it is a very good compromise between stronger, heavy steels and light plastics. It is expensive and hard to work with, but in the featherweight class, it is common and works very well. My heavyweight robot “Wheely Big Cheese” is made entirely of titanium, as is the featherweight version. There really is nothing like it for solving so many problems with just one product. Aluminium is also a scissors type — more paper than rock — but we use it very effectively in our heavy-

Scissors are hard and strong, but they can move and change shape. It is a bit of a stretch to call a strong, but flexible robot “scissors,” but the term refers to the armor being rock-like in its resistance to cutting or penetration, but paper-like in its energy absorption capabilities. It is a middle ground, giving good levels of protection against all Building a robot from titanium types of weapons, but gives excellent strength and energy absorption, but they are still being more vulnera- expensive and hard to build.

SERVO 12.2007

23

CombatZone.qxd

11/5/2007

4:07 PM

Page 24

Even super strong ram-bots like Unity take damage sometimes.

weight robot “Edgehog” The armor takes a lot of damage, but keeps the opponent’s axes from doing internal damage. We have many aluminium featherweights who require a lot of repairing after events, but they work very well.

Rock Beats Scissors Beats Paper Beats Rock ... It is a very black and white subject, or so it would seem from what I have written so far. You can have indestructible robots that cannot beat anyone (as they have no available weight left) or awesome weapons on fragile robots that fall apart with the slightest impact, or you can spend a fortune on middle

ARM

ground materials and machining. Of course, it is never really black and white. What happens if we put heavy steel under polycarbonate, or have stainless steel parts of the robot, with aluminium elsewhere? A hybrid robot made of light materials, using heavy, strong materials in specific areas, is one solution. Laminate armor — using layers of different types of material — can have advantages, as well. Bonding these layers can help them; sometimes they work better if not bonded. One very cheap solution to improving the capability of your armor is to correctly shape it. Crushers love a flat lid, spinners love vertical sides and catching edges. Shape your armor to maximize its natural properties. If it needs to flex,

give it room to do so. If it must not bend, support it properly. Slope as many sides as possible. If you have thick, super strong armor all around you robot, do you need internal structure at all? Why not put teeth on the armor and spin it? Armor is a subject that should be given as much thought as weapons or drive. There is no perfect solution. Some people choose to turn their armor into weapons, such as ram-bots or shell spinners. Others have armor as an afterthought, relying on huge offensive weapons to ward off attackers. Whatever you choose to do, it will always be a compromise, unless you live in the UK right now. We just had our weight limit raise from 12 kg (26.4 lbs) to 13.6 kg (30 lbs) to meet the American standard, so all of our weapon-focused robots can have 1.6 kg of extra armor, and our weaponless rock-bots can have 1.6 kg of weapons. Does that make them all scissors now? Then, I guess it’s time to build a new 30 lb rock or paper robot. SV

R GUIDELINES ● by Chad New

L

et me ask you: Would you walk into a hail storm without any sort of protection/armor for your body? I am going to guess not unless, of

Spatula shows heavy damage mainly because of the vertical and rigid mounting.

24

SERVO 12.2007

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

armed to the teeth with various destructive weapons that are capable of ruining the creation that took you so many hours to build? Again, I would hope that the 150g robot Pookie uses answer to that would be no. shaped titanium to Armor is one of the most deflect the attacks of opposing robots. critical aspects you must account for when you are designing your combat robot. If you do not have armor of some sort, what is going to protect the expensive and critical places inside your robot from being destroyed by your opponents? In this article, I will

CombatZone.qxd

11/5/2007

4:07 PM

Page 25

Rocket, a 60 lb launch bot, uses its shape, shock mounting, and attachments to protect itself from opponents.

explain what I believe to be the most critical aspects of your armor configuration; for instance, the type, how you mount it, its shape, and attachments. By the end of this article, it is my hope that you will be able to utilize this information and improve the armoring techniques on your robots.

Mounting We will start with mounting because I believe this to be one of the most important aspects of your entire armor layout. You can have the best and most expensive armor ever created, but unless you mount it correctly, it will be useless. If you have an armor ‘shell’ that mounts to the base plate or frame, you need to have very strong attachment points. If your 1/4” titanium shell is held onto your 1/4” titanium base plate by 1/8” aluminum brackets, there is a good chance that it will be torn off or bent in short order. Consider the forces involved in the class that you are going to enter. Use appropriate sized hardware that won’t distend under high loads and consider using armor mounts that are just as strong as the armor itself. You might also want to consider shock mounting your armor. Shock mounting usually involves rubber of some sort which provides a cushion. When it’s impacted, it allows some of the force to be absorbed into the mounts. If your robot’s armor is the frame itself, you need to plan for the armor getting bent and damaged. Allow tolerance for components to work even with a damaged frame/armor panel. Consider layering the outer area with UHMW or even a thin shock mounted strip of metal to shield the important pieces.

Type The type of armor that you are going to use depends on the goal of your robot. If you want a robot that is going to be able to withstand attacks from the most destructive competitors, then you are obviously going to need strong and thick armor that is mounted very securely to the frame. If weight is not a concern, you might as well use cheap metal such as steel; many robots have even used wood as armor with positive results. If your robot uses a weapon, you will likely not have the weight to allocate towards an impenetrable setup such as steel. You may have to consider materials that are able to absorb shock well or have a high strength-to-weight ratio. Materials such as UHMW, aluminum, and titanium work well in this instance.

Shape I believe that a robot’s armor should be built around the chassis. Once you have decided the basic bits of your robot, you need to begin to think about how you are going to armor it. Are you going to bolt it flush onto the frame, bend a piece of plastic around the whole thing, or perhaps even use a shaped piece of wood to protect the robot? When you design your armor, you also need to keep the shape of it in mind. Why

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

mount it vertically which gives spinning robots a wonderful surface to grip and impact on when you can design your armor with a slope so that the angles will help to dissipate some of the force (which will give you a distinct advantage when facing your opponents)? Try to design your armor so that it will aid your design. Do not think of it as something that has to be only defensive. If possible, attempt to incorporate it into the offense side of your bot.

Attachments If after you have completed your robot and you find that you have weight left over, you might want to consider making some attachments for weapons that you might face. Even if you don’t have extra weight, it might be worth it to take off a wheel, lose a motor, or cut back on the batteries to give you the advantage of some added armor. If you are going to fight a horizontal spinner, you might want to add extra armor at the height of the blade. That way, it will be less

A great example of what can happen to even the best designed robots if the mounting is not strong enough.

SERVO 12.2007

25

CombatZone.qxd

11/5/2007

4:08 PM

Page 26

likely to rip through and damage your armor. If you are fighting a vertical, think about a wedge of some sort, or the ever-popular “keep away” stick which can be used for just about any type of spinner. The point is that anything you can add for a specific opponent is something that will give you an advantage; try to allocate weight for attachments.

Conclusion In wrapping up, remember how important it is to keep the armor design at the forefront of your mind when designing your robot. Try to incorporate it as an offensive part of your robot and don’t “half ass” it during the last-minute rush getting ready for the event. I also think it is very important to keep in

mind that offense and defense are both huge factors for the success of your robot. Again, take note of how you will mount your armor, what type of armor you are going to use, the shape of it, and perhaps some special attachments to better equip yourself against certain robots. If you do all of this, chances are your robot will be in much better shape at the end of an event! SV

ADVANCED MATERIALS IN INSECT ARM R ● by Kevin Berry

O

ur team, Legendary Robotics, has built (or done major upgrades to) almost 50 insect class bots (150 gram, one pound, three pound, or six pounds), and their armor has run the gambit. We’ve had bots with no armor (all offense), ones mostly made of armor (all defense), and many in between. Until the advent of major spinners in the last few years, we had great success with 1/8” aluminum, which was easy to work, absorbed hits well, and was inexpensive. Once ant or beetle spinners started cutting through it, however, we knew we had to move to something else. In this sport, you either stay ahead of the “death spiral,” or it screws you into the ground. At one event, we were talking with Team Barracuda about their antweight, Flounder. It was made of

a novel carbon fiber honeycomb. Exhibiting the sportsmanship that defines our sport, they directed us to their favorite bot supply place, Acme Industrial Surplus in Sanford, FL (www.acmeindustrialsurplus.com ). Well, we hit the mother lode. Besides the CF honeycomb, they also carry a Kevlar honeycomb material, in thicknesses from 3/32” to 1”. In fact, they have aluminum honeycomb in all kinds of various sizes. We knew we just had to build a bot out of this stuff! Babe The Blue Bot, an antweight, was our first (and most successful) build. Using this material, along with titanium from Titanium Joe (www.titaniumjoe.com), we developed a bot that has survived battles with some of the Southeast’s (and Texas’, as well) most vicious spinners.

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

26

SERVO 12.2007

Our strategy was to combine the chassis and armor, using a fairly classic wedge/box design. The top and bottom are just the raw Kevlar, while the sides have a layer of 0.014” titanium over them. This light, stiff, strong material left us plenty of weight for a 0.040” titanium plow. We started with spacer/screw sinks/corner braces made of wood, but after having several split by a massive hit from superspinner Pirhana, we upgraded those to UHMW (also from Acme). All cuts were made with hand tools. The Kevlar cuts well with a hack saw or coping saw, and the titanium with snips. The plow, of course, was harder to work, but by wearing out a hacksaw blade, it was done by hand also. The Kevlar basically works like plywood, except it takes hits

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

CombatZone.qxd

11/5/2007

4:08 PM

Page 27

While the 0.040” titanium plow is barely scratched, the thinner 0.012” does get a bit dinged up. No marks or penetration to the Kevlar underneath, however.

extremely well. We bought some 5/8” thick material for our lightweight, and plan to layer some 0.030” titanium over that (if we ever get it finished). We’ve also used this 3/32” as the chassis for and weight for all six pieces. our beetle John Henry, and it’s I strongly recommend this proven just as tough in the beetle approach for any small bot, and class with 0.018” titanium overlay. would like to see someone We’ve seen the carbon fiber honeyexperiment in a mid-sized machine. comb used in antweights as well, Babe has survived dozens of nasty and it seems to perform just fine. battles, and while sometimes losing When we bought it, the 3/32” these fights — and often parts — her ran about 10¢ per square inch, or soft creamy center has never been about $5 for Babe. The 0.014” titanium ran about $1 for every six square inches, or about $18. Material Size (in) Weight (oz) The plow, made from 0.040” Top Kevlar 6x6 1.4 costing about $1 for every four Bottom Kevlar 6x6 1.4 inches, cost around $3. So, our Side Kevlar/Ti 1 x 6 0.5 chassis and armor cost $26. Of Side Kevlar/Ti 1x6 0.5 course, we bought the material in bigger sheets, but with Rear Titanium 1x6 0.2 thrifty layout, we use every Plow Titanium 2x6 1.2 possible bit with no waste. TABLE 1 TOTAL 5.2 Table 1 shows sizes, material,

“Exploded view” of Babe’s side construction. When using wooden spacers, this was how it looked coming out of the arena, also!

violated. Knock on wood (or maybe Kevlar)! SV

Front view shows the plow attachment. The screws are left a bit loose so it “bounces” over arena irregularities.

ARMOR CONSIDERATIONS IN LARGE ROB TS ● by Paul Ventimiglia

T

here are some nasty weapons found in today’s combat robots, especially in the 120 lb-340 lb weight classes. If your armor isn’t up to the task, you will not only lose the match, but your expensive robot innards will be defenseless. Having the proper armor for a match is just as important as having that killer weapon, and often it is more important.

Know Your Constraints To maximize your chance of

success, you must plan ahead carefully. You should first decide how much weight you have allotted for armor. The most important design factor is surface area; in order to maximize protection, you must minimize surface area. If you reduce the length or width of an armor pane, then you can increase the thickness of that piece while keeping the weight constant.

Remember, your robot should not have to be taller than the largest

Heavyweight Verbal Abuse illustrates the rubber shock mounting technique where its armor will attach to all sides. Photo courtesy of Dick Stuplich.

SERVO 12.2007

27

CombatZone.qxd

11/5/2007

4:09 PM

Page 28

The 120 lb robots from Robogames 2007. Subzero shows off its shock-mounted armor and titanium wedge deflecting the hits from the drum of Touro. Photo courtesy of Brian Benson.

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

component inside! Always consider the application of what you are designing. You might not be able to predict what each of your opponents will look like at an event, but you know historically what types of robots have competed. This is an area to take some design risks in how you choose to distribute your allocated weight. For example, “there are many heavyweight spinners, but almost no hammer or crushing weapons.” Using that assumption, I am making a potentially risky tradeoff as I shift weight from my top/bottom armor to the rest of my robot.

Importance of Shape When designing your armor, look at the most powerful robots that exist and ask yourself, “Do I feel comfortable letting them hit each

part of my robot?” At a minimum, you should plan to receive an attack from a horizontal spinner such as Megabyte or Last Rites, a hammer robot such as The Judge, and a vertical disk spinner such as Nightmare. The energy of those attacks can be deflected if your armor is sloped at an angle. Megabyte, Last Rites, and Brutality have all placed holes in the 1/2 inch thick steel arena bumpers. Does that mean your robot must have better than 1/2 inch steel armor everywhere? No — of course not — it is all about the shape of your armor. Thin aluminum and plastic can easily render a spinning weapon useless if it is mounted at a low angle (below 30 degrees) to the floor. Similarly, having a one inch thick steel front bumper will do you no good if a spinner can “catch” onto its edge. Often an entire armor panel can be torn off from a solid hit. That is why the corners of your robot are the most vulnerable area; any seam or edge can be caught by a good spinner.

Material Selection The most common robot armor materials are aluminum, steel, polycarbonate, and titanium. Your budget The 340 lb robots from Robogames 2007. The Judge tries to sentence Ziggy who has added additional shock-mounted panels by removing the side armor just for this fight. Photo courtesy of Brian Benson.

28

SERVO 12.2007

and tools will often be the main limiting factor in your selection process. Steel offers the best protection for your dollar. Mild steel (such as 1018) offers good strength and comes in any shape and size. High carbon steels (such as 4130 and tool steels) have the added advantage of the ability to be hardened, becoming many times stronger and harder to penetrate. A simple steel wedge is your best chance of fending off that big spinning weapon, but plan to have it at least 3/16 inch thick at a low angle, and almost 3/8 inch thick as the wedge approaches 45 degrees. For armor in less vulnerable areas, you can get away with 1/4 inch thickness, if you don’t mind a few large gashes and holes. Aluminum is the most commonly used robot building material. It comes in a variety of alloys; 6061 has about half the strength of mild steel, but that comes at about a third of the weight. More exotic alloys such as 7075 obtain similar strengths to mild steel, but they can be very expensive. Additionally, the stronger aluminum will generally fail in a brittle way by cracking, but 6061 is a softer metal that will bend. Polycarbonate (or Lexan) is a surprisingly resilient material. It is one of the lightest materials you can use for armor, and is available in sheets up to about one inch thick. Although it has low strength in tension and it

CombatZone.qxd

11/5/2007

4:10 PM

Page 29

Table 1 Material Mild Steel

Density (lbs/in^3) 0.284

Best Used For Front wedge, high impact areas, sides

High Carbon Steel

0.284

Front wedge, high impact areas

6061 Aluminum

0.098

Sides, top, bottom

7075 Aluminum Polycarbonate

0.098 0.043

Sides, top, bottom Top, sides against non-spinners

Titanium

0.161

Works well in all areas

can be cut fairly easily, it performs well during impact forces. This is due to its ability to flex and still return to its original shape. Some care must be taken when designing to use polycarbonate however, because it is prone to cracking in areas such as sharp corners and near holes. Additionally, this plastic does not block radio waves, and it can give your robot a nice look because it is transparent. Titanium offers the highest strength-to-weight ratio of these materials, but with a very costly price tag. Alloys such as 6AL-4V have more strength than many steel alloys. Super heavyweights such as Ziggy and The Judge are clad in titanium all around; it is necessary to keep their

weight down while covering their large surface areas. I personally do not feel it is worth the price to use titanium armor in the large classes, so instead I try and allow extra weight to use steel.

Mounting Your Armor If your armor is rigidly secured to your frame by welds or bolts, it will resist bending well. The front of your robot will take the most abuse, so use the largest and highest quality fasteners you can find. Reinforce all long spans with gussets and multiple attachment points. If armor panels are mounted on hinges, make sure they are steel, and bigger than you think is necessary. (I use 1/4 inch

Other Notes Easily machined and welded; welded with MIG and TIG. Has to be machined in annealed state; must be hardened for best results. Easily machined, difficult to weld in thicknesses above 3/8 inch. Easily machined, cannot be welded. Very easily machined, should not be tapped; mount with bolts and washers. Difficult to machine, welds only with TIG and heavy shielding.

thick walled, 5/8 inch pin steel hinges on Brutality.) Alternatively, many builders swear by “shock-mounting” their armor. Large rubber washers or metal studs encased in rubber completely isolate an armor panel from a robot’s frame. By using this technique, the energy of an impact is more slowly absorbed and therefore your robot will not be damaged as easily. I prefer to save weight overall by making my frame a part of the armor. Whatever you choose, remember to make it easily repairable or bring spares. Steel can always be welded at an event, but good luck gluing back together your shattered polycarbonate! SV

EVENTS Results and Upcoming Events

R

obothon Robot Combat 2007 was presented by Western Allied Robotics in Seattle, WA, on 9/22/2007. Go to www.west ernalliedrobotics. com for more details. Results are as follows:

Raven, Team DMZ; 3rd: Fiasco, Team Velocity. ● 3 lb Beetleweight Class — 1st: Hurty Gurty, Team Death by Monkeys; 2nd: Altitude, Team Velocity; 3rd: Mission Mayhem, Team Wildcard.

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

● 1 lb Antweight Class — 1st: Melty B 2.0, Spam Butcher; 2nd: Baby

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

R

oaming Robots held an event in Portsmouth at the Mountbatten Centre on 10/6-7/2007. Go to www.roamingrobots.co.uk for

SERVO 12.2007

29

CombatZone.qxd

11/5/2007

4:10 PM

Page 30

more details.

R

oboCore was held in Brazil on 10/6-7/2007. Go to www.robocore.net for more details. Results are as follows: ● Middleweight — 1st: Touro, Team RioBotz; 2nd: Orion, Team Triton; 3rd: Team ThunderRatz.

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

Upcoming Events for December 2007 and January 2008

B

otsIQ Boston Regional, “Rumble At The Rock,” will be presented

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

C

arolina Combat Robots is having its second event in Greensboro, NC. The arena is a 16 ft x 32 ft steel structure with 1/4” steel floor and 1/2” of Lexan for the walls. The event will include robots from 150 g Fairyweight to the 120 lb Middleweights.

T

he Plymouth North and Plymouth South High School Engineering Teams in cooperation with BOTSIQ and The Boston Tooling and Machining Association, will host a 15 lb BOTSIQ Robot Combat Competition at the Engineering Lab at Plymouth North High School — 41 Obery Street, Plymouth, MA.

W

reck-The-Halls will be presented by Carolina Combat Robots in Greensboro, NC, on

Robot Controllers

· 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

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.

Includes eveything you need to build a simple mobile robot. Add your own additional sensors for even more complex robots.

$59.95

$69.95

MicroBric Viper

ARC1.1 Robot Controller

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.

/ Assembled $41.95

oboChallenge will present their Thinktank Christmas Special December 28th and 29th in Birmingham, England. Go to www.robochallenge.co.uk for more details. SV

INEX MicroCamp Mega8

· 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

• 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

R

Programmable Robot Kits

Wiring Robot Controller

Kit $37.95

December 28 and 29, 2007. Go to www.carolinacombat.com for more details.

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.

$89.95

1-800-979-9130

MaximumRobotics.com 30

SERVO 12.2007

Doerr.qxd

11/1/2007

11:02 AM

Page 31

The SC-01 speech chip was one of the most popular speech chips in use during the ‘80s ... by Robert Doerr

I

t is the voice for the Heathkit HERO 1 and HERO Jr robots, the RB5X robot, some arcade games, and several other devices. Many will always remember hearing this chip asking if “Dr. Falken” would like to play a game of chess in the classic “War Games” movie. The SC-01 had a long run, but these days they are getting hard to find. I was concerned about this and wanted to ensure there was some sort of replacement option that would be available for the future. Finding a suitable replacement for this chip proved to be an interesting

project. It highlights the many different problems that come up in the robotics hobby. What seemed at first to be a very straightforward endeavor ended up covering a lot of ground. I’ll try to review all the ups and downs and share some knowledge along the way. Currently, there is no direct drop-in replacement for the SC-01 speech synthesizer, so I decided to go about creating one. At least a hybrid one for now!

The Language Barrier First, let me start with how the SC-01 generates its speech. Some speech chips (or modules) accept regular ASCII text strings and others act like a sound recorder which play back SERVO 12.2007

31

Doerr.qxd

11/1/2007

11:03 AM

Page 32

mind, I looked to see what other phoneme-based speech chips are out there. After looking at the few available chips, it seemed that the closest match would be the SpeakJet (SpeakGin) chip. Although it too is phoneme based, that is about all it has in common with the SC-01 chip (except that they are both in DIP packages). The original SC-01 chip. In the SC-01, there are 64 of these phonemes stored phrases. The SC-01, however, is a defined. The SpeakJet has 72 (allophoneme based synthesizer which phones) plus a variety of sound effects. builds words from small sound The first part of the project was to see fragments called phonemes. With this in if this idea had merit and was possible.

All of the codes for each phoneme are different for each chip. I went through and made a lookup table for what I thought would be a good mapping of each SC-01 phoneme to SpeakJet allophone. With this conversion table in hand, I had some speech strings from the HERO 1 that I ran through the table. Initially, I had a SpeakJet wired up to an old Handyboard for testing. I then took the translated string of phoneme codes and with an Interactive ‘C’ program, sent them all to the SpeakJet. The results of that first test were inspiring and showed that this could be a viable option. Some of the words sounded exactly the same while others needed work. (More to follow ...)

Schematic for the translator.

32

SERVO 12.2007

Doerr.qxd

11/1/2007

11:04 AM

Page 33

The Protocol Barrier

The custom DIP adapter.

Now that the SpeakJet could sound like the good old SC-01 (provided the right codes were fed into it), the next step was handling the protocol it uses to talk to the host. These days, a lot of peripheral devices can be told what to do using a single serial line with perhaps a handshaking line or two. The SC-01 and many earlier devices are from when most peripheral devices were parallel based. The SC-01 accepts six parallel bits of phoneme data, two bits of inflection data, and has a couple control lines to latch the data and acknowledge (busy) that it was received. This added one more thing to deal with for a translator. The SpeakJet, on the other hand, expects to receive all the allophones sent as a serial data stream.

• Acknowledge to the host that it was received.

Too Much Power

To fit in with the idea of drop-in replacement for the SC-01, the whole thing had to plug into the odd 22-pin DIP socket and act just like an SC-01. Lately, I’ve been working with the Parallax SX series of microcontrollers and found that the SX28 was ideal for this project. The translator program was written in SX/B (BASIC compiler) to make it easy for everyone reading this article to follow the code. The SX28 acts as the hardware protocol translator, phoneme translator, and handles all the handshaking signals. In order to do this, it must:

To jumpstart the project, this whole prototype was built upon an SX28 protoboard that Parallax offers. It contains a SX28AC/SS-G surface mount chip, voltage regulator, prototype area, and a header for the programming adapter. Programming the SX series chips also requires the use of an SX-Key or SX-Blitz. The ability to quickly Flash the SX28 processor with new versions of the translator code really helped speed the development process along. The SX28 is available in both a 28-pin SSOP package and a 28-pin DIP package. An important point to note is that pins 1 through 14 are not the same on both package styles. Make sure to note which package is used in any schematic that uses the SX28 chip! Care has to be taken when switching package styles to ensure the wiring is correct. In the example schematic, a surface mount SX28 SSOP package was used. The SX28 chip sits between the 22 pin SC-01 socket and the SpeakJet chip to translate all the signals. The only exception is the voice out signal which the SpeakJet

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

Original SC-01 amp board with the DIP adapter replacing the SC-01 microchip.

Another oddity about the SC-01 is its source of power. Instead of just +5V that most devices seem happy with, this chip was commonly run at +12V. Even so, it had a nice feature in that the data lines had 5V compatible inputs to make it easy to interface to standard 5V systems. A hybrid module would also need an onboard 5V regulator to bring the supply down to a safe level.

Enter the Translator

• Perform a lookup to determine what the equivalent SpeakJet phoneme should be. • Send any special codes to the SpeakJet. • Send the new phoneme to the SpeakJet (if buffer is not too full). • Set the acknowledge line high to signal that host can send another phoneme.

The Hardware

handles and goes out through pin 21 of the 22 pin socket. Port A of the SX28 handles the serial data to and also gets the status back from the SpeakJet. Port B is used to get the strobe from the host since that port can generate interrupts. This will allow for an alternate version of the translator to be written as interrupt driven. A portion of port B can also act as an analog converter and that pin is wired to pin 16 (MCRC) of the 22 pin SC-01 socket. It can eventually look at the riginal SC-01 timing signal and adjust the translation speed accordingly. The remaining pins on port B are used to get configuration information from a DIP switch. Port C is used to get the phoneme and inflection data from the host. To ensure the serial timing to the SpeakJet would be accurate, a 4 MHz resonator is used. Although the internal RC clock of the SX28 is fine for many projects, an external resonator or crystal should be used when timing is critical.

SERVO 12.2007

33

Doerr.qxd

11/1/2007

11:05 AM

Page 34

SpeakJet-based replacement board.

Issues That Came Up (and were overcome) As a real world test, I pulled out the genuine SC-01 chip from the Speech board of my HERO 1 robot and plugged in my translator gadget. The original power source for this

References www.robotworkshop.com Author’s website, home for the HERO robots and vintage robot Guru (Pre-programmed SX28 chips with resonator available here). www.parallax.com Provider of the SX series processors. Offers free software development tools like SX/B. http://forums.parallax.com/forums/ Online user forum for SX series microcontrollers. www.speechchips.com Provider of SpeakJet chips. www.redcedar.com Great historical reference and data on SC-01. groups.yahoo.com/speakjet Online user group for SpeakJet chip. www.speakjet.com Website for the SpeakJet chip. www.soundgin.com Website for the SpeakGin and SoundGin chips. www.rbrobotics.com Home of the RB5X robot.

34

SERVO 12.2007

prototype originated from the supply pin of the SC-01 socket. The HERO 1 can shut down parts of itself to save power and as a result the power on the speech board would cycle on and off this 12V supply whenever the robot tried to talk. It also made downloading new translator program code a chore since the board would normally be off. As a temporary solution, I supplied power to the prototype board from the +5V connection on the HERO 1 breadboard. The amplifier section on the HERO 1 speech board would still power up and down to save power. Later, the 5V regulator will take the 12V from pin 1 on the 22 pin socket for power so that all the connections are directly to the SC-01 socket. The default behavior of the SpeakJet is to announce ‘READY.’ It is also what the HERO 1 says when you first power him up. When the power was first applied, it would say READY but it was misleading. I knew it wasn’t going to be that easy! It only did it the first time it was powered up and following that, all it made was a sort of sick ‘Ehhh’ sound repeating a bit before going silent. Well, that isn’t supposed to happen! It was pretty obvious what was going on with the READY announcement, so I took another look at the source code. I found a typo for the variable name used for the index to look up the SpeakJet allophone in the table. As a result, it was always pointing to the first phoneme in the table (that happens when your index is always 0) so that explained it. I fixed that and started to hear a few new phonemes. I could make out some of the phonemes and portions of words but it was way off. I knew that the lookup table would need work but thought “I can’t be that far off!” A little troubleshooting work quickly uncovered what had happened. I had used a 22 pin DIP socket to make the plug-in adapter to go into the original SC-01 socket. The leads are fairly thin as it was a standard dual leaf socket. You may have already

guessed what had happened. Two of the six data leads used to send the phoneme data to the SC-01 on my custom connector had folded under instead of going into their appropriate pins in the socket below. That left two of the six data bits used to select a phoneme open and in a floating state. Usually when something is open it floats high, so it meant that some phonemes would never be used and other incorrect ones would be selected in their place! Once that was fixed, it started to sound a lot better. The robot would speak a portion of what it was supposed to but would be truncated before it could finish. The SC-01 would accept a single phoneme at a time and would be ready to accept the next while speaking so the speech would be continuous. This ended up being another issue. The SpeakJet is nice enough to offer a 64 byte buffer for incoming commands/allophones. The robot would send along all its phonemes which were being buffered by the SpeakJet. Once transferred, the robot would assume the speech was done and shut down power to the speech board, shutting off the sound amplifier. (Hmm, that’s a problem!) To confirm that was the case, I threw in a small delay after each phoneme was received and sent over to the SpeakJet. It definitely showed this was it and then brought up the issue of how to deal with it. The SpeakJet provides a few handshaking signals. It can signal if it’s ready, it can tell you if it is actively speaking, and it can tell you if the 64 byte buffer is half full. Unfortunately, it has no easy way of letting you know when there is only one byte left in the buffer. This is something that would have been extremely useful in its role of impersonating an SC-01. Instead of sending all it could take and using the buffer half full as a handshaking signal, I wanted to spoon-feed the chip and provide it the allophone codes one at a time so I would know about when it would be done. I did try using the speaking line as the handshake, but the problem was there ended up being a pause between each phoneme which was unacceptable. It seemed that it

Doerr.qxd

11/1/2007

11:07 AM

Page 35

would either take too much or too little. Unfortunately, none were just right ... Luckily, an elegant little solution hit me. Why not just go ahead and send codes to the SpeakJet using the buffer half full as a throttle. Then as a way to sync up the timing, I could use the Speaking handshake line whenever the SC-01 was sent a pause or a STOP. It just so happens that the convention used in the HERO 1 is such that all the speech sent to the speech board ends with a STOP to ensure the board would finish speaking before it was powered off. This was PERFECT! An audible pause between phonemes might normally be a problem, but if the phoneme was a silent one, then no one would notice. This is just what I needed to make it work on HERO 1 and it got around the power issue. After that, some more work went into the translation table for the SC-01 phonemes to SpeakJet allophones. Extra code was added to consider the two inflection bits. If they changed state from the last phoneme, then the program will send out a code to the SpeakJet to change its inflection to improve the emulation. It’s still not perfect, but keeps getting better with each revision. One of the last minute additions into the code was to send a small pause phoneme to the SpeakJet when everything was first powered up. Without this, the first phoneme that was translated and sent to the SpeakJet was garbled. Adding that delay cleared up the problem and now everything sounds just as expected.

The Extras Finally — just for fun — I wanted to use some of the extra features of the SpeakJet and put a few of the extra unused pins on the SX28 chip to good use. One of the unused bits on port B (RB.5) can send debugging info to a serial port for monitoring the translation process. A small DIP switch was added to configure the way the translation is handled. Alternately, instead of a DIP switch, an output port on the robot or another device could be used to control these settings. In the example program provided, DIP switch 1 is used to enable R2/Bio

sounds instead of regular SC-01 phoneme translation, DIP switch 2 enables extra status info to be sent out the debug port, and DIP switch 3 enables a small section of code to initialize a fresh SpeakJet chip by disabling its startup READY announcement. Now, by merely flipping a DIP switch, I can have HERO speak just like R2D2 since it translates real phonemes to equivalent R2 sounds. I don’t know if the real R2 would understand it but everyone that hears it seems to like it! So, not only will this project effectively emulate an SC-01, but also adds value by leveraging some extras within the SpeakJet.

Ideas for Improvement • Better matching of audio output circuitry here. • Monitor RC circuit that sets SC-01 timing and adjust overall timing of emulation. • Tweak phoneme lookup table. • Add another mode to enable more special SpeakJet features like sound effects. • Make another version to translate

Note The source code for the translator is available on the SERVO website at www.servomagazine.com.

from the SC-02 (SSI263) to the SpeakJet. It should be noted that either the SpeakJet or SpeakGin chips can be used interchangeably as the target speech chip with this project. For those that may not be aware, these two devices are actually the exact same chip. The codevelopers decided to pursue different markets and each have their own brand name for this particular speech chip. Eventually, this can all be put on a little hybrid module as a nice tidy plug-in replacement package. For those of you interested in trying out the translator yourself, preprogrammed SX28 chips with a resonator will be available from the author. SV

About the Author Robert has been working on personal robots since building one of the early HERO 1 robot kits when they came out. He enjoys repairing/rebuilding/ upgrading all the robots from that era. It can be challenging at times, but it is rewarding to keep these old robots going.

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

Tormach PCNC 1100 Features: Q

Table size 34" x 9.5"

Q

R8 Spindle 1.5 hp variable speed to 4500 RPM

Q

Computer controlled spindle speed and direction

Q

Precision ground ballscrews

Q

Digitizing and tool sensing support

Q

4th axis and high speed spindle options

3 Axis Mill

$6800 plus shipping

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

SERVO 12.2007

35

Simpson3.qxd

11/5/2007

3:45 PM

Page 36

GPS PART 3

More on the NEMA 0183 Protocol Back in Part 1, we looked at the GSV and GSA NEMA commands. While those commands are invaluable for determining your GPS lock status, they won’t yield any positional data, which you will need in order to generate a nifty plot like that of Figure 1. Let’s take a look at two additional commands: FIGURE 1

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

last two characters in the message are a hex representation of the calculated checksum.

Remember you can download a complete NEMA 0183 reference manual at www.sparkfun.com/data sheets/GPS/NMEA%20Reference% 20Manual1.pdf.

GGA: Global Positioning System Fixed Data

Just To Recap: A NEMA 0183 message begins with a $GP and ends with a carriage return. It looks something like this: $GPGSV,3,1,12,20,00,000,,10,00, 000,,25,00,000,,27,00,000,*79 The message name — which is also referred to as the option — comprises the characters just following the $GP. Each data element is separated by a comma. The data elements are terminated by the * character, followed by the checksum. There is an eight-bit XOR of each character between the $ and * to form the checksum. The

36

SERVO 12.2007

by Michael Simpson

• Field 1, UTC Time in the format of hhmmss.sss • Field 2, Latitude in the format of ddmm.mmmm • Field 3, N/S Indicator (N=North, S=South) • Field 4, Longitude in the format of dddmm.mmmm • Field 5, E/W Indicator (E=East, W=West) • Field 6, Position Fix Indicator (0=No Fix, 1=SPS Fix, 2=DGPS Fix) • Field 7, Satellites Used (0-12) • Field 8, Horizontal Dilution of Precision • Field 9, MSL Altitude • Field 10, MSL Units (M=Meters) • Field 11, Geoid Separation • Field 12, Geoid Units (M=Meters) • Field 13, Age of Diff Correction in seconds • Field 14, Diff Reference

Simpson3.qxd

11/5/2007

3:48 PM

Page 37

FIGURE 3

FIGURE 2 RMC: Recommended Minimum Specific GNSS Data • Field 1, UTC Time in the format of hhmmss.sss • Field 2, Status (A=Valid Data, B=Invalid Data) • Field 3, Latitude in the format of ddmm.mmmm • Fields 4, N/S Indicator (N=North, S=South) • Field 5, Longitude in the format of dddmm.mmmm • Field 6, E/W Indicator (E=East, W=West) • Field 7, Speed over ground in knots • Field 8, Course over ground in degrees • Field 9, Date in the format of ddmmyy • Field 10, Magnetic Variation in degrees • Field 11, Mode (A=Autonomous, D=DGPS, E=DR) Both the GGA and RMC fields will give you the Longitude and Latitude, but only the GGA will report the Altitude and Fix Type. The RMC command will report your course and speed. So, it’s clear that we need to parse both of these commands to

gain all the information.

Data Logger

included both PC and FIGURE 4 Pocket PC versions that will handle all the modules and receivers discussed in this series. You select the device using the Device menu shown in Figure 3. This will set the correct baud rate and enable special setup commands needed for the Etek and Copernicus modules. You start the data collection by hitting the start button shown in Figure 4. The program will then open the com port indicated and initialize the GPS module, if needed. Collected data will be saved to the file indicated. If you want to save the file into the same directory as the GPSDataLogger program, precede the filename with a decimal point as shown in Figure 4. As data is collected and saved, it is also parsed. The NEMA commands GGA, GSV, GSA, and RMC are all parsed. The pertinent information is

To help you understand the GGA and RMC commands a little better, let’s start out by building a data logger. Data loggers are invaluable because they let you collect test data that you can later use to help you test and refine your projects without having to resort to field tests. As shown in Figure 2, the data logger is straightforward. I have FIGURE 5

FIGURE 6 SERVO 12.2007

37

Simpson3.qxd

11/5/2007

3:48 PM

Page 38

Figure 8. When in real time, the data will be processed GGA_UTCTime based on the UTC time stamp GGA_Latitude in the message. What the GGA_NS GGA_Longitude program does is look for GGA_EW differences in the seconds in GGA_FIX the UTC field. When it sees a GGA_FIXtxt discrepancy, it delays the procGGA GGA_Sats GGA_HDOP program for one second. GGA_AltValue For actual plotting, you GGA_AltUnit can use the program called GGA_Sep GGA_SepUnits GPSLogPlot shown in Figure 9. GGA_Age This program will allow you to GGA_Diff plot your actual trip. By default, RMC_UTC the program sets the scale to RMC_Status 200. This divides plot points by RMC_Latitude 200, thus shrinking the plot to RMC_NS RMC_Longitude fit on the display. You can procRMC RMC_EW change this using the settings RMC_SOG menu. When plotting short RMC_COG RMC_Date distances, use a smaller scale. RMC_Variation When you start the plot, RMC_Mode the first valid point becomes GSV_SATSINVIEW the reference starting point GSV_NOM that will be — by default — the GSV_MSG center point on the display. GSV_SATIDS(x) GSV_SATELE(x) You can change this point by GSV_SATAZ(x) changing the Start x and Start procGSV GSV_SATSNR(x) y points in the settings menu. The actual plot area is a 1000 When GSV_NOM = GSV_MSG then all data has been x 1000 grid. You can change collected. At that point you should the view of this grid by using set GSV_NOM = 0 the small pad on the form GSA_SATMODE shown in Figure 10. The procGSA GSA_SATCOUNT center button will center the TABLE 1 view to its default. The plots shown in Figure programs to allow you to do just that. 11 were all captured with the The GPSLogDisplay program shown in GPSDataLogger and my pocket PC Figure 6 will display all the pertinent using the BT359W shown in Figure 12. information. You select the log file This is the most accurate GPS I have captured with the GPSDataLogger ever owned. The main reason I have not program by selecting the File Menu as showcased it in this series is that it is a shown in Figure 7. Bluetooth only receiver. You can use the You have the option of displaying same interface program as the Holux the data as fast as your computer can GPSLim236. Unlike the GPSLim236, the process the data, or in real time by BT359W does supports WAAS. setting the RealTime menu shown in Function

FIGURE 7

FIGURE 8

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

Data Plotter You will want to view the data you collected. I have created two FIGURE 10

38

SERVO 12.2007

FIGURE 11

Variable Populated

GPS Parsing Software

While I have included the compiled version of the programs presented in this article, I have also included the source code for those that may want to

Simpson3.qxd

11/5/2007

3:51 PM

Page 39

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

FIGURE 12

dim tstr as string dim newtime as string dim oldgpstime as string FormMenu(0,0,0,””) FormButton(Disp_Start,-1,-1,-1,-1,”Abort”) ‘First Open the File if FileOpen(1,gfname,Open) = 0 then msgbox(“Unable to open file: “+gfname,0,”Open File”) FormMenu(0,0,1,””) FormButton(Disp_Start,-1,-1,-1,-1,”Start”) exit() endif ‘============================================================ ‘——- Main Data Display Loop ———————————————loop: if FormButton(Disp_Start,0) > 0 then FileClose(1) FormMenu(0,0,1,””) FormButton(Disp_Start,-1,-1,-1,-1,”Start”) exit() endif

FIGURE 13 roll their own. Each of the programs parse the GGA, RMC, GSV, and GSA NEMA commands. The main NEMA processor function is called ProcNEMA. This function calls four functions to handle the parsing of these commands. Each function populates a set of global variables as shown in Table 1. These variables map to the fields in the NEMA specification. One exception is the GGA_FIXtxt variable, which contains an actual description of the FIX type. Take a look at the Dispit function shown in Program Snippet. This is the heart of the GPSLogDisplay program. This function is called when the Start button is pressed. The function opens the log file you have selected, then enters a processing loop. In each iteration of the loop, the abort button is checked and a line of data is retrieved from the log file. If the end of the file is reached or the

if FileEOF(1) = 1 then FileClose(1) Print “End of Data” FormMenu(0,0,1,””) FormButton(Disp_Start,-1,-1,-1,-1,”Start”) exit() endif ‘——- Read a Line of data from Log File ————— procNEMA(FileReadLine(1)) ‘——- If we get a GGA message lets update the display strif NEMAmsg = “GGA” then newtime=converttime(GGA_UTCTime,-5)) FormLabel(Disp_time,-1,-1,-1,-1,newtime) Formlabel(Disp_Fix,-1,-1,-1,-1,GGA_FIXtxt) Formlabel(Disp_mode,-1,-1,-1,-1,GSA_SATMODE) Formlabel(Disp_sats,-1,-1,-1,-1,GSA_SATCOUNT) GSV_NOM=0 GSV_MSG=0 if GGA_Fix <> 0 then Formlabel(Disp_Longitude,-1,-1,-1,-1,GGA_Longitude+GGA_EW) Formlabel(Disp_Latitude,-1,-1,-1,-1,GGA_Latitude+GGA_NS) Formlabel(Disp_Alt,-1,-1,-1,-1,GGA_AltValue+GGA_AltUnit) Formlabel(Disp_Course,-1,-1,-1,-1,RMC_COG) Formlabel(Disp_Speed,-1,-1,-1,-1,Format(float(RMC_SOG * 1.1508),”.0”)+” mph”) else Formlabel(Disp_Longitude,-1,-1,-1,-1,””)

continued ...

SERVO 12.2007

39

Simpson3.qxd

11/5/2007

3:51 PM

Page 40

Program Snippet continued ... Formlabel(Disp_Latitude,-1,-1,-1,-1,””) Formlabel(Disp_Alt,-1,-1,-1,-1,””) Formlabel(Disp_Course,-1,-1,-1,-1,””) Formlabel(Disp_Speed,-1,-1,-1,-1,””) endif ‘—- Used for realtime display option strif oldgpstime <> newtime then oldgpstime = newtime if realtime = 1 then pause(1000) endif

selected. The function also calls various setup functions to place the device into the correct mode when needed. Instead of calling the procNEMA function directly, data from the device is added to a global variable called rxdat when it is received. A call is then made to a function called procdata. This function pulls a single line (one at a time) from the rxdat variable and passes them to the procNEMA command as before.

Sending Log Data

endif goto loop endfunc

Program 1

The plotit function in the GPSLogPlot program is very similar to ‘DiosProg1.txt the dispit function, with the exception func main() of how the GPS information is predim val sented. The plotit function uses a spehsersetup baud,HBAUD4800,start,txon cial command built into the Zeus lannodata: guages called GPSCVTLongitudedec hserin nodata,val and GPSCVTLatitudedec to convert debug val the GPS positional string data to an integer value in degrees * 100000. goto nodata This is a whole number that can be endfunc used for plotting. One final variation of the dispit abort button is hit, the file is closed function is the StartCapture function and the function exits. Each line used in the GPSDataLogger program. In retrieved from the log file is passed to this function, a com port is opened and the procNEMA function and only its parameters are when a GGA message is received does set based on the display get updated. the actual device

Plotting and displaying data is cool to play with, but the main reason we want to capture the data is so that we can simulate an actual GPS module or receiver. I have included a program called GPSLogOutput shown in Figure 13. GPSLogOutput allows you to play back the captured log data to a serial port. The program looks and operates much like the GPSLogDisplay program, but also sends a copy of the captured data to a serial com port. You select the com port via the Settings menu shown in Figure 14. You can also set the baud rate and flag the data to be sent in real time.

Using the Log Data with a Microcontroller Next month, when we start to interface the GPS modules to a microcontroller, the GPSLogOutput program will be indispensable. In addition to your PC, you will FIGURE 14 need a DiosPro FIGURE 16

FIGURE 15

40

SERVO 12.2007

Simpson3.qxd

11/5/2007

3:52 PM

Page 41

microcontroller and a carrier board. I will be using the Dios Workboard Deluxe shown in Figure 15. The DiosPro has a UART built into the chip that has a TTL interface. This is perfect for the modules, but in order to use our PC as a simulator, you will need an EZRS232 interface shown in Figure 16. In order to use the GPSLogOutput program, you will need two serial ports on your PC. One port will connect to the program port on the Workboard and the other will connect to the EZRS232 module. Connect the following pins on the EZRS232 module to the Dios Workboard as shown in Figure 17. EZRS232 EZRS232 EZRS232 EZRS232

Pin Pin Pin Pin

1 2 3 4

— — — —

Workboard Workboard Workboard Workboard

FIGURE 17

FIGURE 18 program as shown in Program 2. This library will break down the GGA and RMC commands and load up a

VSS VDD Port 8 Port 9

Load code shown in Program 1 into the DiosPro compiler and program the chip. Once loaded, start the GPSLogOutput program and load up one of the LogData files I have included. Set the GPSLogOutput com port to the one that is connected to the EZRS232 module. Set the baud rate to 4800 as shown in Figure 18. Once this is done, hit the start program. You should see NEMA data in the debug terminal of the Dios compiler as shown in Figure 19. It just so happens that the DiosPro already has a library called DiosNEMA. It is automatically loaded when you place a call to the procNEMA function in your Dios

FIGURE 19

Program 2 ‘Dios NEMA Proccessor func main() clear hsersetup baud,HBAUD4800,start,txon,clear print “Mode Lat Long Alt Speed print “—— ——- ——— ——- ——- ——-”

Dir”

loop: procNEMA() if NEMAcmd = 3 then ‘GGA if NEMAfix > 0 then print NEMAfix,”:”,NEMAsats,” “,{-6.0} NEMAlatmin,” “,NEMAlongmin; print “ “,{6.1} NEMAaltitude,” “,{4.1} NEMAspeed,” “,NEMAdir else print “No Fix “,NEMAfix,”:”,NEMAsats endif endif goto loop endfunc

FIGURE 20

include \lib\DiosNEMA.lib

SERVO 12.2007

41

Simpson3.qxd

11/5/2007

3:53 PM

Page 42

Parts List The following is a breakdown of sources for all the components needed for Parts 1 through 4 of this project. SPARK FUN ELECTRONICS EM-406A GPS Module www.sparkfun.com/commerce/ product_info.php?products_id=465

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

set of global variables that you can use in your own program. In Program 2, I used the print command to send various pieces of NEMA data to the debug terminal shown in Figure 20.

42

SERVO 12.2007

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

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

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

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

KRONOS ROBOTICS EZRS232 www.kronosrobotics.com/xcart/ product.php?productid=16167

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

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

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

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

What’s Next

how to parse the data. Be sure to check for updates and downloads for this article at www.kronosrobotics.com/Projects /GPS.shtml SV

Next month, I’m going to show you how to connect the various GPS modules to the microcontroller and

Conn.qxd

11/1/2007

11:10 AM

Page 43

by Karla Conn

R

ewards and punishments can serve as fundamental motivations for learning. Think of how you train your dog through tasty treats or the occasional knock on the nose. Your robot isn’t much different. You can reward a robot for staying on target or punish it for getting out of line in much the same way. Dogs already know how good a treat is and can associate the reward with their behavior. Robots, however, need to be taught what a reward is and how to relate it to their actions. Reinforcement learning (RL) is a technique for educating your robot about actions that are beneficial or detrimental. Let’s work with a barebones example. Say you want to teach your

robot to stop at a goal one foot in front of it. You could program that behavior directly, but that approach could get tedious or tricky with more complex scenarios. What if you want the robot to find its way through a maze? What if you want the robot to find the quickest path through a range of terrains? Or the most optimal grip for an assortment of drinking cups? Or the optimal tilt angle to shoot a projectile? RL can help. First, you have to define a goal, actions, states, rewards, a policy for choosing actions, and a value function for the states. In

general, for each time step t, an action a is taken, the state s is updated, and reward r is given (Figure 1). Let’s go back to the example of stopping at a goal one foot in front of a starting point. We will need a sensor (e.g., odometry) that can return how far the robot has moved. Next,

FIGURE 1. Basic relation between a robot and an RL environment.

SERVO 12.2007

43

Conn.qxd

11/1/2007

11:11 AM

Page 44

Start Initialize Parameters

Goal Found?

N

Use Policy to Choose Action

Take Action

Y

Update State Give Reward

Stop

Update State Value

we need to define the scenario (see Table 1). A program flowchart and the central loop of the corresponding example code are shown in Figure 2. Go to www.servomagazine.com to download RL_stand_alone_example.cpp for the full C++ code. To begin the RL algorithm, we initialize the odometry, starting state, starting action, reward, and the values of the states. The robot will begin stopped (a2) at a location away from the goal (s2) and then use the policy to select actions. With each action taken, the state is updated and a reward is given based on the new state. The objective is to take actions that lead to the current state matching the goal (s1). While the current state is not the

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

goal, the robot takes actions based on the policy (e.g., randomly). Then, sensors are used to determine the new state and a reward is given. Values of the states (value_s1, value_s2) are updated based on the reward until the search for the goal is satisfied. Once the goal is found, the robot can stop. In the above example, say the first action randomly chosen is stop. The odometry would be updated (i.e., less than one foot), and the state would be updated based on the definitions (since odometry < one foot, new state = not goal, represented by s2). Therefore, the reward given for the state would be zero, and the value function would update the state value by adding the current state value to the reward

Table 1 Goal: Actions (a1, a2): States (s1, s2): Reward: Policy: Value:

44

SERVO 12.2007

When odometry ≥ one foot a1 = move forward a2 = stop s1 = goal s2 = not goal If current state = not goal, reward = 0 If current state = goal, reward = 1 Random selection New state value = current state value + reward

FIGURE 2. Program flowchart (left) and central while loop of RL_stand_alone_example. cpp (right).

(s2 = 0 + 0). Say the next action randomly chosen is move forward and the robot moved at least a foot, then the odometry would read at least one foot or more. The updated state would be set to s1 (i.e., since odometry ≥ one foot, new state = goal). Therefore, the reward given would be one, and the value function would update the state value (s1 = 0 + 1). The while loop would be satisfied and since the robot has found the goal, it can stop. The result is an educated set of state values that can be used in later runs of the program to improve performance. Intrigued with how the algorithm works? Impressed? Unimpressed? Perhaps. The above example outlines a mere foundation for a valuable way to teach a robot. RL is valuable because it can adapt to so many different situations and remains flexible enough to accommodate a variety of goals and/or state definitions. In the remainder of this introductory article, I will touch on some ways you can compound on the basics set up so far and give examples of where to try your own RL ideas. First, a bit of fair warning. Your robot may need lots and lots of iterations (maybe hundreds or thousands of runs, depending on the application) before the RL algorithm settles on an optimal solution. So schedule adequate time for your robot to learn, but don’t let that word of caution stop you from giving your robot the means to learn on its own. Don’t be confined to the definitions in the above basic example, either. There are plenty of ways to expand on the RL parameters. For example, instead of random selection, the policy can choose to

Conn.qxd

11/1/2007

11:11 AM

Page 45

Table 2 Goal: Actions (a1, a2, a3): States (s1, s2, s3, s4):

Reward:

Policy: Value:

When odometry ≥ two feet a1 = move forward a2 = stop a3 = move backward s1 = goal (odometry ≥ two feet) s2 = not goal (two feet > odometry ≥ one foot) s3 = not goal (one foot > odometry ≥ zero feet) s4 = not goal (zero feet > odometry) If current state = s4, reward = -8*time_step If current state = s3, reward = -4*time_step If current state = s2, reward = -1*time_step If current state = s1, reward = 100 60% move forward, 30% highest state-action pair value, 10% random New state-action pair value = current state-action pair value + reward

move into states with the highest value. Preference could also be set to choose moving forward, turning left, etc. Modifications can certainly be made to the definitions for states and actions. Also, initializing the state values to zero is common, but assigning specifically-chosen values or randomly populating state values is permitted. Rewards can also be negative (punishments) to penalize states that move away from the goal, and any piece of data which you wish to maximize or minimize can be used as part of the reward function. For instance, what if you want your robot to learn to choose actions which find the goal quickly? Incorporate a variable to represent time or the number of steps taken to find the goal in a negative reward function (reward = -full_reward*time_step). A slightly negative step-based reward is like giving your robot a little kick at each step toward the goal, training it to hurry up and find the goal faster. A constructive addition to an RL algorithm is the combination of states and actions into state-action pairs. This concept is called Q-learning, where Q(s,a) represents the value of taking action a in state s. This way, the reward function rewards the state-action pair that caused the action to move from a non-goal state into the goal state. Multiple runs can develop the Q(s,a) values for all state-action pairs in

a task until the optimal solution is found. Even if the optimal solution is not found (due to equivalent solutions), each run can refine the Q(s,a) values towards closer representations of the true value of taking action a in state s. Table 2 shows a set-up for an RL algorithm with (i) a policy with a preference for moving forward, (ii) multiple states besides the goal, and (iii) a slightly negative step-based reward function. A full example of this C++ code (RL_expanded_example.cpp), including a random population of the state values and state-action pairs, can also be downloaded from www.ser vomagazine.com. Once mastered, you can use this algorithm in loads of applications. You simply need a task with a goal. Then you define your states, actions, rewards, policy, and value function. Say you want your robot to learn how to coordinate its leg movements to crabwalk. Define plausible states and actions, and set a reward function based on forward movement. Then let your robot loose to learn. Give your robot plenty of chances to find the goal, and you’ll have a self-sufficient robot in no time. Once your robot can learn to associate rewards with its actions, challenge it to a duel of who can find the quickest path through a maze or over rough terrain. Reward yourself and your robot accordingly. SV SERVO 12.2007

45

Skoglund.qxd

11/5/2007

4:01 PM

Page 46

Programming By Demonstrating Robots

TASK PRIMITIVES

by Alexander Skoglung and Boyko Iliev

It is relatively easy for humans to imitate a task shown to us. This ability to imitate is well developed both in us and in other primates, but rarely found in other animals. Think of a pet; it is not straightforward to just show your dog how to fetch the newspaper. So, it should be no surprise that it has been very hard to design a robot with the same imitating capabilities as humans.

I

t is an appealing thought to have a robot that can be instructed how to perform a task by simply showing it what to do. It would save a lot of time otherwise spent on programming the robot. The concept to simplify robot programming by giving the robot abilities to mimic tasks shown by the user is called Programming by Demonstration, or PbD. In future applications where robots are assumed to be found everywhere in our life it would also be advantageous to give them instructions on exactly how we want a task performed simply by showing the task. Another reason to try simplifying robot programming is that smaller enterprises with shorter production series might

46

SERVO 12.2007

then become interested in automating their production.

Motion Capturing The first step in the PbD process is to capture the data. That is, record and store the motions performed by the human demonstrator and their impact on the environment. Several options using different measurement principles are available for this purpose. If a visionbased system is used, the human can move without too many constraints These systems require rather heavy image processing, though. In most cases, the system tracks different markers attached to certain body parts and the limb motion

is reconstructed with the help of a kinematic model of the human body. It is also possible to extract human body motions directly from raw image data. Another option is to use a dedicated wearable motion capturing system (popular for movie making and analyzing motion in sports). The measurement system is firmly attached to the areas of the body that need to be captured. This type of system requires less data processing, however, the user cannot move as freely. Another catch is the price; for example, a reliable six degree of freedom tracker starts at about $10,000! Another issue with a wearable data capturing system is that the information the sensors can pick up is limited to a

Skoglund.qxd

11/5/2007

4:02 PM

Page 47

specific area. For example, a glove will only provide data on the finger’s configuration; no data will be available on hand position and orientation, or objects in the sensor’s vicinity. Basically, the sensor is ”blind” to the environment. Data fusion — to combine several inputs into a single source — is often necessary in order to gather information surrounding the motion capturing device. In structured environments (such as factory lines), CAD models can be used to aid the data capturing instead of using more sensors.

Task Primitives Another important aspect to consider is what your robot is capable of. The mechanical structure of the robot will determine what tasks and motions it can perform. For example, Figure 1 shows a six degree of freedom robot arm with the elbow in an up position. It is important to distinguish between tasks and motions. Returning to the example of a dog fetching your newspaper, the dog can perform the required task, but in a different way (or motion) than you would since dogs don’t have hands. (Of course, you could do it the same way as your dog). The difference between human and robot body configurations means that the robot may be able to perform a task, but not with the same motion as a human. Therefore, the human needs to know how the robot behaves. To approach the problem of different body configurations, there are two assumptions to be made that will simplify the process. First, the human’s and robot’s end effectors (the human’s hand and the robot’s gripper) can be associated with each other. Second, the task can be seen as a set of subtasks. In the the case of subtasks, consider a fairly general task such as Pick-and-Place commonly performed by industrial robots. Break the task down into smaller building blocks: Move-ToPoint, Move-Linearly-To-Point, MoveAlong-Path, Approach-Object, GraspObject, Release-Object, and so on. Given a clever design of these building blocks, a great number of tasks can be described by a small set of task

primitives. Each of these building blocks can be seen as small robot programs that — when put in sequence — will produce a full task. One of the big challenges in PbD is how to map the demonstrated task to these primitives. Researchers are currently trying to solve the daunting challenge of how a robot should learn completely new and novel tasks from a set of predetermined primitives. For an industrial robot that only performs Pickand-Place operations, learning novel tasks is clearly requesting too much. A number of basic facts about the task are usually known in advance. In a Pick-and-Place operation, the robot starts from a certain position, moves to an object, grasps the object, moves the object to a new location, releases the

object, and moves away from it. It is our belief that future manipulators should be simple to program and have these basic behaviors built in. To simplify mapping from the demonstration of primitives, we make the assumption that the robot’s end-effector is corresponding to the demonstrator’s hand; by doing so, we indirectly tell the robot that only the human’s end effector’s trajectory is of importance. Besides recording the end effector’s motion path, the velocity profile (Figure 2) provides important information about where the motion segments start and end. In a Pick-and-Place task, we know the order of sub-tasks (illustrated in Figure 2). The first detected point is associated with the location to pick up

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

SERVO 12.2007

47

11/5/2007

Mean Squared Velocisty (mm)

Skoglund.qxd

4:02 PM

Page 48

MoveToPoint MoveAlongPath

700

MoveToPoint

600

500

MoveAlongPath

MoveAlongPath

400

300

GraspObject

ReleaseObject

200

100

Second motion

First motion 0

0

1

2

3

4

5

Third motion 6

7

8

9

10

Time (sec)

FIGURE 2. The blue line is the mean squared velocity from a human demonstrator, recorded from the fingertip at 12 Hz. The green vertical lines are the detected start of a motion, where the velocity profile is over a certain threshold and the increase is over a certain level. In a similar way, the red vertical lines are the end of a motion.

an object; the second location is where to place the object. The trajectory between these two locations should be imitated, but the start and end points are not important since they are not actually parts of the task. However, the segment on the trajectory just before the grasp and after the release should be imitated to preserve the way the grasp is performed. When the different variables (such as locations, velocities, and orientations) of the task are determined, the sequence of instructions is transferred to the robot controller. The sequence could look like this: 1) 2) 3) 4)

<Move-To-Point 640,30,80> <Move-Along-Path 648,25,87> <Move-Along-Path 647,28,90>

By doing so, we assume the lower control levels of the manipulator, such as inverse kinematics, constraints of the workspace, generation of the trajectory with a higher granularity, etc., to execute the requested commands in the proper way. It is important to note that other primitives than these can be used. For example, some tasks require the robot to reorient an object, turn an object several times (assembly tasks), and so on. Consider the capabilities of the robot; what motions can the robot do and what motions are impossible? The primitives are small pieces of program code that should reflect what the robot can do and how it would do it, and the human demonstrations put these pieces together in a sequence. A comparison can be made to a programming language, made up by a small set of instructions, from which large programs can be written. In this comparision, these task primitives are an attempt to add some high-level features to robot programming.

Gripper Spring

l

Starting point d Set point

u

48

SERVO 12.2007

FIGURE 3. The vacuum gripper with the spring switch; d is the distance between the target point and the starting point, and is dependent of the sensor inaccuracy, u. When the spring is compressed and the switch turned on, the downward motion immediately stops and the suction is turned on.

An Example Scenario Let’s look at how to teach an industrial robot equipped with a vacuum gripper to execute a Pick-andPlace task. Inside the gripper, a spring with a switch is mounted to detect resistance when picking or placing an object (illustrated in Figure 3). The steps from the demonstration to a robot program would be: 1) A human demonstration is captured and transformed into the robot’s reference frame. 2) Trajectories are segmented to extract the points where the motions start and end. 3) Extracted motions are decomposed into task primitives. 4) Each task primitive is automatically translated into robot-specific code. 5) The complete task is executed by the robot. It is important to note for Step 4 that the task is known in advance which makes it possible to describe the task as a predetermined sequence of task primitives. These task primitives are designed specifically for the robot, but can be executed on most six degree of freedom serial manipulators. The primitives controlling the grasp and release are specific to the

Skoglund.qxd

11/5/2007

4:02 PM

Page 49

type of gripper used. Furthermore, we assume that the demonstrator is aware of the manipulator’s structure, such as workspace boundaries and possible motions. The demonstration is done under the assumption that the teacher’s index finger is associated with the suction cup of the gripper. During demonstration, the fingertip is tracked by a motion capturing device, shown in Figure 4. Initially, the demonstrator moves from a starting point, P0, to the desired pick-point, Ppick (Figure 5). Then, he/she moves along a certain path towards the desired place-point, P0, and finally, back to the end position Pw(t). The collected data consists of position coordinates used for two purposes: to detect the Pick-and-Place positions, Ppick and Pplace, and to reconstruct the desired trajectory that the robot should travel from Ppick to Pplace. The decomposition of a Pick-andPlace task into task primitives is illustrated in Figure 2. By using primitives reflecting the commands available in the robot language of the manipulator, we achieve a simple implementation. In this particular scenario, the following primitives are used: • Move-Linearly-To-Point moves the manipulator’s end effector linearly (Cartesian space) to the desired point in the workspace. • Move-To-Point moves the manipulator’s end effector to the point where it can ”hook on” to the demonstrated trajectory. • Move-Along-Path follows a demonstrated trajectory by taking a sequence of points with relatively high granularity as the input, and then executing an interpolated motion between these points. FIGURE 5. The dotted line is the demonstrated path, starting at P0 going to P0w (t)$, via Ppick and Pplace. The solid line is the robot path with the different starting location, L0, executing the grasp and release primitives just above the Pick-andPlace points, respectively.

FIGURE 4. The 6D-tracker mounted on a data glove that was used to capture the human demonstration.

• Grasp-Object moves towards an object using a ”search” motion (due to the uncertainty of the object’s location) and grasps the object. A search motion moves the gripper slowly towards the object until contact is detected by the touch sensor and the motion is stopped. • Release-Object is similar to GraspObject, but releases the object instead. The two first primitives are typically implemented on standard industrial manipulators as instructions, since most manipulators would be of limited use without such basic instructions. The last three primitives are not normally part of the programming language for industrial robots, so it’s a benefit to add them to the repertoire.

L0 P0 Lw (t) Pw (t) Pplace

Ppick

A “Primitive” Example Now let’s take a closer look at the task primitive Grasp-Object. Before performing a grasp operation, the

Further Reading For those interested, check out the coverage listed below on the subject of robot learning from demonstration: • Robotics and Autonomous Systems, vol. 47, no. 2&3 (2004). • Robotics and Autonomous Systems, vol. 54, no. 5 (2006). • Neural Networks, vol. 19, no. 3 (2006). • IEEE Transactions on Systems, Man, and Cybernetics, vol. 37, no. 2 (2007). Visit the AASS Learning Systems Lab’s webpage at www.aass.oru.se/Research /Learning/. More details on the subject in this article can be found in the paper: A. Skoglund, B. Iliev, B. Kadmiry, and R. Palm. Programming by Demonstration of Pick & Place Tasks for Industrial Manipulators using Task Primitives in the Proceedings of the IEEE International Symposium on Computational Intelligence in Robotics and Automation (CIRA), Jacksonville, FL, 2007.

SERVO 12.2007

49

Skoglund.qxd

11/6/2007

1:53 PM

Page 50

approach phase of the gripper towards the object must be performed. The position and orientation of the table are known since the manipulator is mounted on a table, like the robot in Figure 1. However, the height of the object to be grasped is unknown due to the uncertainty of the sensor, thus the approach primitive has to deal with uncertainty. When performing a grasp

50

SERVO 12.2007

operation, the manipulator is given a goal position to move towards the object and search for contact with it. When a certain resistance is detected (that is, a compliant spring is compressed to a certain length) the motion stops. The starting point is determined by the distance, d, derived from the inaccuracy of the sensor that performs the motion capturing. The retracting motion is the same as the

approach but in reverse. Since the grasp and release primitives are actually the same — but with one binary input variable to decide whether to grasp or release — this pays off in the design process.

Conclusion Task primitives link high-level human instructions to particular robot/gripper functionalities. By using task primitives, the programming of a robot becomes faster and simpler, which is one goal of the PbD concept. One drawback to PbD is that motion capture systems with high accuracy are expensive. Either PbD needs to become less sensitive to inaccuracies (for example, by use of information from additional sensors and intelligent environments) or the price for accurate sensors needs to drop. Another problem is that many motion trackers use magnetic fields for positioning and therefore suffer from degrading accuracy when they’re close to large metal objects or electric motors generating magnetic fields. Alternative trackers are vision based or use optics instead of magnetic fields. Intelligent environments containing RFID tags, passive location sensors, and other sensory units can be a complement to motion capturing sensors when interpreting the environment. One can also think of solutions where more than one primitive can be active at the same time. For example, a gripper can have two primitives for approaching an object from two orthogonal directions. By blending them, one can achieve reaching motions that approach the object from an arbitrary direction. Some of the current research on the topic addresses the problem of action classification where the motions performed by the demonstrator are recognized automatically. However, the design of various task primitives is still needed. The challenge of designing fully autonomous robots is finding a way to enable the robot to generate new task primitives through learning, development, and interaction with humans and the surrounding world on its own. SV

Eady.qxd

11/6/2007

9:34 AM

Page 51

Using FRAM for Non-Volatile Storage

by Fred Eady

Put a new memory technology to work in your robot!

W

hether they be fact or fiction, you don’t see many things robotic moving about with trailing AC line cords. As a matter of fact, if you classify today’s smart weapons as ‘bots, the only serious mobile mechatronic devices that I can think of that may still trail a wire are the early wire-guided anti-tank missiles. Will Robinson’s buddy didn’t drag a cable around. Come to think of it, old Robby didn’t have a “tail,” either. That’s because Will and Robby lived in a time when battery technology was very good. You are fortunate as our battery technology today isn’t too shabby, either. However, even with the best of batteries, there is a possibility that you can lose important pieces of data that your mechatronic creation

has learned or sensed when its “lights go out.” On the other hand, if your roving pile of mechanical parts and transistors is not a hunter-gatherer, you will come to find it a royal pain to reload those special parameters and configuration data that are kept in the robot’s volatile SRAM every time the battery goes south. In many instances, EEPROM is the answer. However, if you have to change your precious data too often, you’ll eventually wear out the EEPROM cells. And, even though EEPROM is a good way to store nonvolatile data, sometimes there just isn’t enough EEPROM available to do the job. If EEPROM densities are too small for your application and you don’t

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

The RAMTRON FM21L16 We are about to embark upon a project that will tie a RAMTRON FM21L16 Ferroelectric Nonvolatile RAM (FRAM) device to a 16-bit PIC24FJ128GA010. The FM21L16 is organized as 128K x 16. This 16-bit FRAM configuration melds well with the 16-bit PIC24FJ128GA010. If your application does not require or cannot handle a 16-bit data bus, the FM21L16 can be configured to run in eight-bit mode, which doubles the available FRAM to 256K x 8. SERVO 12.2007

51

C8 .1uF

52

SERVO 12.2007 39 40

LB UB

12 34 FM21L16

VSS VSS

NC

LB UB

WE OE CE

DQ0 DQ1 DQ2 DQ3 DQ4 DQ5 DQ6 DQ7 DQ8 DQ9 DQ10 DQ11 DQ12 DQ13 DQ14 DQ15

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 DQ0 DQ1 DQ2 DQ3 DQ4 DQ5 DQ6 DQ7 DQ8 DQ9 DQ10 DQ11 DQ12 DQ13 DQ14 DQ15

5 4 3 2 1 44 43 42 27 26 25 24 22 21 20 19 18 7 8 9 10 13 14 15 16 29 30 31 32 35 36 37 38

25 24 23 22 21 20 32 33 34 35 41 42 43 44 49 50 72 76 77 78 81 82 83 84 68 69 70 71 79 80 47 48 6 7 8 9 73 74

A10 A11 A12 A13 A14 A15 A16 LB UB DQ0 DQ1 DQ2 DQ3 DQ4 DQ5 DQ6 DQ7 DQ8 DQ9 DQ10 DQ11 DQ12 DQ13 DQ14 DQ15

CE

WE OE

90 89 57 56 10 11 12 14 96 97 95 1

RC1 RC2 RC3 RC4 RC13 RC14

RF4 RF5 RD0 RD1 RD2 RD3 RD4 RD5 RD6 RD7 RD8 RD9 RD10 RD11 RD12 RD13 RD14 RD15

RB0 RB1 RB2 RB3 RB4 RB5 RB8 RB9 RB10 RB11 RB12 RB13 RB14 RB15

RG0 RG1 RG2 RG3 RG6 RG7 RG8 RG9 RG12 RG13 RG14 RG15

PIC24FJ128GA010

VCAP

OSC2

OSC1

U1RX

U1TX

RB7/PGD

RB6/PGC

RA0 RA1 RA2 RA3 RA4 RA5 RA6 RA7 RA9 RA10 RA14 RA15

RF6 RF7 RF8 RF12 RF13

RF0 RF1 RF2 RF3

MCLR

VSS VSS VSS VSS AVSS VSS

ENVREG VDD VDD VDD AVDD VDD VDD

+

85

64

C1 10uF

RX

52

63

TX

PGD

27 51

PGC

MCLR

C2 .1uF

26

17 38 58 59 60 61 91 92 28 29 66 67

55 54 53 40 39

87 88 52 51

13

75 65 45 36 31 15

86 62 46 37 30 16 2

Y1 OPTIONAL

C3 .1uF

C5 .1uF

6 5 4

C17 .1uF

6 5 4

.1uF

C14

.1uF

C13

TX

2

3

1

10 11

16 13 8

V+

C1-

VVSS

C2+

C2-

T1OUT T2OUT

R1OUT R2OUT

R1 10K

C7 .1uF

SP3232

C1+

T2IN T1IN

VDD R1IN R2IN

U3

R3 1K

3.3VDC

C6 .1uF

3.3VDC

R2 100

3 2 1

RXIN

3 2 1

ICSP CONNECTOR

C4 .1uF

6 15

4

5

14 7

12 9

C11 .1uF

RX

C12 .1uF

C10 220uF

.1uF

C15

.1uF

C16

TXOUT

+

3.3VDC

RXIN

1

3

5

7

9

2

4

6

8

DB9 FEMALE

1

3

5

7

9

2

4

6

8

RS-232 CONNECTOR

TXOUT

NOTES: 1. 10MHz oscillator = DIGI KEY 490-1196-1-ND 2. VCAP = DIGI KEY 511-1447-1-ND 3. Y1 IS OPTIONAL AND IS NOT INSTALLED

SCHEMATIC 1. As you can see, there are plenty of open pins just waiting for you to connect them to something in your FRAM project.

23

17 41 6

VDD VDD ZZ

RE0 RE1 RE2 RE3 RE4 RE5 RE6 RE7 RE8 RE9

U1

9:34 AM

WE OE CE

11 33 28

U2

93 94 98 99 100 3 4 5 18 19

11/6/2007

C9 .1uF

3.3VDC

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9

Eady.qxd Page 52

Eady.qxd

11/6/2007

9:35 AM

Page 53

SCREENSHOT 1. Using a four-layer printed circuit board eliminates the need to route power and ground connections to each hardware device. The latest version of ExpressPCB allows the inner layers to be cut into areas. Being able to separate the inner power and ground layers is great if you have to run multiple voltages or separate ground planes.

As you’ve probably already ascertained, the FM21L16 does not require a battery to retain the data contained within its memory cells. Otherwise, the FM21L16 reads and writes just like a piece of standard volatile SRAM. Once the power is removed from the FM21L16, it can hold on to the data in its possession for a minimum of 10 years. Before you decided to put your FM21L16 into a deep sleep, you can issue up to 100,000,000,000,000 read/write cycles to the device with no concern for loss of data due to memory cell damage. I still have fond memories of hanging 2KB chunks of SRAM from the pins of 8748 and 8751 microcontrollers. The very first of Microchip’s PIC17CXX series of microcontrollers I was exposed to were supported with standard UV-erasable EPROM devices, whose pin layouts resembled their SRAM counterparts. So, I’m glad to see that the FM21L16 has followed in the traditional footprint path that was initiated back in the day by Intel’s line of industry standard EPROM devices. The FM21L16’s industry standard pad layout allows the FM21L16 to be dropped into the space that a standard 128K x 16 volatile SRAM device would take up. In addition to being durable, the FM21L16 is fast; 60 ns reads can be initiated using the FM21L16’s activelow CE pin or by simply changing the address. To prevent accidental data corruption, the FM21L16 utilizes a low voltage monitor that blocks access to the FM21L16’s memory array when the power rail drops below a specified voltage. If you don’t want your FRAM-equipped mechanical device’s computing device to overwrite critical

data within the FM21L16, you have the ability to write protect any of the FM21L16’s eight uniform 16K x 16 memory blocks. The FM21L16 is tough enough to ride in the electronic compartment of an automobile. That means it would prove to be a very macho part inside of your mechanical animal, as well.

Designing the FRAM Controller I don’t know about you, but I love to put electronic stuff together from scratch. So, let’s design and build a PIC24FJ128GA010-based controller that is equipped with a serial port and a FM21L16 FRAM device. Before we

begin, it might be a good idea to examine the FM21L16’s pinout and understand what we need to design in to read and write to the FM21L16’s memory cells. I’ve provided a schematic for you to reference as we discuss the FM21L16’s control pins and I/O lines. Naturally, we will have to deal with assigning the FM21L16’s 17 address lines to PIC24FJ128GA010 microcontroller I/O pins. The PIC24FJ128GA010 does not support 17-bit I/O port configurations. However, there are a couple of 16-bit ports and a few other I/O ports with a minimum of 10 available I/O positions. The trick is to select the port that is easiest to access in relation to the FM21L16’s address

SCREENSHOT 2. Every power and ground connection has been assigned to a power or ground plane in this shot.

SERVO 12.2007

53

Eady.qxd

11/6/2007

9:35 AM

Page 54

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

pin layout. Also, we’ll need to get as many address lines from a single PIC24FJ128GA010 I/O port as possible. Following some brain bashing, I selected the PIC24FJ128GA010’s PORTE for the first 10 bits of the FM21L16’s 17-bit address requirement. The remaining seven bits of PORTB will be used to complete the PIC24FJ128GA010’s 17-bit address bus. The PIC24FJ128GA010’s PORTB is a 16-bit I/O port. However, I’ve used seven of its bits as address lines. Fortunately, I still have a complete 16-bit I/O port that I can apply to the FM21L16’s 16-bit data bus. As you can see in the schematic, I’ve assigned the PIC24FJ128GA010’s 16-bit PORTD I/O

port to handle the FM21L16 data bus duties. The FM21L16’s CE (Chip Enable) pin is used to select the device and begin a new memory access. Taking the FM21L16’s CE pin low while holding the FM21L16’s ZZ input high will kick off a memory access event. The ZZ (Sleep) pin is an important one if your project needs to conserve power. I decided not to dedicate a PIC24FJ128GA010 I/O pin to the ZZ input, which also eliminates us from having to write some ZZ code to support it. If you decide to use the ZZ pin, be sure you understand how it relates to the FM21L16’s CE pin. The FM21L16 datasheet recommends that the ZZ input be tied to Vdd

when it is not utilized. As you can see in the schematic, I follow directions very well. The address data on the FM21L16’s address bus is latched internally on the falling edge of the FM21L16’s CE. The FM21L16 has a special feature that allows page mode reads while the CE pin is low by manipulating the two least significant bits of the address bus. I simply chose the most convenient PIC24FJ128GA010 I/O pin for the FM21L16’s CE line. Since we can choose to manipulate the CE pin or tie it to a logic low level, I designed in a jumper that connects the FM21L16’s CE pin to the PIC24FJ128GA010 or directly to ground. As with the CE pin selection, there is absolutely no science behind my selection of the FM21L16’s WE (Write Enable) line connection. A FM21L16 write cycle is initiated when the activelow WE pin is driven to a low logic level. Data on the FM21L16’s data bus is written into the FM21L16’s memory cells on the rising edge of the WE pulse. The initial high-to-low logic level transition of the WE pin is used to latch in the new column address for page mode write cycles. I decided to control the FM21L16’s OE (Output Enable) line simply because I can. The FM21L16’s active-low OE line allows the contents of the FM21L16’s data bus to be exposed to the PIC24FJ128GA010’s PORTD I/O pins during read operations. Driving the FM21L16’s OE line to a high logic level will tri-state the FM21L16’s data bus. In this project, I could have simply tied the OE line low. I figure we’ll write that one instruction to drive RG3 low and never touch the I/O pin again. If you have other things competing for the PIC24FJ128GA010’s data bus, you must utilize the FM21L16’s OE control pin. The UB (Upper Byte) and LB SCREENSHOT 4. The hard work is done. All of the 17 address lines and 16 data lines are in place in this shot.

54

SERVO 12.2007

Eady.qxd

11/6/2007

9:36 AM

Page 55

SCREENSHOT 5. Sometimes even a blind hog finds an acorn. Everything fits and everything is connected. The next step involves getting the board manufactured and getting it populated.

(Lower Byte) FM21L16 control pins are very interesting. Depending on how you drive UB and LB, you can read and write the most significant byte only or read and write the least significant byte only or read and write all 16 bits of the FM21L16’s data bus. Taking the FM21L16’s UB pin high will tri-state the most significant byte (DQ15:8) of the FM21L16’s 16-bit data bus. Conversely, a high logic level applied to the LB control pin will tri-state the least significant byte (DQ7:0) of the FM21L16’s 16-bit data bus. There was no way I was not going to put some PIC24FJ128GA010 control behind these two FM21L16 control bits. The FM21L16 wants to see a voltage rail that resides between 2.7V and 3.6V. The absence of a voltage regulator circuit in the schematic leads one to the conclusion that I’m supplying the FRAM’s and PIC24FJ128GA010’s power via a 3.3V wall wart. We’ll have no way of knowing what’s inside the FRAM without having some way of communicating the state of the data at a certain address to a human. I’m still on the fence about throwing away my RS-232 interface for a USB interface. So, what you see in this design is a standard 3.3V RS-232 interface driven by a tried and true SP3232 circuit. All that’s left to do is assign a 0.1 µF power supply bypass capacitor to each Vdd pin in the design and connect the PIC24FJ128GA010’s internal voltage regulator capacitor between Vcap and ground. Note that the PIC24FJ128GA010’s ENVREG (Enable Voltage Regulator) pin is tied logically high to enable the PIC24FJ128GA010’s internal voltage regulator circuitry. It all looks good on paper. So, let’s translate the schematic’s contents to a physical device.

Building up the Controller I used the services of ExpressPCB to design and fabricate our FRAM controller printed circuit board (PCB). To make things easy, I opted to put the FRAM hardware down on a fourlayer PCB. The very first thing I do after determining a preliminary layout is assign and make the power connections to the PCB’s inner planes. Connecting pins to the power and ground planes of a four-layer PCB is a simple ExpressPCB procedure. Take a look at Screenshot 1. I’ve laid in a 0.026” via, connected it to the appropriate PIC24FJ128GA010 power

pin, selected the via, right-clicked on the via, and assigned the via connection to the power plane of the PCB. I performed the power and ground assignment task against all of the PIC24FJ128GA010, FRAM, SP3232, and ICSP power pins. The entire set of FRAM controller power plane connections can be seen in Screenshot 2. The schematic really organizes things nicely. However, you’re reading a technical magazine and I know you want the skinny on the actual PCB design. So, I’ve chronicled the FRAM PCB layout process in a series of screen captures for your enjoyment. After I laid in the power and ground connections, I took on the task of routing the 17-bit address bus. Note

SCREENSHOT 6. This is a shot of the MPLAB Watch window following a run of the MAIN ROUTINE. If you take a pencil to the PORTB and PORTE bits, you’ll see that together they form an address of 0x1FFFF.

SERVO 12.2007

55

Eady.qxd

11/6/2007

9:37 AM

Page 56

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

PIC24FJ128GA010’s internal Fast RC Oscillator (FRC). We’ll boost the PIC24FJ128GA010’s native FRC from its default 4 MHz to 16 MHz using the PIC24FJ128GA010’s internal 4X PLL. The Microchip C30 C compiler will be our firmware vehicle and we’ll use the Microchip REAL ICE as our programming/debugging platform. Both the C30 C compiler and the REAL ICE will fall under the command of Microchip’s MPLAB IDE. Let’s begin the firmware creation process by assigning firmware variables to the actual hardware connections. Here’s the code: that in Screenshot 3 I attempted wherever possible to route the top layer traces horizontally in relation to the bottom layer traces, which are routed vertically. You can see that attempting to route in power and ground traces would have made this PCB design task take on a certain odor of ugly. Another advantage to using a four-layer PCB is that the internal ground plane reduces electronic noise in the FRAM controller’s circuitry. Screenshot 4 folds in the 16-bit data bus connections between the PIC24FJ128GA010 on the left and the FM21L16 on the right of the shot. You never know until you get deep into it if your preliminary device layout will actually work out. From the looks of Screenshot 4, we may have lucked out. The rest of the connections to the FRAM control pins, the RS-232 port, and the ICSP programming/debugging port can be seen in the full-board capture represented in Screenshot 5. Four days later, everything that you now see as paper and electronic images becomes reality in Photo 1. I check my PCB designs over at least 10 times before submitting them for manufacture. As it turned out, I found three minor mistakes that I corrected after photographing the FRAM controller board. The ExpressPCB PCB layout file I have provided for you via the SERVO website (www.servo magazine.com) incorporates all of the corrections. Be aware that the FRAM controller PCB you see in Photo 1 is a prototype version. If you want the pretty silkscreen and solder mask, order a production version of the FRAM PCB. Also, before submitting your FRAM controller PCB for manufacture, remove or move the silkscreen legends I placed on the pads of the resistors and capacitors to allow for reliable soldering. Now that we’ve taken our FRAM controller from paper to printed circuit board, let’s give it some smarts.

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

56

SERVO 12.2007

//****************************************************** //* FRAM CONTROL PINS //******************************************************# define WE LATGbits.LATG2 #define OE LATGbits.LATG3 #define CE LATCbits.LATC14 #define LB LATFbits.LATF4 #define UB LATFbits.LATF5 //****************************************************** //* DATA BUS DEFINITIONS //****************************************************** #define data_in PORTD #define data_out LATD #define data_lo 0 #define data_hi 1 #define rd_data TRISD = 0xFFFF #define wr_data TRISD = 0x0000 //****************************************************** //* ADDRESS BUS DEFINITIONS //****************************************************** #define addrlo LATE #define addrhi LATB

This is pretty simple stuff that will save you lots of time when you start coding. Rather than trying to remember what pin does what, I have given each pin a logical name that relates to its function. We’ll use the data_lo and data_hi definitions when we write the code to read the FRAM in eight-bit mode. The rd_data and wr_data definitions will allow us to easily put the PIC24FJ128GA010’s data bus port into input or output mode. We already know that we’ll have to test this puppy. So, why not go ahead and put aside some variables that will store what we read from the FM21L16. Here they are: unsigned int char

framdata16; framdatalo, framdatahi;

We’ll use framdata16 to read the 16-bit data value and framdatalo/framdatahi to store the results of eight-bit reads. We now have enough stuff tied down to begin seriously

Eady.qxd

11/6/2007

9:37 AM

Page 57

writing our FRAM I/O routines. Since the very first thing one would do to access the FM21L16 is write the desired address to the FRAM address pins, let’s put together a routine to write the memory cell address to the FRAM’s address bus. Recall that we split the PIC24FJ128GA010’s address bus between the E and B I/O ports. Therefore, we must do some minor bit manipulation to get the correct address out onto the PIC24FJ128GA010’s address bus. No problem: //****************************************************** //* WRITE FRAM ADDRESS //****************************************************** void wr_fram_addr(unsigned long addr) { addrlo = addr & 0x000003FF; addrhi = (addr & 0x0001FC00) >> 1; }

The addrlo alias is actually PORTE of the PIC24FJ128GA010. Since PORTE only consists of 10 bits, we provide a mask value of 0x3FF to capture all of the PORTE address information. If you count the “1” bits in the addrhi mask, you’ll come up with seven. That’s how many more bits we need to assemble to complete the 17-bit FRAM address. The most significant seven bits of PORTB are represented by the alias addrhi and we need to put the most significant bit of the FRAM address into the most significant bit of addrhi. That explains the one-bit shift to the right. We have the option of performing three types of read operations. Here’s the code for a 16-bit FRAM read: //****************************************************** //* 16-BIT FRAM READ //****************************************************** unsigned int rd_fram16(void) { unsigned int data; rd_data; //PIC24FJ128GA010 data bus = input mode UB = 0; //enable upper byte of FRAM data bus LB = 0; //enable lower byte of FRAM data bus WE = 1; //make sure write is disabled CE = 0; //begin the read access Nop(); //access time wait data = data_in; //read the data into the PIC CE = 1; //terminate the read cycle return data; }

Before we do anything else, we must put the PIC24FJ128GA010’s data bus (PORTD) into input mode. That’s what the rd_data macro does for us. Putting both the UB and LB FRAM control lines at a logic low level enables the full 16-bit FM21L16 to the PIC24FJ128GA010’s PORTD. We are clocking the PIC24FJ128GA010 at 16 MHz, which means we have a 125 nS cycle time. Thus, one NOP (No Operation) instruction is plenty of time for the FM21L16 to respond to a read operation. We also have enough time for a full FRAM write cycle, which has a maximum duration of 110 nS. Performing eight-bit FRAM reads is just as easy as pulling

off a 16-bit read operation. Using the UB and LB FRAM control pins allows us to read either the high byte or low byte of the FRAM data bus. I wrapped both read types into a single function: //****************************************************** //* 8-BIT FRAM READ //****************************************************** unsigned int rd_fram8(char mode) { unsigned int data; rd_data; switch(mode) { case data_lo: //read the low data byte only UB = 1; //kill the FRAM upper byte LB = 0; //enable the FRAM lower byte WE = 1; //make sure write is disabled CE = 0; //begin read process Nop(); //read access time data = data_in & 0x00FF; //get data CE = 1; //terminate read operation break; case data_hi: //read the high data byte only UB = 0; //enable the FRAM upper byte LB = 1; //kill the FRAM lower byte WE = 1; //make sure write is disabled CE = 0; //begin read process Nop(); //read access time //read and adjust FRAM data data = (data_in & 0xFF00) >> 8; CE = 1; //terminate read operation break; } return data; }

To use the eight-bit read, you must enter the mode (data_lo or data_hi) as an argument to the rd_fram8 function. Nothing to it, right? That’s it for the FM21L16 read functions. Let’s move on and do the FRAM write function coding. I’m sure you have a good grasp of what to do here. See how close you came in your mind to writing the same 16-bit FRAM write code I’ve presented here: //****************************************************** //* 16-BIT FRAM WRITE //******************************************************* void wr_fram16(unsigned int data) { wr_data; //PORTD = output mode UB = 0; //enable upper FRAM byte LB = 0; //enable lower FRAM byte data_out = data; //put the data on PORTD CE = 0; //access the FRAM WE = 0; //begin the write cycle Nop(); //write cycle wait WE = 1; //terminate write cycle CE = 1; //terminate FRAM access rd_data; //return PORTD to input mode }

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

57

Eady.qxd

11/6/2007

9:37 AM

Page 58

//****************************************************** //* 8-BIT FRAM WRITE //****************************************************** void wr_fram8(char data, char mode) { wr_data; switch(mode) { case data_lo: UB = 1; //kill the FRAM upper byte LB = 0; //enable the FRAM lower byte data_out = data & 0x00FF; //data on PORTD CE = 0; //access the FRAM WE = 0; //begin the write operation Nop(); //write cycle time WE = 1; //terminate the write cycle CE = 1; //terminate FRAM access break; case data_hi: UB = o; //enable the FRAM upper byte LB = 1; //kill the FRAM lower byte //put data out onto PORTD data_out = (data & 0xFF00) >> 8; CE = 0; //access the FRAM WE = 0; //begin the write operation Nop(); //write cycle time WE = 1; //terminate the write cycle CE = 1; //terminate FRAM access break; } rd_data; }

Note that the FRAM’s OE pin is never accessed in the read routines. That’s because I set OE to a logical low at the beginning of the FRAM read/write program: int main(void) { CLKDIV = 0; OE = 0;

//no clock division //set OE active

Since we’re already there, let’s continue with the FRAM read/write main program flow: //****************************************************** //* INITIALIZE I/O PORTS //****************************************************** //make PORTB data bus pins digital AD1PCFG = 0xFE00; LATB = 0x01FF; TRISB = 0x01FF; LATC = 0xFFFF; TRISC = 0x4FFF; LATE = 0x0000; TRISE = 0x0000; LATF = 0xFFFF; TRISF = 0xFFCF; LATG = 0xFFFF; TRISG = 0xFFF3;

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

58

SERVO 12.2007

It’s always a good idea to control your own destiny when it comes to initial logic levels. In the code snippet that follows, I made sure that all of the FRAM control pins were in a state that disabled any read or write access to the FRAM: //****************************************************** //* INITIALIZE FRAM //****************************************************** CE = 1; WE = 1; OE = 1;

If we’re going to use the FRAM controller’s RS-232 port, we’ll need to support it with some code. I used the C30 C compiler’s mathematician to compute the RS-232 port baud rate divisor: #define #define #define #define

YFREQ PLLMULT FCY BAUDRATE

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

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

Recall that the PIC24FJ128GA010’s internal FRC defaults to 4 MHz at reset. I simply used the PIC24FJ128GA010’s configuration bits to set up the FRC and turn on the PLL: _CONFIG1(JTAGEN_OFF & GCP_OFF & BKBUG_ON & COE_OFF & ICS_PGx2 & FWDTEN_OFF) _CONFIG2(IESO_OFF & FNOSC_FRCPLL & FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_NONE) If you’re not familiar with the _CONFIGx language, just view the PIC24FJ128GA010.h include file, which is part of the Microchip C30 C compiler package. Once the compiler has ciphered BRGVAL, all I have to do is plug it in. The rest of the UART registers default to the standard RS-232 parameters and only require bits to be set to enable the UART circuitry: //****************************************************** //* INITIALIZE UART1 //****************************************************** U1BRG = BRGVAL; U1MODE = 0x8000; // Reset UART to 8N1 and enable U1STA = 0x0400; // Rst status reg, enable TX,RX _U1RXIF=0; // Clear UART RX Interrupt Flag

I decided to show you the UART interrupt flag even though we’re not going to use UART interrupts in this project. If you decide to expand upon the FRAM controller project, you’ll most likely need to use the UART in interrupt mode. We’re at the top of the hill now. All of the FRAM read/write functions are in place and the UART is ready for action. Let’s run a 16-bit FRAM write cycle and utilize all of the read modes as a test case:

Eady.qxd

11/6/2007

9:38 AM

Page 59

//****************************************************** //* MAIN ROUTINE //****************************************************** framdata16 = 0; //clear the variable //put 0x1FFFF on the FRAM address bus wr_fram_addr(0x001FFFF); //write 0x1234 to address 0x1FFFF wr_fram16(0x1234); //read the address we just wrote to framdata16 = rd_fram16(); //read the lower byte of address 0x1FFFF framdatalo = rd_fram8(data_lo); //read the upper byte of address 0x1FFFF framdatahi = rd_fram8(data_hi); // Print values to terminal emulator printf(“\r\n0x%04X”,framdata16); printf(“\r\n0x%02X”,framdatahi); printf(“\r\n0x%02X”,framdatalo); while(1); //loop here forever

The terminal emulator I refer to in the MAIN ROUTINE code snippet is called Tera Term Pro. Tera Term Pro is a free download from the web. The results of running the MAIN ROUTINE code are shown in the MPLAB Watch window capture you see in

Sources • Microchip (www.microchip.com) PIC24FJ128GA010; MPLAB; C30 C Compiler; REAL ICE • RAMTRON (www.ramtron.com) FM21L16 • ST Micro (www.stmicro.com) SP3232

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

It’s Your Data So, put a RAMTRON FM21L16 to work for you. To make implementing a RAMTRON FM21L16 a bit easier for all of you, I have provided a copy of the code and the ExpressPCB layout files for you on the SERVO website. The PIC24FJ128GA010 has plenty of analog-to-digital converters, PWM, and digital I/O that I didn’t touch. Use my ExpressPCB layout to expand upon the design to meet your robotic needs. See you next time. SV

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

STEER WINNING ROBOTS WITHOUT SERVOS!

P

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

Order at (888) 929-5055 SERVO 12.2007

59

LessonsFromTheLab.qxd

11/5/2007

4:19 PM

Page 60

// 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

NXT Packbot: Part 2 L

et’s pick up where we left off in October and add the shoulders and a few other pieces to the NXT Packbot.

STEP 1:

A bi-month column foly r kids!

LESSONS FROM THE LABORATORY by James Isom Parts:

STEP 2:

Parts:

Left Shoulder: The shoulders are mirror images of one another. I included both sets of steps just in case you don't like puzzles.

STEP 3:

STEP 6:

Parts:

STEP 4:

Parts:

SERVO 12.2007

STEP 5:

Parts:

Parts:

STEP 7:

60

Parts:

LessonsFromTheLab.qxd

11/5/2007

4:19 PM

Page 61

Parts:

STEP 8:

STEP 9:

Parts:

STEP 10:

Parts:

STEP 11:

Parts:

STEP 12:

Parts:

STEP 13:

Parts:

Right Shoulder:

STEP 14:

Parts:

STEP 15:

Parts:

STEP 16:

Parts:

SERVO 12.2007

61

LessonsFromTheLab.qxd

11/5/2007

STEP 17:

4:20 PM

Parts:

STEP 18:

STEP 24:

62

SERVO 12.2007

Parts:

Parts:

STEP 20:

STEP 22:

Page 62

Parts:

Parts:

STEP 19:

Parts:

STEP 21:

Parts:

STEP 23:

STEP 25:

Parts:

Parts:

STEP 26:

Parts:

LessonsFromTheLab.qxd

11/5/2007

4:21 PM

Page 63

Parts:

STEP 27:

STEP 28:

Attach the Shoulders:

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

STEP 29:

Building and Connecting the Front Strut:

STEP 34:

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

STEP 30:

STEP 32:

Parts:

STEP 31:

STEP 33:

Parts:

STEP 35:

SERVO 12.2007

63

LessonsFromTheLab.qxd

11/5/2007

4:22 PM

Page 64

STEP 36:

STEP 37:

Parts:

Parts:

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

STEP 38:

Parts:

That’s it for this installment. There’s more to come in February. Your NXT Packbot should now look like this. SV

64

SERVO 12.2007

STEP 39:

Page65.qxd

11/5/2007

2:44 PM

Page 65

SERVO 12.2007

65

Robolinks.qxd

11/5/2007

4:29 PM

Page 66

Electronic Parts & Supplies Since 1967

C Stamp™ Controller

• LOW COST - High Pin Count • 48-Pin Module with Analog • High Speed, Large Memory • Professional SW Dev. Tools • Easy to Connect Accessories • Free Expert Technical Support Toll-Free: 1 (800) 985-AWIT

www.c-stamp.com

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

I M S e r v ic e

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

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

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

i m s r v .c o m

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

www.servo magazine.com and click on

Robo-Links. 66

SERVO 12.2007

SV-GiftSubAd2007.qxd

11/1/2007

3:38 PM

Page 67

Give the gift that lasts all year!

Go to

www.servomagazine.com to enter your gift order!

Be sure to use promotion code Y7WXMS when ordering.

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

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

RoboResources.qxd

11/4/2007

6:36 PM

Page 68

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

Using Lasers With Your Robots W

hen I was growing up, two technologies captivated both science and science fiction: robots and lasers. Both started out expensive and complicated, but today, these technologies are within reach on any budget. This is especially true of lasers, which just a generation ago were laboratory curiosities and the stuff of adventure novels. Now they are such an integral part of our lives we have all but forgotten about them. We’ve lost the appreciation of how useful they can be. Thanks to advances in semiconductor technologies, you can purchase a fully functioning laser for just a few dollars. Given their low cost, and the unique properties and capabilities of laser light, you may want to consider combining these two stalwarts of sci-fidom into your next project. What follows are some ideas to pique your interest and, of course, a listing of online sources you can check out to further your education and experimentation into the world of lasers.

Lasers 101 Though there are many types of lasers, they all do pretty much the same thing: Lasers amplify a source of photons into an intense beam of light. The wavelength of the light varies across the visible, infrared, and ultraviolet spectrum. Most people are familiar with the ruby-red light of the common laser pointer. These operate at about 650-670 nanometers (nm), depending on their design. A newer class of laser pointers put out a green beam (about 530 nm),

68

SERVO 12.2007

which is useful because the human eye is most sensitive to light of this wavelength. The green lasers are more expensive to manufacture, so they cost more. Many devices such as CD and DVD players use infrared lasers that put out an invisible beam in the 750-780 nm range. While you can’t see the beam, an infrared laser is nevertheless quite useful, especially when combined with sensors that are most receptive to light in the infrared region. These include most types of phototransistors and photodiodes, and both CMOS and CCD image arrays. And, of course, there are lasers that emit light in the deep blue and even ultraviolet region. These are fairly expensive, finding typical uses in such things as high definition DVD players, and validating the authenticity of paper currency. The vast majority of lasers today are the semiconductor variety. They are typically constructed of a sandwich of semiconducting material that has been cleaved at exactly the right angle to allow a pinpoint of amplified laser light to be emitted. At low currents, the laser operates like a light emitting diode (LED); with the proper operating current, the device emits true laser light, described below. Semiconductor lasers can be further classified by their operating mode. Most of the devices we are most familiar with are designed for continuous light output. These are operated within a controlled region of current; if the current is too low, the light that is emitted lacks the laser characteristics. If the current is too high, the device will overheat and

burn up. To maintain the proper operating output, a sensor inside the laser collects a portion of the emitted light and a control circuit varies the current to keep it within the prescribed range. Other semiconductor lasers — capable of much higher light outputs — operate in a pulsed mode. They are operated by applying a series of pulses, each one of a short enough duration that the device will not overheat. The intensity of the laser is controlled by varying the duty cycle — the ratio of on time versus off time — of the pulses. Diode lasers may be self contained, or they may require separate driver electronics. Self-contained diode lasers include the laser itself, as well as its control circuitry. You need only apply power. This is the case with laser pointers. Diode lasers without circuitry require a separate driver board. The board provides the correct voltage and current to the laser diode at all times. One advantage to getting a laser diode and separate driver board is the extra flexibility in operating the laser. With a separate driver board, you often have more control over the intensity of the laser output. The better driver boards have a separate modulation input that allows you to use an external signal to turn the laser on and off very quickly. Modulation speeds of 5-10 kHz are common. The older style of laser (still found on the surplus market) uses a tube filled with various gasses. A familiar version is the helium-neon laser, which emits a red beam of 632 nm. The laser itself is constructed of a glass tube

RoboResources.qxd

11/4/2007

6:36 PM

Page 69

filled with a mixture of helium and neon gasses. A high voltage is applied to terminals on either end of the tube. Carefully positioned mirrors on either end serve to amplify the light that bounces back and forth. One of the mirrors is fully reflective; the other is partially reflective. Once suitably amplified, the light escapes the partially reflective mirror and exits the tube. There are yet more methods of producing lasers, including various crystals such as ruby and YAG, plasma, and even Jello. I’ll leave it to you to research these if the subject is of interest to you.

The Properties of Laser Light Laser light is special for a number of reasons. First is that unlike most light sources, the beam from a typical laser is composed of a single wavelength, or color. The single wavelength makes it possible to isolate the color, and ignore all others. For example, if you’re designing a sensor that is only sensitive to the light of your laser source, you can filter out all but that light. You know whatever remaining light your sensor is picking up is probably from your laser. (In actuality, many lasers emit several specific wavelengths, called mainlines. These may be selectively filtered or split to obtain the desired color. For example, an argon gas laser emits both a green and a weaker blue light. A simple prism may be used to separate the mainlines of a laser, while not reducing the light output of the beam.) Recall from high school physics that while light is made up of photons, the photons travel as a wave. Because a laser beam is made up of the same wavelength of light, the photons exit the laser and travel in synchronism. This is called coherence. One striking benefit of coherence is the effect of reflections of the laser light. These reflections cause the waves of light to interfere with one another. What was once practically a “solid” beam of light is now a mish-mash of light rays that commingle in measurable ways. Such so-called local interference forms the basis for a number of sensing techniques. I’ll cover a few in a bit.

Another useful property of laser light is the limited degree to which it spreads as it travels through space. This is due to the nature of coherence, described above. All light eventually spreads out, but with the right laser and the right optics, it’s possible to focus laser light into an extremely thin beam that stays thin for a longer distance than regular light. Without this property, we would not have CDs or DVDs. For robots, we can use this property to ensure a small pinpoint of light regardless of the distance between the light source and its target. The spot caused by the laser beam will remain relatively small and compact whether the laser is a foot away from the target or 20 feet away. Simple collimating optics can further control the spread of the beam. Last, and certainly not least, is the sheer intensity of a laser beam. A small pocket laser, operating on a couple of watch batteries, can emit a light as brilliant as noon day sun. Of course, the area of the light is limited to a small spot, but that works to our advantage. Even in average lighting conditions, it’s relatively easy for people and sensors to spot the light of a laser beam.

Uses for Lasers in Robotics Some applications for lasers in robotics are obvious, and some are not. First to mind are decorative uses — dressing up the bot with colored lasers that flash on and off as the machine drives down a darkened hallway. Combine a laser beam with a reflective diffraction grating, and the beam is split into multiple sub-beams that dance around the room as the robot travels. You can get metalized diffraction grating material at any party store. Just look for the stuff that makes a rainbow when you look at it under ordinary light. More practical applications for using lasers with robots involve some type of sensor. Light-based sensors are already popular solutions in all types of robots, but the majority of these use standard non-laser (i.e., non-coherent) infrared or visible light. Such sensors work by detecting the amount or direction of light. The coherent nature of laser light

permits additional sensory techniques. One notable approach is to rely on the local interference of a laser beam reflected off a surface. To the naked eye, the local interference appears as “speckle,” a grain-like pattern that moves as the light or the surface moves. You could use this idea as a way to measure movement and even distance. Point a laser toward the ground, and pick up the reflections using a suitable sensor. As the robot moves, the pattern of the speckle also moves in direct proportion to the direction and distance of that movement. Systems of these types that rely on local interference typically warrant a multi-cell sensor array. A single light sensor is insufficient to detect the motion of the speckle pattern. However, sensor arrays, such as linear CCDs or even low-resolution CMOS camera chips, can be used to measure finite differences in the speckle pattern. Lasers also find use in various beacon and landmark systems used for robotics. One or more lasers pointed upward from a stationary “lighthouse” are used to project a pattern of beams or lines onto a white ceiling. A traditional CMOS or CCD camera is pointed toward the ceiling, and with the right filtering, sees only the dots/lines of the laser. The unique orientation of the dots or lines reveals the location of the robot within the room. This is basically the same concept as the celestial navigation techniques used for centuries by mariners. It’s already used in some commercial and experimental robotic navigation systems. Recall above that because of the property of coherence, a laser beam will keep its pencil-thin shape for a longer distance than ordinary light. With appropriate optics, a single sensor can focus onto the same area that the laser beam is being projected onto. Using a variety of timing techniques, it’s possible to construct a laser-based distance measurement device that can scan a room and build a 3D map of objects in front of the sensor. This is the basic idea behind the expensive laserbased rangefinder systems build by German electronics manufacturer SICK. Determining the distance between SERVO 12.2007

69

RoboResources.qxd

11/4/2007

6:36 PM

Page 70

laser sensor and target can be accomplished in a variety of ways. With fast enough electronics, it’s possible to measure distances using time of flight of the light itself, which travels about 186,000 miles per hour. Perhaps a more common method that does not require fast switching electronics is to modulate the laser beam with a fairly low frequency sine wave. The difference between the phase of the source laser beam modulation and its returned reflection indicates distance.

power output of the beam (usually expressed in milliwatts or watts), and whether the beam is stationary or constantly in motion. As noted on the FDA website, laser devices are separated by class. The lower class numbers are the least dangerous. Each of these classes has its own warnings and restrictions for use.

Laser Safety

• Class II and IIa products include bar code scanners.

The light from a laser is highly intense, and when aimed directly into someone’s eyes can cause severe pain and optic damage. In the United States, lasers are regulated by the Food and Drug Administration, or more specifically, an FDA unit known as the Center for Devices and Radiological Health, or CDRH. Lasers are roughly classified by the potential damage they can cause; this damage is defined by relying on simple metrics, such as whether the beam is visible or invisible to the human eye, if the light of the laser is ever exposed outside of the device it’s used in, the

• Class I products include laser printers and CD players where the laser radiation is usually contained within the product.

• Class IIIa products include laser pointers. • Class IIIb and IV products include laser light shows, industrial lasers, and research lasers. The vast bulk of lasers available to consumers is Class IIIa. Note that the laser in a CD player is ordinarily a Class I device (but that’s when it’s used inside the player where its light is never exposed). Used outside — you’ve hacked a CD player and raided its optics — the laser is most likely a Class IIIa. Also note that the FDA limits Class

American Science and Surplus often carries optics and sometimes laser components.

IIIa devices to five milliwatts, as indicated by a light meter specifically designed to measure laser output levels. It’s technically possible to operate some laser pointers with a higher-than-normal voltage, or even to pulse them with significantly higher voltages. The result is an increase in power output that makes these devices non-compliant. Class IIIa and lower lasers are generally considered safe, but only in their intended application. Whether or not the laser light may be harmful to people or animals depends on the output power of the laser, whether the laser is visible, and if the beam is held stationary for a long enough period of time. I’d recommend never using anything above a Class IIIa laser in a robotics project, and then only use a visible light laser. The beam of an infrared laser can be damaging to the eyes, and when strapped to a robot, an unsuspecting person or animal may be inadvertently exposed to the effects of the beam. When an infrared laser must be used, consider only employing it in a fashion where its beam is pointed down to the ground, and not out or up. If you must use a higher power laser, do so only with appropriate research and safety training, and be sure to follow all laws and regulations. If your goal is to design a mobile light show robot, employing high power 10 watt diode lasers, do so only after you have fully immersed yourself into the study of laser safety. Be aware that operating certain Class IIIb and above lasers in public without the appropriate safety measures may be against the law, and could expose you to severe fines. Finally, should you opt for older fashioned tube lasers on your robot, know that these require high voltages to operate. These voltages — typically in the 1-2 kilovolt range — can cause nasty shocks. Be sure all wiring is covered. Lasers with glass tubes (like helium neon) should be suitably protected in plastic or metal enclosures, to avoid the risks of broken glass.

Sources In addition to the sources listed

70

SERVO 12.2007

RoboResources.qxd

11/4/2007

6:37 PM

Page 71

here, be sure to check out the regular advertisers in both SERVO and Nuts & Volts, as many of them carry surplus lasers and optics.

Almaz Optics www.almazoptics.com Even lasers need the occasional lens. This outfit sells optics for conventional and laser light applications.

American Science and Surplus www.sciplus.com Variable surplus merchandise, so check their catalog. Often carries optics and sometimes laser components. Low prices.

Anchor Optics www.anchoroptics.com Low-cost optics and laser (diode and gas) products.

Coherent, Inc. www.cohr.com Leading manufacturer of industrial, educational, and laboratory lasers. The site contains numerous application notes and other useful information.

Industrial Fiber Optics www.i-fiberoptics.com Manufacturer of educational grade lasers. Check out their informational pages.

Jameco has a small — but impressive — selection of diodes and laser pointers.

Laser Surplus Sales www.lasersurplus.com

upporting optics.

Laser Surplus Sales carries lasers and optics, at surplus prices. This includes variety of gas, solid-state, and crystal (e.g., ruby) lasers, and

Melles Griot www.mellesgriot.com Maker of laser components, optics, and complete laser systems,

Another established company, Midwest offers a number of higher powered diode lasers, including Class IIIb units of 40 mW and more.

Information Unlimited www.amazing1.com Lasers, laser products, and optics for all sizes and types of interesting projects.

Instapark www.instapark.com Online retailer of laser pointers and diode laser modules. Fairly low prices, even for the green lasers.

Jameco www.jameco.com Small — but impressive — selection of diode lasers and laser pointers.

Laser Glow www.laserglow.com Red, green, yellow, and even blue laser pointers and diode laser modules. SERVO 12.2007

71

RoboResources.qxd

11/4/2007

6:38 PM

Page 72

from educational to industrial. Check out their online tutorials, such as the section on fundamental optics.

Meredith Instruments www.mi-lasers.com Meredith Instruments is one of the

oldest names in hobby and educational lasers. Good selection of low-cost red diode lasers, collimating lenses, and line-producing optics.

Midwest Laser Products www.midwest-laser.com Midwest Laser Products is another established company, offering a number of higher powered diode lasers, including Class IIIb units of 40 mW and more.

US Food and Drug Administration CDRH website www.fda.gov/cdrh Main portal to the CDRH pages at the United States Food and Drug Administration. Plenty of useful information and factoids about lasers, laser use, and laser safety. SV

CONTACT THE AUTHOR Gordon McComb can be reached via email at [email protected]

72

SERVO 12.2007

WebstoreDec07.qxd

11/5/2007

3:25 PM

Page 73

The SERVO Webstore Attention Subscribers ask about your discount on prices marked with an * Insectronics

by Karl Williams

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

Mechanisms and Mechanical Devices Sourcebook

2007 CD Rom

Pre-order before December 20th and get free shipping (U.S. Only) $24.95

Order other CDs with your 2007 copy of SERVO or NV (of any combination) and pay only $21.95 each. Plus get the free shipping! All orders will ship mid December.

123 Robotics Experiments for the Evil Genius by Myke Predko

If you enjoy tinkering in your workshop and have a fascination for robotics, you’ll 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

Robot Builder’s Sourcebook

CNC Robotics

by Gordon McComb

Fascinated by the world of robotics but don’t 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 you’ve been searching for? Turn to Robot Builder’s Sourcebook — a unique clearinghouse of information that will open 2,500+ new doors and spark almost as many new ideas. $24.95

by Neil Sclater / Nicholas Chironis

The fourth edition of this inventioninspiring engineering resource covers the past, present, and future of mechanisms and mechanical devices. You’ll 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

FIRST Robots: Aim High

by Vince Wilczynski / Stephanie Slezycki

This book looks at 30 different robot designs all based on the same chassis, and provides indepth information on the inspiration and the technology that went into build! NEW ing each of them. 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 Geoff Williams

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

SERVO 12.2007

73

WebstoreDec07.qxd

11/5/2007

3:26 PM

Page 74

To order call 1-800-783-4624 Building Robots with LEGO Mindstorms NXT by Mario Ferrari, Guilio Ferrari

! NEW 7 0 N JU 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

Forbidden LEGO

NEED MORE INFO? Go where SERVE’ goes! The online store @ www.ser v omagazine .com

by Ulrik Pilegaard / Mike Dooley Build the Models Your Parents Warned You ! Against. NEW Forbidden LEGO introduces you to the type of freestyle building that LEGOs master builders do for fun in the back room. Using LEGO bricks in combination with common household materials (from rubber bands and glue to plastic spoons and ping-pong balls) along with some very unorthodox building techniques, you’ll learn to create working models that LEGO would never endorse. $24.95

Robot Builder’s Bonanza Third Edition

by Gordon McComb / Myke Predko

Everybody’s favorite amateur robotics book is bolder and better than ever — and now features the field’s “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

Take This Stuff and Hack It!

Great ! a Gift Ide ! 5 $19.9

by Dave Prochnow

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

74

SERVO 12.2007

SERVO Magazine T-Shirts

From HomoSapien to RoboSapien

For men and women

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.

WebstoreDec07.qxd

11/5/2007

3:27 PM

Page 75

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

Blade Runner (The Director’s Cut) (1982)

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

Forbidden Planet: 50th Anniversary Edition

A starship crew goes to investigate the silence of a planet’s 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

BACK ROOM SPECIALS

The Official Robosapien Hacker's Guide by Dave Prochnow

The Robosapien robot was one of the most popular hobbyist gifts of the 2004 holiday season, selling 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

Concise Encyclopedia of Robotics by Stan Gibilisco

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 $9.95 “Only 2 Left” Pub date: November 12, 2002

Robotics Demystified

by Edwin Wise YOU DON'T NEED ARTIFICIAL INTELLIGENCE TO LEARN ROBOTICS! Now anyone with an interest in robotics can gain a deeper 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

Hydrogen Powered Racer and Hydrogen Station

SERVO'S CUSTOM EMBROIDERED HAT

Order now and get your Hydrogen Racer before Christmas 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 12.2007

75

Appetizer.qxd

11/4/2007

6:30 PM

Page 76

Transitioning Sequencer Using Static Frames for Biped Control by Daniel Albert

M

y first impression of a Robo-1 style biped was one of amazement. It walked, performed tricks, and could battle in competition. WOW! So, I bought a Kondo KHR-1, spent many hours building it. And there it was. Now what to do with it!? I programmed in moves I downloaded from the Internet and impressed my friends. I created new moves and sequences and taught it to climb a small staircase. (Not very easy for movements based on static positions!) Out of the box, the robot needed to be tethered. There was a kludgy remote available from Kondo, but I opted not to buy that. I’ve been a programmer since the late ‘70s, so, of course, I had to try to improve the interface. I spent the next few months hacking the communications protocol and wrote a PDA remote controlled WiFi interface. That’s when the disappointment hit. The robot could only run pre-programmed sequences of static frames. If the surface was tilted, the robot fell over. If the surface was rough, the robot fell over. Drat! As with most technical things, there are always innovations. The Hitec RoboNova soon came along. It was programmable via an onboard RoboBasic interpreter. Optional gyros even helped stabilize its movements. COOL! So I bought a RoboNova, spent many hours building it. And there it was. Now what to do with it!? I programmed in moves I downloaded from the Internet and impressed my friends. There was also a decent PC program for creating new static positions. So, like most other RoboNova hobbyists, I built RoboBasic programs. It even had an “out of the box” I/R TV style remote. But the general limiting algorithm was the same: • Receive a command from the remote control. • Run a sequence. • Loop. I wanted to make the robot walk more like a human. Rather than just run one sequence after another, what I really needed were dynamic movements. However, most of

76

SERVO 12.2007

the math involved is beyond the people reading this article, including myself. Not to mention that the RoboNova only has an Atmel ATmega128 MCU running at 7 MHz. I decided to develop a better static model frame sequencer. One that can transition sequences when common frames exist in both. First, I tried to do this in RoboBasic. I hit so many limitations with the compiler that I gave up and wrote MOOSE (My Own Operating System Executive) to replace the RoboBasic operating system (kids, don’t try this at home). Yet, I want to point out that a clever Basic programmer can still make this design work. And now a pearl of wisdom: “Define your task and build the database prior to writing any code.” A wisely designed database set ultimately reduces the amount of code needed to perform a given task. Below is a list of the features and record type definitions included in the MOOSE sequencer database. 1) Use the vendor’s existing static position builder program. 2) Communicate with existing programs. 3) Have variable length sequences. 4) Allow adjustable velocity between frames. 5) Point-to-point servo movement between frames 6) Independence of footedness, play left footed or right footed. 7) Symmetry flag, indicating a frame is identical left footed or right. 8) Play a sequence forwards or backwards. 9) Hold at critical places in the sequence momentarily (for stability). 10) Transition sequences at closest similar frame. 11) Auto-repeat sequences, if desired. 12) Change footedness of sequence on auto-repeat, if desired. 13) Change direction of sequence on repeat, if desired. 14) Work with my wireless serial based PS2 style controller.

Appetizer.qxd

// // // // // // // // // // // // // // // // // // // // // // // // // //

11/4/2007

6:30 PM

Page 77

Record Types P: single static Position (Long name, servo positions[24]) S: sequence (Long Name, ID, Flags) Sequence Flags: (R)epeat sequence over, change footedness. (r)epeat sequence over verbatim. directional changes only go forward! (D)irectional change at end of seq, change footedness & continue (d)irectional change at end of seq. and continue F: looping frames within seq. (Position Long Name, bit flags) Frame Flags: (V)elocity V0 - V3 (V0 = slowest) (A)mbidextrous - can change footedness from left to right if need (J)ump - play this move during a sequence change, else skipped (H)old - Hold when moving forward into this position (h)old - Hold when moving backward into this position (S)ymmetrical - This move can be played either way

FreeLoader — a PC based program I wrote to accompany MOOSE — parses the following example text file and loads the EEPROM of the RoboNova. Record types precede the colon. Flags trail. P:Zero,100,76,144,96,101,100,101,30,81,100,100,100,101, 30,81,100,100,100,100,76,144,96,101,100 P:Lean,69,79,133,101,113,100,105,45,71,100,100,100,101, 37,71,100,100,100,117,96,118,100,94,100 P:ON1Foot,59,73,136,107,117,100,105,45,71,100,100,100,1 00,37,71,100,100,100,116,77,143,98,90,100 P:LeanWide,67,102,114,92,116,100,106,51,83,100,100,100, 98,40,65,100,100,100,106,139,80,89,107,100 P:KneeUpInCenter,87,113,74,130,93,100,105,30,84,100,100 ,100,101,33,90,100,100,100,108,109,83,128,112,100 P:KneeUpInFront,86,124,76,152,94,100,67,35,67,100,100,1 00,125,37,82,100,100,100,114,110,88,111,107,100 P:ShortPlantWeightBk,84,10,182,121,95,100,67,40,73,100, 100,100,112,36,72,100,100,100,109,134,67,120,105,100 P:ShortPlantWeightCt,100,63,121,130,102,100,67,43,64,10 0,100,100,120,43,64,100,100,100,100,117,138,71,102,100 P:ShortPlantWeightFw,105,113,78,128,108,100,72,43,68,10 0,100,100,135,48,68,100,100,100,80,107,172,43,93,100 P:LongPlantWeightCtr,100,44,121,151,100,100,67,43,64,10 0,100,100,120,43,64,100,100,100,100,130,138,47,100,100 P:KneeUpInBack,114,110,88,134,107,100,60,47,70,100,100, 100,144,34,81,100,100,100,86,124,76,53,94,100 P:LongPlantFw,117,134,58,142,102,100,66,43,68,100,100,1 00,139,46,65,100,100,100,83,114,181,43,97,100 P:LongPlantBk,90,09,161,132,99,100,81,42,78,100,100,100 ,116,42,59,100,100,100,106,152,54,101,103,100 P:WidePlantBk,85,15,167,121,113,100,73,42,78,100,100,10 0,129,42,59,100,100,100,109,136,53,121,106,100 P:WidePlantFw,117,154,35,132,111,100,78,42,78,100,100,1 00,134,29,77,100,100,100,77,115,183,25,103,100 P:bigKneeUpFw,95,18,143,137,115,100,64,34,81,100,100,10 0,131,47,70,100,100,100,113,133,87,67,87,100 P:bigKneeUpBk,100,98,96,45,105,100,144,34,81,100,100,10 0,60,47,70,100,100,100,109,96,127,108,97,100 P:BU1,100,130,120,80,110,100,150,160,10,100,100,100,150 ,160,10,100,100,100,100,130,120,80,110,100 P:BU2,80,155,85,150,150,100,185,40,60,100,100,100,185,4 0,60,100,100,100,80,155,85,150,150,100 P:BU3,75,165,55,165,155,100,185,10,100,100,100,100,185, 10,100,100,100,100,75,165,55,165,155,100 P:BU4,60,165,30,165,155,100,170,10,100,100,100,100,170, 10,100,100,100,100,60,165,30,165,155,100 P:BU5,60,165,25,160,145,100,150,60,90,100,100,100,150,6 0,90,100,100,100,60,165,25,160,145,100 P:BU6,100,155,25,140,100,100,130,50,85,100,100,100,130, 50,85,100,100,100,100,155,25,140,100,100

// S:Stand,01,r F:Zero,S,V3,A F:Lean,V5,J,A // S:ShortStepFwdBck,11,R

//(R)epeat sequence // with changed footedness

F:Lean,V6,J,A F:KneeUpInFront,V6 F:ShortPlantWeightBk,V6,H F:ShortPlantWeightCt,V6 F:ShortPlantWeightFw,V6,h F:KneeUpInBack,V6 // S:ShortStepTurn1way,15,R //(R)epeat sequence with //changed footedness F:Lean,V6,J,A F:KneeUpInFront,V6 F:ShortPlantWeightBk,V6,H F:ShortPlantWeightCt,V6 F:LongPlantWeightFw,V6,h F:KneeUpInBack,V6 S:ShortStepTurnOtherway,17,R

//(R)epeat sequence with // changed footedness

F:Lean,V6,J,A F:KneeUpInFront,V6 F:LongPlantWeightBk,V6,H F:ShortPlantWeightCt,V6 F:ShortPlantWeightFw,V6,h F:KneeUpInBack,V6 // S:ShortStepLftRgt,E3,D

//(D)irection and footedness // changed at end. Repeatable // at start

F:Lean,A,V5 F:KneeUpInCenter,V5 F:ON1Foot,V5 // S:RotateInPlace,69,r //(r)epeat sequence verbatim F:Lean,V3,A F:LongPlantWeightCtr,V3 F:Stand,V3,S,A // S:UpFromBack,B6 //runs once and stops at Stand F:Lean,V3,J,A F:BU1,V6 F:BU2,V6 F:BU3,V6 F:BU4,V6 F:BU5,V6 F:BU6,V6 F:Zero,S,A,V6 END

MOOSE starts out on boot-up by playing the first sequence; in this case, “S:Stand.” The serial port waits for a data packet indicating the status of the wireless PS2 controller. MOOSE converts the joystick and button data to a requested sequence ID, direction, and footedness. If it finds an “S” that matches the requested ID, it will then search both the current sequence and the requested sequence for the best transition point. You may notice several things about the S:Stand sequence. It has two static frames: F:Zero and F:Lean. In addition, it is has the “r” flag indicating it will repeat at the end. Why would you want to lean in a stand sequence? Normally, you wouldn’t. The F:Lean frame has a “J” flag indication that it is merely a jump point and will only be played — if necessary — during a transition to another sequence. So, until you jump away from the S:Stand sequence, the F:Lean is ignored.

Now the Fun Begins! Let’s say that we want to transition to the SERVO 12.2007

77

Appetizer.qxd

11/4/2007

6:31 PM

Page 78

“S:ShortStepFwdBck” sequence with a forward direction, starting with the left foot. MOOSE sees that there is a common frame F:Lean in both sequences. It plays the F:Lean in the S:Stand sequence, followed by the next desired frame “F:KneeUpInFront.” Had the direction requested been backwards, MOOSE would see that S:ShortStepFwdBck can be repeated and would run the sequence in reverse starting with F:KneeUpInBack. Upon reaching either end of a repeating sequence that requires a change of footedness, MOOSE will change from left to right foot and continue the sequence. A full backwards/forwards or left footed/right footed walk can be achieved from six static frames.

Now, Let’s Turn While Walking! We don’t need to know where we are in a sequence and we don’t need to finish the sequence in order to transition. Going from S:ShortStepFwdBck to “S:ShortStepTurn1way” can transition on any of the four common frames. MOOSE will immediately switch sequences on the next frame if it can. If not, it will find the next best jump point. I know there are some really sharp readers out there are saying, ”What if the left knee is up and we want to transition to the right knee up ... they are the same frame ... can it hop?” No problemo! Even though the RoboNova can’t hop, MOOSE continues the sequence until it finds either a symmetrical frame where it can just switch current footedness to requested footedness with no delay (i.e., S:Stand) or an ambidextrous frame where it can play it twice (i.e., “Lean” left then “Lean” right).

78

SERVO 12.2007

Sequences with the direction flag set like S:ShortStepLftRgt play forward only from their first frame up to the last, can switch footedness if needed, and play backwards down to the first. They can then repeat from the first frame if the repeat flag is set. One time sequences like S:UpFromBack get played forward once and stop at the last frame. Frames with the (H)old and (h)old flag pause momentarily to allow the robot to settle. These flags are directional since it may be critical to hold during the bounce that occurs when placing a foot to the ground but not hold in the reverse direction of picking the foot off the ground. Well, that’s all there is to giving your biped some dynamic like sequences without using dynamic model programming. If you have a RoboNova and would like to test drive MOOSE and FreeLoader, please contact me. MOOSE emulates much of your original Basic program’s serial command protocol. It can communicate with RoboBasic’s servo motor real time control in order to create the static frames and even adjust and store the zero settings. MOOSE and RoboBasic cannot exist concurrently. If you try to upload a Basic program, you will wipe out MOOSE and reload RoboBasic. I would be happy to assist any brave, savvy RoboBasic programmer that wants to try to emulate this sequencer in RoboBasic. Support for a five degree of freedom IMU (Inertial Measurement Unit) is currently under development. SV

CONTACT THE AUTHOR Dan Albert can be reached via email at [email protected].

Then&Now.qxd

11/5/2007

4:29 PM

Page 79

a n d

Then NOW SERVOS b

S

ervos? Just what is a servo (or a servo motor or servo mechanism, as they are sometimes called)? Is that a year’s collection of this magazine? Most of us who have built robots have used one or more of these in our creations, but not all robots use servos. Most of the larger varieties of robots don’t use servos though they might employ shaft encoders to provide some sort of positional feedback to a controlling microcontroller or computer. Most combat robots (like the ones that seem out of control) don’t use any form of them, so why do so many experimenters utilize them? Who would have ever thought that these small plastic boxes would have had such an impact on experimental robotics? I remember playing with a four channel R/C system years ago, trying to figure out how I could use it in a robot. Most of my robots were usually rather large and the tiny servos could do little more than move small ‘special effects’ appendages. Cute ‘decorations’ really served no useful function, so I decided to FIGURE 1a. JR servo.

y

T

o

m

hack one to see what I could do with it. I believe that first thing I made was a linear actuator. Pulling the 4.7K pot out, cutting off the stops from the output gear, I attached a 25 turn lead screw and a 25 turn 5K trim pot (in the place of the other one) to the output shaft and had an amazingly powerful push-pull actuator. Other experimenters in our robotics group were attaching them to arm and leg joints, and driving the servos with 555/556 timer circuits or 6502 microprocessors, and a few started to use them as drive motors for small robot’s wheels.

Typical Servos Used in Robotics The three servos shown in Figures 1a, 1b, and 1c are just a tiny fraction of the many types, torque capacities, sizes, and weights available from the many manufacturers today. Servos are quite often the only motive force of many experimenter’s robots. Most of the FIGURE 1b. HiTec robot servo.

C

a

r

r

o

l

l

beginner’s kits from Parallax and others use similar servos in small robots. Tabletop robots can make use of the little motor/gearbox to drive a set of wheels and the associated electronics to receive the pulse trains from a microcontroller and convert them to drive signals. This is a cheap and effective way to get a robot design from a few sketches to a working machine in a few hours. As robot experimenters, we think of those little black boxes that were originally developed for model airplanes as the only ‘servo’ that we’re familiar with. Many of us have boxes of them; some hacked, some in pieces, and some actually in one piece.

Servo Feedback With the advent of specialized ICs and electronics, modern servos have emerged as marvels of mechanics and electronics. Servos have been used in industrial applications for years, long FIGURE 1c. Futaba coreless servo.

SERVO 12.2007

79

Then&Now.qxd

11/5/2007

4:30 PM

Page 80

A servo is: “An electro-mechanical device that is used to convert the received signal into mechanical movement. Servos are used to move control surfaces, throttles, retractable landing gear, or auxiliary functions (model airplane enthusiast’s definition).” Servo is: “The name of a great robot experimenter’s magazine.” (Sorry, I just had to put that in.) If you Google ‘servo,’ you’ll find most definitions and hits are about the model airplane types.

How Does a Servo Work? FIGURE 2. Three axis milling machine set up by Servo Products.

before model aircraft found them useful to move various surfaces to change the direction of flight. Newer applications are popular for CNC machine tool use. Figure 2 shows three servos used to move the three axes of a milling machine by Servo Products. Way back in 1787, James Watt used a servo-like device — the flyball governor — to regulate the speed of his steam engines. Figure 3 from the cover of a 1952 Scientific American Magazine shows a classic drawing of the flyball governor. It certainly was not what we think of today as an electrical/electronic servo, but it could be set in different positions to control the speed of a steam engine. The revolving set of balls was directly connected to the engine’s output shaft and as the speed increased, centrifugal force caused the balls to move outward, pulling down the upper ring and connected lever. As this ring moved downward, it would slowly shut down the flow of steam by moving a valve, thus slowing the engine and revolving balls. At one point, a stable speed was developed. By manually changing the distance between the ring and where the valve cut down the steam flow, one could set the engine’s speed wherever desired. A relief valve was set to open at a specific pressure, thus preventing an exploding boiler. No, this certainly is not a typical servo that we’re familiar with, but it did utilize feedback to control a machine.

80

SERVO 12.2007

FIGURE 3. Flyball governor on the cover of Scientific American.

No 1.0 to 2.0 millisecond pulses were sent remotely to Watt’s engine to control speed, just a simple mechanical adjustment by a human operator.

What is a Servo? Just like the definition of a robot is so different to so many people, a servo has many definitions. Allow me to present four definitions of the term servo that I found at random through Google: A servo is: “An electromechanical device that uses feedback to provide precise starts and stops for such functions as the motors on a tape drive or the moving of an access arm on a disk (PC Magazine).” A servo is: “An automatic device used to correct errors in the operation of machinery, used in satellite-tracking systems, power-steering systems on some cars, and to control robots and keep ships on course (encyclopedia).” A servo is: “A small mechanism inside the RC vehicle, the servo is a device with a motor, gears, and circuits that controls things like steering and speed. A typical RC car has a steering servo to make the wheels turn and a speed control or throttle servo to make it go faster or slower. Other types of servos may be present to control other functions (radiocontrol car enthusiast’s definition).”

Are you really any closer to knowing just what a servo is? So many articles in this magazine (including some of mine) have gone over how a typical model aircraft servo works. The more popular and certainly cheaper models utilize a pulse width modulation pulse train from the R/C receiver. The pulse train consists of 50 to 60 pulses per second with each pulse being one to two milliseconds long, though experimenters have used 0.8 to 2.2 ms pulses to drive the servo further than the typical 90 to 120 degrees of travel. A shorter series of pulses will drive the servo’s output shaft one direction, and the longer pulses will drive the other way — with positions in between for pulses closer to 1.5 ms. In these older servos that have been used for years, there are three wires to the servo: a signal wire (for the pulse train) that can be a number of colors; a 4.8 to 6 volt power wire that is usually red; and a ground wire that is usually black or brown. Note that there is no output wire to inform an operator or microcontroller just where the servo’s shaft is positioned.

Early Model Aircraft Servos One of the first R/C systems that I used was by Kraft. Figure 4 shows an earlier analog Kraft system with three servos mounted in the airplane, lying behind the transmitter and receiver in the foreground. Back in the ‘80s, several of us from the Robotics Society of Southern California were invited down to the Kraft

Then&Now.qxd

11/5/2007

4:30 PM

Page 81

plant in Vista, CA and were given a tour of the facility. The guy leading us around the Kraft facility gave us a lot of servos, receivers, and battery packs just for good will; maybe he saw that the end was near. Futaba from Japan was starting to really hurt the US manufacturers and Kraft’s days seemed numbered. Experimenting with them at home, I found the Kraft servos to be quite well made. I also had an old Heathkit R/C system that I built that used two PS-4 servos made by Orbit (remember kits?). Kraft later came out with the smaller KPS-12 servos that some people I knew built into robot joints for walkers. I later began to frequent the Hobby Shack (now Hobby People) in Fountain Valley, CA and found that Futaba and HS’ Cirrus line of R/C equipment to be a lot cheaper for my R/C projects. One of my first R/C robots for a movie used a Hobby Shack AeroSport four channel system with two Vantec speed controllers for the two wheels and two very large Cirrus servos for the two arms. I used coil springs to compensate for the arm’s weight and the little robot could easily pick up over a pound. Futaba took the lead several decades ago and is still one of the more popular R/C systems with a full line of servos for all applications, including servos designed specifically for robots. HiTec of Korea also has a line of servos specifically designed for robots, as does the Robotis Bioloid line of Dynamixel servos (actuators), also from Korea.

Servo Selection You may be wondering just what type of servo that you’ll need for your project. For economy’s sake, you can start with the cheaper analog servos with a three pole cored motor, plastic gears, and bushings for the shaft. These will work great for almost all applications where you need to study the basics before advancing to your final design. The next step for tougher applications is to buy a metal geared servo with ball bearings on the main shaft. Coreless motors have quicker changes in speed over the three and five pole cored motors. The most advanced are the digital servos with an embedded microcontroller to deliver a greater

FIGURE 4. Early Kraft radio.

number of PWM pulses to the motor for quicker response, greater accuracy, and torque with less deadband. They do draw a bit more power to operate, but that is usually not too much of a concern for robot builders. Of course, servos vary widely in their torque, weight, and size. The Cirrus CS-3 Micro Joule SX servo weighs only three grams (its four channel receiver weighs a bit less), yet it only has seven oz. in. of torque (see Figure 5). Monster servos can weigh over a pound and put out 10 foot pounds of torque or more. It all depends on what you need. This single paragraph certainly cannot narrow down the right servo for your application; you need to go to the Internet or to manufacturer’s websites and do some research.

Servo Feedback vs. Feedback to a Microcontroller This magazine takes its name from FIGURE 6. Robotis Dynamixel AX-12.

FIGURE 5. Cirrus CS-3 Micro Joule SX servo.

these devices that so many of us have used in our robots for years, yet servos offer no built-in intelligence. They only take commands from a microcontroller or R/C receiver and move to a certain point and stop. But hack the little suckers and you have an intelligent drive motor of sorts. After reading my August column on Robot Arms, Alex Dirks of CrustCrawler wrote SERVO concerning what he felt were incorrect statements that I made concerning servos used in many experimenter’s robots — the types used with radio controlled model airplanes to move various wing and rudder surfaces. He referred to the following statements that I made concerning their use with robot arms: “The advantage of using R/C servos is the positional feedback. “Potentiometric feedback, as in R/C servos, allows the controlling computer to know where each joint is positioned.” Alex countered with the following: FIGURE 7. Robotis Dynamixel RX-28.

SERVO 12.2007

81

Then&Now.qxd

11/5/2007

4:31 PM

Page 82

FIGURE 8. Line of servos from Pololu.

“There are no feedback mechanisms built into any standard servo today with the exception of the AX-12+ (the servo from Robotis and several others in that line) and a few specialized servos used in biped type robots.” Alex knows servos as President of CrustCrawler, a business he started six years ago with the HexCrawler and QuadCrawler. The products he feels have the most promise today are probably the AX12 Smart arms designed around the Robotis smart servos that I’ll discuss later. However, it is CrustCrawler’s and the other well-known suppliers of ready-to-roll robots and kits that have steered the servo manufacturers into designs that are made specifically for robot experimenters. I felt that the best way to understand where he was coming from was to talk with him personally. “When I talk about servo feedback,” he told me, “I mean feedback to an external controller. Feedback that is limited to the servo itself without feedback to an external controlling/monitoring device such as a microcontroller or host computer limits the usefulness of the servo motor substantially.” I convinced him that I was speaking of the feedback of the internal potentiometer

to the internal circuitry, not to the outside world. Its internal feedback pot serves only to tell the internal circuitry just where the servo horn is positioned. I feel that this is an advantage over the use of a stepper motor as a stepper can become stuck and the microcontroller will assume that it still has moved the required number of turns. A microcontroller connected to a typical servo will send the appropriate series of specific width pulses and the servo will continue to try to move to the right spot until it is there.

Intelligent Servos Alex feels that the standard servo of today — whether analog or digital — will soon be phased out for walking robots, especially the higher end kits and ready-builts. The ‘Robot Exclusive Actuator Dynamixel’ from Robotis is one of the most innovative servos to come out in years. The Robotis line of rotary actuators (as they call them) have some very good features for robot experimenters. They certainly command a premium price but humanoid builders will find one feature very useful in their designs — the ability to be daisy-chained rather that have

three leads from each of, say, 18 servos leading back to a controller board. Dynamixel actuators, such as the AX-12+ (Figure 6), speak to each other through a TTL line, and units such as the RX-28 (Figure 7) communicate through the popular RS-485 protocol. CrustCrawler has developed the AX12 Smart arm that uses the Robotis Dynamixel actuators for the arm’s joints. Each servo in the daisy chain is assigned an address for control and feedback purposes. Yes, these devices have true feedback to the controlling microcontroller, such as an Atmel or BASIC Stamp. Most of the larger manufacturers and dealers of robots and robot kits in SERVO Magazine have numerous styles, costs, and capabilities of servos in their lineups. Figure 8 shows a line of servos from Pololu. The Seattle Robotics Society ([email protected]) has excellent sources for hacking and modifying servos as do many other group’s sites. R/C and model aircraft sites offer much useful information. In the two months that I have been working on this article off and on, I have come across so much information on the subject of servos and many of the articles are completely contradictory with others. So, don’t take everything that you read as fact. Talk with fellow robot experimenters and just take one apart and determine how it works and what you’re going to do with it next. Modern servos are a true bargain. SV

CONTACT THE AUTHOR Tom Carroll can be reached via email at [email protected].

Advertiser Index All Electronics Corp. ..........................19, 66 AP Circuits/e-pcb.com ............................13 AWIT ..........................................................66 Budget Robotics ......................................16 CrustCrawler ...............................................3 Electronics123 ..........................................19 Floatation Center — Art Gallery ..............65 Futurlec .....................................................66 Gears Educational Systems, LLC ............50 Hitec ..........................................................13

82

SERVO 12.2007

Hobby Engineering .................................66 IMService ............................................19, 66 Jameco .................................................2, 66 Lorax Works ........................................19, 66 Lynxmotion, Inc. .......................................17 Maxbotix ...................................................66 Maximum Robotics ............................30, 66 Net Media .................................................83 Parallax, Inc. ...............................Back Cover PCB Pool .............................................66, 72 Pololu Robotics & Electronics ..........42, 66

Robotis Co. Ltd. .......................................78 RobotShop, Inc. .................................66, 72 Schmartboard .....................................19, 65 SCON .........................................................19 Solarbotics/HVW .......................................7 SORC ..........................................................59 SPSU ...........................................................21 Technological Arts ...................................66 TORMACH ................................................35 Vantec .......................................................59 Yost Engineering ......................................45

CoverInside.qxd

11/1/2007

3:10 PM

Page 2

We’re passive aggressive When it comes to passive products, we don’t pull any punches: we stock more major brands of passive components than any other major catalog distributor.* So whatever brands you need—

5

10

15

20

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

Jameco®

Digi-Key®

Mouser®

Newark®

AMP Astec Power Augat AVX Bourns Cherry Condor Power Corcom CTS Elco Connector Fox Electronics Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Power-One Teledyne Relays Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Corcom CTS Elco Connector Fox Electronics Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Power-One Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Condor Power Corcom Elco Connector Fox Electronics Int’l Rectifier Kemet Molex Panasonic Potter & Brumfield Teledyne Relays Vishay Wakefield

AMP Astec Power AVX Bourns Cherry Corcom Elco Connector Grayhill Int’l Rectifier Kemet Molex Osram Panasonic Potter & Brumfield Vishay Wakefield

Free shipping on these and 83 other major brands. Call for details.

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

for even greater cost savings.

Order 24 hours a day, 7 days a week

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

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

Vol. 5 No. 12

SERVO MAGAZINE

HERO • SERVOS • SPARE THE ROD, SPOIL THE BOT • TASK PRIMITIVES

December 2007

4

74470 58285 0

1 2>

$7.00 CANADA

$5.50 U.S.

Related Documents

Servo Magazine 2007-12
November 2019 11
Servo Magazine 02 2005
April 2020 5
Servo Magazine 01 2005
April 2020 6
Servo Magazine 05 2005
April 2020 5
Servo Magazine 03 2005
April 2020 6
Servo Magazine - 2007 11
November 2019 15