Servo Magazine 01 2005

  • April 2020
  • 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 01 2005 as PDF for free.

More details

  • Words: 41,675
  • Pages: 84
Cover.qxd

12/9/2004

3:54 PM

Page 84

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

Circle #106 on the Reader Service Card.

CoverInside.qxd

12/9/2004

3:33 PM

Page 2

Circle #60 on the Reader Service Card.

SERVO 08.2004 Circle #32 on the Reader Service Card.

83

Full Page.qxd

12/9/2004

Circle #81 on the Reader Service Card.

3:22 PM

Page 3

TOC.qxd

12/8/2004

10:00 AM

Page 4

Departments 6 7 37 38 58 62 82

Publisher’s Info Bio-Feedback Robotics Showcase Events Calendar SERVO Bookstore New Products Advertiser’s Index

Take a Sneak Peek!

See what the st ylish RSs are w ear ing!

Coming 2.2005 4

SERVO 1.2005

Columns 6 8 14 30 60 64 68 70 80

Mind/Iron Rubberbands GeerHead Menagerie Brain Matrix Ask Mr. Roboto Robytes Robotics Resources Appetizer

Check out our new column dedicated to hacking robots to do things they were never designed to do — but can!

76

Twin Tweaks Witness the ups and downs involved in transforming a four-legged walker into a biped.

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

TOC.qxd

12/8/2004

9:58 AM

Page 5

SERVO

1.2005 VOL. 3 NO. 1

Features & Projects

17

BEAM Robotics, Part 4: Seeking the Light

23

Hack-a-Sapien: Sci Fi Becomes Reality

29

Hack-a-Sapien Contest Winners

31

Bot Brain Basics

39

Navigating Robo-Magellan

43

Virtual Robotics

51

IR Remotes for Your Robot

by Thomas Gray and Wolfgang Goerlich

by Jamie Samans

by Kerry Barlow

by Daryl Sandberg and Larry Geib

by Thomas Braunl, Andreas Koestler, and Axel Waggershauser

by Karl Williams

SERVO 1.2005

5

JanPages6&7.qxd

12/9/2004

9:44 AM

Page 6

Published Monthly By The TechTrax Group — A Division Of T & L Publications, Inc. 430 Princeland Court Corona, CA 92879-1300 (951) 371-8497 FAX (951) 371-3052 www.servomagazine.com

Mind / Iron

Subscription Order ONLY Line 1-800-783-4624

by Dan Danknick Œ There are some things we were not meant to know. Fortunately — in the area of robotics — this is not the case. Each year brings new advances in the art, borne on the back of previous accomplishments. Some of these achievements are incremental and some are major shifts in current design paradigms. Either way, things move forward. In the past year and a half of interviewing various robot protagonists, interacting with robot clubs, and observing the research money that companies spend, I have made some predictions of the hot topics for 2005. Active sensors: In the December, 2003 issue of SERVO, we published a project on an active sonar mapper. I wonder how many of you built this and integrated it into your room-exploring robot? It's easier to learn about your environment if you send out a known pulse and then measure the return signal, inferring environmental features from how it is modified. We need more research in this area — and that is why many large companies are working on such devices. As Guy Marsden's project demonstrated, the typical robot hobbyist can also jump in. Locomotion gaits: Not every robot rolls on wheels — some walk. When constructing a walker, the builder needs to implement a gait or sequence in which the legs move to affect motion. Consider a horse: it walks, trots and gallops — three different gaits, each uniquely suited for a different application. As walking robots gain in popularity, the two-, four-, six-, and eight-legged machines will necessarily require different gaits. In the September 2004 issue of Nuts & Volts, author Mike Keesling demonstrated a number of different gaits for the hexapod in his

6 SERVO 1.2005

column. Which is best? A clearer definition of this question leads us to the answer. Better power supplies: Better battery technologies allow longer run times and more complex behavior by providing energy for more motors and sensors. This increases the overall functionality of robots and extends the "design cap" of projects. You should be taking advantage of the hot new batteries as much as you take advantage of new R/C servos and advanced math routines on CPU boards. Better competitions: From the start of the “Mind/Iron” column, I've encouraged robot clubs to move on to more clever competitions. Some have stepped up to the plate with ribbon climbing and SRS' Robo-Magellan. This trend will continue as the excitement of tackling new challenges continues to spur builders. Ultimately, that's the future of 2005 in our avocation — staring down challenges with good designs. We are up to our ears in cheap CPU processing, low cost sensors, low weight frame materials, and the like. It's time to step into the game and make robots that solve new problems. I know my words would fall flat if I didn't also take up that challenge and that's why this is my last “Mind/Iron” in SERVO. I've accepted an engineering position at a top-notch R&D company, where I'll be designing and building robots to solve some of the big problems we face in the world. It's a tall order, but it's what all my years in the field have given me — the ideal toolkit for the task. I encourage you all to make the most of what you know and use it as best you can. As mathematician René Descartes said, "It is not enough to have a good mind. The main thing is to use it well." SV

PUBLISHER Larry Lemieux [email protected] ASSOCIATE PUBLISHER/ VP OF SALES/MARKETING Robin Lemieux [email protected] MANAGING/TECHNICAL EDITOR Dan Danknick [email protected] ASSOCIATE EDITOR/ PRODUCTION MANAGER Alexandra Lindstrom [email protected] CIRCULATION DIRECTOR Mary Descaro [email protected] WEB CONTENT/STORE Michael Kaudze [email protected] PRODUCTION/GRAPHICS Shannon Lemieux COVER ART Michele Durant STAFF Kristin Rutz Dawn Saladino INTERN Mandy Garcia OUR PET ROBOTS Guido Mifune Copyright 2005 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 subscription orders, correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879.

JanPages6&7.qxd

12/9/2004

11:28 AM

Page 7

Dear SERVO, You folks have been terrific in providing copies of SERVO for our students in BEST ROBOTICS. Thank you so much for that!!! Robert Steele via Internet Dear SERVO, The Tetsujin exosuits in the December 2004 issue are incredible! How can I find out more about them? Tony Schnyder via Internet Dear Tony, We promised you “ongoing Tetsujin coverage” and we’ll deliver! Keep reading over the next few months and you’ll find in-depth articles about the suits, the builders, and the motivation behind Tetsujin 2004. Editorial Dept. Dear SERVO, In the December 2004 issue of SERVO “Robotics Resources” article by Gordon McComb on Metalworking 101 on welding and other metal fusing techniques, he incorrectly states that 110 volt welders are, "limited to welding fairly thin sheets of metal — down to about 12 or 14 gauge." I happen to own a Millermatic 135 MIG welder that plugs into a standard 110 V wall socket. You can easily weld up to 1/8" stock with it and — if you're good — 3/16". The importance of him missing this fact is that a 110 V MIG welder is a versatile and powerful tool for the

home hobbyist. It is inexpensive, easy to operate, and produces high quality welds for steel or aluminum. 220 V MIG welders are much more expensive and are more for commercial applications. You can also get a low end AC stick welder like a Sears "buzz box," but they require a 220 V plug (I don't recommend the 110 V). The advantage of stick welders over MIG is they can weld through rust and paint, in addition to their ability to weld thicker metals. The disadvantage of stick welders is they require a lot more skill than a MIG does to produce a good bead. If you're going to weld clean metal surfaces, go with MIG. Also I have two more suggestions for your readers: 1. Get a good book on welding. One such book is New Lessons in Arc Welding by The Lincoln Electric Company. It's only $10.00 and can be ordered from their website: https:// ssl.lincolnelectric.com/lincoln/apdi rect/item.asp?prodnum=L 2. Welding requires lots of practice. Take a class before you buy a welder. Many regional technical schools offer welding classes at night. At these classes, you get hands-on experience with many types of welders. You will learn how to weld and get a good idea of which welder is best for you. Tony Rea via Internet

What kinda bot do you got? Do you think your bot is cooler than what you see here every month? Prove it! Earn bragging rights by having your creation highlighted in our Menagerie section! Send us a high res picture of your robot with a brief description and we’ll make you famous. Sort of.

[email protected] Circle #109 on the Reader Service Card.

7

Rubberbands.qxd

12/8/2004

9:34 PM

Page 8

by Jack Buffington

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

of the most frustrating things about working with Onemicrocontrollers is that they don’t have a nice display like

standard equipment, like your desktop computer does. In fact, most of the time, all that you will have available is a couple of LEDs to look at to try to determine what is going on inside of it. Figure 1. Pin functions for the LCD module.

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

RESOURCES I/D

S

Result

0

0

Moves the cursor to the left after a character is displayed.

0

1

Cursor stays at the same location. Line shifts to the right.

1

0

Moves the cursor to the right after a character is displayed.

1

1

Cursor stays at the same location. Line shifts to the left.

Figure 2. I/D and S truth table.

8

SERVO 01.2005

www.ccsinfo.com Sells the C compiler for PIC processors used in this column www.microchip.com Manufacturer of the PIC microcontroller www.mpja.com Sells the LCD module used in this article

Rubberbands.qxd

12/8/2004

8:39 AM

Page 9

Rubberbands and Bailing Wire it is wasteful of I/O pins on a microprocessor, it makes the source code more readable. If you were to choose to use the four-bit interface, you would simply send the same commands as shown here, except that you would send the high nibble of the byte that you wanted to send and then follow it with the low nibble. There are three other pins that are exclusively inputs. These are E, RS, and R/W. E is the line that you use to signal to the chip that you are sending it data. Data is loaded into the chip on the falling edge of E. RS is the register select line. You can choose between sending commands that change how the display driver acts or sending data that is written to one of the display driver’s registers using this pin. R/W selects between read and write. For the most part, you will be writing data to the driver more often than you will be reading it. Still, the option is there, so — if you happened to be a hot-shot programmer who was running low on RAM — you could command the display to turn off and use its internal registers to store up to 88 bytes of RAM! The HD44780 has just a few commands that you need to know (see Table 1).

TECH TIDBIT Do you use a lot of LEDs in your projects? With most LEDs, you need to have a resistor in series in order to keep the current through the LED below a certain threshold. It is a pain to wire up all of those resistors. A simple solution that lets you avoid this problem is to use an LED that has an integrated resistor.

Connecting the Display to Your Electronics In this column, a PIC16F870 is being used, but — if you happen to be using a different processor — the connections will be essentially the same. You will need an eight-bit I/O port and three other pins for the E, RS, and R/W outputs. Figure 3 shows how you would connect the display to your circuit. For this display, there is a connection labeled VO. By adjusting the voltage supplied to this pin, you can adjust the display’s contrast. In practice, it turned out that simply connecting this pin to ground

Table 1 RS 0 0 0

R/W 0 0 0

Data 00110000 00000010 000001 I/D S

0

0

001 DL N F 00

0

0

01DDDDDD

0

0

1DDDDDDD

0

1

BF DDDDDDD

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

SERVO 01.2005

9

Rubberbands.qxd

12/8/2004

8:40 AM

Page 10

Rubberbands and Bailing Wire

Table 2 Steps • Wait at least 15 milliseconds after power-up before doing anything. • Send 00 00110000 by placing this data on the output lines and then raising and then lowering the E line. • Wait at least 4.1 milliseconds. • Send the same command by raising the E line and lowering it again. • Wait more than 100 microseconds. • Once again, send the same command by raising the E line and then lowering it. • Send the function set command. • Wait for the command to finish by checking the Busy flag or by simply waiting long enough. • Send the Display command. • Wait for that command to execute. • Send the cursor movement command. • Wait for that command to execute.

RS —

R/W —

Data —

0

0

00110000

— —

— —

— —

— —

— —

— —

0 —

0 —

001 DL N F 00 —

0 — 0

0 — 0

00001DCB — 000001 I/D S

Figure 3. Connections between a PIC and the LCD module.

10

SERVO 01.2005

provided the best contrast. The higher the applied voltage, the dimmer the display was.

Making the Magic Happen Before you can start to use the display, you will have to initialize the HD44780 driver chip. You will have to send a number of commands. For each command, you will place your data on the eight-bit port and the RS and R/W lines, raise the E line, and then lower it again after a short delay. Initialization can be done by following Table 2. Your display should be initialized now and you could go ahead and start sending ASCII character codes to be displayed. If you are using a one or two line by 40-character display, then everything will work as expected and the lines will break as they should. The display used in this column broke each line up into two lines of 20 characters, so you have to be careful that you don’t send more than 20 characters in a row or else the cursor will likely jump to a place where you don’t want it. Figure 5 shows the map for the display used here. As you can see, when the cursor hits the end of the first line, it will jump to the beginning of the third line and — after it reaches the end of the third line, it will go to the second — then the fourth. That’s not quite intuitive. I’ll show you how to more easily deal with that a little later. For now, let’s look at how to send characters to the display. Figure 6 shows a chunk of C code that lets you do this. When sending any command to the display, the procedure is to set up all of your output pins and then raise the E line. Although it

Rubberbands.qxd

12/8/2004

8:41 AM

Page 11

Rubberbands and Bailing Wire isn’t covered in the documentation, it appears to be necessary to wait a few microseconds to let the data settle before lowering the E line again. After that, you will need to wait until the display has processed that command. This is what the lcdBusy() routine is doing. Figure 7 shows the lcdBusy() code, which will delay until a character or command has been processed. You now have the ability to draw characters to the LCD. Let’s take a look at the issue of the lines being jumbled and how you can specify where on the display you would like to draw a character. Figure 8 shows code that will work for the display being used in this column. You may need to adjust the algorithm to match the display that you end up using. Now, you have the ability to draw any character anywhere on the screen, but it can be a little tedious to write the code to do it. This final example will show how — by using the printf() statement — you can reduce what would be a long series of statements into just one line. Every compiler works differently, but the CCS C compiler for the PIC allows you to specify a routine that takes eight-bit variables as the receiver of the data from a printf() statement. This drastically simplifies the task of writing to the display and allows you to do things like printf(lcdPutChar,”Button presses:%u”,presses); where you want to display numeric data.

Dotting the I’s and Crossing the T’s

void lcdInit(int1 showCursor) {// gets the display driver chip ready to display characters delay_ms(16); output_low(E); output_low(RS); output_low(RW); portB = 0b00110000; output_high(E); delay_us(20); output_low(E); delay_ms(5); output_high(E); delay_us(20); output_low(E); delay_us(110); output_high(E); delay_us(20); output_low(E); delay_us(50); portB = 0b00111000; delay_us(20); output_high(E); delay_us(50);

// 8 bit operation, 2 lines, 5x8 character

output_low(E); if(showCursor) // send command for how the cursor acts portB = 0b00001111; else portB = 0b00001100; delay_us(20); output_high(E); delay_us(50); output_low(E); portB= 0b00000110; delay_us(20); output_high(E); delay_us(50); }

// move cursor to right, don’t shift

Figure 4. How to initialize the LCD using C code. Figure 5. Map of the LCD’s display.

Throughout the code presented here, you will see statements like output_high(E);. If you were to use this code in a program, you would want to stick the statements at the beginning of your code (see Figure 10). Figure 6. How to send a character to be displayed. void lcdPutChar(int8 theChar) { output_high(RS); output_low(RW); output_high(E); portB = theChar; delay_us(20); output_low(E); lcdBusy(); }

SERVO 01.2005

11

Rubberbands.qxd

12/8/2004

8:42 AM

Page 12

Rubberbands and Bailing Wire

TECH TIDBIT Wires are a major source of failure in electronic projects. Wires tend to break off right where they are soldered to your circuit board. It is always best to try to reduce the number of wires that will be necessary, but for wires that you absolutely need, here is a trick that will keep them from breaking: Lay your wire against the board after it has been soldered. Using some E-6000 glue — which can be bought at many craft, hobby, and hardware stores — put a dab of glue over where the wire comes out of the board. E-6000 takes a while to dry, but — when it does — it is like hard rubber. Attaching the wire to the board in this way makes it so that any wiggling of the wire happens at a point where there is insulation on the wire, which significantly increases the longevity of the conductor inside.

void lcdBusy() {// delays until LCD indicates that it is not busy set_tris_b(0b11111111); // make LCD pins all inputs output_low(RS); output_high(RW); output_high(E); delay_us(10); // give the display some time to output while(input(BUSY)) {// do nothing } output_low(E); set_tris_b(0b00000000); // make LCD pins all outputs delay_cycles(2); }

Figure 7. Code that waits until the display is done processing the last command.

program will run on or maybe because you need to use a peripheral that has its pins currently tied up by something else in your program. If you didn’t use the #define statement, then you would have to go through your code and manually change every Using #defines is a good way to program because it reference to that pin. allows you to quickly rearrange your I/O connections if you Adding an alphanumeric display to your project has need to. This can a certain cool factor to it, as well as an immediately useful Figure 9. The first 10 lines and the be handy if you ability to instantly get feedback about what your robot is printf statement do the same thing. are switching the doing internally. processor that your Overall, this is a relatively easy part to add to your robot LcdPutChar(‘L’); and is well worth the effort. LcdPutChar(‘C’); LcdPutChar(‘D’); Figure 10. #define statements for the Next month’s column will cover LcdPutChar(‘s’); various LCD pins. some more advanced things that you can LcdPutChar(‘ ’); do with an LCD display that should be LcdPutChar(‘r’); #define E PIN_C0 // enable immediately useful to you — such as creatLcdPutChar(‘u’); #define RW PIN_C1 // read/write LcdPutChar(‘l’); ing your own characters, drawing bar #define RS PIN_C2 // register LcdPutChar(‘e’); graphs and sliders, and then using one select LcdPutChar(‘!’); #define busy PIN_B7 // busy flag of the bar graphs to give you visual feedfrom LCD back about your robot’s battery’s voltage. printf(lcdPutChar, “LCDs rule!”); SV Figure 8. Code to move the cursor to where you want it. void lcdMoveTo(int8 line, int8 character) {// move to the position on the display that was specified int8 position; if(line == 2 || line == 4) // If you want the second or fourth line position = 0b11000000; // on the LCD, select the second line in else // the driver’s memory. position = 0b10000000; if(line == 3 || line == 4) // If you want the third or fourth line position += 20; // on the LCD, add 20 because these lines position += character; // are actually the second halfs of the output_low(RS); // driver’s two lines. output_low(RW); portB = position; output_high(E); delay_us(20); output_low(E); lcdBusy(); }

12

SERVO 01.2005

Figure 11. Although not robotic, this is a fun application that uses an LCD.

Full Page.qxd

12/9/2004

3:30 PM

Page 13

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

Cleveland Institute of Electronics offers distance learning programs that will prepare you for rewarding careers in Electronics Engineering or Computer Technology - even if you have no experience! CIE's courses allow you to learn new technology at your own pace, in your own home, without disrupting your present job or lifestyle.

CIE’s Distance Learning Programs • Electronics Associate Degree • Computer Associate Degree • Basic Electronics with Lab • Advanced Electronics Troubleshooting with Lab • Electronics Technology with FCC Preparation

No prior experience is needed and you can do all your training at home with full instructor support, extensive learning labs and on-line exams.

• PC Troubleshooting

They're fast, convenient, affordable and quickly becoming the new way to earn an accredited degree.

• COMING SOON! Industrial Electronics with PLC Technology

Send for your FREE CIE course catalog and take the first step toward building a successful career in electronics and computer technology. You’ll find it has many rewards!

• Computer Networking • Wireless Technology

Cleveland Institute of Electronics 1776 E. 17th St, Cleveland, OH 44114

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

CD ROM & Certificate Training - CIE Bookstore Introduction to Multimeters

Introduction to Computers

Soldering Course with Lab

2 meters • 4 lessons • 13 experiments 02-069 (Pictured) cert .......... $195

9 lessons • certificate 01-IN01 ...................................... $195

3 lessons • lab • video 01-SD01 (cert) ......................... $195

FCC License Prep Course

Basic Electronics Course

PC Board Design with Lab

19 FCC prep lessons on CD ROM. 01-FCC01 (cert) ................... $49.95

39 lessons • 2 labs • 53 exercises 03-Introb (cert) ....................... $225

4 lessons • lab • CD ROM 02-261 (cert) ............................ $195

Fiber Optics Course with Lab

Oscilloscope Course

Intro to Information Systems

2 lessons • Lab • Video • Certificate 01-FB02 ..................................... $175

7 learning topics • video 01-SCP01 (cert) ......................... $95

9 lessons • certificate 01-CET111 ................................ $195

FREE CIE BOOKSTORE CATALOG • www.ciebookstore.com • (800) 321-2155 Circle #82 on the Reader Service Card.

SERVO 01.2005

13

Geerhead.qxd

12/8/2004

8:44 AM

Page 14

by David Geer [email protected]

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

Tiny, but Mighty! Small Bot Saves Lives by Marking Land Mines! Uncle Sam and Others Are Looking for a Few Good Robots ast spring, four students at Johns Hopkins (JH, Mechanical Engineering Department) completed a robot that can travel, locate metal objects, see, and spray paint. What’s the big deal? With these capabilities, it becomes a plausible solution for detecting and marking deadly land mines that are waiting underground in far away battle

L

14

SERVO 01.2005

zones around the world. The bots, which can be built for under $1,000.00 a piece (in production), traverse the grassy or jagged terra firma found in war zones like little two-part tanks. A metal detector — to be replaced by top-notch sensors developed at JH — locates suspected land mines. The robot’s camera eye sends

back pictures of the target, which can be manually spray painted from the controller and later neutralized. The little mine detective is in the welcome hands of explosive detection scientists. They are using it as the * All photos are courtesy of Will Kirk. *

Geerhead.qxd

12/8/2004

8:48 AM

Page 15

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

Land Mine Detection, Project Inception

Rugged bot mine detective finds its prey — a metal target that represents a land mine — in a test demonstration.

The story began when John Hopkins physicist Carl Nelson presented the student engineers turned robotics team with a problem. He had created these great new sensors targeted at detecting land mines, but he needed an appropriate contraption to get the sensors through the brush, rocks, and sand to the mines. The students were tasked with creating a mini-off-roadingall-terrain robot that could get to the mines without being blown up itself.

Robot Dud On its maiden test run, the minedetecting bot looked more like one of its exploding adversaries than a proponent of protection. When the student roboticists first attempted to run the rascal via the joystick, they got no movement and a load of melted connectors. They found out that their supplier had shipped the wrong motors; the

current demanded by the ones they did get was beyond the capacity of the connectors. The team ended up scrapping those motors and finding new motor and gearbox pairs.

Robot Racer With the “front vehicle” — more on that later — ready to go, the team tried again. The new, high torque drill motors worked perfectly. The bot zoomed around the lab, navigating all terrains — including people’s toes. The bot’s operator had the vehicle spin brodies like a racecar. The mini-tank-like vehicle could spin in place at 60 RPMs. The vehicle was detailed with an inverted cow catcher up front to move obstacles out of its camera’s path. The robot’s design was dictated by the requirement that it not set off the land

This effective controller guides the robot and receives video from its camera eye, sounding the alarm when a metal object — possibly a mine — has been detected.

mines. The paint used to mark the spot where each mine is located is a very light and, yet, a very easily recognized The eyes have it as the robot camera enables the operator to have a glimpse of everything the bot itself sees.

CONSTRUCTION The mine-detecting robot looks like two robot tanks — one towing the other. The front vehicle moves the bot by means of its two cordless power drill motors, which are powered by a sealed lead-acid battery. This front vehicle is topped off with a color video camera, which lets the bot’s operator see what it sees. The rear vehicle carries the metal detection coil that is used at this experimental phase to detect the land mines (in this case, metal objects that are surrogates for the mines themselves). This detection device was scavenged from a common consumer treasure hunting

product; it will be replaced by Professor Nelson’s specialized mine-seeking sensors in the funded research phase. The rear vehicle also carries the paint and paint nozzle for marking mine locations. At this point, the mechanism can only house enough paint to mark about 40 mines before it needs a refill — but that’s still four times the minimum requirement for the project. Keeping a Safe Distance A joystick controller steers the bot from up to 500 feet away. The video

feed can be received from up to 100 feet away. The controller video screen can display real time images of what the bot sees. When the bot detects metal, an alarm — a beep — sounds in the operator’s headset. The operator must throw a switch on the controller to mark the place where the metal detector reacted. The bot was constructed using plastic and other non-metal parts in order to save on weight, costs, and false positives from the bot detecting itself instead of the mines. The two part front and rear vehicle design spreads out the robot’s weight so that it is less likely to set off a mine.

SERVO 01.2005

15

Geerhead.qxd

12/8/2004

8:50 AM

Page 16

GEERHEAD

The controller can steer the robot while operators steer clear, up to 500 feet away. Video transmissions reach out up to 100 feet from the bot’s camera.

RESOURCES Low-res versions of pics in this article and more at: www.jhu.edu/news_info/news/ home04/jun04/mines.html and www.jhu.edu/news_info/news/ home04/jun04/mines2.html Robotic Mine Detector, Project Video at: www.jhu.edu/news_info/news/ audio-video/mediamines.html Johns Hopkins Department of Mechanical Engineering at: www.me.jhu.edu

Tank-like treads enable mobility through tall grass, rugged terrain, and any place mines may be laying in wait for their next victims.

shade of yellow.

constraints they had to work with.

Finishing Touches

Lessons Learned

The young roboticists wanted their machine to look as cool as it ran. The students chose an all-black construction and appearance (where possible). They worked diligently to cut and attach black acrylic sheets on the back where there were still some clear panels showing. The roboticists also machined all the applicable parts themselves. The four shared in the cutting, drilling, gluing, sanding, mounting, and CNC programming for the project. Maintaining this added project control gave them an edge in creating exactly what they wanted within the time

The type of laser cutter that Johns Hopkins made available for the mechanical engineering class and the Polycarbonate that was being used did not mix. The combination created chlorine gas. One of the young engineers discovered the hard way how easy it is to have drill bits break on you and have the pieces come flying at you, hitting you in the forehead. The roboticists also suggest that anyone engaging in similar projects test, break, rebuild, test, break, rebuild, and repeat until not broken; this is the best way to find your path to a solution. SV

TIDBITS Yes, the four robotics engineers in this story have names; all but one have graduated now. Landon Unninayar, Dan Hake, and Dat Truong were seniors working on this project before graduation. Edoardo Biancheri planned to have completed his undergraduate studies in December ‘04, with a double major in mechanical engineering and economics. These young men were tasked with building this successful bot project for under $8,000.00; they did the job with about $5,000.00 and believe it could be mass produced for under $1,000.00 — less the cost of better sensing. Professor Nelson will soon have demonstrated this

16

SERVO 01.2005

prototype to US Army funding sponsors to establish how an inexpensive minedetecting bot could help prevent death and dismemberment from land mines around the globe. Challenges Building a life saving bot is not a goal without its obstacles. The biggest one the crew reported was making a pressurized paint sprayer out of almost 100 percent plastic materials. The requirement included being able to mark at least 10 mines before the sprayer went empty. There are no commercial sprayers

that meet all the specs they needed to meet. So, the team set out to design and test their own. They started by looking at both Polycarbonate and soda bottles. Ultimately, a Polycarbonate bottle was found that would fit all constraints. The only remaining spec was the pressure test. How did they test it? They filled it with water, suited it up with gas fittings, and pumped it up with a bike pump until it started to leak. At first, leaks came from the pipe fittings. Then, those leaks were fixed and the cap broke off the bottle and shot out about 60 psi of water. Once they dealt with the weaknesses in the cap, the paint container was complete.

Gray4.qxd

12/8/2004

8:27 AM

Page 17

by Thomas Gray and J. Wolfgang Goerlich

T

his is the final article in “BEAM Robotics Step-by-Step.“ During this series, we have touched on some of the central themes in the BEAM (Biology, Electronics, Aesthetics, and Mechanics) design philosophy: • Keep it simple; minimize everything from cost to part count to power consumption. • Use basic circuits to simulate biological nervous systems and pattern generators. We designed this final robot to illustrate these ideas while tossing in a couple more BEAM bits.

Walking and Tumbling

Turbot is upside down. A Turbot can maneuver in much the same way as a walker can. It can turn on the spot, climb up and over obstacles, and traverse rough terrain, yet it only requires two motors. Since motors cost a lot and draw a lot of power, fewer motors mean lower cost and longer battery life. Also, the mechanics of a Turbot are simpler than those of a walker and do not require much balancing or tweaking in order to work properly. Simple and low power, cheap and versatile — classic BEAM!

Step 1: What’s Nu? The Nu (pronounced “new”) Neuron looks like a Nv Neuron with its resistor and capacitor mixed up. See Figure 1 for a side-by-side comparison. There’s nothing to it, but — as with so many BEAM circuits — the resulting change in behavior exceeds the minor part change. When we say that the Nv Neuron is “nervous,” we are being a bit cheeky. The Nv Neuron is an edgy neuron, trigger happy, and all the other silly puns. The Nv Neuron immediately sends an output pulse when an input impulse comes in. There’s no waiting around — the Nv Neuron fires immediately, holds the output for a time, and then

At one time or another, every kid has spent an afternoon poking and prodding insects. It is amazing how bugs move around, handling rough environments. Walking robots — especially quadrupeds and hexapods — can handle rough terrain better than wheeled or tracked vehicles. However, while there have been great improvements in walking robots, they still lag far behind the tough-shelled bugs! One particularly tough problem faced by walking robots — whether they are BEAM or microprocessor driven — is what to Figure 1. Comparison of the Nv and the Nu Neuron. do when they fall over. A unique type of BEAM robot called the Turbot has no problem being inverted because it spends half its time upside down! A Turbot moves by flipping itself using rotating flagella instead of legs. A Turbot doesn’t exactly walk; it scoots and tumbles. It’s a bit tricky to give a Turbot directionality (having it head toward a light, for example) because — every time the bot flips over — the motors are effectively reversed and a different side will be facing the light. What we will need, then, is a circuit to decide which way to go (“Which way is brighter?”) and another circuit (“Which way is up?”) to invert the decision when the

SERVO 01.2005

17

Gray4.qxd

12/8/2004

8:29 AM

Page 18

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

shuts down. The time period is determined by the Nv’s RC Time Constant. Again, this sets the time in seconds equal to the resistance in megohms times the capacitance in microfarads. T=RxC 4.7 seconds = 1 M x 4.7 µF The Nu or “Neural” Neuron waits a bit before deciding to switch. It receives a high input signal, waits around for a time period (again determined by its capacitor and resistor), then turns on and stays on until the input goes low again. If the Nu does not receive a low reset signal to its bias point, it will stay active. Basically, you are charging a capacitor through a resistor. The capacitor takes time to charge up — again determined by the RC constant. When the capacitor’s charge passes the ’240 switching threshold, the inverter will flip and send a low pulse. The Nu is said to be active. When the Nu input changes to Gnd, the inverter flips back to high and the Nu is inactive. Figure 3. The Nu on the breadboard. A 4.7 mF electrolytic capacitor (watch polarity) and a 1M resistor give a delay of about 5 seconds.

Step 2: Muxing Around Often, it is helpful to be able to reverse a Nu or Nv output, in order to change the motion of a robot. To do this, we will use a gadget called an Inverting Multiplexor or IMx (pronounced “eye-mux” or just mux) that can be built with one half of a 74xx240. For our Turbot, this means that we can stick the entire circuit on a single IC chip, keeping the parts count down and keeping life simple. In Figure 4, Enable (A) is the enable line, which is normally held high (off) in this case by the 100K resistor, but can be sent low (turned on) by a push-button switch. Input (B) normally comes from some neuron output; the 470 Ω resistor holds the input high through the LED. If A is high, then the inverter is turned off; the signal (B) is passed through R1 to the Output (C) via the output LED. In this case, C is the same as B and both LEDs glow. Push the button to set A to low, though, and the inverter turns on. Since the resistance of the inverter is less than R1, the inverted signal takes this path and the output is the opposite of B. The input LED remains on, but the output LED goes out. The IMx acts as an Exclusive Or (XOR) gate. Some BEAM robots will use an XOR chip to get the same results. The Solarbotics Scout Walker, for example, uses two gates on a 4030B quad-XOR chip.

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

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

18

SERVO 01.2005

Gray4.qxd

12/8/2004

8:30 AM

Page 19

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

Figure 4. Inverting Multiplexor (IMx).

becomes active (goes low). Now, things start to get interesting. The high pulse from Nv(4,16) is fed to the Nu decisionFigure 5. Tumbler Turbot schematic.

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

19

Gray4.qxd

12/9/2004

1:07 PM

Page 20

BEAM Robotics Step by Step — Part 4 like an inhibitory neuron. Whichever Nu decides to fire first is the only one that can fire during the current Bicore cycle.

FP

PP

PP ƒ

 PP

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

20

SERVO 01.2005

Figure 8. Photo of Tom’s prototype.

Gray4.qxd

12/9/2004

9:24 AM

Page 21

Tumbling Turbots run; on the opposite side, the inactive Nu signal is reversed so that its motor does run.

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

Figure 9. Photos of Wolf’s finished robot.

A LITTLE BIT OF INFO Check these websites for more BEAM projects and information. Photographs of Mark Tilden’s Turbots: www.solarbotics.net/gallery/Turbots Solarbotics BEP Turbot: www.solarbotics.com/resources/static/bep/bep5_turbot.php

ABOUT THE AUTHORS Tom and Wolfgang connected online at http://groups. yahoo.com/group/beam/ and hope someday to meet faceto-face for coffee and conversation or perhaps a friendly mini sumo match.

Grant McKee’s Turbots: http://grant.solarbotics.net/Turbots.htm Brett Hemes’ Solar-powered Turbot: http://breadboard.solarbotics.net/misc_03.html

Circle #118 on the Reader Service Card.

SERVO 01.2005

21

Gray4.qxd

12/8/2004

8:34 AM

Page 22

BEAM Robotics Step by Step — Part 3 will flop its way into a pool of light. Be patient and swap the motor connections until you get it right.

Conclusion

Figure 10. Mark Tilden’s Turbots, courtesy of Solarbotics.

When you build your Tumbler, it may take a few tries to get the motors hooked up properly. You’ve got a one-in-four chance of hitting it the first time. What you want is a bot that

In this series of four articles on BEAM, we aimed to give you an introduction to the simplicity-within-complexity of this approach to robotics and a chance to create some fascinating little robots with relatively simple circuitry. If you have tried these projects and enjoyed them, experimented with them and extended them, or developed an interest in going deeper and learning more, then we’ve succeeded. As Tom signs all his BEAM posts, “Keep BEAMing and dreaming.” SV

PARTS LIST Electronics 74HC240 (74AC240 in a pinch) Photodiodes Asst. LEDs

Resistors Capacitors

CdS Photoresistor PNP Transistors Diodes Perfboard

Mechanics Motors 6 V Power

Power Switch Flagellum Connectors

Misc. Breadboard Body Wire ties Flagella Heat shrink tubing

22

SERVO 01.2005

Texas Instruments SN74HC240N Fairchild MM74HC240N Siemens SFH 205f wide field Red, green, or yellow LEDs (We use standard LEDs on the breadboard and tiny LEDs in construction.) 4- 470 Ω, if desired, for indicator LEDs and a few in the 1M – 10M range Assorted, 0.1 µF to 6.8 µF range If electrolytic or tantalum caps are used, observe polarity. Any of various types should work. Try for a matched pair. 2N2907 or 2N3906, for example Two small signal diodes, e.g., 1N914 or 1N4148 Perfboard or project board

Two matched hobby gear motors Two AAA battery packs or one four-AAA battery pack (You can use four-AA, if you wish. The AAAs are lighter and smaller.) SPST toggle power switch Use a slide switch, if you prefer. Euro-style terminal blocks (get the smallest ones)

Generic solderless breadboard and ties Use 3 mm Sintra or any suitable material Brass welding rod or old coat hanger Or rubber tubing / model aircraft fuel tubing

Digi-Key 296-4305-5-ND Solarbotics 74HC240 Solarbotics 74AC240 Solarbotics IR1 Digi-Key 350-1347-1-ND Digi-Key 350-1348-1-ND Solarbotics TLED See text for details See text for details

Solarbotics CDS RS 276-2032 or RS276-2034 Solarbotics TR2907 or TR3906 RS 276-1122 or 276-1620 Solarbotics D1 Solarbotics BEP BB1 RS 276-0050 or RS 276-1395

Solarbotics GM3 RS 27-411 includes switch RS 27-413 x 2 RS 27-398 x 2 Solarbotics BHoldAAA x 2 RS 275-325 Solarbotics SWT2 RS 274-679

Solarbotics Any hardware store

Samans.qxd

12/8/2004

7:55 AM

I

Page 23

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

RoboSapien PC Control Set-up

The Hack My RoboSapien hack has several different components: audio, video, and control. I have outfitted the robot with a wireless camera, a radio frequency receiver that SERVO 01.2005

23

Samans.qxd

12/8/2004

7:59 AM

SERVO Magazine

Page 24

Hack-a-Sapien

Contest Winner

IR sensor. After you plug in the USB-UIRT for the first time, make sure to install the latest drivers. Girder is Windows automation software that is very popular with the HTPC crowd. It can be complicated and has a steep learning curve, but — in terms of depth of control and raw power — it is the best thing out there by far. We are going to use it primarily to learn, organize, and store the IR commands from the Here’s the early prototype of the RF receiver RoboSapien remote and then exewith a RadioShack mini amplifier/speaker. Great backpack, horrible sound quality. cute them by pressing a button in the MainLobby interface. whatever I have programmed in Girder. As stated, another extremely useful Unlike the RoboSapien, Girder places feature of Girder is the ability to no limit on the number of steps you program macros (called “multigroups” can put in a macro. in Girder) with unlimited amounts of The following is a detailed “how steps. We are really only using a fraction to” on setting up a skinned PC interface of the software’s capabilities; you can to control RoboSapien using the also use Girder to control your PC via IR USB-UIRT IR transceiver, Girder, and remote, to send and receive serial MainLobby. This information was commands, and a million other things. originally published by me in the MainLobby is made by a company forums at RoboSapien.tk called Cinemar and is designed to be I used the USB-UIRT as my IR transan HTPC (home theater PC) front ceiver. I don’t think it is the cheapest end. It allows you to create a custom option, but I had an extra one laying graphical user interface (GUI) with around. The creator, Jon Rhees, hand buttons that you can set up to launch makes them and provides excellent programs, execute files, trigger events in Girder to send IR commands, and so support; the device is also pretty much on. It is entirely skin-able, so the sky is custom made to work with Girder. If you are just going to use it with the the limit in terms of graphics and the RoboSapien, the base model will do; design is accomplished via an easy however, if you also want to use it to drop-and-drag interface. For this project, I am using the trial learn IR from a lot of stereo and home version of MainLobby and I just used theater components, you need to get buttons and a background from the the version with the additional 56 kHz included libraries. It will be fun to design RoboSapienThe wireless camera installed in chest cavity. If you weren’t looking for it, you probably wouldn’t notice themed setups. ML Server is it. Of course, the fact that you are being followed by a robot would probably make you suspicious.

24

SERVO 01.2005

the MainLobby application used to interact with Girder. Set-up: So how do we get all these pieces setup and communicating with each other? The first thing is to make sure that the USB-UIRT, Girder, ML Server, and MainLobby are all installed and running on your PC.

Girder Set-up and Configuration: Go to File -> Settings -> Plug-ins tab and make sure that the “Internet Event Server” and “USB-UIRT driver” plug-ins are installed (checked). Also make sure that the “Auto Enable Input device” box is checked. Click “apply” and then click “OK.” You should now be back at the main Girder screen and the light in the bottom right corner should be green (this means the plug-ins are enabled and operational). If it is not green, try going to File and choose “Enable Input Device(s)” or hit F9. Now that the plug-ins are set up, let’s teach Girder a RoboSapien command. Go to File -> New. In the large, white area on the left, right click and choose “Add command.” A folder named “New” and a command named “New” will be created. Select these and right click to rename them. The folder is what’s called a “group” and is used to organize commands. Let’s rename it as “arm commands” and use it to store all of RoboSapien’s individual arm movements. Select the command, right click, and rename it “R arm in.” While it is still selected, look in the top right and select “Internet Event Server.” Click on the learn button and enter an event string — for example, “rarmin.” Notice that there is a new item underneath the The ZT-802 mini wireless camera. command called an “Event String.” This is the command that Mainlobby will send to trigger Girder to send out the appropriate IR command. Click “OK.” Now, make sure the “R arm in” command is still selected and, in the bottom right, choose the “Plug-ins” tab. Select the “USB-UIRT driver” in the list and then click on “Settings.”

Samans.qxd

12/8/2004

8:00 AM

Page 25

SERVO Magazine A USB-UIRT driver window will pop up; click on the “Learn ...” button. Another window will now come up and await the IR signal. Take RoboSapien’s remote and point it at your USB-UIRT then continue pressing the right arm up button until it learns the command and returns you to the USB-UIRT driver window. I know that the instructions in the window say to HOLD the button on the remote, but RoboSapien’s IR isn’t a constant signal (it is a burst), so you might have to hit the “Accept Burst” button if it will not fully learn. Now that you are back at the USBUIRT driver window, point the USB-UIRT at RoboSapien and hit the “Test” button to make sure that the command was learned successfully. If not, relearn it. Also pay attention to the “Repeat” box. You will want to set this to 1 in most cases, so that Girder only sends the command once — unless you want it to send the IR command multiple times. For example, I have commands setup to move the arm all the way up, all the way down, all the way out, and all the way in; these utilize the repeat function. Congratulations! You have taught Girder the first RoboSapien command. Repeat the above steps for each command on the remote and organize them in groups as you see fit. One other thing worth mentioning in Girder is “multigroups.” These are macros; you can take any girder command you have created, right click on it to copy, and then paste it into multigroups. String together unlimited commands, but keep in mind that you might have to mess around with some more advanced settings to get the timing right when using RoboSapien’s combination or attitude moves. Don’t forget to add an event string for them so you can call them from MainLobby. Once you have your IR commands learned into Girder, save your file, and then click File-> close window to send Girder into your system tray.

Hack-a-Sapien

Contest Winner

up Windows Explorer and find the file gireventlib.dll (it should be in the folder C:\Program Files\girder) and copy it to your C:\Windows\system32 folder. Alternatively, you can add the file to your path. Select Option on MLServer and choose hide to send ML Server to the system tray. MainLobby Set-up and Configuration: With MainLobby open, go to the top of the screen to bring up the menu. Select options and hit the “Girder” button at the left. Setup both the Girder.exe location and the Internet Event Server (ieventc.exe) location on your hard drive. They should both be in the main Girder directory. Click on the “Scene” button on the left. Notice that this is where you choose your background skin, any animated effects, and so on. Click the “OK” button in the bottom right to exit the Options screen. Now, move your mouse to the top menu bar and choose design mode. Click “Add” to add a button; any button shape will do for now. You can load custom buttons of your own or hit the “Library” button to choose from those included with MainLobby. Once you see the button appear on your background, you can drag and drop it wherever you like. Hit the “Edit” mode button in the top menu bar and click on the button you just created. A screen with tons of options will open up. Here, you can customize your button. In the “MLServeCmd” area at the bottom, click on the “A” button. A new window will pop up. From the drop The wireless camera installation from the inside.

RoboSapien with the RF receiver PCB prior to installing it inside his back cavity.

down list in the “MLServeCmd” Panel, choose “MLGirder.” This will populate the following statement in the box: “MLServeCmd.MLGirder|.” Add the Event String you created in Girder for a particular RoboSapien command to the end of this statement. Using the command we created earlier, the box would read “MLServeCmd.MLGirder|rarmin.” You can now test it via the test button to make sure it works or press “OK” and test it from the button’s properties panel. Click “OK” when finished. You should now be able to choose “Launch” from the top menu bar, click on the button you created, and make RoboSapien bring his right arm in. Repeat the above steps in MainLobby for each button you wish to create.

The RadioShack mini amplifier/speaker gutted. Oddly, it made me hungry for doughnuts.

ML Server Set-up and Configuration: Open up ML Server and make sure that “MLGirder” is listed in the plug-ins at the bottom. Open SERVO 01.2005

25

Samans.qxd

12/8/2004

8:12 AM

SERVO Magazine

Page 26

Hack-a-Sapien

Contest Winner

from my PC. This ties in nicely with the PC control scheme. I gutted an inexpensive set of Emerson EHP1000 wireless (RF) headphones. Initially, I just stuck the circuit board in the little slot behind RoboSapien’s head. I did not want to make a more permanent decision until I could install a camera. This allowed me to transmit sounds played on my PC to the RoboSapien speaker. MainLobby lets you assign multiple events to each control button, so I can press one button in the MainLobby GUI and it will send an IR command to RoboSapien and play an MP3 file. With the wireless set up, it plays this sound through RoboSapien’s speaker. RoboSapien now says whatever The finished RF receiver hack. The project box MP3 I send to him, plays music, includes a stereo amplifier, batteries for the cametc. era and the amplifier, an on/off toggle for the amp with LED indicator, volume control, and The possibilities are interestinputs for both Robosapien’s native voice (mono) ing. You could set up separate and the RF receiver output (stereo). The toggle schemes for and indicator LED behind the head are for the RF control receiver, which is concealed in his back cavity. RoboSapien with separate sounds. For example, with a custom themed GUI created in MainLobby, you could create a football RoboSapien, programmed to dance, play the fight song of your favorite The next step in my Zion replication with RoboSapien was to develop a team, cuss at the refs, cheer for individmodified sound system. The original ual players, whatever you want. concept was to use the RF receiver Once I got into this hack, I found from a set of wireless headphones so that I had a real problem with amplifithat RoboSapien could play MP3 music cation — more specifically, the lack of files and, for that matter, any sound it. I am a total newbie when it comes to electronics, so — when I hooked this up — I basically RoboSapien at night with his new lighting system. just plugged the RF transmitter into the headphone jack on my PC speakers and hooked up the RoboSapien speaker to the wires that were used for one of the headphone speakers. The volume was adequate through the RoboSapien speaker (slightly lower than the default RoboSapien voice) if I have the volume turned all the way up on my PC. To solve this problem, I added a 1 W amplifier

RoboSapien RF Sound Mod

26

SERVO 01.2005

that works like a charm. Now, there was more than enough volume, but I realized that the speaker was subpar. The solution was found in a set of 10-year-old, unamplified Sony Walkman speakers I had laying around. The speakers are each 8 Ω, 0.2 W, so I wired them in series. This made a real improvement in the sound quality. The new problem was that the speakers are pretty big — 2.5” by 3/4” thick — plus a 9 V battery and two AAA batteries in the mix, the amplifier PCB, and the RF headset PCB. Obviously, I needed to house all this hardware in some sort of a backpack/project box. Building the project box was an issue. All of the boxes at RadioShack were either too big or too small. I tried a plastic box that housed a set of hobby knives. I liked the size, but it was too shallow for all the boards and batteries. While searching, I came across a decent little mini amplifier/speaker. It’s a nice little package — about the size of a handheld transistor radio. It’s 200 mW and drives a 16 Ω, 0.5 W speaker — a perfect robot backpack. Using a couple of lids from tin espresso boxes, I rigged up an enclosure for the RF amplifier and the AA battery pack. I then Velcroed it all together and attached it to RoboSapien’s back. It’s very secure and it works pretty well. I needed to shield his upper body motors; they caused some interference. I’m still not really very happy with this mod; although it works as intended, it’s just okay. Once I had decided that I needed to house all of the RF equipment and improved speakers “off site” from RoboSapien, I wired up a toggle switch on the robot’s back that turns off his internal speaker. I found I was missing his “caveman talk” — which I found quite strange. I ran a set of wires out of RoboSapien to hook up his internal sounds with the external setup, although I am not really sure now that they are needed. I left them because I figure any backpack arrangement will end up blocking his internal speaker. Now, the Sony speaker system sounds fantastic and plays both the RF receiver input (in stereo) and RoboSapien’s native voice (in mono).

Samans.qxd

12/8/2004

8:13 AM

Page 27

SERVO Magazine It’s pretty much the coolest MP3 boombox ever! At this point, there are still a few loose ends that need to be tied down: •I am using industrial strength Velcro to hold the speakers on RoboSapien and the project box on the speakers. It is pretty heavy. I will need to come up with a better solution to attach it — maybe bolts or pegs of some sort. • The weight of the speaker system slows down RoboSapien’s walking speed. This isn’t such a bad thing, as it helps to stabilize him and make the wireless camera feed less jittery. • The amplifier eats through batteries pretty quickly. • I need to make longer patch cables so that the entire “backpack” can be removed once RoboSapien reaches his destination. I made them a little too short.

RoboSapien Camera Mod Next, I decided to install a miniature wireless camera in my RoboSapien. Thanks go to RoboSapien.tk for the initial idea. Some people have installed a similar camera into the robot’s head. This is great, since the head turns when you raise and lower the arms and you can pan the camera around. Getting the glued head assembly apart is extremely difficult, so I went for the easier solution: I installed it into RoboSapien’s roomy chest cavity. For this project, I used a small “ZT-802” type RF mini camera. They are easily found on www.eBay.com It will transmit both audio and video. The actual camera is about the size of a sugar cube and fits very nicely in RoboSapien’s chest cavity. The receiver has composite (RCA style) outputs that you can plug into a TV or a tuner card in your computer. I build HTPCs as a hobby and swear by the Hauppauge WinTV PVR-250. It works great with this mod, since it provides the ability to record the audio and video (or snapshots) on your PC.

Hack-a-Sapien

Contest Winner

Before you start cutting up RoboSapien, though, it is a good idea to test the camera to not only make sure it works, but to make sure you are happy with the quality and with the set-up. Plugging it into a TV or VCR probably isn’t as much fun as plugging it into a PC that can control RoboSapien and record the images. The camera lens is 0.5”, so that’s the hole size we need to drill in RoboSapien’s chest. He’ll I see London, I see France, I see RoboSapiens’ headlamp underpants! probably have nightmares about the drill for a long time to come. I tried using smaller Finally, I felt it was the most aesthetically holes, but the result wasn’t as good as pleasing place for the camera. letting the entire lens come through Here are a few notes on drilling the RoboSapien shell. It also looks the hole: Make sure you take your time nicest when the camera lens is flush and go slow; once the hole is there, with the robot’s chest. you can’t easily fix it. I started with a I chose the center location in his 1/8” drill bit and drilled in the center chest for several reasons. One, it is the point on his chest, right where his spot where his chest cavity is widest. “cleavage” meets his black “throat Also, it is the furthest point away from piece.” Once this hole was made and his arm and waist motors, so interfercleaned up with a hobby knife, I moved ence is kept to a minimum. I didn’t even to a 1/4” drill bit; I enlarged it and need to shield his motors. This spot is again smoothed the edges with a also one of the more stable points on hobby knife. the RoboSapien and — since it is dead Finally, it was time for the big center — it shouldn’t affect his balance. daddy — the 1/2” drill bit. This made a

:HERWV )DVWSURWRW\SLQJ VLPXODWLRQRIURERWV 7KHFKRLFHRIXQLYHUVLWLHVDQG UHVHDUFKFHQWHUV ZRUOGZLGH

ZZZF\EHUERWLFVFRP Circle #114 on the Reader Service Card.

SERVO 01.2005

27

Samans.qxd

12/8/2004

8:14 AM

SERVO Magazine

Page 28

Hack-a-Sapien

Contest Winner done. If you have other mods that are taking up space in the chest cavity, you may need to secure the battery cable connector inside; it’s pretty bulky, but I just let mine lay where it wanted. One thing this mod showed me was that there is a ton of space inside the chest cavity.

The MainLobby configuration menu.

mess because the plastic is so thin (comparatively) and required a lot of the old “in and out” with the drill to smooth the hole. It also required quite a bit of sculpting with the hobby knife to get the edges nice and smooth. Once the hole is made, you will need to fit the camera and make any adjustments to the hole. There is no place to attach the camera and I don’t really think it would be a smart idea to hot glue it onto the chest shell where the lens goes through. The threaded lens screws in and out of the camera body to focus and gluing would eliminate its ability to do this. I used a small piece of wood to attach the camera to the robot’s chest shell. I used a spongy sanding block to make it nice and smooth and — more importantly — to get exactly the right size and shape. Note that you will need to angle the camera upward slightly, unless you want RoboSapien to film only shoes. A custom sanded piece of wood is perfect in this regard. Make sure you

28

SERVO 01.2005

fit it exactly how you want it before you even plug in your hot glue gun. Apply the hot glue to the piece of wood and press the camera into place. This makes it much easier to install. I glued the apparatus to the center support peg. I left the antenna for the camera inside the chest cavity. Once the camera is attached to RoboSapien’s shell, hook it all up to make sure it still works and that the position, angle, and so on are to your liking. The next step is to elongate the cables for the battery. I simply snipped off the original battery snap from the connector — leaving the wires intact — and then used a RadioShack 9 V snap. This gave me 3” or 4” of wire, which was plenty. I also drilled a small hole in RoboSapien’s back shell to feed the wires out of. If you are going to do this, make sure you feed the wires before you connect them. I used Velcro to connect the actual battery to the robot. Put it all back together and you are

Lights, Camera, Action As I mentioned, the main problem with the mini cam is how much light it needs. I knew that adding some lighting would help alleviate this problem, so — when I came across a Coleman LED headlamp for $10.00 — I convinced my wife that it would be great for camping (which we haven’t done in three years). Anyway, I had planned on gutting it, but it turns out that it fit pretty well right out of the blister pack in the form of “headlamp underpants” on RoboSapien. I like the design, as it’s just one piece. I’ve seen a lot of headlamps that have a separate pack for the batteries. I still need to test how well it works with the camera in terms of upping the light levels, especially during daylight indoors. Now, I have my ever-present Zionstyle dub, in addition to remote control via PC and a video link, all thanks to this RoboSapien hack. And there’s still room for more mods ... SV

Page29.qxd

12/9/2004

1:46 PM

Page 29

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

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

Circle #132 on the Reader Service Card.

SERVO 01.2005

29

menagerie.qxd

12/9/2004

5:00 PM

Page 30

Send us a high-res picture of your robot with a few descriptive sentences and we'll make you famous. Well, mostly. [email protected]

Hero Pat Stakem, Laurel, MD The HERO was based on a Motorola M6808 eight-bit CPU and had a Polaroid range finder, light and sound sensors, and voice synthesis. The manipulator arm was a popular option. I built one unit and borrowed the other machine from a research lab for some co-ordination experiments. Upper left: Let's think about this — the Hero-1 on the left uses the teaching pendant of the other Hero-1 robot ... Middle left: Two Hero-1 robots solder a connection on a Hero-JR. I built the Hero on the right and the JR. Lower left: Here's a good use for the little fellows. Lower right: The Hero-1 on the left uses a pencil to operate the hex keypad of the other Hero-1.

30

SERVO 1.2005

Barlow.qxd

12/8/2004

9:26 AM

Page 31

— BY KERRY BARLOW — obot designers face many challenges in their quest for the perfect robot. The most obvious decisions are microprocessor type, wheel configuration, sensor modes, prices of hardware, and software design. The list can be endless and daunting. One of the first decisions we all must face is the choice of microprocessor. In my latest robot, I have chosen the Basic Micro Atom 24pin as the brains of my creation (Figure 1). I chose the Atom primarily for its basic programming language and its compatibility with many thousands of pre-existing program examples in the communi-

R

ty. The Atom comes in many variants — 24-pin, 28-pin, and 40-pin. In addition, there are Atom Pro microprocessors with extended capabilities above and beyond what the Atom has. The Atom 24 is pin compatible with the Parallax BS2. Basic Micro is a small company, so they put their effort into designing new hardware and features for their product line. A person will not find quite as much software support as they would from a larger company, such as Parallax, but the extra hardware capabilities of the Basic Micro products make up for some lack of support. Basic Micro does have excellent forums for their products. These forums cover both hardware and software examples. For those readers who have not been to the Basic Micro site recently, please

SERVO 01.2005

31

Barlow.qxd

12/8/2004

9:28 AM

Page 32

THE ATOM 24-PIN MICROPROCESSOR

FIGURE 1

FIGURE 2

allow me to list some of the many features of this chip and then I will go into further detail of how I implemented many of these features on my robot. • 14K contiguous program space no bank switching necessary • 368 bytes user RAM • 256 bytes user EEPROM • 33K instructions/second • Three hardware timers • Two hardware PWM • A/D three channels of hardware A/D • Interrupts, both hardware and software driven • 32-bit math integer and floating point • NTSC video display generation • I2C bus • LCD commands • Servo direct control software command • In circuit debugger line by line execution as debugger runs. • Oscilloscope • DTMFOUT output DTMF signals on PIN • DTMFOUT2 two-pin DTMF, higher quality signal • HCAPTURE capture internal timer value based on external event • HCOMPARE set pin when timer value equals compare value • IF .. THEN .. ELSEIF .. ELSE .. ENDIF conditional statements • LCDREAD reads RAM on LCD • LCDWRITE send text to an LCD • OWIN receive data from one-wire device • OWOUT send data to one-wire device • PAUSE delay (1 mSec resolution) • PAUSEUS delay (within 1 µs resolution) • PAUSECLK delay based on internal hardware timer

FIGURE

32

SERVO 01.2005

• PEEK ... POKE read /write specific RAM location • PULSIN measure pulse width (10 µs resolution) • SPMOTOR control any stepper motor • XIN X-10 input • XOUT X-10 output

The Atom 24pin, as stated, is pin compatible with the BS2. For the additional A/D channels, Basic Micro has special pads underneath the chip that a user may solder wires onto (see Figure 2). Once a user does this, the A/D channels will be active. To view the wires attached, see Figure 3. The 28-pin version of the Atom has these additional A/D lines already brought out to pins on the chip. The 40-pin version has additional I/O channels. Soldering wires to the tiny lands under the chip is not an easy task. There is a walk through provided by Basic Micro and I certainly advise reading this thoroughly before attempting the task. If you are designing from scratch, I advise you to purchase the 28-pin version of the Atom and save yourself some grief. I, myself, have done the conversion; using a low wattage soldering iron, panavise, and reading glasses, it can be done. The Atom software code is 99% compatible with the BS2; however, there are some small differences that should be noted. Please review the sidebar for a list of differences I have seen while programming the Atom.

Choosing the Microprocessor I specifically chose the Atom for its A/D capability, the large program space, Basic language, and its interrupt capability. While working with the Atom and designing my robot, I found many more features that have made life much easier. For my latest robot, I wanted all the bells and whistles I could design within my budget. I wanted to stay with the Basic program language. I had used many BS2 Stamp products in the past and was happy with the language; however, I was always running into the dreaded out-ofmemory problem. I was never happy with the idea of bank switching. To me, it just confuses an already difficult situation. In addition, RAM space was always tight in my programs and — even if I learned how to bank switch — I still would be running out of RAM space. I also had run into problems on my previous robots where a subroutine may be active and the robot is traveling forward and hits an obstacle before the main loop can process either a bumper switch or an I/R sensor. I was hoping that a hardware interrupt could solve this problem for me. I also had always wanted A/D capabilities. This can be done externally, but then the processor has to run through a software routine to read input. Hardware A/D 3 would be a much more worthwhile item to have.

Barlow.qxd

12/8/2004

9:29 AM

Page 33

THE ATOM 24-PIN MICROPROCESSOR

Memory Space One of the biggest reasons I chose the Atom was its contiguous memory space. The Atom has a 14K program space. Simply put, all you need to do is write your program — no more worries about bank switching or running out of memory space. I could not possibly have fit everything I am doing inside the 2K memory space of a different processor. Consider the robot program I will be discussing (available on the SERVO website or my own — see Resources). At this time, there are 200 bytes of RAM free and 4K of program space still free; 656 program lines show as being compiled. This is non-optimized code. On my own working version of the program, there are many lines of old subroutines still left in my program only because I have the space and it is easier to leave them in for testing purposes. I have never had any worries about RAM space, as I did with the BS2. I have variables declared that I am not even using. The program on the SERVO website is cleaned up and the unused code has been removed, but I simply wish to say that variable and program space is so large that I never even worried about it. The Atom does not have as much user EEPROM available as a BS2. There are 256 bytes of EEPROM for data storage. If you need more storage for something like a data logger, then you will have to use an external memory system. The simplest method for this is to use an I2C bus based EEPROM memory chip. For my robotics work, I have never needed to actually store memory, but I can imagine a person who would want to map a location to memory. In this case, I do recommend using external memory. The internal RAM of 368 bytes for variable and array space is quite large. Even with 35 variables and two arrays in my program, I still have 200 bytes of variable space free in the Atom! Variables can be bit, nibble, byte, word, and long. These are defined as Bit Nib Byte Word Long

0 0 0 0 0

hardware to use. The Atom has two PWMs available. The first is on pin 9, which is selected by setting a value of 1. The second is on pin 10 and is selected by using a value of 0 for CCPx. Period is a variable or constant from 0 to 16,383 that specifies the period of the pulse width in CLK cycles. Duty is a variable or constant from 0 to 16,383 that specifies the duty cycle of the pulse width. ENABLEPIN con 9 TrackLow: HPWM 1,9890,8000 : Return ‘81% Duty Return TrackMed: HPWM 1,9890,9000 : Return ‘90% Duty Return TrackHigh HPWM 1,9890,9890 : Return ‘99% Duty Return

IF .. THEN .. ELSEIF .. ELSE .. ENDIF The Atom uses standard syntax for its IF decision statements. There are two ways in which IF ... THEN can be used. The first tests a condition and, if that condition is true, goto or gosub to a point in the program specified by an address label.

or 1 to 15 to 255 to 65535 to 4,294,967,295

As you can see, the Atom gives a programmer great versatility in defining a variable, thereby freeing up that much more RAM space.

Hardware PWM The HPWM command outputs a user-specified Pulse signal on either of two channels. Both channels may run independently at different duty cycles, if you wish. Hardware PWM is much more useful than software generated PWM. The Atom will continue processing your program at the same time it is generating PWM signals. HPWM CCPx, Period, Duty CCPx is a variable or constant of 0 or 1 that specifies the PWM Circle #122 on the Reader Service Card.

33

Barlow.qxd

12/8/2004

9:30 AM

Page 34

THE ATOM 24-PIN MICROPROCESSOR FIGURE 4

FIGURE 5

If range <=130 then gosub OBJECT The second use of the If ... Then can conditionally execute a group of statements following the THEN. The statements must be followed by Elseif or Else with an Endif. If Ldist <=10 then Lflag = 8 Endif

Incircuit Debugger I have used the ICD and found it to be a valuable asset in debugging my programs. I can watch my variables changing on the fly or watch the flow of my program code line-by-line. It is documented that timing dependent code may not work properly with the ICD. In my case, I found that

THE ATOM The Atom is 99% compatible with the BS2; however, there are a few minor differences. Basic Micro has a list of differences between the Atom and a BS2 in their documentation, as well. Debug code is different than with a BS2; primarily, the Atom needs the command placed inside brackets. debug [DEC val02, 13] Reserved variable names include: smp, swap, sound, int, dt, skip. N9600 is used for serial output to a LCD display within the Atom: serout 1,n9600,[“START”] You do not need to declare n9600 as you did with a BS2. An Atom may not be used on a Board of Education unless you remove the capacitors on the serial programming lines of the BOE. Servo commands are much simpler to use with the Atom. I have found a quicker way to program the Atom. This is not documented by Basic Micro, but it works well for me. The Atom IDE will do a WRITE command to the chip and then do a few VERIFY commands to determine if the Atom was programmed properly. I have found that I can cancel the IDE program command at the end of the WRITE function and disregard the VERIFY functions. The Atom will work fine. I have been doing this for years without any problems. I also have found that you do not even have to do a full WRITE of 100%. If you have a short program, WRITE may be canceled at 25% or 50% and the Atom will work fine.

34

SERVO 01.2005

the SRF04 sonar would not output values properly to the ICD. To get around this, you can send the SRF04 output to a terminal window and display the data in this manner inside the ICD. The Atom ICD has several commands. Here are some of them: Animate The animate button will animate the displayed program line-by-line, as it is executed on the target device. Run The run button will start program execution on the target once the connection is established. Reset Reset is used to restart the program currently running on the target device. Pause The pause button will pause program execution. Step Into The step button allows you to step through the current running program, line-by-line. Step Over This allows the program to step over a routine, mainly a gosub and/or for .. next loop. Step Out Step out will allow you to step out of a gosub routine. This allows you to skip any gosub in your program and go to the next line after the routine. Run To Cursor Using the run to cursor function will allow the program to run until the cursor is reached. Show Variables If clicked, the variable button will open a small new window that displays all the current variables used in the current program and the current values in HEX, decimal, binary, and floating point. Show SFRs SFRs stands for Special Function Registers. These are the registers built into the PICmicro MCU on the Atom. Show Ram If clicked, the RAM button will open a small window that displays all the RAM values in the Atom.

Barlow.qxd

12/8/2004

9:31 AM

Page 35

THE ATOM 24-PIN MICROPROCESSOR Show Gosub Stack Displays the gosub stack. This indicates where a program is in a gosub routine.

FIGURE 6

Oscilloscope Inside the Atom IDE there is a built-in oscilloscope tool. The oscilloscope supports two basic kinds of data plots. Y/time is where the Y-axis is the data and the X-axis is time. Note that this is not real time. It is actually the time between when the data points are received. So, if you are only sending a data point once a second, that’s when the Y-axis will be updated. I have not personally used the oscilloscope yet. There is documentation on the Atom website (see Resources) describing its full use.

The Robot My robot has been in its design phase for many years now, mainly due to a busy work schedule. It would take too much space to go through all the iterations and design changes. I feel, however, that it would be beneficial for the reader to know of some of the worst problems I have had, in addition to why I changed my plans and some of the hardware on the robot. On this robot, I specifically did not want any mechanical bumper switches. Bumper switches are fine and 100% reliable, but an animal in nature does not really use them and I did not want them on the robot, either. I had used servo motor-driven drive wheels with a trailing caster previously and they work fine, but a trailing caster would occasionally cause problems, either catching on a carpet or catching while backing up. With this in mind, I chose a dual track design (Figure 4). It also was thought that edge-mounted I/R sensors would be good as a final last-ditch obstacle detection system. See Figure 5 for a close-up of the edge sensors. The Atom hardware interrupt was to play a major part in the edge detection circuitry. I will go into more detail on interrupts in Part 2 of this article. You will notice two circuit boards on the robot. The lower board has the Atom, H-bridge driver, and the 555 timer for I/R and A/D connections (Figure 6). The upper board contains a LCD, 4052 multiplexor, and inputs for the three CDS cells (Figure 7). I’ll also explain the 4052 multiplexor hardware and software in further detail in the next installment of this article.

The Construction Design must turn into hardware at some point, so I chose a toy tracked power shovel as the main drive unit. I was quite happy with the track drive unit for indoor use. Motor control was achieved by the use of an SN754410

FIGURE 7 H-bridge motor control chip. I wanted motor speed control and had plans for Pulse Width Modulation (PWM). The Atom will provide hardware-based PWM. This offloads much of the necessary overhead of software-driven PWM. At this time, I have not used the PWM feature except as a test program. I found that my robot runs at an adequate speed using full battery voltage and I did not need any reason for speed reduction at this time. The H-bridge driver to the SN754410 has been detailed many times in previous articles, as have the I/R transmitters using a 555-frequency generator. For an example of the

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 01.2005

35

Barlow.qxd

12/8/2004

9:32 AM

Page 36

THE ATOM 24-PIN MICROPROCESSOR

FIGURE 8 schematic of the I/R transmitter, review Figure 8.

Sensors Sonar Four SRF04 sonar sensors mounted on the front and sides of the robot provide main object detection. These sonar sensors are tied together using the 4052 multiplexor; look for more details on the 4052 next month. I/R Ranged Secondary object detection is performed by a GP2D02 IR range finder inside a small project box that is mounted on top of a standard hobby servo. I can rotate this head to find the largest openings around the robot. I/R Static Interrupt-driven edge sensors are a third and final detector. On the front of the robot, I have transistor pairs and two sensors at each corner. On the rear, I have two sensors

and transmitters aft facing. All transmitters are tied in parallel and so are the receivers. I am using the Parallax IR receiver modules. These output a digital LOW or 0 state if an object is detected. All receivers are tied to the Atom’s interrupt hardware pin (pin 0). No matter where the Atom may be in its main loop, if a detection occurs, the hardware pin will immediately stop the program and branch to a special subroutine. In this subroutine, a user may do anything desired. I chose to stop all motors, back up, and then search for a large area to drive into. Again, I shall go into more detail on interrupts in Part 2. CDS Light Sensor I also have CDS light sensors mounted on the robot. One sensor is mounted inside the rotating head and one is mounted on either side of the robot. At this time, I only implement the light sensor inside the rotating head. I use this light sensor to prevent the robot from driving under tables. I am currently using the Atom’s A/D circuit connected directly to a standard CDS cell.

Reliability RESOURCES Atom 24, accessories, and supplemental info www.basicmicro.com I/R receiver www.parallax.com/detail.asp?product_id=350-00014 SRF04, PIR sensor, and GP2D02 http://acroname.com SN754410 and CD4052 http://mouser.com/ Program, Atom 24, and Atom Manual 2.2 http://mntnweb.com/hobby/bolo/

SERVO Magazine — code listings www.servomagazine.com

36

SERVO 01.2005

This method has proven to be 95% reliable. I highly recommend mixing sensor types in this way. I have often seen sonar miss an obstacle that an IR sensor will detect and vise versa.

Final Notes I hope this review of the Atom has given you an appetite for a powerful microprocessor that is programmable in the Basic language. So many times in the past, I have found great sounding robots, only to realize they are based on a microprocessor that either requires C code or uses such a convoluted syntax for its Basic that they would nearly require relearning the language. Basic Micro has done a good job of giving us a high power processor wrapped in a high level language. In Part 2, I will go into details of the Atom specific code and how I have used that code in my robot design. SV

Showcase.qxd

12/9/2004

4:28 PM

Page 37

THOUSANDS OF ELECTRONIC

8lÛCYkl›ÛCgoÛ[gklÛ ]f[g\]jkÛ^gjÛ eglgjkÛ¬Ûk]jngk›

Smart Servos

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

VISIT OUR ONLINE STORE AT

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

N`]]dNYl[`]j

KD

ÝÛ NJ•Û?al][Û¬Û?gZZa[gÛk]jngkÛ Yf\ÛeYfqÛJgdYjZgla[kÛeglgjk ÝÛ Lk]kÛklYf\Yj\Ûo`]]dk ÝÛ ;]Y\Ûj][cgfaf_•Ûg\ge]ljq•ÛklYddÛ \]l][lagf•Û[dgk]\¤dgghÛ[gfljgd KD

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

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

ooofmZgla[k[ge

• Simple serial bus interface – 31 motors on a single link • Position & load readout, overcurrent protection • Full rotation mode • Modular connections – 11 attachment pieces Robot kits starting at $185 Garage Technologies, Inc. modular robotics, modular electronics www.Garage-Technologies.com

Robotics Showcase

SERVO 01.2005

37

Events.qxd

12/8/2004

9:54 AM

Page 38

Send updates, new listings, corrections, complaints, and suggestions to: [email protected] or FAX 972-404-0269 We're starting a new year and tradition says it's time to make some New Year's Resolutions. Here are a few to try out for size:

F e b ru a r y 2 0 0 5 4-6

• I resolve to see at least one robot competition this year. • I resolve to enter at least one robot competition this year. • I resolve to build a better robot this year. That last one is important. Competitions are fun, but sometimes we get too focused on competitions and rules to innovate. Even worse, some competitions seem to have rules designed to prevent innovation. If you have a great idea for a new robot, go ahead and build it — even if it doesn't fit into the rules for a contest. Some of the best robots that turn up at our local robot group meetings weren't designed for a contest; they were created to try out a new idea. There continues to be a lot of talk online about new types of competitions that would stimulate the construction of more innovative general-purpose robots rather than more and more specialized robots. I'm hoping some of these ideas come to fruition this year and bring some much need variety to the realm of robot competition. — R. Steven Rainwater

March 2005 6-10

24

Citrus Robotics Robot Combat Inverness, FL Radio-controlled vehicles destroy each other in Florida. www.citrusrobotics.com/

28-30 Techfest 2005 IIT, Mumbai, India A nationwide science and technology festival for Indian students. There are several robot contests, including Yantriki and Survivor. www.techfest.org/

38

SERVO 01.2005

APEC Micromouse Contest Hilton Hotel, Austin, TX This will be the 18th annual APEC Micromouse event. www.apec-conf.org/

11-12 AMD Jerry Sanders Creative Design Contest University of Illinois at Urbana-Champaign, IL The design problem for this contest is new and different each year. Check the website for the latest news and details. http://dc.cen.uiuc.edu/

19-20 Manitoba Robot Games Manitoba Museum of Man and Nature, Winnipeg, Manitoba, Canada A variety of events, including sumo, a robot tractor pull, and Atomic Hockey. www.scmb.mb.ca/

For last minute updates and changes, you can always find the most recent version of the complete Robot Competition FAQ at Robots.net: http://robots.net/rcfaq.html

Januar y 2005

Robotix IIT Khargpur, West Bengal, India Organized for students of IIT Khargpur, this contest includes events for both autonomous robots and radio-controlled machines. www.robotixiitkgp.com/

24-27 ROBOlympics San Francisco State University, San Francisco, CA Lots of events, including sumo, BEAM, Mindstorms, FIRA, and robot combat. www.robolympics.net

A p r il 2 0 0 5 9-10

Trinity College Fire Fighting Home Robot Contest Trinity College, Hartford, CT Could the fire have been set by a robot builder frustrated with the voluminous rules? www.trincoll.edu/events/robot

Sandberg.qxd

12/7/2004

4:38 PM

Page 39

by Daryl Sandberg & Larry Geib

A

message dated 8/3/04 on the PARTS Yahoo! listserver:

SandbergDJ writes ... “Is anyone building a robot for Robo-Magellan? I’ve considered using MRToo, but I don’t have the time or knowledge to do the navigation and sensor modifications to the robot. Is anyone interested in collaborating?” LJGeib responds ... “Time is short, so we’ll have to start stirring the pot soon if we want to try to do this.” And so the race to build a robot for the Seattle Robotics Society/ SERVO Magazine Robo-Magellan began. We had less than eight weeks

to do the job.

Early Decisions I had a robot chassis (MRToo) that I had been tinkering with for two years, but it would need a lot of work to make it to Robo-Magellan in less than eight weeks. Larry Geib had a GPS that he had been playing with for about a week, but didn’t have a reliable chassis to attach it to. With an exchange of several Emails, we decided that — with lots of work and a fair amount of luck — we might just be able to get a challenger assembled for the contest. I registered the robot right away to provide a little extra motivation and, with that, we began the project. We decided that parallel development was the only way that we could

succeed. I would make the chassis functional and create the control commands and Larry would develop the GPS software and CMUcam interface. Neither Larry nor I are great programmers, so we decided that a BASIC Stamp II was the best choice for overall control. We felt that keeping it simple and reliable provided our greatest chance for success.

The Chassis MRToo (pronounced M-R-2) is a four-wheel drive, four-wheel steering robot. The robot was built without an overall plan or purpose. It just evolved from parts that I had acquired over time. The drive motors are discarded rear wiper motors modified for continuous rotation. There is one motor for each wheel and all four SERVO 01.2005

39

Sandberg.qxd

12/7/2004

4:40 PM

Page 40

MRToo Goes to Seattle before I settled on the current version. A small Toyota window motor is geared down 3-to-1 with a #25 roller chain drive to turn a series of bell cranks and connecting rods to coordinate movement of the wheels. A 10K potentiometer gives position feedback to a PICAXE 08M to control the H-bridge to make the motor into a giant servo. This setup provides The orange cones were easy on the sensors. the extraordinary torque necessary to turn four motors are powered by a single wheels on a 40 pound robot. There is H-bridge. The wheels are made from a certainly enough torque to bend and couple of eight inch disks of ABS that break the steering components, so use a piece of one and a half inch ABS motion is limited both mechanically plastic plumbing pipe for a center hub and through software. and a strip of three inch wide ABS for The chassis is constructed from the outside edge. A rubber floor mat pieces of discarded Lexan given to me was cut into strips and glued to the by a friend. I just liked the idea of a wheel surface to provide a tire tread. A clear-bodied robot so that people could nylon bearing was turned to ride on see the internal components. the housing of the motor and an I decided early on that the robot aluminum disk was fashioned to needed some kind of suspension. The transmit power from the motor shaft front wheels pivot in relation to the to the wheel. body of the robot and provide about The robot uses four-wheel steering five inches of wheel travel, which for a really tight turning radius of allows the robot excellent mobility. about three feet. It actually took more time to get the steering working properly than it did to build all the rest of MRToo. I tried eight different motor, gear, and linkage combinations The BASIC Stamp II has its limitations, so our goal was to get as much mundane GPS in action! processing as possible off the Stamp and onto individual PICAXE 08M microcontrollers. We used three 08Ms in the robot.

Computers and Sensors

Inside MRToo.

40

SERVO 01.2005

One is used for the drive motors, one for the steering mechanism, and one as a wheel encoder. The drive motors, steering, camera pan, and calibration servos are controlled through a Scott Edwards serial controller. This allowed one pin and simple code to maintain the mobility functions of the robot. The encoder also used just one I/O off the Stamp. A serial signal is sent from the Stamp to the 08M, indicating the desired distance (in feet) for the robot to travel. The wheel encoder 08M counts down to zero and then sends a signal back though the same pin to tell the Stamp, “We have arrived.” Another pin (with a 22K resistor in series) is used for a 4800 baud serial connection with the Garmin Geko 201 GPS unit. The Devantech CMPS-01 compass module feeds a PWM signal to the BASIC Stamp on another single I/O. A 4 x 20 LCD is used for debugging the BASIC Stamp program and is serial driven through a Peter Anderson (www.phanderson.com) preprogrammed PIC 16F628. A front bump sensor and a giant, red pause switch provided by Tim Weaver finish out all of the connections to the BS2.

Navigation To determine the longitude and latitude of each of the target cones, Larry walked the course before the start of the contest and entered the locations of the cones into the Garmin GPS unit as “waypoints.” These waypoints would ultimately determine the path of the robot. The navigation process begins when the Garmin gets a valid signal. This triggers the BASIC Stamp to start processing the incoming data. The GPS gives the BASIC Stamp a bearing and then the Stamp looks for readings from the compass to decide if the robot is heading in the right direction. The GPS unit does all the calculations of the bearing to waypoints and automatically cycles through

Sandberg.qxd

12/7/2004

4:41 PM

Page 41

MRToo Goes to Seattle the individual waypoints on a route. The Stamp sends a signal (left or right) to the Scott Edwards Serial Controller that, in turn, sends a signal to the PICAXE 08M to turn the wheels in the desired direction. When the GPS decides that the robot can reach the waypoint within 15 seconds, a signal is sent to the Stamp. The Stamp starts the CMUcam on a search routine to locate the cone, based on the reflected color of the cone. If the CMUcam doesn’t find a cone on each pan, it returns direction control to the GPS.

CMUcam The CMUcam code was all “liberated” from code and examples written by Ron Nucci in his original example hack that came with the camera (www.seattlerobotics.com), from Michael Miller’s previous SERVO articles, and from John Iovine’s book, PIC Robotics. The camera calibrates itself when the robot is first turned on. It uses a gray card to measure ambient light, then a bright orange card attached to a servo arm that pops up in the camera’s field of view. The camera then pans through 180 degrees in five steps, covering the entire field of view. If it finds enough bright orange color at any step, the Stamp uses the direction that the camera servo is pointed in to steer the robot toward the cone. Like all the other code used on this robot, it’s quick and dirty. Larry wrote the final version of the code in one evening and debugged it the afternoon before the contest. Nevertheless — with the addition of an IR filter and a neutral gray filter for the outdoor environment — the camera can detect an 18 inch cone at 18 feet or more. Traffic cones are easy to pick out from the background in a park setting. With more testing and tweaking, we know it will do even better.

day, we just didn’t know what to expect. We found that the start of the contest was a lot more difficult than what we had planned for. The first portion included an outdoor stage with only two ramps for access, a serious three-foot drop off, and a narrow pathway. After the first attempts, it didn’t look like many of the robots were sophisticated enough to get through all of the beginning obstaMRToo makes a run for the 50-yard line! cles. The officials offered an easier start for the later runs out of bounds on the first two runs with one caveat — no prize money. We without making much progress. On were more interested in some level of our final run, we just cranked the success, so this was our choice because compass module 70 degrees from we didn’t have the sensors to deal with where it should have been and the the ramps and the stage drop-off. robot did much better. MRToo started Many of the other contestants picked heading toward the first cone. this simpler option also, but a couple of the braver souls attempted the Unfortunately, a coding error original start. caused the Stamp to not see the GPS We decided to go for the easiest signal that indicated that the robot cone and then head for the finish cone. was closing in on a cone, even though If we were successful, we would make MRToo was within one meter. This another attempt for the medium diffiwas not a big problem because the culty cones on a later run. program stated that if the cone We had been having problems all wasn’t found when expected, the week with the compass (after the robot would just move on to the contest, we found two wires on a next target. compass sensor that were shorted MRToo was about 10 meters away out). The compass worked well going from the final cone (which was hidden east, north, and south. behind a concrete sculpture and a parUnfortunately, the robot needed tial wall) when it got hung up between to go west. The compass was 70 a tree and a garbage can. We were degrees off in that direction, which offered a chance to extricate the robot caused the robot to make a giant, curved path. It spiraled Detail of the wheel mounts. vaguely in the direction of the first cone, but the robot went Navigating tricky terrain.

How We Did When we arrived on contest SERVO 01.2005

41

Sandberg.qxd

12/7/2004

4:42 PM

Page 42

MRToo Goes to Seattle band on the steering program and use tighter tie rod ends for the linkage. These three things were the reasons for the drunken duck behavior that the robot exhibited during the contest. Testing the steering.

Sharp turns are no problem!

Note the strong design.

just to see if it could find the final cone, but we had already turned the robot off. That killed the Stamp’s memory, ending our chances at hitting the destination cone.

contest version looked at the wrong variable to turn on the camera. We couldn’t test it after dark the night before the contest, so we didn’t catch the error.

Lessons Learned

• GPS is a very robust navigation method. Even with the bad compass (shorted wires on a sensor), the GPS offered enough correction to get the robot around the course. With a GPS that has routes, you don’t need to do double precision math.

Entering the contest this year was an excellent learning experience. It gave us a good idea what works and what doesn’t.

• We will add proximity sensors. Sonar, IR, and vision are some choices. We’ll spend enough time on sensor fusion to improve behavior and speed up the response to objects and hazards. • We will do tests to gain more speed before next year. There are some really fast robots out there! • We’ll add more of our own waypoints and include a scheme for determining which waypoints have cones attributed to them.

This is what we learned: • Start earlier. By the time Larry got the robot and put the sensors on it, there were only nine days left to the contest. It’s remarkable that the robot worked at all. The fact that the camera didn’t turn on at the first cone is directly attributable to not having time to debug the entire program. The MRToo poses with its prize.

Next Year • For next year, we will build on what we have. More time and cleaner coding will smooth out the glitches in the behavior. The camera code is a good example. It works over a wide field of view, but there are certainly more elegant ways to do the task. • We will decouple the steering from the GPS input. Currently, the steering corrects only refresh once a second because the Stamp spends most of its time waiting in a looped SERIN statement.

• TEST, TEST, TEST! What you think you are writing isn’t always what the robot ends up doing. • We will provide alternate behaviors for different parts of the course. • We’ll wear lots of orange and walk in front of the other guys’ robots.

Conclusion

When Larry and I began this project, I was genuinely concerned that differences in style or disagreements about how the robot should be put together would lead to bickering and possibly damage our friendship. Quite the opposite happened. Working as • We will tighten the deada team was one of the best parts of this project. Being able to bounce ideas Testing the four-wheel drive. off each other and encourage each other when the going got tough made getting a robot completed on time possible. I now have a much greater level of respect for Larry’s abilities and his creativity and we’ve already begun working to improve MRToo for next year’s event. SV

42

SERVO 01.2005

Braunl.qxd

12/8/2004

8:15 AM

Page 43

by THOMAS BRAUNL, ANDREAS KOESTLER, and AXEL WAGGERSHAUSER The entry fee to robotics is not exactly cheap when you consider the cost of all the mechanics and electronics required. This suggests the use of a simulation system; however, very often simulation and reality are miles apart. The goal for our simulation system — EyeSim — was, therefore, to create a simulation package that is available as a public domain and that models real robots as realistically as possible. Not only should the outer appearance of the simulated robot match the real one, but the complete application programmer interface (API) should also be identical for both the simulation and the real robot. This allows us to switch between the simulation and real robots without having to change a single line of source code! This simulation system should implement all robot actuators and sensors of the EyeBot robot family, including a virtual camera with adjustable error models. Simulation is not only an ideal entry to the robotics arena, it is also an important instrument for research in many computation-intense AI techniques, like genetic algorithms or genetic programming — which can be executed in the

simulation much more easily than on a real robot. We can have hundreds of robots interact in a simulation and let robot programs evolve through thousands of generations much faster and with less trouble than on real robots. However, the prerequisite for all this is that the so-called “reality gap” — the difference between simulated and real robots — is minimal.

User Interface The EyeSim user interface comprises two main parts: the virtual 3-D world in which the robots operate and the user interface through which the simulation can be controlled (e.g., by changing a robot’s position or the timing of the simulation). A simple 3-D engine based on OpenGL has been developed for visualization. This provides for fast graphics rendering, even on older style PCs and graphics cards. Newer style graphics accelerators are supported and allow even faster rendering, but are not a requirement. Environment Definition All models of robots and objects (walls, boxes, cans, etc.) have been designed with Milkshape3-D (www.swiss quake.ch/chumbalum-soft), a simple but efficient shareware module that is mainly used for generating polygon models for simulations and computer

FIGURE 1. Omni-directional robot in reality. SERVO 01.2005

43

Braunl.qxd

12/8/2004

8:17 AM

Mobile Robots Between

Page 44

SIMULATION & REALITY

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

44

SERVO 01.2005

Braunl.qxd

12/8/2004

8:18 AM

Page 45

Mobile Robots Between

SIMULATION & REALITY

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

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

45

Braunl.qxd

12/8/2004

8:19 AM

Mobile Robots Between

Page 46

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

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

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

46

SERVO 01.2005

Braunl.qxd

12/8/2004

8:22 AM

Page 47

Mobile Robots Between

SIMULATION & REALITY

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

NEW!

Motor Control Choices from Pololu

1. Choose your protocol.

2. Choose your motor. With an operating range of 6 volts to 18 volts and up to 3 A of current, you’ll have many motor options.

RC servo protocol lets you connect to an RC receiver or serial servo controller. Analog protocol is simple for quick tests and demonstrations.

3. Choose your feedback mode.

Serial protocol is great for microcontroller- or computer-based control. shown actual size

Visit www.pololu.com or call 1-877-7-POLOLU for more innovative motion control solutions. Circle #145 on the Reader Service Card.

Position feedback mode allows you to use a potentiometer or other analog voltage source to accurately move to exact positions. Speed feedback mode allows for tachometerbased control of your motor’s speed.

SERVO 01.2005

47

Braunl.qxd

12/8/2004

8:23 AM

Mobile Robots Between

Page 48

SIMULATION & REALITY

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

48

SERVO 01.2005

Braunl.qxd

12/8/2004

8:25 AM

Page 49

Mobile Robots Between

SIMULATION & REALITY

Figure 11. Recursive maze exploration. visited all reachable fields (the goal would not be reachable in this case). Object Detection and Tracking Simulation gets much more interesting with the capability to perform image processing on the simulated robot. Like all real robots in the EyeBot family, the simulated robots may have a virtual camera onboard, which can be accessed through RoBIOS calls in order to read an image

N

e

(CAMGetColFrame). Images can be displayed on the robot console (LCDPutColorGraphic) and manipulated by using image processing routines on the robot. A simple problem is the detection of an object by using its color. For this task, we have placed a red ball in the robot’s environment and put the robot at a random position and orientation. We use a top-down program design strategy. We assume we have an image processing routine for ball detection ColSearch, then write our main program around it.

w

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

BROUGHT TO YOU BY WWW.SOZBOTS.COM Circle #151 on the Reader Service Card.

SERVO 01.2005

49

Braunl.qxd

12/8/2004

8:26 AM

Mobile Robots Between

Page 50

SIMULATION & REALITY

Figure 12. Object detection with onboard camera. In a loop, we read a camera image and display it on the LCD, then call our detection routine ColSearch, and print its results as text on the LCD (using LCDPrintf). While we are not close enough to the object (val<20, which means ball diameter is less than 20 pixels), we continue driving. If the detected ball position is equal to -1 (no ball detected) or between 0 and 20 (ball detected in the left image third), we rotate the robot to the left (VWDriveTurn). If the detected ball position is between 60 and 79 (ball detected in the right image third), we rotate the robot to the left; otherwise, we drive a short distance forward (VWDriveStraight). What is still missing is the actual implementation of the ball detection routine ColSearch. Since color objects are easier to detect in the HSV color model (hue, saturation, value) than the camera output format RGB (red, green, blue), our first step is to convert RBG to HSV. However, this step is not always necessary. For example, for the detection of a red object, one could more easily work on RGB values directly. In the next step, we generate a column histogram in a loop over all pixels. This means we count for every column the number of pixels with a color (hue) that is similar to the desired object color (obj_hue). With this, we get a number representing the concentration of the desired color value for each column. We only have to find the maximum value over all columns in order to find the ball’s position. As a result,

About the Authors Thomas Braunl is Associate Professor at the University of Western Australia in Perth, where he directs the Centre for Intelligent Information Processing Systems (CIIPS) and the Mobile Robot Lab. He has published a number of books and created the EyeBot mobile robot family. Axel Waggershauser is a graduate student who is just finishing his Master’s Degree at the University Kaiserslautern, Germany. He implemented EyeSim version 5 under Linux. Andreas Koestler is a graduate student at FH Giessen, Germany and has continued Axel’s work with implementing EyeSim version 6 under Windows. Contact details are available from http://robotics. ee.uwa.edu.au

50

SERVO 01.2005

from function ColSearch, we return the column number (pos) with the highest concentration (val) of matching color values. Figure 12 shows the execution of the object detection program. At the beginning of the experiment, the robot is facing the wall and is not able to see the ball. Following the algorithm, the robot turns on the spot until the ball is being detected in the middle third of its local camera image. The robot then drives toward the ball and corrects its orientation in case the ball drifts towards the left or right image border. Note that this algorithm requires the ball to be visible from every board position; otherwise, the robot would spin forever. An alternate solution would be to drive to various points in the environment and start searching for the ball locally.

Downloads and Further Reading The complete simulation system (version 6.1) for Windows is freely available and can be downloaded from: http://robotics.ee.uwa.edu.au/eyebot/ftp/rob61win. exe (43 MB). This package contains the full EyeSim simulation system, robot models, environments, example programs, and documentation. Also included are the C/C++ compiler MinGW and the RoBIOS environment for the real EyeBot robots. See these general websites for more details and downloads of newer versions, as well as the EyeSim Linux version (version 5.01): http://robotics.ee.uwa.edu.au http://robotics.ee.uwa.edu.au/eyebot/ftp/ Details on the EyeCon controller and SoccerBot robots are available from: http://joker-robotics.com For further reading on robot design and applications — both simulated and real — we recommend the book: Embedded Robotics — Mobile Robot Design and Applications with Embedded Systems by Thomas Braunl, Springer-Verlag 2003, 434 pages, hardcover, ISBN 3-54003436-6. SV

Williams.qxd

12/8/2004

9:44 AM

Page 51

Many robotics experimenters build small robots or devices that are intended to stay within the limits of a room in a house

by Karl Williams

or school. An inexpensive way to remotely control these machines is to use a television infrared remote control transmitter.

SERVO 01.2005

51

Williams.qxd

12/8/2004

9:45 AM

Page 52

INFRARED REMOTE CONTROL SIGNAL ANALYSIS those signals is useful for controlling small robots or devices. Infrared remote controls use anywhere from 12 to 60 bits when transmitting codes. As you will see later in the article, only 8-10 of these bits are usually needed when controlling a robot. If you plan on using only the television controls on the remote, then as little as four bits of the information is necessary.

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

Infrared Signals and How They Work

Analyzing an Infrared Remote Control Signal To capture the infrared packet being transmitted by the remote

52

SERVO 01.2005

Williams.qxd

12/8/2004

9:46 AM

Page 53

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

53

Williams.qxd

12/8/2004

9:48 AM

Page 54

INFRARED REMOTE CONTROL SIGNAL ANALYSIS Figure 5. It is made up of 34 pulses — if you include the last one — START: that represent bits. PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(0) As you can see, the IF IR_PULSE(0) = 0 THEN START large amount of time FOR I = 1 TO 33 (relatively speaking) PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(I) of 9.2 ms goes by NEXT I with the output being low (0 volts) before the first pulse. This CODE 2 indicates the start of the transmission. HIGH LED The first pulse in FOR I = 0 TO 33 the packet is much IF IR_PULSE(I) > 150 THEN wider (4.2 ms) than SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, those that follow and #(IR_PULSE(I) * 53) / 10, “ US = 1”] will be used by the ELSE microcontroller softSEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, ware to trigger the #(IR_PULSE(I) * 53) / 10, “ US = 0”] measuring and storing ENDIF of the width values of SEROUT COM,COM_BAUD,[13,10] each pulse in the packNEXT I et. All of the pulses LOW LED that follow are 5 volts and either have a width of approximately Figure 6. Pulse timing values and their binary 0.4 ms or 1.6 ms, except representations. for the last pulse. The space between each pulse is 0 volts and is consistently 0.7 ms. The 0 volt, 0.7 ms space is a marker to differentiate between each bit. The 5 volt pulses that are 0.4 ms wide represent logic zero (0) and the pulses that are 1.6 ms wide represent logic one (1). With the help of the oscilloscope, we now know exactly what

CODE 1

microcontroller software will need to be written in order to capture and analyze the IR packet. The software examples are given in the PicBasic Pro language developed by microEngineering Labs (www.melabs.com) for Microchip Technology’s powerful Picmicro microcontrollers. The PicBasic Pro compiler is “BASIC Stamp II-like” and has most of the libraries and functions of both the BASIC Stamp I and II. Being a true compiler, programs execute much faster than their interpreted Stamp equivalents. You will also need a hardware programmer — such as the EPIC Plus programmer, also available at www.melabs.com — to program the PIC with the .HEX files that are generated by the compiler. I also use a free integrated development environment called MicroCode Studio (www.mecanique.co.uk) because it makes editing, compiling, and programming PIC microcontrollers easier. One of the nice features of MicroCode Studio is the serial communications window that will be used to display the signal analysis data.

Capturing and Storing the Signal

The PicBasic Pro code segments will be listed for each of the functions as they are discussed and then the entire program will be listed at the end of the article. The first thing that the microcontroller IR analysis program needs to do is to determine the start of an IR packet transmission. This is done by monitoring for the first high pulse on the output of CODE 3 the PNA 4602M, as shown in Figure 5. The HIGH LED PULSIN command is lookFOR I = 0 TO 33 ing to measure the width IF IR_PULSE(I) > 150 THEN of a pulse and — since the SEROUT COM,COM_BAUD,[“1”] output is constantly high ELSE — PULSIN returns a value SEROUT COM,COM_BAUD,[“0”] of 0 when there is no ENDIF activity. As soon as the NEXT I start of the transmission SEROUT COM,COM_BAUD,[13,10] has been detected, the LOW LED program will measure the

54

SERVO 01.2005

Williams.qxd

12/8/2004

9:49 AM

Page 55

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

55

Williams.qxd

12/8/2004

9:50 AM

Page 56

INFRARED REMOTE CONTROL SIGNAL ANALYSIS on using only the television controls on the remote, then bits 25 through 28 can be used to create unique values — that’s only four bits! To summarize, all you need to do to control a device with an IR remote is to capture the packet information in an

array, convert the useable bits to a decimal value, and then use that value to determine what events you want to occur by using an IF..THEN..ELSE..ENDIF or SELECT CASE decision statement. The entire program to analyze the packets from a Sanyo

remote is called ir-decode.bas and is listed in Code 5. It can be used as a starting point when writing routines for other remotes. The PicBasic program and the HEX file to program the PIC 16F819 can be downloaded at www.thinkbotics.com SV

CODE 5 ‘————————————————————————‘ NAME : IR-DECODE.BAS ‘ COMPILER : PICBASIC PRO - MICROENGINEERING LABS ‘ NOTES : IR REMOTE CONTROL DECODING PROGRAM ‘ AUTHOR : KARL P. WILLIAMS ‘————————————————————————@ DEVICE PIC16F819, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_ON, PROTECT_OFF, BOD_OFF INCLUDE “MODEDEFS.BAS” TRISA = %00011111 TRISB = %00000001 DEFINE OSC 8 OSCCON = $70

GOTO START ‘———————- DISPLAY PULSE STREAM ———————— DISPLAY_PULSE: HIGH LED FOR I = 0 TO 33 IF IR_PULSE(I) > 150 THEN SEROUT COM,COM_BAUD,[“1”] ELSE SEROUT COM,COM_BAUD,[“0”] ENDIF NEXT I SEROUT COM,COM_BAUD,[13,10] LOW LED RETURN ‘———— CONVERT USEABLE BITS DECIMAL VALUE ————-

IR_DETECT COM LED COM_BAUD IR_PULSE ACTIVE_LOW ACTIVE_HIGH RESULT I POWER

VAR PORTB.0 VAR PORTB.1 VAR PORTB.2 CON N2400 VAR WORD(33) CON 0 CON 1 VAR WORD VAR BYTE VAR WORD

LOW LED ‘———- WAIT FOR START OF PACKET TRANSMISSION ———-

CONVERT_BITS: HIGH LED RESULT = 0 POWER = 1 FOR I = 0 TO 8 IF IR_PULSE(15 + I) > 150 THEN RESULT = RESULT + POWER ENDIF POWER = POWER * 2 NEXT I SEROUT COM,COM_BAUD,[“BITS 15 TO 23 = “,#RESULT,” DECIMAL”,13,10,13,10] LOW LED RETURN

START: ‘—————— DISPLAY PULSE TIMING VALUES ——————PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(0) IF IR_PULSE(0) = 0 THEN START ‘——————— INPUT PULSE STREAM —————————FOR I = 1 TO 33 PULSIN IR_DETECT,ACTIVE_HIGH,IR_PULSE(I) NEXT I ‘———————- CALL SUBROUTINES —————————— GOSUB PULSE_TIMING GOSUB DISPLAY_PULSE GOSUB CONVERT_BITS

56

SERVO 01.2005

PULSE_TIMING: HIGH LED FOR I = 0 TO 33 IF IR_PULSE(I) > 150 THEN SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, #(IR_PULSE(I) * 53) / 10, “ US = 1”] ELSE SEROUT COM,COM_BAUD,[“PULSE “, #I, “ - “, #(IR_PULSE(I) * 53) / 10, “ US = 0”] ENDIF SEROUT COM,COM_BAUD,[13,10] NEXT I LOW LED RETURN

Full Page.qxd

12/9/2004

3:56 PM

Page 57

BookstoreJan05.qxd

12/9/2004

andy Mind Cday’s For To ticist Robo

12:50 PM

The SERVO Bookstore

ROBOT DNA SERIES Three Volume Pack

Everything you need to program your robot controller: • Microcontrollers in Robots • Software Development • The Microchip PICmicro Microcontroller • Microcontroller Connections • Designing the Robot System • Going Forward Everything you need to build your own robot drive train: • The Basics of Robot Locomotion • Motor Types: An Overview • Using DC Motors • Using RC Servo Motors • Using Stepper Motors • Motor Mounting • Motor Control • Electronics Interfacing • Wheels and Treads • Locomotion for Multipods All the data you need to build your own robot base: • Mechanical Construction • Electrical Construction • Operating Power • Robot Designs • Constructing a Two-Wheeled Rover Robot • Selecting the Right Materials • Glossary of Terms • Tables, Formulas, and Constants

Subscribers: $62.99 Non-subscribers: $69.99 Limited time only! Offer expires January 31, 2005!

Robot Programming by Joe Jones / Daniel Roth Using an intuitive method, Robot Programming deconstructs robot control into simple and distinct behaviors that are easy to program and debug for inexpensive microcontrollers with little memory. Once you’ve mastered programming your online bot, you can easily adapt your programs for use in physical robots. $29.95

58

SERVO 01.2005

Page 58

Industrial Robotics by Harry Colestock With so many industries taking advantage of the tremendous advances in robotics, entities ranging from small family businesses to large corporations need assistance in the selection, design, set-up, maintenance, and economic considerations of industrial automation. Industrial Robots shows how to achieve maximum productivity with robotics, classifies robots according to their complexity and function, and explains how to avoid common automation mistakes. $39.95

Electronic Gadgets for the Evil Genius

Build Your Own All-Terrain Robot by Brad Graham / Kathy McGowan Remotely operated robots are becoming increasingly popular because they allow the operators to explore areas that may not normally be easily accessible. The use of video-controlled technology has sparked a growing public interest not only in hobbyists, but also in the areas of research, space, archeology, deep sea exploration, and even the military. Inside Build Your Own All-Terrain Robot, the writers enable even total newcomers to robots to construct a rugged, video-controlled, talking, seeing, interacting explorer bot with a range of over a mile for under $200.00! $29.95

by Robert Iannini The do-it-yourself hobbyist market — particularly in the area of electronics — is hotter than ever. This book gives the “evil genius” loads of projects to delve into, from an ultrasonic microphone to a body heat detector, all the way to a Star Wars Light Saber. This book makes creating these devices fun, inexpensive, and easy. $24.95

Robot Building for Dummies by Roger Arrick / Nancy Stevenson Ready to enter the robot world? This book is your passport! It walks you through building your very own little metal assistant from a kit, dressing it up, giving it a brain, programming it to do ! things, even making it NEW talk. Along the way, you’ll gather some tidbits about robot history, enthusiasts’ groups, and more. $21.99

Robot Builder's Bonanza by Gordon McComb Robot Builder’s Bonanza is a major revision of the bestselling bible of amateur robot building — packed with the latest in servo motor technology, microcontrolled robots, remote control, LEGO Mindstorms Kits, and other commercial kits. It gives electronics hobbyists fully illustrated plans for 11 complete robots, as well as all-new coverage of Robotix-based robots, LEGO Technicbased robots, Functionoids with LEGO Mindstorms, and location and motorized systems with servo motors. $24.95

We accept VISA, MC, AMEX, and DISCOVER Prices do not include shipping and may be subject to change.

Mobile Robotic Car Design by Pushkin Kachroo / Patricia Mellodge This thoughtful guide gives you complete, illustrated plans and instructions for building a 1:10 scale car robot that would cost thousands of dollars if bought off-the-shelf. But, beyond hours of entertainment and satisfaction spent creating and operating an impressive and fun project, Mobile Robotic Car Design provides serious insight into the science and art of robotics. Written by robotics experts, this book gives you a solid background in electrical and mechanical theory, and the design savvy to conceptualize, enlarge, and build robotics projects of your own. $29.95

BookstoreJan05.qxd

12/9/2004

12:52 PM

Page 59

To order call 1-800-783-4624 or go to our website at www.servomagazine.com PIC Microcontroller Project Book by John Iovine The PIC microcontroller is enormously popular both in the US and abroad. The first edition of this book was a tremendous success because of that. However, in the four years that have passed since the book was first published, the electronics hobbyist market has become more sophisticated. Many users of the PIC are now comfortable paying the $250.00 price for the Professional version of the PIC Basic (the regular version sells for $100.00). This new edition is fully updated and revised to include detailed directions on using both versions of the microcontroller, with no-nonsense recommendations on which one serves better in different situations.$29.95

Robot Builder's Sourcebook 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 the 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

Robotics Demystified by Edwin Wise There's no easier, faster, or more practical way to learn the really tough subjects. McGraw-Hill's Demystified titles are the most efficient, intriguingly written brush-ups you can find. Organized as selfteaching guides, they come complete with key points, background information, questions for each chapter, and even final exams. You'll be able to learn more in less time, evaluate your strengths and weaknesses, and reinforce your knowledge and confidence. $19.95

Build Your Own Humanoid Robots by Karl Williams Build Your Own Humanoid Robots provides step-by-step directions for six exciting projects — each costing less than $300.00. Together, they form the essential ingredients for making your own humanoid robot. $24.95

Robot Mechanisms and Mechanical Devices Illustrated by Paul Sandin Both hobbyists and professionals will treasure this unique and distinctive sourcebook — the most thorough — and thoroughly explained — compendium of robot mechanisms and devices ever assembled. Written and illustrated specifically for people fascinated with mobile robots, Robot Mechanisms and Mechanical Devices Illustrated offers a one-stop source of everything needed for the mechanical design of state-of-the-art mobile ‘bots. $39.95

Machine Nature: The Coming Age of Bio-Inspired Computing by Moshe Sipper Despite being marvels of complexity and human ingenuity, computers are notoriously bad at learning new things and dealing with new situations. Researchers at the frontiers of computer science have turned to nature for solutions to the problem of machine adaptation and learning. By applying models of complex biological systems to the realm of computing machines, they have given rise to a new breed of adaptive software and hardware. In Machine Nature, computer scientist Moshe Sipper takes readers on a thrilling journey to the terra nova of computing to provide a compelling look at cutting-edge computers, robots, and machines now and in the decades ahead. $24.95

Check out our online bookstore at www.servomagazine.com for a complete listing of all the books that are available.

CNC Robotics by Geoff Williams Now, for the first time, you can get complete directions for building a CNC workshop bot for a total cost of around $1,500.00. 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 can be customized to suit your purposes exactly, because you designed it. $34.95

Designing Autonomous Mobile Robots by John Holland Designing Autonomous Mobile Robots introduces the reader to the fundamental concepts of this complex field. The author addresses all the pertinent topics of the electronic hardware and software of mobile robot design, with particular emphasis on the more difficult problems of control, navigation, and sensor interfacing. Its state-of-the-art treatment of core concepts in mobile robotics helps and challenges readers to explore new avenues in this exciting field. The accompanying CD-ROM provides software routines for the examples cited, as well as an electronic version of the text. $49.95

Robotics, Mechatronics, and Artificial Intelligence by Newton C. Braga Accessible to all readers — including secondary school students and amateur technology enthusiasts — Robotics, Mechatronics, and Artificial Intelligence simplifies the process of finding basic circuits to perform simple tasks — such as how to control a DC or step motor — and provides instruction on creating moving robotic parts, such as an "eye" or an "ear." Though many companies offer kits for project construction, most experimenters want to design and build their own robots and other creatures specific to their needs and goals. With this new book, hobbyists and experimenters around the world will be able to decide what skills they want to feature in a project and then choose the right "building blocks" to create the ideal results. $31.95

SERVO 01.2005

59

BrainMatrix.qxd

12/7/2004

4:43 PM

Page 60

lathes ) in l( ve ra gh e T rou ) dl in in Th ( Sp dle ore il r Ta Spin B ape eT dl in e Sp id n Sl ai d in) M un l ( po ave om Tr ed C Fe ) ss in ro l ( C ve en ge Tra we ) t n ria be s (i ar C ce er an nt (in) ist e D C ed B er ov

g in Sw

) (in

M RP d, ee Sp

ze Si

el od M

SUPPLIER Cummins Industrial Tools www.cumminstools.com

Mini Lathe

7 x 12

Variable, 100-2500

7

11.8

2.6

2.2

MT-3

0.78

2.5

Grizzly www.grizzly.com

7 x 12 Mini Metal Lathe

7 x 12

Variable, 0-2500

7

11.82

2.75

1.38

MT-3

0.75

2.5

7 x 10 Precision Mini Lathe

7 x 10

Variable, 186-3000

7

7.88

2.75

2.87

MT-3 0.625

Speedway Series 7 x 12 Mini Bench Metal Lathe

7 x 12

Variable, 0-2500

7

12

2.56

1.38

MT-3

0.75

2.56

Jet 9 x 20 Lathe

9 x 20

6 speed, 130-2000

8.75

20

5

1.88

MT-3

0.75

1.56

LatheMaster www.lathemaster.com

LatheMaster 8 x 14 Mini Lathe

8 x 14

6 speed, 125-2000

8

14

4.5

2.3

MT-3

0.75

2.75

Micromark www.micromark.com

MICROLUX 7 x 14 High-Precision, Heavy-Duty Lathe

7 x 14

Variable, 100-3000

7

14

2.56

2.17

MT-3 0.787

2.13

Prazi various third party vendors

Prazi MD200 Miniturn Lathe

4x8

3 speed, 690, 1200, 3.94 2240

7.87

2.16 1.97” Option MT-1

Prazi various third party vendors

Prazi SD300 Materturn Lathe

5 x 12

4 speed, 300, 600, 1200, 2400

5.12

11.81

3.5

Sherline www.sherline.com

Model 4000 Lathe

3.5 x 8

Variable, 70-2800

3.5

8

Sherline www.sherline.com

Model 4400 Lathe

3.5 x 17

Variable, 70-2800

3.5

Micro Lathe II

4x9

6 speed, 525-5200

4.5

Harbor Freight www.harborfreight.com Homier www.homier.com

Jet Equipment & Tools www.jettools.com

Taig Tools International www.taigtools.com

60

SERVO 01.2005

2

0.35

1.6

MT-2 0.438

1.5

3

1.5” Option MT-1 0.405

1.25

17

4.25

1.5” Option MT-1 0.405

1.25

9.75

1.75

2.17

Option

15 deg 0.343

0.63

BrainMatrix.qxd

12/7/2004

4:44 PM

Page 61

by Pete Miles

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

er w Po

e ic Pr st Li

ly pp Su

ze Si

nd co se

n tio yp cr En a s at el D nn ha C of or ct ne on C

r pe ts bi

r be um N

, te Ra

na en nt A

MT-2

No

12 to 52 tpi

3" Three Jaw Chuck,Tool Post, Live and Dead Centers, Drill Chuck, Face Plate, Steady and Following Rests, Gear Set, 5 Piece Cutting Tool Set, Spare Fuse,Wrenches

MT-2

No

12 to 52 tpi

3" Three Jaw Chuck,Tool Post, Dead Center, Face Plate, Steady and Following Rests, Gear Set

110

250

13 x 30.25 x 13

78

$399.00

MT-2

No

12 to 52 tpi

3" Three Jaw Chuck,Tool Post, Live Center, Face Plate, Gear Set

110

250

13 x 26.4 x 13

89

$399.00

MT-2

No

12 to 52 tpi

3" Three Jaw Chuck,Tool Post, Dead Center, Face Plate, Gear Set

120

400 W

13 x 30.25 x 13

85

$299.00

115

550

20 x 37.5 x 45

235

$999.99

110

250

13 x 30 x 13

90

$399.99

MT-2

Yes

8 to 56 tpi

4" Three Jaw Chuck, 7" Four Jaw Chuck,Threaded Back Plate, Face Plate, Single Tool Post, Steady and Following Rests, Live and Dead Centers,Threading Dial, More

MT-2

Yes

8 to 40 tpi

4" Three Jaw Chuck, 5" Four Jaw Chuck, Face Plate, Four Way Tool Post, Steady and Following Rests, Dead Center,Threading Dial, Gear Set

110

550

17.5 x 17.5 x 34

190

$695.00

MT-2

Yes

12 to 52 tpi

3" Three Jaw Chuck,Tool Post, Dead Center, Gear Set, Digital Tachometer

110

350

12 x 35 x 12.75

90

$574.95

MT-1

Yes

None

2.6" Three Jaw Chuck, Dead Center, Tool Post, One Cutting Tool

110

120

9.5 x 25 x 7.5

55

varies by vendor

MT-1

Yes

11 to 60 tpi

3" Three Jaw Chuck,Tool Post, One Cutting Tool, Dead Center, Gear Set

110

250

11 x 31.5 x 8.5

97

varies by vendor

MT-0

Yes

Option

Tool Post,Two Dead Centers, One Cutting Tool

100-240

250

7.5 x 24 x 6

24

$575.00

MT-0

Yes

Option

Tool Post,Two Dead Centers, One Cutting Tool

100-240

250

8.75 x 32.25 x 8

30

$675.00

Custom

Yes

None

3" Three Jaw Chuck,Tool Post, 1/4 Jacobs Drill Chuck, Pulleys

115

190

12 x 16 x 6

40

$399.00

SERVO 01.2005

61

JanNewProducts.qxd

12/9/2004

9:41 AM

Page 62

New Products

New Products CIRCUIT BOARDS Canadian Circuit Board Solution

P

CBexpress now manufactures and ships their quick turn around, quality prototypes to Canada. Due to the overwhelming increase in Canadian customers, PCBexpress has created a specialized website dedicated to Canada — www.PCBexpress.ca They’ve incorporated the same pricing, quality, and ease of ordering that they have been offering for the past seven years from their US online service. Combined with 29 years of PCB manufacturing, they provide experience and reliability for your circuit board needs. Here are a few of the benefits of ordering your circuit boards through PCBexpress.ca: • First online quote and order e-commerce site of its kind for Canada’s PCB industry. • Quick turn prototype circuit boards available in hours, rather than days. • Boards manufactured and shipped WITHIN Canada. • All prices calculated in Canadian dollars. (No more conversion headaches.) • Option for centimeters or inches. • Two to six layer circuit board prototypes — up to 25 pieces. • Online pricing and simplified ordering. • Never a tooling charge. • PCBs routed to any shape. • Excellent customer support, including live help. Try out their seamless order process and receive two free boards (when you order four or more). Just enter in “2for4” as your gift certificate code when placing your orders. For further information, please contact:

PCBexpress

Website: www.pcbexpress.ca or www.pcbexpress.com (for small orders of prototypes) www.pcbpro.com (higher production volumes) www.pcb123.com (PCB design software)

Circle #26 on the Reader Service Card.

62

SERVO 01.2005

PLATFORMS  Revolutionizes Botster Robotics Kit Market

S

ummerour Robotics Corporation sets a new standard in price, flexibility, and style for programmable robotic kits with the launch of their new Botster™ platform. Botster provides an economical way for hobbyists, students, and educators to jump-start their robotic projects. The provision of a ready-made platform allows more time for enthusiasts to develop intelligent software. The rugged, boxed chassis holds up well under constant usage and is styled with a dynamic appeal that makes it look fast and agile — even just sitting still. Users can easily implement autonomous behavior via features that include an integrated wheel encoder system, Sharp™ infrared sensor mounts, and differential drive motors. The wheel encoder system provides 0.187” of linear resolution and is used to provide speed and distance information to the user’s controller. The Botster’s differential drive design allows it to pivot around its center to easily navigate out of tight spaces. The included heavy duty hobby servos power the Botster and can be controlled from any controller featuring two Pulse Width Modulation (PWM) ports. The Botster’s weight is supported by the drive wheels and the heavy duty steel ball caster. The rear vertical deck folds down for access to the inner cavities of the Botster and can accommodate the following controllers: • • • •

PDA (largest currently available) PC104 controller Small single board computer Up to two microcontrollers

The front vertical deck can be used to mount sensors, recharging circuitry, or an optional breadboard that can be used for robotic circuit experiments. The horizontal decks can be used to mount communication modules, microcontrollers, sensors, or more power supplies. A fully integrated turret is also available as an option. It bolts into the middle deck and comes in two versions: a

JanNewProducts.qxd

12/9/2004

9:42 AM

Page 63

New Products CMUcam2 version and a generic version. The generic version can be use to mount various robotic components, such as sonar ranging modules, digital cameras, and more. New holes can be easily drilled into the chassis decks to mount extra sensors, components, or controllers. Botster’s dimensions are 5.5” W x 5.5” D x 7.25” H. Fully laden (PDA, microcontroller, batteries, wiring, CMUcam2, and breadboard), the Botster weighs approximately 3.2 lbs. The Botster kit starts at $99.95 and comes in several configurations of controllers, sensors, and turrets. For further information, please contact:

Summerour Robotics Corp.

P.O. Box 998 Braselton, GA 30517 Tel: 770•314•1577 Email: [email protected] Website: www.roboticsconnection.com

Circle #38 on the Reader Service Card.

SENSORS The RoboEye Sensor

P

arallax has introduced the RoboEye Sensor. It provides both a simple and sophisticated method of robotics vision and control. In its simple form, the RoboEye Sensor sends a 168 x 110 pixel image over a 2.4 GHz wireless band for display on your PC using the RoboEye software. An additional serial I/O line may be used to send control commands or data between the RoboEye software terminal and a BASIC Stamp. The wireless data link includes built-in error checking. This device is suitable for the Boe-Bot, as well as your own custom robot.

In its more advanced form, software developers can take advantage of RoboEye’s open sourced image transmission protocol for further decision making and analysis on a computer. This is done using an OCX application and intercepting a data packet stream that describes pixel colors and location. This type of use is similar to the popular CMUcam, except that image analysis can be done with PC software instead of the BASIC Stamp. Parts included in the kit: 1 RoboEye Sensor module 1 RoboEye USB module 1 3-pin 10” female/female cable (white, red, black) 1 Lens and lens holder (black plastic) 2 Right-angle aluminum bracket parts 4 4/40 1/4” screws 4 4/40 nuts 2 M2 x 10 screws Note:This part requires a USB cable to interface from this unit to a PC (not included). This cable can be ordered from Parallax, Inc., part number 805-00007. RoboEye PC software and BASIC Stamp source code is available in the downloads section at www.parallax.com Note: Once you have received your RoboEye, please pay close attention to the setup process described in the printed documentation on installation of the USB driver. The setup of the RoboEye Sensor Module and configuration works best if done in a particular order. For further information, please contact:

Parallax Incorporated

599 Menlo Dr. #100 Rocklin, CA 95765 Tel: 888•512•1024 Email: [email protected] Website: www.parallax.com

Circle #45 on the Reader Service Card.

SERVO 01.2005

63

MrRoboto.qxd

12/8/2004

9:10 AM

Page 64

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

[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

.I would like to be able to program a PC to control several servos for a robotic Halloween display I want to make for next year. The problem is that I have no idea where to start. Do you have any suggestions on how I could go about doing something like this? — Paul Gear via Internet

A

.This sounds like a fun project. Okay, there are several different ways to go about solving this problem. One of the more common ways to do this is to use a serial servo controller. These controllers hook up directly to a serial port on your computer and — with some software that comes with the controller — you can control your project. Table 1 has a few servo controllers that you can take a look at. This column got me thinking about how I could make a custom application to directly drive R/C style servos. So the rest of this is a more generic approach to solving this problem with Visual Basic from Microsoft (www.microsoft.com) and a microcontroller from Parallax. The example shown here only uses two servos, but can be modified to include additional servos. Also, to make things a little more interesting, I added four check boxes that can be used to turn on and turn off external relays. The relays could be used for things like turning on red eyes, a sound box, or Company

Servo Controller Parallax Servo Controller

Parallax, Inc.

Mini SSC II

Scott Edwards Electronics, Inc.

SSC-12

Lynxmotion, Inc.

Quad Serial Servo Controller

Phigets

ServoPod USB

New Micros, Inc.

Table 1. Serial servo controllers.

64

SERVO 01.2005

a fog-making machine. Figure 1 shows a simple Form layout for a Visual Basic 5.0 program example. Two horizontal scroll bars are used for moving the servo positions. The check boxes are for special relay switching options. The telephone and stopwatch icons are for establishing serial communications and servo position update timing. In this application, the Visual Basic program itself will be used to maintain the servos’ 50 Hz position update timing instead of the BASIC Stamp. This simplifies synchronizing the timing between the Stamp, PC, and the servos. If you are not familiar with using Visual Basic, just follow a couple of the tutorial examples and you will see how quickly this Form can be put together and running. Figure 2 shows what the graphical user interface looks like when the program is running. The Visual Basic program listing shown here is all that is needed to make this application talk to a BASIC Stamp, control two servos and four outputs, along with selecting which serial port to use when controlling the BASIC Stamp. The Form_Load() subroutine is used to initialize all the variables and the appearance of the user interface. This is why you see several differences between Figures 1 and 2. Figure 2 shows that the Com port was set to a value of 6. This just happened to be an open Com port on my computer when I wrote this program. It will most likely be different on your computer, so Website you can change the default value in the program to what is normally open www.parallax.com on your computer. The Command1 www.seetron.com button is used to open and close the Com port. www.lynxmotion.com When running the program, you must open the Com port in order for www.phigets.com the program to talk to the BASIC Stamp. When this button is pressed, www.newmicros.com the Command1_Click() subroutine is executed. This routine is used to verify

MrRoboto.qxd

12/8/2004

9:11 AM

Page 65

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

Figure 3. Project schematic drawing. SERVO POWER

+5V

Vdd

2 1

BASIC STAMP 2

+5V

11 470 ohm

SERIAL DATA IN

15

5V SPDT RELAY

12 470 ohm

SERVO #1

SERVO #2

SERIAL GROUND 13

IN4001 470 ohm

Vcc

14 470 ohm STAMP I/O PIN 1 Kohm

RELAY CONTROL 2N2222A

SERVO 01.2005

65

MrRoboto.qxd

12/8/2004

9:15 AM

Page 66

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

Microcontroller

2005

T

P

www.apec-conf.org

www.apec-conf.org

66

SERVO 01.2005

MrRoboto.qxd

12/8/2004

9:15 AM

Page 67

“True” serial data is actually inverted, then you have to tell the Stamp to receive the TO STAMP I/O PIN data as Inverted data so that it will be 22 Kohm received correctly. Figure 4 shows a schematic for a simple serial adapter for hooking a RS-232 serial 4 1 2 5 3 cable to a BASIC Stamp. This schematic is based on the one shown in the BASIC Stamp 7 6 8 9 manual. This cable will not invert the incoming serial data, thus the Stamp needs to receive the serial data as Inverted data (the DB-9 MALE (CONNECTOR SIDE) only exception is if you are hooked up to the Sin pin on the Stamp). Figure 4. Simple RS-232 for connecting to a BASIC Stamp. The Stamp program shown here is based on using a BS2p Stamp. As you can see, there is not a lot of programming required to receive serial Stamp program only looks at the first four bits of that byte of data. The WAIT(255) command in the serial input line (Serin data and lights the LEDs accordingly. command) tells the Stamp to wait until it receives a byte of That is about all there is to it. Once you have the serial data that is equal to the numerical number 255. This is the communication protocols setup properly, writing these types same synchronization byte that is sent first in the Visual of programs is not that time consuming and the programs Basic program. can be easily customized for your exact application. In this Once the Stamp receives the 255 value, the program will program, moving the slider bars back and forth causes then look for three more bytes of data. The next two bytes the servos to move back and forth and pressing the option of data tell the servos the commanded position they are buttons will cause the corresponding LEDs to light. supposed to go to. Since the Visual Basic program sent Hopefully, the information shown here is enough to get the Accessory Options Byte as a four-bit binary number you started in making your animatronic project a success for (representing which check box was checked), the BASIC next year. SV

Affordable Motion Control Products Robot Building Blocks Motor Speed Control PID Motor Position Control Solutions Cubed Phone 530-891-8045 www.solutions-cubed.com

Solutions Circle #111 on the Reader Service Card.

3

SERVO 01.2005

67

Robytes.qxd

12/8/2004

8:56 AM

Page 68

Robytes ’m back! I escaped from the snarling, fire-breathing robots that wouldn’t let me finish my column. Dreadful, you say! If readers had sent me items, this wouldn’t have happened: david@robotics-society. org Many thanks to Dan and Alexa for filling in for me last month. — David Calkins

I

Robots Move Towards True Autonomy

The bot has eight MFCs, each filled with raw sewage (the robot is autonomous and it smells good!). Bacteria in the slurry eat the flies and release electrons into the MFCs as the flies are metabolized. The MFCs are so efficient that the robot worked for five days on just five bugs. On the plus side (for the current, human leaders of the world), it takes three hours for the robot to move 75 cm (30 inches), so — for the near future — you’ll probably be able to outrun it when it comes for you.

Shape Shifting Robots!

by Dave Calkins configurations — snake, roller, or walker. As for batteries, each segment has its own, but can share power when connected to the whole. They can also disconnect from the group and move on their own. Using infrared, they can always find each other and re-connect. The units each have their own independent Atmel ATMega 128 processor, as well as a two-axis accelerometer for sensing tilt. For further external sensing, an ATRON module can put its infrared communication into a special sensing mode that functions as primitive distance sensors to tell if a neighboring cell in the lattice is occupied or not. The distance sensing offers all information needed in order to recognize dead modules, external obstacles, or modules to connect with.

Robots Clean Up! Photo courtesy of the University of the West of England.

Yeah, yeah, yeah, robots are going to take over the world — just as long as they can do it within the four hour charge of their batteries. Unless, of course, they don’t NEED batteries. Solar power is nice and all, but it doesn’t do so well at night. So, what’s a powerhungry robot to do? Why, run off of decomposing bodies, of course. Yes, my paranoid followers of Bill Joy — the future is one step closer to not needing us. The University of the West of England has developed a robot called EcoBot II that derives its energy supply from decomposing bugs. The robot uses microbial fuel cells (MFCs) to accomplish this magic. Chris Melhuish — head of the project — has designed the robot so that it can catch flies and “digest” them in the MFC-powered robot “stomach.” MFCs are bio-electrochemical transducers that convert bio-chemical energy to electrical energy in roughly the same manner as a normal fuel cell.

68

SERVO 01.2005

Photo courtesy of Henrik Hautop Lund.

Who wants a robot that just walks? Or one that just rolls on wheels? Even one of Gavin Miller’s cool snake robots can be limited. Gosh dangit, I want a robot that does it all! Well, Henrik Hautop Lund of the Maersk Institute in Denmark has made my Christmas wish come true! His new robot — ATRON — is a re-configurable robot made up of approximately 100 spheres, each about 5 inches in diameter. “The two connectors are held together by two joints, allowing the connectors to yaw and pitch with respect to each other. Using this approach, a number of modules may form snakes, six-legged walkers, snakewheels, and many other structures.” Each sphere is split into two segments and can rotate along its axis with the internal motor. The spheres then join together in many different

Got pollution? Shanghai certainly does. As one of the fastest growing cities on the planet, it’s got all the usual problems associated with big cities and one of the biggest is pollution. The major type of pollution is air pollution — indoor air being filled with cigarette smoke, shoddy home decorations, factory spewage, and so many of the other things that make modern living so much fun. Many health experts blame toxic indoor fumes in Shanghai for the country’s rising problems with lung cancer and leukemia. So, robots to the rescue! In November, the Shanghai Environment Protection Industry Association started a promotion for this robot, which officials say will purify poisonous fumes — such as formaldehyde, cigarette smoke, and other toxic fumes. The robot acts as a dust collector and can emit negative ions to absorb toxic particles in the air while consuming very little electric power, according to Wang Fang, Secretary General of the association’s indoor division. “The robot or other air purifying

Robytes.qxd

12/8/2004

8:57 AM

Page 69

Robytes facilities will become a trend as people are paying more and more attention to their living quality,” said Ma Keqin, Vice General Manager of Gree New Technology Institute Company. Can they make a robot that will clean up the poisonous fumes emanating from my laundry pile?

Martian terrain, allowing a single Mars Rover a far greater ability to explore! Who needs wheels, anyway?

Robot Cleans Up the Past

Mars Robots Go BOING!

Photo courtesy of the University of Southampton.

Photo courtesy of Pioneer Astronatuics.

The problem with extraterrestrial robots is their range. Of course, the Mars Explorers are cool and we learned an amazing amount from them. However, they never went much farther than 30 feet from their landing places. Wouldn’t it be cool if we could send something to Mars that would go all over the place? Enter Pioneer Astronautics, a tiny little company making robots for NASA. They’ve come up with the Mars Gas Hopper — a cool way for robots on Mars to use indigenous carbon dioxide from the Martian atmosphere as a propellant to provide a Mars explorer with greatly enhanced mobility. The Gas Hopper acquires CO2 from the Martian atmosphere and then stores it in an onboard canister. When the robot is done exploring a given area of Mars, the propellant tank is heated and then the gas is released through directional nozzles to provide thrust! It can also provide enough power for altitude control and controlled landings under Mars’ reduced gravity. The robot can potentially go as far as 100 km over

The great thing about the web is that you can access information from just about anywhere on the planet. The bad news is that you can only access information that's on the web. You can't access a 300 year old tome in a crusty library. Well, not yet. The University of Southampton in England has developed a robot scanner that will put their entire paper archives online. This includes many legal documents from the British Parliament, going back to the 18th Century. The £1.4 million (that’s more than $2.5 million) project is funded by the Joint Information Systems Committee (JISC) and is part of an ambitious £10 million digitization program made up of all UK further and higher education funding bodies and financed by the government. The robot uses lasers to detect the edges of pages and a vacuum arm to turn them after scanning. Unlike pesky grad students who want to be paid, fed, and given sleep breaks, this bot scans 600 pages an hour, 24 hours a day. They hope to scan a million pages a year. Stanford University has one as well, and the two universities are working together to bring once exclusive information to the masses. I guess the grad students will have to stick to founding dot coms. SV

SERVO 01.2005

69

RoboResources.qxd

12/8/2004

8:58 AM

Page 70

Robotics Resources:

BY GORDON McCOMB ou’d think that — with the vast informational resources of the Internet — printed books and magazines would by now be obsolete. That hasn’t happened for a number of reasons. On the top of the reasons list is a simple matter of numbers: the Internet has grown too big for itself and the best information is getting hard to find. Search engines like AltaVista, Google, and Yahoo! provide a window to the Internet world, but they’ve lost some of their effectiveness because of the sheer volume of websites and pages. You must choose search terms carefully or else you’ll be swimming in a sea of worthless links. Careful exploitation of the Internet’s resources can be rewarding on many levels. With the Internet, you can find almost any piece of information, part, or supplier, but knowing how to look is as important as knowing where to look. You can waste

Y

70

SERVO 01.2005

a lot of time “surfing” the Internet; there are better ways! In this column, I’ll look at several tools you can use to find information on the Internet. Some of it may seem obvious, but there are still some tricks to make your research more relevant.

Search Engines — The Big, the Bad, and the Ugly The basic tool for finding things on the Internet is the search engine — a web-based program that collects data about other pages. Search engines catalog websites, assigning “keywords” to them so you can locate what you want among the millions of pages available. The trouble is, most search engines on the Internet are rubbish. They’ve become nothing more than cheap advertising vehicles for the companies with the largest

budgets to spend and the search results can be both misleading and unproductive. A few search engines are different. At the top of the list are Yahoo! and Google. Both are different in that they strive to deliver quality results first and profits second (though making money is a key aim for both services). For several years running, Google has been the champ among search engines — boasting a clean, uncluttered interface and text-only ads. However, because of Google’s popularity, it has been the subject of intense scrutiny by webmasters seeking to “game the system” — they figure out how Google ranks pages so that their sites appear at the top of the list. It’s not uncommon for many searches to result in nothing more than websites with links to other websites — particularly auctions on eBay and books on Amazon. These searches are commonplace

RoboResources.qxd

12/8/2004

9:01 AM

Page 71

ROBOTICS RESOURCES because both Amazon and eBay offer referral fees for attracting customers. The websites are set up to simply refer visitors to other places. As a business, they flourish when they appear first in the search results; therefore, the webmasters of these sites do everything they can to maintain a high ranking. I’m not against this as a business — everyone has a right to earn an income. However, sales referral sites can significantly slow down research when that’s your aim.

Search, but Search Wisely All search engines have a text box where you enter a search term (called a keyword) to find the information you want. The keyword (or keywords) you use greatly influence the relevancy and effectiveness of your searches. Enter “robotics” into the Google search bar and you’ll get something on the order of eight million web pages! As you can imagine, robotics is a popular field, but using a common search phrase such as this will get you nowhere, fast. Fortunately, search engines provide a number of ways to narrow your search so that you have a greater chance of finding what you want. The following tips and observations specifically apply to Google, but they work on many other search engines, as well. Like most search engines, Google uses keywords to match your search phrase with the content of a web page. Keywords can be contained in the title or the text of the page. How Google ranks the relevancy of the keywords it finds on pages is a closely guarded secret, but — through observation — it’s pretty clear that Google tends to favor sites where the keyword(s) you’re searching for appear in the title of the page. Therefore, if a page says “ Robotics Stinks,” it will likely be ranked highly among pages on robots, simply because the word “robotics” is in the title.

Trimming Web Page Fat So-called meta tags — text embedded in a web page, but not visible to the user — used to be a popular way for webmasters to describe what their site was all about. Trouble is, too many people abused the feature, so many search engines ignore these meta tags. Most search engines nowadays look only for text that is visibly displayed. Though webmasters can be penalized

Knowing this, you can more readily search for companies, products, or information by using search terms that are most likely to appear in the title of web pages. Those web page creators that use undisrupted titles or leave them blank will be ranked much lower in the search results. That’s too bad for them.

Using Multiple Search Terms One of the best ways to insure quality search results is to use multiple search terms. By using multiple terms

for trying other tricks — like hiding text by giving it the same color as the background — search engines don’t catch it all. This is why you sometimes click on a link from a search result, only to see a page that has nothing to do with what you were looking for. Odds are, they’ll try to direct you to a pornography site or someone selling drugs to combat male impotency. Oh, the tricks they play!

in a search, you narrow down the possible results. It’s better to do several small searches than one big one. For example, instead of searching on robotics — and the eight million pages you get as a result — try “robotics kits” or “robotics schools” or whatever your interest is. There’s no reason to limit yourself to just two keywords. Try three, four, or more. The more keywords you use, the narrower your search will be. If you find the search is too narrow and you don’t get any results, try removing one or two of the keywords and searching again.

FIGURE 1. Google.com provides the Big Picture. Use its features carefully to find what you need.

SERVO 01.2005

71

RoboResources.qxd

12/8/2004

9:03 AM

Page 72

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

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

72

SERVO 01.2005

RoboResources.qxd

12/8/2004

9:04 AM

Page 73

ROBOTICS RESOURCES contain “us robotics” as a complete phrase are omitted. It’s often handy to search for multiple keywords, such as “robotics and vision.” With few exceptions, Google does not use Boolean searches — “robotics AND vision,” for example — like some other search engines. Google’s syntax is a lot easier, yet isn’t limited. +robotics +vision Finds pages with both of the word forms robotics vision Same as above “robotics vision” Finds pages with the specific phrase robotics vision. Except for the whole phrase “robotics vision,” the keywords in a multiple keyword search do not have to appear next to each other on the web pages. That is, robotics can appear at the beginning of a paragraph and vision later in the paragraph. That said, Google appears to give precedence to those pages where the keywords are found closer together. Note the plus (+) character in one of the examples. Google automatically ignores very common words and does not include them in the results. Adding a + character to the word ensures that Google considers it in your search. While both robotics and vision are not common words and will not be ignored, it’s a good practice to include the + character whenever you want to ensure the word is considered in the search. When using the + character, be sure to add a space before it and to type the keyword immediately following: robot +about Good robot+about Not good (no space between + and either word)

robot + about Not good (space between + and about)

No Wildcards, but ... Many web search engines — Google included — don’t support wildcards. Wildcards are special characters (like ? and *) that denote any character

or characters. However, the search engine allows you to construct phrases to look for multiple forms of words by using the OR search modifier. +robotics eye OR eyes Note OR in capitals. Google searches are not case sensitive, but you

Newsgroups — Information Beyond the Web Newsgroups were born in the days long before the Internet became a global marketplace. A newsgroup is a discussion group or bulletin board for posting and reading messages. Unlike chat, newsgroups are not real time; you don’t directly communicate with others while everyone is online. Newsgroups — which are part of the Internet sometimes referred to as Usenet — can be excellent sources of information and feedback. As newsgroups are the result of the early Internet, their structure follows something of a gear head’s design of the world and some aspects of them may be confusing and cryptic. However, it’s not complicated once you learn your way around. What’s a Newsgroup? First and foremost is that newsgroups are divided into two main forms: public and private. Public newsgroups are open to anyone and, most likely, your Internet service provider (ISP) maintains computers just for the purpose of storing newsgroup messages. Your ISP’s computers are connected to all the other public newsgroup computers around the globe and they constantly trade messages back and forth. The end result is that — even though you may “connect” to a newsgroup via your local ISP — you are reading the messages of others worldwide; if you post a message of your own, it will circulate around the globe within a few hours. Private newsgroups are set up by companies or organizations to support their products or agendas. They may or may not be open to the public. In most cases, you must use the newsreader

portion of your web browser to separately log into these private newsgroup servers; they are not part of the public newsgroups provided by your ISP. Manners and Etiquette in Newsgroups Newsgroups can be a horrendous sink of time and energy. Take my advice — avoid using them as a soapbox and avoid getting involved in a heated discussion. People say things in a newsgroup that they’d never say in person, simply because folks are protected sitting behind a computer screen. Here are some other tips: • If you include your Email, use a “throwaway” Email account that you can close should the spam (unsolicited commercial mail) get too abundant. • If you read a message that angers you, don’t reply immediately. Flag it and return to it a day later. If you still want to reply, don’t add to any possible “flame war.” They consume way too much time. • Unless you are an adult, don’t reveal your age. If you’re old enough to read this column, you’re old enough to understand why. • Sexual harassment is still a problem, particularly in public newsgroups where “joy riders” and “trolls” only stick around to cause trouble. So, if you’re female, I suggest you use a male name for your login. Obviously, this isn’t a huge problem in groups frequented mostly by women, but harassment is known to be a bigger issue in male-dominated interest groups.

SERVO 01.2005

73

RoboResources.qxd

12/8/2004

9:06 AM

Page 74

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

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

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

74

SERVO 01.2005

RoboResources.qxd

12/8/2004

9:08 AM

Page 75

ROBOTICS RESOURCES More Than Just Web Pages The Google search engine is not limited to just web pages. You can also find images, Usenet newsgroups, news, shopping pages, and more. • The Groups search lets you sift through years of archives of newsgroup messages. • The Directory search provides web links to submitted and approved sites. Some of these may be paid advertisements; nevertheless, it’s a good way of locating major suppliers. • The Catalogs feature lets you search hundreds of mail order catalogs, including many of interest to robot builders. Be sure to try this one! • The University search lets you limit searches to the websites of any of a couple hundred universities. With this tool, you can look up relevant research data posted by professors, post-grads, and students at the Massachusetts Institute of Technology, CarnegieMellon, and several other schools that are known for their robotics departments. • Use the Froogle search if you specifically want to find products for sale. The results are specific products that match the search terms you’re looking for and you can change the order of the listings by price.

AltaVista; my favorite is Google, so we’ll talk about that first. To translate a web page, go to www.google.com /language_tools and enter the full URL, including the portion of the web page you want to view, in the appropriate text box. Select the “from” and “to” languages, such as Spanish to English or French to German. The translation takes anywhere from a few seconds to over a minute, depending on the length of the page. Note that only normal text is translated. Text in a graphic image is not translated and is shown in the original language. AltaVista’s similar offering is available at babelfish.altavista.com It works in a similar fashion to Google’s translation page and offers additional languages, such as Korean, Russian, and Chinese.

About — www.about.com AltaVista — www.altavista.com AOL — search.aol.com Ask Jeeves — www.ask.com Buyer’s Index — www.buyersindex. com (mail order shopping search engine) Direct Hit/Teoma — www.directhit.com Dog Pile — search.dogpile.com Euroseek — www.euroseek.com Hotbot — www.hotbot.com Infospace — www.infospace.com LookSmart — www.looksmart.com Lycos — www.lycos.com MSN — www.msn.com Public Internet Library — www.ipl.org Search Hippo — www.searchhippo. com Worldpages — www.worldpages.com Yahoo! — www.yahoo.com SV

Other Search Engines

Author Bio

Of course, there are other search engines on the web — some good and some terrible. Here is a listing of some additional general-purpose search engines. Some of these are “powered by Google,” meaning that they use Google’s database of pages. Typically,

Gordon McComb is the author of several best sellers. In addition, he operates a small manufacturing company dedicated to low cost amateur robotics at www.budget robotics.com He can also be reached at [email protected]

HobbyEngineering The technology builder's source for kits, components, supplies, tools, books and education.

Robot Kits For All Skill Levels

En Francais, Anyone? Page Translations Robotics isn’t limited to just those who speak English. You’ll find plenty of web pages in a variety of languages. Several free services offer text translation from and to the world’s most common languages. The translations are not perfect, but they are often close enough to allow you to get the gist of what the web page is all about. Among the better web page language translators are Google and

they are tuned to address a more specific market, like shopping or nonUS searches.

ICs, Transistors, Project Kits Motors, Frame Components and Scratch Builder Supplies. Order by Internet, phone, fax or mail.

www.HobbyEngineering.com

Books and Educational K

BEAM Kits and Components

1-866-ROBOT-50 1-866-762-6850 1-650-552-9925 1-650-259-9590 (fax) [email protected] 180 El Camino Real Millbrae, CA 94030

Visit our store near SFO!

Most orders ship the day received! World-wide shipping. Convenient payment options.

SERVO 01.2005

75

TwinTweaks.qxd

12/8/2004

9:19 AM

Page 76

NEW ! UMN COL

THIS MONTH: Attack of the Monster Robot Dog!

H

ello, SERVO readers! We’re Evan and Bryce Woolley. You may recall our names from the series of articles on Team 1079 and the FIRST Frenzy experience. Why are we back again, you ask? Well, it is not for FIRST. Although FIRST has been a significant experience in our budding engineering careers, we actually have quite an impressive background. We began at a very early age by playing with Z-bots (little plastic robot toys). Eventually, we graduated to LEGO Mindstorms robots, which we have used in various events, including high school science competitions. The pre-hack robot dog has amazing flexibility!

76

SERVO 01.2005

Our robot building moved up to the next level when — at the end of our middle school years — we acquired a CAG (California Association for the Gifted) grant for $1,000.00 to jumpstart an independent learning endeavor involving robotics — combat robotics, to be exact. We had watched the robotic combat shows on television and thought it would be fun to participate ourselves. So, we built 60 and 30 pound robots for the BotBash competition. (They are not vapor bots; they have competed quite successfully.) More recently, we have been devout Can RoboSapien do this?

followers (but, unfortunately, not participants) in the DARPA Grand Challenge and Tetsujin competitions. Through these endeavors, we have met such engineering greats as Dave Lavery and Dean Kamen and have listened to people like Tony Tether (the Director of DARPA) and Red Whitaker (a robotics genius from Carnegie-Mellon University) in person. To share our hobby with other students, we started the Robotics Club at our high school in our freshman year. As you already know, we are actively involved in FIRST, in which we have participated in for over two years. We have been apprentices at the Palo Alto Research Center (PARC) through IEA (the Institute for Educational Advancement), where we worked on modular snake robots for urban search and rescue with professional engineering mentors (for more on PARC, see the August, 2004 issue of SERVO Magazine). The list goes on ... In short, we have some credibility. What this column will do is detail our modifications to certain robotic products. These modifications will have a connection to a larger concept in robotics. It is just for fun, but you just might learn something in the process! This month, we’ll study the

TwinTweaks.qxd

12/8/2004

9:21 AM

Page 77

Attack of the Monster Robot Dog! transformation of a Joinmax Robot Dog into a Tyrannosaurus Rex. Before beginning any type of project, though, it is imperative to know what you’re dealing with. In this case, that would be the Joinmax Robot Dog.

truly better suited to program hacks, but it definitely has room for mechanical hacking, as well.

The Plan

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

The Joinmax Robot Dog

The Hack

SERVO 01.2005

77

TwinTweaks.qxd

12/8/2004

9:22 AM

Page 78

Twin Tweaks ...

Wiring up the kit. Miniservo Explorer program. A RoboSapien may make walking look like a piece of cake, but it really isn’t. The movements of all four legs for a walking gait were very difficult to coordinate. That illustrates one advantage of two-legged walking — it would be a lot easier to program! The dog’s first major surgery was the amputation of its two forelegs. Don’t worry; we replaced them by fitting stubby Tyrannosaurus rex arms from a suitable donor — and old Godzilla toy. This is hacking, not fabricating; you have to work with what you have. The ease in construction with the robot dog translates to ease in deconstrucThe Tyrannosaurus rex dog and its prehistoric cousin. Quite a family resemblance!

tion — the only tool we needed was a small Phillips screwdriver. Without the forelegs, the dog could actually balance on its hind legs. It slouched, though, and we decided that an extension on the tail would give it better posture. A broad end on the tail would provide a solid point for balance and we thought that an arrowhead-shaped tail fit better with cool factor engineering than a lame spatula shape. After some quick work with a jigsaw, the dog had a shiny, new aluminum tail. Now, a point of balance would be useless without friction, so we attached a piece of rubber to the arrowhead to keep the dog from slip-sliding away. Some spray-on adhesive gave the tail some grip via a new rubber sole. With a couple of holes in the dog’s tail, the new extension could be attached with tie wraps. The tie wraps even gave the tail a ridged look like a Tyrannosaurus rex — cool factor can be found in some unusual places, if you take the time to look. Now that we had a two-legged dog that could balance, it was time to make it walk.

toward actually walking. We had the dog stand to attention with its neck down (from the normal dog position), hind legs vertical, and tail angled acutely towards the ground. The first gait we tested involved some deep knee bending, but the dog fell down without making any forward progress — back to the drawing board.

Modifications

As the dog picked up one leg to move forward, we noticed that it was unable to balance on the other leg and the tail. To solve this problem, we crafted some extensions for the feet. The robot dog itself has fairly small feet, which is okay when it has four of them to stand on. For the purpose of two-legged walking, tiny feet just don’t cut it. Looking at other walking robots — like RoboSapien — for guidance, we saw that most walkers have fairly large feet. Spray-on adhesive would be kind of messy in this application, so we simply duct-taped the aluminum extensions we designed onto the feet. Now it was a real robot! Another design feature of the dog that was ideal for four-legged and not two-legged walking was that it literally had balls on its feet. Selfadhesive foam helped to level the We knew that a reliable standing dog’s feet and give it some muchposition would be the first step needed stability. The final problem was that the tail kept sliding The dog can stand on two feet, back while the dog shuffled but it can’t walk, yet! forward, contributing to its eventual fall. As a solution, we attached some self-adhesive foam to obstruct this unwanted path of motion. The foam proved to be too squishy, so we taped on a square of plastic, instead. Trial and error is a wonderful thing.

First Tests

Final Product With these modifications completed, all that was left was some programming. In

78

SERVO 01.2005

TwinTweaks.qxd

12/8/2004

9:25 AM

Page 79

Attack of the Monster Robot Dog! its own way, this robot Tyrannosaurus rex dog is representative of robotics projects in general in that a knowledge of all aspects of the project is necessary. Robotics is perhaps the most cross-disciplinary field in all of engineering and it demands engineers that know their ways around both hardware and software. The programming in this hack was considerably simplified by working with only two legs, but that is not to say that making the Tyrannosaurus rex dog walk on two legs was easy. The first successful gait we had was a kind of shuffling, jerky walk. It wasn’t graceful, but it worked. After some more effort, we were able to improve upon this gait to make the dog take distinct steps, which we consider to be the requirement that makes it a true walker. It still wasn’t graceful, but it most definitely walked. The robot dog was no longer a dog — it was a Tyrannosaurus rex. When it is placed next to a toy Tyrannosaurus rex, one can see that the resemblance is, indeed, striking.

Significance The Tyrannosaurus rex dog is not simply the belated synthesis of fond childhood memories (we played with dinosaurs before Z-bots), it also has relevance to some issues in the greater world of robotics. The trials and tribulations of the Tyrannosaurus rex dog illustrate the difficulties in making an effective two-legged walking robot. The Tyrannosaurus rex dog hack may have been simple and it may have worked, but its walking motion did not nearly have the grace of other walkers, like Asimo or even RoboSapien. Simply put, walking is harder than it looks. Walking takes balance and control. In the case of the robot dog, balance was the easy part — at least for just standing up. To get anything to balance, all you really have to do is give it big feet and maybe a few extra supports, like a tail. (This may, however, be frowned upon by the more strict

engineers who may call the tail a third leg; two-legged humanoid walking is, after all, the holy grail of robotics.) Even so, what balances while standing may not balance while walking, as the first tests of the robot dogasaurus illustrated. Walking is a complex problem and all of the factors must be considered at once for an effective solution. The second consideration is control. The Tyrannosaurus rex dog hack was done without any sensory feedback — just pure mechanics. This The Joinmax Robot Dog is rather easy means that we were to assemble and disassemble. programming blind; we didn’t know how little changes need to be coordinated, so every might affect the final gait. degree of freedom adds a layer of Also, the dog could not adjust complexity. itself; it had only the program to rely Our hack of the Tyrannosaurus rex on. It still walked, but with a kind of dog shows that making a walking shuffling, jerky gait. robot can be relatively easy, but its High dollar walkers get feedback shortcomings demonstrate that the from every joint so as to fine-tune task of walking on two legs is difficult weight distribution on the fly. These to perfect, no matter how easy the robots have impressive gaits that RoboSapien makes it seem. approximate human motion to an almost unnerving degree. Another aspect of control is the number of joints that are being worked That was fun, wasn’t it? We hope with. The RoboSapien essentially only that we have inspired you to try has one powered joint per leg at the experiments of your own with walking hip — the knees move reflexively. This robots (especially two-legged walkers). makes for simpler control, since fewer Now, you can see how simple things — joints are in play. The Tyrannosaurus rex dog had like a robo-dog and old Godzilla three joints per leg, making control a parts — can create an engineering more complex proposition for us. microcosm for more significant issues More joints mean that more motions in the world of robotics. SV

Final Thoughts

Special Thanks SERVO Magazine would like to thank E-Clec-Tech (www.e-clec-tech. com) for their generous donation of the Joinmax Robot Dog for this month’s “Twin Tweaks” column. Take advantage of their limited-time special — exclusively for SERVO subscribers — on the Joinmax Robot Dog at E-Clec-Tech. Also, browse their selection of other robot kits and parts

for everything from joints and servos to hexapods and robotic arms. If you are a manufacturer or vendor with a robot or kit that you would like to see hacked beyond all recognition, contact us at editor@ servomagazine.com The column is bi-monthly, so we’ll have plenty of time to plot the “evolution” of your product! SERVO 01.2005

79

Appetizer.qxd

12/8/2004

9:51 AM

Page 80

Robots and Generations at RoboNexus by Dr. Pete Markiewiez n October 2004, I attended RoboNexus (www.robonexus.com), the first commercial US show for consumer and service robots. While I was prepared to see a lot of robots, I was stunned by another kind of participant — the literally thousands of kids who attended the Expo, usually with their parents. In retrospect, I shouldn’t have been surprised. These kids are part of the Millennial or Echo Boom generation, recently featured on the CBS program 60 Minutes and described by generational experts William Strauss and Neil Howe of Lifecourse Associates1 as the “next greatest generation.” They’re the post GenY group2, product of a second baby boom, aged 0-20 years old.

I

They recently confounded experts by reversing numerous negative social trends long associated with youth. Among teens today, crime is at the lowest rate in 30 years and out-of-wedlock births are at the lowest rates ever recorded. Drug use is down to levels comparable to the early 1960s. You wouldn’t know it from the media, but Millennials seek the social norm — and are even a bit more straight arrow, compared to older groups. Most importantly, this new generation is showing renewed interest in science and technology. While interest in tech-related fields has been declining for years at colleges, SAT scores among younger Millennials are going up — especially in the math

portion of the test. By the time 12-year old Millennials reach college, they’re likely to reverse the anti-science and engineering trends.

A “Robotic” Generation Turns to the Real Why should this new generation be specifically interested in robots? The answer lies in patterns of popular culture. Typically, waves of new technology in the US last 18-25 years and are closely associated with the rise of a new generation. At the end of the era, a new generation appears and replaces the former one’s youth culture. During this

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

The “Echo Boom” Total U.S. Births, in Millions

1.04 1.04

4.5

Boomers

1.03 1.03

Millenials "Echo Boom"

1.02 1.02

Gen-X Mi llions of B irths

Tes tSSAT scores beg in aound s low craw l AT Scores Seniors, Scores of of College-B College-Bound Se ni ors, (1975=100) 1975-2001 (1975=100) upward 1975-2001 as oldest Millennials reach teen years around 1996 S AT--Math Only SA T--Math Only

1.01 1.01

4.0

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

1.00 1.00 3.5

0.99 0.99

Gen-Y

0.98 0.98 0.97 0.97

3.0 1950

1955

1960

1965

1970

1975

1980

1985

1990

Source: U.S. Bureau of the Census (2000)

80

SERVO 01.2005

1995

0.96 0.961975 1975

1977

19801981

1979

1985 1985

1983

1987

19901991

1989

1995 1995

1993

1997

20002001

1999

Source: Colleg e Board (2001) Source: Colleg e Board (2001)

Appetizer.qxd

12/8/2004

9:52 AM

Page 81

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

Parents Encourage Interest in Robots

References

SERVO 01.2005

81

Appetizer.qxd

12/9/2004

9:57 AM

Page 82

Movie Link See the RoboNexus movie! – This hyperlink will take you to a short RoboNexus movie by the author, featuring both robots and their Millennial friends. http://www.plyojump.com/ movies/tradeshows/robonexus/ 2004/robonexus_plyojump.wmv (Windows Media File) literally crawling with student-built robots. A few weeks later, on the other side of Los Angeles, Santa Monica College (a two-year community college regarded as a “finishing school” for students planning to attend universities) announced it will begin teaching Mobile Robotics in spring 20055. Both schools have recognized the generational trend and are catering to an increasingly robotaware youth culture. Evidence that Millennials know robots better than the “next up” generation was evident in audience ages at RoboNexus. While the 25er Internet junkies and 30ish video game-meisters weren’t entirely absent, they were low in number compared to the 8-16 year olds swarming the booths. Hardly a piercing, skateboard, or Avril Lavigne getup was to be seen. Instead, RoboNexus featured Boomers and Xers as mentors accompanying their Millennial kids. I suspect more than a few of these parents were stunned by their

kids’ knowledge of the RoboNexus exhibits — until they found out they were building robots in school.

How the New Generation Will Affect the Future of Robotics How will Millennials affect the rise of the robots? Here’s a recent quote from Toshitada Doi, Vice President of Sony Corporation: “The 90s was the era of the PC and the Internet. The first decade of the 21st century will be dominated by robots.” The oldest Millennials are just graduating from college and the main wave of their generation will become young adults 2009-2015. As these kids move out of school and into their first jobs, they will remember playing with robotic toys and building robots in school. It is only natural that they will embrace robotics as the next big thing. There will be two aspects to the Millennial interest in robotics. One will be a boom in consumer robotics — Millennials will see it as natural and even inevitable that a robot mower will replace a manual one, while older generations may resist (until necessity forces robotic elder care on them). Even more importantly, Millennials will also shift the pop culture mindset regarding robots. Having favorable experiences with real robots while

growing up, Millennials will have little use for the Frankenstein fantasies of earlier generations. Instead of running from the Terminator, they’ve said hello to Asimo. By the time this trend is underway in the next decade, PCs, the Internet, and wireless gadgets will seem like electrical wall sockets do today — essential, but hardly the breaking wave of tech. Robots will be the hip, “in,” and young technology — just like the PC and Internet were in other eras. Millennials will want real robots — the virtual robots in games and movies that entertained earlier generations just won’t cut it. So, have at those robots! If you’re a part of the Millennial generation, be proud that generational experts expect great things from you. If you’re from an older generation, get busy mentoring kids with your robotic knowledge and get ready to see an extraordinary new generation bring on the robotic age. SV

Author Bio Dr. Pete Markiewicz has a degree in Biology, but was co-founder of one of the first commercial websites in early 1994. He currently teaches programming at the Art Institute of California, Los Angeles. His company — Indiespace (www.indiespace.com) — specializes in consulting in new technology from a generational perspective. His website documenting the rise of the robots may be found at www.plyojump.com

Advertiser Index All Electronics Corp. ....................................37

Jameco ..........................................................83

Pololu Robotics & Electronics ....................47

APEC 2005/MicroMouse Contest ..............66 Lemon Studios .............................................45

ROBOlympics ...............................................63

Cleveland Institute of Electronics ...............13

Lynxmotion, Inc. ...........................................69

Rogue Robotics ............................................21

Net Media .......................................................2

Solutions Cubed ...........................................67

CrustCrawler ...................................................7 Cyberbotics ..................................................27 Enigma Industries ........................................37

NUBOTICS .....................................................37 Sozbots..........................................................49 Parallax, Inc. ...................................Back Cover

Technological Arts .......................................28

HiTec .............................................................29

PCB123/PCBexpress ......................................3

Vantec ...........................................................35

Hobby Engineering .....................................75

PCB Fab Express ...........................................33

Zagros Robotics ...........................................37

Garage Technologies, Inc. ...........................37

82

SERVO 01.2005

CoverInside.qxd

12/9/2004

3:33 PM

Page 2

Circle #60 on the Reader Service Card.

SERVO 08.2004 Circle #32 on the Reader Service Card.

83

Cover.qxd

12/9/2004

3:54 PM

Page 84

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

U.S.

CANADA

$9.25 0 1>

0 Circle #106 on the Reader Service Card.

$5.50

74470 58285

4

Related Documents

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