Vol. 6 No. 11
SERVO MAGAZINE
SELF-REASSEMBLING ROBOTS • PROPELLER • UNIVERSAL MOTOR • ROBOT PUPPET
1 1>
November 2008
4
74470 58285
0
$7.00
CANADA
$5.50
U.S.
Page 1 10:16 PM 10/8/2008 Cover.qxd
Full Page.qxd
7/9/2008
9:57 AM
Page 2
Let your geek shine. Meet Pete Lewis, lead vocalist for the band Storytyme. Pete recently created the RS1000, a new personal monitor system for performing musicians. It was SparkFun’s tutorials, products and PCB service that enabled him to take his idea to market in less than a year. The tools are out there. Find the resources you need to let your geek shine too.
Sharing Ingenuity W W W. S P A R K F U N . C O M
©2008 SparkFun Electronics, Inc. All rights reserved. Hear music from Storytyme at www.storytymeband.com, or check out Pete’s RS1000 at www.rockonaudio.com.
Full Page.qxd
10/7/2008
11:41 AM
Page 3
TOC Nov08.qxd
10/8/2008
2:38 PM
Page 4
Departments
PAGE 21
06 18 20 72 75 81 81
Mind/Iron New Products Events Calendar SERVO Webstore Robotics Showcase Robo-Links Advertiser’s Index
THE COMBAT ZONE ... Features
Columns 08
by Jeff Eckert
by David Geer
by Dennis Clark
Twin Tweaks by Bryce and Evan Woolley
Surveyor’s Travels
68
Robotics Resources by Gordon McComb
Hand Tools for Robot Construction
76
35
BUILD REPORT: 30 Pound Combat Robot — Mitch MANUFACTURING: Even More Things to Consider When Building a Fighting Robot PARTS IS PARTS: Chain Length Calculator and Chain Path Visualizer A Brief History of WAR
Ask Mr. Roboto Your Problems Solved Here
21
33
GeerHead Self-Reassembling Robot
14
28
Robytes Stimulating Robot Tidbits
10
26
Appetizer
Events 30 31
Results and Upcoming Competitions Event Report: Robot Battles 2008
Robot Profile 34
Limblifter
by R. Steven Rainwater
Why Just Build a Robot? Be a Robot!
78
Then and Now by Tom Carroll
Robot Competitions and Contests
4
SERVO 11.2008
SERVO Magazine (ISSN 1546-0592/CDN Pub Agree#40702530) is published monthly for $24.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL ENTRY MAILING OFFICES. POSTMASTER: Send address changes to SERVO Magazine, P.O. Box 15277, North Hollywood, CA 91615 or Station A, P.O. Box 54,Windsor ON N9A 6J5;
[email protected]
TOC Nov08.qxd
10/8/2008
2:39 PM
Page 5
11.2008 VOL. 6 NO. 11
Features & Projects 36
PAGE 56
A Robotic Puppet by John Blankenship and Samuel Mishal See how to implement computer control to give your robots the illusion of life.
40
The Universal Motor by Fred Eady This circuit gives you effective control of the AC power that is being applied to your robot’s motor without having to pamper the microcontroller.
48
PAGE 36
Getting Control With the Propeller: Part 3 by Kevin McCullogh Stepper motors.
52
The Pico ITX Johnny 5 Project by Andrew Alter Part 3 shows the advantages of having an onboard PC.
56
When LEGO Meets Sumo
PAGE 40
by Phil Malone See how combining two styles of robots adds up to a unique competition.
60
Build a GPS Smart Logger by Michael Simpson You’ll want to get started building this device as it will be incorporated into the Ultimate Robot Build series which picks up next month.
SERVO 11.2008
5
Mind-Iron Nov.qxd
10/8/2008
6:52 AM
Page 6
Published Monthly By T & L Publications, Inc. 430 Princeland Ct., Corona, CA 92879-1300 (951) 371-8497 FAX (951) 371-3052 Webstore Only 1-800-783-4624 www.servomagazine.com Subscriptions Toll Free 1-877-525-2539 Outside US 1-818-487-4545 P.O. Box 15277, N. Hollywood, CA 91615
Mind / Iron by Bryan Bergeron, Editor I just finished listening to book one of Kevin Anderson’s Saga of Seven Suns, in which robots play a central role. In the story, the Klikiss robots are highly intelligent, multi-limbed bug-like creatures that communicate with other robots using digital data streams and with humans via speech. The tale reminded me that at least one perception of intelligent robots revolves around the power of speech. Unfortunately, progress in robotic speech is relatively stagnant. Speech synthesis has been a mature technology for decades, and advances in large vocabulary, continuous speech recognition seems to have hit a wall in the late 1990s. This is in part because the projected
multi-billion dollar market for PC-based speech recognition document processing products never materialized. Today, few people even take notice of the speech recognition software available for the PC and Mac – and most hate the speech recognition systems used by the automated attendants employed by the airlines and credit card industries. Despite the mystique of “AI” surrounding speech recognition, speech recognition software that you can purchase for your PC/Mac works by simply matching spectral templates of sounds and using tables of likely word sequences to build sentences. For example, if you say “ball,” the speech recognition software would identify likely Figure 1
PUBLISHER Larry Lemieux
[email protected] ASSOCIATE PUBLISHER/ VP OF SALES/MARKETING Robin Lemieux
[email protected] EDITOR Bryan Bergeron
[email protected] TECHNICAL EDITOR Dan Danknick
[email protected] CONTRIBUTING EDITORS Jeff Eckert Tom Carroll Gordon McComb David Geer Dennis Clark R. Steven Rainwater Fred Eady Kevin Berry Bryce Woolley Evan Woolley Andrew Alter Phil Malone Michael Simpson Samuel Mishal John Blankenship Kevin McCullough Ray Billings Mike Jeffries Charles Guan Robert Farrow CIRCULATION DIRECTOR Tracy Kerley
[email protected] MARKETING COORDINATOR WEBSTORE Brian Kirkpatrick
[email protected] WEB CONTENT Michael Kaudze
[email protected] PRODUCTION/GRAPHICS Shannon Lemieux Joe Keungmanivong ADMINISTRATIVE ASSISTANT Debbie Stauffacher
Copyright 2008 by T & L Publications, Inc. All Rights Reserved
Mind/Iron Continued
6
SERVO 11.2008
All advertising is subject to publisher’s approval. We are not responsible for mistakes, misprints, or typographical errors. SERVO Magazine assumes no responsibility for the availability or condition of advertised items or for the honesty of the advertiser. The publisher makes no claims for the legality of any item advertised in SERVO.This is the sole responsibility of the advertiser.Advertisers and their agencies agree to indemnify and protect the publisher from any and all claims, action, or expense arising from advertising placed in SERVO. Please send all editorial correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879.
Mind-Iron Nov.qxd
10/7/2008
2:37 PM
Page 7
candidates such as “ball,” “fall,” and “gall.” Now, if the previous three words are “Johnny hit the,” the algorithm will likely rank ball as the most probable word. Current accuracy limitations are about 97%, even with individual training, and accuracy isn’t improved by adding processing power or memory. The obvious limitation to current speech recognition software is that it’s simply a replacement for the keyboard and video display. There is no underlying intelligence or reasoning capability. Of course, prototype systems capable of reasoning have been developed in academia, but these demonstration projects have been limited to highly constrained domains. What we need in robotics is a system that not only recognizes the phrase, “Johnny hit the ball,” but that can infer with what. If Johnny is playing soccer, we might infer he hit the ball with his head. If the sport is baseball, then we might infer he used a bat. Back to our needs in robotics, the owner of a service bot should be able to say, “Please bring me the paper” and the robot should be able to infer that the owner is referring to the newspaper. There are also issues of image recognition, mobility, and grasping the paper, but they all depend on the robot understanding the need of the owner. The limitation of speech recognition in robotics then isn’t in the ability to transform utterances into machine readable form, but with how the computational elements of the robot should process the machine readable words and phrases into actionable commands. So, how do you go about accomplishing this? It’s a non-trivial task, as a search of the IEEE literature on Natural Language Processing will illustrate. The traditional techniques — such as Hidden Markov Modeling — might be a bit intimidating if you don’t have a degree in computer science. However, you can get a feel for the tools used to map out the contextual meanings of words and phrases by working with Personal Brain. You can download the free, fully-functional personal version at www.thebrain.com. You can use the Brain to build context maps that show, for example, inheritance and the relationship between various objects in your home (see Figure 1). For your robot to bring you the newspaper, it would have to first locate the paper, and it would help to know the possible locations the paper might be found in the home. It would be inefficient, for example, if the robot began digging through your clothes’ closet in search of the newspaper, instead of on the table in your kitchen. Once you get used to working with Personal Brain, you might want to explore other uses in robotics. For example, I keep track of my various robotic projects – parts, suppliers, references, etc.— by creating networks with the program. In fact, the best way to build context maps is to create explicit, detailed maps that actually help you in everyday tasks. SV SERVO 11.2008
7
Robytes-Nov-edited.qxd
10/6/2008
10:38 AM
Page 8
Robytes Bot Gets Bio Brain
understanding of development and of diseases and disorders which affect the brain such as Alzheimer’s disease, Parkinson’s disease, stroke, and brain injury. This research will move our understanding forward of how brains work, and could have a profound effect on many areas of science and medicine.”
Give Us Some Skin
by Jeff Eckert can be mounted on curved surfaces and stretched up to 1.7 times their original size with no mechanical damage or significant change in conductivity. (You can stretch the stuff more, but conductivity drops by about 50 percent by the time you get to 2.3 times the original size.) With further development of the material, bots of tomorrow may be able to feel temperature and pressure like we do.
Must Be Nuts This small mobile robot sports a biological controller based on cultured neurons. Courtesy of the University of Reading.
Placing a functioning human brain into a robot is still well within the realm of science fiction, but some folks at the University of Reading (www.read ing.ac.uk) have created a biological brain of sorts and hooked it up as a robot controller. It has been known for some time that cultured neurons are somewhat like ants that have been scattered away from the anthill in that they can no longer function as a single unit. However, when interconnected in a culture dish, such neurons form simple networks that display spontaneous electrical activity and can function as memories; i.e., they can “learn” things. In this application, Prof. Kevin Warwick and associates placed the neurons on a multielectrode array which is a dish that employs 60 electrodes to pick up the cells’ signals. This activity is then used to control the robot’s movement. When the robot approaches an obstacle, signals are sent to the “brain,” and its responses are used to drive the wheels left or right to avoid hitting the object. The research is not aimed at creating biomechanical robots of the future, however. Rather, according to Warwick, “The key aim is that eventually this will lead to a better
8
SERVO 11.2008
This climber bot could boost coconut pickers’ productivity by 800 percent. Flexible ICs may give robots a human-like sense of touch. Courtesy of the University of Tokyo.
There’s a basic problem with creating a layer of skin for a robot. For the skin to provide tactile feedback, it must be able to conduct signals back to the “brain.” And if the skin is pliable enough to bend with the bot’s movements, it has to be made of something flexible, like rubber. The snag is that rubber is a terrible conductor. But now researchers at the University of Tokyo (www.u-tokyo.ac.jp) say they have developed a new, highly conductive rubber, paving the way for robots with stretchable “e-skin.” The trick was to grind up some carbon nanotubes, mix them with an ionic liquid, and add them to the mix. The resulting material flexes like ordinarily elastic but offers conductivity about 570 times higher. Apparently, one can use it to create elastic ICs that
It isn’t immediately apparent how students at Troy High School (www. troyhigh.com) became concerned about the well-being of the world’s professional coconut pickers, but they are. It seems that gathering nuts from the “tree of life” requires harvesters to climb 100 ft trees and chop them down with machetes, which is both dangerous and inefficient. Hence, the “robotic tree climber,” which the students developed for the 2008 Lemelson-MIT InvenTeams event. The remarkable feature of the remotecontrolled device is that it can accommodate changing tree diameters, thanks to its employment of a DryLin® QuadroSlide linear guide system, which was donated by igus, Inc. (www.igus.com), a manufacturer of various motion-related components and machinery. The developers of the climber tell us that it will allow pickers to scale more than 40 trees per day, as opposed to the present five to 10. Will
Robytes-Nov-edited.qxd
10/6/2008
4:54 PM
Page 9
Robytes the resulting glut of coconuts cause a precipitous drop in the price of coconut cream pie? Only time and the commodity markets will tell.
Heli See, Heli Do
mission-critical operations such as monitoring wildfires in real time and searching for land mines in war zones.
Bots For Art’s Sake
According to Oscar Wilde, “Life imitates art far more than art imitates life,“ but sometimes art imitates imitations of life, and a couple interesting works were on display this year. Perhaps the biggest spectacle centered around La Princesse, a 50 ft (13 m) mechanical spider created by the French performance art company La Machine. The spider was showcased in Liverpool, England, back in September as part of the 2008 European Capital of Culture celebrations. In the photo, we see it clinging to the side of Concourse House, a derelict tower block that was scheduled for later demolition.The spider was built in Nantes, France, using steel and poplar wood, and complex hydraulics, taking an entire year to construct. Operated by up to 12 people strapped to its body, it weighs 37 tonnes, has 50 axes of movement, and offers seven different special effects: rain, flame, smoke, wind, snow, light, and sound. The project cost British taxpayers £1.5 million ($2.6 million), plus the cost of treating unhinged arachnophobia sufferers, but at least admission to the celebration was free. Less spectacular but (literally) creepy is Miyata Jiro, a crawling humanoid robot created by Japaneseborn artist Momoyo Torimitsu, who now resides in New York. Miyata is a detailed and lifelike model of a Japanese “salaryman” who basically crawls around on his elbows like a soldier in the field. He has performed in New York, London, Paris, Amsterdam, Sydney, and Rio de Janeiro so far, evoking responses ranging from Stanford’s AI system allows helicopters to learn aerobatic maneuvers by “watching” laughter to anger. others. Courtesy of Stanford University. According to Torimitsu,
In the past, programming robotic helicopters has been something of a pain, given that they must perform some fairly complex maneuvers and (unlike fixed-wing vehicles) are inherently unstable. But computer scientists at Stanford University (www.stan ford.edu) — tired of laboriously pecking out source code from scratch — have developed some AI algorithms that allow their four-foot autonomous helicopter fleet to teach itself to fly. The process involves both groundbased and ‘copter-mounted instruments, including accelerometers, gyros, magnetometers, GPS receivers, and cameras. It begins with a human using a remote control to put a vehicle through a series of stunts and repeating them several times. The instruments record the flight data, which becomes the basis of the control program. But the AI system monitors the resulting autonomous flight data, crunches the numbers, and relays program modifications back to the helicopter 20 times per second, allowing the vehicle to learn from its mistakes and actually perform better than under remote control. In the real world, such improved autonomous performance could enable these choppers to be used in
Robotics continues to be a popular medium for artists, as demonstrated by Miyata Jiro, the robotic Japanese businessman.
La Princesse, a giant mechanical spider.
“When Japan entered its high growth period in the 1960s, Japanese society was transformed into a `businessman culture’ characterized by entertainment, movies, karaoke, TV, compartmentalized housing, bars, and even a sex industry that catered to them. This artwork reflects my impression of this particular culture.” Miyata can be seen at www.youtube.com/watch?v= glUnzzoFUxg. You may mistake the performance for just an amusing little parody, but thankfully we have critics to set us straight. According to zing magazine.com’s Rainer Ganahl, “The power and success of this life-sized crawling doll lies in the dramatic representation of a businessman in its most humiliating position: crawling in the street in a suit. This is a strong linguistic metaphor, as well as a psychoanalytical and a pathological one.” So there’s your elightenment for the month. SV
SERVO 11.2008
9
Geerhead-edited.qxd
10/8/2008
4:30 PM
Page 10
by David Geer
Contact the author at
[email protected]
A Self-Reassembling Robot Ever seen a robot torn apart only to put itself back together? Jimmy Sastra, a student in the Modular Robotics Lab at the University of Pennsylvania has. He helped create it. As with most scientific endeavors, the Robotic Self-Reassembly After Explosion (SAE) project was a solution to a problem: how to get a robot to reassemble itself after ‘disassembly’ by ‘explosion’ (“Towards Robotic Self-Reassembly After Explosion,” the Modular Robotics Lab, University of Pennsilvania, Mark Yim, et.al.). Jimmy Sastra, a named author on the paper and research student at the University, calls an explosion “the rapid randomized disassembly of a system from a high-energy event.” As shown in the video linked here with, the explosion is the separation of the robot as students kick it apart, separating it into three parts. he Self-Reassembling robot is a precursor to modular, selfconfiguring robots of the future, which are envisioned with many
T
Close-up of cluster with camera module.
thousands of parts and modules that configure themselves for varying applications or — as in this case — reassemble all their parts after separation by explosion. In this experiment, the goals of the robot are to perform a task, suffer an explosion, reassemble itself, and continue the original task from where it left off. This cluster of five modules shows the camera module attached, top-side.
The robot is designed to disassemble along specific, preselected lines or weakest links between the modules in a structured fashion. By ensuring that the robot separates at these “bonds” between the modules, the robot absorbs the shock and disassembles at points where it is capable of reassembling. The self-assembly of the robot is part of a larger plan for self-repair. This type of self-repair involves diagnosis of the problem/break points, a plan for re-assembly, and an execution of that plan, according to Yim.
Diagnosis The robot uses sensors to determine that it is no longer connected to itself. The robot consists of clusters of modules. According to Jimmy Sastra, the clusters are connected to each other at certain modules — using magnets. Each module face — which is connected to another module face — has two IR
10
SERVO 11.2008
Geerhead-edited.qxd
10/8/2008
4:31 PM
Page 11
GEERHEAD
Three separated clusters attempting to locate each other and re-join.
(infrared) pairs: one is an emitter and one is a detector. The pairs check to see whether they can communicate with the set of pairs on the other module facing them. If they can’t communicate with each other, they know they have been “exploded” (disconnected from each
Two clusters making ground toward each other.
other). The IR pairs also inform the modules as to who their neighboring modules are. Each cluster consists of five modules screwed together. Each module in a cluster also uses IR pairs to determine which module is its neighbor. Each cluster talks to itself using a CANbus, which is a global bus connecting the internal microcontrollers.
Planning and Execution
The single robot returns to its original activity: walking.
Each module in the robot contains a microcontroller that controls the angle of the module. Each of three camera modules employs a vision localization processor. The camera module also contains a communications unit. The camera module includes a
Two clusters even closer. The third cluster is shown in the background.
three-axis accelerometer so that it may know its orientation; whether it is standing or lying down. “After we kick the robot to explode it, it might be upside down. Using the accelerometer, it will self-right the cluster or the entire robot as needed. It needs to self-right in order to locomote to connect to the other clusters,” explains Sastra. Each of three clusters has an additional stand-alone controller that communicates with the microcontrollers in the camera modules. Each microcontroller runs its own state machine (software), according to Sastra. If the robot is fully assembled, it walks. If it is assembled, one of the three stand-alone controllers in one of the three clusters will become the master controller over the other clusters and control the walking task. As the robot walks, it uses its IR
More Entertainment Than A Political Debate!
Three clusters re-united into a single robot.
By the time this is published, Jimmy Sastra and the selfreassembling robot team will have attended the Wired NextFest at which they planned to demo the robot. “It’s a well attended event,” comments Sastra. The robot is a collaboration of various labs at the University of Pennsylvania, including CJ Taylor’s lab, which worked on the vision technology and Mark Yim’s lab, which worked on the modular robotics. Other researchers involved
in the project include Babak Shirmohammadi, Michael Park, and Michael Dugan, all of the University of Pennsylvania. Sastra notes that while there are about eight different modular robotics labs around the world, the robot from the University of Pennsylvania is a very unstructured demonstration of the technology, and it uses a high impact means of disassembling. Probably the closest to this robot is in a lab in Japan, called the Entran robot, which can also self-assemble.
SERVO 11.2008
11
Geerhead-edited.qxd
10/8/2008
4:35 PM
Page 12
GEERHEAD RESOURCES Video demo, self re-assembling robot, separated, then reconstructing itself http://modlab.seas.upenn.edu/ wiki/?n=Main.JimmySastra?action= download&upname=sae.mpg Roboticist Jimmy Sastra website http://modlab.seas.upenn.edu/ wiki/?n=Main.JimmySastra Other cool modlab robotics videos http://modlab.seas.upenn.edu/ wiki/?n=Main.Movies
The single robot with its third cluster upright.
sensors to check whether the clusters are all connected. If they are, it will
continue walking. If at any point it determines that it is disconnected from the other clusters, each cluster begins searching for the others. This becomes an independent task of each master controller in each cluster. At this point, the robot is essentially a
distributed system and each cluster will circle until it locates another. When any two clusters see each other (the camera of one sees the flashing LEDs of the other, and vice versa), they start moving toward each other. As part of the re-assembly process, each cluster needs to localize the other clusters so they can talk to each other. The blinking LEDs enable each cluster to ID the others because they use different blink patterns. Once the clusters recognize each other, they come together so that they can dock at their ajoining modules, which use magnetic faces, as previously mentioned.
Conclusion This technology is just the beginning of robots that can quickly re-assemble once they have literally been blown apart into many pieces. SV
HE8EJIFH;<;H>?J;9)0' .EW 2OBOT 3ERVOS >_j[Y Ej^[h8hWdZ
+656*
+656*
+657*
6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV
6SHHGVHF 7RUTXHR]LQ 6WHHO*HDUV
6SHHGVHF 7RUTXHR]LQ 7LWDQLXP
$//63(&,),&$7,216$792/76
7KHUHVXOWVRIDQLQIRUPDOSROOWDNHQUHFHQWO\DWWKH)LUVW $QQXDO:RUOG'RPLQDWLRQ6\PSRVLXPDUHQRZLQ5RERWV SUHIHU+LWHFVHUYRVRYHURWKHUVHUYREUDQGV7KH\NQRZWKHZLGH VHOHFWLRQRI+LWHFDQDORJDQGGLJLWDOVHUYRVSURYLGHWKHPZLWKWKHSRZHUDQGGHSHQG DELOLW\QHHGHGWRHYHQWXDOO\WDNHRYHUWKH:RUOG0DNH\RXUURERWKDSS\XVH+LWHFVHUYRV 3DLQH6WUHHW_3RZD\_&DOLIRUQLD___ZZZKLWHFUFGFRP
12
SERVO 11.2008
Full Page.qxd
10/7/2008
11:45 AM
Page 13
MrRoboto-Nov-edited.qxd
10/7/2008
11:08 AM
Page 14
Our resident expert on all things robotic is merely an email away.
[email protected]
Tap into the sum of all human knowledge and get your questions answered here! From software algorithms to material selection, Mr. Roboto strives to meet you where you are — and what more would you expect from a complex service droid?
by
Dennis Clark Since I like to group similar topics with the questions in this column, the theme this month seems to be motor controls.
Q
. Hey, could something like a relay board be used for driving really big honking motors with PWM? I have eight relays, and (unless I’m confused) you can make an H-bridge out of four, so it seems like you could use this as a dual H-bridge motor driver if you wanted, and have your motor power completely separated from your logic circuitry. Or is this nonsense? - Joe in Fort Collins
A
. In reality, you don’t need so many relays to make a reversible motor controller. If you design a motor controller that is just all relays, you would only need two relays if one of them is a DPDT (double dole, double throw). One example of this type of driver is shown in Figure 1. There are only two speeds with this type of a driver: ON and OFF. Diodes D1 and D2 shunt the CEMF, often called Back EMF to the relay coil and not to the transistors. Diodes D3 and D4 try to keep those voltage spikes out of your
Figure 1. Relay only motor driver.
14
SERVO 11.2008
power supply. The odd looking diodes D5 and D6 are transient voltage suppressors (TVS) that protect the transistors from excessive voltage spikes between the collector and emitter. The values of all of these diodes and transistors depend upon the current that you are running through your relays; more current = bigger relays = more drive current to turn on their coils. This type of motor controller is pretty common in older “BattleBot” style vehicles. It is simple, rugged, and high powered. We call it the “Bang! Bang!” motor controller because it has little finesse. It literally bangs the motor on and off. It works, but it ain’t pretty. With a little more effort, we can create a more useful motor controller that can handle very large loads and have variable speeds, as well. Usually, our robot motor controllers are H-bridges that use transistors to choose the direction of current flow through our motors, and from that the motor direction. However, high powered H-bridges are expensive and need proper care and feeding. If we use a MOSFET and single DPDT relay, we can create very high current motor drivers for very little cost. Figure 2 shows just such a motor controller. This particular motor driver is limited to eight amps because that is the current limit of the transformer. The MOSFET is capable of handling over 30 amps. Note that this design uses opto-isolators to protect the rest of our robot from unfriendly voltage and current spikes from the motor controller. The relay has the usual CEMF diode and the MOSFET is protected by a TVS, as well. Another notable design characteristic is the zener diode on the gate of the MOSFET. This is to protect the MOSFET from having the gate ring at a
MrRoboto-Nov-edited.qxd
10/7/2008
11:10 AM
Page 15
Figure 2. MOSFET and relay motor driver. higher voltage than the Vgs rating of the device. Ringing can occur on any MOSFET that is driving a high Vds (Voltage across the drain and source of the MOSFET). Even if the MOSFET has a voltage rating of 60V, the Vgs will typically be much less than that. The resistor R4 is used to bleed off the voltage at the gate of the MOSFET which will speed up its switching time. The PWM frequency here is limited by the opto-isolator transition speeds. The advantage of this type of MOSFET/relay motor driver compared to the relay only driver is that you can PWM the MOSFET and get variable speeds. If you are driving large currents, however, it is a good idea to turn the PWM off before switching motor directions to avoid arcing on your relay contacts.
Q A
. I’ve heard that PID is hard to implement but that it makes your motors run better. Is this true? - Don
. Hmmm, I guess this depends on your definition of difficult. There have been many articles written about PID algorithms, and if you have read some of them you could come away with the idea that PID is horrifically complex and difficult to implement. Really, this is not generally true. Sure, some of the very fancy algorithms that need to run super fast for super accurate motor controls can be very hairy indeed. But most of that complexity comes from the need to have high accuracy for special applications. We can implement PID in our robot motors with a minimum of complexity because we would be happy with just getting constant speeds that don’t depend much on battery levels. Before we continue, some definitions are in order for the elements of a PID algorithm. Proportional: We will apply a correction that is
proportional to the difference between the speed we are going now and the speed we want to be going. In other words, if we want to be going 500 RPM and we are going 100 RPM, we will have a larger P term than if we wanted to go 500 RPM and we were already going 400 RPM. Integral: We will add a correction every time we are not going the speed that we want to be going. This element of the PID algorithm is usually the one that is misunderstood. With this element, we will accumulate an error term every cycle of the PID where our speed is not where we want it to be. Sometimes the P error term will not be large enough to reach our terminal speed. Over time, the I error term will get larger and force a greater error correction to eventually occur. This is a very handy error term for making smooth corrections to large error terms. This term should be kept small relative to the other PID elements. Derivative: The P and I elements have been driving us onward to our terminal speed goal. As we approach our goal, someone needs to start applying the brakes so that we don’t overshoot the target. This is what the D term will do. As the motor speed gets closer to the terminal value that we want, the D term will start supplying a negative correction to slow the acceleration down so that we won’t overshoot our target speed (by much). This term will be larger than the I term, but still smaller than the P term. This term is arrived at by subtracting the last error from the current error. Eventually (we hope), the current error will be smaller than the last error and this term will get increasingly more negative. Error: This is the name given to the difference between the terminal (target) speed and the current speed. Correction: This is the PWM value that we will give the motors to tell them to speed up or slow down. So, here is how a PID loop is calculated and used. SERVO 11.2008
15
MrRoboto-Nov-edited.qxd
10/7/2008
7:15 AM
Page 16
Read your chosen feedback value and subtract it from your desired terminal value. This is called the error term. You can get this any way you want — via wheel encoder, motor back EMF readings, or anything else you wish to use. It will be: error = (desired speed – current speed). Calculate your P term. It will be: kP * (error term) = Vproportional. Calculate your I term. It will be: kI * SUM(all past error terms) = Vintegral. Calculate your D term. It will be: kD * (current error – last error) = Vderivative. Calculate your Correction term. It will be: Vproportional + Vintegral + Vderivative. Note that Vderivative will most likely be a negative term. Apply your correction term to your PWM setting; this will set the voltage to the motor. A PID algorithm will have terms that are used to multiply times the error term. These terms will supply the gain of the term. Think of them as amplifiers for the error term in the PID algorithm. Typically, they are denoted with a lower case k. In order of our definition above, they are kP, kI, and kD. You’ve probably heard the term “tuning a PID loop.” This is the process of tweaking the three terms above to give your PID algorithm the response you desire. That isn’t so scary, is it? There are more sophisticated ways to calculate these values and come up with proper corrections that will work with your PWM generation, but careful selection of your PID gains will allow your loop (called a loop because you do it over and over again) to return sane values. Your friendly neighborhood SERVO Magazine website has a C program written in CCS PCM for the PIC16F73 microcontroller that allows you to play with your PID algorithm to see what gain values cause what responses. You can download this program at www.servomagazine. com under Mr. Roboto as picpid.zip. I’ll describe the various functions of this demonstration code first. Picpid will allow you to control the speed and direction of a DC motor through a serial interface at 115200 baud. You are free to choose your favorite processor, but I recommend that you use one that has a hardware PWM, as well as a hardware USART, so that your PID algorithm can run as fast as it can in the background. This program does not use interrupts to take the error term; it simply operates at a sample rate of every 5 ms. To do the best job with a PID algorithm, you should have the sample rate repeat at a constant rate so your error terms will be proportional to both the time they are taken and the error value that you get. Picpid is simply an example program that will allow you to play with PID values to see what effects they have on your hardware. Picpid uses the ADC hardware to measure the CEMF (or back EMF) of the DC motor to determine how fast it is spinning. This isn’t incredibly accurate, but it requires no other sensors to be used beyond that required to get the voltage from the motor wires. Listing 1 shows the GetError() function which reads that back EMF. Feel free to modify this to get your quadrature readings instead. (Listing 1, 2, and 3 are available on the website, as well.) Here, in this function,
16
SERVO 11.2008
you should scale your readings to allow them to match up with your PWM settings. I’m using a 10 bit PWM in the PIC hardware, so I scaled my readings up by two to get better response. signed long getError() /* Find the difference between where we want to be and where we are. */ { signed long error; unsigned int16 ma,mb; setup_ccp1(CCP_OFF); delay_us(500);
//Turn off PWM //wait for steady state
set_adc_channel(0); delay_us(20); ma = read_adc(); ma <<= 1;
//get fwd side voltage
set_adc_channel(1); delay_us(20); mb = read_adc(); mb <<= 1;
// “Amplify” the signal, making it // more relevant //get reverse side voltage
currPos = (signed long)((signed long)ma - (signed long)mb); //printf(“ma= %lu mb= %lu\n\r”,ma,mb); setup_ccp1(CCP_PWM_PLUS_3); error = calcPos - currPos; return error; } Note that new settings are only sent to the program when you press the L key. This allows you to set several attributes before the motor has to respond to them. Picpid is a very simple PID implementation, but it works. There are bugs in it, such as interesting motor behavior at boundary conditions that I didn’t test and correct for. Since I chose to use 16-bit signed calculations, the resolution isn’t as great as it could be, but again, it works. Experiment with the settings to see what happens. You may wish to change the program to make it implement a positional servo mechanism instead of one controlling motor speed. It can be done! I will leave this as an exercise for the student. You too can implement PID in your motors quite easily. However, I caution you — a PID algorithm of sufficient sample speed will take over your microcontroller if it is a low speed device. I recommend that you implement PID on a dedicated microcontroller and talk to it via a serial connection like this one or SPI or even I2C so that your main computer can set its “mind” to higher things that you want your robot to be doing. I hope that you’ve learned something this month. As usual, I can be reached for questions, comments, and criticisms at
[email protected] and I’ll be happy to work on it! Until next time, keep on building those robots! SV
Full Page.qxd
10/7/2008
11:43 AM
Page 17
email:
[email protected]
NOV08NewProd.qxd
10/8/2008
9:54 PM
Page 18
New Products
N E W P RO D U C T S ROBOT KITS
KicCrad
1
SORC Technologies, LLC (pronounced “one source”) announces the release of its premiere product, the KicCrab walking crab robot kit. This kit is one of the most complete robot kits on the market today, combining the three basic components of robotics (mechanical engineering, electronics, and programming) to create the ultimate robotics experience for both the advanced and beginner robotics enthusiast. The KicCrab is based on the popular three motor walker design and utilizes tiny R/C airplane servos which can be precisely positioned for controlled walking. Many hours have gone into the design to make it both appealing and functionally balanced for great performance. All structural components are cut from light but durable expanded PVC plastic. Kits are available in four colors: red, yellow, green, and blue. The functional electronic circuit board is printed on colored boards to match the crab colors. When complete, the circuit board becomes the curved shell of the crab, giving it a unique character while maintaining a robotic look. This versatile board is also equipped with extra ports for the addition of an IR demodulator for remote control, I2C peripherals, IR sensors, tactile sensors, temperature sensors, and light sensors, as well as a modulated IR output for communications with other crabs or for annoying your family by changing the channels on your TV. The KicCrab offers USB programming via onboard USB to TTL conversion. It also has a state-of-the-art onboard Lithium Polymer battery charging circuit that charges and manages the KicCrab’s battery using PC power through the USB connection. The kit includes the battery, which should last the lifetime of the robot. The KicCrab also includes the KicChip™ processor and the intelligently designed KicStudio™ programming environment. This system provides an outstanding
18
SERVO 11.2008
solution for those who haven’t yet mastered the skills of programming. Using a flowchart-style programming interface, even the most inexperience programmer can be using his KicCrab in no time. The chip can also be programmed in the Basic language for the more experienced programmer. Those wishing to learn Basic can program using the flow chart style and watch as it’s translated to Basic in real time. The assembly of this kit requires a skill level of 5 and therefore may not be suitable for children under the age of 15. Kits are available online for $79.95. For further information, please contact:
1SORC Technologies
Web: www.1sorc.com
EDUCATION New Robotics Curriculum
I
nnovation First, Inc. (www.innovationfirst.com), and Autodesk, Inc. (www.autodesk.com), have teamed up to offer a new robotics curriculum package. It is primarily intended for classroom use, but it includes some features that should make it appealing to the home hobbyist, as well. Autodesk has been around for years, providing 2D and 3D design software to manufacturing, construction, and other markets, and its contribution is based on the Autodesk Inventor package, which is used by many professional robotics engineers. Innovation First is kicking in its VEX Robotics system, which is already used in more than 2,000 classrooms. The result is the new VEX Classroom Lab Kit, which “provides a custom solution for robotics education that is flexible enough to be applied at multiple grade levels, including secondary and post-secondary.” The basic $699 package contains a set of 17 units, each of which contains a separate lesson, concept, and activity. For a list of included hardware and options, visit www.vexrobotics.com/vex-education.shtml. The Lab Kits make it easy to bring VEX Robotics into the classroom while making budgets go farther. Turn-key bundles of essential classroom equipment make it easy to order while saving money. The Classroom Lab Kit which is ideal for two to five students. This bundle includes everything needed to design, build, power, and operate robots. Increase the challenge level by adding expansion kits for advanced sensors, drive systems, and pneumatics. For larger classes, add kits for every
NOV08NewProd.qxd
10/8/2008
9:55 PM
Page 19
additional two to five students. Bundled kits are ideal for the beginning VEX Robotics engineering lab and include popular accessory items. Turn-key discounted bundle includes: • • • • • • • • • • • • • • •
Protobot Robot Kit Microcontroller Transmitter and Receiver Additional Servo Bumper Switch Kit Limit Switch Kit Advanced Gear Kit Chain and Sprocket Kit PWM Cable Bundle (4) Safety Glasses Inventor’s Guide Tank Tread Kit Booster Kit w/Additional Metal, Gears, and Hardware 7.2V Robot Battery and Charger 9.6V Transmitter Battery and Charger For further information, please contact:
Innovation First, Inc. and Autodesk, Inc.
Website: www.innovationfirst.com www.autodesk.com
applications. Wheels can be mounted one, two, or even three wide. Mounting two or three wheels to the same hub gives the flexibility of creating wider tread or mixing different durometers. Custom hub solutions are available subject to minimum quantity orders (typically starting at 500). For further information, please contact:
BaneBots, LLC
WHEELS New Line of Wheels and Hubs
B
aneBots has a newly released line of wheels and hubs specifically designed to provide a simple, lightweight, durable, low cost method of mounting a wheel on just about any small motor or shaft. Constructed of a thermoplastic rubber tread bonded to a polypropylene core, they provide excellent traction. The wheels are available in eight different sizes ranging from a small 1-3/8” diameter (weighing only 1/4 oz) up to a relatively large 4-7/8” diameter. Treads are available in various durometers including soft 30 Shore A green tread, medium 40 Shore A orange tread, and relatively hard 50 Shore A blue tread. Standard low profile hubs and bushings are available supporting shaft sizes from 2 mm upto 1/2” in both drive wheel and caster
520 W 67th St. Loveland, CO 80538 970•461•8880 Fax: 970•461•8771
Show Us What You’ve Got! Is your product innovative, less expensive, more functional, or just plain cool? If you have a new product that you would like us to run in our New Products section, please email a short description (300-500 words) and a photo of your product to:
[email protected]
SERVO 11.2008
19
Events.qxd
10/8/2008
9:27 PM
Page 20
Send updates, new listings, corrections, complaints, and suggestions to:
[email protected] or FAX 972-404-0269 Know of any robot competitions I’ve missed? Is your local school or robot group planning a contest? Send an email to
[email protected] and tell me about it. Be sure to include the date and location of your contest. If you have a website with contest info, send along the URL as well, so we can tell everyone else about it. For last-minute updates and changes, you can always find the most recent version of the Robot Competition FAQ at Robots.net: http://robots.net/rcfaq.html
walking robot race, Photovore, Search and Rescue, and an Art and Innovation contest. www.robotgames.ca
24
Hawaii Underwater Robot Challenge Kahanamoku Pool, UoH at Manoa, Honolulu, HI Timed, multitasking tethered mission. www.marinetech.org/rov_competition
29
FIRST LEGO League of South Africa Championship Sci Bono Science Center, Johannesburg, South Africa FIRST LEGO League events. www.fllsa.org.za
TBA
South’s BEST competition Beard-Eaves Memorial Coliseum, Auburn University, Auburn, AL Different each year, see website for details. The listed date is for the state-wide championship contest. A month earlier, the various teams have regional contests and the winners go on to compete at the state-wide competition. BEST is very similar to the FIRST contest except that in the BEST event, teams of students build robots from standardized kits with only minimal guidance from their corporate sponsors. www.southsbest.org/ or www.bestinc.org/
— R. Steven Rainwater
N ov e m b e r 1
15
Bloomington VEX Tournament Ivy Tech Community College, Bloomington, IN Events include Top-It-Off-2, Pythagorean-2, VEX Tractor Pull, and a CAD Design Contest. http://robotics.bloomington.googlepages.com ROBOMO Expo Indian Trails Public Library, Overland, MO This year’s ROBOMO will include demonstrations of mini-Sumo, line-following, mini-Magellan, and robot soccer. All robots are welcome. There will be door prizes and a Chinese food buffet afterwards. www.robomo.com
21-23 All Japan MicroMouse Contest Tsukuba, Japan Includes Micromouse, Micromouse Expert level, and Micro Clipper events. www.robomedia.org/directory/jp/game/mm_ japan.html
22
Roaming Robots Grand Final Kent, UK “Robots” (RC vehicles) attempt to destroy each other. www.roamingrobots.co.uk/events_ calendar.htm
December 4-31
ROBOEXOTICA Museumsquartier, Vienna, Austria Robots are tested on serving cocktails, mixing cocktails, bartending conversation, lighting cigarettes/cigars, and other achievements in electronic cocktail culture. www.roboexotica.org/en/acra.htm
5
Robotex Tallinn University of Technology, Tallinn, ESTONIA www.robotex.ee
22-23 Canadian National Robot Games Ontario Science Centre, Toronto, Ontario, Canada Lots of events including Mini-Sumo, full size Sumo, fire-fighting robots, line-following, a
20
SERVO 11.2008
17-21 IROC International Robot Olympiad Kuala Lumpur, MALAYSIA www.iroc.org or www.iiu.edu.my/ICOM/2008
TwinTweaks-Nov-edited.qxd
10/6/2008
3:30 PM
Page 21
THIS MONTH:
Surveyor’s Travels FIGURE 1.THE SURVEYOR.
T
he folks at Inertia Labs may have forever earned a celebrated place in the memory of combat robotics fans with their formidable and uplifting creations like Toro, but Alexander Rose and Reason Bradley have also put their energies into other, less destructive projects. One of their new endeavors at Inertia Labs is as a designer and distributor for the new quad motor Surveyor SRV-1Q from Surveyor Labs — a nifty little treaded robot outfitted with a high quality camera. Perhaps the most distinctive detail about the SRV-1Q is that it allows you to do your surveying autonomously or over a wireless network. How cool is that? With that most tantalizing detail about the Surveyor robot and its capability to be controlled wirelessly over the Internet, we were excited to see what this web savvy robot had to offer.
Let Your Robot Do the Walking The Surveyor robot can be acquired in pre-assembled form, or it can be bought as a kit that needs to be put together. We received the already built version, but we also
received the base kit so that we could make another bot. Two bots in one article is a bit too crowded, so the project base will have to wait for another month. At first blush, it is evident that the Surveyor is one sophisticated bot. The tough rubber treads give the bot a rugged feel, and the solid frame constructed from thick plastic and machined aluminum is like Chuck Norris walking into High Tea. The elegant exterior hides four DC gearmotors with a 100:1 gear reduction that gives the robot both hefty torque and considerable zippiness. The robot is also quite well equipped in the sensor department. A high quality camera takes center stage on the face of the bot, and it is flanked by laser pointers for range finding. And in case those sensors don’t make the bot aware enough for you, the fancy printed circuit boards (PCBs) have ports for additional sensors like ultrasonic range finders. The robot comes with an antenna and a charger that imbues it with over four hours of battery life. A clearly labeled switch at the back of the bot labeled ON, OFF, and CHARGE is also a comforting sight. The robot radio is
Lantronix Matchport 802.11b/g WiFi, and the robot can be teleoperated from a distance of 100 m indoors, and up to 1,000 m with a line of sight. The bot makes use of three layers of PCBs (Figures 2, 3, and 4), but with the plastic headpiece holding down the camera, the lower boards are fairly difficult to reach. That, however, shouldn’t be a major concern. The topmost PCB on a fancy red wafer is what will intrigue most tinkerers, because it is this board that possesses the spare ports for additional sensors and other flights of fancy. And to top it all off, the red PCB is graced by the presence of a nice Blackfin processor.
One Fish, Two Fish, Red Fish, Blackfin The Blackfin processor from Analog Devices debuted circa 2001, and it is designed specifically to support open source operating systems like Linux. This is great news for tinkerers of a programming persuasion, but the descendant of the SHARC processor has something to offer to more mechanical hobbyists, as well. The Blackfin was designed to SERVO 11.2008
21
TwinTweaks-Nov-edited.qxd
10/6/2008
3:31 PM
Page 22
Twin Tweaks ... FIGURE 4
FIGURE 2
FIGURE 3 something that is a much better use of one’s money than the newest gaming console.
My Robot is More Well-Traveled than Your Robot We were eager to test out the capabilities of the SRV-1Q, but the idea of tackling a robot without the comfort of a software CD did seem a little daunting. We wanted to get an idea of the bot’s capabilities and limitations before we tackled it ourselves, so we looked to the place where any roboticist would look if they were in the same situation – Australia! A fun showcase of the Surveyor robot’s abilities comes from a somewhat unexpected place – the folks at the Australian branch of the energy company British Petroleum. The BP Explorer is a website that allows users from all over the world to drive a Surveyor robot around a diorama of a cityscape and the surrounding countryside. Not only is this a cool way to
FIGURE 6
22
SERVO 11.2008
FIGURE 7
create a platform where applications including sound, video, and signal processing could be integrated without sacrificing the performance of any single application. A project that combines video and other signal processing sounds a lot like a camera toting robot – how fortuitous! And to top it all off, the Blackfin cuts through the waters of signal processing with the utmost energy efficiency. The Blackfin processor on the SRV-1Q handles the camera (Figure 5), which is an Omnivision OV9655 1.3 megapixel sensor. For those of us that don’t structure our thoughts with spec numbers, that basically means that the bot is outfitted with a nice color camera. The SRV-1Q seems to be nothing but quality through and through, and you get what you pay for. The bot comes with a price tag of a little under $500, which really seems quite reasonable given the caliber of the robot. A fine chassis, robust motors, a stunning camera, an able processor, and more software than one could shake the proverbial stick at all seem like excellent justifications for
demonstrate the wireless capabilities of the Surveyor, but there is also something intangibly empowering about controlling a robot that lives in another continent. The project also earns kudos for the camera on the Surveyor, which gives a clear color picture of the surroundings that is detailed enough to read model billboards scattered around the environment that offer clues to a secret message. Why would these intrepid bots be given a playground by an energy company, anyway? Apparently, the demonstration is meant as a way to spotlight the company’s environmental initiatives. The SRV-1Qs in the BP Explorer all run off of batteries that are charged with BP solar panels. For that reason, the bots only run during the daytime (in Australia). When the website debuted, the little bots were so popular that the waiting time to use one of the five was several hours. When we surfed the website, however, there was no wait time at all and we were able to drive around at our leisure. After a couple of rounds, we felt that we had become sufficiently acquainted with our robot’s Australian cousins, so we turned back to the home front with renewed excitement and pride in the capabilities of the robot. We personally think it is a great thing to see the adventuresome bot involved in the environmental cause, especially when it takes the form of a fun and FIGURE 5 interactive game.
TwinTweaks-Nov-edited.qxd
10/6/2008
3:32 PM
Page 23
Surveyor’s Travels
Even Robots can have Dog Day Afternoons After our international adventure, we were even more excited to tackle our SRV-1Q. Even with the SRV-1Q in pre-built form, there is some minimal assembly required. All you need to do it attach the antenna to the bot, and while this might sound like a trivial task it turned into something much more dramatic. Normally, the antenna should just screw into place near the stern of the robot, but our parts had a bit of a compatibility problem (Figure 6). The connector on the antenna and the connector on the bot were both male, with the connector pins to prove it. It was only a minor setback, and after a quick trip to our favorite electronics shack we were ready to proceed. We acquired a male-to-male connector (Figure 7), but we hoped that the extended length of the connection wouldn’t interfere with the bot’s nifty treads. To begin the process, we screwed the new connector into the one on the antenna. When we weren’t sure if it was fitting nicely, we unscrewed the male-to-male connector, and we were surprised to see the pin from the antenna come with it. And with that, our problem had been solved, and the antenna screwed onto the robot just as it should have. We were assured by the folks at Surveyor labs that this mix-up only occurred in a small number of kits, but if you were to run across one of
them you can perform a much quicker fix than the one we did. The pin in the connector on the antenna came out so easily because the connector was socketed and it wasn’t soldered to a wire. Since this is the case, some needle-nosed pliers can be used to simply extract the pin with no ill effects. With the assembly of the robot finally finished, we let the little bot charge up its Li-poly battery pack before we made our first attempt at teleoperation.
Smooth Teleoperator Don’t be fooled into thinking that the SRV-1Q doesn’t come with any goodies just because it doesn’t come with a CD. The bot comes equipped with some handy firmware that makes wireless operation over the computer a snap. To get everything fully configured, you’ll have to visit the Surveyor website (www.surveyor.com). The Surveyor website provides clear and concise instructions on how to get started with your bot. There are a plethora of software applications to choose from, but we went with the highly recommended Java console. The Java console can be downloaded for free, and after the generic installation procedure you’ll have a screen pop up as in Figure 8. After opening the console, the next task was to connect to the robot’s wireless network (Figure 9). An “SRV1” network conveniently popped up, and connecting was no
problem. After we were connected, the mysterious purple smear on the Java console was replaced by an image of our dorm room desk. While this might seem random, it was because the robot was looking at our desk. Before we could officially get to playtime, we had to configure the Matchport connection for easy access. This actually involves a somewhat lengthy process, but roboticists are carefully guided through the steps with generous screenshots and clear directions. With all of the network nuts and bolts taken care of, we were ready to get going (Figure 10). Some of the controls on the Java console are pretty straightforward. Directional arrows control the basic movements, while a familiar red octagon causes the bot to freeze in its tracks. Some controls, however, are a bit more enigmatic. Buttons labeled fast and slow can control the motor speed of the robot, and the different sized rectangles on the right side of the console can change the resolution of the screen. Don’t think that you could get a huge screen for nothing though – there’s a corresponding trade-off in frame rate. In addition to the screen with the mysterious button, the command prompt window also pops up with the Java console (Figure 11), and it provides even more enigmatic feedback that is sure to delight programmers. Driving around our own SRV-1Q was quite like our experience with the Australian robot, but without the lag
FIGURE 10
FIGURE 8
FIGURE 9
SERVO 11.2008
23
TwinTweaks-Nov-edited.qxd
10/6/2008
3:36 PM
Page 24
Twin Tweaks ...
FIGURE 12
FIGURE 11 time. The scenery of the miniature cityscape was replaced by the scenery of our dorm room. The quality of the camera image was stunning, and the treaded robot was also deceptively zippy. One important caveat, however, is that the robot will continue to move in the direction specified until another command is given. We figured that the driving would be like that of the Australian bot – pressing a directional button would cause the bot to move in that direction for a time proportional to the time that the button was pressed. This was not the case, and the unexpected learning curveball caused the over-eager robot to crash into a wall. Thanks to its robust construction, no damage was inflicted, but we were more careful from then on out. After a bit of practice, the driving becomes a bit more intuitive, but slower motor speed is definitely helpful for navigating obstacle-laden areas and for enjoying the scenery. The frame rate of the camera is also admirable, because it is good enough so that surveying your space doesn’t become a motion sickness inducing blurry mess. The robot even has a built-in
software module that allows several computers to view the output from the camera, so your robot can have a nice audience as it surveys the land.
Your Telepresence is Requested For those who can study a robot’s behavior like a patient naturalist and determine how the bot could be improved, the Surveyor website also offers the source code for the Java console (which is open source). The site even encourages tinkerers to mess around with the code and share their improvements. In addition to the Java console, there is also a Python console (also open source, of course), and the website has links to all of the most popular third party software like Roborealm and Microsoft Robotics Studio. The popular platform Roborealm can be acquired for free at www.roborealm.com. The download was quick and painless, and soon we were ready to see what else the SRV-1Q had to offer (Figure 12). The Roborealm program sports an interface that looks fairly intimidating, even if only because it has such a plethora of options for image
processing. There are options for edge and blob detection, and also a myriad of other things to keep even the most technical of tinkerers occupied for days on end. Some of the options give some quite interesting images, from the minimalistic skeleton to the unflattering Sobel edge convolution (Figure 13) to the trippy Canny edge detection method (Figure 14). You can even turn the object of your robot’s attention into a cartoon using the whimsical Kuwahara variance filter (Figure 15). For all of those folks unfamiliar with the refined mathematical techniques of image processing (ourselves included), the numerous methods presented by Roborealm are a great motivation for some intellectual development. You can drag your cursor over each option for a very brief description, but this will probably only serve to whet your intellectual appetite. You’ll be asking yourself why the Sobel edge convolution creates such a scary picture, and a little research will reveal that the Sobel method analyzes the image gradient and takes the areas of highest gradient as the likely edges of the image. Then, you have to look up what an image gradient is, and you’ll find out that it is a gradual blend of colors that changes in discretizable steps from low values (white) to high values (black) of color. Then you’ll want to learn about the trippy Canny method, and the wonderful floodgates of curiosity will have been officially opened. After an exciting whitewater ride, you’ll find that you are much more well-versed in the subtleties of image processing than you were before.
FIGURE 15
FIGURE 13
24
SERVO 11.2008
FIGURE 14
TwinTweaks-Nov-edited.qxd
10/6/2008
3:36 PM
Page 25
Surveyor’s Travels But just in case image processing isn’t your cup of tea, the Surveyor can also run autonomously using interpreted C programming. Programs are stored in Flash memory. There are special robot commands and the protocol is also available on the website. The robot-specific commands even include those for a “wander mode” and a “swarm mode.” There are entertaining videos on the website that demonstrate these. And, as you might have guessed, there is also sample code that can be acquired through the website, and — by extension — the community of SRV-1Q users that frequent it.
design to reality. The open source mentality seems to have been truly adopted by the folks at Surveyor, with all of the shared software, hacks, and enthusiasm for creating a better and more interesting product. The Surveyor Labs website features a link to a video about the Google Lunar X Prize that talks about the new contest to send a robot to the moon tasked with photographing
the Lunar Lander. With all of the promise shown by the SRV-1Q and the impressive community that is growing around it, we wouldn’t be surprised to see a robot like it end up on the moon someday. SV
Special Thanks to Zander Rose and Reason Bradley of Inertia Labs and Howard Gordon of Surveyor Labs.
Open Source Opening Doors Perhaps the most exciting things about the SRV-1Q are the possibilities. In the space of this article, we have hardly even scratched the surface of this bot. It can run autonomously, it can archive the video it takes, you can even get a bunch of SRV-1Qs together to make a swarm. The bot can be expanded with more sensors, and it can even be given “stereo vision” with the addition of another camera. Hacks like stereo vision and other things that score highly on the cool factor scale are all shared on the Surveyor Labs website, and a Robot User Forum encourages hackers and hobbyists to share their latest projects. All of the possibilities are made reachable because the bot is open source. Not only can tinkerers mess around with the source code, but schematics and other diagrams of the robot are also freely available. Users can even download a Solidworks 3D model of the SRV-1Q from the website so they can truly get an idea of how this robot has progressed from
For more information, go to: www.surveyor.com www.bpexplorer.com.au/ www.roborealm.com www.analog.com www.cyberbotics.com/ http://msdn.microsoft.com/ en-us/robotics/default.aspx
Experience a Faster Way to Search for Components! Jameco Electronics’ new catalog and enhanced Jameco.com website are two tools that are designed to work together to give electronic professionals faster access to the hottest components in the industry. Color coded references throughout the catalog assist you in analyzing a wide range of brand choices (from franchise sourced to house brands to factory overruns) offering you more pricing options than you'll see anywhere else.
Web codes allow you to quickly jump from catalog to website to view additional specifications, application notes, photos and more products. You'll find exactly what you're looking for without having to wade through hundreds of thousands of products on a complicated website or wielding a twenty pound catalog. With a flip of the page or a click of the mouse, you have all the tools you need at your fingertips. Reach for Jameco first and order your catalog today.
Order your web-enabled catalog today!
Call 1-800-831-4242 or Visit www.Jameco.com/Speed for the ride of your life!
SERVO 11.2008
25
CombatZone-edited.qxd
10/7/2008
3:36 PM
Page 26
Featured This Month: Features 26 BUILD REPORT: 30 Pound Combat Robot — Mitch by Ray Billings
28 MANUFACTURING: Even More Things to Consider When Building a Fighting Robot by Mike Jeffries
33 PARTS IS PARTS: Chain Length Calculator and Chain Path Visualizer by Kevin Berry
35 A Brief History of WAR by Robert Farrow
Events 30 Aug/Sep 2008 Results and Nov/Dec 2008 Upcoming Events
31 EVENT REPORT: Robot Battles 2008 by Charles Guan — Team Test Bot
ROBOT PROFILE – Top Ranked Robot This Month: 34 Limblifter by Kevin Berry
26
SERVO 11.2008
BUILD REP
RT
30 Pound Combat Robot — Mitch ● by Ray Billings
F
requently at events, I am reason this bot couldn’t have inundated with questions on been built with a simple drill how to get started in combat press, or even a hand drill and robotics. I’m always honored by basic hand tools. Most of the the requests, and enjoy the material used was inexpensive, enthusiasm that potentially new as well. And the best part: This builders bring to the sport. But machine was very effective, due to the violent nature of winning the 30 pound division at some of my more high-powered the 2008 RoboGames event; creations, I always feel hesitant to going undefeated in the class. tell a 10-year-old how to build a I started out with four of the heavyweight spinner! I usually basic 20:1 36 mm planetary gear recommend something simpler to motors from Banebots. They are start out with — like a wedge — only 1.5” tall, allowing me to but up until recently, I didn’t have create a very low profile robot an example of my own to display. and still have decent power. Well, all that changed for the RoboGames event this year. Introducing Team Hardcore’s first wedge bot: Mitch. Mitch was created almost completely from off-the-shelf parts and, although there were some areas that were machined specifically for This is Mitch, after winning the 30 pound class at RoboGames. You can see some of the scars on the assembly, there is no wedge from all the action.
CombatZone-edited.qxd
10/7/2008
3:37 PM
Page 27
Paired with the new wheels that Banebots just released, this made for a relatively inexpensive and responsive drivetrain. I also used the bearing blocks that Banebots sells to support the drive shafts. I ended up shortening the This is the view of the shock mounting from the output shafts of the gear underside. I used three rubber standoffs on each end. These really helped a lot to isolate the bot motors about half an inch from the big hits, and I credit a great deal of our to fit into this design. The success with Mitch to these isolators. wheels extend out both the bottom and top equally, allowing custom fan arrangement in the the bot to drive inverted. future. Radio control was provided For battery power, I wanted by a Spektrum DX6 transmitter something simple and didn’t want coupled with the BR6000 receiver. to overvolt the motors too much. A 2.4 GHz system such as the Overvolting is a very common Spektrum (or some other nonmethod for improving the power frequency dependant system) is a output of a DC motor, and frequently requirement for combat events at combat builders will double (or the RoboGames. Many competitions more) the rated voltage of a motor still allow the 75 MHz systems, so to get maximum power. But I this isn’t mandatory everywhere, but wanted this machine to be if you are new to this sport and dependable, with the least amount want to get equipment that you will of maintenance needed as possible. be using for the foreseeable future, For that reason, I went with some I highly recommend some form of four cell lithium polymer batteries, spread spectrum system. Make sure for 14.8 volts. The motors are rated you get a receiver that correctly for 12V, so I felt this was a good failsafes on all channels, such as the compromise between reliability and BR6000. There are some systems power. I used a pair of 2200 mAh that only failsafe on the throttle batteries from Hobby City. channel. The remaining electronics For speed control, I used the in the system are a small battery standard for most of the larger eliminator circuit from Park, and the weight categories: the Victor 883 smallest main power switch sold by units from IFI Robotics. Since these Team Whyachi. A list of the parts are rated for 60 amps continuous at used is included here. 24 volts, I felt I could run them at The front and side rails are 2” the lower voltage (and probably tall by 1” thick 6061 aluminum. I nowhere near the maximum amps) could afford to use such thick without the fans. This was necessary material since the bot was going to due to the extremely low clearance be very compact and I would not inside the bot. There were few problems with this setup, although we never actually stalled the drivetrain, which I suspect would be an issue if this ever happened. I may consider making some kind of
This is an overhead view of the bot with the titanium panel removed.
have to worry about weight. The back rail in Mitch was actually 1” thick UHMW, although there would have been no reason I couldn’t have used more of the aluminum in its place. The truth is, I had the UHMW laying around. Sometimes the right part is whatever junk you have on hand! Top and bottom plates are identical, and were made from 1/4” Lexan. This was also a matter of convenience, since it was also material I had on hand. I had considered using some thinner titanium in constructing the top and bottom plates, but the Lexan made for a quick and easy build. For the final combat-ready machine, I ended up making an extra titanium plate to place on top of the top Lexan plate to protect the internals. I machined in a .25” recess around the inside of the frame rails, so that the top and bottom panels were set into the rails. This was the only step that required any fancy machining equipment, but could have easily This is a view of the interior with all panels removed, showing the layout. You can pretty much see all of the components. The block of foam towards the top houses the receiver and battery eliminator.
The bolt holes for the motors were countersunk. This certainly isn’t required, since the clearance top and bottom was more than sufficient for the bolt heads to stick out. I simply didn’t want an opponent to be able to “catch” a bolt head that was attached to the motor/gearbox assembly and possibly damage it.
SERVO 11.2008
27
CombatZone-edited.qxd
10/7/2008
3:38 PM
Page 28
providing these as a guide to making a simple and effective combat robot which you can copy exactly or modify as you see fit. The frame and drivetrain minus the The wheels from Banebots get fantastic traction, but wedge weighs in at they are very soft rubber and wear quickly. Buy spares! about 15 pounds, giving and bottom plates match the plenty of weight for any extras you exterior dimensions. The only may feel like adding. Our wedge critical dimension was to make weighed in at ~12 pounds, giving A more close-up view of the speed controllers. I have used some zip strips to try to manage sure the distance from the top to us a combat weight of slightly less the mess of wires that invariably comes from wiring a bot. Don’t be afraid to tie bottom plates was 1.5” to than 27 pounds.The wedge on down everything that you think will move correspond to the height of the Mitch is constructed of .25” 4130 around. Nobody will ever give you a bad time after you’ve won a match and tell you motors and bearing blocks. steel, which was cut and welded that you have too many wire ties! Available on the SERVO website into the final shape. A big part of been avoided if needed. You could (www.servomagazine.com) are Mitch’s success is due to the shock simply use 1.5” tall aluminum for the AutoCAD drawings (and PDF mounting I used for the wedge. A the frame rails, and made the top files for those without access to wedge that is more than 1/3 the AutoCAD) with the specifications on bot’s weight is obviously substantial Mitch’s construction, not including for the class, but the shock mounts the wedge mounts. With 1” thick really helped isolate the chassis of aluminum across the front and the bot from the big hits from all sides, there is plenty of opportunity the nasty spinners in the 30 pound to mount a wedge in almost any weight class. The rubber isolators fashion you would like. I am are the only item I cannot find you a link to the exact part I used. I For a simple, quick, and cheap locating bought these surplus years ago and method for the wheels, I simply stacked washers on each side of the wheel. This kept like most surplus items, once they the wheel centered in the wheel opening, but allowed some side to side movement of the are gone you can never find them wheel on the axle. again. McMaster-Carr sells many rubber isolation mounts though, so Parts List you can find similar items, such as ITEM SUPPLIER LINK their part #9376K39. Mitch proved • Drive motors http://banebots.com/pc/MP-36XXX-545/MP-36020-545 to be a tough little machine, and • Wheels http://banebots.com/c/WHB-KS3-298 was a blast to build and drive. Top • Bearing blocks http://banebots.com/pc/MOTOR-ACC/PB-S3751-BB speed was manageable at around • Batteries www.hobbycity.com • Speed controllers www.robotmarketplace.com/products/IFI-V883.html 8 mph, and was easily controlled. If • Power switch www.teamwhyachi.com/MS1.htm you have any questions on the parts • BEC www.robotmarketplace.com/products/0-PBEC1.html and materials used, I can be reached • Radio www.robotmarketplace.com/products/0-SPM6600.html at
[email protected]. SV
MANUFACTURING: Even More Things to C nsider When Building a Fighting Robot ● by Mike Jeffries
I
n previous issues of SERVO, I’ve talked about weapon and drive
28
SERVO 11.2008
systems in robot combat. There are a lot of important things to consider
that don’t fit under either of those umbrellas but still merit considera-
CombatZone-edited.qxd
10/7/2008
3:39 PM
Beta uses chain drive to power its electric hammer.
Page 29
Checkmate uses a strong baseplate for component mounting.
Crocbot uses car style steering to maneuver in the arena.
tion when building your bot.
Car vs. Tank Steering Most robots use tank steering, which is where each side of the drive system can go forward or backward independently allowing the robot to go forward, backward, or turn in place. Car steering works just the way it sounds. The robot will drive like a large, metal remotecontrolled car. One common point of confusion in tank steering is turning while reversing. With the way tank steering works, when you’re turning left from standing still, the right side wheels are going forward and the left side wheels are going backward. When you’re turning left while moving forward, the right side wheels are spinning faster than the left side in the forward direction. When going in reverse, however, the left wheels are spinning faster backwards than the right, causing it to rotate to the left while moving to the right.
External vs. Internal Wheels Internal wheels are better
protected and able to be supported on both sides. External wheels will prevent the robot from being hung up on a competitor’s armor if it gets lifted off the ground. External wheels can be hit easily by the opposing robot’s weapons and are subject to many more direct impacts. Which option is best depends on both the design of the robot and which features are most important to it.
Belts, Chains, and Gears You’ve got to get the power from your motors to your wheels and weapons somehow. Belts, chains, and gears are your three options if the motor can’t have the wheel or weapon attached directly to it. Belts are fairly lightweight and can transmit power over large gaps. There are multiple types of belts to choose from but most use tension and friction to provide enough grip on the pulleys on each side of the system to transmit power. Chains are stronger and heavier than belts, but serve essentially the same function as belts. They
Grue uses tank style steering to maneuver in the arena.
transmit power from one shaft to another over a gap. Chains need to be aligned more precisely than belts due to their inflexibility. If they are not aligned well, the chain is likely to fall off or break. Gears require the highest precision of the three options and are also able to be the most efficient. They are not, however, able to span the same distances that belts or chains can. Tight tolerances and proper pitch selection can result in a nearly indestructible power transfer system, however, if the pitch is too small or the gears are too loose or tight, you’re just asking for catastrophic failure.
Chassis At the core of every competitive robot is a strong chassis. It doesn’t matter how powerful your spinning weapon is or how high your arm can flip other robots if the chassis can’t handle the forces that act on it both internally and externally. A small number of construction methods make up the majority of combat robot chassis today. The first method is to use square, tubular, or right angle metal Stewie has an aluminum unibody chassis.
Sewer Snake has external wheels.
SERVO 11.2008
29
CombatZone-edited.qxd
10/7/2008
3:40 PM
Page 30
Tillah uses belts to power its spinning drum.
Totally Offensive uses gears to drive around the arena.
Storm II has internal wheels.
beams to form a strong skeletal chassis. Armor and components are then mounted to the chassis. This arrangement allows for easy replacement of damaged armor and components, and easy access at any angle. The main downside of this type of chassis is that unless it’s very carefully designed it will be heavier than the other chassis styles. The second type of chassis uses the frame itself as armor. Instead of working like a skeleton, this chassis functions more like the shell on a crab. A strong outer body with rigid internal supports holds all the parts and provides for a very strong
defense. This style tends to be lighter than a skeletal chassis but often leads to difficulty in replacing or accessing parts. The third type of chassis functions similarly to the second, but relies on a strong base plate for component mounting. The armor normally is a shell that can be completely removed for easy access to most of the components. The one difficulty with a chassis like this is making it strong enough to hold up to combat while keeping the weight low. These are only a few of the most popular chassis styles. There are more options of varying complexity and many hybrids of the three mentioned that have seen success in robot combat.
Armor Choosing the right armor is often the difference between winning and losing in robot combat. Do you go with the stronger, heavier steel? Do you choose the light, but easily cut polycarbonate?
Village Idiot has a skeletal chassis.
Perhaps aluminum or titanium armor is a better fit for the job. You are not limited to a single choice in armor. Often robots will be heavily armored in areas the builders think will be subject to the most stress and have something that acts essentially as a dust cover for less vital areas. When choosing which material, how much, and where, you should look at the robots you’ll likely face. If there are very few robots with hammer weapons, top armor is less of a priority. With most arenas in use today, there isn’t much need for thick bottom armor unless it is a structural part of your robot. Layering different materials can work very well in robot combat. Having a thin layer of a material resistant to cutting over a thicker impact resistant material that cuts easily can act to minimize the negatives while keeping weight and costs low. SV All photos courtesy of BuildersDB (www.buildersdb.com).
EVENTS Results and Upcoming Events Results Aug 12 – Sep 14, 2008
Upcoming Events Nov-Dec 2008
H
R
ORD Fall 2008 was held by the Ohio Robot Club in Strongsville, OH, on September 13th. Twenty-three bots were entered.
30
SERVO 11.2008
oaming Robots will hold an event in Maidstone, England on November 22nd.
A
ntweight Benelux Championship will be held by Dutch Robot Games in the Netherlands on
CombatZone-edited.qxd
10/7/2008
November 1st, and a large bot event will be held on November 6th.
3:41 PM
Page 31
R
obots Live will hold events at Reading on November
15th, and Birmingham on November 22nd. Please go to www.robots live.co.uk for more details. SV
EVENT REPORT Rob t Battles 2008 ● by Charles Guan — Team Test Bot
W
hat’s the second longestrunning robotic combat competition ever? It’s neither BattleBots nor Robot Wars. In fact, you have probably never even heard of it. It’s the Robot Battles series of events, which held its first tournament in 1991 and has been held every year since then at the Dragon*Con sci-fi and fantasy convention every Labor Day weekend in Robot Battles, the longest-running indie robot fighting event. Atlanta, GA. What has kept it going all these years is its complete weapons at home, because the disregard for everything a fights are open-air on a raised mainstream robot combat stage, sumo style. That means good competition holds dear. driving far outweighs your weapon The MC of the event is a former choice, and a fair percentage of radio disc jockey and newspaper matches are actually decided when editor that occasionally makes fun one robot simply careens off the of the audience (which has a stage. Robot MicroBattles, which disturbingly high proportion of began in 2003, caters to the Stormtroopers). The tournament smallest combat classes: the oneitself is half robots and half stand-up pounders and three-pounders. This comedy. The atmosphere is relaxed, tournament is enclosed-arena and and matches are often re-run just with the full set of Robot Fighting because the builders or audience League-approved weaponry allowed. members feel like it. The essence The level of destruction and energy of Robot Battles is that of robot is much higher. The audience loves combat before the glamour of shredded parts, flying sparks, and cameras, cash prizes, and minor pop culture icons. Thirty pound robots Jaws (right) and Vorpal There are two separate Bunny Foo-Foo (left) ensnare their weapons. tournaments at Robot Battles. The main tournament happens on Labor Day Monday — the last day of the convention — and is for 12 pound and 30 pound robots. The tournament is doubleelimination, and each match is best-two-out-of-three. Leave your high-energy kinetic
The 12 pound battle royale at Robot Battles 2008.
especially when one robot runs head-on into the floor hazard (a grinder-powered spinning rubber wheel with gratuitous protrusions) and is subsequently sprayed across the arena. For the 2008 event, 29 little ‘bots fought at MicroBattles and 20 large robots competed at the main tournament. The record number of small ‘bots necessitated running the tournament single-elimination, instead of the usual double in order to fit the event within its given time slot. The audience packed both events to standing-room-only levels, and the convention twice closed the large ballroom in which the main tournament was held because the
Überclocker (left) and Poulan Rouge (right) tangle in the 30 pound elimination rounds.
SERVO 11.2008
31
CombatZone-edited.qxd
10/7/2008
3:42 PM
Page 32
MC Kelly Lockhart entertains the crowd at the Robot Battles Tournament on Monday.
The small arena is enclosed by 1/4” polycarbonate sheet and features drop-out pits and a spinning wheel hazard.
number of people watching had exceeded the hotel’s fire code limit. The MicroBattles event on Sunday saw the first irreparable arena damage at any Robot Battles event, when the spinning wheel hazard was sheared off in the three-pound class Battle Royale. A solid slam by three-pounder Cloud of Suspicion broke the mounting hub off the wheel, sending it bouncing around the arena floor. Builders and audience alike were stoked, and the combat arena goes back to the shop for a completely new arena hazard to be debuted later this year. In a move that straddled the point intersection between confidence, arrogance, and insanity, Cloud of Suspicion’s builder strapped six pounds of dead weight on top of his robot and returned Monday to fight in the 12 pound division. This year’s event also saw the
introduction of a new design to the combat stage. The open stage format of the competition is particular well-suited to a grabberlifter type design; one which can manipulate the opponent by holding it completely off the floor, not merely breaking its traction. Yet, for as long as the event has run, nobody has built such a machine. This year, two grabber-lifter robots entered into the 30 pound class: Jaws, from Team Stingray, and my own entry, Überclocker. Jaws did well, advancing through the loser’s brackets after losing its first round to the eventual 30 pound class champion. Due to some poor design on my part, Überclocker was plagued with mechanical problems, and I had to repair the bot quite literally after every match. Despite losing after the first round, it was able to put on a good show for the audience by performing a few body
A clean gash in a 1 lb robot’s titanium front plow.
32
SERVO 11.2008
slams on opponents. The perennial winners returned again this year, with the 12 pound class final match a repeat of last year’s. Dale’s Homemade Robots swept all the categories at the Monday tournament, except for the 12 pound Battle Royale. Other historically successful teams including Blade Robotics and Evil Robotics also placed. Here’s the list of champions and runners-up: • First place 1 lb class: Gilbert, Team Meatheads • Second place 1 lb class: Misdirected Pedestrian, Team Meatheads • First place 3 lb class: Nuclear Kitten 5, Team Test Bot • Second place 3 lb class: Ringo, Evil Robotics • First place 12 lb class: Omegaforce 2, Dale’s Homemade Robots • Second place 12 lb class: Nicole Richie, Team Shenanigans
Overthruster knocks Jaws off the stage using its innovative automatic flipper mechanism, moving on to take the 30 pound division championship.
CombatZone-edited.qxd
10/7/2008
3:43 PM
• First place 30 lb class: Overthruster, Dale’s Homemade Robots • Second place 30 lb class: Scimitar, Blade Robotics For 2009, the Robot Battles main tournament is moving to a larger ballroom to handle the increasingly large audience. With Dragon*Con hosting a Robotics program track specifically to introduce more people to robots and robot fighting, the competition is only going to grow larger and more intense. So, if you’re tired of the same old arena, consider coming to Atlanta over Labor Day weekend 2009 and checking out not only the Robot Battles competition, but Dragon*Con as a whole. If you are already attending
Page 33
the Con, and have (somehow) missed us for the past 18 years, then you know what to do next year. Here’s some resource links to get you started: • www.robotbattles. com is the event’s website. Look here for the rules, photo galleries, and online community. Make sure to join the email list! • www.dragoncon.org is the website of the hosting convention, Dragon*Con, your one-stop shop for any sort of science fiction, comics, fantasy, role-playing, anime, subcultures, and much more.
Überclocker holds Scimitar perilously close to the stage’s edge.
As a bit of interesting trivia: The oldest robot fighting competition — Critter Crunch — began in 1987 at the MileHiCon in Denver, CO. Robot Battles is a direct descendant of Critter Crunch, with almost identical rule sets. SV
PARTS IS PARTS: Chain Length Calculat r and Chain Path Visualizer ● by Kevin Berry
A
n endless source of information on bot building is the RFL forum on Delphi Forums (www.chief delphi.com/media/papers/1598). A recent thread had a great discussion about a software tool — Dr. Joe’s Chain Length Calculator, and the accompanying Chain Path Visualizer. This handy tool lets a builder input sprocket and chain data (up to 12 sprockets!) and out pops the geometry to build the rig. The Excel front end drives a macro called Goal Seek, that does loops of “what if” analysis to optimize the design. The outputs and a graphic visualize the answer, while the raw outputs are on other tabs. I haven’t built any chain driven mechanisms myself that would require this level of calculations,
but according to the folks on both forums (RFL/Delphi and Cheifdelphi), it’s both useful and accurate. Dr. Joe Johnson, the creator, has a few comments worth noting:
2) I move my “idler” up and down (or left and right) the amount I plan to build in to my adjuster so that I can tell if I can actually tighten the chain.
Alternatively, I use it to see if I “This is a tool I use to get my can swap sprockets and still tighten chain adjuster travels right and to my chain with the different ratio give my “gut” a chance to “see” the (this is a non-obvious calculation chain path before I commit to it in at times).” SV metal. It is not a perfect tool. It does not have any Dr. Joe’s Chain Path Visualizer. way to enter a slider, for example. Here is how I use it most often: 1) I lay out my chain path (counte-clockwise order around the chain).
SERVO 11.2008
33
CombatZone-edited.qxd
10/7/2008
3:44 PM
Page 34
ROBOT PR
FILE
TOP RANKED ROBOT THIS MONTH ● by Kevin Berry
Top Ranked Combat Bots History Score Weight Class
Bot
150 grams
VD
1 pound 1 kg
Limblifter – Currently Ranked #1
Ranking
Win/Loss Weight Class
Bot
Win/Loss
26/7
150 grams
Micro Drive
10/3
Dark Pounder
44/5
1 pound
Dark Pounder
23/3
Roadbug
27/10
1 kg
Roadbug
11/4
3 pounds
3pd
48/21
3 pounds
Limblifter
12/1
6 pounds
G.I.R.
17/2
6 pounds
G.I.R.
11/2
12 pounds
Solaris
42/12
12 pounds
Surgical Strike
19/7
15 pounds
Humdinger 2
29/2
15 pounds
Humdinger 2
29/2
30 pounds
Helios
31/6
30 pounds
Billy Bob
12/4
30 (sport)
Bounty Hunter
9/1
30 (sport)
Bounty Hunter
9/1
60 pounds
Wedge of Doom
43/5
60 pounds
K2
14/2
53/15
120 pounds
Touro
14/2
46/13
220 pounds
Original Sin
12/5
39/15
340 pounds
Ziggy
6/0
28/9
390 pounds
MidEvil
3/0
120 pounds Devil's Plunger 220 pounds
Sewer Snake
340 pounds SHOVELHEAD 390 pounds
MidEvil
History Score is calculated by performance at all events known to BotRank
Current Ranking is calculated by performance at all known events, using data from the last 18 months
Rankings as of September 14, 2008
L
imblifter has competed at Kilobots X, WBX-IV, Kilobots XI, and WBX-3. Details are: ● Overall configuration: Four wheel drive with lifting arm that can go 360 degrees around the frame. ● Frame: 1/4” UHMW-PE and
Historical Ranking: #6 Class: 3 pound Beetleweight Team: Team GuavaMoment Builder(s): Brendan McClure Location: Edmonton, Alberta, Canada BotRank Data Total Fights Lifetime History 18 Current Record 13 Events 4
1/16” garolite. ● Drive: 4x 20:1 25 mm Banebots gearmotors, FF-180 motor. ● Wheels: 2” Lectra Lite flites. ● Drive ESC: 2x Banebots 3-9 ESC. ● Drive batteries: 1320 mAh 7.4V Thunderpower Lipoly. ● Weapon type: 360 degree flipping arm. ● Weapon power: Same as drive. ● Weapon motor: 256:1 28 mm Banebots gearmotor, RS-385 motor. ● Weapon controller: Banebots 5-18 ESC.
34
SERVO 11.2008
Wins 15 12
Losses 3 1
● Armor: 1/8” 6061 Aluminum, 1/4” UHMW-PE. ● Radio system: Futaba 8U. ● Future plans: 60 lb version of Limblifter. ● Design philosophy: Know your strengths and weaknesses, and build accordingly. ● Builders bragging opportunity: #1 ranked Beetleweight on BotRank.com! SV Photos and information are courtesy of Dennis Beck. All fight statistics are courtesy of BotRank (www.botrank.com) as of September 14, 2008. Event attendance data is courtesy of BotRank and The Builder’s Database (www.buildersdb.com) as of September 14, 2008.
CombatZone-edited.qxd
10/7/2008
3:45 PM
Page 35
A BRIEF HIST RY OF WAR ● by Robert Farrow
W
AR has much of what you expect — flying shrapnel, destruction, winners and losers, but unlike real war, Western Allied Robotics competitions are always good natured fun. The organization currently has a 12 x 16 foot steel and polycarbonate arena capable of containing powerful 30 lb robots, but WAR had a much simpler start. A lot of early BattleBot builders came out of the Pacific Northwest. After the first season of BattleBots appeared on TV, a dedicated fan contacted several local builders to put on a robot demonstration at a regional science fiction convention. The builders had a great time showing off their robots and talking to people who were interested in getting involved. Near the end of the show, Brett Dawson of team UVGScorpion brought out two small robots and put them on the ground. One was a four-wheel wedge and the other was a horizontal spinner. He needed someone to drive the wedge robot so he handed the controls of the wedge over to me. Over the next five minutes, Brett and I battled it out with cheering crowds. As Brett schooled me on the fine arts of robot destruction, it was clear from the crowd’s reaction that the robots did not need to be big to generate the same excitement we had experienced at BattleBots. A small scale fighting robot competition was scheduled for April 2002 at Gasworks Park in Seattle. Brett built a 6 x 6 foot wood arena with polycarbonate walls to contain the robots. Having an actual arena to compete in made the event more than just talk or a dream; it solidified things and the race was on to design and build an effective robot for the competition. Computer scientists, artists, teachers, and students made up the group. Only about half of the original competitors had ever built or competed with robots before. Making things
even more challenging, robots had to weigh one pound or less. This was a few years before cheap, reliable speed controllers that would fit into such small robots became readily available. Even the experienced builders had to figure out how to make these things powerful but small. Luckily, there was an active online community to provide advice and guidance to anyone who was interested in building. People worked modifying RC toys and co-opting motors and electronics from RC airplanes and cars to build their creations. Well over a dozen robots competed in the first event with robots that ranged from remote control rats that could only turn left, to powerful spinner and wedge robots that were solidly built. The first event was such a solid hit with builders that everyone wanted to do it again, and soon. No one is sure of how the term “War Lord” came about, but it was the title thrust upon whoever represented WAR with the larger Robot Fighting League. The first War Lord was Mike Morrow of Team Juggerbot. He helped organize WAR’s participation in the Davinci Days festival in Corvallis, OR. The robots fit right in with the kinetic sculptures and creatively engineered machines that drove the theme of the festival. WAR held another successful antweight competition. Crowds were also entertained by robots ranging from 60 to 340 pounds holding demonstrations by pushing each other around and attacking large objects like washing machines. Because there was no large arena to contain the robots, no actual fighting was allowed at the festival, but afterwards a few of the competitors gathered at a remote parking lot and had a street fight with some of the less hazardous bots. One of WAR’s strengths as an
organization is that so many people have stepped up to handle the events. For years, Dylan Feral-McWhirter of Team Evil Squirrel was the standing War Lord and managed the arena logistics. Adam Conus of Team Wildcard and Scott Ferguson of Team Whoopass held events in their backyards and the term BotBQ was coined to refer to fun with equal parts robot fighting and grilled hot dogs. As the events, robots, and arena have gotten bigger, bigger venues have been needed. Rob Purdy of Team Gausswave has grown WAR to the next level as an organization. In 2006, WAR became a branch of the Seattle Robotics Society. The alliance made sense given that Bill Bottenberg of Team Crash was running a robot class with young kids to get them excited about science, engineering, and learning about how things work. As the new War Lord, Rob also drove larger competitions where hundreds of spectators could enjoy the show, like at the Center House at Seattle Center and in association with large hobby shows. As the organization has grown, so have the robots. In the early days, only the one pound antweight class was supported. Now the focus is largely on the three pound Beetleweight and 12 pound Hobby weight classes, although one pound robots still compete. Whether large or small, these events have brought the regional robot building community together and entertained thousands of people. Where will WAR go from here? It’s hard to say, but as the sport continues to change, WAR will be up to the challenge. SV
SERVO 11.2008
35
Blankenship.qxd
10/8/2008
2:56 PM
Page 36
by John Blankenship and Samuel Mishal
I
f you visit a robot club or any robotic function for that matter, it is likely that you will meet someone who is interested in humanoid robots. Often, these enthusiasts are not particularly interested in building robots that perform useful tasks. Instead, they wish to build a robot that looks and moves like a real person. They may or may not want to endow their creation with artificial intelligence (AI), but they nearly always want to create the illusion of life. My interest in robotics has always been very diversified and I too have FIGURE 1. Epoxy putty was used to turn a Halloween decoration into this head.
36
SERVO 11.2008
always been fascinated with the idea of creating the illusion of life. Perhaps that was a motivating factor that pushed me towards another of my hobbies — ventriloquism. It occurred to me that the techniques used in puppet construction might be of interest to many hobbyists interested in animatronics. A typical ventriloquist puppet is carved from wood or molded from some form of composite material such as plastic wood or papier-mâché. In either case, the head cavity must be open enough to add mechanisms such as pulleys and levers to control the movement of the mouth and other optional features such as moving eyes, eyebrows, and eyelids. If we are creating a robotic puppet, the head must contain all the moving parts found in a standard puppet plus appropriate actuators (motors or solenoids) to effect the movements. Since I wanted the puppet to appear life-like, it was important to animate some body movements in addition to the facial features. In order to simplify the programming aspects of the project, servo motors were
used as actuators. This meant that the overall size and weight of the puppet had to be kept to a minimum. Keeping the puppet small was no bother. To the contrary, it was actually very intriguing. Normally, a ventriloquist’s puppet has to be big enough so that a hand can be placed inside it to perform the manipulations. With a small puppet, everyone would know it was not being controlled in the normal manner. The puppet’s head in this project is smaller than normal and it has to contain even more mechanisms than a standard puppet. If the head was made from wood or composite materials, the required wall thickness would reduce the size of the head cavity even further, adding to the problem. One solution is to use a plastic head from a doll or holiday decoration. The thin plastic shell would provide the maximum interior space. I found a Halloween prop that was the perfect size, but (as you would expect) it had a ghoulish look that was not appropriate. I used epoxy putty to fill in unsightly wrinkles, alter the lips, add teeth, and lift the cheeks. Epoxy putty is as easy to work with as clay — but for only 10 or 15 minutes — so don’t try to do too
Blankenship.qxd
10/8/2008
2:57 PM
Page 37
FIGURE 3. A puppet’s eyes are easily motorized for computer control.
FIGURE 2. The interior of the head is cramped. The miniature servos shown move the eyes and eyebrows. Notice the magnets on each side.
much at once. Figure 1 shows the altered head before painting. The back of the head was cut away to allow easy access to the inside. Magnets were epoxied in appropriate positions (on both pieces) to hold the cut piece in place and still allow easy removal for repairs. Figure 2 shows the interior of the head, which contains three miniature servos: one for the mouth, one for the eyes, and one for the eyebrows. The details of how you mount your servos depends on the features you want and the space available in your puppet’s head. It is also important to realize that you can purchase servos in various sizes with a wide variety of torque, speed, and noise levels, so consider your needs carefully. Most of the bell cranks, disconnects, and other apparatus I use are mechanisms designed for model airplane construction and can be found in many hobby stores. Your local hardware store can also be a great source for small pulleys, lazy-susan bearings, and such. It is difficult to see how the eye assembly is constructed in Figure 2, so Figure 3 shows an
external mockup to provide additional detail. Eyes are easily made from wooden balls that rotate on a bolt or rod. Stiff wires protrude from the rear of each eye and up through a plastic wafer that ensures the eyes move together based on the servo’s motion. It is important to use a slot as shown instead of a hole because the opposing rotational motions can cause binding. The use of the bell crank in Figure 2 allows the motor to be mounted away from the eyes. This can be very advantageous when working in a confined space. The puppet’s body is shown in Figure 4 and is constructed primarily from wood. Padding may be needed to make the body look more natural under the clothes. His full height is 28 inches. The legs are made from PVC pipe. One leg of the pants is pulled up to show the pipe.
Figure 5 shows how the head is mounted on a hinge to allow a forward tilt under control of the neck-mounted servo. The lazy-susan bearing gives the head the ability to rotate. The neck is connected to a servo mounted in the body using a short piece of rubber hose. The flexibility of the hose connection prevents binding by allowing for twisting and bending (much like FIGURE 4. The puppet’s body is hinged to allow side-toside tilt. The legs are made from PVC pipe.
FIGURE 5. The head is hinged to tilt forward and mounted on a lazysuzan bearing to handle rotation.
SERVO 11.2008
37
Blankenship.qxd
10/8/2008
2:58 PM
Page 38
FIGURE 6. The body is hinged at the hips and moved with a servo. The Parallax servo controller simplifies the controlling program.
FIGURE 7. The complete puppet looks very lifelike when being manipulated with the joystick.
universal joints on an automobile driveshaft) while ensuring a secure connection. The body is hinged to the hips allowing a small side-to-side tilt. Figure 6 shows how the servo is mounted to control this movement. The connecting rod passes through a hole in the bottom of the body and connects to an eye-bolt in the hip surface. Figure 6 also shows a Parallax USB servo controller that will be discussed later. The arms aren’t functional in a true robotic sense, but the pull of a string creates just enough movement to add to the illusion of life. Figure 7 shows the fully clothed and painted puppet. Fake fur from a cloth store was used for hair. The USB cable for the servo controller, as well as a power cable are run down the puppet’s leg and extend from the bottom of the pants to make connections
38
SERVO 11.2008
FIGURE 9. Partial listing of the Real_Puppet.BAS //——Constants program for controlling the puppet. COMMS_PORT = 1 JOYSTICK_PORT = 1 //==================================================================== MainProgram: GoSub Instructions GoSub SetUp GoSub Initialize GoSub Start_Control GoSub FinishUp Exit //==================================================================== Read_Joystick: GetButton btn if btn == Buttons[0] then n=MsgBox(I_M) if btn == Buttons[1] then Quit = true joystickE JOYSTICK_PORT,jvalue jx = jvalue[0,0]/(jvalue[0,2]-jvalue[0,1]) jy = jvalue[1,0]/(jvalue[1,2]-jvalue[1,1]) jz = jvalue[2,0]/(jvalue[2,2]-jvalue[2,1]) jr = jvalue[3,0]/(jvalue[3,2]-jvalue[3,1]) jb = jvalue[6,0] jhat = jvalue[7,0] Return //==================================================================== Start_Control: while !Quit GoSub Read_Joystick //—-check buttons first (special movement combinations if jb == B_Yes then GoSub Yes_Combo \ continue if jb == B_No then GoSub No_Combo \ continue if jb == B_Combo1 then GoSub Combo1 \ continue if jb == B_Combo2 then GoSub Combo2 \ continue //—-then move all motors based on joystick’s position GoSub HeadR_Movements GoSub HeadT_Movements GoSub Arms_Movements GoSub Brows_Movements GoSub Eyes_Movements GoSub Mouth_Movements GoSub Torso_Movements wend Return //==================================================================== Yes_Combo: //—-Yes comination movement m = “Yes” xyText 0,100,m+spaces(20),””,20,fs_Bold ramping = HeadTRamping channel = HeadTChannel for i = 1 to 3 nn = 750 a = char(channel)+char(ramping)+char(nn&255)+char((nn >> 8)&255) SerOut “!SC”,a,char(13) delay 500 nn = 950 a = char(channel)+char(ramping)+char(nn&255)+char((nn >> 8)&255) SerOut “!SC”,a,char(13) delay 500 next Return //==================================================================== HeadR_Movements: //—-rotate the head ramping = HeadRRamping channel = HeadRChannel if HeadRTime < Timer() rHeadR =random(HeadRRandomness)-HeadRRandomness/2 HeadRTime = Timer()+1000 // random movement every 1000 mseconds endif nn = HeadRLowLimit+round(jr*(HeadRHighLimit-HeadRLowLimit))+rHeadR a = char(channel)+char(ramping)+char(nn&255)+char((nn >> 8)&255) SerOut “!SC”,a,char(13) Return //====================================================================
Blankenship.qxd
10/8/2008
2:58 PM
Page 39
FIGURE 8. An extended joystick provides control of the puppet’s functions.
easy while being hidden from view. The clothes for a small puppet are not easy to find. An outfit for a 12-18 month old child was tailored and modified to give it the correct proportions. The features on this puppet allow for a variety of emotions. When the puppet lowers his eyebrows, for example, he looks mad. Raising the eyebrows while keeping the mouth open will express surprise. In order to make control of the puppet as intuitive as possible, all the movements on the puppet were associated to similar movements on an extended joystick. Figure 8 summarizes these movements. Some of the puppet’s actions are provided automatically by the computer, thus making the manipulation easier for the user. Buttons on the extended joystick, for example, can be programmed to provide specific movements for the arms, or head movements for yes and no. All of these motions could be created by controlling the puppet manually with the joystick, but preprogrammed movements can have pre-selected servo speeds and limits so that the automated movements can be as lifelike as possible. Furthermore,
Announcing the Gears
JOYSTICK ACTION • Twisting the stick • Moving the stick forward/backward • Moving the stick left/right • POV hat left/right • POV hat forward/backward • Trigger (firing) button
the arms, head, and body all have small random movements programmed into them even when the puppet is not being controlled. This simulates life-like restless shuffling. At this point, we are ready to create the program to bring the puppet to life. We used RobotBASIC because it has the ability to read and write to all the ports on a PC (parallel, serial, and USB). A Parallax USB multiservo motors controller www.Parallax. com) makes it easy to control the servos because it will simultaneously move the servos using the positions and speeds requested by the controller program and maintain those positions without further intervention. The RobotBASIC program reads the joystick and then commands the servo motor controller module to position the motors accordingly, reflecting the positioning of the joystick and/or button presses. The program is too long to list here in full, but the listing in Figure 9
PUPPET MOVEMENT • Rotates the puppet’s head • Tilts head forward/backward • Tilts the body left/right • Moves the eyes left/right • Moves the eyebrows up/down • Opens the mouth
shows a representative sample of some of the subroutines. You can download the full program from www.Robot BASIC.com. It is well commented so it should be easy to follow the logic. The techniques demonstrated in this article can be valuable in a wide variety of projects. Even this project itself can be the starting point for further ideas. For example, instead of using the humanoid form as a manually controlled puppet, you could place it under automatic computer control. If you combine voice synthesis and voice recognition with the puppet’s ability to simulate emotions, it is easy to imagine an amusing interactive robotic display. Of course, the techniques shown here can be utilized in robotic projects involving humanoid forms and other animatronic characters. Constructing your own computer-controlled puppet allows you to have the features you want along with the ability to control it as you see fit. SV
Heavy Metal Robot Kit
Designed for Students and Professionals L Heavy Metal is engineered for rigors of daily use in classrooms,
Supports 200 lbs of standing weight!
summer camps, workshops, labs . . . even combat robots! L Assembles quickly using fasteners of same size/pitch and
threaded inserts. 10" wheel base, heavy gauge aluminum, 4-wheel drive, 3" rubber wheels, 3/8" axles, flanged bronze bearings, #25 pitch steel chain and sprockets. All drive components are keyed and broached. L Competition all-metal gearhead motors, gearbox rated at 500 oz-in of continuous torque. Heavy Metal accepts off-the-shelf engineering parts, plus components and control systems from GEARS IDS, FIRST* and VEX Robotics* kits. Heavy Metal 1 Kit includes chassis, motors, drive system, and wheels for $499.00.
Contact Mark Newby
[email protected] s WWWGEARSEDSCOM
Lb for Lb the World's Toughest Robot Chassis
*VEX Robotics is a mark of Innovation First, Inc. and FIRST refers to © US FIRST (Foundation for the Inspiration and Recognition of Science and Technology)
SERVO 11.2008
39
Eady-Universal Motor-edited.qxd
10/8/2008
9:29 PM
Page 40
THE UNIVERSAL MOTOR by Fred Eady
Electric motors come in a seemingly endless variety of shapes and sizes. If you’re into robots and mechanical devices that move about freely, DC (Direct Current) motors capable of operating on battery power are almost always your most practical motor choice. However, not every robot created by man or alien is a fully mobile Robby running around on forbidden planets. If your robot is a stationary collection of nuts and volts that’s at home working next to a wall outlet, you may be able to use the advantages of an AC (Alternating Current) power source to drive your mechanical animal’s motors. t is often desirable to be able to control a motor’s speed and direction. I’ll bet that most of you have experience with controlling the speed of a standard brushed DC motor. The first brushed DC motor speed control circuit that comes to my mind is shown in Schematic 1A and consists of a PIC microcontroller squirting a PWM (Pulse Width Modulation) signal into the gate of a MOSFET whose job it is to switch
I
current to a brushed DC motor. Adding a trio of MOSFETs in Schematic 1B forms an H-bridge configuration that allows us to change both the speed and the direction of the brushed DC motor with a few bits of PIC I/O. Can you conjure up a similar circuit in your mind’s eye for a simple AC motor speed control? I see a PIC microcontroller punching an optoisolated DIAC (short for the words DIode AC Switch) triggering a TRIAC, which is controlling the flow of AC voltage to an AC motor (Schematic 1C). The problem with the DIAC/TRIAC motor circuit is that the DIAC and a series resistor have all of the “control” and that control is very limited. Another problem with the AC motor control circuit I’ve envisioned lies in the need to provide a separate DC power supply for the PIC microcontroller. What
VDD
VDD
DRIVE A+
DRIVE B+
BRUSHED DC MOTOR
BRUSHED DC MOTOR
Schematic 1A. The duty cycle of the PWM signal that is applied to the gate of the MOSFET determines the speed of the motor. In this case, the duty cycle percentage (0% to 100%) is directly proportional to the speed of the motor shaft.
PWM IN DRIVE B-
DRIVE A-
SCHEMATIC 1A
SCHEMATIC 1B
V+
Schematic 1B. By selectively energizing diagonally opposing MOSFETs, this H-bridge configuration allows for both speed and direction control of the DC motor. The PWM signal is applied to one of the diagonally opposing MOSFETs while the other associated diagonally opposing MOSFET is held in an energized state.
MT2 FROM MICRO
MT1
AC MOTOR
SCHEMATIC 1C
40
SERVO 11.2008
~
Schematic 1C. This is about as simple as it gets for AC motor control. Fact is, we don’t have much “control” here as the DIAC break over voltage characteristics and the value of the resistor between MT2 and the DIAC determine the TRIAC’s triggering point.
Eady-Universal Motor-edited.qxd
10/8/2008
9:29 PM
Page 41
we need is a microcontroller-based AC motor control circuit that gives us effective control of the AC power that is being applied to the motor without having to pamper the microcontroller with additional power supply circuitry. We have our challenge. Let’s deliver the solution.
The Universal Motor A universal motor is a variation of a standard DC motor. However, the universal motor can spin its rotor shaft using AC or DC power. In that this motor spins so well with AC power, you’ll find that most of them are powered with AC rather than DC. If the universal motor application requires slower speeds and quieter operation, you’ll most likely see it powered with DC. The stator of an everyday DC motor is composed of a stationary group of permanent magnet poles. A common DC motor rotor uses it rotor windings in conjunction with a commutator and brushes to work with and against the stator’s magnetic field to rotate the motor shaft. DC motor brushes are made up of a carbon/graphite material and are placed in direct physical contact with the commutator. The motor brushes are also electrically connected directly to the motor’s power source. The brushes and commutator are considered part of the DC motor’s stator assembly as the brushes and commutator are permanently mounted in a stationary position. The commutator is designed in such a manner as to act as a switch that is fed by the brushes. The commutator switches incoming current between the coils within the DC motor. This switching of current between the motor coils is called commutation. A DC motor’s rotor windings are energized in such a fashion as to force the rotor winding to attract to a stator magnetic pole. In other words, the rotor winding is given an opposite polarity than that of the stator pole that it is moving towards. Opposite polarities attract and the rotor moves to align itself with the attracting stator pole. When the rotor winding aligns with the attracting stator pole, the commutator is positioned in relation to the brushes to provide the stator pole with an attracting polarity to the next rotor winding. The newly attractive rotor winding forces the rotation of the rotor shaft as it is now being forced to move and align with the stator pole that was previously the attraction of the rotor winding before it. The commutator contacts are angularly arranged in order to insure the correct electrical and magnetic positioning of the commutator contact versus the angular position of the rotor winding and the stator magnetic pole. Since the DC motor’s stator magnetic poles never change their polarity, we can force the DC motor to run in the opposite direction by simply reversing the polarity of the power being applied to the commutator by the brushes. To understand the forces that cause a DC motor to run in a particular direction, point your right hand away from your body while holding your thumb skyward. Your fingers represent the polarity of the stator’s magnetic field with the tips of your fingers representing the stator’s South magnetic
pole and your wrist standing in for the stator’s North magnetic pole. The direction of your thumb is the direction of the current flow through the stator’s magnetic field. The palm of your hand is the direction of the resultant force. Rotate your hand while observing the position of your palm versus your thumb. It will be obvious to the most casual observer that when your thumb is pointing towards the floor (opposite current flow), the force will be opposite to when your thumb was reaching for the sky. This simple hand twisting technique illustrates what scientists call the Lorentz force. Applying an AC voltage to a DC motor such as the one we’ve just discussed will result in the rotor simply thumping back and forth as the polarity of the rotor winding current is constantly changing due to the continual reversal of power polarity applied to the brushes and commutator on every AC half cycle. To experience this phenomenon, just hook up one of those 12 VDC RadioShack DC hobby motors to a 6.3 VAC transformer’s secondary windings. The DC hobby motor will whip its shaft back and forth at a 60 Hz rate. Conversely, a true AC motor will not run with the application of a DC power source. That’s because the rotation of a true AC motor’s output shaft depends on the very thing that won’t allow our DC motor shaft to spin: the continual rhythmic reversal of power source polarity. Let’s take that DC motor we’ve been discussing and modify it by replacing the permanent magnets in the stator with electromagnets. We’ll rewire that same modified DC motor to put all of its major components in series. That is, the stator electromagnets are wired in series with the rotor windings. Our modified DC motor will retain the original brushes and commutator, which are also participants in the series wiring scheme. Now that we have replaced the stationary permanent magnets with physically stationary electromagnets and wired them in series with the rotor windings, our new DC motor will no longer react to the changes in power source polarity as we have come to expect. That’s because every magnetic pole in our modified DC motor will change polarity in step and negate any changes in the magnetic force between the poles. If we apply a DC power source to our modified DC motor, the stator electromagnets will retain a fixed magnetic polarity and function just as if they were permanent magnets. The modified DC motor thinks it has permanent stator magnets and everything will run just fine. The Lorentz force right hand rule proves this out as the North and South stator poles are fixed. Changing the modified DC motor’s power supply polarity will cause every magnetic pole to change its polarity. Thus, reversing the current through the rotor windings also causes a reversal of the polarity of the stator electromagnets. This simultaneous rotor winding and stator electromagnet polarity reversal means that the modified DC motor will always turn in the same direction no matter the polarity of the power source applied to the motor brushes. Expanding on the observation that the modified DC motor will always turn in the same direction despite the input power polarity, SERVO 11.2008
41
42
SERVO 11.2008
F1 10A
RV1
C1 470nF
MT2 GATE
HOT (BLACK)
MT1
C2 1.0uF
R5 100
D1 5.6V
RC0 RC1/CCP2 RC2/CCP1 RC3 RC4 RC5
RB3 RB4 RB5
RB0/INT0
1N4007
+
PIC18F2620
D2
11 12 13 14 15 16
24 25 26
21
8 19
20
17 18
22 23
1
27 28
6 5 4
3 2 1
3 2 1
C4 .1uF
ICSP CONNECTOR
6 5 4
R6 10K
5V
R11 1K
R10 100
5V
4
5
6
R12 10K
2
1
4N25
OPTOTX
R8 680
4N25
2
OPTORX R7 180 1
C5 .1uF
4
5
6
NOTES: 1. RV1 - AVX VE07P00151K 2. R1 IS 100 OHMS @ 1 WATT MINIMUM 3. D1 IS 5.6V @ 1.5 WATTS - ON SEMI 1SMA5919BT3G 4. C1 IS 470nF @ 275VAC TYPE X2 MET POLYESTER 5. C2 IS 1.0uF @275VAC TYPE X2 MET POLYESTER 6. ALL RESISTORS SMT 0805 1% UNLESS OTHERWISE SPECIFIED 7. ALL CAPACITORS SMT 0805 16WVDC UNLESS OTHERWISE SPECIFIED 8. J1 AND J2 PHOENIX CONTACT 1729128
C3 470uF@16V
GND GND
VDD
RC6/TX RC7/RX
RB1 RB2
MCLR
RA0 RA1 RA2 RA3 RB6/PGC RA4/T0CKI RB7/PGD RA5 RA6 RA7
U1
RX_DATA_IN
ALT_CONTROL
R9 10K
TX_DATA_GND
TX_DATA OUT
9:30 PM
N L
J1
BTA16-600CW TRIAC1
LOAD
1M
R4
2 3 4 5 6 7 10 9
10/8/2008
N L
J2
NEUTRAL (WHITE)
R3 47
R2 47
R1 47
Eady-Universal Motor-edited.qxd Page 42
Schematic 2. This is an AC power supply, a DC power supply, and a PIC microcontroller melded together to turn an AC motor shaft under our control. The amount of hardware stuff you load onto the PIC side of this circuit depends on how much DC current you provide with the transformerless capacitive power supply. I’ve supplied a piece of code in the download package that uses the OPTORX optocouplers as a simple ON/OFF switch.
Eady-Universal Motor-edited.qxd
10/8/2008
9:30 PM
Page 43
this leads us to conclude that the modified DC motor will run in one direction only with an AC power source, as well. Imagine your right hand detached from your body and floating in 3D space. Reverse the direction of your hand to point towards you (reverse the polarity of the stator’s magnetic field) while rotating your thumb towards the floor (reverse the polarity of the rotor winding current). The force (your palm) ends up in the same position as when your hand was pointed away and your thumb pointed skyward. Our modified AC/DC-capable motor is the a universal motor. Most of your AC-powered kitchen appliance motors and most vacuum cleaner motors are universal. I’ve led you down this path because that’s the type of motor we are going to drive with our PIC microcontroller-based controller. Our target universal motor is a product of Ametek Lamb Electric. The one shown in Photo 1 is an Ametek 116207-00, twostage tangential bypass discharge 120 VAC vacuum motor. The 116207-00 is rated at 1,000 watts. Typical input current draw for this motor is quoted as 8.6 amperes when pulling a respectable vacuum through a 19 mm orifice. If you have a robotic application that requires creating a vacuum, that’s great. However, the universal motor controller circuitry we’re about to design can be adapted to drive most any motor you may wish to employ in your robotic applications.
The Universal Motor Controller Hardware I realize that many of you work with potentially hazardous mechanical tools and devices on a daily basis. Every metal head I’ve ever had the good fortune to meet knows that safety is paramount when working with and around metal-forming tools. For you electron heads, safety should also be at the top of your list when working with the universal motor controller electronics. The controller circuitry you see in Schematic 2 is driven by potentially lethal 120 VAC mains power. Do not under any circumstances handle the universal motor controller electronics when the 120 VAC mains power is applied to it. If you don’t want to release the magic smoke from your electronic tools, never attach a PIC programmer or debugger device to a universal motor controller when it is powered directly from the 120 VAC mains. If you want to probe the controller circuitry, get the mains power, behind an isolation transformer first. Like anything else, the universal motor controller circuitry is best understood when digested in small chunks. So, as you study the components in Photo 2, think of the controller electronics as three
cooperative subsystems: an AC control subsystem; a DC power subsystem; and a microcontroller subsystem. The AC control subsystem is responsible for interfacing the motor with the 120 VAC. The PIC18F2620 microcontroller depends upon the DC power subsystem for its power supply needs. The STMicroelectronics BTA16-600CW snubberless TRIAC — which is the heart of the AC control subsystem — is under the control of the PIC18F2620-based microcontroller subsystem. The AC control subsystem provides overall protection for the controller circuitry with a 10 ampere fuse and a zinc oxide varistor placed in series with and across the 120 VAC mains supply, respectively. A 470 nF X2-type capacitor (C1) also traverses the 120 VAC supply to limit electromagnetic interference (EMI). Believe it or not, C1 is not there for the controller circuitry. It’s there to restrict harmonic pollution of the 120 VAC mains. Take another look at Photo 2 and you’ll see that the entire AC control subsystem is contained to the left of the area delineated by the TRIAC’s heatsink. In this instance, we are driving an inductive load and one would normally see a resistor/capacitor snubber network placed across the TRIAC’s MT1 and MT2 terminals to reduce the possibility of false triggering of the TRIAC. The BTA16-600CW is designed to work against the high instantaneous voltages that occur during TRIAC commutation that can force a TRIAC to conduct unexpectedly. In the case of a TRIAC, commutation is the switching from an ON state (TRIAC conducting) to an OFF state (TRIAC not conducting). When an AC signal is applied to a TRIAC and a trigger is applied to the TRIAC gate during a time when the AC signal is not crossing zero, the TRIAC will conduct until the next zero crossing of the AC signal. If a trigger is not applied to the TRIAC gate following the zero crossing event, the TRIAC will remain in a nonconductive state until it is triggered again. The TRIAC’s ability to reliably turn itself off (commutate) and be triggered into conduction at will by our PIC within the time domain of an AC cycle are the keys to controlling the amount of power Photo 2. Although you can easily breadboard a universal motor controller, building up your own on a printed circuit board like this is recommended. Note that there are no exposed printed circuit board traces or lands, which reduce the probability of you getting your fingers fried. Be sure to use X2-type capacitors for C1 and C2 as X2z are approved for safe use in this type of AC circuit.
Photo 1. This universal motor could be a blender motor or a kitchen mixer motor. As long as the motor is considered to be universal, it’s a safe bet that our core AC motor controller circuitry can be adapted to drive it.
SERVO 11.2008
43
Eady-Universal Motor-edited.qxd
10/8/2008
9:31 PM
Page 44
we apply to our universal motor. The DC power component of the controller is supplied by a transformerless capacitive power supply. With yet another peek at Photo 2, all of the transformerless capacitive power supply components are located below the 470 µF electrolytic capacitor (C3), which is to the right of the TRIAC heatsink. You should be able to easily pick out the transformerless capacitive power supply’s five components, which include resistor R5 (100Ω) , capacitor C2 (type X2 1 µF), zener diode D1 (5.6V, 1.5 watt), generalpurpose rectifier D2 (1N4007), and electrolytic capacitor C3. The transformerless capacitive power supply you see in Schematic 2 will work for us (keep a stable voltage across C3) as long as the current we draw from the transformerless capacitive power supply is equal to or less than the current that is feeding the power supply. The amount of output current the power supply provides depends on the value of R5, C2, D1, and the magnitude and frequency of the input AC voltage. (C3) is the output charge collection point that stores and supplies voltage gleaned from the rest of the transformerless capacitive power supply components. Here’s the formula that will reveal the amount of current taken from the 120 VAC mains:
where: • IN = Current available at transformerless capacitive power supply output • VRMS = AC mains input voltage • VZ = Voltage drop across zener diode • f = Frequency of AC mains input voltage • C1 = Value of universal motor controller capacitor C2 (blocking capacitor) • R1 = Value of universal motor controller resistor R5 (blocking resistor)
I had a great deal of fun playing with this formula. So, to make it just as much fun for you to manipulate the parameters, I whipped up an Excel page (included in the download package available at www.servomagazine. com) that calculates IN using your input values. Screenshot 1 is a spread of values using a tolerance of 20% for the blocking capacitor and 1% for the blocking resistor. The other parameters are hand-picked assumptions with the exception of the VZ value (zener voltage drop), which I extrapolated from the 1SMA5913BT3 datasheet. I overdesigned my universal motor controller Screenshot 1. I used a 1.0 µF X2-type capacitor and a 100 ? two-watt SMT power resistor in this transformerless capacitive power supply to provide ample current for driving LEDs and optocouplers. I also overdesigned the PIC18F2620 into this circuit as to not want for I/O if I needed it later. You can design in just as much PIC as you want and just as much DC current as you need for your personal universal motor controller application.
transformerless capacitive power supply as I didn’t end up using as many current-hungry LEDs and optocouplers as I had envisioned. As you can see from Screenshot 1, I have about 30 mA of available current. The formula for computing the available current is generous. The actual amount of available current will be somewhere around 80% of the computed value, or 24 mA. The PIC18F2620 is also overdesigned as I have plenty of PIC I/O left over after servicing the controller’s AC and logic interfaces. The main reasons for choosing the PIC18F2620 for this application were its built-in oscillator, ample I/O, and EUSART. A smaller PIC footprint will also work with our controller AC and DC components. Just make sure your PIC has enough I/O lines to do the job. It’s pretty obvious in Photo 2 as to where the PIC, optocouplers and all the supporting microcontroller components are located. It is important to note that our transformerless capacitive power supply has its DC positive component referenced to the 120 VAC mains Line, which is also connected to the triac’s MT1 terminal. The reasons for the zener diode’s cathode connection to the 120 VAC mains Line are twofold. First, we want to trigger our BTA16600CW using a low-going pulse. The reason for selecting a low-going trigger pulse is dictated by the quadrants in which we desire to trigger the BTA16. A careful study of Figure 1 shows us that a typical triac can be triggered by a positive or negative going pulse. Since we’re triggering the controller’s BTA16 with a lowgoing pulse, we can only trigger it in quadrants II and III. For inductive loads, triggering in quadrants II and III is desirable as the triggering energy is not excessive here. Simple diac-based lamp dimmer circuits — which are fashioned similarly to Schematic 1C — usually trigger in auadrants I and III. Transpose the diac trigger diagram in Figure 2 over Figure 1 to see why. quadrant I is also a desirable triggering quadrant as it does not require excessive triggering current. Note that quadrants I and III are complementary as far as triggering and AC cycle conduction are concerned. For most applications, quadrant IV is to be avoided as it takes the most triggering energy. Note also that both the positive and negative portions of the AC cycle can be processed with a low-going triac trigger pulse. The BTA16-600CW requires a minimum of 35 mA and a maximum of 60 mA of gate current flow to trigger. The PIC18F2620 can sink 25 mA per I/O pin. I’ve paralleled 3 I/O pins to provide a total of 75 mA of sink current capability. The 47.5Ω 1% resistors (R1, R2, and R3) are present to level the I/O pin load across the three current sinks and limit the maximum amount of gate current drive. In our universal motor controller application, I’ve selected a minimum logical high level of three volts. The BTA16600CW datasheet tells me I need to be ready to sink a maximum of 60 mA of current through the triac gate. Using Ohm’s Law, that equates to: R = 3 volts / 0.060 Amperes = 50Ω
44
SERVO 11.2008
Eady-Universal Motor-edited.qxd
10/8/2008
9:31 PM
Page 45
Figure 1.To make the logical low triggering easier to understand, forget about AC and think logically. Think of the REF terminal as a DC voltage (five volts) instead of an AC voltage. Triggering the TRIAC is accomplished by taking the DC voltage level at the gate of the TRIAC below the DC voltage level of the REF terminal.
I selected the gate-limiting resistor values that are a click below 50Ω to insure that enough current (about 63 mA with the 47.5Ω resistors) could sink through the triac gate and PIC I/O pins. You may be asking why the triac doesn’t trigger when the PIC I/O pin attached to the gate is logically high. Take another look at Figure 1. Notice that everything is referenced to the MT1 terminal. Schematic 2 shows us that terminal is referenced to the positive pole (zener diode D1’s cathode) of the transformerless capacitive power supply. So, to trigger the BTA16 with a logically low gate potential means that the gate voltage must go negative with respect to terminal MT1. With MT1 referenced to the positive pole of the five-volt power supply, we can take the PIC I/O pin driving the gate below the voltage applied to the PIC’s VDD pin (+5 VDC), but we can never take the PIC I/O pin that is driving the triac gate above the positive voltage level that is being supplied to the PIC’s VDD pin by the capcitive power supply (which is the same voltage level referenced at the MT1 terminal). Thus, the voltage at the gate can never be more positive than the voltage referenced at the MT1 terminal, and the triac cannot trigger. To correctly position our trigger pulse within the 16.66 ms period of a 60 Hz AC cycle, we need to know when the zero crossing point of the cycle occurs. Thanks to the PIC’s internal I/O pin protection diodes, we can simply place a limiting resistor between the 120 VAC mains neutral and a PIC I/O pin. Our zero crossing event (ZVC) detection is enabled by the PIC18F2620 RB0 pin’s ability to trigger an interrupt. Each time the AC cycle crosses zero, the PIC is interrupted. The ZVC firmware has the ability to determine if the event occurred on a rising or falling half cycle and uses this event as a timing reference for issuing a TRIAC trigger pulse. Earlier, I warned against casually connecting stuff to the controller electronics. However, it would be nice to be able to pass control information to the universal motor controller’s PIC. The easiest way to accomplish this is to simply optoisolate the PIC I/O pins we wish to interface to the outside world. Just in case any of us will have the need to have the controller respond, I’ve also included an optoisolated transmit portal. I placed the optoisolated interface on the PIC’s EUSART transmit and receive pins. Using the EUSART pins allows us to send and receive serial data, as well as using the controller’s PIC I/O pins as simple binary ON/OFF inputs and outputs.
on or off, depending upon the logical state of the OPTORX input (RC7). You can change the motor speed by altering the triac triggering angle, which ranges from zero degrees (motor off) to 179 degrees. I found that my universal motor would not spin with a firing angle beyond 145 degrees. So, the theoretical useful triggering range is one to 140 degrees. I will caution you to tie down your motor if you plan to trigger the device below 90 degrees with the Ametek I used. At 90 degrees with no vacuum load, mine howled and roared. (My wife commented that the motor sounded like a small plane taking off of the shop bench). Also, be aware that switching within a triac is not instantaneous. Switching delays will limit the lowest triggering angle you will be able to dial in. The real fun in all of this is punching in those trigger angles and turning the universal Figure 2. A DIAC triggers on each AC half cycle. Note that the polarity of the TRIAC’s MT2 terminal always matches the polarity of the TRIAC gate’s trigger pulse. Also note the total lack of DIAC activity in Quadrants II and IV.
The Universal Motor Controller Firmware The firmware behind the universal motor controller is just as easy to understand as the hardware. I’ve supplied code in the download package that simply turns the motor SERVO 11.2008
45
Eady-Universal Motor-edited.qxd
10/8/2008
9:31 PM
Page 46
Photo 3. I hung my IDEAL 400 AC clamp meter around the universal motor’s AC line lead (black lead) with a 90 degree TRIAC triggering angle dialed in. The universal motor’s no-load AC amperage draw varied from 6.92 to 7.00 amperes.
motor loose. Photo 3 is a real time shot of my motor’s no-load AC current draw with a triggering angle of 90 degrees. If you’re having problems getting your arms around the triac triggering angle concept, visualize them as beginning with the rising half cycle of an AC signal. Half way through the first positive half cycle is 90 degrees, which is also the peak positive-going voltage of the AC cycle. As you move past 90 degrees, you will move towards the next zero crossing point at 180 degrees. The firmware will reset the triggering angle to relative zero at each zero crossing event and trigger the device at the same relative time in the negative cycle as it did in the positive cycle of the AC signal. For instance, let’s assume we trigger the triac at 90 degrees into the positive half cycle. It will conduct until the AC signal crosses zero at 180 degrees into the cycle. The next trigger pulse will be issued 90 degrees after zero crossing, which is actually 270 degrees into the AC cycle. At the next zero crossing, the firmware will reset the trigger timing reference to zero and the triac will again commutate. The result is that we have energized the universal motor for 50% of the full AC cycle with a 90 degree trigger angle. Since the motor will run very slowly at a 140 degree trigger angle and run faster as the trigger angle is decreased, we can conclude that the angle is inversely proportional to the motor speed. Here’s the code
that converts the triac trigger angle to a trigger delay time: //********************************************** //* CONVERT TRIGGER ANGLE TO TIME //********************************************** unsigned int angle_to_time(char trigger_angle) { unsigned int angle2time_val; if(trigger_angle == 0) { angle2time_val = 0; } else { angle2time_val = 0xFFFF - (trigger_angle * 0x2E); //each degree ~ 46us at 60 Hz } return angle2time_val; }
Understanding how the triac trigger timing is determined is the key to understanding the rest of the universal motor controller firmware. Each degree of trigger angle delay time is equivalent to approximately 46 µs assuming a 60 Hz AC signal. If you’re reading this in a 50 Hz mains country, each degree of delay time is approximately 56 µs. Thus, the controller hardware and firmware will work with 50 Hz AC systems. All you have to change is the time delay associated with each degree of triggering angle. A PIC18F2620 timer uses the angle2time_val to kick off a 400 µs TRIAC trigger pulse at the same relative time in every AC half cycle. At every zero crossing event, the current trigger angle is converted to a value that is fed into the PIC18F2620’s triggering delay timer. To prevent the motor from lurching at every speed change, the firmware includes a routine that ramps up or down to the new trigger angle. The firmware also contains a soft-start routine that smoothly ramps the motor up to speed upon initial power-up.
Hands On ... Carefully, Please ...
The best way to get your hands around driving the universal motor is to do it yourself. Photo 4 is a shot of the Photo 4. It ain’t as pretty, but it works just as well as breadboard version of the controller I assembled before the production universal motor controller you see in committing to a printed circuit board (PCB). However, you Photo 2. The smaller 470 nF X2 filter capacitor is directly don’t have to build this from scratch as the controller downabove the varistor and fuse. The much larger 1.0 µF X2 transformerless capacitive power supply blocking load package contains an ExpressPCB file that you can use capacitor is just left of the PIC18F2620. as-is to fabricate your own PCB. The firmware included in the download package was created SOURCES using the HI-TECH PICC-18 C compiler and is ready to run out of the box. I’ve included a set of Microchip — www.microchip.com PIC18F2620 interrupt-driven RS-232 routines in the code for those of you that want to experiment with www.ametek.com controlling the controller serially. All that’s left for Ametek Lamb Electric 116207-00 you to do is to collect the necessary electronic Universal Motor components, solder them down, and fire up your universal motor. All it takes is an email to solicit www.htsoft.com HI-TECH PICC-18 C Compiler my help with this project. I had bunches of fun with this and I’m sure you will too. SV STMicroelectronics — www.st.com BTA16-600CW
46
SERVO 11.2008
Fred Eady can be reached via email at
[email protected].
Full Page.qxd
10/7/2008
11:47 AM
Page 47
McCullogh.qxd
10/7/2008
10:31 AM
Page 48
by KEVIN MCCULLOGH
GETTING CONTROL WITH THE
Propeller Introduction In the last article of this series, David Carrier covered how hobby servos work and an appropriate control scheme using the Propeller™ microcontroller. By taking advantage of the Propeller’s multiple onboard processors, the control board was designed to be easy to use with a minimum number of components. In this part of the series, we will take a “step” (bad pun intended) into the world of stepper motors. We will look at bipolar steppers in particular and some methods to improve their performance.
Stepper Motor General Description/Comparison In general, stepper motors are brushless motors with many poles per rotation. In a standard DC motor, an applied voltage causes the motor to spin continuously because the windings are automatically commutated (switched) internally as the rotor travels through a full rotation. In a stepper motor, windings are commutated externally, usually with either discrete transistor switches or H-bridges. The main advantage they have over DC motors is their ability to be controlled to precise angles without using closed loop feedback. This is at the expense of increased motor weight, and lower efficiency and speed. However, open loop control systems are generally much simpler and cheaper than closed loop servo systems.
PART 3: Stepper Motors
unipolar or bipolar. From a controller’s point of view, the main difference is that unipolar motors only require current flow in one direction, while bipolar motors require the current to reverse direction. This makes unipolar motors easier to control electrically since current can simply be switched on or off in each winding. Bipolar motors generally require more complex circuitry, such as H-bridges to reverse current through the windings. This can increase the cost of the controller. On the positive side, the power-to-weight ratio of bipolar motors surpasses unipolar motors since the entire winding is utilized at any given time on each pole. In unipolar motors, only half the coil is driven at a time. This reduces the size and usually cost of bipolar motors over unipolar motors with comparable specifications. For this article, we will implement a control scheme for a bipolar stepper motor using the Propeller microcontroller and some external circuitry. And, since there is always something satisfying about improving hardware performance, we will also go over some ways to optimize the stepper motor drive system.
S
S
S
N
N
N
NN
NN S
S
NN S
Types of Stepper Motors Stepper motors come in a variety of configurations, as shown in Figures 1-3, but are generally categorized as
48
SERVO 11.2008
Figure 1: Unipolar stepper with continuous windings
Figure 2: Unipolar stepper with separate windings
Figure 3: Bipolar stepper motor
McCullogh.qxd
10/7/2008
10:38 AM
Page 49
Control Method The current through each winding of a bipolar stepper motor must be alternated, so when operating from a single supply, the best approach is to use an H-bridge. These can be created using discrete transistors, or more conveniently by using an existing H-bridge integrated circuit (IC). The latter is often the best choice for driving motors requiring less than a few amps. I found a couple bipolar motors laying around which are rated at 12V, 75Ω per coil; or 160 mA per coil. The L293D IC is a quad half H-bridge driver and can handle up to 600 mA per driver – more than enough for this project! We will be pairing the four half H-bridges to form two full bridges to control the two windings in our bipolar stepper motor. Each bridge now has two control inputs and one enable line. When the control inputs’ levels are opposite, current will be driven through the motor coil in one direction or another, according to Table 1. Driving both lines high or both lines low effectively shorts the motor windings across the supply or ground, respectively, which acts to electrically brake the motor. The enable line is unnecessary for this configuration and can be left tied to VCC through a resistor. The input lines from both H-bridges should be connected to I/O pins on the Propeller microcontroller. All that is left is to program the necessary step sequence to cause the motor to rotate. This can be done by storing the output pin states in memory, and stepping through each state after a brief delay. Increasing or decreasing the delay period changes the speed of the motor. Figure 4 shows the coil switching sequence for two full cycles with four steps per cycle. As you can see, a simple stepper motor driver can be made rather easily; however, there are a few techniques to get noticeably higher performance from the motor. These come in the form of programming, hardware, or a combination of both. Example Spin code for this project can be downloaded at www.parallax.com/go/GettingControl3. The Spin object takes care of sequentially stepping the motor windings behind the scenes. With a simple set of function calls on the front end, this object can be used to move to an absolute position, move a relative number of positions from the current position, set the step rate (speed) in full or half steps, and set the acceleration value to ramp up and down the speed. The user can also read back the current position or clear the position back to 0. The object is set to handle up to four stepper motors at once, using a total of 16 I/O pins. And since this code is open source, you can easily tailor the object to fit your exact needs whether they are to drive unipolar steppers or to employ some of the optimizations described next.
Optimizations Microstepping Microstepping breaks each step into a number of smaller sub-steps in order to achieve higher position resolution. This is usually achieved in software by using pulse width modulation (PWM) to vary the current in each
+Vcc
Coil
A -Vcc
+Vcc
Coil
B -Vcc
Figure 4: Coil switching sequence for bipolar motor.
coil. By controlling the current more precisely, the motor can be moved to many positions between each full step. Microstepping also allows the motor to transition more smoothly, resulting in reduced vibration and noise. The practical limit to the resolution of microsteps is affected by static friction, detent torque of the motor caused by the presence of permanent magnets, and any error introduced by the controller. Very thorough analyses of microstepping can be found in various sources online or in related text books. Current Regulation When a coil is switched on, it takes a small amount of time for the current to reach its steady state. Each coil of wire has a certain amount of inductance, L, and series resistance, R. The voltage across the coil, V, and the coil’s inductance determine how fast the current changes. This rate of change — known as di/dt — is equal to the voltage divided by the inductance: di/dt = V/L. At low switching speeds, the current rise time is negligible compared to the duration of the pulse. However, at high switching speeds, the coil current is unable to reach its full value before being switched again. Motor torque is proportional to the current through the coil, so as the speed increases, torque decreases – eventually to a point where the motor can no longer operate. If a much larger voltage — around 2-3 times the rated voltage — is used when the coil is initially switched on, the current will rise more quickly (see Figure 5). This gives the motor more torque allowing it to operate up to higher speeds. However, it is important that current through the coil does not significantly exceed the rated value, since overheating and ultimately damage to the motor can occur. One way to protect against this is analog current
Input 1 L L H H X
Input 2 En L H H H L H H H X L
Output Function Electrically braked Reverse current flow Forward current flow Electrically braked Electrically braked
Table 1: H-bridge output function versus input state.
SERVO 11.2008
49
McCullogh.qxd
10/7/2008
10:39 AM
Page 50
Current (i)
components to sense and switch the supply current, but it is one of the best ways to noticeably increase motor torque and top cutoff speed. And conveniently, we already have a microcontroller available to monitor the current and control the switching. Rated coil current
Ideal Simple driver Current regulated driver Simple driver with double voltage
Time (t)
Figure 5: Current transient curves showing the benefits of a regulated current driver
limiting with a transistor. Initially, the transistor allows full supply voltage across the coil. Then, as current through the coil increases, the transistor partially turns off to limit current to the rated value. The down side to this analog approach is that significant energy is wasted as heat in the transistor. A more efficient method is to switch the large supply voltage all the way on or all the way off. The on time is adjusted so that the average coil current is appropriately limited to the rated value. This technique requires a few additional
Conclusion There are several methods of fine-tuning the control system to enhance a stepper motor’s performance. Fortunately, by using a microcontroller like the Propeller and a few external components, we have tremendous flexibility to create a control system as simple or complex as necessary for our application. Next month, Chris Savage will be back with the final article in this series to discuss the use of PWM for DC motor control. Be sure to check out the Parallax web link for schematics, Spin code, and photos of this project. And as always, good luck and have fun! SV Parallax website for this article with example code, schematics, and photos. www.parallax.com/go/GettingControl3 This website provides lots of information and a very thorough explanation of stepper motors. www.cs.uiowa.edu/~jones/step/index.html Wikipedia article on stepper motors. http://en.wikipedia.org/wiki/Stepper_motor
Microsoft
Visual Studio
Dyynamixxel SDK
C/C++
Visual Basic C#
EX-106 NEW
164 Encoder EX-106
14.8 84
106
0.182
0.143 155
50
SERVO 11.2008
Full Page.qxd
10/7/2008
11:49 AM
Page 51
What today’s robotics engineers, rocket scientists, and astrophysicists do for fun. Exercise your skill, expand your mind, and challenge your creativity with everything from games to gadgets from Edmund Scientific. Whether you’re a hobbyist, scientist, or student, Edmund Scientific has something to make you smile and think. For the latest trends in toys and technology, call for your free catalog or shop online at scientificsonline.com.
Gift of Science 1-800-728-6999 • www.scientificsonline.com
Alter3-edited.qxd
10/6/2008
Software and Programming
4:48 PM
Page 52
Part 3: Software Advantages of a PC-Based Robot
network admin for seven years so I stuck with what was comfortable. Installation of the operating system (OS) went First off, let’s set the record n this series of articles, we are exploring my Pico simply enough. I plugged an straight. I am not a programmer. ITX based Johnny 5 project. In the first article, I LCD monitor, keyboard, mouse, I know various forms of detailed the work that went into upgrading and and USB CD-ROM into my robot “microcontroller Basic,” VBScript, (Ha! I love saying that!) and some Visual Basic, and am in the expanding the original kit to make it a more viable installed Windows just as I process of teaching myself C#, research platform. In the second article, I dove into would on any PC. I kept it but I don’t believe that qualifies the concept and implementation of PC-based plugged into these peripherals me as a programmer. Until my robotics. In this third article, I will show some of throughout the Windows install, recent venture into C#, I had only the software advantages of having an onboard PC. driver installation, software taught myself enough to get While I used the Lynxmotion Johnny 5 kit as a installation, and initial specific projects done, and left it platform for my project, the principles, concepts, configuration of the OS. at that. With my Johnny 5 Before we dive into what project, I wanted to keep things and even components of this project can be software I installed on Johnny, simple and more importantly take applied to almost any robotics platform. let’s cover some initial advantage of GUI-based configuration details needed to trim down the OS a bit and programs as much as possible, given that I have full access to prepare it for remote connectivity. Trimming down the OS is the robot’s desktop at all times. We’ll touch more on that optional and doesn’t provide a huge benefit but it’s sort of later. Let’s tally a few things that we have at our disposal habitual for me to do on a PC with a very specific function with a PC-based robot: We have a computer and hard drive capable of running a full fledged operating system, wireless such as the robot’s Pico ITX. Right clicking on My networking, “bridgeware” to connect the PC to the robot’s Computer, selecting Manage, and then selecting Services hardware components (in my case, this was my SSC-32 down towards the bottom will bring up a list of active and servo controller), and various other peripherals such as USB inactive services on Windows XP. These are various webcams, speakers, and a microphone. I will show you just processes running in the background that enable and how easy it is to bring all of those components together to control different functions of the OS, and a lot of them greatly expand your robot’s potential. aren’t needed for this project. I turned off Automatic Updates, Clipbook, Error Reporting Service, Fast User Operating System Switching, Help and Support, Indexing Service, Print Spooler, Remote Registry, Security Center, Themes, and I used Windows XP for my project; it’s what I know Windows Firewall/Internet Connection Sharing (ICS) by best and it’s simple and easy to use. I know many out right clicking each service, selecting Properties, changing there will preach the greater potential of Linux in such the Startup Type to Disabled, and clicking Stop. applications, but for me it was a simple choice: I was a Lastly, I did a clean-up of a few unneeded apps that
I
52
SERVO 11.2008
Alter3-edited.qxd
10/6/2008
4:49 PM
Page 53
get installed with Windows such as Games, Internet Explorer (I use Firefox), MSN Explorer, Outlook Express, Windows Media Player, and Windows Messenger. These are just the basics. Depending upon your comfort level with Windows, you can take the total size down to about 500-600 megabytes and use as little as 50 megabytes of RAM while still maintaining an OS capable of running your robot. Diving into the intricacies of in-depth Windows liposuction is a bit beyond the scope of this article, however. Remote connectivity is very important in PC-based robots. You don’t want to have to continue to plug in peripherals to your bot when you can simply pull up its desktop over your network via Remote Desktop Protocol (RDP) and operate it with the same ease. To prepare Windows for this, you must first create a password protected account or simply use the default Administrator account for this purpose. Next, enable Remote Desktop connections on the computer. This option is found by right clicking on My Computer, selecting Properties, selecting the Remote tab, and placing a checkbox in “Allow users to connect remotely to this computer.” At this point, all that is left is establishing a connection to your wireless network. The Remote Desktop Connection manager can be found by navigating to Start > All Programs > Accessories > Communications > Remote Desktop Connection, or alternatively you can type “mstsc” on the Run line. You can do this on any modern Windows-based PC connected to your network and simply type in the computer name you set for your robot’s computer. This will bring up a log-on prompt; enter in the username/password you set earlier and your robot’s desktop will be displayed. At this point, you can access and control your robot’s PC from anywhere within the range of your wireless network. If it has webcams, you can view those over this connection for easy telepresence, talk through it using a text-to-speech engine, access network resources, and control its servos and motors via various programs.
FIGURE 1
treads on the robot. Lucky for me, the original Johnny 5 kit I started out with came with a Lynxmotion SSC-32 Sequencer, which is a GUI-based servo control and sequencing package. SEQ is a straightforward and easy-touse application that interfaces directly with the SSC-32 servo controller I am using for this project. Servo home positions and range limits are set via a small configuration menu, and servos are controlled via a drag-and-drop GUI. Each servo is represented as a small box with a slider for setting servo positions, which can be moved around to create a layout of your robot’s frame. Figure 1 shows a screenshot of what my servo layout looks like. A “step” is created by manipulating the servos to their desired position and then taking a snapshot of the position. These steps can be strung together and played through at various speeds to create complex motion sequences, as well as be mapped to buttons in the GUI or physical keys. Refer to Figure 2 for a picture of a pose created using SEQ. Also check out www.youtube.com/watch?v=hHUoxtG91YQ
Telepresence The software used on a robotics project is going to be dependent upon many things such as what type of hardware you’re using, what programming languages you’re comfortable with, and what you want to do with your robot. Obviously, I can’t tell you what will work for your project, but I will cover what worked well for me. My first objective with this project was to set up a solid telepresence scheme and have the ability to speak through the robot (read: scare the wits out of my wife). Given that a remote video feed is simply a matter of establishing an RDP connection and viewing one of the webcams, all I really needed was a way to control the
FIGURE 2
SERVO 11.2008
53
Alter3-edited.qxd
10/6/2008
4:49 PM
Page 54
FIGURE 3
This code is written for a camera set to 160x120 resolution, a pan/tilt ‘ servo turret, and a Lynxmotion SSC-32 servo controller. ‘ Initialize starting servo values ‘ Make sure these variables are set to their respective channels in the ‘ SSC-32 module pan = GetVariable(“PAN_SERVO”) tilt = GetVariable(“TILT_SERVO”) ‘ get the size (width or height) of the current bounding box size = GetVariable(“COG_BOX_SIZE”) ‘ if it is equal to “” then no object was detected if size <> 0 then ‘ get the horizontal center of gravity cogX = GetVariable(“COG_X”) ‘ pan left if cogX < 70 then pan = pan - 20 end if ‘ pan right if cogX > 90 then pan = pan + 20 end if
Autonomy and Machine Vision FIGURE 4
‘ get the vertical center of gravity cogY = GetVariable(“COG_Y”) ‘ tilt down if cogY < 50 then tilt = tilt - 10 end if ‘ tilt up if cogY > 70 then tilt = tilt + 10 end if if if if if
pan > 2500 then pan = 1500 pan < 500 then pan = 1500 tilt > 2500 then tilt = 1500 tilt < 500 then tilt = 1500
SetVariable “PAN_SERVO”, pan SetVariable “TILT_SERVO”, tilt end if
Contact Andrew at
[email protected]
54
SERVO 11.2008
for an example of a dance sequence I made (when I was very, very bored). SEQ allows for control of my robot’s Sabertooth 2x5 motor controller, as it responds to PWM signals just as a servo does. I created various steps for moving the robot forward, back, left, and right at varying speeds – and then mapped those to my arrow keys. I was also able to control the pan/tilt movement of the head to look around the room. Once this was accomplished, I could easily drive the robot around my house through an RDP connection with a streaming video feed from its webcams — overall, a very easy implementation of telepresence. Adding a voice to the robot was also a simple task, thanks to its onboard PC. The default text-to-speech engine that comes with Windows is fairly primitive, to the point of being nearly unintelligible. The company Cepstral offers high quality text-to-speech engines that work as drop-in upgrades for the stock Microsoft engine. I chose a voice called “David” as it was clear and easy to understand. The Cepstral voice engines also come with a simple text-to-speech app that reads aloud whatever is typed into the text box. In the first article, an LED VU meter was fashioned into a mouth, giving the robot’s voice a visual display as spoken syllables are synchronized with the LEDs. This setup mimics the original technology used for the Hollywood Johnny 5’s mouth.
As I stated before, I am not a programmer. Full blown autonomy is a technology still being explored by top researchers around the world; however, a small piece of that pie would satisfy me. Having built small walkers and rovers in the past that used basic range sensors to avoid obstacles, I wanted to explore new territory with this project. Given that my robot was already capable of vision, I chose to explore machine vision for the first time. Roborealm is a free machine vision software package that can be interfaced to a wide variety of cameras and electronic hardware. It handles a lot of the heavy coding work required for vision processing and allows novice programmers to focus on the concept and implementation. In Roborealm, a camera’s video feed is brought into an interface in which various filters can be applied to a processing pipeline. These image filters can accomplish a variety of different tasks, such as filtering out specific colors, sharpening or softening an image, reducing image noise, and drawing outlines around objects, to name just a few. Refer to Figure 3 for a diagram of the Roborealm GUI and a preview of what an object looks like using a filter to remove
Alter3-edited.qxd
10/6/2008
4:50 PM
Page 55
all but red and green colors. Like many others, I have a man-child obsession with building a robot that is capable of fetching me a cold adult beverage. I soon learned this was much easier said than done, but I had to start somewhere. The basis of locating specific physical items within an environment is known as “object tracking,” and can be done a few different ways. The easiest way for me was to implement colored object tracking. The concept behind this is fairly simple: RGB color filters are applied in Roborealm to remove all but a specific FIGURE 5 color. I had a red ball handy that proved itself to be an excellent prop for this. To remove some background noise, I applied a mean color filter which essentially blurs the image. Roborealm also has a very handy center of gravity (COG) filter which places a box around the largest concentration of same color pixels on the screen, and outputs an X,Y coordinate of its location. The SSC-32 servo controller has an interface module that can be added to the pipeline, allowing variables to be assigned to different channels. Lastly, there is a VBscript module that provides a simple programming interface to tie all of the variables together. I created a program that tracks various colored objects using the pan and tilt head of my robot. Figure 4 shows the VB code I used; the entire .robo file containing all pipeline settings is available for download from the SERVO website (www.servomagazine.com). This program works by filtering out everything but a specified color, placing a COG box around the mass of same colored pixels (the object), and the VB code reads the X,Y coordinates of the COG module and translates those into servo positions on the pan and tilt to keep the object in the center field of vision. I have a video hosted on YouTube showcasing this object tracking ability at Robogames 2008, found here: www.youtube.com/watch?v=GfMCaaePFBw. Figure 5 shows what my RDP session looks like when piloting my robot around the house via telepresence. The next step for me will be experimenting with object chasing. I can easily track the size of an object using Roborealm, and have been somewhat successful in being able to drive towards the objects, but I still hit a lot of walls. I’ve seen some work done where Roborealm can draw lines at the floor to ceiling junctions and use those to avoid running into walls, so implementing that will be the logical next step.
Conclusion
the possibilities of PC-based robotics. As my own programming knowledge grows, I think my robot’s potential will grow exponentially, as the ceiling of possibility is nearly limitless with this much computing horsepower at my disposal. While it’s hard to sum up a year long project in only three short articles, I hope that some of what I learned in the process can be passed along to others. I think the biggest thing I’ll take away from this project is that we can’t always hold on to what is comfortable. Microcontrollers are still great tools but they are severely limited in what they can do when compared to a PC-class processor. Start thinking of them as complementary electronics to a larger, more powerful system and you’ll be surprised what solutions become available to you as an experimenter. Welcome to the realm of PC-based robotics! It’s here now and is the future of our hobby. For updates on the progress I make with this project, visit my project page at the Trossen Robotics Community. SV
References VIA Pico-ITX Page www.via.com.tw/en/initiatives/spearhead/pico-itx/ Roborealm Cepstral Lynxmotion SEQ
www.roborealm.com www.cepstral.com www.lynxmotion.com
My Project Thread http://forums.trossenrobotics.com /showthread.php?t=1312 My Blog http://forums.trossenrobotics.com/blog.php?u=1492
I feel that my project barely scratches the surface of SERVO 11.2008
55
Malone - Lego meets Sumo-edited.qxd
10/8/2008
7:06 PM
Page 56
When LEGO meets Sumo Running a SuGO tournament by PHIL MALONE
When I moved to Garrett County (a rural community in western Maryland), I really wanted to start a robotics club. I’d been working in underwater robotics for about 20 years, and I figured it was time for me to give something back to the community in the way of fun technical challenges for the area kids. Underwater robots are tough to build (water and electricity just don’t mix), so I decided that Sumo robots were the perfect place to start. The Inspiration After experimenting with several Sumo kits and even designing some of my own bots, I realized that traditional Sumo competitions require some technical expertise that I couldn’t expect from the kids I wanted to attract (yet). I put the idea on the back burner for a year while I mentored a couple of area FIRST LEGO League (FLL) teams, and helped out in some LEGO tech camps.
LEGOs Rule! When my desire to start a local competition resurfaced, I realized that I wasn’t utilizing an abundant resource in my area, namely LEGOs. It turned out that two area teachers “Chuck” and “Arlene” had been accumulating all kinds of the coolest LEGO parts and RCX Bricks for years and they loved seeing kids explore LEGO machines. So, the idea for a
56
SERVO 11.2008
LEGO/Sumo ’bot was hatched. Anyone who’s tried to build a LEGO/Sumo bot probably knows that it’s tough getting one to fit into the existing Sumo size classes. The RCX Brick (the original LEGO brain) is just shy of the mini-Sumo class size limits, so by the time you add motors, wheels, and a line sensor, you end up with a very top-heavy robot. Plus, until recently there was no easy way to add vision to the RCX, so the robots just run around hoping to get lucky and run into their opponent. For a Sumo bot to really be competitive, it needs to be able to detect its opponent, but LEGO doesn’t have a simple sensor that can be used to decide which way to turn. Since I’d used Sharp’s GP2D12 IR range sensor on my other Sumo bots, I wondered if it could be adapted to the LEGO RCX. The best way to find out was to see if anyone had already tried, so I started Googling. First, I found Andreas Peter, who had developed a fancy Sharp interface
Malone - Lego meets Sumo-edited.qxd
10/8/2008
7:06 PM
Page 57
using an external microprocessor, then I came across Philippe Hurbain, who had devised a simpler analog interface. That led me to Nitin Patil (founder of www.Mindsensors.com) who was selling a GP2D12-based sensor that plugged into an RCX using a standard LEGO cable. Woo Hoo! The good thing about the Mindsensors device is that it provides an actual range reading; but it also has its downsides. First, in order for it to get enough power to update at a reasonable rate, it has to be plugged into an RCX motor output. This means that for a left and right eye, you have four cables: two going into sensor inputs, and two sharing a common motor output. The next problem is that the sensor is very sensitive to battery voltage. After a short while, even fresh batteries start giving erroneous readings, which tends to make the Sumo bot spin. Cost is a bit of a problem, because the sensor costs $33. (That’s $66 per Sumo.) I was about to give this up as a lost cause, when I discovered a simpler unit that did everything I needed. Mindsensors also sells what they call a Long Range Dual Infra Red Obstacle Detector (DROD40). This device uses two IR LEDs and a central IR detector to sense the presence of an object in three zones: left, center, or right. The device indicates the position via a single RCX input channel as a stepped voltage. The DROD40 sells for $29 and is all that a self-respecting Sumo robot needs.
The DROD40 has a very clever circuit board with holes that match the standard RCX electrical plug. Initially, we used standard cables to connect the sensor to the RCX. However, because of the rough and tumble that Sumo bots must endure, these connections didn’t always stay connected. Eventually, we cannibalized some old cables by cutting them in half and soldering the wire ends directly to the sensor boards (see Figure A). This provided a much more reliable connection and also enabled us to permanently glue small LEGO plates to the sensors to give them a more robust mount.
Figure A. The MindSensors DROD40 sensor can be seen here in its final modified configuration. Hot melt glue adds some strain relief to the after-market sensor cable. Mindsensors also has a DROD40 that is compatible with the new NXT LEGO robots.
Conceiving the Event Format
Portland Area Robotics Society Sumo rules to insert a new class between the Japan and mini-Sumo classes.
By now, I’d decided how I wanted to run my competition. Since LEGO is such an instant gratification toy, I decided to throw out the classic design/build/test model, and embrace everyone’s “let’s just build it” roots. I would run a half-day event where people would turn up empty handed, sit down in a room full of LEGOs, build the coolest Sumo they could , and then battle it out on the Sumo ring. I even had a name for my event ... it would be called “SuGO” — a concatenation of Sumo and LEGO. With the right inflection, the name even makes a convincing Japanese battle cry. To try out the basic SuGO concept, I created a Sumo program using Robolab, beamed the program to some RCXs, and got a group of my FLL kids together to build and battle SuGO bots. Some of the resulting matches were really exciting, but others were very dull (lots of deadly embraces). It became clear that I had to be more creative to keep this fun. I needed to set some size and weight limits appropriate for a SuGO bot that would permit interesting designs but still create some technical challenges. I needed to encourage more clever drive systems rather than just letting the kids depend on lots of motors. Having the RCXs preprogrammed turned out to be a great way to get all ages involved (kids, moms, and dads), but I realized that I had to make the program more dynamic and adaptable to a wide range of drive systems (e.g.: really fast or really slow). So, to develop a successful SuGO class, I adapted the
Figure 1. The best way to avoid having to answer the same questions over and over again is to create simple hand-outs. This laminated card illustrates the correct way to hook up the motors and sensors. The “Mechanic” program loaded on the RCX is used to verify that the robot is wired correctly.
SERVO 11.2008
57
Malone - Lego meets Sumo-edited.qxd
10/8/2008
7:06 PM
Page 58
Sumo purists will notice that instead of sticking with traditional “metric” units, I’ve reverted to “English” units when defining the SuGO class. As an Australian who grew up with the metric system, it’s not that I don’t like meters and grams, it’s just that most American kids don’t know what they mean. It’s ironic that even the English don’t use ”English” units anymore. Too bad the colonists didn’t throw them overboard with the tea. Here are the resulting SuGO Class specifications: • The Dohyo diameter is 36”. •The robot must be made exclusively out of LEGO parts. •The only exceptions to this are batteries and IR eyes. •The robot may only use the following electrical parts: — 1 RCX Brick with batteries. — Up to three LEGO motors. — Up to two light sensors. — One set of DROD40 eyes. — One touch sensor. — Interconnecting cables as required by the motors and sensors. •The maximum robot size is 6” x 6” x unlimited (WxLxH) • The maximum robot weight is 1 lb, 8 oz.
Finally, Some Software Once I’d decided on the class specifics, I had to work on some programs. Embedded programming is my “thing,” so I was looking forward to this. During the experimental SuGO matches, it was quite common for the robots to get locked together and either bog down or circle the table in a very non-dancing-with-thestars kind of way. To keep things interesting, I needed to
Figure 2.The GEARS color scheme is “Sponge Bob Yellow,” so your energy level peaks just by entering the room. The electrical parts are seen in the foreground and are controlled by the event coordinator. Teams are given a basic kit of electrical parts when they register; this includes the pre-programmed RCX, two motors with leads, a line sensor, and a set of IR eyes. The bulk of the remaining LEGOS are laid out on a 4x8 table in the center of the room and are up for grabs.
58
SERVO 11.2008
restart matches quite often. The problem was that my initial SuGO program demonstrated the classic Sumo behavior: Go forward until you either see the white line or see the opponent. If you see the line, back up and turn. If you see the opponent, turn towards it and push! Unfortunately, it didn’t know how to get unstuck from another robot. What I needed was some method to break a deadlock between the robots, and to implement that method; I needed a better language. So, I got back on Google and discovered NQC (Not Quite C) and the Brickx Command Center. These two tools let me get back into my programming comfort zone and think in terms of functions, tasks, and variables rather than sub-VIs and colored containers. What I ended up with was a system whereby the robot keeps track of how long it’s been doing the current action, and if it gets stuck doing the same thing for too long, it backs off and makes a random evasive maneuver. This is implemented as two tasks: A “Move_Sugo” task that deals with normal Sumo behavior; and a “Deadlock” task that kicks in to break an obsessive behavior. In the end, the implementation was pretty simple. A number is assigned to each action the robot takes in response to sensor input (e.g.: turning away from the whiteline sensor is action 1; turning left based on the left eye is action 4, etc.). The Move_Sugo task is responsible for polling the sensors and taking the appropriate action (setting the motor speeds, etc.). It then sets an “Action” variable to indicate what action the robot is currently taking. The Deadlock task runs in the background watching the Action variable. Whenever the variable changes to a new value (indicating a new action), the task clears a timer back to zero. However, if the timer ever reaches a certain value (called BREAK_DEADLOCK), then it’s time to break things up. The Deadlock task shuts down the Move_Sugo task and drives the robot through a random avoidance motion. Once that’s complete, it resets the timer and restarts the Move_Sugo task. Just for fun, the robot plays a tune to let everyone know that it’s not giving up, it’s just getting a better grip. Since the RCX brick has five program slots, I configured four SuGO strategy programs and one test program. (All five programs may be downloaded from the SERVO website at www.servomagazine.com). The four SuGO programs are almost the same except for the type and duration of turns that are made. Whereas a tankbot needs to use full differential steering, a speedybot needs to keep one wheel stopped when turning. The programs are called Elephant, Rhino, Lion, and Cheetah to help the kids figure out which program they should use based on their robot’s own characteristics. The test program (or Mechanic) is used to verify that all the robot’s cables are plugged in correctly and that the motors are running in the correct directions. It directs the robot through a sequence of motions that let you isolate any problems, and then makes noises based on what the various sensors see. Trust me, a set of eyes that are
Malone - Lego meets Sumo-edited.qxd
10/8/2008
7:07 PM
Page 59
Figure 3. During the 2 1/2 hour build period, teams design and build their SuGO bots. Many teams are family groups with moms or dads learning alongside their kids. It’s amazing how many times we hear the mantra: “I wish we had LEGOs like this when I was a kid.”
incorrectly plugged into the line sensor input can make for a very erratic Sumo bot. Before any robot can compete, it needs to “see” the Mechanic. I have laminated cards (see Figure 1) to show how to connect up the devices and what each step of the test program does so the kids can prep their own robot.
Game Day We run SuGO events on the first Sunday of each month, from 1:00 pm to 5:00 pm. Construction starts right at 1:00 pm and the competitions follow at 3:30 pm. We run free community event announcements on the radio and in the local paper during the week leading up to game day. The local Chamber of Commerce is a great asset in getting the word out, and if we include a photo from the last event the paper will usually print that, as well. The venue is a county-owned facility, made available by the Garrett Engineering And Robotics Society (GEARS). We
Web Links The SuGO website includes a set of SuGO rules and specifications, a how-to guide, building instructions for a simple SuGO robot, and online event registration. http://sugo.gearsinc.org
Figure 4. Once building is complete, play moves out into the arena area. GEARS also hosts the county’s FIRST Robotics Competition Team 1629 so we run our SuGO matches at one end of the FRC practice field. Team 1629 members take full advantage of the audience and demonstrate the operation of past FRC robots. 2006 and 2005 robots can be seen behind the SuGO rings, as well as the “Rack” from the 2006 competition.
have a 1,000 sq foot room where we set up a 4’x8’ table for all the LEGO parts, and then a bunch of folding tables for construction (see Figures 2 & 3). The actual competition is run in the arena section of the GEARS building (see Figures 4 & 5). We run each competition as a very informal event, as many of the teams are actually family groups. We do have a weigh-in and an official sizing box, but beyond that it’s all about the fun of learning what works and what doesn’t. I think the most anticipated part of the day is when we have our free-for-all when up to eight robots play at once and it’s all about the last bot standing. Anyone who’s a serious Sumo bot competitor will recognize that our SuGO format embraces the joy of building and doesn’t get much into game strategy or software. I’m hoping that as our players get more experience and reach the limits of my canned programs, they will want to start an Advanced SuGO competition, where each player programs their own robot. As it is, I’m still waiting for someone to use the part of my program that turns on the third motor when the opponent is directly in front. Can you say flipper? SV
Pictures from our first event. http://sugo.gearsinc.org/event_10-15-06.shtml Garrett Engineering And Robotics Society, Inc. www.GEARSinc.org The product page for DROD40 infrared sensors. www.mindsensors.com/index.php?PAGE_id=30 Brickx Command Center. http://bricxcc.sourceforge.net/ Not Quite C. http://bricxcc.sourceforge.net/nqc/
Figure 5. A dad helps a young participant to get a SuGO match under way. Notice that the competition is not all about function. Aesthetic design is also important. Everyone joins in with the starting chant: Ready, Set, SuGO!
SERVO 11.2008
59
Simpson-SV-edited.qxd
10/8/2008
4:41 PM
Page 60
Build a
GPS SMART LOGGER
by Michael Simpson
I recently did a GPS series covering various GPS modules and their interfaces. A project that I have had in mind for a while was a small GPS Smart Logger. I call it a smart logger because in addition to the GPS data, you can log various other telemetry. You can also set the conditions and type of GPS data that gets logged.
W
hen I started this project, I came up with the following requirements:
• • • • • • • • • •
Self-contained operation Able to operate on battery for 24 hours Able to detect low battery levels Log data must be written to SD memory card WAAS support Single button operation LED indicators 3.3V operation Ability to log additional data Must cost under $150 to build
I call this a smart logger because you have the ability to choose what does and does not get written to the SD memory card. You can also use one of the many analog-todigital (A/D) lines on the DiosPro to log additional data. I chose to operate the smart logger at 3.3V for a couple of reasons. First, both the SD card and the GPS module operate at that voltage. Second, the lower the operating voltage, the more run-time for a set of batteries. The DiosPro microcontroller chip that I have chosen to use in this project will operate at 3.3V just as easily as it will at 5V. The DiosPro also supports an LVD library that is
60
SERVO 11.2008
capable of detecting a low voltage drop. This is important to prevent log file corruption when the battery dies. The wiring diagram for the project is shown in Schematic 1. I have used a couple of techniques to make hookup easier. Notice that the two LEDs are connected to two ports each. Ports 0 and 2 are held low, so this provides a ground for the LEDs. While this uses a port on the DiosPro, it does make the connection of the LEDs much simpler, as you will see later. Another shortcut I have taken is to tie both leads on the record button to ports 6 and 7. The DiosPro has the ability to hold ports 0-7 high with a weak internal resistor. Port 6 is held low so that when the record button is pressed, this forces port 7 low, as well. The EM 408 GPS connection is straightforward. I have simply connected it to the onboard UART. Notice how the Enable lead is also tied to VCC. This needs to be done in order for the GPS module to operate. The SD memory card interface utilizes the Dios MMC library and is forced to use I/O ports 10, 11, and 12. The CS (Card Select) is configurable and can be set to any port. In this case, I have used port 13.
Construction You will need the following components in order to
Simpson-SV-edited.qxd
10/8/2008
4:42 PM
Page 61
complete this project. Please refer to the parts list later in the article for part numbers.
Schematic 1
Major Functional Components: • DiosPro 28 chip • Dios Carrier 1 • EM 408 GPS • SD breakout board • EZRS232 (needed for Programming the DiosPro) • SD memory card Additional Components: • Pushbutton • Twored LEDs • Two green LEDs • 100 µF capacitor • On/off switch • Jumpers • Battery holder • Battery connector clip • Two 1K resistors • 36-Pin female header • 40-Pin male header • Two 4.5” x 3.5” pieces ofpPlastic • 3.3V regulator • Four #4 x 1” stand-offs (F-F) • Female crimp pins • Eight #4 x 1/2” machine screws • Eight #4 hex nuts • Double stick foam tape
sure to solder at both the entry pad and the pad located at the tip of the pin. Now gently twist the regulator and insert the remaining pin into the hole shown in Figure 5. With the regulator attached, you can now attach the two 16-pin headers on the top of the board as shown in Figure 6. Take an additional two pin header and attach it to the position marked J2.
You will also need a copy of the Dios compiler. This compiler is free and can be found on the KronosRobotics website at www.kronosrobotics.com. • STEP 1: The first thing you need to do is to build the Dios Carrier 1. Build it according to the included instructions but hold off attaching the two included 16-pin headers as shown in Figure 2. The carrier comes with a 10 µF capacitor and this is plenty for the circuit; however, you may want to replace it with a 100 µF capacitor. This will keep the insertion of the memory card from resetting the DiosPro chip. A 100 µF capacitor won’t fit on the board, so you will have to bend the pins and insert it at an angle. • STEP 2: The project requires a 3.3V regulator to power the circuit. The most compact way to do this is to attach it directly to the Dios Carrier 1 board. Take the regulator and insert pins 1 and 2 into the board as shown in Figure 3. From the underside of the board, bend pin 1 on the regulator and solder it in place as shown in Figure 4. Be
• STEP 3: You will need to cut two pieces of plastic like the ones shown in Figure 7. I used compressed PVC cut to 4.5” x 3.5”. The bulk of the size of the project is devoted to the batteries used to power the device. I am using a six AA cell pack to power my unit. If you want to use a small 9V-like battery, this would allow you to create a much smaller enclosure. The trade-off, however, would be less run-time. Place four small 1/8” holes in each corner about 1/8” from both edges. A trick I use to place the holes all in the same place in each corner is to drill one hole in one piece. Then use that hole to mark Figure 3 each of the
Figure 2
SERVO 11.2008
61
Simpson-SV-edited.qxd
10/8/2008
4:43 PM
Figure 4
Page 62
Figure 5
corners in the other piece. You do this by flipping the piece with the hole as needed. Once all four holes are marked, drill them out and use this piece to make the original. Take the completed carrier module and attach some double stick foam tape to the bottom, then attach the carrier to the base as shown in Figure 8. Notice how I placed stand-offs on the board so I can judge the distances better. • STEP 4: The EM 408 comes with a small cable that needs to be modified for this project. You can purchase an extra cable from SparkFun, if needed. Cut one end and attach the leads to small headers as shown in Figure 9. • STEP 5: Take the SD memory breakout board and attach a five-pin header into the first five pads shown in Figure 10. Take a few pieces of double stick foam tape and attach them to the memory board as shown in Figure 11. Now take the EM 408 and attach it to the memory board as shown in Figure 11. Make sure Figure 7
Figure 8
Figure 6
the antenna connector is off to one side of the card slot. This way, if you decide to use an external antenna it won’t be in the way when you insert the memory card into its socket. Place some double stick tape on the bottom of the memory breakout board and attach it to the base as shown in Figure 12. • STEP 6: Take a red LED and attach a 1K resistor as shown in Figure 13. Then cut the leads so that they can slip into the crimp pins as shown in Figure 14. You can also solder the leads to the crimp pins. As an option, you may connect a small bit of heat shrink to the leads as shown in Figure 15. Repeat the step with the green LED. If you don’t want to use the crimp pins, you can use a two-pin female header instead. • STEP 7: Attach two crimp pins to a pushbutton as shown in Figure 16. You can also use a female header. The actual connection technique depends upon the type of button that you use. As before, you can cover the leads with heat shrink. • STEP 8: Attach the red LED to ports 0 and 1 as shown in Figure 17. Make sure the flat side of the LED is connected to port 0. Attach the green LED to ports 2 and 3. Make sure the flat side of the LED is attached to port 2. Attach the button to ports 6 and 7 as shown in Figure 17. • STEP 9: You need to build a battery connector assembly. This connector will work with the six-cell battery Figure 10
Figure 9
62
SERVO 11.2008
Simpson-SV-edited.qxd
10/8/2008
4:44 PM
Page 63
holder, as well as a nine-volt battery. Take the battery clip and attach the ends to a small twopin female header as shown in Figure 18. Cut the red lead at about 3.5 inches from the clip. Strip and solder each red lead to a small toggle switch as shown in Figure 18. Attach the cable assembly to the carrier board as shown in Figure 19. Make sure the black lead faces the capacitor. • STEP 10: At this point, you can perform an LED test. Before you can do that, you need to build the EZRS232 driver. The EZRS232 driver comes with a male header so you have two choices. The first is to install a five-pin female header in place of the included male header as shown in Figure 20. Another option is to create a female-to-female connector by attaching two five-pin female headers together and using this as an adapter.
Figure 12
Figure 11
Figure 13
• STEP 11: Attach the battery to the battery clip and the LEDs should begin to light. This is because each DiosPro chip comes preprogrammed with a test program. Attach the EZRS232 to the Dios Carrier as shown in Figure 21, then connect the nine-pin cable to your PC and start up the Dios compiler. Load and program the included file called DiosLEDtest.txt into the Dios. The two LEDs should blink and then stop when the button is pressed. • STEP 12: I will be using some small female-to-female jumpers to connect the memory card and GPS module to the Dios carrier. These can be purchased from Schmartboard at www.schmartboard.com/index.asp? a=11&id=42. We need to create a couple of split power connectors. In order to do this, take three of the jumpers and cut them in half. Then connect three of the pieces to create the split jumper shown in Figure 22. You will need to make two of these jumpers.
Figure 15
Figure 14
• STEP 15: For the following connections, you need to refer to Schematic 1 and the Dios Carrier 1 manual to help you find the pin location. Connect a jumper between the GPS TX lead (black) to the carrier port 8. Next, connect the GPS RX lead (white) to the carrier port 9. At this point, you can test the GPS. Apply power to the Dios and attach the RS-232 driver. Load and program the Dios with the file called DiosEM408test.txt that I have Figure 16
Figure 17
• STEP 13: Take one of the split jumpers and connect one end to the J1 pin 2 as shown in Figure 23. Then connect one of the other ends to the GPS GND lead (black). Connect the last end to the memory board pin 5 (GND). With the second split jumper, connect one end to the J1 pin 1 as shown in Figure 23. Then connect the other ends to the GPS VCC and Enable leads (white and red). • STEP 14: Take a single 5” jumper and connect it to the VCC pin (marked +) on the carrier and the VCC lead on the memory board (pin 3) as shown in Figure 24. SERVO 11.2008
63
Simpson-SV-edited.qxd
10/8/2008
4:45 PM
Page 64
Figure 19
Figure 18
• STEP 17: In order to attach the stand-offs, insert a 1/2” machine screw through a hole in the bottom base, then attach two nuts to the screw and finally the 1” stand-off (as shown back in Figures 8 and 12). This configuration will make the six-cell battery holder fit tightly inside the enclosure. If you use another kind of battery, you will need to adjust accordingly.
Figure 20
Figure 21 Figure 22
included. The GPS Dios should start to display NEMA information to the debug terminal. • STEP 16: Make the following connections to complete the hookup: • • • •
Connect the memory card pin 1 (CS) to the carrier port 13. Connect the memory card pin 2 (DI) to the carrier port 10. Connect the memory card pin 4 (CLK) to the carrier port 12. Connect the memory card pin 6 (DO) to the carrier port 11.
Now insert an SD memory card into the memory card breakout board and apply power. Then plug the EZRS232 driver into the carrier and load the Figure 23 program file called DiosLogEM408.txt. This is the main logger program. If the memory card is working properly, you should se a message that looks something like this: Memory Card Initialized Volume Type=FAT16 Partition starts at sector 0.101 Reserved sectors 7
64
SERVO 11.2008
Each cluster has 8 sectors Number of fat tables 2 Each FAT has 244 sectors Root has 512 entries or 16384 bytes. 32 sectors Fat1=0.109 Fat2=0.353 Root=0.597 Data=0.629 Memory Card Initialized
• STEP 18: In order to attach the top base, you will need to line up the LEDs and buttons to create some holes. There are a couple of ways to do this. One way is to cut out a piece of tracing paper that is the same size as the base and place it over the LEDs, then mark the LED and button positions. Before drilling the holes, add an extra 1/8” between the two LEDs. For the LEDs, I drilled 5/32” holes. The button will depend on what is used. If you use a button that mounts to the top base, then you can attach wires to the leads and route them to ports 6 and 7. In this case, the button can be placed in several locations. You will also need to drill a hole for the power switch. The actual diameter will depend on the switch you use. Attach the base to the stand-offs with four 1/2” machine screws as shown in Figure 25. You will probably have to bend the leads on the LEDs in order for them to fit properly. This is normal, and if you used heat shrink as insulation, should not present a problem.
Smart Logger Operation When power is applied to the smart logger, it will test the memory card for a file called LOGDATA2.txt. If it is not found, a 20 meg file will be created. This is just a place holder file and will be truncated as necessary when collecting data. Startup Indicators • Red LED blinks four times and stops — Smart Logger is ready and in run mode. • Red and green LEDs alternate a one second blink — Memory card failure. • Red LED does nothing — Battery dead. • Red LED blinks four times then green LED flashes
Simpson-SV-edited.qxd
10/8/2008
4:45 PM
Page 65
fast — Battery low. Fix Indicator • Green LED alternates on and off every second or so — Smart Logger is ready and in run mode with no Fix. • Green LED flickers on with one quick blink — GPS has a SPS mode 1 Fix. • Green LED flickers on with two quick blinks — GPS has a DGPS or WAAS mode 2 Fix. • Green LED flickers very fast constantly — Indicates battery level has dropped too low for operation. • Green LED fails to light at all — Battery dead. Record Indicator • Solid Red LED — When record button is pressed, the LED will light solid red until the button is released. Press a second time to exit record mode. • Red LED flashed quickly — Each time a NEMA GGA or RMC message is saved, the red LED will flash quickly. • Red LED not flashing — Not in Record mode. Each line of data is actually written to a buffer and when that buffer reaches a value of 512 bytes, it is saved to the SD memory card. When recording is stopped or the battery level drops too low, the buffer is also saved to the memory card. It is not recommended that you remove the memory card while in record mode; you could corrupt the log file. Take the logger out of record mode first. You can stop and start the record mode at will. When restarted, it will append data to the end of the log file. Note that if power is removed, the logger will start back at the beginning of the file when power is restored.
How Well Does it Work? On a freshly charged set of 2,000 mAh rechargeable batteries, I get about 20 hours of record time. This could probably be extended if the LEDs were turned off completely. By only recording the GGA and RMC messages, we can store about 39 hours of data in a single 20 meg file. Because of the way I set up the addtofile function, only 65,000 sectors can be written to the file on the SD memory card. This is about 33 meg. If you need to store more data, then you need to add more code to flush the current file and open up a second. Another option would be to modify the Figure 24 addtofile and setfilesize functions to handle a larger sector counter. I have included a sample log file that I created using the Smart Logger and I have to say it worked perfectly. The logger is small enough to fit into most robots that would be using GPS and can be made even smaller if you remove the battery and power it from your robot’s logic power source.
Going Further If you look closely at the code in the DiosLogEM408.txt program, you can see that I have added my own NEMA messages. When a low battery is detected, a “$GPMSG,1,LowBat*7C” is sent to the log. The DiosPro has several unused digital and A/D ports so it would be possible to add additional data to the log file. This would enable you to actually record robot control telemetry, as well as sensor data. The DiosPro supports a sleep mode so it is possible to log intermittent data. This would allow you to log days worth of data on a single charge. While the Smart Logger was built for logging GPS and telemetry data for robotic applications, there’s no reason you can’t use it to log positional and speed data in your automobile.
SparkFun Data Logger I would be remiss if I didn’t mention the SparkFun data logger module. For those of you who want a pre-built data logger module, this may be what you are looking for. The GPS Logger v2.4 is a self-contained module. All you need to add is four to seven volts DC. The module has an EM406 GPS module installed on the top as shown in Figure 26. It supports up to a 1GB SD memory card which is inserted on the bottom as shown in Figure 27. To power the module, I recommend a set of 2,000 mAh rechargeable batteries and a battery holder like the one shown in Figure 28. SparkFun also sells a battery holder with a two-pin connector that mates directly with this module. With this power source, you will get just under 12 hours of operation with a steady stream of data writing to the memory card. You will get a couple days of run time if you opt for an intermittent write of once every few minutes. Once you insert a memory card and apply power, the module will create a default config file called GLOGCON. TXT as shown next. By default, the config file will be set to mode 1, which will log all data. By changing this to mode 1, you can set the time between logs, thus putting the module to sleep when it is not writing. Another setting you will want to change if you are in the US is the WAAS setting. By setting this to 1, the module’s accuracy Figure 25
SERVO 11.2008
65
Simpson-SV-edited.qxd
10/8/2008
4:46 PM
Page 66
If you decide to use the SparkFun module, here are a few tips:
Figure 26
• The module does not monitor the battery so it’s up to you to make sure you don’t drain the batteries completely. If you do, you will probably corrupt the card and it will require reformatting. For long-term logging, you will want to use the intermittent write method mentioned previously. Figure 27 • You need to hit the small button on the module to stop the logging operation. This can be a problem if you mount the module in any kind of enclosure. You can connect an external button to the two outside leads on the button. This way, you can route them to any location on your enclosure. • To mount the module to an enclosure, place some double stick tape on the top of the GPS antenna and stick the module to the underside of the top of your enclosure. • If the power connector gets in your way, try removing the connector completely and soldering a couple of wires to the bottom of the board.
Final Thoughts Figure 28
will be greatly increased. Mode = 0 Log What = RMC;GGA;GSA Time Between Logs = 00:10:00 Holdoff = 5 WAAS = 0 Max Time to Lock = 300
All in all, the SparkFun data logger works pretty well and presents itself in a very small package. The output on the SD memory card is NEMA 0183 so you won’t have any compatibility issues. If, however, you want total control over the output and the ability to log some of your own messages such as A/D, you will want to stick with the GPS Smart Logger. The cost is about the same for both systems. Be sure to check for updates and downloads for this article at www.kronosrobotics.com/Projects/GPSLOG. shtml. SV
Parts List The following is a breakdown of the sources for all the componets referenced in this project.
SMA to MMCX Adapter Cable (optional) www.sparkfun.com/commerce/product_ info.php?products_id=285
SPARKFUN ELECTRONICS EM-408 GPS Module www.sparkfun.com/commerce/product_ info.php?products_id=8234
GPS Logger v2.4 www.sparkfun.com/commerce/product_ info.php?products_id=8237
DF-MMC Breakout Board www.sparkfun.com/commerce/product_ info.php?products_id=204
SCHMARTBOARD 5” Yellow Jumper www.schmartboard.com/index.asp?a=11&id=42
Nine-Pin Serial Cable www.sparkfun.com/commerce/product_ info.php?products_id=65
KRONOS ROBOTICS EZRS232 www.kronosrobotics.com/xcart/product. php?productid=16167
External Antenna with SMA Connector (optional) www.sparkfun.com/commerce/product_ info.php?products_id=464
66
SERVO 11.2008
DiosPro 28 Chip www.kronosrobotics.com/xcart/product. php?productid=16429
Dios Carrier 1 www.kronosrobotics.com/xcart/product. php?productid=16170 800 ma 3.3V Regulator www.kronosrobotics.com/xcart/product. php?productid=16565 Six-Cell Battery Pack www.kronosrobotics.com/xcart/product. php?productid=16321 36-Pin Female Header www.kronosrobotics.com/xcart/product. php?productid=16291 Female Crimp Pins www.kronosrobotics.com/xcart/product. php?productid=16261
SV-GiftSubAd2008.qxd
10/7/2008
4:07 PM
Page 67
Give the gift that lasts all year!
Go to
www.servomagazine.com to enter your gift order!
Be sure to use promotion code Y8WXMS when ordering.
U.S. Prices 1 Yr – $24.95 2 Yr – $45.95 3 Yr – $65.95
Subscribe online at: www.servomagazine.com or call: 877-525-2539 (toll free) / 818-487-4545 (outside US)
RoboResources-Nov-edited.qxd
10/6/2008
12:18 PM
Page 68
Tune in each month for a heads-up on where to get all of your “robotics resources” for the best prices!
Hand Tools for Robot Construction Imagine robot building during Neanderthal times. Your only tools were various rocks, maybe an antler or two, and wood sticks that everyone else in your camp used for throwing at animals they wanted to eat. This most certainly made constructing that perfect line follower very difficult. Be grateful you live in the 21st century, where tools are the mainstay of our industrial existence. Starting with just the lowly screwdriver, an assortment of the right tools and the right time helps you build better, stronger robots. In this column, we review some of the more common hand tools used in building the average robot. There’s no way to discuss every tool you’ll possibly see or use, but we’ll cover the most important ones that you won’t want to be without. In the Sources section, you’ll find online suppliers of hand tools in various price ranges. (To learn more about power tools useful in the roboto building trade, check out the April 2008 column).
What’s in Your Toolbox? The most common tool for any kind of robot construction is the screwdriver. Because screws have different types of heads (usually slotted or Phillips) and heads of different sizes, you’ll need a couple of sizes to meet most any demand. At a minimum, get #1 and #2 Phillips,
68
SERVO 11.2008
and medium- and small-tip slotted drivers. Magnetic tips are handy, but not necessary. For working with slotted screws, get a small and medium size flat blade screwdriver. If space in your toolbox is limited, consider a set with one screwdriver handle and multiple bits. (You just exchange the bits depending on the screw you’re working with.) Whatever you buy, don’t cheap out. You’ll use your screwdrivers more than most any other tool, so test the grip for comfort. The plastic should not dig into your palm. Try soft (rubber) coated grips for extra comfort. Miniature fasteners (those 4-40 and under) require smaller screwdrivers. Purchase a set of #00 and #0 Phillips, and small-bladed slotted “jeweler’s” screwdrivers. Standard and needle-nose pliers are the next most common tool used in making robots. Pliers hold things with a stronger grip than you can apply with just your fingers. A pair of both standard and needle-nose pliers is sufficient for 90% of all jobs. Avoid using either one as a wrench for tightening bolts and nuts. They’ll strip the head of the fastener. A pair of “lineman’s” pliers can be used for bigger jobs, and they provide a sharp cutter for clipping non-hardened wire (don’t use them to clip steel aircraft cable or music wire). If your robot uses nut and screw construction, you’ll want a nut driver to secure the nut while you’re tightening the screw with the screwdriver (or
vice versa). Nut drivers are typically sold in sets for nuts from #2 size to 3/8”. You may find some other types of wrenches useful. Locking grip pliers — such as the Vise-Grip brand — incorporate a mechanism that literally locks around whatever object you want to hold, saving your hands considerable effort. There’s also box wrenches, socket wrenches, adjustable wrenches, and a slew of others, but unless you’re building the larger metal combat robots, you probably will have little use for these. A mainstay of robot building is a hacksaw, purchase one with a sturdy metal frame. Look for a tool that allows quick blade changes, yet holds the blade securely. Common blade sizes are 10 and 12 inches long, and many hacksaw frames are adjustable to accommodate either one. The smaller size is recommended when working with metal, as the short blade gives you more control of the tool. Purchase an assortment of carbide-tipped blades in 18 and 24 teeth-per-inch (tpi). Though most robots are not made with nails, a standard 16-ounce hammer is a useful tool for any workshop. You might use it to hammer a small metal bracket into a new shape, or softly knock at the corners of your robot to ensure the frame is square. You will need drill bits and a drill if you want to make any holes. I personally recommend a small electric drill rather than a hand drill,
RoboResources-Nov-edited.qxd
10/6/2008
but either will work as long as your robot is made of plastic or wood. Drill bits are commonly sold in convenient sets. Opt for the better quality titanium oxide coated drill bits. They cost more, but they’ll stay sharp longer, which means you won’t have to replace or resharpen them as much. The typical set contains bits with sizes from 1/16” to 1/4”. If and when you need to replace a bit, you can purchase them separately in just the size you need. You’ll want a tape measure if you are building robots from scratch. I prefer a six to 10 foot metal tape measure with a spring-loaded mechanism that automatically retracts the tape. If most of your robots are small though, a compact three to six foot cloth or plastic tape measure may be more appropriate. You can find these at fabric and notions stores in various sizes and types. Last, but certainly not least is a pair of safety glasses. As you cut, hammer, or chisel your robot into shape, bits of material are bound to go airborne, and if you’re unlucky, some of this debris may take a bee-line into your eye. You obviously want to avoid this, and a pair of good safety glasses or goggles is your best defense from a painful, costly, and possibly debilitating eye injury. Be sure they prevent material from entering the eyes from the sides as well. This requires a full wrap-around design. I wear a pair of 1970’s industrial safety glasses that provide a wrap-around shield over the temples; these are popular among machinists. A really good pair can be fairly expensive because of the plastic used in the lens. A less costly approach suitable for use in machine shops is rubber safety goggles. These use a nearly unbreakable, optically clear rubber to form the lens and body. They’re available at most any hardware or tool store. Word to the wise: Stay away from the very cheap goggles and glasses. Because of poor manufacturing, they may distort your vision or fit poorly.
12:19 PM
Page 69
Where to Get Your Tools I always recommend that you buy only the best tools you can, because better tools not only last longer, they perform better. But it’s not always practical to buy the best. When necessary, you can purchase low-cost versions that don’t require accuracy or heavy-duty construction. A $1 screwdriver will do the same basic job as a $10 one, but it may not last as long or feel as good in your hands. Shop wisely, and you can better afford all the tools you need while still maintaining reasonable quality. For basic, inexpensive tools, try the selection at the local discount or dollar store. I’ve found perfectly good screwdrivers, utility knives, and other basics at these locations. I always prefer buying better quality when buying wrenches and pliers, because a cheap tool here often results in ruined parts. You don’t need mechanic’s grade tools, but you want to stay away from the mass-produced junk. Something middle of the road will do. Quality name-brand hand tools designed for the do-it-yourselfer are available at hardware stores, online, and department stores. Craftsman and Crescent are representative of this group.
Sources Of course, your local hardware and home improvement stores are good places to start when building up your tool chest, however, there are literally thousands of online sources for tools. I’ve provided just a sampling of them here. Remember that many of the regular advertisers in SERVO and Nuts & Volts carry hand tools so check them out first.
Enco Manufacturing Co. www.use-enco.com Enco is a premier mail order source for shop tools, power tools, hand tools, production tools (lathes, mills, hydraulic presses, metal brakes,
you name it), bits, saws, casting materials, plastics, hardware safety equipment, and more.
FDJ On Time www.fdjtool.com For the jewelry maker, FDJ/On Time is a “one-stop shop” for miniature jewelry tools, casting equipment, soldering supplies, electroplating gear, cleaners, mold making equipment, and wax working tools. They offer an extensive list of investment casting supplies (furnaces, investment, etc.). A printed catalog is available.
Harbor Freight Tools www.harborfreight.com Harbor Freight built a business on selling value-priced tools, much of it “off-brand,” but still perfectly workable. They offer hand and power tools, pneumatic tools, and even metal mills and lathes. Retail stores in selected areas of North America; check the website for a store locator.
Irwin Industrial Tools www.irwin.com Irwin makes the famous Vise-Grip locking hand tools, along with several other well-known brands. This is a good site for learning about common shop tools and how they’re used. Micro-Mark www.micromark.com Micro-Mark manufactures precision and miniature tools of all types, including desktop mills and lathes, as well as hand tools, bits, and other accessories, small hand-operated motorized tools, casting supplies, and raw metal, plastic, and wood.
Minicraft www.minicrafttools.com Sellers of Minicraft precision power tools (sanders, saws), as well as quality hand tools.
Penn State Industries www.pennstateind.com Hand and motorized tools (mostly SERVO 11.2008
69
RoboResources-Nov-edited.qxd
10/6/2008
12:19 PM
Page 70
for wood). The Library section contains information about the tools (many in Adobe Acrobat PDF format), as well as plans for home-based projects (no robots that I could find).
Rockler Woodworking and Hardware www.rockler.com
Sears Brand www.sears.com Sears sells lots of stuff, but of prime interest to robot builders are their tools. You can buy Sears tools at their local stores or online.
Rockler carries hand and power woodworking tools, hardware, and wood stock.
Stanley Supply and Services www.stanleysupplyservices.com
S*K Hand Tool Corporation www.skhandtool.com
Tools for electronics — basically everything you need, including handheld meters and scopes, precision hand tools, shop supplies, soldering stations, you name it. Wide selection.
Wrenches, ratchets, and other great hand tools. Buy a set when you’re young and they’ll grow old with you.
Toolsforless.com www.toolsforless.com Power tools, hand tools. Stocks some 50,000 power and hand tools, hardware, parts, and accessories.
Vermont American Corporation www.vermontamerican.com Tool manufacturer. Saw blades, screwdriver bits, router products, drill bits, abrasives. Browsable Web catalog; products are available through retail stores like Lowe’s and Home Depot.
Zona Tool Company www.zonatool.com
ClassPack and CoroBot …where Virtuality meets Reality
x puts a virtual robot in the hands of every student x lowers the cost of project development without effecting long-term results x reduces lab down-time x physics-based simulation environment x multiple licensing options available
www.corobot.com ®
1-800-641-2676 www.corobot.net
LINEAR SERVOS Radio Control Industrial Robotics fi
70
SERVO 11.2008
Small precision tools for hobbies and crafts. Product line includes: clamps, pin vices, small hack saws, jeweler’s saws, metal and oxide shaping tools (replacement bits for Dremel and similar tools), and sanding blocks. Zona tools are most commly found at the local hobby store. SV THE OWNERSHIP, MANAGEMENT, AND CIRCULATION STATEMENT OF SERVO MAGAZINE, Publication Number: 1546-0592 is published monthly. Subscription price is $24.95. 7. The complete mailing address of known office of Publication is T&L Publications, Inc., 430 Princeland Ct., Corona,Riverside County, CA 92879-1300. Contact Person: Tracy Kerley. Telephone: (951) 371-8497. 8. Complete Mailing address of Headquarters or General Business Office of Publisher is T&L Publications, Inc., 430 Princeland Ct, Corona, CA 92879. 9. The names and addresses of the Publisher, and Associate Publisher are: Publisher, Larry Lemieux, 430 Princeland Ct., Corona, CA. 92879; Associate Publisher, Robin Lemieux, 430 Princeland Ct., Corona, CA 92879. 10. The names and addresses of stockholders holding one percent or more of the total amount of stock are: Jack Lemieux, 430 Princeland Ct., Corona, CA 92879; Larry Lemieux, 430 Princeland Ct., Corona, CA 92879; Audrey Lemieux, 430 Princeland Ct., Corona, CA 92879. 11. Known Bondholders, Morgagees, and other security holders: None. 12. Tax Status: Has not changed during preceding 12 months. 13. Publication Title: SERVO Magazine 14. Issue Date for Circulation Data: October 2007-September 2008. 15. The average number of copies of each issue during the proceeding twelve months is: A) Total number of copies printed (net press run); 10,812 B) Paid/Requested Circulation (1) Mailed Outside County subscriptions: 5,658 (2) Mailed In-County subscriptions: 0 (3) Paid Distribution Outside the Mail including Sales through dealers and carriers, street vendor, and counter sales and other paid distribution outside USPS: 1,809 (4) Paid Distribution by other classes of mail through the USPS: 0; C) Total Paid Distribution: 7,467; D) Free or Nominal Rate Distribution by mail and outside the mail (1) Free or Nominal Rate Outside-County Copies: 0 (2) Free or Nominal Rate In-County Copies: 0 (3) Free or Nominal Rate Copies Mailed at other classes through the USPS: 0 (4) Free or Nominal Rate Distribution Outside the mail: 800; E) Total Free or Nominal Rate Distribution: 800; F) Total Distribution: 8,267; G) Copies not distributed: 2,545; H) Total: 10,812; Percent paid circulation: 90.32%. Actual number of copies of the single issue published nearest the filing date is September 2008; A) Total number of copies printed (net press run) 9,871; B) Paid/Requested Circulation (1) Mailed Outside County subscriptions: 5,398 (2) Mailed In-County subscriptions: 0 (3) Paid Distribution Outside the Mail including Sales through dealers and carriers, street vendor, and counter sales and other paid distribution outside USPS: 1,806 (4) Paid Distribution by other classes of mail through the USPS: 0; C) Total Paid Distribution: 7,204; D) Free or Nominal Rate Distribution by mail and outside the mail (1) Free or Nominal Rate Outside-County Copies: 0 (2) Free or Nominal Rate In-County Copies: 0 (3) Free or Nominal Rate Copies Mailed at other classes through the USPS: 0 (4) Free or Nominal Rate Distribution Outside the mail: 1,300; E) Total Free or Nominal Rate Distribution: 1,300; F) Total Distribution: 8,504; G) Copies not distributed: 1,367; H) Total: 9,871; Percent paid circulation: 84.71%. I certify that these statements are correct and complete. Larry Lemieux, Publisher - 9/29/08.
Page 71.qxd
10/7/2008
4:13 PM
Page 71
Extreme Robot Speed Control!
inder w e d i S
6 6 6 6 6 6 6
$399
14V - 50V - Dual 80A H-bridges - 150A+ Peak! Adjustable current limiting Temperature limiting Three R/C inputs - serial option Many mixing options - Flipped Bot Input Rugged extruded Aluminum case 4.25" x 3.23" x 1.1”
Bo
RC Control $39.99
6 2.5A (6A pk) H-bridge 6 5V - 20V 6 1.6” x .625” x 0.25”
Fav ori te!
$104.99
$159.99
2+ price
Scorpion XXL
Scorpion Mini
tsIQ
Scorpion XL
6 Dual 20A H-bridge 45A Peak! 6 5V - 28V 6 2.7“ x 1.6” x 0.75”
6 Dual 13A H-bridge 6 5V - 28V 6 2.7“ x 1.6” x 0.5”
Introducing Dalf 6 6 6 6 6 6 6
Closed-loop control of two motors Full PID position/velocity loop Trapezoidal path generator Windows GUI for all features Giant Servo Mode! C source for routines provided PIC18F6722 CPU
$2
50 See www.embeddedelectronics.net
$2
19
H-bridges: Use with Dalf or with your Micro/Stamp Simple-H
OSMC 6 6 6 6
6 6 6 6
Monster power! 14-50V 160A! 3.15”x4.5”x1.5” 3 wire interface
$79 MADE
www.robotpower.com
THE
IN
6-28V 25A! 2.25”x2.5”x0.5” 3 wire interface current & temp protection
We also do consulting! Give us a call for a custom motor control to meet your exact needs
USA
Phone: 253-843-2504 s
[email protected]
5 reflectance sensors on underside
battery charger connector
Item #975 $99.95
piezo buzzer
4 AAA batteries (not included)
30:1 micro metal gearmotors
The Pololu 3pi robot is a high-performance, compact mobile platform featuring: * Two metal gearmotors * Five reflectance sensors * 8×2 character LCD * Three user pushbuttons * Buzzer and LEDs
* High-traction silicone tires * Speeds exceeding 3 ft/sec using innovative constantvoltage motor supply
optional power LED
ISP programming connector
All peripherals are connected to an ATmega168 microcontroller running at 20 MHz, with free C-programming push-on/push-off tools, libraries, and support for the Arduino environment. power button reset button
removable 8x2 character LCD user pushbuttons
robot diameter is 3π cm (~3.7 inches)
Find out more at www.pololu.com/3pi or by calling 1-877-7-POLOLU. SERVO 11.2008
71
WebstoreNov08.qxd
10/8/2008
7:09 AM
Page 72
The SERVO Webstore Attention Subscribers ask about your discount on prices marked with an *
“EDITOR’S PICKS”
Electronic Troubleshooting
This book is a 'must' for contestants preparing for the FIRST competitions — and for anyone who wants to know what really goes in to creating a practical robot with limited time and resources. $39.95
Editor Bryan Bergeron’s recommended reads. Find these and many more great titles in the SERVO Magazine Webstore!
! NEW
Enter the arena of the metal gladiators! Do you have what it takes to build a battle-ready robot? You do now! Here are the plans, step-by-step directions, and expert advice that will put you in competition — while you have a heck of a lot of fun getting there. Grant Imahara, the creator of the popular BattleBot Deadblow, shares everything he’s learned about robot design, tools, and techniques for metal working and the parts you need and where to get them. $24.95
Forbidden LEGO by Ulrik Pilegaard / Mike Dooley Build the Models Your Parents Warned You Against.
Forbidden LEGO introduces you to the type of freestyle building that LEGOs master builders do for fun in the back room. Using LEGO bricks in combination with common household materials (from rubber bands and glue to plastic spoons and ping-pong balls) along with some very unorthodox building techniques, you’ll learn to create working models that LEGO would never endorse. $24.95
72
SERVO 11.2008
Published by T & L Publications, Inc.
Save $10 off the normal per bundle price!! Now you can get one year’s worth of all your favorite articles from SERVO Magazine in a convenient bundle of print copies. Available for years 04, 05, 06, and 07.
$57
Robot Programmer's Bonanza
ROBOTICS by Grant Imahara
SERVO Magazine Bundles
FIRST Robots: Rack 'N' Roll Behind the Design
When things go wrong with your robot design, you'll need a logical approach — and know which tools to use — to get things working again. This book describes both the techniques and technologies you need to troubleshoot any electronic device. $49.95
Kickin' Bot
Lo W h ao k t New ’ s
Robot Building for Dummies
by John Blankenship, Samuel Mishal
by Roger Arrick / Nancy Stevenson
Discover what robots can do and how they work. Find out how to build your own robot and program it to perform tasks. 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 talk. Along the way, you’ll gather some tidbits about robot history, enthusiasts’ groups, and more. $24.95
Build Your Own Humanoid Robots by Karl Williams GREAT 'DROIDS, INDEED! This unique guide to sophisticated robotics projects brings humanoid robot construction home to the hobbyist. Written by a well-known figure in the robotics community, Build Your Own Humanoid Robots provides step-by-step directions for six exciting projects, each costing less than $300. Together, they form the essential ingredients for making your own humanoid robot. $24.95*
The first hands-on programming guide for today's robot hobbyist! Get ready to reach into your programming toolbox and control a robot like never before! Robot Programmer's Bonanza is the one-stop guide for everyone from robot novices to advanced hobbyists who are ready to go beyond just building robots and start programming them to perform useful tasks. $29.95
Robotics Demystified by Edwin Wise YOU DON'T NEED ARTIFICIAL INTELLIGENCE TO LEARN ROBOTICS! Now anyone with an interest in robotics can gain a deeper understanding — without formal training, unlimited time, or a genius IQ. In Robotics Demystified, expert robot builder and author Edwin Wise provides an effective and totally painless way to learn about the technologies used to build robots! $19.95 We accept VISA, MC, AMEX, and DISCOVER Prices do not include shipping and may be subject to change.
WebstoreNov08.qxd
10/8/2008
7:11 AM
Page 73
To order call 1-800-783-4624 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 Robot Builder’s Sourcebook — a unique clearinghouse of information that will open 2,500+ new doors and spark almost as many new ideas. $27.95 Sale Price $24.95
MEMS & Nanotechnology for Kids by Marlene Bourne Small is cool! What is nanotechnology? What are MEMS? And what makes them so special? Welcome to the wonderful world of really small stuff. Things so tiny, you need special microscopes to even see them. Winner of a 2008 IPPY Award (bronze medal) for best juvenile/young adult non-fiction, MEMS & Nanotechnology for Kids explores what you can find at the micro- and nano-scale; where you'll discover all sorts of amazingly small sensors, structures, and materials. Reg $24.95 Sale 18.95
I’m trying to understand the bailout plan! Do you? visit my online store @ www.ser v omagazine .com Linux Robotics by D. Jay Newman If you want your robot to have more brains than microcontrollers can deliver — if you want a truly intelligent, high-capability robot — everything you need is right here. Linux Robotics gives you stepby-step directions for “Zeppo,” a super-smart, single-boardpowered robot that can be built by any hobbyist. You also get complete instructions for incorporating Linux single boards into your own unique robotic designs. No programming experience is required. This book includes access to all the downloadable programs you need. $34.95
The Amateur Scientist 3.0 The Complete Collection by Bright Science, LLC There are 1,000 projects on this CD, not to mention the additional technical info and bonus features. It doesn’t matter if you’re a complete novice looking to do their first science fair project or a super tech-head gadget freak; there are enough projects on the single CD-ROM to keep you and 50 of your friends busy for a lifetime! $26.99
CNC Robotics by Geoff Williams CNC Robotics gives you step-by-step, illustrated directions for designing, constructing, and testing a fully functional CNC robot that saves you 80 percent of the price of an off-the-shelf bot — and that can be customized to suit your purposes exactly, because you designed it. Written by an accomplished workshop bot designer/builder, this book gives you everything you need. $34.95
SERVO 11.2008
73
WebstoreNov08.qxd
10/8/2008
12:54 PM
Page 74
Or order online www.servomagazine.com SPECIALS OFFERS
The Definitive Guide to Building Java Robots by Scott Preston
S AVE 10% plus GET FREE US SHIPPING! Buy both these books together in the month of November 2008 Building Robots with LEGO Mindstorms NXT
and
Programming Lego Mindstorms NXT
save 10% off the list price. Plus get free shipping in the US!! Call 800 783-4624 or order online @ www.servomagazine.com List Price $29.95 Sale Price $ 26.95 List Price $40.95 Sale Price $35.95
The Definitive Guide to Building Java Robots is for educators, students, hobbyists, and startups looking for Java/hardware interaction. This book shows you how to use your PC to build robots, and how you can interface with a microcontroller to do the basics. You’ll learn to design your robot to navigate, see, speak, recognize your face, listen to you, and build maps. $55.95 Sale Price $ 47.95
Robot Builder’s Cookbook
FREE! with any e purchas 0 over $10
by Owen Bishop This is a book for first-time robot builders, advanced builders wanting to know more about programming robots, and students in further and higher education tackling microcontrollerbased practical work. They will all find this book a unique and exciting source of projects, ideas, and techniques to be combined into a wide range of fascinating robots. $29.95 Sale Price $ 24.95
Phone-inly! n orders o
From HomoSapien to RoboSapien
SERVO Magazine T-Shirts
Before R2D2 there was R1D1
Get your very own limited-edition SERVO Magazine T-shirt. Shirts come in sizes S, M, L, and are available in either black or white. All shirts are 100% preshrunk cotton. Limited time offer. Call 1-800-783-4624. PROJECTS
Tankbot Kit & Alpha Brain Kit As seen in the Sept. issue Tankbot/ Brain Alpha by Ron Hackett A bi-monthly series filled with projects and experiments to challenge you through your learning process while you grow your fully expandable Brain Alpha PCB!
The Alpha Brain kit is an excellent way to The TankBot gives you everything you get started in robotics. The brain — a need to start building your own sturdy PICAXE-14A — is easily programmed in a servo-motor robotic tracked vehicle. dialect of Basic that includes many powerful Powered by two modified R/C servos commands. At the end of each of Ron’s (44 oz-in torque). The assembled Tankbot articles, he will include programming for that measures 7 inches long, 4.75 inches wide, month’s project. The kit also includes a 400 and 3.5 inches high. The top deck is point breadboard which allows for drilled ready for the Alpha Brain. For more considerable expansion and experimentation. info & pictures, visit the SERVO Webstore For more info & pictures, visit the SERVO at www.servomagazine.com. Webstore at www.servomagazine.com. $59.95 Sale Price $ 56.95 $99.95 Sale Price $ 85.95 Combo Price $ 138.95
74
SERVO 11.2008
The SERVO Buddy Kit
An inexpensive circuit you can build to control a servo without a microcontroller!
For more information, please check out your May 2008 issue or go to our website @ www.servomagazine.com Subscriber’s Price $39.55 Non-Subscriber’s Price $43.95 PCB includes article reprint.
Showcase Nov08.qxd
10/7/2008
7:19 AM
Page 75
T
6 UH ROGH TX UL LUH QJ G
7KH(VFDSH 5RERW¶VEXLOWLQ PLFURSURFHVVRU HQDEOHVLWWR ³WKLQN´RQLWVRZQ .65
7KHURERWIURJPRYHVIRUZDUG ZKHQLWGHWHFWVVRXQGDQG UHSHDWVVWDUWPRYHIRUZDUG !
VWRS!OHIWWXUQ!VWRS!ULJKW WXUQ!VWRS.65
PP:KLWH ZDWHUFOHDU /('9 PFG $%
VHFRQGYRLFHUHFRUGHUSOD\EDFN PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH SUHDVVHPEOHG $ 7KH9HOOHPDQ3HUVRQDO6FRSH LVQRWDJUDSKLFDOPXOWLPHWHU EXWDFRPSOHWHSRUWDEOH RVFLOORVFRSHDWWKHVL]HDQG FRVWRIDJRRGPXOWLPHWHU +36 $146. QGV 7KRXVD RQ V P PRUHLWH LWH V E H Z RXU
Robotics Showcase ROBOT CONTROL MADE EASY up to
2x120A
THOUSANDS OF ELECTRONIC
PA R T S A N D S U P P L I E S
VISIT OUR ONLINE STORE AT
www.allelectronics.com
- RS232, RC, or Analog input - Speed or Position Mode - Dual channel output up to 120A - Optional single channel to 240A - Optical Encoder Inputs - Intelligent Current Limiting - Thermally Protected - Field Upgradable Firmware - Enclosed and Board-Level versions - and many more advanced features ...
WALL TRANSFORMERS, ALARMS, FUSES, CABLE TIES, RELAYS, OPTO ELECTRONICS, KNOBS, VIDEO ACCESSORIES, SIRENS, SOLDER ACCESSORIES, MOTORS, DIODES, HEAT SINKS, CAPACITORS, CHOKES, TOOLS, FASTENERS, TERMINAL STRIPS, CRIMP CONNECTORS, L.E.D.S., DISPLAYS, FANS, BREADBOARDS, RESISTORS, SOLAR CELLS, BUZZERS, BATTERIES, MAGNETS, CAMERAS, DC-DC CONVERTERS, HEADPHONES, LAMPS, PANEL METERS, SWITCHES, SPEAKERS, PELTIER DEVICES, and much more....
O R D E R TO L L F R E E
www.roboteq.com
1-800-826-5432 Ask for our FREE 96 page catalog
SERVO 11.2008
75
Appetizer.qxd
10/7/2008
3:08 PM
Page 76
Why Just Build a Robot? Be a Robot! by R. Steven Rainwater -Kon is North America’s longest running national anime convention. It was first held in 1990 and it has been growing ever since. A-Kon 2007 had an attendance of more than 14,000. Quite a few of those attendees are cosplayers: fans who dress and act like their favorite characters from TV, anime, comics, books, and video games. To give you an idea of how big this thing is, A-Kon 2008 set a new Guinness world record for the most people dressed as video game characters in one room (700+). Video game characters aren’t even the most popular type of cosplay. I thought with all these guys in one place, there were bound to be a lot of robot costumes. So, I set out with my camera to see what I could find. When I was still several blocks away from the event location, I spotted a group of Dragonball Z characters marching down the street. In the park across from the hotel, a group of female super heroes battled ninjas, to the surprise of workers
A
76
SERVO 11.2008
in nearby office buildings. Once inside, there was no shortage of robots, androids, and cyborgs. Within minutes of walking into the lobby, I spotted a Super Vandread robot fighting machine, posing for curious bystanders who kept their distance from the dangerous robot. One bystander who considered danger irrelevant was a Borg, complete with motorized appendages, lasers, blinking lights, and surrounded by a cloud of self-generating fog. If Transformers are your thing, you’ll be happy to know there were numerous Autobots and Decepticons in attendence including Arcee — a pink, female Autobot. Androids were in plentiful supply, as well, and one of the best this year was R. Dorothy Wayneright, the android companion of Roger Smith from the anime series The Big O. Dorothy was part of a group of cosplayers who won the Best of Show award for their depiction of Big O characters. In addition to robot cosplayers, I
also made several other unexpected robot sightings at A-Kon 2008. In the dealer room were a variety of imported Japanese robot toys — Transformers, Robotech mecha, Gundams, and other more obscure robots. One dealer was selling tiny little robot figures for gamers. Leaving the dealers room, I ran across another room full of Virtual World Battlemech combat simulator pods. The pods are networked together and exist in a common virtual universe. Inside the pod, you are in control of a giant, bipedal robot battle machine and you fight it out with other players. One unusual robot in attendance this year was Gir, the cute little robot from Invader Zim. Gir wasn’t a costume or a toy. Dallas resident, Remia, had Gir tattooed on her arm. When I asked her why she chose Gir, she said, “Gir is kinda the reject robot who was slapped together on the spot for Zim. But the motivation for me was I’m kinda like Gir, very easily distracted at times and kinda off the
Appetizer.qxd
10/7/2008
3:09 PM
Page 77
wall.” Her robot tattoo has earned her the name “Gir Girl” among locals. After a long day photographing cosplayers, I walked across the street to find some dinner at the restaurants surrounding the Plaza of the Americas ice-skating rink. Along the way, a blue-haired catgirl complained that the hotel never warns the restaurants of the impending A-Kon crowds. Every year, nearby restaurants run out of food,
limiting the eating choices of hungry event participants. As I sat at a table eating a fast food trans-fat burger, I watched aliens, robots, and super-heroes wandering through the crowds. A collection of space pirates skated by on the ice. It’s a very different experience from the average robot event I attend. There was no clear line separating robot from human. A glimpse of the future perhaps? SV
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 11.2008
77
Then&Now.qxd
10/6/2008
11:42 AM
Page 78
a n d
Then N O W ROBOT COMPETITIONS AND CONTESTS b As long as there have been two people gathered together who have different ideas and skill sets, there have been competitions of some sort. The recent Summer Olympics was an extreme example of the world’s finest who gathered together in China to prove who the best athlete in many categories was. Old records fell as younger or more experienced athletes swam or ran faster than ever before, jumped higher or further, or performed some series of athletic motions with more finesse than the others. An American swimmer walked away with a record eight gold medals. We humans love to present our finest to the world in hopes that our country’s competitors are better than anyone else. Robotics is no different as we are all proud of our coolest, fastest, meanest, smartest, or most destructive robot of all and want to show it to the world in some sort of competition. In this year’s April issue of SERVO, I touched upon some of the more popular contests such as the Seattle Robotics Society’s Robothon, the Portland Robotics PDXBot robot competition (both of which have been postponed due to the need of leadership), the Robotics Society of Southern California’s annual robot fairs, and a few of the national events. As I was more concerned with the exhibits by different groups, I really did not cover the complexities of these events and the many more held around the world. I also had a few responses from
78
SERVO 11.2008
y
T
o
m
readers mentioning that I did not cover their event or other events that were particularly noteworthy. I spoke with a few personally, and related that I can never cover the wide spectrum of any topic in modern robotics technology and I just try to cover a few unique aspects of a particular article’s subject. This certainly applies to the many robot exhibitions and competitions as there are so many types of contests and competitions these days. In this article, I again will highlight a few of the more well known robotics contests in a bit more detail, but, this in no way represents the very best competitions. They just happen to be a few of the contests I know a bit more about. Competition can be as simple as one neighbor watching another build a robot. That neighbor then decides that he can build an even better one, and so on. It can also arise in a school or university where two or more students build a robot that can “one up” another group of student’s machine. Sometimes a competitive urge develops when a person watches a contest on TV or reads about one. Some of the best competitions arise when sponsors decide to develop a contest with a specific set of rules and award prizes to the best in the contest. These can be a simple science fair at a local high school, a nationwide series of contests such as FIRST, or even a government sponsored contest such as the DARPA off-road Grand Challenge or Urban Challenge with a first prize of $2 million.
C
a
r
r
o
l
l
Contestants benefit as do the sponsors who can use the winning technology to further enhance military or other government projects at a far cheaper cost than handing out research grants. I’m going to outline a few of the more widely-spread types of contests and, as I mentioned before, these are just a drop in the bucket of the many very interesting competitions around the world involving experimental, amateur, and downright unique robots.
The Seattle Robotics Society Robo-Magellan Contest The varieties of entrants in robotics contests can vary from simple kit-built wheeled robots exhibited by elementary level kids in a local event to the million dollar autonomous cars and SUVs entered into the Grand Challenge series held in multi-mile desert and suburban environments. I had the honor of being one of the judges for the Seattle Robotics Society’s Robo-Magellan contest for several years, held at the SRS Robothon at Seattle Center. This contest was envisioned as an affordable alternative to these government sponsored contests and has spread to many robotics groups across the country. Entries are nothing short of amazing. The robots that I’ve seen over the years range from a few pounds to maybe 30 or more, and sizes range from a small, remote-controlled car chassis to 18 inches long and 14
Then&Now.qxd
10/6/2008
11:42 AM
Page 79
inches high, or so. They must weigh less than 50 pounds and fit within a four foot cube for the duration of the race. Some crawl away from the starting point at a speed slower than a stroll in the park and others race away at breakneck speeds. I’ve seen contestants running behind their speeding Robo-Magellan robot, barely able to keep up, with the safety tether in their hand ready for an emergency stop.
FIGURE 1. Robo-Magellan contestant.
Figure 1 (courtesy of SRS) shows a contestant holding the safety tether in the October 2006 competition. Wireless safety switches are admissible, but most contestants use a wired tether. In the early years, we had a bit of trouble with the GPS satellites being shadowed from the robots by a high wall or even the Space Needle, but this made the contest a bit more challenging when the competitors transferred navigation to odometry and compass navigation. Newer and more sensitive receivers solved a lot of the GPS reception problems in later years. I never saw an entry that wasn’t first class, though some did manage to get lost or stuck behind obstacles. As stated in the rules set up by the SRS, “Robo-Magellan is a robotics competition emphasizing autonomous navigation and obstacle avoidance over varied, outdoor terrain. Robots have three opportunities to navigate from a starting point to an ending point and are scored on the time required to complete the course with
opportunities to lower the score based on contacting intermediate points.” The ‘chicken switch’ tether I mentioned previously is allowed to disable the robot when it is deemed unable to continue or will run into a person or obstacle, but all control is autonomous and navigation is by GPS coordinates (no differential GPS to enhance the accuracy), visual cameras (to avoid obstacles and locate the 18” orange traffic cones), and on-board compasses. The contest is held outdoors (for best GPS reception) and is usually on sidewalks, grass, and has some unique ramps and turns. The contests at the Seattle Center have always attracted a crowd of people who excitedly follow the robots around the course. Sometimes a person with an orange jacket or hat will confuse the robot so that it deviates from the course because it thinks it has seen the orange cone. It’s always fun to explain to the crowd just how intelligent the robots are and why they do certain things on the course, (which can be longer than 1,000 feet). Scoring is based on time, but points are also given for locating and touching all waypoint cones, so slower robots have frequently bested the speedier machines. Contestants are given the course coordinates just before the contest and are allowed to traverse the course themselves before their robot makes its run (a maximum of 15 minutes is allowed for each run). Other groups have used desert courses, woods, and strictly urban courses with only concrete and asphalt. To make the course more interesting, overhead trees, inclines, curbs, garbage cans, park benches, shrubs, and even streams have been included. Target cones are hidden from view at the starting points and at the waypoints. Go to www.robot hon.org/robothon/robo-magellan for more detailed rules and information.
built robots to solve simple mazes since before the microcomputer age. In 1977, IEEE Spectrum magazine announced a ‘micromouse’ contest that would be held in New York in 1979. That gave time for the 6,000 initial entrants to design, build, and fine-tune their creations. Fifteen finalists were selected for the competition to be run in a 10’ by 10’ maze. The winner of this first contest was a simple, high-speed wall-follower that used no sort of ‘intelligence’ to seek its goal. These types of mice simply turn a certain direction when detectors locate the absence of a wall and continue turning in that same direction for the same reason, many times until they eventually (accidentally!) reach the goal. Rules were changed to eliminate these types of entries. As the contest series gained popularity in the early 80s and groups around the world became interested in participating, the rules became more defined. ‘Mice’ appeared in all sorts of forms. David Buckley of the UK came up with Quester in 1981 — a large 8” by 7-1/2” by 5-1/2’ micromouse that used a vision system to detect the maze walls and bump sensors when those sensors failed. (See Figure 2). Buckley gained a bit of fame when Quester was featured in one of the earliest non-industrial robot magazines, Robotics Age. The First World Micromouse Competition was held in Tsukuba, Japan in 1985 and the top six winners were all locals. After a few sporadic contests in the US with low attendance and few
IEEE Micromouse Competitions Running a maze with a robot has always been a draw and people have
FIGURE 2. Quester from the UK.
SERVO 11.2008
79
Then&Now.qxd
10/6/2008
11:42 AM
Page 80
entrants, the contest became quite popular and is now often held in conjunction with electronic business conferences, especially where IEEE attends.
What is a Micromouse? A mouse must be self-contained and totally autonomous, no larger than 25 cm by 25 cm (about 10” x 10”) and there is no limit on the height. It cannot, however, move over or damage the maze walls. The maze itself consists of a square pattern of 16 by 16 squares (18 by 18 cm each), with 5 cm high walls of 1.2 cm thickness. The entire maze is enclosed by an outside wall and the mouse is placed at an outside square and must find its way all by itself to four squares at the center of the maze. This destination is so positioned that wall-hugging mice will be unable to locate it. Of course, the maze is set up ahead of time and hidden from view until just before the contest begins. The mouse has 10 minutes to complete the run from the start to the center four squares where there is a wooden goal post. Obviously, the
fastest mouse wins. Figure 3 shows the maze at a contest at Cal State Chico. Note the detector protrusions over the walls in both Figures 3 and 4. One entry at a contest that I had the pleasure of judging back in 1988 at Wescon featured a very unique mouse. It could not have weighed more than 100 grams and had a pair of sensor arms made from PC board material that extended over the walls on both sides of the maze paths. I’m guessing that the arms had a series of IR photo transistors and IR LED pairs to detect the presence or absence of walls, and to keep the robot centered in the path. This little sucker would zip forward and stop at each 18 cm square, examine the walls present, and would then proceed or quickly turn a precise 90 degrees as required, and quickly step to the next square. It rapidly examined almost every possible square and found the center fairly fast. The amazing thing was when the contestant placed the mouse back in the square, the mouse quickly sped to the center four squares by the absolute best route, sometimes making deliberate 45 degree turns to save time. Needless to say, it won first place.For rules, check out www.ieee.uc.edu/main/files/sac20 07/mm_rules.pdf. There are many other good sites that have both rules and building techniques available.
each other by controlling their individual robots to push and pass large rubber ‘Trackballs’ around the field of play. (Two of the five winning high school teams were sponsored by NASA centers.) The mission and vision of the FIRST Robotics Competitions, FRC, is described this way, by Kamen: “Our mission is to inspire young people to be science and technology leaders, by engaging them in exciting mentor-based programs that build science, engineering, and technology skills, that inspire innovation, and that foster well-rounded life capabilities including self-confidence, communication, and leadership.”
BEST — Boosting Engineering, Science, and Technology BEST is also a non-profit, volunteer-based organization whose mission is to inspire middle and high school age students to pursue careers in engineering, science, and technology through participation in a sports-like, science and engineeringbased robotics competition. Their vision is to excite the nation's students about engineering, science, and technology to unlock their imagination and discover their potential.
Final Results FIRST — For Inspiration and Recognition of Science and Technology FIGURE 3. Micromouse maze at Cal State Chico contest.
FIGURE 4. Micromouse maze variations.
80
SERVO 11.2008
I could not write about robot contests without mentioning the very popular FIRST competition that began back in 1992 with 28 teams competing in a New Hampshire high school gym. This competition series is the vision of one of my favorite robotic innovators, Dean Kamen, best known as the inventor of the Segway Transporter. FIRST competitions are for high school students across the US and other countries. NASA and other major US companies have been long-time supporters of these events. One example of a challenge was one year teams competed against
I’ve only touched on a few of the more visible robotics contests. The many variations of BattleBots that was so popular a half dozen years ago on the Comedy Channel are still held across the world. Robot Sumo and other physical robot vs. robot contests are a mainstay of most robot organization’s events. If any of these competitions sound the least bit interesting to you, I encourage you to go to any of the hundreds of websites for information and help your own group of robotics enthusiasts develop some super fun events in your home town. SV Tom Carroll can be reached via email at
[email protected].
RoboLinks-Index Nov08.qxd
10/8/2008
9:24 PM
Page 81
For the finest in robots, parts, and services, go to www.servomagazine.com and click on Robo-Links.
W LO
! ST CO
Free Expert Technical Support 1 (800) 985-AWIT
LOW COST
Easy to Connect
CONTROLLERS & ROBOT KITS – SENSORS – DISPLAYS LO W
CO
ST ! Professional SW Dev. Tools
www.c-stamp.com
Electronic Parts & Supplies Since 1967
All Electronics Corp. ................................75 AP Circuits/e-pcb.com .............................71 Boca Bearings .............................................7 Coroware ...................................................70 CrustCrawler ..............................................17 Electronics123 ..........................................75 Firgelli Technologies .................................70 Gears Educational Systems, LLC .............39 SolderByNumbers.com ...........................47 Hagisonic Co. ............................................75 Hitec ...........................................................12
Innovation First ...........................................3 Jameco ......................................................25 Lorax Works ..............................................75 Lynxmotion, Inc. ........................................13 Net Media .................................................83 Parallax, Inc. ................................Back Cover PCB Pool .......................................................7 Pololu Robotics & Electronics .................71 Robot Power .............................................71 Robotis ......................................................50 RoboteQ ....................................................75
RobotShop, Inc. ........................................82 Scientifics ...................................................51 Sherline Products .....................................70 Smiley Micros ............................................77 Solarbotics/HVW .....................................19 SolderByNumbers.com ...........................47 Sparkfun Electronics ..................................2 Vantec ........................................................77 Weird Stuff Warehouse ............................75
SERVO 11.2008
81
Full Page.qxd
82
10/7/2008
SERVO 11.2008
11:51 AM
Page 82
Full Page.qxd
4/29/2008
4:05 PM
Page 83
backcvr.qxd
10/7/2008
11:34 AM
Page 84