Cover.qxd 5/6/2009 9:25 PM Page 1 Vol. 7 No. 6 S E R V O MAGAZINE HAGETAKA • VIRTUAL LABORATORY • FLEX SENSORS • CHEAPBOT CONTROLLER CHEAPBOT June 2009

U.S. $5.50 CANADA $7.00 06>

0474470 58285 Full Page.qxd 5/6/2009 4:36 PM Page 2

“Build Smarter.” Full Page.qxd 5/6/2009 4:37 PM Page 3 TOC Jun 09.qxd 5/6/2009 3:15 PM Page 4

The Combat Zone... Columns 08 Robytes by Jeff Eckert Stimulating Tidbits 10 GeerHead by David Geer First Robot for Cleaning Solar Cells 13 Ask Mr. Roboto by Dennis Clark Your Problems Solved Here 67 Resources PAGE 22 by Gordon McComb Blogging Your Way to Robotics Stardom Features 72 Beginner Electronics by William Smith 22 BUILD REPORT: Build Your Own Atom Nano Board The Intro Ant (for use in future projects) 25 MANUFACTURING: 76 Then and Now RioBotz Combot Tutorial by Tom Carroll 27 PARTS IS PARTS: Automated Guided Vehicles Banebots P60 1:16 Gearbox Departments Events NEW! 27 Results and Upcoming 06 Mind/Iron 32 Bots in Brief Competitions 07 Bio-Feedback 64 SERVO Webstore 19 Showcase 81 Robo-Links Robot Profile 20 New Products 81 Advertiser’s Index 29 Black Death 30 Events Calendar

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]

4 SERVO 06.2009 TOC Jun 09.qxd 5/6/2009 9:34 AM Page 5

06.2009 VOL. 7 NO. 6

PAGE 42

PAGE 50

PAGE 47

36 Implementing a Low Speed, Features Low Cost Communications Protocol (that you’ve probably never heard of) & Projects by Fred Eady LIN is a relatively young network topology used in automobile mechatronics. See how you can apply it to your robotic needs. 42 The CheapBot-14 Robot Controller by L. Paul Verhage Add this controller to your robot base of choice for an efficient and cheap learning environment. 47 A VIrtual Laboratory by John Blankenship and Samuel Mishal Simulate mechanical systems to streamline the designing process. 50 How to Make Bi-Directional Flex Sensors by John Iovine Flex sensors have a lot of applications in robotics. Here’s a simple approach to making your own. 54 Computer Control and Data Acquisition by David A. Ward Part 4: Working with analog signals. 58 Hagetaka: Bipedal Combat Robot by Andrew Alter Follow the journey of designing and building your own MechWarrior inspired robot.

SERVO 06.2009 5 Mind-Iron - Jun09 dc.qxd 5/5/2009 8:25 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 Mind / Iron Outside US 1-818-487-4545 P.O. Box 15277, N. Hollywood, CA 91615 by Bryan Bergeron, Editor Œ PUBLISHER Larry Lemieux [email protected] robotic technology: medical devices. The Broader Perspective ASSOCIATE PUBLISHER/ The archetypical medical device VP OF SALES/MARKETING Before you know it, it will be the — the implantable cardiac pacemaker Robin Lemieux end of summer. Time to finish that — is shown in the accompanying [email protected] robotics project that’s been lingering photo. As you can see, a pacemaker EDITOR on your workbench for weeks, and, is about half the width of my index Bryan Bergeron economics allowing, perhaps take finger. The diminutive device [email protected] one more vacation trip. If you’re a monitors the electrical activity of the TECHNICAL EDITOR student, it’s also the start of a new wearer’s heart and, when it detects a Dan Danknick academic year and time to think significant aberration in the signal, it [email protected] about starting or returning to school. generates a signal that paces the It’s also time to think about selecting heart back into a normal rate and CONTRIBUTING EDITORS Jeff Eckert Tom Carroll and pursing a career. rhythm. And normal is a function of Gordon McComb David Geer If you’re considering robotics as activity — slower for sitting and more Dennis Clark R. Steven Rainwater a field of study, make sure you take rapid for walking or jogging. Fred Eady Kevin Berry the broader perspective. As I’ve To accomplish this feat, the David Ward John Blankenship Samuel Mishal John Iovine mentioned in past editorials, the sealed, bio-inert device has to Andrew Alter Paul Verhage focus of robotics and — more flawlessly sense and respond to the Nick Martin Marco Meggiolaro importantly — robotics technology electrical activity of the wearer’s William Smith extends beyond creating Wall-E look- heart for five years or more. Think CIRCULATION DIRECTOR alikes, developing and testing combat battery technology, sensor Tracy Kerley , and creating automatic gutter technology, materials engineering, [email protected] cleaners. Although you may have thermal engineering, and electrical MARKETING COORDINATOR dreams of one day creating the engineering. WEBSTORE ultimate Cylon, you’ll probably make Moreover, we’re just getting Brian Kirkpatrick a bigger splash in the world by started, as the pacemaker is typically [email protected] working in one of the high-relevance part of a much larger system of WEB CONTENT areas that depends directly on devices that rely on robotics Michael Kaudze technologies. For starters, the [email protected] pacemaker has to be programmed to suit the physiology of the wearer. An PRODUCTION/GRAPHICS Shannon Lemieux active person with relatively modest cardiac disease requires a set of ADMINISTRATIVE ASSISTANT alarms and an auto pacing rate that Debbie Stauffacher are different from someone with Copyright 2009 by severe cardiac disease. This T & L Publications, Inc. programming is accomplished by a All Rights Reserved physician or other clinician who All advertising is subject to publisher’s approval. We are not responsible for mistakes, misprints, uses a wireless programmer that or typographical errors. SERVO Magazine assumes communicates with the embedded no responsibility for the availability or condition of pacemaker. A technician monitors advertised items or for the honesty of the the wearer’s EKG through a wireless advertiser. The publisher makes no claims for the legality of any item advertised in SERVO.This is the RF link with the pacemaker and sole responsibility of the advertiser.Advertisers and adjusts the triggering and pacing their agencies agree to indemnify and protect the publisher from any and all claims, action, or expense arising from advertising placed in SERVO. Please Mind/Iron Continued send all editorial correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879. 6 SERVO 06.2009 Mind-Iron - Jun09 dc.qxd 5/5/2009 8:26 AM Page 7

Dear SERVO: If WALL-E is three feet tall as you state in the April issue, Response: then those are the biggest kids I have seen. That boy Whoops! Ultimate WALL-E in his normal state is 15.5" tall, to WALL-E’s left must be pushing 8’. but sometimes his eyes can tip up and reach 16" total Monty Saine height. David Geer

parameters. Similarly, when the patient returns to the clinic for a checkup, the physician’s workstation communicates wirelessly with the pacemaker and downloads — in real time — the battery voltage, lead impedance, pacing activity, and other operating parameters. Think wireless telemetry and electrical engineering. The clinic use of machines to program and monitor the status of the patient and pacemaker pales in comparison to the supporting technology available from the home. Fuzzy logic within the pacemaker monitors the EKG and, if it detects a problem, it establishes a communications link with a home monitor that, in turn, establishes communications with a web server. Within minutes, an alarm condition appears on the physician’s cell phone or desktop monitor. Think fault-tolerant, real- time communications, computer science, web services, artificial intelligence, and data encryption technology. Of course, the pacemaker is 4FSWJDJOHZPVSDPNQMFUF only one of many free-standing, wearable, or implantable medical 1$#QSPUPUZQFOFFET devices that relies on robotics related technologies. For a ƅLow Cost - High Quality glimpse of the leading edge of PCB Prototypes medical devices, take a look at medGadget (www.medgadget ƅ&BTZPOMJOF0SEFSJOH .com) and the medical technology news section of Science Daily ƅ'VMM%3$JODMVEFE (www.sciencedaily.com). The /&8 take away is, if your interests ƅ-FBEUJNFTGSPNIST lie in sensors, computing, AI, /&8 ƅ0QUJPOBM$IFNJDBM5JOGJOJTITTII communications, and other no extra cost technologies related to robotics, 8BUDI“VS”1$#® your career options aren’t limited Follow the production of your PCB in to competing for the dozen or so 3&"-5*.& positions at NASA for developing planetary vehicles. It’s something email : [email protected] to consider when you’re weighing Toll Free USA : 1 877 390 8541 www.pcb-pool.com options for a rewarding career. SV

SERVO 06.2009 7 Robytes - Jun 09 dc-edited.qxd 5/6/2009 11:37 AM Page 8 Robytes by Jeff Eckert

Wings Over Mars both download and installation are (either fully robotic or a modified slow. You can also get a pdf or jpg standard automotive vehicle). file that allows you to print, cut out, EATR is entering the proof-of- and fold your own scale model. Just concept phase, which will focus on its visit http://marsairplane.larc. ability to recognize edible biomass nasa.gov/platform.html. sources, ingest them, and generate electrical power. Phase 3 will lead to commercialization in several military Bot With An Appetite and civilian areas. If you see one coming down the street, try not to Artist’s concept of the ARES look too delectable. marsplane. Courtesy of NASA.

UAV Employs Fuel Cells

Basic configuration of the EATR bot. Courtesy of Robot Technology, Inc.

While most bot designers agonize over how to provide enough ARES instrument layout. power to keep the machinery Courtesy of NASA. running for extended periods, the The Ion Tiger fuel cell powered UAV. Energetically Autonomous Tactical Courtesy of the Office A fascinating UAV-based concept Robot (EATR), an ongoing program of Naval Research. is NASA’s Aerial Regional-scale at Robotic Technology, Inc. (www. Environmental Survey of Mars (ARES) robotictechnologyinc.com), Beating the battery dilemma in — a proposed Mars Scout mission. It circumvents the problem by creating a different way is the Ion Tiger UAV, is intended to extend the Mars a biologically inspired bot that under development at the Naval exploration program by making actually forages for its own food. Research Lab (www.nrl.navy.mil) measurements in three areas: crustal Much like a great white shark in Washington, DC, for various magnetism; atmospheric boundary cruising the beach for tasty tourists, surveillance missions. It tests a 500W layer composition, chemistry, and EATR “can find, ingest, and extract hydrogen-powered polymer fuel cell dynamics; and near-surface water. In energy from biomass in the environ- design that allows it to carry heavier operation, the autonomous powered ment (and other organically-based payloads over longer distances than airplane will be delivered in a energy sources), as well as use earlier battery-powered designs. protective “aeroshell,” then released conventional and alternative fuels It also provides better stealth after entering the red planet’s atmos- (such as gasoline, heavy fuel, characteristics because of its small phere. After separation, the wings kerosene, diesel, propane, coal, size, reduced noise, low heat and tail will unfold, and the aircraft cooking oil, and solar) when signature, and total lack of emissions. will pull up and begin its mission. suitable.” According to the developer, The Tiger, which is slated for a trial The fun part is that NASA has it can travel about 100 miles on a flight soon, is expected to provide a made available a detailed flight meal of 150 lb of vegetation. 24 hour flight endurance with a 5 lb simulator that allows the operator to The system has four basic (2.7 kg) payload. program a mission and watch it subsystems: an autonomous control progress. Available for both Windows system with sensors; a manipulator and Mac OS X, you can download it system (robot arm and end effectors); at http://education.grc.nasa. a hybrid engine system (external BMI Achieves Mind Over gov/MarsFlight/index.htm. But be combustion engine that charges a Matter patient. It takes up about 750 MB, so battery); and a mobility platform At the end of March, Honda

8 SERVO 06.2009 Robytes - Jun 09 dc-edited.qxd 5/6/2009 11:37 AM Page 9

Robytes

with artificial intelligence technologies working on a small robot — Scout — and/or other robotics technologies. that can be used for such things as detecting radiation in nuclear facilities. Off-Highway Vehicle Demonstrated String-Climbing Bot

A BMI subject is fitted with an array of non-invasive sensors. Courtesy of HRI-JP.

Research Institute Japan Co., Ltd. (HRI-JP, www.honda-ri.com), a subsidiary of Honda R&D, Advanced Telecommunications Research The CMC ROHV provides highway Institute International, and Shimadzu defense duties at 1/10th the cost. Corp., announced the world’s first Jack Bauer would be so proud. brain-machine interface (BMI) that A few weeks ago, the California using electroencephalography (EEG), Mechatronics Center (CMC) at This month’s excavation for a near-infrared spectroscopy (NIRS), California State University, Chico truly stupid and worthless robot and a newly developed information (www.csuchico.edu), demonstrated didn’t turn up much paydirt, but at extraction technology enables control a small robotic off-highway vehicle least the Solar Climbing Orangutan of a robot by human thought alone. (ROHV) designed to scout the road is cheap and useful only for The EEG measures changes in ahead of a military convoy to detect amusement. According to the vendor, the scalp’s electrical potential while roadside explosives and other safety www.thinkgeek.com, “What the NIRS monitors changes in threats. It can be driven using a happens when you combine the cerebral blood flow; some advanced console in the first vehicle of a federal stimulus package with billions statistical processing crunches this convoy, up to a half mile behind, in funding for alternative energy information to distinguish and transmitting sound and visual images sources, monkeys, and the sun? Well, interpret brain activities. The tech- to alert operators of potential you get the Solar Climbing nique offers obvious advantages over dangers. Orangutan, of course. Assemble this conventional machine interfaces that One of the cited advantages is resourceful simian and set up a string require movement of the operator’s that this vehicle — built with off-the- suitable for climbing. As long as the hands or feet to engage switches and shelf components — costs about 90 sun is shining (or you burn valuable so on, as well as invasive techniques percent less than similar vehicles built electricity by applying your own that involve surgical implantation of for military use but offers 80 percent light), this orange orangutan keeps electrode arrays. It also is a major of the capabilities. “Not all govern- climbing. We wanted to offer you the improvement over a previous ment spending has to come in huge Nuclear Climbing Orangutan ... but technology that was based on packages with large price tags to be unfortunately couldn’t get them magnetic resonance imaging, which effective,” opined CMC Director Nick into the country due to high lead was limited by the MRI scanner’s size Repanich shortly before he was content.” and powerful magnetic field. dragged away and beaten by angry The $14.99 price tag includes all In recent tests with an ASIMO DoD bureaucrats. required batteries (i.e., none) and unit, the BMI reportedly achieved a The city of Chico has already even a piece of string. Plan on about 90 percent accuracy rate in generating expressed interest in acquiring one 20 min of assembly time, though, such actions as raising an arm or leg. for inspecting suspicious packages, and you’ll need to know how to Honda is looking into applying this so engineering students will be wield a screwdriver. The little guy technology to a people-friendly developing the idea over the next measures about 3 in (80 mm) high human interface through integration several months. The center is also when assembled. SV

SERVO 06.2009 9 Geerhead - Jun 09 dc5-edited.qxd 5/4/2009 11:33 AM Page 10

by David Geer Contact the author at [email protected] First Robot For Cleaning Solar Cells Sees The Light!

When the solar energy producer cannot bring the panels to the car wash, it is time to bring the car wash to the panels! Industrial/mechanical engineering students from Northeastern University in Boston have designed and constructed a prototype robotic cleaning head and pulleys for solar panels. This work was performed on behalf of the Green Project, a Greek start-up focused on sustainable energy. The PV Cleaner Robot v1.0 apparatus — which must be assembled and installed by hand — autonomously cleans solar panel arrays of increasing scale with greater efficiency than a crew of human workers. This is important because sand, dust, and debris build up to block the sun and reduce power.

he PV Cleaner Robot uses a controlled process which employs the cleaners. makes cleaning very efficient. It also ensures that the When companies use the robotic cleaner, human risks Tsurfaces of all panels are systematically cleaned with a of falling are reduced to setting up up the robotic cleaner, high level of precision. A hose and water have no where which takes two people about 15 minutes. This reduces the near the same impact or reliability on debris removal. liability for teams of workers employed all day to clean all Solar panel arrays can be located anywhere. Elevated the arrays. locations add personal injury risk for employees and liability As the robot cleans the arrays, the water it uses also risk for the company who owns the panels and/or cools the solar panels, increasing their efficiency.

The PV Cleaner Robot. Robotic Assembly and Features To keep things simple, the cleaning robot uses a modular design. The trolleys that run the top and bottom of the solar panel arrays are nearly identical except for slight variances related to the motor mounts. Operation requires attaching the trolley mechanisms to the panels on the top and bottom, and clamps are easily tightened by hand. The robot remains in place, thanks to its balancing weight. Sensors allow the robot to see the panel edges, so it knows how far it has traveled left and right, maintaining a current location of the cleaning head. This enables the robot to optimize the necessary movements for a thorough cleaning. 10 SERVO 06.2009 Geerhead - Jun 09 dc5-edited.qxd 5/4/2009 11:34 AM Page 11

GEERHEAD

Cleaning Algorithm the solar panels very accurate. The researchers plan to increase the robot’s intelligence Based on readouts from rotary encoders, the robot’s by introducing more sensors and combining them with trolleys move sideways the width of the cleaning head, so algorithms for checking panel functionality. By monitoring that no area of the panels is missed. Once the head has the status of each panel surface before and after cleaning cleaned the entire area it covers vertically, the trolleys it, the robot could vary the pressure applied to the panels, move again. vary the cleaning rate, adjust the water pressure, or clean Inductive proximity sensors detect when the robot is the panels that are really dirty, twice. moving between panels or when it has reached the end of a row, according to Dr. Constantinos Mavroidis, director Design Challenges of the Biomedical Mechatronics Lab at Northeastern University. As with most successful robotics designs, the solar The cleaning motion of the head (with brushes and panel cleaner PV Cleaner Robot v1.0 began with a sprayers) applies just the right pressure to insure a clean problem that demanded a solution. Once several ideas for surface without scratching the panels. approaching a solution were recorded, the team put them A rotary encoder on the pulley that drives the lift into a decision matrix that required each idea to score belt records the distance the cleaning head has traveled. high based on how well the concept improved on existing “By setting the top and bottom limits during installation, cleaning methods given a set of improvement priorities. the robot knows where the cleaning head is in its Y axis Remaining challenges include improved cleaning direction at all times. The X axis direction is read by efficiencies, decreased size for the apparatus, improving encoders on the trolley’s lateral drive motors,” says sensors, and adding various kinds of inspection Dr. Mavroidis. equipment. Researchers will eventually replace the current The robot has enough sensor input to keep from hardware with lighter materials to reduce the weight of driving itself right off the solar panels. The rotary encoders the device. exist on all the drive motors, tracking the X and Y distances that the cleaning head has moved across the plane. “Each Considerations time the cleaning head moves sideways, it detects the edge of the solar panel and resets the distance counter to Permanent installations of cleaning robots could minimize errors that build up due to slippage of the eliminate assembly time and associated risks and allow for cleaning head,” explains Dr. Mavroidis. This makes the more automated cleaning schedules. “However, this device robot’s calculations about where it is in the plane across was originally designed so that with only a handful of

Different views of the robotic cleaning system on solar panels, including trolleys at top and bottom.

SERVO 06.2009 11 Geerhead - Jun 09 dc5-edited.qxd 5/4/2009 11:35 AM Page 12

GEERHEAD

Educating the Solar Panel Resources Cleaning Slave Solar Panel Cleaning Robot Announcement www.neu.edu/nupr/news/1208/Solar_Panels1.html The next generation PV Cleaner Robot will monitor for solar panel defects and power outages. While Exhibition that Solar Panel Cleaner Robot will enter the current model does not have panel inspection www.ecotec-exhibition.gr/index.php?lang=en capabilities, there are several plans to incorporate this, one including a thermal camera. The camera would look for hot spots on the panels. These hot spots would permanently installed along the length of the solar array. represent voltage inconsistencies due to damaged However, this method only rinses the solar panels and uses photo cells. a lot more water. Unlike suction cup systems, the PV Because the cleaning robot knows the position of Cleaner will not fall off the arrays even the event of a its cleaning head when the camera finds the hot spots, power failure. it can log these inspection points and notify solar panel The cleaning head is very precise. It uses a solenoid engineers who can address these issues. valve to make sure water sprays on the panels in front of the brushes in whichever direction the head is moving, robots (a limited investment), an entire solar panel energy and only in one direction at a time. A Syncromesh cable park could be cleaned by relocating a few robotic cleaners in contact with the pulleys (attached at the ends) drives now and then.” the brushes. This eliminates the need for a motor to turn them. Comparisons and Conclusions The PV Cleaner Robot v1.0 should be a hit with solar farms seeking an automated cleaning option that is The only other system that comes close to the PV relatively inexpensive, thorough, and soon to be groomed Cleaner Robot would be a static spray system that is to add desirable inspection features. SV

What is the missing component?

Industry guru Forrest M. Mims III has created a stumper. Can you figure out what's missing? Go to www.Jameco.com/missing to see if you are correct and while you are there, sign up for our free full color catalog. It's packed with components at prices below what you are used to paying.

12 SERVO 06.2009 MrRoboto - Jun 09 dc-edited.qxd 5/5/2009 4:10 PM Page 13

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

This month, I was asked a seemingly simple The first hardware transport layer that comes to mind is question that dovetailed very nicely into a project I’ve asynchronous serial, also known as RS-232. This is certainly been contemplating for a while. As usual, when such simple to bit-bang, however, because it is asynchronous things happen to me the project balloons out of control (has no system clock) the timing needs to be precise or and a major project ensues. That is what happened this other receivers won’t be able to decode it properly. This will month. What started out simple turned into a monster limit the data rate to something slow enough that a little with lots of twists and turns and a last minute subtle bug slop in the timing will still work correctly, but I don’t think that turned out to be obvious once I looked carefully at it. this is what I want. If I’m going to have lots of sensors, I I’ll attempt to work through the entire process here so want to get some speed from the bus. that you can avoid the same pitfall! Synchronous serial will have a clock line and one or two data lines. We can make the data line bi-directional so . I want to put a bunch of sonar boards on my we only need to run two I/O lines to every device. Because robot so that I can experiment with area mapping. this bus is synchronous, the clock can be any speed and the QThe problem is that I don’t want to have my speed can drift a little. Synchronous serial buses typically “brain” do all the work of running them. Is there a way to operate on rising and falling edges of a clock, not the network my sonar units with sub-processors so that my frequency of the clock. A rising edge is the point where a main brain can communicate with it to get my readings? digital signal changes from a logic low 0 to a logic high 1 — Sean and vice-versa. This will be ideal for our simple network. There are two commonly used synchronous serial buses . Of course! It just so happens that I’ve been working that microcontrollers like: SPI (Serial Peripheral Interface) on an outdoors robot that I want to put a bunch of and I2C (Inter-IC). I2C is a fairly complex bus architecture Asonar units on. On top of that, I’ve wanted to create that allows for multiple masters (a master controls the flow a network protocol for sensors on my robot that is simple, of data on the bus), addressing of individual nodes, bus fast, and easy to implement no matter what microcontroller arbitration, and priority addressing. It only needs two I/O I use. In this article I’ll try to give some insight into my lines: a clock and a bi-directional data line. Messages on design process and some of the problems that I ran across the I2C bus are half-duplex which means transmitting and and solved to get to a solution. receiving don’t occur at the same time. This is a pretty complex standard, so I’m not sure I want to deal with all THE PROBLEM: How to network of the packet overhead that is needed. a bunch of sensors easily? The SPI bus is master/slave which means that the bus has only one master controller and the rest only respond Since I want my network to be cheap and easy to when they are talked to. There is no packet formatting; it implement, this means it will need to be serial in nature just clocks data back and forth. This bus is full-duplex which to minimize the number of I/O lines needed. means you can receive data at the same time you send it. We’ll leave out the networks that require extra The SPI interface, on the other hand, uses four I/O lines: a hardware and more powerful microcontrollers like CAN and clock, a data out, a data in, and a select line. Four I/O lines Ethernet. I want to create a network that I can implement are needed for SPI and one of them is a chip select, which by bit-banging I/O lines on any device so I can use cheap, means that I’d need an additional I/O line for each device low pin count micros. on the bus. That isn’t what I want either. SERVO 06.2009 13 MrRoboto - Jun 09 dc-edited.qxd 5/5/2009 4:10 PM Page 14

is a single bunch of data that is sent out in a transaction from the master to the slave. [8 bit address] [8 bit command] [16 bits of data] Some commands will be sending data out to the device to do things like set a motor controller speed or set up some sensor condition. Some commands will want to get data back from a sensor. This latter operation means that I’ll have to Figure 1. Data setup and clock timing. flip the direction of flow on the data I/O line after the address and command bytes are sent. This is The solution? Combine the ideas. We’ll take the easy to do as you’ll see later on with the code examples. address and command fields along with the two I/O line Basically, the master and slave need to know when the hardware interface from I2C and combine it with the simple data line flip should occur. I decided that the write back SPI interface that doesn’t have to do bus arbitration commands will have the MSB (Most Significant Bit) of the (decides which master can talk). If we include an address byte set (means equal to 1) when the command requires and command field with the data that we clock out, then data to come back from the slave to the master. we can have addressable devices without needing an Additionally, I need to decide how the data will be read additional select line. Since I can’t resist creating my own at both the master and slave sides. My choices were that bus design, this sounds perfect! the slave will read a data bit on the rising edge of the If you want more information on these two common clock, so that data has be ready and stable at the master synchronous serial bus implementations, you can always when the master transitions the clock from low to high. Google them on the Internet. There is a lot of information When the slave sends data back to the master, it will set up out there that can help you understand these ideas. the data on the rising edge of the clock; the master will then read the data line on the falling edge of the clock. THE DESIGN: A two-wire bus Take a look at Figure 1 to help you understand what I’m talking about. When you are designing a communications with simple address/command/ protocol and hardware system, there are a lot of details you data packets. need to work out carefully if you want it to work properly! Figure 1 shows the bit timing for the clock and data. Here is the packet format that I’ve settled on. A packet You can see that the master has to have the data set up and ready before it transitions Figure 2. Sensor board schematic. the clock from low to high. The slave, on the other hand, only needs to set the data up when the clock transitions from low to high since we specify that the master reads the data when the clock transitions from high to low. We have lots of time for the data line to settle before the master reads it. THE HARDWARE: The sensor slave hardware board.

Now that we’ve got the protocol all settled, what hardware will it run on? In my case (as with most hobbyists), that decision was made by looking in the junk drawer to see what I had a bunch of at 14 SERVO 06.2009 MrRoboto - Jun 09 dc-edited.qxd 5/5/2009 4:11 PM Page 15

the time. I had a drawer full of PIC16F630 microcontrollers. This is a small, 14-pin PIC with no special hardware features, but a few timers and an external interrupt pin. It has 1K of Flash program memory and 64 bytes of RAM. It also has 128 bytes of EEPROM which will come in handy in the future when I expand things to modify the individual device address; my current code hard-codes the address when I program the part. Figure 2 shows what my sonar board schematic looks like. It is pretty simple. I use every I/O line there is. I like to include a Microchip ICD2 type connector on my prototype boards to make it easy to program the part while it is in the board. You can see it to the right in Figure 3 which is a photo of my prototype board. There isn’t much here — a regulator, 10 MHz resonator, and a reset circuit — everything else is just connectors. Looking at Figure 2, you’ll see a header (J4) that has Rx and Tx on it. Even though the 16F630 doesn’t have a hardware UART, you can still use CCS’s software UART on any two I/O lines. This helps debugging a part like this where you can’t use the typical Microchip debugger solution – there aren’t enough pins! I used a Scott Edward’s BPI-216 2x16 LCD display for debugging and to directly display range measurements in inches. The left side of the schematic has the connector J5 that is used to control a sonar board that was hacked Figure 3. Sonar sensor board. from an old Polaroid camera. I have a bunch of these because they have greater range than the smaller units 2) Control a sonar unit, store its readings, and convert that are sold. (If you’d like to get a sonar unit for about to inches. $6 off of eBay, check out my now rather ancient website that details how to do this with three different Polaroid I wanted to tell the sensor board when to ping the instant cameras: www.techtoystoday.com/sonar/ sonar so that I could run several of them in sequence dlcsonar.html). Figure 4 shows what one looks like. and not have them interfere with each other, so there is Finally, there is J3 which is the actual I/O lines used in my SCI (Synchronous Communications Interface) bus. This Figure 4. Sonar from a SUN 660 camera. bus can be daisy-chained between boards by making sure that every sensor board has two sets of connectors to these lines. THE SOFTWARE: The code that goes on the slave and the master controller. The master and slave are the two parts to the software that gets the sonar sensor boards to talk to the master controller. Let’s talk about the slave first. I chose the PIC16F630 for three reasons: low pin count (14 pins); they’re cheap (under $1.50 each); and I had about a dozen of them in a drawer. This part had exactly the number of pins to make a good sensor board. The pinout matches other 14-pin PICs that have ADC and PWM hardware modules as well, so many kinds of sensors can be built on the same board with similar code. This sensor board needs to only do two things:

1) Communicate with the master over the SCI interface. SERVO 06.2009 15 MrRoboto - Jun 09 dc-edited.qxd 5/6/2009 7:59 PM Page 16

Here is the definition code for those commands:

#define CMD_PING 0x01 //Take a //reading #define CMD_SEND 0x81 //Send the //data back #define CMD_DEMO 0x0F //In demo mode

Note that the MSB of the command is set in the CMD_SEND command; this tells the SCI state machine that it will be sending data back to the master. Many more things can be done with commands than just this. One I have in mind for the future is a command to set the device address to something other than its default and save it in the EEPROM. So, how does one create a state machine to handle the SCI communications? The first step is to sit down and draw what you think it would look like. Typically you have too few Figure 5. Sensor board SCI state machine. states, then too many, then you can trim it to be just right. I ended up with five states a command to do a sonar reading. Another command which you can see in Figure 5. State 0, idle is where the tells the board to return the converted distance state machine sits when nothing is happening. As soon as measurement (in inches). I included a third command a clock is detected then it transitions to state 1, AddCmd. that will put the sensor board in demo mode which makes In this state, the device address and command are clocked it take a sonar reading every five seconds and display it in and checked. If the address isn’t for “me,” then I sit on the LCD. in this state and discard the next 16 bits. Otherwise, I

//start the timeout clock ticking. LISTING 1. SCI state machine code. switch (spiState) { //Kick start the state machine #int_global case S_IDLE: void isr(void) bCount = 0; //clear count /* I will handle the pre/post amble for the ISR spiState = S_ADDRCMD; //next state * because I know which memory locations I’ll * use. Incoming commands are read in, as would case S_ADDRCMD: * be any incoming data. The main program if (bCount <8) { //Target address * would determine what to do with the data. shift_right(&addrIn,1, * Whenever a command comes in that has bit 7 input(SDA)); * (msb) of the command byte set the ISR will //Get the current data bit * transmit back whatever is in the data buffer. } * The main program will have no choice in the else if(bCount < 16) { //Command * matter, it had better have the data in shift_right(&cmdIn,1, * myData, because whatever IS there will be input(SDA)); * sent back! } */ if (bCount == 15) { //cmd & addr { if (addrIn == myAddr) { // Me? #asm if ((cmdIn & 0x80) != 0) { //store current state of processor //next state is data out MOVWF save_w spiState = S_DOUT; SWAPF status,W dataOut = myData; MOVWF save_status SWAPF FSR,W } MOVWF save_FSR else { BCF status,5 //Set to page 0 for SFR’s // next state is 16 bits #endasm // data in spiState = S_DIN; set_timer0(0); }

16 SERVO 06.2009 MrRoboto - Jun 09 dc-edited.qxd 5/6/2009 7:59 PM Page 17

} bCount—; } break; //to S_READY break; } bCount++; //increment the bit count case S_DOUT: //Next 16 bits go out if (bCount == 32) { //Make SDA an output now spiState = S_READY; //all I/O are done set_tris_C(CTRIS); } output_bit(SDA, shift_right(&dataOut,2,0)); #asm break; // restore processor and return from INT BCF INTCON,1 case S_DIN: //Next 16 bits come in SWAPF save_FSR,W shift_right(&dataIn,2,input(SDA)); MOVWF FSR break; SWAPF save_status,W MOVWF status case S_READY://Done, deal with data now. SWAPF save_w,F default: //Here just for a bug SWAPF save_w,W set_tris_C(RSPI); //Make SDA an input #endasm //Keep coming back to this state } //until reset

transition to either state 2, Dout, or state 3 Din, depending LISTING 2. Recover from a bad packet length. upon the state of the MSB of the command byte. When the rest of the packet has been clocked in, move to state 4, /* Ready. It is this final state that the main program loop is * Check for clock timeout, and recover. looking for. When a command is ready, it acts upon it and */ then clears the Ready state back to Idle where the process if ((spiSTATE != S_IDLE) && can start up again. (get_timer0() > SPI_TIMEOUT)) { Now, how would you code this? It really isn’t that //leave READY state alone difficult. You use a switch construct that checks the if (spiState != S_READY) { current state variable, how many bits have been clocked spiState = S_IDLE; //transfer timeout in, and what type of command has been read to } determine what it needs to do next. Listing 1 shows an } ISR (Interrupt Service Routine) that I created to handle this state machine. approximately), the SCI state machine is reset to Idle. In this I used an ISR to handle the SCI communications so that way, we recover from a packet error condition gracefully. I would know exactly when the chip started getting clock This error will occur if we don’t see another bit transition in signals. It is easier to read and work this way. No more the clock within 6.5 ms. This obviously sets our lowest commands will be taken or acknowledged until the Ready speed of the clock to about 150 Hz. Currently, I don’t know state has been cleared back to Idle, so we are safe from what the upper limit is; I’ll figure that out later or leave it as interference, while the sonar ping is being handled. a challenge for the reader. There is one more interesting requirement that we I won’t go into the details of how I time the sonar ping need to deal with: an error condition that can occur if we and convert the time to distance; you can see how easy don’t get a full packet – how do we reset the state machine? In the main code (shown in Listing 2), note that Figure 6. ATMEGA168 master controller board. a timer is consulted and if it overflows (the timer is 6.5 ms

LISTING 3. Slow things down to give the slave time to respond.

void waste(void) /* * This delays the clock for data setup timing */ { volatile int x; // So the compiler won’t // optimize it away!

for (x=0;x<100;x++) ; }

SERVO 06.2009 17 MrRoboto - Jun 09 dc-edited.qxd 5/6/2009 8:00 PM Page 18

Sent Received to stabilize before raising the clock line. Without this delay, the slave may not see the data correctly depending upon 0x0000 0x0000 the length of the wires between the boards. I have not characterized how long the wires can be yet; there wasn’t 0x0001 0xFFFF time before my deadline loomed ahead. I’m also not sure how fast you can clock the data out. These will be 0x0080 0xFF80 good characterizations to do in the future. This bus should be fast (at least 100 kHz, perhaps higher). The 0x0800 0xF800 source code files for the master controller program are atm168.c and atm168.h. 0x8000 0x8000 BUGS: You’ve got to hate them. Figure 7. Bug test matrix. In every program, there comes a little bug ... The master program here had a very subtle bug in it. I did not that is in the source code. The main challenge with this get the data back that I expected. I sent a few patterns and program was the SCI communications implementation. This then pondered the results. The test matrix is in Figure 7. I program is called SPIsonar.c in the project zip file, available also show the source code bits in the GetSPI() function that at www.servomagazine.com. were wrong. One more hint: I shift in the serial bits into the We now have to handle the master’s side of the MSB of the data storage variable and then shift those bits dialog. To show that any device can talk to any other, I’ve to the right until my 16-bit word is full. Do you see what I implemented the master’s side of the communications did wrong? (No fair cheating by looking back at Listing 3 scheme on an Atmel ATMEGA168 microcontroller. I to see the correct settings). chose this controller because I have a bootloader on the See it yet? As soon as a logic 1 is received on the data ATMEGA168 and a SparkFun (www.sparkfun.com) line, all subsequent bits are a logic 1 as well. I changed Bluesmirf Bluetooth wireless virtual serial port attached to both chips and checked signal levels. All were fine ... what the board. No cables needed! (See Figure 6.) was going on? When you are an embedded programmer, I have a bunch of these boards which can also use the you need to understand some very low level specifications standard AVR ISP six-pin header to be programmed. If you about how a compiler works and how numbers are want one, drop me a line and I’ll sell you one at cost plus represented. Give up? Think about this ... how is a shipping (about $6 more or less.) This master controller negative number represented in an integer? The MSB is doesn’t do anything beyond sending a few commands to set to 1, that’s how. Have you heard the term Sign Extend show how it is done. before? In a signed integer when the MSB is set, that Listing 3 shows one code excerpt, the function means that it is a negative number; no matter what else waste(), which generates the delay to give the data bit time you do with that variable, the MSB must remain set. This is the bug. I defined my data variable as an int, not an Figure 8. The whole sensor system. unsigned int. As soon as I shifted a 1 into the MSB, the compiler made sure that the MSB stayed set so that the number remained negative. DOH! This bug was both

LISTING 4. Where’s the bug?

unsigned int getSPI(char addr, char cmd) { /* * get an SPI data packet * SDA = PC0 * SCK = PC1 */

unsigned int data=0; unsigned int bCount = 0; //bit count unsigned int bit = 0x8000; //set the msb

for(bCount = 0;bCount<8;bCount++) //send addr { SDA = addr & 0x01; //send bit 0 waste(); addr>>=1; //get next bit //{and so on}

18 SERVO 06.2009 MrRoboto - Jun 09 dc-edited.qxd 5/5/2009 4:13 PM Page 19

subtle and really obvious once I saw it. There is the 4) Investigate devices that have an open drain output lesson: When the data you observe doesn’t make any so that I don’t have to worry about damaging a part if sense, examine your assumptions; at least one of them bus contention occurs (two parts driving the line in is wrong! opposite directions). So, there you have it. To add more sensors, simply daisy-chain more boards on to the SCI bus. Make sure that 5) Add more kinds of sensors! each of them has a different address though! Figure 8 shows my entire test setup with all of the boards wired That’s all folks! Have fun and let me know what you together. Not pretty, but it worked great. come up with if you like this bus architecture. Remember, the complete source code for this article ENHANCEMENTS: You can is available on the SERVO Magazine website under Mr. Roboto as SPIsonar.zip. It will have three files in it: always do better… SPIsonar.c for the PIC16F630 and CCS C compiler, and There is certainly room for future enhancement here. atm168.c and atm168.h for the ATMega168 processor Here are some of the modifications and changes that I side of the project. I used avr-gcc 4.3.0 as my compiler want to make: with Eclipse and the AVR Eclipse plugin as my development environment. If you want to know how to use this 1) Add a command to change the board address so I don’t environment, see my columns in the August and have to compile the address in. September issues. Well, we’ve come to the end of another Mr. Roboto 2) Carefully measure the required data setup time so I can column and I hope you’ve felt that it was time well spent. run the bus as fast as possible – find out what is possible. As usual, I can be reached for questions, comments, and criticisms at [email protected] and I’ll be happy 3) Find the maximum wire length before data corruption to work on it! Until next time, keep on building those occurs. robots! SV Robotiics Showcase 7KH(VFDSH C Stamp is ... 5RERW¶VEXLOWLQ L PLFURSURFHVVRU M O M A W HQDEOHVLWWR i N C cr U O ³WKLQN´RQLWVRZQ o FA S c C T .65  o T P n U C 6ROGHULQJ tr R B UHTXLUHG7KHURERWIURJPRYHVIRUZDUG o IN l G ZKHQLWGHWHFWVVRXQGDQG THOUSANDS OF ELECTRONIC le ! rs UHSHDWVVWDUW PRYHIRUZDUG ! PARTS AND SUPPLIES ! VWRS!OHIWWXUQ!VWRS!ULJKW WXUQ!VWRS .65  VISIT OUR ONLINE STORE AT PP:KLWH www.allelectronics.com Sensors and ZDWHUFOHDU /('9 WALL TRANSFORMERS, ALARMS, Boards Communications! PFG FUSES, CABLE TIES, RELAYS, OPTO for Development! $%  ELECTRONICS, KNOBS, VIDEO  ACCESSORIES, SIRENS, SOLDER VHFRQGYRLFHUHFRUGHUSOD\EDFN ACCESSORIES, MOTORS, DIODES, PRGXOH7KHHOHFWUHWPLFURSKRQHLVRQWKH HEAT SINKS, CAPACITORS, CHOKES, ERDUG2QHEXWWRQUHFRUGVWKHRWKHUEXWWRQLV TOOLS, FASTENERS, TERMINAL PRPHQWDULO\SUHVVHGWRUHSOD\WKHPHVVDJH STRIPS, CRIMP CONNECTORS, SUHDVVHPEOHG  $  L.E.D.S., DISPLAYS, FANS, BREAD- 7KH9HOOHPDQ3HUVRQDO6FRSH BOARDS, RESISTORS, SOLAR CELLS, ! LVQRWDJUDSKLFDOPXOWLPHWHU BUZZERS, BATTERIES, MAGNETS, ys EXWDFRPSOHWHSRUWDEOH CAMERAS, DC-DC CONVERTERS, la RVFLOORVFRSHDWWKHVL]HDQG HEADPHONES, LAMPS, PANEL p FRVWRIDJRRGPXOWLPHWHU METERS, SWITCHES, SPEAKERS, is $146. D +36  PELTIER DEVICES, and much more.... 7KRXVDQGV Come see what else at PRUHLWHPVRQ ORDER TOLL FREE www.c-stamp.com RXUZHEVLWH 1-800-826-5432 Ask for our FREE 96 page catalog SERVO 06.2009 19 JUN09NewProd.qxd 5/6/2009 4:10 PM Page 20

New Products NNEEWW PPRROODDUUCCTTSS

theory of operation, a complete wiring diagram, the MICROCONTROLLERS circuit schematic and a basic overview of the source code. Some of the exciting topics that are covered in 17 IN 1 Deluxe Microcontroller this course are basic digital circuits, logic levels, pull-up resistors, sensors, LEDs and LED displays, binary and Exploration Lab hexadecimal numbers, pulse width modulation (PWM), f you are looking for analog-to-digital conversion, stepper motors, LCD Ia way to introduce displays, and more. students to the world of For further information, please contact: microcontrollers and need CHANEY Tel: 800•227•7312 everything in one conven- electronics Website: www.chaneyelectronics.com ient package, then this is the kit for you. Chaney Electronics has developed a complete microcontroller MOTOR CONTROLLERS introduction course: the new 17 in 1 Deluxe Microcontroller Exploration Lab. This kit offers an introduction to microcontrollers and requires no previous Stepper Motor Controller Kit knowledge of microcontrollers or programming he stepper motor languages. It is a perfect hands-on lab that gives Tcontroller kit from students valuable practical experience as they build each Images Co. allows users experiment. All of the source code (written in C) is to control a uni-polar provided on a CD-ROM and each experiment has a hex stepper motor from file (the compiled source code) that can be programmed Windows XP. Various volt- onto the microcontroller using a Microchip PICkit™2 age stepper motors may programmer. The PICkit2 programmer plugs into a USB be used with the kit, including 5 VDC, 9 VDC, 12 VDC, port on your computer and allows you to program your and 24 VDC. The kit includes a 12 VDC stepper motor. microcontroller with the hex file. The PICkit2 programmer The exclusive Windows interface is designed to teach is included with the complete version of the kit and is fundamental stepper motor control. Automatic and man- necessary to program the microcontroller. Advanced users ual control of the stepper motor is available through the or students that are familiar with the C programming interface. Windows controls available are speed, direction language will be able to follow the source code that was full step and half step, and manual step. The Windows used to generate the hex file for each experiment. Stepper Motor Controller Kit is offered for $49.95. The lab requires no soldering as each experiment For further information, please contact: is built on a reusable solderless breadboard using the Website: www.imagesco.com/ supplied electronic components. At the heart of the kit Images Co. catalog/motors/stepper.html is a custom built microcontroller board that contains a Microchip PIC18F2410 microcontroller, a crystal, a volt- age regulator, and other components. The board is pre- soldered and ready to plug directly into the breadboard. WIRELESS A printed instruction manual with detailed illustrations guides students through the lab. The Easy Bluetooth Module instruction manual starts with an introduction to microcontrollers and gives an overview of what micro- he Easy controllers can do and how they are used in today’s TBluetooth modern digital circuits. Information on interfacing the Serial Module PICkit2 programmer with your computer is also included. from Parallax is an From here, the student will begin to build the effective and low- experiments. All experiments operate from one 9 VDC cost solution to battery (not included). Each experiment has a detailed free hardware

20 SERVO 06.2009 JUN09NewProd.qxd 5/6/2009 4:11 PM Page 21

applications from wires. The module is small in size, and with a SIP header design it can fit on any 0.1” HOME CARE ROBOTS spacing breadboards or perfboards for rapid prototyping and implementation. The module can be powered New Personal Care Mobile Robot with various voltages since it has an on-board regulator which allows it to be used with all the eckoSystems Intl. Corp. has Parallax, Inc., microcontrollers and other CMOS or TTL Gcompleted the prototyping of controllers. The RBT-001 module — which supports their CareBot™ MSR 3.87. “After Bluetooth 1.x and 2.0 — is removable, so other various nearly 12 years of development by applications can be designed without the SIP header many talented, tenacious engineers attached if desired. and programmers, we are very Price for the module is $69.99. excited to introduce our new For further information, please contact: CareBot personal care mobile robot,” said R. Martin Spencer, Web: www.parallax.com Parallax President/CEO of GeckoSystems. “The new CareBot MSR 3.87 can automatically watch over grandma or the kids, patrol SOFTWARE your home, and/or run errands for eight to 14 hours continuously without recharging. This capability, along with GeckoTrak™ and Internet-based video conferencing, RobotBASIC Version 4 enables our CareBot to perform like a family caregiver, enabling them to watch over loved ones, even when they obot BASIC Version 4.0 is now available and is can’t be there physically.” Rthe biggest upgrade to date with over 300 new For further information, please contact: commands and functions. The Window’s based GeckoSystems Tel: 866•227•3268 language still lets you create and debug your Intl. Corp. International: +1 678•413•9236 programs in a fast, easy-to-use interpreter-based IDE Website: www.GeckoSystems.com (which has been enhanced with external editor support and improved debugging features), but now has the option of compiling stand-alone EXE applications. This latest release has many new visual controls (now with event-handling), making it easier to create graphical user interfaces. There is also direct support for USBmicro I/O boards and a new low-level file I/O system. Internet support includes the ability to send and receive emails plus the ability to communicate with other RobotBASIC programs anywhere in the world utilizing both TCP and UDP protocols (no additional hardware needed). RobotBASIC is a very easy language to learn. To find out more about Version 4.0, visit their website and download your free copy. For further information, please contact:

Web: RobotBASIC www.RobotBASIC.com

SERVO 06.2009 21 CombatZone - JUN09-edited.qxd 5/5/2009 10:59 AM Page 22

Featured This Month: Features 22 BUILD REPORT: The Intro Ant BUILD REP RT by Kevin M. Berry The Intro Ant 25 MANUFACTURING: RioBotz Combot ● by Kevin M. Berry Tutorial Summarized Original text by Professor Marco fter a hiatus in building, unless very specialized. I’m heading back into the This post — quite similar to Antonio Meggiolaro; Summarized A arena. As part of my research, the previous Ultimate request — by Kevin M. Berry I’ve kicked off a series of accomplished exactly what I conversations on the Antweight desired. Three builders (all part of 27 PARTS IS PARTS: forum on Delphi Forums the Ultimate panel) posted their (http://forums.delphiforums. lists, along with some advice Banebots P60 1:16 com/antweights) about the from other seasoned veterans. Gearbox Review current state-of-the-art in The results were surprisingly con- antweight technology. Building sistent, and really only included a by Nick Martin on the Ultimate Ant thread, few — but significant — variations I asked the community for from the Ultimate list. recommendations to incoming Events new builders on constructing a Drive Motors 27 Mar 16 – Apr 12 2009 fully competitive, but more value-based (i.e., cheaper) The 16 mm BaneBots series is a good value among gearmotors. Completed Events and machine. Jun-Jul 2009 Upcoming For pumping the forum’s expertise, I laid down the Events following groundrules: Assuming the following: ROBOT PROFILE – Top limited budget (not zero, just tight) for components (but value Ranked Robot This Month: matters too, not just cost), two 29 Black Death by Kevin Berry driven wheels, spinner (drum, disk, horz, vert, doesn’t matter), any legal radio system, and it’s all BaneBots appears to be the RFL compliant. Don’t worry about value vendor of choice, both in raw materials or manufacturing forum responses and based on a

22 SERVO 06.2009 CombatZone - JUN09-edited.qxd 5/5/2009 11:00 AM Page 23

broad survey of current bot designs. www.fingertechrobotics.com. to come in a nearly infinite Pololu is also a contender. A number number of flavors. Suggested of folks have experienced a minor Drive ESC were: the 1,900 Kv 2830; the problem with the BaneBots motors: 1,130 Kv 2209 26 turn; and the The Fingertech Robotics Tiny ESC separation of the motor and gear- saves a few dollars and comes highly 1,500 Kv 2205 34 turn. All retail for box under load. A strip of tape to recommended. around $18. reinforce the joint seems to be a remedy. Gear ratios depend on the Weapon Controller desired speed, wheel size, and Turnigy’s Plush ESC handles 25 amps of torque, but the 16 mm 24:1 with continuous current. the 050 motor for $14 each is a good midrange selection. The Pololu 35:1 for $18 is also a possibility. Check out www.banebots.com and www.pololu.com. Three different ESCs were submitted. Two — the FingerTech Wheels Tiny ($54 a pair) and the BaneBots 3-9 ($58 a pair) — were Ultimate Dave Brown Lite Flite wheels proved Ant winners. The third (new to me) popular among beginners, as well as veterans. is the Sabertooth 5 at $60. Only because of the slightly lower price, The Turnigy Plush 25 amp I’m going with the FingerTech Tiny. speed controller — $17 at the mysterious King City Hobby place — Drive and Weapon seems to be the winner. Various Batteries other ESCs from the same outlet were suggested; all similar. The Rhino Li-Poly batteries from Hobby City ESC should be matched to the are a value-based alternative to more expensive brands. motor/battery combo, so since I left the motor selection vague, the ESC choice is also. Lite Flites, unanimous choice, same as the Ultimate Ant. Around Armor $4 a pair. The Spektrum 2.4 GHz system, with Hubs specialized combat robotics receiver, is Every vote cast was for a Li-Poly the new standard for FingerTech Hubs, at around fighting safely. $4 a pair, are made to work from www.hobbycity.com which with Lite Flites. for some reason takes you to Hobby King. Either way, let’s go with a Rhino 460 mAh 3S pack for $8. Weapon Motor

The Turnigy brand outrunner offers a wide range of specs in weapon motors.

The “value” nature of this FingerTech always gets votes. design precludes new titanium or I’m still a fan of the Lynxmotion carbon fiber (used/scrap is, of hubs, but the ease of installation of The Turnigy brand, also carried course, a strong possibility). That the FingerTechs wins me over, and by HobbyCityKing, was the only leaves the classics: aluminum, the price of $4 a pair can’t be beat. suggested outrunner. These appear UHMW, or polycarbonate. Online

SERVO 06.2009 23 CombatZone - JUN09-edited.qxd 5/5/2009 11:00 AM Page 24

Metals has a nice selection of VDD hubs are a polycarbonate in sizes like 12” low cost option for attaching x 12” x 0.25, for around $10. blades. www.onlinemetals.com. Radio Systems

Mike Jefferies build this render The Intro Ant of The Intro Ant.

The BR6000 Putting it all together, Table 1 the value. I do like the idea, receiver is upgraded for RFL shows our shopping list. The however, of being able to tell an compliant safing. Spektrum DX5e five-channel excited parent/child team watching transmitter ($73) is considered part their first event that a competitive There are a number of high of the infrastructure, just like the spinner ant can be built — including quality, inexpensive 75 MHz systems battery charger ($50-$100). support gear and spare parts — for on the market. However, any new This totals up to $238 for the under $500. SV builders should be aimed at the bones of a very decent antweight. 2.4 GHz systems, so they can be Depending on the builder’s abilities, Thanks to Travis Schmidt, Dan Wiseman, compatible with rules for all future the cost for the frame, fittings, Donald Sung, and Dennis Beck who events. The Spektrum DX5e ($73) weapon, wire, etc., vary from free provided information for this article. Graphics are from the websites of vendors with BR6000 ($50) from The Robot to another $200 or so. mentioned throughout the article. MarketPlace is the preferred and The Ultimate Ant rang the till possibly only RFL compliant system; at $481 (adjusted for the more TABLE 2 a real bargin in most builder’s reasonable battery), so our Intro ULTIMATE INTRO opinions. Check out www.robot cost about half the Ultimate. See • Drive Motor $70 $28 marketplace.com. the big differences in Table 2. • Wheels $4 $4 I’m not experienced with • Hubs $21 $4 Power Switch brushless outrunner motors and • Drive ESC $54 $54 controllers, so I can’t judge if • Drive Batteries $37 $8 • Weapon Motor $75 $18 This category received almost the quality and power of the • Weapon ESC $80 $17 no play in the Ultimate Ant thread. Ultimate brands are worth four • Armor $40 $20 For an Intro level bot, it was pretty times the cost of the Intro • Radio Receiver $50 $50 much agreed that a simple, setup. I do know that we didn’t • Power Switch $20 $5 “connect the connector” approach even address the matter of • Fittings/Parts $30 $30 $481 $238 is fine. I still like my RadioShack spare parts here — a significant • Transmitter $130 $73 DPDT switch setup that allows a expense. I’ve also never run • Charger $50 $50 charging jack option, but can’t Maxon motors (the Ultimate argue that KISS is the best. favorite) so again, can’t judge TOTAL $661 $361

Fasteners, Fittings, TABLE 1 and Parts ITEM DESCRIPTION PRICE • Drive Motor Two BaneBots 16 mm 24:1 with the 050 motors $28 Confusing “cheap” with “value” • Wheels Two 1.75” Lite Flites $4 was a common theme. Yes, sheet • Hubs 3 mm FingerTech $4 metal screws and parts swiped from • Drive ESC Fingertech Robotics Tiny ESC (2) $54 VCRs (“Daddy, what’s a VCR?”) are • Drive Batteries Rhino 460 mAh 3S 11.1V $8 • Weapon Motor Turnigy 1,130 Kv 2209 26 turn $18 cheap. I’m going to maintain that in • Weapon ESC Turnigy Plush 25 amp Speed Controller $17 fasteners, paying a bit is worth it. • Armor 0.25” Polycarbonate $20 One useful tip is the VDD blade • Radio Receiver BR6000 Spektrum $50 hub, available from The Robot • Power Switch Dealer’s Choice $5 MarketPlace. • Fittings/Parts Various $30

24 SERVO 06.2009 CombatZone - JUN09-edited.qxd 5/5/2009 11:01 AM Page 25

MANUFACTURING: RioBotz Comb t Tutorial Summarized: Design Fundamentals

● Original text by Professor Marco Antonio Meggiolaro; Summarized by Kevin M. Berry rofessor Meggiolaro of the Scale Factor scale factor of the cube root of two, PPontifical Catholic University or 1.26, so all dimensions should be of Rio De Janeiro, Brazil, recently One important thing to keep in increased by 26%. translated his popular book, mind during the design phase is Obviously, there is a lot more to The RioBotz Combot Tutorial, into the scale factor. If the physical this. Volume doesn’t automatically English. In the process, he greatly dimensions (length, weight, height) equal weight unless the density is expanded it and solicited input of a bot are doubled, the volume the same, which means precise from a wide range of robot cubes. However, the cross sectional scaling of components. Using builders. The updated version — 367 area of a structural member just commercial parts with standard pages long with an incredible 895 doubles, so its strength doesn’t sizes, this won’t exactly happen. figures, graphs, and photographs — keep up with the weight/volume. Also, stress and strength aren’t is available free for download at What does this have to do with linear factors. The tutorial recom- www.riobotz.com.br/en/ combat robots? Everything. mends raising the scaling factor to a tutorial.html. SERVO Magazine, If you want to take your 12 power of 1.5 in critical components as a service to the building pound hobbyweight design and like weapon shafts to account for community, is summarizing the scale it up to a 120 pound tutorial in a series of articles middleweight, you’d need TABLE 2 beginning with part of Chapter 2, to multiply the weight by WEIGHT CLASS DIAMETER “Design Fundamentals.” Look for 10. You’d do this by • 60 pound Lightweight 0.5” the rest of Chapter 2 and additional multiplying all the • 120 pound Middleweight 0.75” chapters in the future. All dimensions by the cube root • 220 pound Heavyweight 1.0” information here is provided of 10, or 2.15. If you were • 340 pound Super-Heavyweight 1.25” courtesy of Professor Meggiolaro going to double a 60 and RioBotz. pound bot’s weight, TABLE 1 you’d be building NAME WEIGHT Weight Classes a 120 pound • Unnamed 1 ounce middleweight with a • Fleaweights, Nanoweights, 50 or 75 grams Combat robots UK Fairyweights range in size from • US Fairyweights, UK Antweights 150 grams • US Antweight 1 pound the unnamed one • Beetleweight 3 pounds ounce miniatures, • Kilobots 1 kilogram through 50 or 75 • Mantisweight 6 pounds gram fleaweights, • Featherweight 12 pounds (full combat & Sportsman) up to 390 pound • BotsIQ (small class) 15 pounds megaweights. Table • Hobbyweight 30 pounds 1 summarizes cur- (full combat & Sportsman) rent weight classes. • Lightweight 60 pounds • Middleweight 120 pounds Middleweight, Hobby-weight, • Heavyweight 220 pounds Beetleweight, and • Super-heavyweight 340 pounds (US); Fleaweight versions of the same “Touro” drumbot 320 pounds (UK) design, stacked to illustrate • Megaweight 390 pounds scaling factors.

SERVO 06.2009 25 CombatZone - JUN09-edited.qxd 5/5/2009 11:02 AM Page 26

Playing the “Who Can Beat Who” game is an integral part of the design process. the weight of a multibot must be incapacitated to win a round, often three bots are used. This means three 120 pound middleweights (with one losing 20 pounds on a diet) would fight a 340 pound super-heavyweight. The odds of a 120 pound weapon inflicting damage on super-heavyweight armor are slim. Another technique using one “90%” bot and two smaller “door stops” hasn’t worked well in practice, either. Cost

TABLE 3 Imagine how many shafts Cost is variable, depending on have been broken in combat creativity, resourcefulness, and WEIGHT CLASS COST (US$) to arrive at this optimized design. However, a survey of typical • 60 pound Lightweight $3,000 sizing. Using these calcula- costs for bots built with high quality • 120 pound Middleweight $4,000 tions, the optimum design parts reveals these numbers • 220 pound Heavyweight $6,000 can be done up front. (including R/C equipment and spare • 340 pound Super-heavyweight $8,000 batteries). See Table 3. Robot Types Bots can certainly be built for this. This is backed up by steel more or less than these numbers. wheel shaft data from successful There are basically 16 types of But, it’s best to remember, this is combat bots (see Table 2). combots: rammers, wedges, lifters, not a cheap sport. For the interested Comparing heavyweights and launchers, thwackbots, overhead new builder, smaller bots like super-heavyweights with similar thwackbots, spearbots, horizontal featherweights or insects (less than aspects, the theoretical scale factor spinners, sawbots, vertical spinners, 12 pounds) are a good option. would be (340 lb/220 lb)1/3 = drumbots, hammerbots, clampers, 1.16, and the ratio between the crushers, flamethrowers, and Sponsorship shaft diameters is 1.25”/1” = 1.25 multibots. While there are infinite — a value reasonably close to subtle differences, they can always The Robot MarketPlace has 1.161.5 = 1.249. be categorized into one of these 16 some great tips about sponsorship. The bottom line is that theory types. There are also bots with inter- (http://robotmarketplace.com/ combined with common sense is a changeable weapons (chameleons). tips.html). Basically, it’s not easy to very powerful design tool in practice. Bots known as “Swiss Army Knives” get a sponsor if you haven’t built a with two or more weapons bot before. The only exceptions are The stunning craftsmanship of Buster, a are usually not very efficient companies whose owners or direc- Super-heavyweight milled from titanium. Photo courtesy of Hal Rucker. or effective, with the excep- tors already know you well. Most tion of using a wedge as a big companies don’t sponsor robots. secondary weapon. This is It’s better to look at smaller local so common as to be almost a shops that might benefit from the standard design technique. exposure. Also, you have to call or There are also defensive visit in person. Email isn’t likely to items like bumpers or hold bring you sponsorships. off sticks. Bring or mail business cards Multibots generally with your team’s information and don’t do well. To get logo. Prepare a presentation folder around the rule that 50% of with lots of nice photos. Show the

26 SERVO 06.2009 CombatZone - JUN09-edited.qxd 5/5/2009 11:03 AM Page 27

potential sponsors how and where from sponsors without a proven their name will be visible, such as track record. However, parts or on team T-shirts, websites, You-Tube machining time are much more videos, and of course, on the likely. Don’t give up after getting bot. Show examples of where turned down a few times. Evaluate newspapers, magazines (say SERVO what you’re doing and keep going; three times, loudly), and TV news this takes a lot of effort. programs have covered events. Showing videos from fights is What’s Next? important. Make sure the videos show enthusiastic crowds. The next installment of this Include your annual budget on summary will get into the nuts and your folder. Include the total cost of bolts (literally!) of combot design: building, fighting, and repairing your calculations, optimization, building bot, marketing items like T-shirts, and testing, structures, armor, and travel costs, entry fees, etc. Don’t be drive types. This short summary afraid to show the total cost. They covered 16 pages of dense and can always fund part of the cost fascinating material. SV instead of the whole, but going back for more money later is difficult. All material used with permission of RioBotz, A well designed brochure can elevate a team It will be difficult to get cash Marco Antonio Meggiolaro. from “begger” to “sponsored.” EVENTS Completed and Upcoming Events

Completed Results for and 28, Brisbane, Queensland. oboGames will be held June March 16 to April 12, R12-14 in San Francisco, CA. 2009 Upcoming Events for Go to www.robogames.net for Jun-Jul 2009 more details. SV deas IFestival: March 27 PARTS IS PARTS: Banebots P60 1:16 Gearb x Review ● by Nick Martin

y P60 gearboxes have arrived right spots where the CAD drawings Mand so far, they look very say they will be. promising. The overall machining Compared to the 42 mm quality is vastly improved when gearboxes they replace, the P60 compared to the Chinese produced has a very similar 1/2” output shaft versions. All the mounting holes on that reduces to 3/8” at the front PHOTO 1. P60 (center) with the 36 and 42 mm my gearboxes are in exactly the bearing. The reduction point is gearboxes it replaces.

SERVO 06.2009 27 CombatZone - JUN09-edited.qxd 5/5/2009 11:03 AM Page 28

PHOTO 3. The Banebots similar thickness to parts fitted in Orbit. the 36 and 42 mm gearboxes and has the same improved construction and materials as the front plate. It adds some ventilation recesses so that motors can draw air in through their front faces — a small but worthwhile upgrade. PHOTO 2. Internals of the P60 with the 36 mm and 42 mm ring gears at the back. In Action

where the shaft is going to bend or The ring gear has had a major An Aussie 30 lb vertical disk break every time, but it is no worse overhaul: the outside diameter has bot named Orbit has a pair of P60 than its predecessor and is stronger remained, but the wall thickness has gearboxes, Banebots 2-7/8” wheels, than the 36 mm gearboxes. The dropped so that the same gears and bearing blocks fitted. In a P60 is a little heavier and longer from the 42 mm box now fit in a recent event, it had seven matches than the old 36 mm gearbox and 36 mm box — this is the ‘secret against a variety of opponents: unfortunately for existing users the ingredient’ and is the most vertical and horizontal spinners, mounting holes do not line up, significant design change in my wedges, and thwackbots. While it meaning that P60 is not a drop-in opinion. The case screws that took its fair share of damage, the replacement. formerly went through the ring gear P60 gearboxes still look and operate The front plate is a definite are now external and have changed like new; the only problem being improvement over the 36 and 42 from M3 to a larger 6-32 imperial the motors coming loose (clamping mm gearboxes. It is well machined thread pitch — a good move. The the motor to the frame would have and made of a tougher grade of only bad point here is the use of fixed this). The gearboxes had to aluminum, supposedly 2024. The screws with a slotted, round head. withstand some huge downward cheaper gearboxes are made with The slot strips very easily and I have forces as Orbit bounced opponents aluminum that crumbles after small already replaced them with socket off the roof and walls. amounts of shock damage and the head screws; for the small cost, I front plate design has a very thin suggest you do the same. Summary cross-section in places. The new Inside, the P60 looks very version does away with the largely similar to the 42 mm box but there The big question is: ‘Are they useless face mount screw holes and are several small but important worth it?’ I would say definitely yes, moves the remaining holes to better differences: the gears are now all if you ever broke one of the 42 or locations, making a stronger part. steel; the pins are increased from 36 mm gearboxes. For about the

PHOTO 4. Orbit and the P60 gearboxes 3 mm to .125”; and the carrier same price the 42 was and $19 in action. plates are thicker and more than the weaker 36 mm unit stronger steel. (based on the 16:1 version), you will Banebots lists the end up saving money in reduced gears as being larger breakages and repairs. If you have than before, but my not yet killed any of your 36 mm callipers say they are gearboxes, then the extra strength the same — except of the P60 is possibly wasted, but steel, so it’s still all still a comfort to have. good news. The only If I was going to change disappointment is the anything about these gearboxes, I small increase in the would still upgrade the second pin size; a 5/32” pin stage pins to 5/32” and replace would have been the case screws with socket cap better IMHO. screws, however, the mods are The back plate is a more optional than essential. SV

28 SERVO 06.2009 CombatZone - JUN09-edited.qxd 5/5/2009 11:04 AM Page 29

ROBOT PR FILE TOP RANKED ROBOT THIS MONTH

● by Kevin Berry Top Ranked Combat Bots Black Death – Currently Ranked #1 History Score Ranking

Weight Bot Win/Loss Weight Class Bot Win/Loss Class

150 grams VD 26/7 150 grams The Joke 4/0 Black 1 pound Dark Pounder 44/5 1 pound 15/1 Death

1 kg Roadbug 27/10 1 kg Underkill 4/1

3 pounds 3pd 48/21 3 pounds Yeti 14/4

6 pounds G.I.R. 17/2 6 pounds G.I.R. 5/0

12 pounds Solaris 42/12 12 pounds Surgical Strike 21/7

15 pounds Humdinger 2 29/2 15 pounds Humdinger 2 29/2

30 pounds Helios 31/6 30 pounds Touro Feather 8/2

30 (sport) Upheaval 19/7 30 (sport) Upheaval 17/5

Wedge of 60 pounds 43/5 60 pounds K2 6/0 Doom

120 pounds Devil's Plunger 53/15 120 pounds Touro 12/2 Class: 1 pound Antweight Team: Enigma Robotics 220 pounds BioHazard 35/5 220 pounds Original Sin 10/2 Builder(s): Peter Iskaros 340 pounds SHOVELHEAD 39/15 340 pounds Ziggy 5/2 Location: Ridgewood, NJ 390 pounds MidEvil 28/9 BotRank Data Total Fights Wins Losses Current Ranking is calculated by History Score is calculated by perfomance Lifetime History 23 20 3 performance at all known events, using at all events known to BotRank data from the last 18 months Current Record 16 15 1 Events 3 Data as of March 30, 2009

lack Death has competed in: ● Drive batteries: ThunderPower Motorama 2010 BMotorama 2007, Motorama 730 mAh 2S 7.4V 2008, Motorama 2009. Details are: ● Design philosophy: Spin ● Weapon batteries: Same as undercutting bar to stop anyone ● Overall configuration: Two wheel above (one battery) from getting near with weapon. horizontal bar spinner Weapon spins low enough to stop ● Weapon motor: Axi Silver wedges from getting near, also. ● Frame: 3/16” thick UHMW milled 2208/20 unibody ● Builder’s bragging opportunity: ● Weapon controller: Thunderbird The blade wobbles to the point ● Drive motor: Banebots 16 mm 18 brushless ESC that it hits the ground, yet no 24:1 spur gearmotor one can take it out. It’s been ● Armor: 1/32” Garolite top and 16 matches on the same bearing ● Wheels: 2-1/4” Lite Flites bottom skins, UHMW side walls (15 of them wins). SV

● Hubs: 4 mm aluminum Dave’s ● Radio system: Spektrum DX6, Photos and information are courtesy of Peter hubs BR6000 receiver (2.4 GHz) Iskaros. All fight statistics are courtesy of BotRank (www.botrank.com) as of April 11, 2009. Event attendance data is courtesy of BotRank and ● Drive ESC: Banebots 3-9 ESC ● Future plans: Return to The Builder’s Database (www.buildersdb.com).

SERVO 06.2009 29 Events - JUNE09.qxd 5/5/2009 4:31 PM Page 30

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 24-26 MATE ROV Competition local school or robot group planning a contest? Send an Scripps Institution of Oceanography, email to [email protected] and tell me about it. Be sure to San Diego, CA include the date and location of your contest. If you have a In this event, high school and university teams website with contest info, send along the URL as well, so we field remotely operated underwater robots in can tell everyone else about it. an event that simulates an underwater rescue For last-minute updates and changes, you can always mission to deliver emergency supplies to a find the most recent version of the Robot Competition FAQ submarine. at Robots.net: http://robots.net/rcfaq.html www.marinetech.org/rov_competition

— R. Steven Rainwater 27-28 International Autonomous Robot Contest San Diego County Fairgrounds, San Diego, CA June Multiple events for autonomous robots including a technical presentation, an Urban Challenge 5-8 AUVS International Ground Robotics event, and the Gold Rush Challenge. Competition www.iaroc.org Oakland University, Rochester, MI University teams field autonomous ground robots 27 UK National Micromouse Competition that must navigate an outdoor obstacle course. Birmingham, United Kingdom www.igvc.org/ In this competition, there is maze solving for autonomous micromouse robots. 12-14 RoboGames www.tic.ac.uk/micromouse Fort Mason, San Francisco, CA This is the big one with over 70 events for 29 RoboCup Robot Soccer World Cup everything ranging from Sumo and robot soccer (runs through July 5) to Kung-Fu. Graz, Austria www.robogames.net Robot soccer events for all types of autonomous robots including four-legged robots, bipeds, and 13 KCRS Robot Exhibition and Competition wheeled robots. Also includes the NIST Rescue Kansas City, MO robots field test event. Events include Mini Sumo, Solar Rollers, Photovore www.robocup.org Mouse Race, Line-Following, and the oddly named Dinnerware Demolition. www.kansascityrobotics.org Jully 13-14 Motodrone AFO Competition 1-5 Botball National Tournament Finowfurt, Germany Leesburg, VA Events for autonomous flying robots including stable Autonomous robot event for student teams. hovering in changing wind, waypoint navigation, www.botball.org capturing objects, automatic take-off and others. www.motodrone.de 7-9 Singapore Inter-School Micromouse Competition 19 SPURT Ngee Ann Polytechnic, Singapore Rostock-Warnemunde, Germany This is a maze solving event for autonomous Autnomous robots race around the official micromouse robots. SPURT track. www.np.edu.sg/alpha/micromouse/ http://spurt.uni-rostock.de mice_main.htm

30 SERVO 06.2009 Events - JUNE09.qxd 5/6/2009 9:19 AM Page 31

11 RobotRacing 10-12 Robots at Play University of Waterloo, Ontario, Canada Odense, Denmark Autonomous robot race cars navigate an outdoor Autonomous robots compete to demonstrate race track. playfulness and interactivity. www.robotracing.org www.robotsatplay.dk/

20-24 AUVS International Aerial Robotics 14-17 European Micro Air Vehicle Competition Competition Delft, The Netherlands University of Puerto Rico, Mayaguez, Puerto Rico Multiple events for flying robots include an Autonomous flying robots and sub-vehicles outdoor autonomy mission, an outdoor perform complex tasks including entering and endurance mission, an indoor autonomy mission, searching buildings. and an indoor dynamics mission. http://avdil.gtri.gatech. www.emav2009.org edu/AUVS/IARCLaunch Point.html

20-24 K'NEX K*bot World Championships Las Vegas, NV Multiple events with asterisks in their name like Cyber K*bots, Four-wheel drive K*bots, and Two-wheel drive K*bots. www.livingjungle.com

28 AUVS International Underwater Robotics at AUBURN UNIVERSITY Competition (runs through Aug 2) San Diego, CA BEST University students field Boosting Engineering, Science and Technology autonomous robots that Middle and High School Robotics Competition must complete an underwater course. www.auvsi.org/compe Join us at the conference to learn why and how titions/water.cfm to start a BEST competition on your campus! BEST Facts: 2nd largest school-based robotics competition August tin the U.S. 18-20 FIRA Robot World Cup tSix-week long, Fall competition that is FREE Incheon, Korea and open to all schools A robot soccer competition All equipment and materials are provided that tries to combine tto participating schools robotics with high quality In Fall 2009, over 750 schools and 12,000 students scientific research in AI and twill compete at 39 sites in 16 states computer vision. www.fira.net/ BEST excels at developing students’ technological literacy skills — exactly what industry needs in a future workforce! September 4-7 DragonCon Robot Battles Go to Atlanta, GA Remote control machine combat event. for more! www.dragoncon.org

SERVO 06.2009 31 Grazing Jun09.qxd 5/5/2009 7:29 AM Page 32

botsIN BRIEF

NO MORE SMELLY CAT ...

utomated Pet Care Products is doing their part to offer pet owners eco-friendly Apet care merchandise such as the new ECO Unit Litter-Robot to help contribute to the protection and sustainability of the planet — while still helping pet owners pamper their beloved cats. The Litter-Robot new ECO Unit is the perfect litter management solution that helps cat owners keep their pet 'green' and happy. Constructed with high quality, durable, industrial-grade components, the Litter-Robot is built to last and uses 100% recycled plastics in 84% of all the plastic components.The Litter-Robot's patented litter sifting process gently separates the waste clumps from the litter and deposits them into a waste drawer, leaving behind a clean bed of litter and greatly reducing odors. Pet owners simply empty the waste drawer every few days (more often if you have multiple cats) and no scooping is needed. The Litter-Robot is safe and comfortable for your pets and the rotating globe is spa- cious enough to comfortably accommodate a cat up to 15 lbs., while providing a large litter bed area for your cat.The unit operates using a safe 12 volts DC electrical plug and there are no moving parts or sharp objects inside the globe that can harm your cat.The Litter-Robot does not use a rake mechanism that can get jammed, clogged, or that requires frequent cleaning and maintenance. The product also features a safety mechanism that prevents the Litter-Robot from operating when a cat is inside.An added safety feature, the globe rotates very slowly during the cleaning cycle. If a cat tries to re-enter during the cleaning cycle, the motor automatically shuts off. For more information about the Litter-Robot, go to www.litter-robot.com. ROBOTS FOR THE BIRDS erman robotic company Festo has engineered the AquaPenguin G— a bionic life-size penguin that can swim and move underwater seemingly as graceful as their real life counterparts.The design and engineering involved with these robotic penguins is pretty amazing since they are able to twist and turn in small spaces.They also carry 3D sonar that allows them to communicate with other AquaPenguins, as well as swim autonomously around their environment. The seaworthy penguins sport wings of spring steel embedded in an elastic matrix of silicon, producing a sleek profile and the ability to twist to the most efficient pitch angle with each stroke.The flat, flexible wings of the airborne penguins are made of polyurethane foam and are suspended by a strut at the pivot point of the creature's torso. You’ll find out more at http://penguingeek.wordpress.com.

REAL DRAGON BREATH ere’s a 23.6 foot tall (7.2 meters) aluminum robot "baby" breathing fire during a Hrehearsal for this year's Roppongi Art Night, held back in March.The robot, created by Japanese artist Kenji Yanobe, was one of the main art installations for the event held in the Roppongi Hills neighborhood,Tokyo Midtown.The venue was held over many locations, including the National Art Center, Suntory Museum of Art, public spaces, and participating shops and restaurants in the Roppongi area. Check out other exhibits at http://roppongiartnight.com. Photograph by Katsumi Kasahara/AP

32 SERVO 06.2009 Grazing Jun09.qxd 5/5/2009 7:29 AM Page 33

IN BRIEFbots

ROBOT SNAKE WITH LEGS

ost robot snakes tend to look like real snakes, but Mthis new design has a central “body” with three “branch legs,” each of which has a wheel. The “trident” snake robot is an example of a nonholonomic mobile robot The basic idea of this invention is based on a purely mathematical interest on nonholonomic systems with multi-generators. In terms of nonlinear controllability, multi-generator systems are structurally different from single-generator systems such as chained systems, which have been comprehensively investigated since the early ‘90s. Control problems for these systems are a relatively new field that is actually pretty complicated. Additional info is at www.robotworldnews.com.

COME SAIL AWAY ... echanical engineering students from ETH Zurich have developed an Munmanned sailing boat in a focus project that can reach any given destination completely autonomously.The Avalon robot sailing boat is due to set sail from Ireland in the fall and head for the Caribbean. Avalon has already had a taste of the water on Lake Zurich. Admittedly, the first run ended on a sandbank, but that can happen to any sailor, right? The students are just happy that the boat is ready and in the water. Organizers of the Microtransat Challenge — which Avalon will be competing in — expect that it will take somewhere between two to three months for the boats to reach the tropical waters on the Atlantic crossing. If you’d like to set sail yourself, go to www.microtransat.org. Image courtesy of SSA/ETH Zurich

A PREFERRED PROCEDURE ...

ox Chase Cancer Center researchers have found that — based Fon a study by Fox Chase robotic surgeon Rosalia Viterbo, MD — outcomes of robotic assisted kidney cancer surgery prove more beneficial to patients when compared to open surgery. As a result of the fast recovery, patients do not delay treatment plans with chemotherapy or radiation therapy which help to stop the disease from progressing. Go to the Fox Chase Cancer Center website at www.fccc.edu if you’d like to learn more.

SERVO 06.2009 33 Grazing Jun09.qxd 5/5/2009 7:29 AM Page 34

NO ‘FLASH’ IN THE PAN

ith a Flash drive input for a head, this metallic robot can store 4 GB Wof memory in its shiny body. It can also be clipped to a keychain, allowing users to conveniently take their data with them. Even better, it holds its helmet (a USB cap) in both hands so that you’ll never lose it. It’s available for $25 at Gadget4all.com if you feel strongly about getting one.

PIONEERING EFFORTS

ne of the pioneers of Orobotics in Japan is Professor Shigeo Hirose at the Tokyo Institute of Technology. He has been working in robotics for 35 years. His lab is crammed with prototypes and designs for robots that can walk, crawl, swim and jump. Check out his creations at www.gavo.t.u-tokyo.ac.jp.

TINY (AUTONOMOUS) DANCER MOON-WALKIN’ ROBOT uilt from a simple NXT apan hopes to have a two- walk on the Bkit, a new robotic system Jmoon by around 2020, according to a plan laid out by designed by João Oliveira — a a government group. student finalist at the Masters in Specifics of the plan, including what new technologies Integrated Electrical Engineering will be required and the size of the project's budget, will be of the Faculty of Engineering decided within the next two years, according to Japan's of the University of Porto Strategic Headquarters for Space Development. (FEUP) — can identify differ- Development of a lunar robot is part of a broad ent types of dance and music framework outlined by the group, which is charged with in an intelligent manner and is plotting a new course for Japan's space strategy.As a next fully autonomous.The next step, joint exploration of the moon involving robots and step is to create and manage cho- astronauts will be considered. reography between humanoid The framework is to be finalized soon, after the public robots. has a chance to comment on the proposals. The result of this combination The group also recommended promoting research of math and music is a robot that applies algorithms to the into military satellites, such as an early warning system for level of perception of rhythmic musical notes with an inte- detecting ballistic missile launches and systems to detect grated system for and analyze radio waves sent in space. intelligent hearing.The robot reacts in sync with different Other recommendations by the group include using stimuli (either musical or related to the color of the dance space research as a tool to foster diplomacy with other floor), expressing the movement of dance style defined countries and developing an advanced satellite to predict by the user. and monitor natural disasters. Source: Faculdade de Engenharia da Universidade do Porto Source: www.sfgate.com www.fe.up.pt

34 SERVO 06.2009 Grazing Jun09.qxd 5/5/2009 7:30 AM Page 35

TWICKIE TWEENS TAKE ON NEW YORK

weenbots are human-dependent robots created by Kacie Kinzer Tthat navigate a city (in this case, New York) with the help of pedestrians they encounter. Rolling at a constant speed in a straight line,Tweenbots have a destination displayed on a flag and rely on people they “run into” to read this flag and point them in the right direction to reach their goal. Throughout numerous missions, the Tweenbots were successful in rolling from their start point to their far-away destination assisted only Copyright © 2009 Kacie Kinzer All Rights Reserved by strangers. Every time the robot got caught under a park bench, ground futilely against a curb, or became trapped in a pothole, some passerby would always rescue it and send it toward its goal. Never once was a Tweenbot lost or damaged. Often, people would ignore the instructions to aim the Tweenbot in the “right” direction, if that direction meant sending the robot into a perilous situation. One man turned the robot back in the direction from which it had just come, saying out loud to the Tweenbot, "You can’t go that way, it’s toward the road.” Get the latest travel plans at www.tweenbots.com.

MARCO POLO BOT cientists have used a popular kid’s swimming pool game to guide their Sdevelopment of a system for controlling moving robots that can autonomously detect and capture other moving targets. Engineers from Duke University and the University of New Mexico have used the simple pursuit-evasion game "Marco Polo" to solve a complex problem — namely, how to create a system that allows robots to not only "sense" a moving target, but intercept it.The main challenge facing researchers is developing the artificial intelligence to control the robots and their sensors without direct human guidance. Get updates at www.pratt.duke.edu.

MEET KASPAR, THE FRIENDLY ROBOT ASPAR is a child-sized being used to study human-robot interaction as Kpart of the European RobotCub Project, which aims to build an open-source robot platform for cognitive development research.The Adaptive Systems Research Group is investigating the use of gestures, expressions, synchronization, and imitation. In addition, the robot may be used for developmental studies and interaction games. This family of robots has been used in the past in the Aurora project which investigated the possible use of robotic systems as therapeutic or educational tools to encourage social interaction skills in children with Autism.They are currently being used with children with Autism as part of the European IROMEC project which acknowledges the important role of play in child development as a crucial vehicle for learning about the physical and social environment, the self, and for developing social relationships. IROMEC targets children who are prevented from playing, either due to cognitive, developmental, or physical impairments which affect their playing skills, and is investigating how robotic toys can empower children with disabilities to discover the range of play styles from solitary to social and cooperative play. To learn more, visit http://kaspar.feis.herts.ac.uk/.

SERVO 06.2009 35 Eady - LIN - edited.qxd 5/6/2009 10:51 AM Page 36

Implementing a Low Speed, Low Cost Communications Protocol by Fred Eady (that you’ve probably never heard of)

The LIN (Local Interconnect Network) framework was originally conceived for the automobile industry. LIN nodes are typically small standardized electronic modules that enable low cost networks for low end automotive functions. In today’s automobile, major automobile computing nodes are usually interconnected using high bandwidth CAN (Controller Area Network) technology. LIN nodes command less bandwidth than CAN nodes and are normally found in smaller satellite networks that oversee the automobile’s door locks, windows, lighting, and air handling. If you really get down to it, a modern automobile is made up of a number of networked embedded computing nodes that are tasked to support the automobile’s mechanical parts and electrical functions. Thus, a car is no more than a sophisticated, computerized four-wheeled cargo robot.

IN is a relatively young network topology. It is a designing and building a pair of regulation LIN nodes. standardized protocol based on hardware and Lfirmware normally used for RS-232 communications. Scratching Out A Robotic LIN Node Initially released in 1999, the latest spec is revision 2.0 and dated September 23, 2003. As LIN became more of a From the looks of Photo 1, we’ve got some assembly complicated liability for American automakers, North work to do. The actual LIN circuitry takes up about half of American automakers dived into the LIN mix. A task force the printed circuit board’s component area. The rest of the was assembled and published the SAE (Society of component area is populated by a textbook PIC18F2620 Automotive Engineers) J2602 Recommended Practice for microcontroller implementation. I’ve reserved plenty of LIN Networks document, which is aimed at the ambiguities breadboard area for additional monitor and control of the LIN 2.0 specification. As of late 2008, a LIN 2.1 test electronics as the automotive and robotic purpose of a LIN specification is in the works. If LIN can be applied to the node is to perform or control a mechatronic task. control of automobile mechatronics, it stands to reason that The Microchip LIN transceiver doesn’t need much sup- we can adapt LIN to our robotic needs, as well. Let’s begin port from the PIC18F2620. So, most of the PIC’s I/O pins our smells-more-like-a-robot-than-a-car LIN discussion by are available at the I/O header. If you need to commandeer some of the I/O pins that are already spoken for, you can PHOTO 1. The LIN node electronics are mounted on an free up RC0 and RB2 by removing resistors R9 and R8, inexpensive two-layer ExpressPCB printed circuit board. respectively. By activating the PIC’s internal oscillator, you All of the components are readily available from Mouser or Digi-Key. There’s plenty of breadboard area for mounting relays, can also recover I/O pins RA6 and RA7 while eliminating LEDs, an LCD, or motor drivers. crystal Y1 and supporting capacitors C8 and C9. The LIN founders intended for the slave nodes to be hosted by devices that require very little support circuitry, such as crystals and voltage regulators. So, you may want to keep the crystal and its supporting capacitors in your master node and trim the slave nodes down to the bare essentials. There are two things that turn our PIC18F2620 circuit into a LIN node: the firmware driver and a Microchip MCP2021 LIN transceiver. Since we’re in the hardware build mode, let’s talk about the MCP2021. Microchip’s MCP2021

LIN nodes operate on a bidirectional, half-duplex commu- nications link. The term half-duplex tells us that network nodes 36 SERVO 06.2009 Eady - LIN - edited.qxd 5/6/2009 10:52 AM Page 37

are not allowed to transmit simultaneously. J1 J2 3 SCHEMATIC 1. The 2 1 Thus, only one node may transmit on the network PIC18F2620’s EUSART

at any time. When a node is transmitting, all provides the RS-232 GND LIN VBAT of the other nodes are in listen mode. The LIN signal source which is converted to LIN 2.0 specification lays out the timing require- voltage levels by ments to prevent data collisions on the link. the MCP2021. Multiple LIN nodes physically attached SMBJ43A-E3/52 to the same single wire bus are called a LIN D1 cluster. A LIN cluster is made up of the bus wire, 1N4004-S1G

a master node, and up to 16 slave nodes. D2 Despite the origin of the communications signal, D4

a LIN node must provide a suitable hardware MMBZ27V

interface to the physical communications medium. +

In our design, the LIN physical interface is 10uF C3 provided by the MCP2021 LIN transceiver. CLT1 The MCP2021 was specifically designed JP1 0.01uF for automotive use. Those of you that have C4 larger mechanical animals that are powered 1N4148WX- with automotive batteries will appreciate the

MCP2021’s ability to absorb automotive type D3 1K R4

electrical transients and overloads. However, we TP can also easily adapt the MCP2021 to other LED1 smaller non-automotive mechatronic applications. 5 6 7 U1 Our PIC18F2620-based LIN node design GND LIN VBB 1K MCP2021-500 is depicted graphically in Schematic 1. Let’s R9 FAULT/TXE work our way through the LIN node design CS/LWAKE LIN VDD RXD TXD R7 from left to right, beginning with the LIN 1K bus physical interconnect at J2. The MCP2021 8 is designed to continuously handle VBAT 1 4 2 3 input voltages between +6.0V and +18.0V. VDD The maximum voltage that can be accom- 1uF C5

modated by the MCP2021 at the VBAT input 100 R5

is +30.0V. The nominal voltage expected at K VBAT for an automotive application is +13.8 100K R6 C6 .1uF 0.01uF VDC. If things get hairy, the MCP2021 is C7 capable of handling double battery jumps and a +43.0V load dump at its VBB input on its own. D1 — an SMBJ43A-E3/52 — is a TVS

(Transient Voltage Suppression) diode that 19 20 11 18 17 22 21 27 28 8 1 4 5 6 U2 enables the MCP2021’s VBB input to survive PIC18F2620 RC0 RC7/RX RC6/TX RB1 RB0 RB6/PGC RB7/PGD MCLR VDD 6 4 5 GND GND load dumps in excess of +43.0V. Diode D2 is ICSP 1 2 3 100 assisting in the voltage regulator protection R1 1 2 3 RA4/T0CKI circuitry as a high voltage blocking diode. RC2/CCP1 RC1/CCP2 OSC1/RA7 OSC2/RA6 If we run our LIN bus outside of an RC5 RC4 RC3 RB5 RB4 RB3 RB2 RA3 RA2 RA1 RA0 RA5 automotive environment with a trustworthy R2 1K

regulated power supply, D1 and D2 become 16 15 14 13 12 26 25 24 23 9 10 7 6 5 4 3 2 10K R3

optional components. According to the LIN ACTIVE MCP2021 datasheet, D1 and D2 are considered as optional components in the automotive .1uF environment, as well. However, the datasheet C1 20M Y1

also points out that good engineering practice R8 Hz C8 C9 .1uF dictates their inclusion in the node’s circuitry. C2 10K

For low voltage robotic applications, I concur 20pF 20pF with dropping D1 from the lineup. However, I advise keeping D2 no matter what. The LIN VBAT input feeds the MCP2021’s VBB pin, which is tied to the SERVO 06.2009 37 Eady - LIN - edited.qxd 5/6/2009 10:52 AM Page 38

input of the internal LDO (Low Drop-Out) voltage regulator. combination holds the LIN bus in a recessive state. Unlike the VBB input, the MCP2021’s internal voltage regulator The right-hand side of the LIN transceiver interfaces to doesn’t need any help from its friends. The MCP2021’s voltage the node’s host controller, which in this case happens to regulator is thermally protected and shuts itself down in be a PIC18F2620. The MCP2021’s LDO voltage regulator short-circuit and overload situations. Depending on the type output is presented at its VDD pin. Both variants of the of MCP2021 you specify, the internal voltage regulator’s MCP2021 require an external output bypass capacitor for output can supply +3.3V or +5.0V at 50 mA over the stability. Ceramic capacitors C5 and C6 serve this purpose. MCP2021’s entire operating temperature range (-40°C to The open-drain /FAULT/TXE pin doubles as the Fault +125°C). Our LIN node design uses the five volt version of Detect output and Transmitter Enable input. Faults include the MCP2021 (MCP2021-500). A 10 µF aluminum electrolytic a shorted-to-ground LIN bus and thermal shutdown. acts as the LDO voltage regulator input filter capacitor. Otherwise, driving the /FAULT/TXE pin logically high with If overall footprint is important in your LIN node design, the PIC18F2620 enables the MCP2021’s LIN transmitter. the 10 µF aluminum capacitor can be replaced with a smaller The CS/LWAKE pin may have a dual purpose, but it is 1.0 µF monolithic ceramic part. Just make sure that the input not a bidirectional pin. The CS portion of the pin’s function filter capacitor you select can withstand the voltages applied is Chip Select. CS must be logically high to activate the LIN at the VBAT pin. Extra noise filtering at the voltage regulator transmitter. If CS is logically low when power is applied to input is provided by C4, a 0.01 µF ceramic capacitor. Auxiliary VBB, the MCP2021 enters Ready mode, which is also power input J1 has been added to the LIN node design for defined as low power mode. In Ready mode, the MCP2021’s your convenience. Power receptacle J1 parallels the VBAT input receiver and voltage regulator are active while the transmitter to allow the easy connection of an alternate power source. is inactive. Conversely, if CS is logically high at VBB powerup, For instance, you can use J1 to power the node or cluster the MCP2021 enters Operation mode following the from a wall wart if there is no VBAT voltage source available. stabilization of the voltage regulator output. The transmitter, J2’s bidirectional LIN pin is an open collector driver that receiver, and voltage regulator are running in Operation is controlled by the voltage level applied to the MCP2021’s mode. LWAKE is short for local wake-up. The CS/LWAKE pin TXD pin. In receive mode, the signal level presented to the is internally pulled down allowing an external switch and LIN pin is reflected logically at the RXD pin. TVS diode D4 pullup resistor to trigger a wake-up manually. is an SAE-recommended part that is used in LIN nodes to The MCP2021’s TXD pin is internally pulled logically protect the node from EMI and ESD transient surge volt- high to the output of the internal voltage regulator. When ages. D4 breaks down at 27.0 volts. I didn’t see anything the transmitter is enabled, the LIN pin logically follows the in the datasheets and application notes that labeled the voltage level of the TXD pin. If the voltage regulator output MMBZ27VCLT1 as an optional component. So, I suggest voltage falls below 1.8 volts, the TXD pin is internally forced keeping D4 in the face of the MCP2021 at all times. high. There’s nothing fancy about the RXD pin. It is simply a Jumper JP1 is the master node jumper. When JP1 is CMOS output that follows the logic of the LIN pin when installed, switching diode D3 and resistor R4 form what is the receiver is operational. termed the master node termination which provides a As a master node, the PIC18F2620 will run both a strong pullup to the LIN bus recessive state (logical 1). master node and slave node task under the strict control When the master node jumper is absent, the MCP2021 of the 20 MHz clock. The only difference in a slave node internally terminates to the LIN pin with a 30K resistor. Only configuration is the absence of a jumper at JP1 and the one LIN node in a cluster can be deemed the master node. 20 MHz crystal. A slave node needs no crystal-controlled When all of the nodes in a cluster are sleeping, the cluster’s clock because the beginning of each LIN frame includes an master and slave node receivers are all listening to the autobaud chirp (binary 01010101) that the slave nodes pick LIN bus. When there is no bus activity, the D3/R4 pullup up and use to set their baud clocks. The maximum baud rate for a LIN cluster is 20 Kbps. The closest we can come to that with the PIC’s EUSART is 19200 bps. The ICSP programming/debugging portal is the same circuit you see in most all of my PIC18 designs. However, be careful what you use to program and debug this particular LIN node hardware. Recall that the MCP2021 voltage regulator is rated to safely supply 50 mA of current. As you can see in Figure 1, that eliminates the MPLAB ICD2 as a node-powered programmer/debugger. I had no problems programming the LIN node’s PIC18F2620 with an MPLAB ICD3 and MPLAB REAL ICE using power provided by the

PHOTO 2. The LIN protocol has many advantages. However, you can also use this board to transmit and receive standard RS-232 messages on a single-wire, half-duplex link.

38 SERVO 06.2009 Eady - LIN - edited.qxd 5/6/2009 10:52 AM Page 39

FIGURE 1. This table is designed to Feature PICKIT™ 2 PICKIT 3 MPLAB® ICD 2 MPLAB ICD 3 MPLAB REAL ICE™ help you decide which programmer/ USB Speed Full Only Full Only Full Only High and Full High and Full debugger device best suits your USB Driver HID HID Custom Custom Custom needs. For this LIN project, we’re USB powered Yes Yes Yes Yes Yes primarily interested in how much External power supply required No No Yes No No current load the programming/ Programmable VPP Yes Yes Limited; 10V Yes Yes debugging device will place on the Power to Target Yes Yes 5V only Yes No MCP2021’s voltage regulator. Programmable VDD Yes Yes No Yes Yes VDD drain from target 20 ma 20 ma 100 ma <1 ma <1 ma MCP2021’s voltage regulator. I also Over voltage/current Protection Yes, SW Yes, SW Yes, HW Yes, HW Yes, HW Emulation Support Full Speed Full Speed Full Speed Full Speed Full Speed tied an MPLAB ICD2 to the node’s Breakpoints Simple Simple Simple Complex Complex ICSP portal. I set up the ICD2 to Software Breakpoints No No No Yes Yes provide power to the LIN node via Program Image 128K bytes 512K bytes No No No its wall wart instead of powering Serialized USB No Yes No Yes Yes itself from the MCP2021’s voltage Trace – Native No No No No Yes regulator. Everything worked as Trace – Other (SPI, PORT, Inst) No No No No Yes Data Capture No No No No Yes designed. The PICkit2 is the easiest Logic/Probe Triggers No No No No Yes programmer/debugger to use as it High Speed PAK (LVDS) No No No No Yes simply plugs into the ICSP portal and provides power to the LIN node via its USB connection. configuration (MMBZ27VAL-7-F), as well as the desired Although I don’t have a PICkit3 on the bench, I’m sure it common cathode configuration (MMBZ27VCLT1). will behave similarly to the PICkit2. If you add electronics There are a multitude of S1G and 1N4004 packages. I to the original LIN design, be sure to include any additional hate it when I get the correct part in the incorrect package. circuitry current drain into your load calculations when using So, to keep you from having to guess about D2, our printed the PICkit2 and PICkit3 as they draw 20 mA on their own. circuit board (PCB) wants to see a Fairchild S1G_Q, which is Mouser part number 512-S1G_Q. Gathering Parts For The I selected the working voltage for capacitor C3 based LIN Development Board on the fact that I would probably power my LIN nodes with nine volt wall warts and some of you may power your nodes The LIN rules with regard to data movement are much from +12 volts. So, I went with a 25 volt Panasonic aluminum more complicated than the hardware. Everything you need for electrolytic (Digi-Key part number PCE4193CT-ND). The official your own LIN Development Board can be obtained from Digi-Key Panasonic part number is EEE-HA1E100R. The 1.0 µF, 16 V or Mouser. For instance, J1 — the 2.1 mm power jack — is a ceramic voltage regulator output bypass capacitor (C5) can CUI, Inc., part with a Digi-Key part number of CP-202A-ND. be had from Mouser (part number 80-C0805C105M4R). Keeping connector and terminal footprints on 0.1 inch I prefer ECS, Inc., crystals and used a 20 MHz CSM-7 centers allows you to use the same interconnect parts in your part in the LIN hardware design. You can get the same crystal node expansion circuitry. J2 is a three-position Phoenix contact I used from Digi-Key (part number XC581CT-ND). The 20 pF screw terminal block with pins that are equally spaced 0.2 capacitors that support Y1 are 0805 C0G (NP0) ceramics. inches (5.08 mm) apart. The bread- All of the resistors and capacitors in board area consists of holes on 0.1 the design are 0805 SMT devices, which inch centers. Thus, you can use the can easily be handled and soldered Phoenix contact terminal block in the with a fine-tipped soldering iron. The LIN Development Board breadboard area. resistors are all 1% tolerance types while The screw terminal block is available the 0.1 µF and 0.01 µF capacitors are from both Digi-Key and Mouser. I general-purpose X7R types with 20% happen to have obtained my Phoenix tolerances. The LEDS are 1206 SMT terminal blocks from Digi-Key by devices. I’ll leave the choice of LED specifying part number 277-1248-ND. manufacturer and LED colors to you. In the early stage of pulling Both the PIC18F2620 and together components for the LIN MCP2021 have SOIC footprints. SOIC Development Board, I made the mistake of ordering standard zener PHOTO 3. When it comes to showing diodes instead of TVS diodes for D1 you waveforms on the printed page, and D4. So, be sure to procure the Saleae’s logic analyzer is just as good as an expensive digital storage scope. The diode part numbers I have specified analyzer will also capture and interpret for you in Schematic 1. Be especially I2C, SPI, Serial, and 1-Wire protocols. If you careful with D4, as you can get don’t have one of these, get one. You’ll this part in a common anode wonder how you got along without it. SERVO 06.2009 39 Eady - LIN - edited.qxd 5/6/2009 11:41 AM Page 40

SCREENSHOT 1. The Break signal has a width of 0.677 milliseconds which equates to a Start bit and 12 zero bits at 19200 baud. All we had to do to generate the Break signal was set a bit and send a dummy character.

by 12 zero bits and a Stop bit. The Sync character is actually a byte with the value of 0x55 that follows the Break sequence. In a regulation LIN frame, the Break-Sync signal is followed by a protected identifier byte and what is termed the response — which is one to eight bytes of data. The LIN frame is topped off with a checksum byte. There components are large enough to be easily mounted and are two types of checksums. The enhanced checksum soldered by hand without the need for specialized soldering includes the protected identifier in the checksum calculation equipment. The PCB silk screen legends give a visual cue to while the classic checksum only covers the data. Right now, the orientation of the MCP2021 and PIC18F2620. we’re only interested in synthesizing the Break and Sync signals. You really can’t miss with D4. However, to make the So, let’s put some simple code together to do just that. assembly process as straightforward as possible, the diode It doesn’t take much to coax a Break-Sync signal out of the component enumerators (D1, D2, D3, D4, LED1, LIN) are all PIC18F2620’s EUSART. Here’s the code I used to generate the placed near the cathode pad of the respective device. The only waveform captured by my logic analyzer in Screenshot 1: polarized capacitor is C3 and if you match the capacitor’s base SENDB = 1; //set the SEND BREAK bit plate with the PCB silk screen, mounting C3 is a no-brainer. sendchar(0x55); //send dummy character Once you’ve pulled all of the electronic components sendchar(0x55); //send autobaud chirp together on your bench, carefully mount and solder them to the PCB. When the solder smoke clears, you will have assembled Setting the SENDB bit forces the PIC’s EUSART to send a LIN Development Board like the one you see in Photo 2. the LIN Break signal. The 0x55 that is sent after setting the SENDB bit is ignored and 0x00 is sent instead. The second 0x55 Let’s See If It Works is actually transmitted. The slave node sees the Break signal and prepares to receive and time the bit widths of the 0x55 byte. The best place to start our functional testing is at the The next byte a LIN slave expects to see is the protected beginning of a LIN frame. A Break-Sync sequence is sent identifier. For this example, we’ll use the 0x3E identifier which with every LIN frame. A standard RS-232 sniffer won’t like indicates that a LIN user-defined message is in the incoming the way the Break-Sync sequence looks. So, a logic analyzer frame. We must add a checksum to the two most significant would work well for us here. Photo 3 is a bird’s eye view bits of the identifier. That will result in us actually sending of the Saleae logic analyzer I’m going to use to capture a 0xFE as our identifier byte. The Break-Sync sequence and Break-Sync sequence in real time. the protected identifier make up the LIN frame header. The PIC18F2620’ EUSART subsystem is designed to emit Let’s set the EUSART baud rate for 9600 bps and a LIN Break-Sync signal which consists of a Start bit followed send four bytes of data (0x4A, 0x55, 0x93, 0xE5) behind a protected identifier of 0x3E. I’ve put together a function to PHOTO 4. This is a must-have tool if you’re going to develop LIN do all of the work: applications. I got this one from Microchip DIRECT. If you want to build one of these from scratch, you can get the full schematic and firmware driver from a download on the Microchip website. //make8 macro #define make8(var,offset) \ ((unsigned int)var >> (offset * 8)) & 0x00FF

//protected ID bit fields typedef struct { char id0: 1; char id1: 1; char id2: 1; char id3: 1; char id4: 1; char id5: 1; char p0: 1; char p1: 1; }IIDBITS;

IIDBITS id_bits;

void send_frame4(char id, char data1, char data2, char data3, char data4) 40 SERVO 06.2009 Eady - LIN - edited.qxd 5/6/2009 11:40 AM Page 41

Microchip — www.microchip.com LIN Serial Analyzer; HI-TECH PICC-18 PRO; MCP2021; PIC18F2620; REAL ICE; MPLAB 8.30 Sources Saleae LLC — www.saleae.com Logic Analyzer ExpressPCB — www.expresspcb.com LIN Node Printed Circuit Board The firmware was compiled with HI-TECH PICC-18 PRO.

{ //CALCULATE PROTECTED ID CHECKSUM id_bits.id0 = id & 0b00000001; id_bits.id1 = (id & 0b00000010) >> 1; id_bits.id2 = (id & 0b00000100) >> 2; id_bits.id3 = (id & 0b00001000) >> 3; id_bits.id4 = (id & 0b00010000) >> 4; id_bits.id5 = (id & 0b00100000) >> 5; id_bits.p0 = id_bits.id0 ^ id_bits.id1 ^ id_bits.id2 ^ id_bits.id4; id_bits.p1 = ~(id_bits.id1 ^ id_bits.id3 ^ id_bits.id4 ^ id_bits.id5); if(id_bits.p1) id = id + 0b10000000; SCREENSHOT 2. The enhanced checksum value includes the if(id_bits.p0) protected identifier in the checksum calculation. The classic id = id + 0b01000000; checksum value only covers the response (data) fields. The Microchip LIN Serial Analyzer app runs on a PC and does all of //CALCULATE FRAME CHECKSUM the calculations to figure out which checksum was used. The //checksum = 0; //classic checksum LIN Serial Analyzer app allows us to see the checksum-stuffed checksum = id; //enhanced checksum protected identifier, the data, the frame checksum, and baud checksum = checksum + data1; rate in the analyzer window. checksum = (checksum + make8(checksum,1)) & 0x00FF; checksum += data2; calculates the frame checksum accordingly. With all of checksum = (checksum + the checksums calculated, we can put the MCP2021 into make8(checksum,1)) & 0x00FF; transmit mode and send the frame along its way. checksum += data3; checksum = (checksum + I used the Microchip LIN Serial Analyzer you see in Photo 4 make8(checksum,1)) & 0x00FF; to capture the traffic you see in Screenshot 2. The human- checksum += data4; readable information in the LIN analyzer window is captured checksum = (checksum + make8(checksum,1)) & 0x00FF; in its digital form by the logic analyzer in Screenshot 3. checksum = ~checksum & 0x00FF;

LIN_TX; //place MCP2201 in Tx mode We’re Almost There SENDB = 1; //set SEND BREAK bit sendchar(0x55); //send dummy We’ve proven our LIN node hardware and put together sendchar(0x55); //send chirp some code to calculate checksums and send LIN frames. //SEND FRAME We still need to write some LIN receiver code and assemble sendchar(id); the master and slave firmware tasks. sendchar(data1); sendchar(data2); In the meantime, I’ll post the code we have up to this point sendchar(data3); on the SERVO Magazine website (www.servomagazine.com) sendchar(data4); for you. I’ll also post the ExpressPCB LIN node PCB file. Next sendchar(checksum); mdelay1(100); time, we’ll expose more of the LIN 2.0 specification and put } its standards to work in a robotic way. SV Fred Eady can be reached via email at [email protected] The first thing the send_frame4 function does is break down the protected identifier into bits. ID checksum bits p0 and p1 are then calculated and inserted into the most significant bits of the protected identifier. I chose to use the enhanced checksum in this frame and the function

SCREENSHOT 3. This is a logic analyzer capture of the frame we are transmitting in Screenshot 2. You can easily pick out the 9600 baud Break-Sync sequence. The protected identifier (0xFE) which follows the autobaud chirp (0x55) is also easy to see in this capture. It takes just a bit over 9 mS to send this frame.

SERVO 06.2009 41 Verhage - CheapBot.qxd 5/4/2009 11:42 AM Page 42 The CheapBot-14 Robot Controller

By L. PAUL VERHAGE

A simple line-following robot that incorporates the CheapBot-14 controller. A robot like this costs about $65 and is expandable for more complex tasks

42 SERVO 06.2009 Verhage - CheapBot.qxd 5/4/2009 11:43 AM Page 43

My PhD work is focused on included in the design of the CheapBot, so there’s teaching STEM, that is, science, very little chance the wires will break off with normal use. technology, engineering, and mathematics. What better way to Theory of Operation teach STEM than a microcontroller- Even if a microcontroller can sense the world, based project like a robot. One it can’t react until it has a way to control the motions of the robot. The CheapBot-14’s PICAXE of the problems schools face, microcontroller sends two signals to each of its two however, is the cost involved H-bridges to control the rotation of the robot’s two motors. I really like the Toshiba motor drivers; they teaching technology curricula. were introduced to me by the good folks at Surplus My first attempt (and certainly not Gizmos. Go to their website and download the datasheet for this motor driver (http://surplus my last since I have a bunch more gizmos.com/datasheets/TA8080K_datasheet.pdf). ideas) to address this issue is the Up to one amp of current can be controlled with the TA8080K. inexpensive robot controller I’ll Controlling the rotation of the motor lets the describe in this article. robot travel forward and backward, turn left and right, and stop. The two controlling signals to an H-bridge are either +5V (a logic 1) or ground (a logic 0). A signal of 0 and 0 causes the TA8080K’s to stop The CheapBot-14 Controller motor rotation and the motors to wind down. When the signals to an H-Bridge are 1 and 1, the H-bridge The CheapBot-14 is a flexible robot controller stops its motor from rotating by applying the brakes. that doesn’t limit you to a single robot design. It’s When the signals are 0 and 1, the motor rotates one fully programmable, has inputs and outputs, and can way and when the signals are reversed to 1 and 0, operate two independent motors. One big reason the the motor rotates in the opposite direction. If both CheapBot-14 is so affordable is at its heart is the motors are commanded to rotate in the same PICAXE-14M microcontroller. The second reason is its direction, the robot travels straight (either forward motor controllers: Toshiba TA8080Ks. or backward), and if the motors are set to spin in The CheapBot-14 has six outputs or six ways a opposite directions, the robot turns (either clockwise robot can react to the world around it. The first or counter-clockwise) in one place. four of the outputs are to the CheapBot’s two motor The H-bridges each have their own 10 µF controllers. The remaining two are its output ports: capacitor to maintain a more constant motor voltage. Output 0 and Output 1. Both outputs have three pins They’re needed because when the motors spin, they each: ground, +5 volts, and a connection to the can generate electrical noise. To prevent the noise PICAXE-14M. The outputs are receptacles that accept from interfering with the operation of the TA8080Ks, three pin headers with 1/10th inch spacing. The the capacitors act as tiny batteries to push up the receptacle/header combination is easy to work with voltage when it sags and (like discharged batteries) and is inexpensive. to absorb extra current when the voltage spikes. There are five inputs on the CheapBot-14. The LEDs in the CheapBot-14 are power Again, that represents five ways the environment indicators and each has its own current-limiting 330 can influence the robot. The inputs — called Input 0 ohm resistor. The only function of these LEDs is to through Input 4 — are also built like the two output light up when the power switches for the motor and ports. Since they are constructed this way, it’s easy to logic are turned on. interface sensors to the CheapBot-14 robot controller. The 22K ohm resistor next to the program Motor and logic power are separate from each header limits the current flowing into the PICAXE-14 other in order to prevent motor noise and current while it’s being programmed by the PC. The 10K draw from affecting the PICAXE. This also allows resistor next to the programming header is a different voltage levels to operate the logic and the pull-down resistor that ensures the PICAXE sees zero motors (I use six volts for each, but the motors could volts when the PC is not sending a signal to it. run up to 16 volts). Logic and motor power, LED The LM2940 voltage regulator takes the power indicators, and the switches to control them gradually decreasing voltage from the logic battery are attached to the controller through cables, pack and drops it to the constant five volts that the allowing them to be mounted to the robot in a PICAXE prefers. The regulator is low drop-out, so it convenient location. Strain relief for each wire is can continue to function SERVO 06.2009 43 Verhage - CheapBot.qxd 5/4/2009 11:43 AM Page 44

Assembly Directions

It’s generally easier to solder components to a PCB if the lowest lying components are soldered first. This means you begin assembling the CheapBot-14 by soldering the jumper wires and resistors first. The suggested soldering order is indicated in the list below. (Note the CheapBot-14 used polarized components that must be inserted with the proper orientation.)

An illustration of the proper layout of components for the CheapBot-14. The PCB pattern for this project is available on the SERVO website at www.servomagazine.com. Battery pack – The red lead of the battery packs solder to the red wire in the top silk diagram. Capacitors – Align the + mark on the capacitor with the + on the top of the silk diagram. PICAXE-14 socket – Align the socket’s notch with the notch on the bottom. H-bridges – Align pin 1 with 1 printed on the top silk diagram (this puts the heatsink of the H-bridges towards the bottom side of the PCB). LEDs – The cathode or lead on the shaved side of the LED body solders to the black wire in the top silk diagram.

The schematic for the CheapBot-14 controller. The two items responsible for keeping its cost so low are the PICAXE-14M and TA8080K motor drivers.

44 SERVO 06.2009 Verhage - CheapBot.qxd 5/4/2009 11:44 AM Page 45

until the battery voltage drops to around 5.3 volts. The 22 arrangement of pins since it’s used with servos. µF capacitor next to the voltage regulator acts as a momen- tary battery. It helps the voltage regulator maintain a more Using the CheapBot-14 constant voltage by discharging when the robot controller requires more power and charging when the voltage level After testing, the next step is to mount your climbs. The two two-pin headers are connection points for CheapBot-14 to a robot body. In my opinion, the best the robot’s motors. The three-pin header is the program- material for a robot body is 1/8 inch thick Syntra, or ming jack for the PICAXE-14. One of the pins is the ground foamed PVC. The material is rigid for small robots and connection and marked with the letter G. easy to work with. There are four holes near the corners Close to the edge of the PCB (printed circuit board) of the PCB to mount the controller to the robot body. Use are two input and output receptacles. These are where #2-56 hardware and stand-offs, or replace the stand-offs external circuits are plugged into the robot controller. The with a layer of Foamies (foamed neoprene). Be careful not receptacles are laid out in three columns. The column to over-tighten the mounting bolts when using Foamies. closest to the PCB’s edge is the ground column. Any pin Since the material compresses quite easily, the PCB gets plugged into this column is connected to ground, or 0 volts. bent when the bolts are over-tightened. It’s best to use The middle column is +5 volts, so any pin plugged into the nylon insert locking nuts when bolting the robot controller middle column connects to +5 volts. The inner column is to a layer of Foamies. the individual connections to the I/O pins of the PICAXE-14. To keep the robot’s footprint small, stack a second The pins they connect to are listed in the top silk Syntra layer above the first using four bolts, nuts, and diagram included here. You’re probably familiar with this spacers. On the top layer, mount the battery holders, toggle

Step by Step Soldering List • Repeat for the other three leads and wires. • Three jumper wires (use cut resistor leads). • Slide heat shrink over the soldered connections and • 330 ohm resistor (orange, orange, brown, gold) apply heat to shrink. • 330 ohm resistor (orange, orange, brown, gold) • From the bottom of the PCB, insert the bare end of • 10,000 ohm resistor (brown, black, red, gold) a wire through a large pad (strain relief pad), • 22,000 ohm resistor (red, red, orange, gold) bend it over, and insert it into the neighboring • Two-pin right angle header smaller pad shown in the photo. • Two-pin right angle header • Solder the wire ends and clip any excess length. • 14 pin DIP socket * Verify Polarity * • Repeat five more times to solder the two battery • 10 microfarad capacitor * Verify Polarity * backs, two LED indictors, and two toggle • 10 microfarad capacitor * Verify Polarity * switches to the PCB. • 22 microfarad capacitor * Verify Polarity * A strain relief wire ready for soldering. • Three-pin straight header • LM2940 * Verify Polarity * • TA8080K H-bridge * Verify Polarity * • TA8080K H-bridge * Verify Polarity * • 5 by 3 receptacle • 2 by 3 receptacle

Cabled Components The last six components — the battery holders, the power switches, and the indicator LEDs — are soldered to the PCB through wires. This allows them to be placed somewhere convenient on the robot. The battery packs are ready to solder to the PCB, however, the switch and LED cables must be prepared as follows:

• Strip one end of all four wires back by 1/2 inches. If you would prefer a complete CheapBot-14 kit instead of rolling • Twist the ends tightly and tin. your own, check out my website under the Catalog link. I’m selling the complete controller kit for $26.50 plus $6 shipping. Directions — written • Cut the leads of the LED to half their length. for first-time roboticists — are available as a free download along • Tin the leads of the LEDs and the toggle switches. with sample code. You can also find a line-follower kit at my website. • Place a tinned wire against a tinned lead. Over time, I’ll add ideas for other sensors you can use with this robot • Heat with a soldering iron until the solder on the controller. I now have a Twitter account and occasionally send tweets. If you'd like to stay up to date with some of my activities, then wire and lead fuse. follow NearSys.

SERVO 06.2009 45 Verhage - CheapBot.qxd 5/4/2009 11:44 AM Page 46

switches, and indicator LEDs. This places the switches and (The wheels are SKU# SW and cost $4 a pair.) They come batteries on top where they can be accessed more easily. in several colors and will add some pizzazz to your bot. The Use #4-40 flat head bolts to attach the battery holders. The other option is to use plastic peanut butter lids. To give the LEDs and toggle switches are bolted through holes drilled robot some traction, wrap a #84 rubber band around the in the top Syntra layer. A good design places the proper rim of the peanut butter lid wheels. Now, load batteries LED indicator next to the toggle switch that turns it on. into the robot and it’s ready to drive. The commands to The motors and drag wheel are mounted on the drive the robot look like this: bottom of the robot. The best motors for the CheapBot LOW 2 LOW 4 are gearhead motors in a clear servo case (SKU# GM4) HIGH 3 HIGH 5 from HVW Technologies www.hvwtech.com/products_ view.asp?ProductID=58 . (The motors are servos with To make the robot turn or reverse, just change the gearhead trains and motors, but no controlling electronics.). pattern of highs and lows. Just remember that pins 2 and 3 They have plenty of torque and mount just like servos. control one motor and pins 4 and 5 control the other. Cost is $11.95 each (you’ll need two). To stop the robot, use this code: I found the easiest way to mount the two motors to LOW 2 LOW 4 the robot is with two parallel basswood strips. Use two 1/2 LOW 3 LOW 5 inch basswood strips cut to 5-7/8 inches long and bolted to the bottom of the robot. Make the spacing between them You can apply braking to the motors by setting all four equal to the width of the servo case (which is 40.6 mm, or PICAXE pins high. nearly 1.6 inches). Now, the servo motors can be mounted between the rails with the screws included in their package. Wrap-Up The third wheel is a dragger and it’s a cheap plastic pull knob. The pull knob’s original mounting bolt must be I designed the CheapBot-14 robot as an inexpensive replaced since it is too short for the robot. Hardware stores way for 4-H and scout troops to start a robotics project. So sell a replacement sheet metal screw two inches long of far, the 4-H in Lawrence, KS is having a great time with it. the proper diameter. You’ll need a spacer to fill the gap I’ll put updates on my website about their adventures and between the base of the pull knob and the bottom of the the research I hope to accomplish with this robot controller robot base. A styrene plastic tube from a hobby store works combo. Check it out at nearsys.com. well for this and for the spacers between the two layers of That’s it, until I describe the CheapBot-18 and the the robot body. The servo motors connect to Cheapbot-14 Moon Rover I’ve designed around it. So, stay tuned! SV through the right angle headers on the back. Crimp a pin on the end of each servo motor wire and push the two of Parts List them into a plastic housing. The servo motors can now be CheapBot-14 PCB * plugged into the controller. This still leaves the wheels to be Two 4-AAA battery packs completed. Here are two options. First, HVW Technology PICAXE-14M sells a 2-5/8” diameter wheel designed for servo motors. 14-pin IC socket Two Toshiba TA8080K H-bridges ** Two LEDs (use two different colors) Test Procedures Two 330 ohm resistors (can be up to 1K ohm in value) Before inserting the PICAXE-14 and flipping the switch, 10K ohm resistor verify the circuit has been properly assembled using the 22K ohm resistor following checklist: Three-pin straight header Two two-pin right angle headers • Inspect the bottom of the PCB for solder that has Two 10 microfarad capacitors overflowed its pads to other pads and traces. 22 microfarad capacitor • Turn on the switch and verify there is no continuity between LM2940 low-dropout voltage regulator the positive and negative terminals in the battery packs. 5 by 3 receptacle *** • Insert AAA cells into the battery packs and flip the switches; 2 by 3 receptacle *** the LEDs should light. Two subminiature toggle switches • Measure voltage across the IC sockets pins 1 (+5V) and #24 AWG stranded wire (two feet will be sufficient) 14 (Ground). Thin heat shrink tubing (to cover leads on toggle switches) • Shut off power and insert the PICAXE-14 (align the notch of the chip with the notch in the socket). * Shoot your own board from the copper pattern available on • Connect a programming cable to the programming header the SERVO website. and start the PICAXE program Editor. ** The best place to order these H-bridges is Surplus Gizmos • Set the Editor to PICAXE-14 and proper Comm Port. (www.surplusgizmos.com) • Type and download the following one line program: *** Purchase a 3 by 38 receptacle and cut pieces two and five DEBUG pins long. Finding this size of receptacle can be a hit or miss • The Debug terminal will pop up and you should get a single affair, so if you can't locate one use a combination of one and reply with all variables being zero. two pin wide receptacles. 46 SERVO 06.2009 Blankenship - Virtual Lab.qxd 5/1/2009 3:56 PM Page 47

A VIRTUAL SIMULATION LABORATORY (Simulating Mechanical Systems)

by John Blankenship and Samuel Mishal The simulation techniques discussed in this article can move the laboratory environment into the classroom where students can immediately see the relevance of the material being presented. Distance learning curricula can be enhanced immensely because even students without access to a laboratory can be given assignments to develop algorithms for interesting applications. Hobbyists can experiment with a wide variety of situations without the frustrations and expenses associated with constructing physical models.

he last time I taught a college-level microprocessor lab, the students were struggling with a motor-control project — but the struggles had more to do with time limitations than they did with electronics or programming. In order to make the assignment more exciting and relevant, each group of students had to construct a miniature elevator Tshaft that spanned three floors. They had to interface a motor, six floor-call buttons, and three elevator buttons to a computer or microcontroller, and create a program to make the model respond like a real elevator. They could use any type of motor to move the elevator, but most groups chose a stepper or DC gearhead motor. If they chose a stepper motor, they had to provide some sort of limit switch to allow the motor to be automatically moved to a known starting position. The limit switch also had to be monitored to detect (and correct) any slippage that accumulated during the motor’s movement. If they chose a DC motor, they had to provide some form of feedback to know when the elevator reached each floor. The feedback could take many forms including mechanical switches, infrared beams, or even Hall-effect detectors. As you can see, a project of this nature has many characteristics that make it suitable for teaching control-oriented programming. Unfortunately, many students in this situation spend the majority of their time on the construction aspects of the project. Remember, students often don’t have a workshop available to them so getting the elevator to move properly without jamming can be more difficult than you might imagine. Getting the elevator to reliably trigger appropriate floor detectors can be even harder. There are situations (senior-level projects, for example) where it can be a tremendous learning experience for students to get personally involved with the SERVO 06.2009 47 Blankenship - Virtual Lab.qxd 5/1/2009 3:56 PM Page 48

functions, and many other features make it easy for even a mid-level programmer to develop professional looking simulations. Let’s examine one option for simulating an elevator project controlled by a stepper motor. The output from the program is shown in Figure 1. Notice that an actual picture of a stepper motor has been integrated into the SIMULATION graphic display. A 3D pointer allows the still image to move in a realistic manner and seemingly control a 2D elevator (the motor drives a spool that winds and unwinds a cable attached to the elevator). You can control the simulated stepper motor by sending it binary codes (1000, 0100, 0010, and 0001) in the proper sequence through an interface subroutine. The floor and elevator buttons, along with the limit switch at the bottom of the shaft, allow a complete elevator algorithm to be developed without any physical construction. Programming the system is surprisingly realistic because the programmer is forced to control the simulated motor in Figure 1: An image of a real the same manner as a real motor. Standard stepper motor adds realism stepping was used in this example program to the elevator simulation. but it could easily be modified to handle half- stepping or full-torque drive. physical construction of a mechanical system. In most cases, Once you accept the idea of creating simulations for a though, students would learn much more if they could virtual laboratory, the options are endless. Figure 2 shows forego construction and concentrate their efforts on a simulation of a DC motor suitable for teaching the learning to control the motor, interrogating the sensors, and fundamentals of speed control. The motor reacts as developing an appropriate system-level algorithm. expected when the associated mass and friction parameters One possible solution is to give each student a pre-built are changed. The programmer controls the motor by system so they can begin experimentation immediately. specifying the duty cycle to be applied just as they would As you might expect, though, constructing, maintaining, with a real world motor controller. and storing the necessary equipment usually prevents this Figure 3 shows another possibility. Two pointers are from happening. attached to two potentiometers which — in the simulation It was this type of educational problem that originally — are attached to eight-bit A/D converters. A DC gearhead inspired the robot simulator in RobotBASIC. The simulator motor (controlled by direction and duty cycle parameters) allows programmers to concentrate on algorithm drives the rear potentiometer. The front potentiometer development instead of physical construction. Fortunately, pointer can be moved with the mouse. RobotBASIC’s simulation capabilities extend well beyond In the demo program, the motor is simply turned on robotic applications. Double-buffered video output (for at a low speed with the proper direction. It is immediately flicker-free animation), bitmap manipulation, an easy-to-use obvious to the student or programmer that the motor is not 3D graphics engine, matrix math, extensive mathematical moving fast enough to keep up with the manually moved pointer. If the program Figure 2: The ability to alter is changed to increase the mass and friction of the the speed, they see pulley makes developing an that the motor does, algorithm for speed control in fact, move quicker more relevant. but the increased speed causes it to regularly overshoot its destination. In only a few minutes, the need for a more sophisticated control algorithm becomes apparent, thus 48 SERVO 06.2009 Blankenship - Virtual Lab.qxd 5/1/2009 3:57 PM Page 49

creating enthusiasm for a lecture on proportional or PID control.

The primary image in Figure 3 is a picture SIMULATION of a motor assembly actually used by a college student in a microprocessor lab. RobotBASIC’s ability to resize, rotate, and position photos of actual motors made it easy to create these realistic demonstrations. When you use the program, the animated pointers quickly feel Figure 3: A DC motor and two like they are part of the picture. The top of potentiometers provide a platform for studying the screen graphically displays the positions positional control of both pointers over time (simulating an algorithms. oscilloscope), making it easy to see how well the motor tracks the manual pointer. Figure 4 shows a simulated hobby servo that can be controlled by sending it the pulse width (in microseconds) of a periodic signal. The servo’s 3D actuator moves a plate that moves two eyes. Learning how to move a robot’s eyes can be far more motivational than just moving a stand-alone motor — especially if you don’t have to spend a week constructing a model before you can It’s hard to imagine how realistic these simulations can be without seeing them in action. If you select the even start programming. EDUCATION tab at www.RobotBASIC.com, the section RobotBASIC has commands that allow vision algorithms on Distance Learning provides a link to a video that to be implemented using a standard webcam (see our demonstrates each of the simulations we’ve discussed. previous article on vision in the April ‘09 issue of SERVO). There is also a link to a zip file containing all the programs Imagine developing a program that allows the eyes in (and the required image files), so you can try your hand Figure 4 to track objects moving in front of your webcam- at programming solutions to these problems (don’t forget equipped laptop’s screen. to download your free copy of RobotBASIC). Commented Using these techniques, a lecturing professor can easily source code has been provided for all the programs move the laboratory environment into the classroom where to encourage interested readers to create their own simulations. students can immediately see the relevance of the material The virtual environments described in this article are being presented. Distance learning curricula can be aimed at mid-level students and hobbyists, but more enhanced immensely because even students without access complex, high-level simulations are also possible. The to a laboratory can be given assignments to develop Distance Learning reference above also provides a link to algorithms for interesting applications. numerous videos showcasing various aspects of Hobbyists can experiment with a wide variety of RobotBASIC. One video entitled RobotBASIC Control situations without the frustrations and expenses associated Application shows how quadrature-encoded position with constructing physical models (not to mention replacing data was used to implement heading control of both a parts that are often damaged or destroyed during the simulation and an actual model of a satellite in a friction free environment. Source code for this demo is also learning phase of many projects involving hardware available on the RobotBASIC web page. interfacing). SV

RobotBASIC is a general-purpose Figure 4: These simulated servo-controlled eyes can programming language with an be programmed to follow objects moving in front integrated robot simulator. The of the screen on any webcam equipped PC. language has many features that make it easy to develop professional looking simulations. These include double-buffered video output (for flicker-free animation), the ability to resize, rotate, and position pictures of actual hardware, an easy-to-use 3D graphics engine, matrix math, and extensive mathematical functions. The new Version 4.0 of the program is available for free from www.RobotBASIC.com. SERVO 06.2009 49 Iovine - Bi-directional flex sensorsc.qxd 5/4/2009 12:30 PM Page 50

How to Make Bi-Directional FLEX SENSORS

by John Iovine

Flex sensors are passive resistive devices that can be used to detect bending or flexing. Constructing commerical devices is not difficult, but does involve the use of specialty resistive and conductive inks, silk screens to apply the inks, and specific heats to cure the inks — a little too much manufacturing for most hobbyists. However, all is not lost, because there are simpler sensors you can build. The flex sensor I will show you how to build here is a bi-directional flex sensor that decreases its resistance in proportion to the amount it is bent.

Applications sensors we will be making are also •Resistive material 5/16” x 5” pressure sensitive so they can be used (see text). The sensor we are building is as either bumper switches for wall about 3/8” wide by 5” long. You can detection or pressure switches on Copper foil laminate is used in the easily make a sensor wider and longer robotic grippers. electronics industry to make flexible depending upon your application. For bio-metrics, the flex sensor circuits. It is thin copper cladding on a Flex sensors can be used in can be placed on a moving joint of plastic material substrate like acetate. robotics to determine joint movement athletic equipment, for example, to The material we are using is single- or placement. They can be utilized provide an electrical indication of sided copper: copper on one side and as whiskers for wall detection. The movement or placement. A few of the the substrate (plastic) on the other. sensors could be incorporated onto a glove for a virtual reality application. Components The materials needed for construction of the bi-directional flex sensor are shown in Figure 1. Remember, the size of the materials listed here is only a guideline to the sensor we are constructing in this article. These types of sensors can be manufactured to larger widths and lengths. •Copper foil laminate 1/4” x 4.5” (see text). •Acetate 1/4” x 4.5” x .010 thick. FIGURE 1. Flex sensor components. •Heat shrink tubing 3/8” FIGURE 2. Overview of flex sensor dia x 5”. construction. 50 SERVO 06.2009 Iovine - Bi-directional flex sensorsc.qxd 5/4/2009 12:31 PM Page 51

How to Make Bi-DDirectional FLEX SENSORS

FIGURE 3 Soldering wire on FIGURE 4. Resistive copper clad material layered FIGURE 5. Copper clad laminates. on copper clad laminate layered on laminate. resistive material.

FIGURE 8. Base FIGURE 6. FIGURE 7. of materials Acetate Sandwiched before being added to materials inserted into sandwich of inserted into heat shrink materials. heat shrink tubing. tubing.

Making the Bi-Directional Flex Sensor

The resistive material is sandwiched between the two copper clad laminates. The copper sides of the laminates are both facing toward the resistive material; see Figures 3, 4, and 5. If you solder the wires on the same side of the laminates, when you FIGURE 9. assemble the sensor the wires will be positioned on opposite corners, allowing Adding clear the base of the sensor to lay flatter. silicon sealer to ends of To this sandwich, we add the acetate strip, as shown in Figure 6. the flex The purpose of the acetate strip is to make the sensor more resilient and able sensor. to spring back after it has been flexed. This entire sandwich is inserted into the heat shrink tubing (Figure 7). The base of the sandwiched materials is shown in Figure 8, just before it is inserted completely into the heat shrink tubing. We are almost finished. At each end of the heat shrink tubing, place a small amount of clear silicon sealer, (Figure 9). Allow the sealer to dry according to its directions, usually around 24 hours.

The copper cladding material is with scissors. easier to solder the wire to the strip if divided into two pieces 1/4” wide Solder about 6” of wire to one you tin the bottom 3/8” of each strip. x 4.5” long strips and is easily cut end of each strip. You may find it Solder each wire to one corner side of the strip. It doesn’t matter which side Most materials are easily obtained from electronic sources. you choose, just make sure you solder Images Inc., can supply the following materials to get you started: Parts List both strips on the same side. Take a look at Figure 2 to get a quick Available from Single-sided 6” x 2” laminated Images Scientific Instruments, Inc. overview of flex sensor construction. copper; $2.50 109 Woods of Arden Road 5” x 4” resistive material; $2.50 Staten Island, NY 10312 4” x 5.5” .010 acetate; $1 718-966-3694 Tel. Resistive Materials 3/8” heat shrink tubing (one foot); $1 www.imagesco.com/sensors/ flex-sensor.html There are a variety of resistive materials available: cloth, plastic, and SERVO 06.2009 51 Iovine - Bi-directional flex sensorsc.qxd 5/4/2009 12:32 PM Page 52

How to Make Bi-DDirectional FLEX SENSORS

Testing the Bi-Directional Flex Sensor Set a VOM meter to read ohms. The sensor we’ve built has a nominal resistance of approximately 20K ohms, (Figure 10). As the sensor is bent in one direction, the resistance decreases in proportion to the bend to approximately 2K. Take a look at Figure 11. Bending the sensor in the opposite direction also decreases the resistance in proportion to the bend to 2K ohm as in Figure 12. Since the sensor is pressure and force sensitive, pressing down on the sensor will decrease its resistance.

FIGURE 10. Checking FIGURE 12. nominal FIGURE 11. Bending in resistance of Bending in opposite bi-directional first direction direction flex sensor (2K ohms). (2K ohms). (20K ohm).

paper. The common element of all bags. In the electrical industry, these Flexing Your Sensors these appropriate choices is that the bags are used to store components material is somewhat conductive or that are static sensitive. The bags The basic flex sensor covered here resistive. The degree to which the are made from a single layer of can be modified in size and shape to material is resistive will determine carbon-loaded polyethylene and the fit custom applications. The resistive the scale at which your flex sensor conductivity does not depend on material may also be modified to operates. For example, here I am humidity. I cut the bags into 3/8” obtain different resistances and using conductive black plastic poly wide by 5” long strips. characteristics. SV

Prototype Stencils www.quickstencil.com

Designed specifically for hand printing Proto-Basic $94.50 Even paste distribution on any size board

Superior paste release and repeatability, right at your desk!

Stencil comes with a squeegee and pcb alignment tools

Convenient on-line ordering and same day shipment *same day shipment dependant on courier availability Phone: (208) 215-6825

52 SERVO 06.2009 Page 53 Jun09.qxd 5/6/2009 4:35 PM Page 53

STEER WINNING ROBOTS WITHOUT SERVOS!

erform proportional speed, direction, and steering with P 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 06.2009 53 Ward - Part 4 dc-edited.qxd 5/4/2009 3:40 PM Page 54

COMPUTER CONTROL and DATA ACQUISITION by David A. Ward Part 4: Working With Analog Signals

Many things in the natural world are not either ON or OFF or digital in nature like they are in the inner workings of computers; these non-digital occurrences are analog in nature. Some examples of analog occurrences are: sound, light, temperature, atmospheric pressure, and humidity, just to name a few. For example, the temperature in a room is not exactly 72°F or 73°F all of the time, it will pass from 72° up to 73° in small increments or steps from perhaps 72.1° then to 72.2° etc., until it finally reaches exactly 73°, but this will probably last for just an instant. In order to acquire analog information into the computer, transducers are needed that convert these analog measurements into varying voltages or currents that are then presented to an analog- to-digital (A-to-D) converter. The A-to-D converter converts the analog values into a digital format that is compatible with a digital computer. Likewise, for a digital computer to output an analog signal, the digital numbers must pass through a digital-to-analog (D-to-A) converter. FIGURE 1 here are several different types of A-to-D converters but Tone of the most common ones — and one that is used such as the LM34 which produces in the NI USB-6008(9) units — is the successive approximation 10 mV/°F at its output terminal register or SAR A-to-D converter. Let’s take a minute and should be connected to an A-to-D , step through the operation of a simplified SAR conversion converter with at least a 10 mV process. The A-to-D converter in the USB-6008 unit is either resolution so that the binary con- 12 or 11 bits and either 14 or 13 bits in the USB-6009 unit. version value would change for - We’ll use a much simpler three bit A-to-D converter for our every °F change in the transducer. example. As we step through the three bit process, you’ll Going back to the three bit A-to-D quickly understand why we don’t want to step through an explanation, if the applied analog FIGURE 2 A-to-D converter with many more bits than this. voltage was 0V to +7V, then 7V First of all, let’s calculate the resolution of an A-to-D would be divided by 23, or eight; subtract 1 is 7, and the converter; the resolution is a value that tells you how much resolution comes out to 1V. Therefore, every change of 1V the voltage will change before the digital conversion value will result in a change of one in the binary conversion value. increments or decrements by one. The equation for A-to-D As you read through the following explanation, refer to resolution is: Resolution = (Vmax – Vmin) / (2N – 1). The Figure 1. The SAR conversion begins by making the most Vmax and Vmin are the maximum and minimum analog significant bit (MSB) a 1, and feeds this value into a (D-to-A) voltages that will be presented to the A-to-D converter. The converter. This voltage then goes into a comparator, com- number “2” is used because the conversion answer is base paring the incoming analog voltage with the internal 2 or a binary number. The value “N” is the number of bits approximation voltage. Let’s say an analog voltage of 3.25V that the A-to-D converter converts the analog voltage into. was sent to the A-to-D converter. The first value to be com- Since the voltage range is divided by (2N – 1), increas- pared would be “100” or 4V versus 3.25V. If 4V is greater ing the number of bits decreases the resolution value, or in than the applied 3.25V — which it is — the approximation other words divides the analog voltage into smaller sections. voltage is too high and the MSB of 1 is cleared to a 0. This The smaller the resolution voltage for an A-to-D converter, the is then placed in the SAR’s three bit holding register. On the more sensitive it is. So, smaller analog voltage changes will next pass, an approximation of “010” or 2V is compared result in changes in the converted binary result. The resolution with 3.25V. If the approximated voltage is below the incom- needs to be matched to the transducer supplying the analog ing voltage — which it is — the 1 remains a 1 and is placed voltage to the converter. For example, a temperature transducer in the holding register for the next bit. On the third pass, an 54 SERVO 06.2009 Ward - Part 4 dc-edited.qxd 5/4/2009 3:41 PM Page 55

approximation of “011” or 3V is compared with 3.25V and again this is below the incom- ing voltage. Therefore, the 1 remains and is placed in the holding register in the LSB’s place. So, when an analog voltage of 3.25V is converted in this three bit SAR, the binary conversion is “011” or 3. Enough Theory; Let’s Measure! FIGURE 3 FIGURE 4 Now let’s look at converting analog voltages with the USB- 6008 unit. You probably noticed that two values were given for the number of bits used in the A-to-D converters in the USB- 6008(9) units. When these converters are used in the differential mode — that is, two sides of an analog voltage are fed into the converter — they use the higher number of bits for the conversions, with a FIGURE 5 FIGURE 6 total of four analog inputs possible. When they are used in the single-ended mode or RSE (respect to ground single ended) mode, the conversion bits are one less with a total of eight analog inputs possible. In this article, we are going to use a 10K potentiometer, an LM34 temperature transducer, and an LDR (light dependent resistor) which can all be used FIGURE 8 in the single-ended or RSE mode, FIGURE 7 and we are going to use a voltage range of 0V up to +5V. Therefore, for the USB-6008 unit indicator, and the stop button inside of a while loop on the the resolution will be: Resolution = (5V-0V) / (211 - 1) or 5V / block diagram by selecting from the functions palette: 2047 = 2.44 mV. Since the LM34 changes its output by 10 mV/°F, Programming>Structures>While Loop and wire as in Figure 6. it will fit within the USB-6008’s A-to-D capabilities quite well. When you run the VI, you will see the analog voltage Let’s first connect a 10K potentiometer to AI0 as change as you turn the potentiometer wiper. You can also shown in Figure 2. Now let’s make a VI that will display the connect a multimeter to the potentiometer and compare its analog voltage conversion result. Open a blank VI and place readings against the VI display. Analog inputs can be displayed a numeric indicator and a stop button on the front panel by in more graphical ways than just through a numeric indicator. selecting from the controls palette: Express>Numeric Let’s add a meter to the front panel by selecting: Express>Numeric Indicators>Num Ind and Express>Buttons>Stop. In the block Indicators> Meter. Open the meter’s properties window and diagram, open a DAQ Assistant by selecting from the func- under the scale tab set the maximum to five; see Figure 7. tions palette: Express>Input>DAQ Assistant. From the DAQ In the block diagram, place the meter’s icon inside of the Assistant pop-ups, select: Acquire Signals>Analog>Voltage; while loop and wire it to the output of the DAQ Assistant see Figure 3. Next select AI0 and finish; see Figure 4. From as shown in Figure 8. Now you have a graphical display of the the final pop-up window, set the Max to 5 and the Min to 0 analog voltage along with the numeric indicator as in Figure 9. and the terminal configuration to RSE as shown in Figure Next, let’s connect the LM34 temperature transducer to 5, then select OK. Place the DAQ Assistant, the numeric the AI0 terminal as shown in Figure 10. Be sure to remove SERVO 06.2009 55 Ward - Part 4 dc-edited.qxd 5/4/2009 3:42 PM Page 56

FIGURE 11 palette by selecting: Express>Arith & Com…>Numeric>Multiply. Wire the data terminal from the DAQ Assistant to one of the multiplica- tion inputs on its left side. Wire the output of the multiplication icon on its right side to the input of the thermometer input. Now hold your cursor over the unconnected input of the multipli- cation icon and right click. From the pop-up menu, FIGURE 9 select the create constant. In the constant box that appears with a zero in it, type in the number 100 and press enter. When the VI is run, the thermometer will now / display the temperature of the LM34 in °F (see Figure 11). Let’s add a second analog channel to the VI with an LDR  -.- connected as shown in Figure 12. We will also need to add an additional numeric indicator to the front panel to display the LDR’s voltage. If, however, we attempt to open another analog input DAQ Assistant, we will get an error when we try to run the VI.  -*-, We must open the current DAQ Assistant, and add an additional analog input channel to it by selecting the blue “plus sign” from FIGURE 10 FIGURE 12 the DAQ Assistant pop-up as shown in Figure 13 then selecting channel AI1 as shown in Figure 14. Now we need to split the the 10K potentiometer from the circuit first. Now when you data coming from the DAQ Assistant data terminal out to two run the VI, you will see the output of the LM34 which is 10 separate indicators: the thermometer and numeric indicator mV/°F; so if the room temperature is 72°F, you will see 720 for channel AI0 and a numeric indicator for channel AI1. mV in the numeric indicator display. If we multiply that value To do this, delete the wiring between the DAQ Assistant by 100, we convert that voltage to °F and can display that and the thermometer and its numeric indicator. Add a in the thermometer on the front panel. Add a thermometer splitter by selecting from the functions palette: Express>Sig to the front panel by selecting from the controls palette: Manip>Split Signals. Grab the lower edge of the signal splitter Express>Numeric Indicators>Thermometer. In the block icon and drag it down until three terminals appear: one diagram, add a multiplication function from the functions input and two outputs. Now you can wire the DAQ Assistant data to the input terminal and the two FIGURE 14 output terminals to the thermometer and the numeric indicator for the LDR (see Figure 15). Output, Too!

Finally, let’s control an analog voltage coming out from the USB-6008 unit. We can add another DAQ Assistant to control an analog output from one or both of the analog output channels, AO0 and AO1. Add a knob to the front panel to control an analog output voltage by selecting from the controls palette: Express>Num Ctrls>Knob. In the block diagram, add another DAQ Assistant and when FIGURE 13 its pop-up menus appear, select Generate Signals> Analog Output>voltage as shown in Figure 16. Select channel AO0 as shown in Figure 17. In the final pop-up menu, change the generation mode to one sample (on demand) as in Figure 18. Now in the block diagram, wire the knob’s icon to the DAQ Assistant as FIGURE 15 FIGURE 16 shown in Figure 19. 56 SERVO 06.2009 Ward - Part 4 dc-edited.qxd 5/4/2009 3:43 PM Page 57

FIGURE 19

FIGURE 17 FIGURE 18

Run the VI, rotate the knob, and measure the voltage level capable of PWM out- on the AO0 terminal with a multimeter. If you exceed the 5 puts but another setting on the knob, your VI will generate an error since you device (such as a are asking it to output more voltage than it is capable of. Microchip PIC) can be To fix this, you can change the maximum range of the knob added to convert the to 5 in the front panel by right clicking on the knob, from analog output voltage the pop-up menu selecting properties, and from the scale into a PWM signal. tab changing the maximum to 5 as shown in Figure 20. The two analog output channels each have a resolution Final Thoughts of 12 bits and can output from 0V to 5V at up to 150 Hz FIGURE 20 at 5 mA. One of the ways you can use the analog outputs We’ve been able is to convert that analog output voltage into a pulse width to introduce the analog functions of the USB-6008(9) units modulated (PWM) signal to control a DC SSR, providing a and LabVIEW’s analog abilities in this article. The fifth and variable DC voltage on a DC load such as a motor to make final installment will tie all of the concepts from the first four it a variable speed motor. The USB-6008(9) units are not articles together into a complete thermal cycling system. SV

5 reflectance sensors on underside

battery charger piezo buzzer connector Item #975 $99.95 4 AAA batteries 30:1 micro (not included) metal The Pololu 3pi robot is a high-performance, compact gearmotors mobile platform featuring:

* Two metal gearmotors * High-traction silicone tires * Five reflectance sensors * Speeds exceeding 3 ft/sec * 8×2 character LCD using innovative constant- optional * Three user pushbuttons voltage motor supply power LED ISP * Buzzer and LEDs programming All peripherals are connected to an ATmega168 connector microcontroller running at 20 MHz, with free C-programming push-on/push-off tools, libraries, and support for the Arduino environment. power button reset removable 8x2 button 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 06.2009 57 Alter - Hagetaka Part 1.qxd 5/4/2009 1:03 PM Page 58 Hagetaka Bipedal Combat Robot Part 1

By Andrew Alter

In this series of articles, we will explore the design and building process of my robot Hagetaka: a remotely piloted bipedal combat robot. We will detail the overall project goals, the design, and building of the proof-of- concept using the Bioloid robotics system. Then, we’ll go into the process of scaling and migrating our conceptual creation over to a custom built platform using the powerful RX-64 servos, an advanced Gumstix based onboard controller, supporting telepresence electronics, and weapons system. I feel this project is a solid exercise in taking an idea on paper and moving it into the physical realm through the many gradual steps of the design process. This project spanned a period of 12 months and consumed hundreds of hours. I hope to share much of what I learned through this lengthy project, as it is applicable to just about any robot design.

58 SERVO 06.2009 Alter - Hagetaka Part 1.qxd 5/4/2009 1:04 PM Page 59

Figure 1

t this point, some of you are probably thinking: website at: http://mech-warfare.com), I will outline the “What the heck? A Bipedal Combat Robot?” criteria one must meet when building a competition-ready AWell, it’s not a combat robot in the traditional Mech. The basic concept is that two remotely piloted robots ‘spinning saw blades, ramming, flipping, and will start on opposite sides of a 15’x15’ urban style arena — otherwise mauling’ sense, but as you will see, its purpose complete with 1:24th scale buildings to provide cover — and is very much combat orientated. I built Hagetaka with the battle each other using projectile weapons such as airsoft, sole intention of competing in Mech Warfare, which is a CO2 BB guns, and even rockets. The match may not be new type of robotic competition debuting at RoboGames viewed directly by the pilot, so each Mech must be 2009. Mech Warfare in a nutshell is a projectile weapon equipped with telepresence equipment such as a wireless based combat competition for bipedal and quadruped camera, distance sensors, and occupancy grid mapping robots, akin to the sci-fi franchise Battletech™ and systems. This adds a level of immersion and difficulty, and Mechwarrior™. For those of you who aren’t familiar with also holds true to the concept in Battletech that the Mechs the franchise, think futuristic war scenarios where the carried a pilot onboard. Each Mech starts off with a finite strongest weapon on the battlefield is a 30-100 ton amount of ‘hit points,’ and hits are scored on 3x3” target walking “tank” known as a ‘Mech.’ plates that wirelessly relay their data to a central scoreboard While I won’t go into great detail about the PC. The first Mech to have their hit points reduced to competition rules (full details can be found on the official zero or have the lesser amount of HP when 15 minutes expires loses! Hagetaka Specifications Degrees of Freedom: 16 Initial Design and Prototyping Weight: 4.5 kg Height: 66 cm So, given that criterion, a competition-ready Mech Power Source: 18.5V 4,000 mAh LiPo Battery Onboard controller: 400 MHz Gumstix Verdex Pro XM4-bt consists of a walking robot with two to four legs, a fly-by- Vision: 720x480 Sony ExView Camera wire method of remote control, a telepresence solution, Weapons: 2x 250 RPM automatic airsoft guns enough battery power to operate for at least 15 minutes,

SERVO 06.2009 59 Alter - Hagetaka Part 1.qxd 5/4/2009 1:05 PM Page 60

and a weapons system. Being a long time fan I needed to stray away from a of the Battletech series, I wanted to model Figure 2 standard humanoid leg my own Mech after one of my favorites configuration, so I started from the franchise, the Vulture. While looking at different options. aesthetically pleasing, the design of My good friend Jon Hylands this fictional Mech is very impractical is a researcher with the Brain in the real world. Its theoretical Engineering Lab at Dartmouth walking gait, extreme reverse leg College, and has done some design, and disproportional leg impressive work towards alternate to torso size ensure that this walking gaits for bipedal robots Mech will continue to reside using his Bioloid based MicroRaptor only in the sci-fi universe. I robot (shown in Figure 3). He was determined to capture implemented a seven degree of some of the look and feel of freedom leg design based on a the Vulture while adapting it Velociraptor and with that, to a more practical real started work on different types world design. Figure 1 is the of walking gaits than what is 3D model captured from the normally seen with bipedal videogame Mechwarrior 4™ robots. Here are Jon’s that I used as inspiration for thoughts behind the gait my design. he is using: To prototype my design, I chose the Bioloid Comprehensive Kit from Robotis “Most bipedal robots (www.robotis.com). I give this kit today walk using a my highest recommendation. strange technique that The modular bracket involves keeping each building system, foot more or less impressive AX-12 servos, aligned horizontally and the simple ‘pose with the corresponding and capture’ software is hip. If you try and a dream come true for walk that way, you rapid prototyping. I end up looking like built the stock these robots, with Bioloid humanoid your upper body to get a feel for swaying back and how the system went forth as you together and upon doing Figure 3 desperately try so I noticed that the and keep your humanoid’s legs turning balance. Clearly, around backwards made we’ve got a nice reverse knee a long design. (Refer to way to Figure 2 for reference.) go to I figured this would get realistic be a simple starting point as the walking. One of walking gait would be the same as that the techniques I’m planning on trying of the stock humanoid, so I decided to with MicroRaptor is to use longer strides, do some further testing. Almost with the legs coming under the body to immediately, I noticed that keeping the knees maintain balance without rocking the entire slightly bent backwards would cause more strain upper body back and forth.” on the weight-supporting servos. Checking the temperatures only confirmed this and simple By using Jon’s MicroRaptor leg design, physics explains it; just try walking around with your legs I moved away from the standard humanoid bent at a 90 degree angle at the knees. Bipedal robots approach while gaining upper torso stability are more efficient when the servos are aligned vertically (which would prove to be critical for aiming so that load-bearing servos hold most of the payload on while piloting remotely). While this leg design top of their rotational shaft, rather than at a point of differs from that of the Vulture, it proved to be leverage. To stick with the Vulture’s overall aesthetics, much more functional while still maintaining a

60 SERVO 06.2009 Alter - Hagetaka Part 1.qxd 5/4/2009 1:06 PM Page 61

reverse knee style aesthetic that I felt was important for out what else would need to capturing the feel of the Mech. I quickly assembled a be added: an upper set of legs based on the MicroRaptor and started torso to carry the plugging away at getting them to electronics, wireless walk. Figure 4 shows a photo of the camera, battery, and leg design. a method of mounting Many painstaking hours later the weapons as well and after watching Jon’s videos as aiming them, all dozens upon dozens of times, my own the while keeping payload prototype started taking its first steps considerations in mind. I forward. One thing I was very mindful of while decided on a pan/tilt doing this testing was the payload capability. I closely arrangement for the waist monitored the temperatures of all the servos (another which would be the simplest great function readily available with the AX-12s) and had solution for aiming and looking the distinct feeling that while they would be sufficient to around. The airsoft weapons carry the components required to compete, I would end and camera would then be up wanting to do more with this project than just the mounted in a stationary bare minimum. With that in mind, I moved fashion to the upper torso, towards building my proof of concept. allowing me — in theory — to shoot whatever my Hagetaka v1.0 camera was aimed at. I do most of my CAD work in Armed with a solid vision of the Autodesk Inventor 2008, project in mind, I started on the so I started drawing up a first revision of Hagetaka. Why Figure 5 simple ‘roll cage’ style build the robot on a smaller upper torso design that scale when we’ve already would protect the verified that the design is electronics and provide functional and can walk? a means of mounting the Well, one can plan all weapons. Pololu Robotics (www.pololu.com) offers they want on paper, a fantastic, low cost laser cutting service that I have but having a real used on more than one occasion. I recommend them world scale model of because of their customer service, pricing, and quality your final version is of work. invaluable for trial and I’ve always been a big fan of building a chassis error. My other reason using flat frame pieces connected with standoffs: it’s for building the robot inexpensive, easy to design, and quite effective. I also on a smaller scale was added Lynxmotion SES compatible mounting holes to budget. I knew my the sides of the torso chassis to provide a mounting ultimate goal point for my weapons. Check out Figure 5 for a shot would be to of Hagetaka v1.0. move this over I learned quite a bit from building the first version. to a custom For armament, I ended up using airsoft weapons intended aluminum chassis for an R/C tank due to their light weight and small with much form factor. Mounting the weapons was fairly higher torque straightforward using some Lynxmotion tubing servos, but the and hubs. While I did encounter a few challenges cost for that would getting my original onboard micro, battery, be considerable. For the wireless camera, and other supporting time being, I could at electronics mounted within the chassis, I would least build a smaller classify my prototype as a great starting point. version to experiment with, Figure 4 and use what I learned Hagetaka v2.0 from that to move forward with the larger, Upgrading the servos in version 2.0 would not only final version. increase the payload capacity to allow for a higher end With the legs more or video system and better weaponry, but it would also less taken care of, I started to plan increase the overall size of the robot by a substantial

SERVO 06.2009 61 Alter - Hagetaka Part 1.qxd 5/4/2009 1:07 PM Page 62

s someone who does not have very much experience in machining, AI approached the owner of Big Blue Saw, Simon Arthur, with my project and what I needed to have machined. We went back and forth discussing some of the details of having my parts manufactured and ultimately Big Blue Saw was kind enough to offer me a sponsorship and assist in getting the parts I needed made. Simon provided invaluable advice and consultation on the physical properties of the aluminum I wanted to use and tips on my bracket designs. In the process, I learned a considerable amount about manufacturing. Without Big Blue Saw, this project would not have come together as well as it did. I cannot even begin to recommend them strongly enough to anyone looking for custom machining work. Once I had chosen the 0.08” thickness 5052 aluminum as the material for the brackets, creating the necessary pieces to build the frame for Hagetaka was a two step process: First, the aluminum sheet was cut into a flat pattern using Big Blue Saw’s water jet CNC machine. (These machines Figure 6 are incredible pieces of technology, capable of cutting through just about any material with incredible accuracy.) Figure 6 shows some of these modeled brackets. All of the brackets used are available for download on the SERVO website at www.servo.magazine.com. Figure 7 shows the CAM software interface for the machine and Figure 8 shows the parts being cut from the aluminum sheet. The next step in the manufacturing process is bending the cut patterns using a metal brake. The majority of the bends in the brackets were simple 90 degree bends, but the feet and hip/ankle brackets were a bit more complex requiring a decent amount of jig work. Figure 9 shows one of the brackets being bent in the brake. Figure 10 shows a picture of the finished brackets. Figure 9

Figure 7

Figure 8

Figure 10

62 SERVO 06.2009 Alter - Hagetaka Part 1.qxd 5/4/2009 1:08 PM Page 63

MechWarrior is a profession in the fictional universe of BattleTech, a wargaming and science fiction franchise created by FASA Corporation and currently owned by WizKids. MechWarriors are individuals who pilot BattleMechs: large robotic war machines that are central to the BattleTech series. The fictional events of the BattleTech universe constitute a future history that describes the course of humanity from modern times until the mid 32nd century. It also be considered an alternate history distinct from our own, since its point of divergence from the real world occurs in the past. This is not the focus of the series, though, and is more the result of real-world history overtaking the early years of the BattleTech timeline. Given its central theme of military conflict, the events of the BattleTech universe can be classed as a military history, albeit a fictional one. Incessant wars are the backdrop of most BattleTech stories and historical happenings, the majority of which concern individuals in the military rather than civilian sectors. Equally important to BattleTech history are politics and technology. The earliest events distinct to the BattleTech universe occur after the end of the Cold War and the collapse of the Soviet Union. The United States, Europe, and Japan announced in 1994 their intention to jointly construct an orbiting industrial facility named Crippen Station, which was successfully launched 11 years later. A 1997 coup d'état by hard-line communists restored a militant, Soviet-style government in Russia and sparked a "Second Cold War" with NATO that lasted until the start of peaceful reforms under premier Oleg Tikonov in 2005. The republic crumbled in 2011, igniting a civil war that drew in NATO and saw the successful use of the Western Orbital Defense Network (WODeN) — successor to the earlier SDI — to intercept a preemptive Russian missile attack against western targets. The war ended with a Western Alliance victory in 2014. From Wikipedia, the free encyclopedia

amount. The Bioloid system was an various machine shops locally, but excellent tool to prototype with and almost all of them had very high was made even better by the fact minimum order amounts and seemed that moving over to the higher end better suited towards someone Dynamixels was a simple transition. making mass quantities of a single I planned on keeping the same leg part, rather than small quantities of design since, “if it ain’t broke, don’t multiple parts. Most of the quotes I fix it.” received were in the thousands of dol- I chose the RX-64 Dynamixel as lars, which would put me far over an the actuator to build the second already stretched budget. I happened revision of Hagetaka, however, this to find Big Blue Saw (www.big presented one major challenge: I bluesaw.com) which — unlike many would need to build a completely other machine shops — does not have custom chassis to house the larger, a minimum order amount. This is more powerful servos. Although the especially useful for experimenters Bioloid system comes with a variety and hobbyists working on personal of brackets, the actual selection of projects, or others not needing parts brackets is rather limited. Custom manufactured in quantity. design was the only way to go. I went to work in Inventor essentially scaling Conclusion up and porting over the existing Bioloid brackets used in my prototype Next time, we will cover the to an RX-64 compatible equivalent. assembly of the robot’s chassis, At this point, I had all of the wiring and power distribution scheme, structural components for Hagetaka remote control setup, weapons, v2.0 designed within Inventor, but supporting telepresence electronics, lacked a means of machining the and a more in-depth explanation of components. I started contacting the walking gait. SV

Trossen Robotics Community http://forums.trossenrobotics.com Big Blue Saw www.bigbluesaw.com Pololu Robotics www.pololu.com Links Mech Warfare http://mech-warfare.com

SERVO 06.2009 63 SVWebstoreJune09.qxd 5/6/2009 10:26 AM Page 64

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

“EDITOR’S PICKS” ELECTRONIC NEWBIE DIY Design Electronics Kit NEW! This great kit contains everything you need to Bionics for learn the basics of the electronic circuit LEGO MIND- Evil Genius design. It contains all STORMS NXT of the most common electronics components Hacker's Guide as well as a prototyping Modern medicine is increasingly breadboard for you to The NXT is probably the kindest dependent on the monitoring of get started right away. introduction to robotics available. physiological signals. The text, from my The kit has over 130 parts! Although the user guide and online favorite series in electronics, provides an No soldering is required and documentation that accompany the NXT excellent-practical-grounding in monitoring the included 32 page are good, a little extra handholding never and manipulating biological signals. This illustrated manual guides you hurts. While the 'Hacker' in the title book is perfect for an electronics through each of the projects. suggests an advanced text, in reality, this enthusiast considering a career in After you build all of the book provides a friendly, gentle medicine or biology. The projects are projects, you can use the introduction to the NXT. simple, and, in general, inexpensive. parts for your own designs. $24.95 $24.95 For a complete product detail, please visit: Editor Bryan Bergeron’s recommended reads. http://store.nutsvolts.com Find these and many more great titles in the SERVO Magazine Webstore! $49.95* ROBOTICS Kickin' Bot Robot Building for Dummies Robot Programmer's Bonanza by Grant Imahara by Roger Arrick / Nancy Stevenson by Enter the arena of the metal gladiators! John Blankenship, Do you have what it Discover what Samuel Mishal robots can do and takes to build a The first hands-on how they work. battle-ready robot? Find out how to programming guide You do now! Here are build your own for today's robot the plans, step-by-step robot and program hobbyist! directions, and expert it to perform tasks. Get ready to reach into advice that will put Ready to enter the your programming you in competition — robot world? This toolbox and control a robot like never before! while you have a heck book is your pass- Robot Programmer's Bonanza is the one-stop of a lot of fun getting port! It walks you guide for everyone from robot novices to there. Grant Imahara, the creator of the through building your very own little advanced hobbyists who are ready to go popular BattleBot Deadblow, shares every- metal assistant from a kit, dressing it up, beyond just building robots and start thing he’s learned about robot design, tools, giving it a brain, programming it to do programming them to perform useful tasks. and techniques for metal working and the things, even making it talk. Along the way, $29.95 parts you need and where to get them. you’ll gather some tidbits about robot history, enthusiasts’ groups, and more. $24.95 $24.95 Robotics Demystified Forbidden LEGO Build Your Own by Edwin Wise by Ulrik Pilegaard / Mike Dooley Humanoid Robots YOU DON'T NEED ARTIFICIAL INTELLIGENCE by Karl Williams TO LEARN ROBOTICS! Build the Models Now anyone with an Your Parents GREAT 'DROIDS, INDEED! interest in robotics can Warned You This unique guide to gain a deeper under- Against. sophisticated robotics standing — without for- projects brings mal training, unlimited Forbidden LEGO humanoid robot introduces you to time, or a genius IQ. In construction home to Robotics Demystified, the type of free- the hobbyist. Written by style building that expert robot builder a well-known figure in master and author Edwin Wise builders do for fun in the back room. the robotics provides an effective and totally painless Using LEGO bricks in combination with community, Build Your way to learn about the technologies used to common household materials (from rub- Own Humanoid Robots provides build robots! $19.95 ber bands and glue to plastic spoons step-by-step directions for six exciting proj- and ping-pong balls) along with some ects, each costing less than $300. Together, We accept VISA, MC, AMEX, very unorthodox building techniques, they form the essential ingredients for and DISCOVER you’ll learn to create working models that making your own humanoid robot. $24.95* Prices do not include shipping and LEGO would never endorse. $24.95 may be subject to change. 64 SERVO 06.2009 SVWebstoreJune09.qxd 5/6/2009 10:44 AM Page 65

To order call 1-800-783-4624

RobotBASIC Projects For Beginners byJohn Blankenship, Samuel Mishal WOW! If you want to learn how to program, this is the book for you. The Das Blinken Most texts on programming offer dry, boring examples that are board sure has difficult to follow. In this book, a wide variety of interesting helped my and relevant subjects are explored using a problem-solving functions!! methodology that develops logical thinking skills while making learning fun. RobotBASIC a powerful, yet extremely Visit my online store @ easy-to-use, computer language available www.ser.servomagazine.com.com for any Windows-based PC is used throughout the text. $14.95 SERVO Magazine Linux Robotics The Amateur Scientist 3.0 by D. Jay Newman The Complete Collection Bundles If you want your robot by Bright Science, LLC to have more brains than There are 1,000 microcontrollers can projects on this CD, not deliver — if you want to mention the a truly intelligent, additional technical high-capability robot — everything you need info and bonus is right here. Linux features. It Robotics gives you step- doesn’t matter if you’re by-step directions for a complete novice “Zeppo,” a super-smart, single-board- looking to do their first powered robot that can be built by any science fair project or a hobbyist. You also get complete instructions super tech-head gadget Published by T & L Publications, Inc. for incorporating Linux single boards into freak; there are enough your own unique robotic designs. No Save $10 projects on the off the programming experience is required. This $57 book includes access to all the single CD-ROM to keep you and 50 of your per bundle normal price!! downloadable programs you need. friends busy for a lifetime! $26.99 $34.95 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, 07, and 08.

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 06.2009 65 SVWebstoreJune09.qxd 5/6/2009 10:50 AM Page 66

Or order online www.servomagazine.com

SPECIAL OFFERS Proto Buddy Kit & Book Combo The Definitive Guide to For those just getting started in electronics as a hobby, a solderless breadboard (SBB) is the Building Java Robots perfect platform for building those first circuits. Attach a Proto Buddy to an SBB, include a by Scott Preston battery or two, and you will have a combo that has a lot of the same The Definitive Guide to Building Java Robots functionalities as more expensive units. is for educators, Combo includes PCB & Components, 830 point SBB, and students, hobbyists, Do-It-Yourself Circuitbuilding For Dummies. 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, Combo Price $57.95 Plus S/H recognize your face, listen to you, and build Limited time offer. maps. Reg $55.95 Sale Price $47.95 Mechanisms and Mechanical Devices Sourcebook, Fourth Edition by Neil Sclater, Nicholas Chironis Over 2,000 drawings make this sourcebook a gold mine of information for learning and innovating in mechanical design. Overviews of robotics, rapid prototyping, MEMS, and nanotechnology will get you up-to-speed on these cutting-edge technologies. Easy-to-read tutorial chapters on the basics of mechanisms and motion control will introduce those subjects to you. Reg $89.95 Sale Price $69.95 PROJECTS Das Blinken Board Kit Tankbot Kit & Brain Alpha Kit NEW!

As seen in the Nuts & Volts June issue, Personal Robotics column As seen in the Sept. issue by Vern Graner Tankbot/ Brain Alpha The "Das Blinken board" kit includes an ATtiny84 microcontroller that sports eight software by Ron Hackett A series filled with projects and experiments PWM channels to control motor speed and light brightness. Jumper selectable patterns can to challenge you through your learning be used to operate motors, solenoid valves, relays, or any DC load up to 24V/500 mA per process while you grow your fully channel! Expand your board with GNU/GPL software updates featured in upcoming articles. expandable Brain Alpha PCB! Kit comes with all components including a pre-programmed micro, is designed with easy The brain is a PICAXE-14A! through-hole construction, and the main components are socketed for easy For more info & pictures, visit the upgrade & repair. SERVO Webstore. KIT Subscriber’s Price $32.45 Non-Subscriber’s Price $35.95 Tankbot and the Brain Alpha Kit PCBs can be bought separately. can be purchased separately. Includes an article reprint. Combo Price $ 138.95 66 SERVO 06.2009 RoboResources - Jun 09 dc.qxd 5/6/2009 2:20 PM Page 67

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

Blogging Your Way to Robotics Stardom

hen the Web first popped computer and Internet connection can Your blog might also contain up in the mid 1990s, having create and maintain their own blog. pointers to newsworthy stories about Wyour own web page was the You can write about any topic you robotics or essays where you explain in thing. Back then, just about all sites like, but of course the topic of interest your philosophy. You can write blog were static. You created — usually to all of us here is robotics. You don’t entries that teach a concept or by hand — the coding for the page, need your own Internet server or even demonstrate a method or procedure. uploaded it, and then watched as the your own domain name. Just sign up Blogs can contain text, images, videos, relatively few people on the Internet to the service, set up the look and feel and other media, and you’re free found your site. of your new blog (takes about 15 to link to other sources when Before long though, enterprising minutes), and start writing. If you appropriate. individuals like Matt Wright and happen to have your own server and Because a blog is a journal, others came up with simple tools Internet domain, you can create your they’re a great tool for instruction for things like guestbooks and basic own fully customized blog using free and learning. Teachers can create a posting forums. The Interactive Web software such as WordPress. blog to help students with their was born, and it’s been going full In this installment of Robotics assignments. Students can maintain a speed ever since. Resources, we’ll discuss what you blog to show their work and how it’s These days, the hot ticket is the need to start your own robotics blog progressing. Blogs can be updated by blog — a contraction of the already and how to keep your blog fresh and a single individual or multiple people, short word weblog. At the risk of useful to anyone visiting it. making it ideal for group projects. telling you something you probably already know (but for the sake of Why Start a Blog Free and Low Cost completeness), blogs are like personal Blogging Platforms diaries where you can post an article At their basic level, blogs are just about anything you like. If you permit like regular web pages, except they To make a blog, you must have it, visitors to your blog can post use a mechanism to make it easier a web server running blog software. comments about your article. Blogs to update the pages with new By far, most blogs you’ll find on the are a form of specialized community information. Most people use blogs as Internet are contained on free and forum where the topics are generally a form of daily (or weekly or monthly) low cost blogging hosts. These are created and controlled by the owner journal, and the format of blog pages companies that operate web servers of the blog. reflect that. The most recent entries and maintain the blog software (In community forums like the are placed at the top and older entries for you. one provided for SERVO and Nuts & get pushed down or are moved to an One of the biggest is Volts at forum.servomagazine.com, archive section. Blogger.com, operated by Google. anyone can start a new topic — For robotics, you might start a (Note that another blogging platform, usually a question or plea for help blog to keep interested folks updated blogspot.com, is also operated by — and anyone can respond with on your latest project(s). Each entry Google and is functionally the same.) answers. Be sure to head over there you post might contain your progress, In the free camp, there’s also if you haven’t already!) including parts and supplies you’ve WordPress which offers free blog Thanks to numerous free used. You might discuss the hosting in addition to free software platforms provided by Google and challenges of the design and how you can use on your own web server others, just about anyone with a you overcame them. — more about this later. SERVO 06.2009 67 RoboResources - Jun 09 dc.qxd 5/6/2009 2:21 PM Page 68

There’s also the paid blogging On the better hosts, the ads are things like navigation links, activity hosts, typically offering several levels contextually related to the subject of calendars, and ads. of features where you can match the your blog, but sometimes you get ads Apart from changing the title of monthly price you want to pay with inserted that are totally inappropriate. your blog, you can usually change the features you want. A notable So, the less conspicuous the ads, some other aspects of the theme, like example is Typepad.com where you the better. the main logo picture (incorporating a can choose from any of four levels of robot, of course!) or the overall color service; from a low-end $4.95 per Simple Steps to scheme, and what “widgets” you wish month that gives you one blog, up to Running Your to use on your blog. Pro at $14.95, where you can have Widgets are containers for an unlimited number of blogs under Own Blog different kinds of content. You might the same account. (Typepad also add or remove a Links widget that offers a business class account at $89 Whether free or paid, the typical contains links to other sites that you per blog, but this service is designed blogging platform lets you set up define. Or, a widget might contain more for corporate hosting and is one or more blogs and publish them an About box that describes the beyond what most robotics hobbyists under the domain of the blog host. purpose of your blog. On more will want.) For example, you might create a blog complex themes — such as those See the Sources section for a called Super Duper Crazy Robots and with three or more columns — you short list of free and paid blogging have it hosted at Google’s blogger. can often specify which column the hosts. The list isn’t exhaustive, and com. To access your blog, you’d type widget is placed into. if your favorite isn’t listed don’t get something like http://superduper With the overall appearance of mad! The idea is simply to give people crazyrobots.blogger.com your blog set, you’re ready to add an overview of what’s available. (last time I checked there was no some content. This is where the fun Note that most of the free blog such blog, but you never know). begins. Blog entries — or posts — are hosts recover the costs of providing The first order of business in created using an online editor that is their service by inserting ads into your setting up any blog is to define its provided by the blogging host. Just blog, either along the top or bottom, look and feel. Most blog hosts let you click the New Post link, enter a title, or sometimes in the body of the select from a number of themes that and begin writing. Most blog hosts text itself. Look for blog hosts that define the overall appearance of the provide an online editor that is permit only unobtrusive advertising, page. Many blog themes have a switchable between WYSIWYG (what otherwise visitors to your blog may two-column format: a larger column you see is what you get) and HTML. misconstrue the ads they see as that’s wide enough for the articles When using the WYSIWYG editor, you sponsored by you. you write, and a narrower column for can apply formatting such as bold, italics, or headlines by selecting the Free hosts such as Blogger.com let you set up and maintain a blog at no cost. text and clicking a button. If you already know HTML coding, you can switch to that mode and hand-tweak the content of your posts. Note that most blog hosts check the HTML you enter and may automatically correct invalid markup or may simply delete the bad coding. This step maintains the integrity of your blog posts and allows them to be distributed (if you choose to) via a mechanism known as RSS. An RSS feed requires data to be provided in the strict XML format; any coding errors contained inside will prevent the feed from operating correctly. Many blog hosts add restrictions on some HTML code, such as