03-27-2009 11:40 PM
So You Want To Build A Robot?
So You Want to Build a Robot?
If you are reading this, you clearly want to build a robot. Why? This is a common question that I get from people, so why do I build robots? Personally, I find that robotics a great vehicle for learning many skills, in many areas. Furthermore, I like to create stuff. I'm an avid woodworker and metalworker... but the simplest robot I have ever created had more personality than the finest furniture I make ever will. The goal of this tutorial is to get you started building your first robot, by identifying which skills you have, which skills you will need, and by finding the relevant resources out there.
Your skill set
Before we begin, ask yourself, what are your skills? Do you like to assemble things? Do you like to build things from scratch? Have you ever programmed a computer? Ever programmed a microcontroller? Have you ever done any electronics? As will be seen below, robotics is a blend engineering and creativity in the areas of mechanical, electrical and software design. Typically, a person who is interested in robotics will find that they have moderate to great skills in one of these areas, but may lack any understanding of the others -- don't fret! There are solutions out there that will help make up in any of these areas and, over time, you will find yourself picking up knowledge in all of these areas.
What is a robot?
There are two major types of robots: radio-controlled ones, and robots that think on their own (autonomous robots). As I am primarily a builder of autonomous bots, I will be focusing on that type throughout this tutorial.
Mobile robots have several components: a source of power, sensors to get data from their environment, a brain that does some processing on the data, and actuators that do something physical based on the data. A radio controlled robot may not have sensors as you, the person piloting it, are acting as the sensors. It might sound complex, but it's not, let's break it down more:
Batteries and Power Supplies
The power source for most small mobile robots is simply a set of batteries (preferably rechargeable). These batteries give off power that the robot can use. There are several battery chemistry's out there, such as NiMH, LiPO, or NiCD. Most robots will use NiMH, as NiCD is much older technology. LiPO is more expensive, but it packs more energy for the same weight. You will often find LiPO batteries on robots that need lots of power, but can't carry lots of weight, such as humanoids. Batteries also have various nominal voltages, typical robot batteries use 6V to 18V, although occasionally you will find a robot using something outside this range. The nominal voltage is the average voltage of the pack. Typically, a fully charged pack will have a voltage slightly above the nominal voltage, and the voltage will decrease until the pack is empty, at which point the voltage will be somewhat below the nominal voltage. The most common voltage is largely 7.2V because of the abundance of off-the-shelf batteries available locally for radio control race cars. A 7.2V NiMH pack contains 6 individual cells, each with a nominal voltage of 1.2V, however the cells may be as high as 1.4V when fully charged and will probably decline to somewhere around 0.9V when fully discharged, giving our pack a fully charged voltage of 8.4V, and a fully discharged voltage of 5.4V, a fairly wide swing.
The other rating a battery typically carries is the power it contains, usually measured in milliAmp-hours or mAh. A common pack as shown below (C) might be a 7.2V 2000-3000mAh NiMH battery -- you can find one of these in nearly any hobby shop. The mAh rating tells you how long the battery will last. For instance, if your robot uses an average of 500mA of current at any given time, a 2000mAh battery would last for approximately 4 hours, however you won't typically want to draw it all the way down, since the voltage will be too weak to supply your needs after some point.
Delicate electronics such as microcontrollers require voltage regulators on thier power supply, which will output constant voltage at all times. However, it is expensive to build high-current voltage regulators, so items like servos will instead connect directly to the battery. Because our servos have very limited ranges of power they can handle, they will typically dictate what type of battery we can use. A robot controller, motor, or servo will typically specify a range of voltages it can tolerate: for instance, 6-16V or maybe just 6-8V. There are plethora of available packs out there for every application. Shown above: small 7.2V packs of about 1000mAh(A&B), regular 2000mAh 7.2V battery (C), and a 12V 1600mAh pack (D).
See also my tutorial on Power Supply Basics.
Sensors are electronic devices that get information from the environment. Robots often have internal sensors to measure the voltage of their batteries, motor temperature, etc. External sensors that detect objects can be broken down into two further categories: proximity detectors and range-finders. Proximity detectors simply tell you if an object is there or not, whereas a range-finder tells you how far away it is. An important thing to note is that every sensor is imperfect. Many sensors are known to give "bad" data as often as they give correct data. Remember, robots like their sensors. Never rely on just one sensor, or even one type. Common sensors include:
- Range-finding sensors: such as the Sharp IR rangers (D), sonar sensors (A & B), and laser range finders.
- Global Navigation Sensors: such as GPS, Compasses, and Encoders
- Other: Pyro-electric, accelerometers, UV-sensors (C).
See also my tutorial on choosing sensors.
Most robots have brains that are composed of electronics, they are typically small computers. The two major choices are either using a microcontroller, such as AVR/PIC, or a PC/laptop (which often has to connect to a microcontroller or interface board over serial/usb in order to actually interact with hardware like motors or sensors). There are many low-cost, low-power, and low-weight netbooks out there today that would make a great brain for a mid-size robot. Shown below are two variants of AVR ATMEGA168 microcontrollers (A & B), and an Arduino (C). See also my tutorial on AVR microcontrollers.
Lastly, our robot would be pretty boring if it just sat there and did nothing. Therefore it needs actuators, a fancy term for things that act, or do something physical. The most common form of actuators are motors to drive the robot around (A), but we could also give our robot an arm or legs. When buying motors for a robot, they must be gearhead motors -- those cheap things from Radio Shack are way too fast, and have almost no torque. Motors will need a motor driver, a chip that can handle the power needed to drive a motor (C). Hobby servos (B) are motors that have feedback built in, they can be told to go to a particular position, typically within an 180 degree range. Hobby servos are often used on robot arms and legs. Other actuators or actions may not be as physical as motors, some examples are LCDs (D) and LEDs which can give off data, having your robot speak, or even beeping. Another option for output is a wireless connection to a PC, such as an XBEE (E) based network.
See also my tutorial on XBEE Basics.
Everything we have discussed has been physical objects, but the remaining component of the robot is the software. The software is the code on the microcontroller or PC that makes the robot do interesting things. Most people will find themselves building reactive or behavior based robots when they first start building bots. These are simple, biologically-inspired robots. Check out Robot Programming by Joseph L. Jones for a gentle introduction to the programming of reactive robots.
It can thus be seen that robots are a blend of electronics, software, and mechanics. To build good robots you will have to learn some of each of these aspects
Common Types of Robots
Below I will discuss several common types of robots, their characteristics, several examples, and the type of roboticist the platform best suits. An important thing to note is that for each of the categories below, there are two main distinctions with in each: Radio-Controlled bots, or autonomous ones (robots that think and act on their own). Autonomous bots are almost always going to require more programming than R/C ones.
1. ROVERS - the rover is likely the traditional starting place in robotics. These bots can be built cheaply (<$150), but are a GREAT learning tool. You can typically get a basic bot up and running in a few evenings, but you'll be able to continue playing and not be bored for months to come. You can easily learn the essentials of electronics and software on this simple mechanical platform -- and then apply that knowledge to more mechanically complex robots. Rovers are also highly energy-efficient.
- PROS: cheap, easy to build. Easily reconfigurable. Cheap motors can carry a large payload. Batteries life is long.
- CONS: might not look as cool as a humanoid.
- BEST AUDIENCE: People who want to concentrate on software, electronics, or the use of AI in robotics.
- TOP CONTENDERS: most are home-built today. The solarbotics gear motors can provide a great base.
2) BUTLER ROBOT/HOME HELPER - A bigger version of the robot above. Clearly, cost becomes a much greater issue. Typical cost can run $500-2000 depending on how much is purchased surplus, time to build/program/debug could easily be a year or more. High-level AI is still an open research problem. I would always recommend that you start with your first bot like that above, and work up from there.
- PROS: quite cool looking.
- CONS: high cost, not for beginners.
- BEST AUDIENCE: advanced builders, who have several robots under their belt.
- TOP CONTENDERS: These robots are almost always scratch-built. But decent starting platforms can be had from Zagros Robotics.
3) HUMANOID/BIPED/QUAD/HEXAPOD - there are several really great humanoid kits out there today. Beginners can easily assemble a robot and in most cases have it walking in short order. Most of these kits are R/C controlled out of the box, high level control will require some of the same work as for a rover.
- PROS: Really cool looking. Typically the most life-like of robots.
- CONS: high cost, short battery life, low payload capacity.
- BEST AUDIENCE: R/C robot people, for instance see humanoid robot combat (such as robo-one). Advanced roboticists
- TOP CONTENDERS: Bioloid kit, Hitec Robonova, Kondo... yeah, see the humanoids section of the Trossen store for many, many more models.
See also my tutorial on Building Your Own Issy, an early version of which is shown below:
Where to find information
Google - Google is the best thing since sliced bread. Want to know about sonar sensors, just search for, you guessed it, "sonar sensor" or anything similar.
This forum & the tutorial section - This forum can be a great resource, if you learn to use it effectively. A few words of advice:
- Keep all of the discussion of a particular project in one thread! This allows newcomers to the discussion to find out what has already been said, thus allowing them to further help you!
- Post as much information as you can. If you can't give us many details, we probably can't answer the question, further, we probably won't be very interested in solving a problem that is part of a larger project we know nothing about.
- Be patient. It takes about a day for everyone to cycle through reading a thread. Discussions may easily last several days as people are not glued to their monitors (believe it or not...)
- Private Messages are great for asking specific things that would not be relevant to others.. such as people calling me out for writing this tutorial rather than building something they wanted finished a month ago. Private messages are also used for things like thanking jes1510 for finding that I had mis-labeled my sensors.
So where should I start?
I would highly recommend that you start small. It takes a surprising amount of time, energy, and money to make a bot reliable. It is best to make your "learning mistakes" on a smaller robot, so that it can't hurt you as much physically or monetarily. Unfortunately, it is an all too common tale to hear of a beginning roboticist who invests several thousand dollars in a hugely complicated project only to become frustrated and abandon that project. You wouldn't learn to swim by jumping into the ocean, don't try to learn robotics by building R2-D2.
Easy Materials for Your Robot
Build Your Own Issy
Mapping and Localization
Replies to Tutorial: So You Want To Build A Robot?
Re: So You Want To Build A Robot?
Wow great explanations of things!
Re: So You Want To Build A Robot?
awesome thread, do you know anything about controlled bots? or like the buggers from the first tomb raider movie (they're the tiny ones)
Re: So You Want To Build A Robot?
great starting for new one as i am