# Robotics/Print version

The current version of this book can be found at http://en.wikibooks.org/wiki/robotics .

# Introduction

Robotics can be described as the current pinnacle of technical development. Robotics is a confluence science using the continuing advancements of mechanical engineering, material science, sensor fabrication, manufacturing techniques, and advanced algorithms. The study and practice of robotics will expose a dabbler or professional to hundreds of different avenues of study. For some, the romanticism of robotics brings forth an almost magical curiosity of the world leading to creation of amazing machines. A journey of a lifetime awaits in robotics.

Robotics can be defined as the science or study of the technology primarily associated with the design, fabrication, theory, and application of robots. While other fields contribute the mathematics, the techniques, and the components, robotics creates the magical end product. The practical applications of robots drive development of robotics and drive advancements in other sciences in turn. Crafters and researchers in robotics study more than just robotics.

The promise of robotics is easy to describe but hard for the mind to grasp. Robots hold the promise of moving and transforming materials with the same elan and ease as a computer program transforms data. Today, robots mine minerals, assemble semi-processed materials into automobile components, and assemble those components into automobiles. On the immediate horizon are self-driving cars, robotics to handle household chores, and assemble specialized machines on demand. It is not unreasonable to imagine robots that are given some task, such as reclaim desert into photovoltaic cells and arable land, and left to make their own way. Then the promise of robotics exceeds the minds grasp.

In summary, robotics is the field related to science and technology primarily related to robotics. It stands tall by standing the accomplishments of many other fields of study.

## Defining Robots

Robot used in English describes any construct that automates some behavior. For example, a garage door opener automates the behavior of opening a door. A garage door opener has a sensor to detect the signal from the remote control, actuators to open the door, and a control system to stop turn off the motors and lights when the garage is fully closed. In practice, this type of a machine is better described as a Mechatronic device, and is a subset of the more interesting robots that include autonomy or resourcefulness. This book will consider mechatronic devices to be degenerate robots.

A Mechatronic Device is a degenerate robot with these components:

1. Sensors, which detect the state of the environment
2. Actuators, which modify the state of the environment
3. A Control System, which controls the actuators based on the environment as depicted by the sensors

A Robot is a mechatronic device which also includes resourcefulness or autonomy. A device with autonomy does its thing "on its own" without a human directly guiding it moment-by-moment. Some authors would contend that all mechatronic devices are robots, and that this book's restriction on robot entails only specialized software.

Various types of robots are usually classified by their capabilities. Two examples will be used to capture most of what we see as a "robot".

1. Machine Pet: A machine, capable of moving in some way, that can sense its surroundings and can act on what it senses autonomously. Most of these robots have no real useful purpose, other than to entertain and challenge. These are also commonly used for experimenting with sensors, artificial intelligence, actuators and more. Most of this book covers this type of robot.
2. Autonomous Machine: A machine with sensors and actuators that can do some sort of work "on its own". This includes things like robotic lawnmowers and vacuum cleaners, and also self-operating construction machines such as CNC cutters. Most industrial and commercial robots fall in this category.

What isn't considered a "robot" in this book? Pretty much everything you see on RobotWars; those are remote-controlled vehicles without any form of autonomy, no sensors, and just enough of a control system to drive the actuators. These devices use many of the same mechanical technologies described in this book, but not the advanced controls.

In short: If it has autonomy it's a robot (in this book). If it's remote controlled, it isn't.

## Student Questions

1. Which of these studies would be considered robotics by this definition?
1. Studying the strength and flexibility of a titanium alloy used to make a robotic arm?
2. Integrating sensor data from sonar, laser, and CCD cameras and to build an accurate map of surroundings?
3. The real-time software needed to drive two motors to make a robot go in a straight line?
2. Classify each of these as a robot, a mechatronic device, a machine, or something else?
1. A spam email filter.
2. A garage door opener.
3. A remote controlled boat.
4. A 1970s automobile.
5. A current model automobile which includes lane-following.
6. An Apple iPod.
7. An actor in a silver suit.
3. What is a sensor?

# Contributors

• CpE/EE 300: Introduction to Robotics class at the Missouri University of Science and Technology - Updates/Reworks to various pages
• T.R. Darr - responsible for the (almost) complete reformat. If I knew anything about robotics, then I'd have contributed to the content as well.
• J.D. Cox - Attempting to fill in certain areas with basic information.
• Omegatron - I've built a handful of short-lived little robots, and since then I went and got myself an electronics degree. I'll probably just add to and clarify things that other people have contributed. I tend to only contribute to things that are already active, so be active!
• Patrik - As time permits I'm adding more info I've found to be missing in many other sources. I've got a degree in electronics and I've designed and build several robots.
• E. Sumner - Active member of the Dallas Personal Robotics Group; Trying to flesh things out a bit here.
• Mr Dom - just added my two cents worth
• DavidCary - degree in electrical engineering. So in theory I ought to know :-).
• Magnus Persson - studying for Master of Science in Automation Engineering, added sections on PLCs and wireless communications.
• Piyoosh Mukhija - Degree in Electronics & Communication Engineering. Working on Autonomous Robotics Research at L&T Infotech. Attempting to fill in some missing things I believe I know about.
• S.J Manderson - Physics Student in New Zealand. Added sections on Electromagnetic Actuators and Pneumatics thus far.

# What you should know

Robotics spans multiple scientific and engineering disciplines, so when you want to design a better robot you should get some basic knowledge in these fields. How much you should learn depends on how complex you want to make your robot. To give an example: A small tethered tabletop robot would only require some basic knowledge in electronics and programming, a shoe box sized robot would require some additional knowledge on mechanics (mostly about balance) and a large robot might even require some knowledge on solid mechanics.

This page covers the fields that are very much used in robotics. You don't need to know everything about all of these subjects, however knowing the basics of each of these fields can help in building better robots and prevent you from making (some of the) beginner's mistakes.

## Mechanics

• how forces are transferred between the different parts of a construction.
• where the center of gravity lies.
• friction
• position, speed, acceleration
• Newton's laws
• inertia
• material properties

Mechanics helps keeping a robot in balance. Although you could build a robot without knowing anything about mechanics, it'll help in preventing your robot from tipping over when turning, or when picking up something.

Another point where mechanics pays off are axles. On small robots you can attach the wheels directly to the output shaft of the motor. However this doesn't work well for larger robots as this puts a lot of stress on the internals of the motor. A better way is to attach the wheel to an axle, and use gears to connect the motor to the axle. Knowledge of mechanics allows you to build such constructs.

If your robot is a small line follower almost any building material will work. However if your robot weighs a few kilos, something sturdier than cardboard and soda sippers is appropriate. And if your robot is human size you should consider metal and/or composite construction.

See Theoretical Mechanics for an introduction in this field.

the "Theoretical Mechanics" is just started, so there isn't much to read just yet.

## Electronics

• Electronic Components
• Analog Circuits
• Digital Logic
• MicroControllers

Electronics is something you can't go without (unless you want to build a complete mechanical robot or use pneumatics for control). Today there are plenty of books covering basic electronics (See Electronics).

## Programming

• Control structures (sequence, selection, iteration)
• Data types (constants, variables, integer, real, string,...)
• Algorithms
• Hardware control (setting and reading registers, interrupts,...)
• logic

Anyone who has had an introductory course on programming (as they are given in American high schools) would be familiar with the first three points. The fourth point is rarely addressed in introductory courses, but is essential when programming microcontrollers. Although it might sound difficult, it can be very easy in practice (for most purposes). Much of this comes down to setting bits in a byte using simple Boolean logic, and writing this value into some register or memory location. Higher level languages like Bascom provide hardware addressing as special variables, which can be treated just like any other variable.

Microcontrollers (and processor boards) are one of the areas where using Assembly is still very valid. Memory (both RAM and program space) is very limited in these, although each new generation of microcontroller has more memory for about the same price. Many microcontrollers provide between 2K and 30K, and processor boards tend to have up to 256K. These numbers vary wildly, but are still significantly less than PCs have. However if you don't know an assembly language, most microcontroller and processor boards have high level language compilers available in many flavors (C, C++, Basic, Pascal, Fortran, etc.)

• The Event Loop. Most microcontrollers do not have the resources for threading. You will need to look at your robot's task a fraction of a second at a time, and choose which small action to take. What can the program do in that moment to get a little bit closer to its goal?
• Interpreting sensor data. Sensors have many ways of providing noisy or misleading information; how many types of error can you accept? Dirt in a rheostat, a broken switch, and a venetian blind flickering on a photodiode are obvious faults. How about temperature drift, non-linear response curves, or your robot seeing its own shadow?
• Decision making, or Artificial Intelligence is the art of making the right decision given the constraints of the current system.
• Motors and motion. Making motion on a robot often involves moving several motors at once, often with feedback from sensors.

## Solid Mechanics

Solid mechanics is about how forces distribute inside solid materials. Knowledge about this subject is useful because it explains how materials respond to loads. This helps to prevent using too thick or too thin materials. This isn't required for small or medium robots, but it allows to be more efficient with building materials and gives insight to why and how materials fail (break and/or deform). See [this wikibook] for a start on solid mechanics. Be warned: heavy math ahead.

Even if you have a mortal fear of math, bite through this as it gives valuable insights on how materials break and deform. No need to memorize the math, as long as you get the idea behind it.

## A.I.

Artificial Intelligence (in Robotics) is about:

• Finding the shortest way between 2,3 (or more) points
• Dealing with obstacles
• Handling new situations (machine learning)

There are many books available on AI on many different levels. This area has had a short but already fruitful history, but still has a very long way to go. AI isn't just about getting a computer to think and reason. It's more about ordering, sorting and organizing knowledge in a machine and constructing algorithms for extracting real world conclusions from these databases. A search engine like Google or Yahoo are examples of real uses of AI.

Other than pure AI books, books on how the brain works and such can provide interesting angles to AI on robots. Concepts like attention and concentration can have interesting uses in some form for integrating sensor data.

## Math

Although math is generally seen as the ultimate theoretical science, it can be one of the most important skills in many of the more advanced domains of robotics. e.g. Mechanics uses a lot of math. For simple constructs you won't need much more than high school level math, for more complicated shapes it becomes necessary to use more complex math tools like integrals. But since robotics is a very practical craft many things can be done with approximations. Math however can be very helpful in making the right approximation.

# Physical Design

## General Design Considerations

Designing a robot requires balance between size (mostly weight), motor power and battery power. These three elements are connected with each other (more battery power increases the weight of the robot and requires stronger motors) and finding the "perfect" balance requires a lot of tweaking and experimenting. Try to describe heavy components in output/mass (e.g. motors: torque/Kg; batteries: mAh/Kg) and pick the one that gives the highest value.

Using light materials brings down the weight significantly (aluminum instead of steel). Building a frame out of light metal and using plastic plates as surfaces would be a lot lighter than using metal plates. For small robots acrylic plastic is a good material to use and it is easy to work with.

There are other ways to build a robot than to cut and drill your own aluminum plates. Toys like Lego Technic and Meccano, although expensive, are an alternative when you don't have the ability to cut and drill your own parts. Especially Meccano (or better: the cheap imitations) can be useful even when you do make your own parts. There is something convenient about having a collection of parts with standard holes and sizes. Of course you would need to drill your own holes at the right distances and size, if you intend to add Meccano parts. The values can (most likely will) differ between different "brands" of imitations. So it's a good idea to buy a few boxes when they are on sale. Screws tend to be M5 (on the set I've seen so far this is the only value that is common. The hole spacing very rarely matches up).

Another kit that would be good to use is the Vex™ Robotic Design Kit from Radio Shack. The parts in this kit are all metal with holes predrilled every half an inch. That makes it easier to add to parts that you may already have. This kit gives you everything you need to get started with robots. If you do not want to buy the kit you could just buy the Vex™ Metal and Hardware Kit for Robotics Starter Kit.

When you start your design, first decide how big you want your robot to be. Don't think about exact sizes, compare it to the size of an object ("the size of a shoe box") will be sufficient. Exact values can be "calculated" after you've got your motors and batteries, as these have a large influence on the size and shape of the robot.

Make an estimate about the weight of the complete robot and pick your motors and wheels. Keep in mind you need high torque and low speed. A bare DC-motor has high speed and low torque, adding a gear reduction will solve this one. Motors with reduction gears are also available. The speed of your motor and the size of your wheels determine how fast your robot will be able to move.

For example: RB-35 is a motor with a 1:50 reduction. It makes 120 RPM or 2 rounds per second. Lets pick a wheel with a diameter of 20cm (radius R = 10cm). This wheel has a circumference of 2 x ${\displaystyle \pi }$ x R = 2 x 3.14 x 10 = 62.8cm. This means in one turn the wheel moves 62.8cm. When we mount this wheel on the motor it'll turn twice every second and therefore move 2 x 62.8cm = 125.6cm. So its speed would be 125.6cm/second or 1.256m/s.

In reality this speed is going to be a little lower as the motor turns 120RPM without a load. But even a 1 m/s is pretty fast for indoor robots. You'll probably use PWM or other methods to slow it down.

Pick your batteries. Make sure you have enough power to keep the motors and all the electronics running for a sufficient amount of time and keep some reserve for future additions. Compare the weight of the batteries and motors you've chosen to what you had planned. You might need to go over this part again (picking different motors and/or batteries).Keep in mind that your robot's body has a significant weight.

## Platforms

### Wheeled Platforms

Wheeled platforms can have any number of wheels. Most common are 3, 4 and 6 wheeled vehicles (excluding wheels used for feedback). Other numbers are also possible, but can be hard to build, such as 1-wheeled or 2-wheeled robots, or have superfluous wheels which can make turning difficult or complex. Basically there are 2 types of wheels: powered wheels and unpowered wheels. The first are powered by the motors and are used to move the robot forwards (or backwards). Unpowered wheels are used to keep the robot in balance by providing a point of contact with the ground.

#### Turning

Turning can be accomplished in several different ways:

• Differential Steering (Tank-like Turning):
• Moves one wheel forward and the other backwards. The robot turns around within a small circle which center lies in between the 2 powered wheels.
• Move one wheel slower than the other, the robot turns in the direction of the slower wheel. How fast it turns depends on how large the difference between the 2 speeds is.
• Ackerman Steering: This is the same steering system as the one used in cars. It is relatively complicated to implement since the inner and outer wheels need to turn to different angles.
• Crab Drive: Each wheel can turn independently in crab drive steering. This can be very flexible, but requires complex mechanics which either turn the entire motor/gearbox/wheel assembly or transfer power from a statically mounted motor. The second option is much more difficult to build but may have advantages over the first.
• 3-wheeled platforms: These can come in a variety of forms, with the articulated wheel powered, or with the two fixed wheels powered, or a combination of the two. These are generally built for very specific purposes.
• Omnidirectional wheels: The omnidirectional wheels design is based upon the use of a series of free turning barrel-shaped rollers, which are mounted in a staggered pattern around the periphery of a larger diameter main wheel. For this you need 4 powered wheels. However these wheels allow movement in any direction without turning (including sideways and diagonal movement) and can turn the same way as in tanklike steering. Building these wheels is time-consuming, but it's a very powerful steering method. Also, inexpensive omnidirectional wheels are available commercially, often used in conveyors. One drawback, however, is the lack of sideways traction; if something is pushing the robot to the side, it relies on the strength of the motor or brakes to restrain it. Omnidirectional wheels used in place of caster wheels can provide quicker responses and can often roll over larger obstacles.

### Tracked Platforms

Tracked platforms use tracks similar to tanks. This kind of propulsion is only useful on loose sand and mud, as concrete and carpet provide too much horizontal traction when turning and will strip the tracks off of their guides.

### Walkers

Walkers are robots that use legs instead of wheels or tracks. These robots are harder to build than wheeled robots and can be a nice challenge for an experienced builder. Walkers are designed to imitate how animals (or humans) move.

#### 2-Legged Walkers or Bipeds

This is the hardest type of walker. This type tries to imitate how humans walk. The biggest issue is balance.

Two-legged walkers are used for two main purposes: to imitate humans and to provide a great amount of force and traction. Taller walkers used to imitate humans are difficult to build, requiring many balancing circuits and devices, quick motions, and precise construction. Just like any human knows, these can also be knocked over, tripped, etc. Shorter, wider walkers can be used to move a large load. When using walkers, it is possible to use pneumatic systems, which can provide a much larger force than motors. However, turning with such a system is nearly impossible.

#### 4-Legged Walkers

4 Legged walkers imitate 4 legged animals. Many of these designs end up moving one leg at a time, instead of the 2-legged movements typical of animals. It requires 3 legs to be on the ground to provide static balance. Dynamic balance moving 2 legs at a time provides faster and more fluid motion.

#### 6-Legged Walkers or Hexapods

These walkers are imitations of insects. Many of these move 3-legs-at-a-time to provide static balance. Because half of the legs can be moved at one time without losing static balance, 6-legged walkers can actually be simpler to build than 4-legged.

Note: Static balance means the construction is at all time in balance. This means that if the robot would stop moving at any time it wouldn't fall over. In contrast there is Dynamic Balance. This means that the robot is only in balance when it completes its step. If it's stopped in the middle of its step it would fall over. Although this might sound like a bad thing, dynamic balance allows much faster and smoother movement, but requires sensors to sense balance. Animals and humans move with dynamic balance.

### Whegs

There are various combinations of wheels and legs that are useful for varying terrain. For quick details see [5].

### Ball Wheels

This means of propulsion is very similar to how a classic computer mouse works: A ball is mounted in a casing in such a way that it can freely rotate in any direction. Two wheels around the ball are mounted against this ball at an angle of 90° to each other, parallel to the ground. One wheel registers the up-down movements and the other the left-right movements.

A ball wheel uses the same setup but connects the internal wheels to motors. This way the ball can be made to rotate in any direction. A robot equipped with a ball wheel can move up-down and left-right, but can't rotate around its vertical axis. Using 3 ball wheels allows rotation as well.

## Electronics

The electronics of a robot generally fall in 6 categories:

• Motor control: controls the movement of the motors, servos and such. Relays and PWM H-bridges fall under this category.
• Sensor reading: reads the sensors and provides this information to the controller.
• Communication: Provides a link between controller and an external PC, another robot, or a remote control.
• Controller: microcontroller board, processor board or logic board. This part makes decisions based on sensor input and the robot's program.
• Power management: parts that provide a fixed 5VDC, 12VDC or any other level coming from the batteries. Circuits that monitor the status of the batteries.
• Glue logic: Additional electronics that allow all the parts to be connected with each other. An example is a CMOS to TTL level converter.

Not all of these categories are present in all robots, nor does every circuit fall completely into one category. Many robots don't require a separate sensor board as a whole lot of sensors have built-in electronics which allow them to connect directly to a µcontroller/processor.

### Some Tips

• Use low-power (or simply dimmer) LEDs. Always. This drastically reduces how much current your circuits consume. A normal LED consumes around 15 mA. A modern microcontroller consumes about the same. Disabling unneeded LEDs is advisable, but not always possible.
• Use CMOS ICs instead of classic TTL. Again this reduces current usage and allows a more relaxed supply voltage. But pay attention to their sensitivity for static electricity when soldering them.
• Use good quality IC-sockets (or better don't use IC-sockets at all). They're worth their price.
• Avoid using IC-sockets on sensitive circuits (high speed digital, clock signal and analog signals). The moving robot can shake those ICs loose over time. Using In-Circuit programmable microcontrollers removes the need to be able to unplug an IC.
• LEDs are very practical to make slow digital signals visible, adding them on some signal lines can be interesting for testing purposes, however, they do increase power consumption. Removing them when your circuit works correctly can make it more power efficient (replace LED with a wire, replace resistor with a higher value one).
• See if your microcontrollers can run with a lower clock speed. The higher the clock speed, the more they consume.
• Use your microcontrollers sleep functions whenever possible, disable any part that isn't required (e.g. on-chip ADC).
• Learn to make PCBs (Printed Circuit Boards). It's not that hard and it makes your electronics look more professional. Don't throw away your breadboard, PCBs aren't very practical for prototyping.
• If you're up to it: build your circuits in SMD components on PCBs. This reduces size, weight, and cost. However soldering SMD ICs isn't easy. SO-packages (Small Outline) aren't too hard for an experienced builder. Smaller packages are almost impossible to do by hand. Get good soldering tools before you attempt this. For many modern SMD microcontrollers are complete build and tested board available. These can be a solution for those who don't have the equipment, expertise and patience to solder these ICs themselves. These boards don't have to be large as the demo-boards most IC developers sell, e.g. the BasicStamp is such a board with the size of an IC.
• If you intent to build your own electronic circuits, invest in a dual channel oscilloscope. Single channel is very restricting. Pick one with as high a bandwidth as you can afford. At least 4x the highest signal frequency you intend to use.
• A good variable power supply is very handy to test how your circuit operates at lower voltage levels (as happens when the batteries discharge).
• If you can choose between pull-up and pull-down resistors, pick the one that uses the lowest amount of power. If the circuits output is at +5V most of the time, use pull-up, if it's 0V use pull-down. Remember that such outputs consume power when the transistor is active (when it's inactive it consumes a small amount of power: a leak current through the resistor and through the input impedance of the next circuit).
• Use high value resistors as pull-up/pull-down. But keep in mind that high speed signal lines need lower value resistor in order to minimize signal distortion.
• Most electronic components on a robot will run on a 5V supply and need a 5V regulator. Use a regulator with low dropout to prevent the 5V supply from browning out.

## Display

Very simple robots need only a few LEDs to show everything that it is "thinking".

When trying to debug more complex robot software, it is useful for the robot to display text. A few calculators and PDAs have a RS232 connector or some other simple way to connect to a robot.

Many robots have such a calculator or PDA or other display strapped to the top in order to show the humans what the microcontroller is "thinking", which is vastly more productive than trying to guess what's going on inside that little chip of silicon.

With large robots, sometimes a full-size laptop computer is strapped on top for such display purposes.

## Mechanical Design

### Balance

Everybody encounters balance every day. While walking, when putting down a glass of water or in so many other ways we have to keep a balance. Now in most of these cases you wouldn't need to think about it, but when designing your robot you'll have to keep an eye on this concept. For most designs, balance isn't hard to achieve, even without doing calculations on it. A few rules of thumb suffice. For more complex designs, e.g. a robot with an arm, you can get away with just some rules of thumb and some common sense, but there's no guarantee. Doing a simple calculation would make it clear if the robot is going to stay on its wheels or if it is going to tumble over and crush whatever it was trying to pick up.

If you're into walkers, you'll need to spend more attention to balance. The fewer amount of legs you have, the more important balance becomes.

### Simple 4-Wheeled Robots

Achieving balance on this type of robot is pretty trivial. Keep the center of mass between the wheels (picture a rectangle between the centers of the wheels) and as low as possible. In practice it mean you should place the heavy components, e.g. the batteries, somewhat in the center of the robot and as low as possible.

### Simple 3-Wheeled Robots

These designs are nearly as simple as 4-wheeled robots; the difference lies in that you need to keep the center of mass close to the center of the triangle formed by the wheels. If your robot is rectangular avoid placing weight at the two unsupported corners. These points are prone to making the robot tumble over.

### Wheeled robots with an arm or gripper

For the working of an arm or a gripper, we need to take the help of a stepper motor in simple cases or use sensors in sophisticated cases.

# Design software

Robotics: Design Basics: Design software

When designing your robot there are plenty of programs to help. Ranging from a simple tool to print wheel encoders, through CAD drawing programs up to mechanical simulation programs.

e.g. AutoCAD. This type of software is used to turn a rough sketch into a nice professional drawing. This type of drawing is standardized for readability. (Meaning every different type of line has a particular meaning. Solid lines are visible edges, dashed lines are hidden edges, line-dash-line lines are center lines. Standards also include methods of dimensioning and types of views presented in a drawing.) Of course you're free to use your own standards, but using an industrial standard, such as ANSI or ISO, makes it easier to share your plans with other people around the world. While it may somewhat more tedious to make a drawing using 2D software, the results are generally better than using 3D solid modeling software. Solid modelers still have problems translating 3D models into 2D drawings and adding proper notation to standards.

## Solid Modeling

First

e.g. SolidWorks or Pro/Engineer Pro/Engineer (Wikipedia:Pro/ENGINEER). A newer way to draw parts and machines. With solid modeling you "build" the parts in 3D, put them together in an assembly and then let the software generate the 2D drawings (sounds harder than it is). The major advantage over 2D CAD programs is you can see the complete part/machine without actually building it in real life. Mistakes are easily found and corrected in the model. These 3D models are not yet completely standardized though there is a standard for digital data. At this time the 2D drawings this software generates do not conform completely to industrial standards. The 2D paper drawing is still the communication tool of preference in industry and clarity of intent is very important. Solid modeling software tend to generate overly complex drawing views with overly simplified dimensioning methods that likely do not correctly convey the fit, form or function of the part or assembly.

## Pneumatic & Hydraulic Simulation

Festo has a demo version of both a pneumatic and a hydraulic simulation program. Look for FluidSIM Pneumatiek and FluidSIM Hydraulica. (Pick country; click on industrial automatisation; and use the search field to the right.)
Limitations: Can't save nor print. Most of the didactic material isn't included.

IRAI has a free demonstration version of electric / pneumatic and hydraulic simulation software : AUTOMGEN / AUTOMSIM. Go to Download / AUTOMGEN7.

## Schematic Capture & PCB

Software to draw electronics schematics and designing Printed Circuit Boards (PCBs). These packages contain software to draw the schematic, libraries with symbols, and software to draw the PCBs (with autorouter).

In no particular order:

• Freeware: Eagle is commonly used by beginners for their projects because a limited version is available for free. The toolset is well integrated and has a large hobbiest user base. However, once you progress beyond basic designs, you need to pay for the full version.
• Open Source: The open-source gEDA Project has produced a mature suite of applications for electronics design, including: a schematic capture program, attribute manager, netlister supporting over 20 netlist formats, analog and digital simulation, PCB layout with autorouter, and Gerber viewer. The project was started in 1997 to write EDA tools useful for personal robotics projects, but as of this writing the tools are also used by hobbiests, students, educators, and professionals for many different design tasks. The suite runs best on Linux and OSX, although Windows ports of some apps have been made.
• Open Source: Free PCB is a mature Windows only open source PCB drafting tool.

## µControllers

### Programming Languages

There are many different programming languages available for µControllers:

• Assembly: Every µcontroller can be programmed in Assembly. However the differences between µcontrollers can be huge. Assembly gives you the most power of the µcontroller but this power comes with a price: Hard to learn and (almost)no code reuse.
Assembly code is in essence translated machine code. It provides only the instruction set of the processor: add, subtract, maybe multiply, move data between registers and/or memory, conditional jumps. No loops, complex selection or build in I/O as in C/C++, Basic, Pascal, ...
The disadvantage is that you have to implement everything yourself (lots of work even for the most simple programs).
The advantage is that you have to implement everything yourself (programs can be written extremely efficient both in speed and size).
This language is intended for advanced users and is usually only used as an optimisation for code in tight loops or for pushing the performance of a limited device to the edge of its abilities.

Reasons to learn it:
• Teaches you how the computer works on its lowest level.
• Provides high speed code which consumes little memory.

Reasons to avoid it:
• Limited use.
• Non-portable.
• very hard to master.
Freeware: AVR
• C: C offers power but is much more portable than Assembly. For most µcontrollers there is a C compiler available. The differences between µcontrollers is smaller here, except for using hardware.
Learning C is much easier than learning Assembly, still C isn't an easy language to learn from scratch. However these days there are very good books available on this subject.
• Basic: For many µcontrollers there are special flavours of Basic available. This is the easiest and fastest way to code µcontrollers, however you'll have to sacrifice some power. Still modern basic compilers can produce very impressive code.
• Limited Freeware/payware:Bascom AVR Very good Basic compiler for AVR. Limited to 4Kb programs. There is also a version available for the 8051 µcontrollers.
• Limited Freeware/payware:XCSB PIC Basic compiler. Lite version. No 32-bit integer and floating point support. (OS/2 WARP, Win95, Win98, Win2K, XP and Linux)
• Forth:
• PFAVR (GPL) Needs external RAM.
• ByteForth Dutch and works without external RAM, there is also a building book (Dutch only for now) available for Ushi our robotic project.
• Python

### Programmers

After you've written your program, you need to get it into your µcontroller. If you use C or Basic you'll have to compile it. Then use a programmer to upload the code into the µcontroller. There are several different methods for this last step.

• External programmers: This is a device that's connected to a PC. You'll plug the µcontroller IC, EEPROM or other memory IC in its socket and let the PC upload the code. Afterwards you plug the IC in its circuit and test it. Can be time consuming when updating your program after debugging.
• ISP In System Programming: The board with the µcontroller has a special connector to connect to a PC. Hook up the cable, download code, test and repeat. More modern method. Only disadvantage: it consumes some boardspace. Not all µcontrollers support this.
• Bootloader, also called "self-programming": The CPU accepts a new program through any available connection to a PC (no special connector needed), then programs itself. Not all µcontrollers support this. And you also need some other programming method, to get the initial bootloader programmed in (telling it exactly which connector to watch for a new program, the baud rate, etc.).

### Debuggers

Modern µcontrollers have on-chip debug hardware called w:JTAG.

## Various tools

See This site for:

• The Motion Applet – Path modeling for the differential steering system of robot locomotion.
• The Encoder Designer – A design tool for encoder wheel patterns. (Wikipedia:Rotary encoder)
• RP1 – A mobile-robot simulator.
• Map Viewer – A Mapping Tool For Mobile Robotics.

And "Experimental Robotics Framework" for rapid prototyping of robotics algorithms.[1]

# Tools and Equipment

You can't build a robot without at least a few tools. This page will cover some of the tools and equipment that'll be useful.

## Mechanical Tools

For building your robot you'll need some tools to form the body.

1. Small vise: you'll need this.
2. Hammer: A hammer is one of the standard tools you'll need.
3. Screwdrivers & Wrenches: their uses are obvious. Two spanners of equal size are required for locknutting.
4. Saw: Metal and wood saws. Miter saws can be very handy, but are pretty expensive. A miter box might suffice for many purposes.
5. Square, measuring tape, scriber and other marking out tools.
6. Vernier calipers: Allow very accurate marking out and measurement. Also can be used to check thread pitch on machine screws without a dedicated pitch gauge.
7. Files: especially when working with metal, as rough metal edges are sharp.
8. Centre Punch: Essential for accurate drilling of holes in metal to prevent the drill skating over the surface.
9. Drill Press: (small table top versions suffice) is very handy for drilling accurate holes. Can also provide the low speeds for drilling large holes in metal, which hand drills cannot do easily.
10. Hobby Tool: Useful for many purposes.
11. Sharp utility knifes: Mostly used when working with plastics.
12. Hot glue guns: handy for quickly mounting parts. Not too strong bound, but useful for many applications.
13. Arc Welder: Only useful when working with thick steel on large projects (use a gas welding torch for thin metal;arc welders tend to burn holes right through the workpiece). Aluminium cannot be welded with ordinary welders. (Unless you have a MIG/MAG or TIG welder available)
14. Paint stripper/Electric Heat Gun: like a hairdryer on steroids. Useful for bending plastics, also applying heat-shrink tubing to electric cables at low power.
15. Safety Goggles: You only get one pair of eyes, and machine tools are potentially dangerous. Safety goggles are essential for using anything other than hand tools.

## Electronic Tools

### Soldering iron

The soldering iron is a very useful tool for assembling electronic circuits and connecting copper wires together.

For electronic circuits you'll need a light soldering iron (~25W) with a small point (shaped like a pencil point). Especially SMD components require small points (or even better: special SMD soldering points).
Soldering electronic components is done with "soft soldering": with a low temperature (less than 300°C). Usually for electronics the melting point of the solder lays around 238°C. When buying solder choose for a solder wire (60% lead, 40% tin) with non-corrosive flux. (There is also "eutectic solder" - 63% lead, 37% tin, which transitions from liquid to solid immediately, with no plastic state in between.) Take the thinnest wire you can find (<=1mm).

See this page for an in depth explanation of soldering electronic components.

For connecting metal wires you'll need something more powerful (30W-100W) like a soldering pistol, but an ordinary soldering iron would do just as well. Note: not all materials are as good to solder. Copper is easy to solder and has a reasonable strong bond. Aluminum has a weak bond.

For stronger connections it's better to braze instead of soft soldering. Brazing involves higher temperatures (typical between 450°C and 1000°C) and different flux ("Borax") and solder (copper and zinc or silver alloys) it also requires a welding torch instead of a soldering iron.
see this online book for more in depth information on brazing.

If you need even more strength you could use welding. However welding is only used for heavy materials like steel alloys and these are in most cases too heavy to be used in robots (unless you're building a very big or industrial robot). Aluminum can be welded but it isn't as simple as welding steel alloys.
See this site for basic welding information.

The boards allow you to build a temporary circuit in no time. Especially handy for testing new circuits. Connections are made with either ordinary thin stiff wire with the insulation removed at the ends or with special breadboard wires with stronger tips. Wires with crocodile clamps are needed for hooking up signal generator, oscilloscope, DMM, etc. Larger boards have connectors (typically banana plugs) for the power supply.

There are small breadboards with an adhesive strip at the bottom. These can be mounted on an empty part of a microcontroller board and can be used to build small circuits.

• Note: when you build a sensitive analog circuit on a breadboard, it can behave differently than when it's build as a PCB. This is because of parasitic components: the wires connecting the components on the board act as a combination of a resistor, capacitor and coil (all with very low values). Keep in mind that in some circumstances this can affect the working of a circuit. Usually this is only a problem when working with low amplitudes and/or high frequencies.

## Electronic Equipment

Digital Multimeter
• Multimeter: measures voltage, current & resistance. Many can measure transistor and diode characteristics, frequency and capacity. Some can measure temperature or light intensity.
• Note: measuring voltage and current of a AC source isn't as simple as measuring DC levels. But since robots rarely use AC this would be out of the scope of this text. But if you would require to measure AC levels you should read up on this.
• Oscilloscope: makes a electric signal visible. Very useful when working with more complicated electronic circuits, especially analog signals and data communication. Oscilloscopes exist as stand-alone devices or as add-on modules for PCs. The latter provides extra abilities like spectrum analysing and recording of signals.
• Variable power supplies: power supplies with variable output. Either AC or DC. Either the output voltage or current can be regulated, although most power supplies let you set a max current.
• Signal generators: generates different shapes of signals (sine, square, saw and triangle), with variable frequency (1Hz up to 100MHz) and amplitude.
• Logic probe: pen-like devices that detect logic levels (either TTL or CMOS). Most can detect pulse signals. Very handy when working with digital electronic circuits.
• Frequency meters: measures the frequency of a signal. Can also be used as a pulse counter. Oscilloscopes can be used for measuring frequency, and storage scopes can freeze a waveform onscreen allowing pulses to be manually counted, but frequency meters are a good investment if this needs to be done very often.
• LEDs: An underrated test device for digital circuits. LEDs are far better than voltmeters for digital circuits in some situations, as you can see many input and output values concurrently, without connecting a multitude of voltmeters or constantly checking everything with a logic probe. In particular, they can instantly show the status of several logic signals simultaneously, impossible with a logic probe. Good breadboard building practice also includes an LED for each breadboard to show it is powered up correctly - this can help avoid the potentially frustrating situation of faultfinding a logic circuit that is actually sound, but has an intermittent or noisy power supply. It's also an excellent indicator if a component is short-circuiting at any time during operation, as the LED will likely dim or go out.

## Connectors

### Insulation Displacement Connectors (IDC)

Assembling parallel ribbon cables from ribbon and the IDC connectors:

Practical tips:

1. Note that IDC ribbon cable is usually not provided with multicoloured or ‘rainbow’ insulation, but with single-colour insulation — usually grey or white. However it also has a stripe of coloured ink or paint (red or black) down one side, to guide you with connector orientation. If you need to strip away some of the wires of a multi-way cable to suit the IDC

connectors you’re using, remove them from the side furthest from the ink stripe so it’s still present on the cable.

1. It’s usual to fit IDC connectors to the cable so their pin 1 end is on the stripe side of the ribbon. This also

helps guide you when you’re mating the cable connectors with those on the equipment, knowing that the stripe corresponds with pin 1.

1. Before clamping an IDC connector to a ribbon cable, make sure that the cable grooves are aligned with the contact jaw tips and that they are also aligned with the scallops moulded into the underside of the clamping strip.
2. Make sure too that the connector pin/jaw axis is as close as possible to 90° with respect to the ribbon cable wire axes. If the connector/ribbon angle is not close to 90°, some connections may not be made properly. If the connector is being fitted at the end of a ribbon cable, cutting the end of the ribbon cleanly square first will allow you to use it as a guide.
3. Try to squeeze the IDC connector and its clamping strip together as evenly as possible, so they remain as close as possible to parallel with each other during the operation. This too ensures that all joints are made correctly. The easiest way to squeeze them together evenly is by using a small machine vice or a special compound-action clamping tool.
4. If an IDC connector has a second cable clamping strip, don’t attempt to fit this as part of the main assembly. Assemble the main parts of the connector first on the ribbon cable, and only then fit the second clamping strip.
5. When you are bending the ribbon cable around before fitting the second clamping strip, don’t pull it hard. This may loosen some of the connections inside the IDC connector. Just bend the ribbon around gently — a small amount of slack won’t do any harm, and may in fact protect the IDC connections from strain.

Properly-assembled IDC connector illustration:

Practical uses:

A common IDC cable in use is an IDC D9 socket to IDC 2 by 5 header socket. This cable is often used to connect a PC serial (RS232) port to a microcontroller development board. On the board there will be a 2 by 5 pin header.

### RJ45 network connector

RJ45 Connector

These are the connectors used on UTP network cables. A smaller version (RJ11) is used for telephones. You need a crimping tool to attach the connector to the cable. These connectors are very useful for hooking up different PCB with each other. A good use for RJ45 connectors is for making serial (RS232) programming cables for small embedded systems (many credit card terminals use a DB9 to RJ45 cable to download software from a PC during development). If you are building small embedded controller boards an RJ45 can be a handy connector size to use.

# Electronic Components

## Basic Electronics

For basic electronics you may want to consult this wikibook and this section on Microcontrollers.

## Special Electronic Components

There are many electronic components that aren't described in most electronic textbooks, but are very useful in robotics. Most of these components are covered in other section in this book (e.g Sensors and Motors).

A typical robot needs a heat sink on the power transistors connected to its motors and other actuators, but often does not need a heatsink connected to its CPU.

# Mechanical Components

Robotics: Design Basics: Mechanical Components

## Gears

Gears are mechanical parts with cut teeth designed to mesh with teeth on another part so as to transmit or receive force and motion. The cut teeth are also sometimes called cogs. In Robotics Gears are used to transfer rotational forces between axles. They can change speed and direction. The axles can stand in any orientation, however not all orientation can be done with 2 gears. Commonly gears are used to reduce the speed of a motor. When they reduce the speed, the torque of the output axle increases.

Common types of gears as used in Robots are explored below. Each type of gear is used for different purposes and it has both advantages and disadvantages.

See this Wikipedia article on gears. This page will cover how each gear is used specifically in robotics.

### Spur gear

Spur gears found on a piece of farm equipment

Spur gears are the best known gears. These are the simplest form of gears and are commonly used in light machines as bikes, mixers, etc,...
They aren't used in cars as they are very noisy and their design puts a lot of stress on the teeth.

You might use them to transfer rotation from a motor output shaft (coming directly from the motor or from the gear box) to the axle on which the wheels are attached. This poses a limitation: the motor output axle and the wheel axle have to be parallel.

### Bevelled gear

Bevelled gears are used when you wish to transfer work between two perpendicular shafts that are on the same plane (if the axles were to be extended they would hit). They can have straight, spiral or hypoid teeth.

### Worm Gear

This is a gear that resembles a screw, with parallel helical teeth, and mates with a normal spur gear. The worm is in most cases the driving gear, there are however a few exceptions where the spur gear drives the worm. The worm gear can achieve a higher gear ratio than spur gears of a comparable size. Designed properly, a built in safety feature can be obtained: This gear style will self-lock if power is lost to the drive (worm) however this feature doesn't work if the pinion is powered.

An Example of a Worm Gear and Pinion

### Rack and Pinion

Torque can be converted to linear force by a rack and pinion. The pinion is a spur gear, and meshes with a toothed bar or rod that can be thought of as a sector gear with an infinitely large radius of curvature. Such a mechanism is used in automobiles to convert the rotation of the steering wheel into the left-to-right motion of the tie rod(s).

## Chains & Belts

Chains and belts can be used to transfer rotational motion over a longer distance. The main difference between the two, lays in the fact that a belt can slip. This is not necessarily a bad thing as slipping occurs when the output shaft carries a load that is too heavy. In this case the belt slips instead of the motor being stalled. This protects the motor as it could otherwise be damaged by the stall current.
The disadvantage of belts is that since it can slip, the amount of rotation doesn't remain the same, e.g., the input axle may turn 4 times, while the output axle may turn only 3.8 times. This should be taken into account if the position of the output axle is important.

# Building Materials

Robotics: Design Basics: Building Materials

There is plenty of choice when it comes to picking the building materials for your robot. However not every material is a good choice.

There are three groups of materials. Each of these three groups have their own characteristics, possibilities and difficulties.

Note: There is a fourth group of materials called ceramics. However this group is only marginally useful for robotics.

Note In this book robot sizes are mentioned as small, medium and large. With small I mean any robot that can maneuver on a table. Medium means any robot that's too large to move on a table but still is light enough to lift on your own. Large mean anything bigger and heavier than that. Also robots that'll have to operate in real life (rough) condition should be counted as either medium or large.

## OWoodO

Wood is probably the best material to start with. It's light, pretty strong and easy to work on. Not to mention cheap and easily available.
Even if you intend to use metal or plastic, wood can be handy for various purposes like prototyping and building jigs and other aids in working on metal or plastic parts.
The main reason that you will not see many wooden robots is because wood doesn't seem to fit in the picture of high tech machines. Funny thing is that (synthetic) composite materials have a very high coolness-factor (e.g Kevlar® Yes, Kevlar is a brand name. It's made of Aramide), yet wood, a natural composite material, hasn't.

• Useful for small or medium sized robots, prototyping and as construction aid.

## Metal

There are 80 different pure metals each having different properties. However in the world of Robotics there are only a select few from the 80 that are useful. This list is increased by Alloying. Alloying is the process of combining either in solution or compound, two or more elements, at least one of which is a metal, and where the resulting material has metallic properties. The resulting metallic substance has different properties (sometimes significantly different) from those of its components.The properties of some metals and their alloys are below.

Some alloys are limited in supply in the market due to the limited demand for them. In order to obtain these materials it is often required to look further than the general consumer market.

### Aluminum

Aluminium (or aluminum, both are correct) is commonly available in extruded forms in different shapes. It's pretty cheap, light, strong, resistant to corrosion and easy to work with. However welding aluminum isn't practical as it needs special welding equipment (MIG/MAG or TIG welding) and the bond isn't very strong. While soldering is possible, it doesn't make a strong bond. Rather use nuts and bolts or rivets.

• Useful for small or medium sized robots.
• Useful for non-load bearing parts in large robots.
• Not very good for bearings.

There is an alloy of aluminium called Duraluminium it is almost as strong as soft steel but very light thus making it a natural choice for the construction of Aircraft. However as a trade off for the combination of being strong and light it is quite expensive (if you can find it at all). The best bet is to search aircraft wrecking yards.

### Steel

Commonly available steel is an alloy of iron. It's stronger than aluminum, but it's also heavier and harder to work with - in particular, it blunts tools more easily and swarf is always razor sharp. Welding isn't much of a problem. However heating steel (at welding temperatures) changes its characteristics (strength, hardness, rust resistance). Note that drilling steel requires cooling and a slow drill speed (both rotational and feeding). If you drill too fast, you'll see your drill heating up red hot. Drills that have been red hot lose their hardness and will be dull in no time.

• Useful for small
robots and robots intended to operate in rough conditions. Too heavy for small or medium sized robots.


### Bronze

Heavy. Very good for bearings. Too expensive and heavy for most other purposes. Yasuo mains are one of the example. because they are toxic

### Brass

Heavier and more expensive than aluminum. Can be soldered.

• Useful for bearings.

### Copper

Mostly available as wire or axles. Quite heavy, very good conductor.

• Useful for special parts and wires.

## Synthetic Materials

Like steel, synthetic materials are a name for a very large group of materials. There are hundreds of different plastics each with different characteristics and uses. We'll be covering only a few of them, but many techniques work just as well with other synthetics.

Most synthetic materials can be bent into shape after they are heated. A hot air gun (used to remove paint) can be sufficient for this purpose. Drilling and sawing these materials requires low speeds or they have to be cooled with water so the material doesn't melt. Soft plastics can be cut with an utility knife.

### PVC

Polyvinyl chloride: Used for plastic tubes.

### Plexiglass

Polymethyl methacrylate: Transparent material. Can be bent when heated to 200°C.

## Composite materials

Polymer composite materials are materials consisting of a polymer matrix and a reinforcing material. (think of reinforced concrete: the polymer matrix is the steel grid and the reinforcing material is the concrete)
These materials are considerably stronger and stiffer than steel and aluminium alloys.

Material           Specific strength        specific stiffnessSteel              150*103 Nm/kg            20*106 Nm/kgE-fiberglass/epoxy 300*103 Nm/kg            10*106 Nm/kgAramide/epoxy      500*103 Nm/kg            25*106 Nm/kg


The reason why composite materials haven't replaced steel is because of cost. Composites are only used where weight is a more important factor than price, e.g., airplanes: less weight means less fuel consumption and/or more useful payload.

## Other Materials

### Foamcore

Foamcore is relatively weak, but it is very practical for making fast prototypes. ( [6] [7] ).

### Cardboard

Generally, it's weak and looks ugly[citation needed], but it's very practical for making fast prototypes. Can be cut with a knife or scissors and put together with duct tape or glue gun. When dry, it's an insulator and can be used as a prototyping board for circuits.

With careful design, corrugated cardboard is strong enough to hold up full-sized humans ( a b c ).[1][2][3][4][5][6]

Often a cardboard mockup is built to make sure the parts of the robot all fit together properly.

Sometimes cardboard is more than strong enough for many parts of a working robot (a b).

1. Nick Michelin. 'The cardboard version of le Corbusier's "le Gran Confort" club chair.' etc. "Cardboard Furniture".
2. les cartonnistes associés. Courses, workshops, training, creation and sale of cardboard furniture.
3. Lazerian. "cardboard furniture range".
4. pacalowski. "cardboard furniture".
5. Frank Gehry. "Easy Edges" and "Experimental Edges" series of cardboard furniture. "designer profile: Gehry Chair collection".
6. "Wiggle Side Chair. Frank Gehry". quote: "Gehry named this material Edge Board: it consisted of glued layers of corrugated cardboard running in alternating directions, and in 1972 he introduced a series of cardboard furniture under the name “Easy Edges.” The “Easy Edges” were extraordinarily sturdy..."

# Basic Programming

## Programmable devices

### Microcontrollers

These days using programmable components is easy. In the early days you had to write code in assembly, burn it in an EPROM, plug the EPROM in its socket and hope you didn't make any mistake. Because if you did, you had to hunt down the error in hundreds of lines of cryptic assembly code and had to use a new EPROM. These days you've got flash memory which can be reprogrammed in circuit. You've got C and Basic compilers to write your code. Most µcontrollers have a whole lot of hardware on chip (UART, Watchdog, Real Time Clock, RAM, ROM, EEPROM,...) and libraries are available for different programming languages which make coding LC-displays or Servos very easy. Not to mention you've got emulators (A special connector plugged into the MICROcontroller socket which allows a PC to pretend to be the µcontroller) and simulators (simulates the µcontroller on a PC and allows to run its code) to hunt down the bugs.

#### AVR

A good µcontroller to start with is the Atmel AVR ATtiny2313 (previously: AT90S2313) or ATMEGA8535 (previously: AT90S8535) (Atmel). It's cheap, has all the essentials on chip and has a whole lot of websites dedicated to it. The 8535 is more expensive, but has more memory and has an on board ADC. An AVR combined with Bascom-AVR is pretty much the easiest way to start with µcontrollers.

See Atmel AVR for details.

See Robotics/Computer Control/The Interface/Microcontrollers for other popular microcontrollers.

See General Engineering Introduction/Arduino and Motors/Arduino Introduction for one way to do AVR development.

### PC

The PC has many advantages over µcontrollers when it comes to controlling a robot. However it has 2 flaws that make it nearly impossible to use in small robot-projects:

• First: it's large and heavy.
• Secondly: A modern pc consumes enormous amounts of power.

This means that PCs are limited to tethered or large robots. If power isn't a problem the PC offers enormous amounts of RAM and HD space and plenty of CPU power. Plus a very handy user interface. Also network capabilities can be very useful for some applications. Providing your robot with a wireless connection (IR, radio, WiFi, bluetooth,...) and a similar interface on the PC reduces the wire-problem to a limited-distance (or in the case of IR a line-of-sight) problem.

If you intend to use a PC in your project, you might want to use one of the flavors of linux as the OS, as it allows easy access to any of the parts of the computer. Another choice for an OS is the older MS-DOS, although MS-DOS lacks multithreading (but those can be added in your software) and has ugly memory management (remember the 640Kb limit?).

### Laptop

The laptop has only its size against it. A laptop provides the benefits of a PC without the enormous power consumption. The downside to laptops is their limited battery life.

### PDA

The PDA (Personal Digital Assistant) is nothing more than a hand held PC (Personal Computer). Most of the time these units used scaled down RISC (Reduced Instruction Set Chip) processors to allow for fast execution times and also allow the unit to remain smaller and lighter than your average laptop. Some PDA's even have built-in GPS which makes it very interesting for outdoor robot applications. The downside is their price. The PDA is useful for play, but also serves as a great business tool especially when they are equipped with a stylus.

### Gameboy

The Gameboy (the classic, advance, color and DS) can be a very powerful device. These have been used in many projects (see google). The only drawback is constructing the special PCB to act as a connector.

The Gameboy Advance is also excellent as a robotics platform. There are a few complete open-source development suites available (GCC based C/C++ plus ARM assember). There is also a good kit (Charmed Labs) available to interface Lego robotics motors/sensors and give much more control compared to the Lego RCX. With 4MB of FLASH and a few hundred K of RAM the kit has huge potential. The kit is not really for the complete beginner though as setting up the GNU tools can be quite complicated although the development environment is consequently very rich.

See GBA Development for tips on writing software for the Game Boy Advance.

### Programmable Logic Controllers

Programmable logic controllers, PLCs, are special purpose industrial computers, made to be easy to interface with electrical circuits. Most PLC are expandable but there are some compact "all-in-one" solutions as well. They have excellent bit-manipulating possibilities, and add-on-cards for several special signals as high-speed counters, analog I/O, networks and fieldbuses (RS-232, RS422, RS-485, Ethernet, DeviceNet, Profibus...), pulse output, servo control, etc. Increasingly, special inputs are included in the PLC CPU unit. PLCs are traditionally used to control automated factories, possibly several machines per PLC. They normally use special-purpose programming languages, most commonly ladder or SFC.

PLCs are available in sizes from approximately 5x5x5 cm (there is a PLC IC available as well, but for the purposes of this book we choose to ignore that fact). The smallest ones are very limited though, with only a few I/Os and very limited memory, and also very limited instruction set with regards to data processing and calculations. PLCs are especially suitable if you have a lot of experience of electric systems, but feel intimidated by designing and soldering PCBs and programming computers (i.e., you are an electrician). They also shine in very large system with many special purpose sensors and outputs, as mostly there will be a standard solution from the manufacturer that is possible to use.

The downside with PLCs are their price - They can be quite costly, normally at least an order of magnitude higher than microcontrollers. They also draw more current than a microcontroller, however less than a computer. On the other hand, compared to a computer, they are computationally weak. They aren't suited for heavy signal-processing work.

PLC:s are best suited for large robots, but could be usable in medium-sized projects as well.

### Combinations

It's common to use both a computer/laptop/PDA and (a) microcontroller(s) as those 2 complement each others limitations. e.g. The first has the advantage of large amounts of memory and processing power, however lacks specific outputs that are very handy in robotics, like PWM. Microcontrollers commonly have PWM channels that operate independently of the rest of the microcontroller, but are limited in their processing speed and memory.
Linking those 2 devices provides the best of both worlds.

## Programming languages

### Which language to pick?

The choice of language depends on a few points:

• previous experience. If you're already comfortable with a particular programming language, you'll probably want to use that language for programming your robot.
• How much time and effort you intend to invest. Not every language is equally hard/easy to use. Most of the complexity of a language comes from allowing more low-level access. Basically the more control a language gives to the user, the harder it is to use, but also the more powerful it is. In theory Assembly would allow a programmer to write the fastest and smallest code. However this is only true for an experienced programmer. Modern compilers can generate code that comes near to hand written Assembly. In most cases, using Assembly needlessly complicates a program, with the exception of using inline assembly in a C or Basic program. Usually these are a few lines of code which work directly with memory, or have to execute in a known time. For many if not most projects, a language such as Basic or C suffices. Only if you intend to push a microcontroller or PC to the limits of its capabilities is it worth the trouble of writing Assembly code.
• your goals. If you want a simple robot, you wouldn't need Assembly code at all. With modern microcontroller you can easily write sloppy Basic code and still have sufficient speed and memory. If you intend to build a cutting edge robot with a few dozen sensors, image recognition and speech recognition you'll need to write perfect code and will need Assembly for some of the components in order to have enough speed and be able to fit the code in the limited memory of the microcontroller(s). Most projects will fall in between these two extremes and good written Basic or C code would be more than sufficient. Knowing (some) Assembly can be useful as it'll give some insight on how processors work. Such insights make you a better programmer.
• Availability. Not all languages are available for all microcontrollers. Urbi is open source, C and Basic and Forth are common, often as freeware, other languages might be available commercially, or not at all.

This section doesn't intend to teach the basics of programming, just those points that aren't addressed in most programming tutorials and beginners books.

• Style. "Style" is how you indent your lines, how you pick your variable and function names. Pick one and stick with it throughout your program. Especially for functions and variables you should decide when to use capital letters, underscores and when to stick words together. Doing this the same everywhere makes it easier not to miss-spell names.
• Use informative names. Functions, procedures and variables should have informative names. Their purpose should be clear.
• Plan before coding. In software development there are two important steps before coding: requirement analysis and software architecture. The first is about finding out what the program is expected to do, what inputs to expect, which output it should generate and what the limitations of its environment are going to be. The latter involves working out how the program is going to be structured, which data types to use, which algorithms, how the input is going to enter the program and how to make sure it's valid and how to format the output. Using a lite version of these steps will make it much easier to write a decent program. If you intend to build a more complicated robot, you'll going to need to invest more time in planning out your software. Have all your software requirements written out first. Then pick a few of the most critical requirements and refine them. Implement those first. After you're done with those (this includes throughfully testing them), pick a new set and refine and implement those. By doing it in small steps you avoid having to write out everything at the start (and making many assumptions) and get to use the insights you get by coding parts of it.
• Use PDL (Program Development Language) PDL is a method to write functions. It involves writing down the individual steps of a function in plain English without referring to language-specific things, then refining these steps into smaller steps, until it's easier to write the code than to split the steps further. Afterward leave the PDL lines in as comments.
• Simulation and Debugging Learn to use the simulator. It's easier to find errors there than in the hardware. Also learn to use the debugger. It's your best friend for finding errors.
• If your software runs on a PC a log-file can be useful. But be picky with what you let the software log. If you intend to run it for a long time those log-files can become massive. If you want to log sensor data over time, know that these can be imported in Excel by saving the data with spaces between them to separate columns and newlines to separate rows. See w:Comma-separated values.

• Khepera III Toolbox: a wikibook with detailed information on how to program one particular robot
• Urbiforge: a website with tutorials on programming in Urbiscript

## The Platform

Most robots need a framework of some sort to which the builder attaches the various components and subsystems that make the robot function. This framework is known as the platform.

A good platform has a few requirements:

• It has to be light. Don't use steel unless you really need the extra strength. Plexiglass (or any other hard plastic) with an aluminum framework for strength can be sufficiently strong for most purposes. Don't forget about wood. Wood is strong, flexible and light.
• It has to be easy to add new parts to it. By using one size of PCB you can drill holes ahead of time. And you'll be able to stack PCBs. If you're familiar with Meccano sets you know the advantage of using one standard hole size and spacing. Picking one for your robot can make adding parts very easy and fast, of course this is less efficient with space.
• It has to be easy to remove parts of it: Make sure you can access any of its parts without having to take most of the robot apart. Especially batteries should be accessible.
• It has to be in balance. The weight of the robot should be mostly within the figure formed by connecting the wheels of the robot (A triangle for 3 wheeled robots, a rectangle for 4 wheeled robots). Placing significant weight outside this figure makes it more easy for the robot to tip over. The center of gravity should also be as low as possible, otherwise the robot could tip over when turning too fast.
• It has to have a size that's practical: Don't make it too small or you end up with insufficient space for all the features you had in mind. Don't make it too large either or you end up with a robot that can't maneuver without bumping in furniture and people. Or worse: can't get through a door post.
• Avoid putting the wheels directly on the motors' axles. Use an axle and connect the motor to it with gears. For small robots this isn't important, but larger would displace the axle inside the motor and damage it.

# Construction Techniques

## Working with Metals

### Measuring and Marking

• Do: Measure twice, cut once. Putting it back on is MUCH more difficult than taking it off.
• Do Not: Measure with a micrometer, mark with chalk, cut with a torch. Accuracy is important in moving parts.

### Cutting and Sawing

• Sawing sheet metal requires a saw with a fine-tooth blade. As a general rule of thumb at least three teeth should touch the material being cut.
• The teeth should be aimed away from the handle.
• Only apply pressure when pushing the saw away from you, not when pulling back.
• A miter box can be very handy to make straight or 45° cuts. Use a metal box as wooden boxes wear out very fast.

### Drilling

• Use a punch to make a small indentation where you want to drill the hole.
• Use a slower speed to drill the hole than you would use for wood.
• Use clamps when working with sheet metal. Don't hold it with your hands as metal is very sharp when cut.
• Large holes can be made by drilling a hole and using a file thread or small metal saw to cut the hole. Finish with a half round file.
• A groove can be cut by drilling two holes at the outer edges and using file thread or small saw to connect both holes.

### Filing

• Files exist in different shapes and different roughness.
• Filing straight: Hold the file diagonal on the surface, apply pressure and move the file upwards while moving from left to right.

### Bending

Place the sheet metal between 2 wooden boards in a vice. Let the line where you want the material to bend match up with the border of the boards. Use a hammer to bend the metal.

## Working with Plastics

### Cutting

Thin plastics can be cut with a sharp utility knife, thicker material can be sawed. When sawing plastic, care must be taken to not melt it.

### Drilling

Drilling plastic requires a slow speed drill. Special drills for plastics are much better as metal drill can cause the material to crack.

Large holes and grooves can be made the same way as in metal.

### Bending

Use a heat gun (paint stripper) to heat up the plastic, bend it and let it cool down. Bending can be done by hand.

• "the #1 rule of machining: Always properly secure the workpiece." -- David Cook[8]

## Resourcefulness

Though many components for a serious robotics project will almost certainly have to be purchased, the total cost of the project can be reduced by harvesting parts from various electronic and electro-mechanical devices. The general rule for selection is "the older, the better," as newer devices are now dominated by specialized ICs and surface mount components that builders might find difficult to use in their robots. SMD (Surface-mounted devices) can be used to create very small robots, if one has the tools and patience to work with them.

An example of a good source of parts would be a printer from the 1980s. Without even disassembling such a printer, one can see all sorts of potentially useful components. Additionally, several metal rods and plates contained in the printer may be used as structural parts for the robot, and even the plastic case itself could be used.

Old floppy disk drives and copy machines are also good sources for parts such as stepper motors, optocouplers or microswitches, regular components, machined metal rods and hardware. Hard disk drives have fewer usable parts but can still be a source.

However stepper motors from printers and copy machines tend to consume a lot of power and may not be as good for battery operated robots.

Note to potential contributors: perhaps there could be a "case studies" section here, with examples of what can be obtained from a variety of devices.

# Power Sources

Though perhaps other power sources can be used, the main sources of electrical power for robots are batteries and photovoltaic cells. These can be used separately or together (for practical applications, most solar-powered robots will need a battery backup).

## Photo voltaic cell

Photo Voltaic Cells

solar cells are well known for their use as power sources for satelites, enviromentalist green energy campaigns and pocket calculators. In robotics solar cells are used mainly in BEAM robots. Commonly these consist of a solar cell which charges a capacitor and a small circuit which allows the capacitor to be charged up to a set voltage level and then be discharged through the motor(s) making it move.


For a larger robot solar cells can be used to charge its batteries. Such robots have to be designed around energy efficiency as they have little energy to spare.

## Batteries

Batteries are an essential component of the majority of robot designs. Many types of batteries can be used. Batteries can be grouped by whether or not they are rechargeable.

Batteries that are not rechargeable usually deliver more power for their size, and are thus desirable for certain applications. Various types of alkaline and lithium batteries can be used. Alkaline batteries are much cheaper and sufficient for most uses, but lithium batteries offer better performance and a longer shelf life.

Common rechargeable batteries include lead acid, nickel-cadmium (NiCd)and the newer nickel metal-hydride (Ni-MH). NiCd & Ni-MH batteries come in common sizes such as AA, but deliver a smaller voltage than alkaline batteries (1.2V instead of 1.5V). They also can be found in battery packs with specialized power connectors. These are commonly called race packs and are used in the more expensive RC race cars. They will last for some time if used properly. Ni-MH batteries are currently more expensive than NiCd, but are less affected by memory effect.

Lead acid batteries are relatively cheap and carry quite a lot of power, although they are quite heavy and can be damaged when they are discharged below a certain voltage. These batteries are commonly used as backup power supply in alarm systems and UPS.

An extremely common problem in robots is the "the microcontroller resets when I turn the motor on" problem[9]. When the motor turns on, it briefly pulls the battery voltage low enough to reset the microcontroller. The simplest solution[10] [11] [12] [13] is to run the microcontroller on a separate set of batteries.

HISTORY OF THE BATTERY:

The first evidence of batteries comes from discoveries in Sumerian ruins dating around 250 B.C.E. Archaeological digs in Baghdad, Iraq [14]. But the man most credited for the creation of the battery was named Alessandro Volta, who created his battery in the year 1800 C.E. called the voltaic pile. The voltaic pile was constructed from discs of zinc and copper with pieces of cardboard soaked in saltwater between the metal discs. The unit of electric force, the volt, was named to honor Alessandro Volta [15]. A time line of breakthroughs and developments of the battery can be seen here [16].

HOW A BATTERY WORKS:

Most batteries have two terminals on the exterior, one end is a positive end marked “+” and the other end is the negative marked “-”. Once a load, any electronic device, a flashlight, a clock, etc., is connected to the battery the circuit being completed, electrons begin flowing from the negative to positive end, producing a current. Electrons will keep flowing as fast as possible until the chemical reaction on the interior of the battery lasts. Inside the battery there is a chemical reaction going on producing the electrons to flow, the speed of production depends on the battery’s internal resistance. Electrons travel from the negative to positive end fueling the chemical reaction, if the battery isn’t connected then there is no chemical reaction taking place. That is why a battery (except Lithium batteries) can sit on the shelves for a year and there will still be most of the capacity to use. Once the battery is connected from positive to negative pole, the reaction starts, that explains the reason why people have gotten a burn when a 9-volt battery in their pocket touches a coin or something else metallic to connect the two ends, shorting the battery making electrons flow without any resistance, making it very, very hot. [17]

MAIN CONCERNS CHOOSING A BATTERY:

- Geometry of the batteries. The shape of the batteries can be an important characteristic according to the form of the robots.
- Durability. Primary(disposable) or secondary (rechargeable)
- Capacity. The capacity of the battery pack in milliamperes-hour is important. It determines how long the robot will run until a new charge is needed.
- Initial cost. This is an important parameter, but a higher initial cost can be offset by a longer expected life.
- Environmental factors. Used batteries have to be disposed of and some of them contain toxic materials. [18]

PRIMARY (DISPOSABLE) BATTERY TYPES

• Zinc-carbon battery - mid cost - used in light drain applications
• Zinc-chloride battery - similar to zinc carbon but slightly longer life
• Alkaline battery - alkaline/manganese "long life" batteries widely used in both light drain and heavy drain applications
• Silver-oxide battery - commonly used in hearing aids
• Lithium Iron Disulphide battery - commonly used in digital cameras. Sometimes used in watches and computer clocks. Very long life (up to ten years in wristwatches) and capable of delivering high currents but expensive. Will operate in sub-zero temperatures.
• Lithium-Thionyl Chloride battery - used in industrial applications, including computers and electric meters. Other applications include providing power for wireless gas and water meters. The cells are rated at 3.6 Volts and come in 1/2AA, AA, 2/3A, A, C, D & DD sizes. They are relatively expensive, but have a proven ten year shelf life.
• Mercury battery - formerly used in digital watches, radio communications, and portable electronic instruments, manufactured only for specialist applications due to toxicity [19]

Helpful link comparing the most popular types of batteries in many different types of categories [20] [21]

SECONDARY (RECHARGEABLE):

(Will be discussing the two most popular secondary batteries)

Lithium-ion Batteries:

These batteries are much lighter than non-lithium batteries of the same size. Made of Lithium (obviously) and Carbon. The element Lithium is highly reactive meaning a lot of energy can be stored there. A typical lithium-ion battery can store 150 watt-hours of electricity in 1 kilogram of battery. A NiMH (nickel-metal hydride) battery pack can store perhaps 100 watt-hours per kilogram, although 60 to 70 watt-hours might be more typical. A lead-acid battery can store only 25 watt-hours per kilogram. Using lead-acid technology, it takes 6 kilograms to store the same amount of energy that a 1 kilogram lithium-ion battery can handle. Huge difference!

Begin degrading once they are created, lasting only two or three years tops, used or not. Extremely sensitive to high temperatures, heat degrades battery even faster. If a lithium battery is completely discharged, it is ruined and a new one will be needed. Because of size and ability to discharge and recharge hundreds of times it is one of the most expensive rechargeable batteries. And a SMALL chance they could burst into flames (internal short, separator sheet inside battery keeping the positive and negative ends apart gets punctured). [22]

Alkaline Batteries:

The anode, the positive end, is made of zinc powder because the granules have a high surface area, increasing the rate of reaction and higher electron flows. It also helps limit the rate of corrosion. Manganese dioxide is use on the cathode, or the negative side, in powder form as well. And potassium hydroxide is the electrolyte in an alkaline battery. There is a separator inside the battery to separate the electrolyte between the positive and negative electrodes. [23]

## Fuel Cells

Fuel cells are a possible future replacement for chemical cells (batteries). They generate electricity by recombining hydrogen gas and oxygen. (commercial fuel cells will probably use methanol or other simple alcohols instead of hydrogen). Currently these are very expensive, but this might change in the near future when these cells are more commonly used as a replacement for laptop batteries.

Note: since fuel cells use flammable products you should be extra careful when you build a power source with these. Hydrogen has no odor like natural gas and is flammable and in some conditions explosive.

Pressurized canisters have their own set of risks. Make sure you really know how to handle these. Or at least allow other people enough time to get behind something thick and heavy before experimenting with these.

## Mechanical

Another way to store energy in a robot is mechanical means. Best known method is the wind-up spring, commonly used in toys, radios or clocks.

Another example of mechanical energy storage is the flywheel. A heavy wheel used to store kinetic energy.

## Air Pressure

Some robots use pneumatic cylinders to move their body. These robots can use either a bottle of pressurized air or have a compressor on board. Only the first one is a power source. The latter power source is the batteries powering the compressor. Pneumatic cylinders can deliver very large forces and can be a very good choice for larger walkers or grippers.

Note: Pressurized canisters and pneumatic components can be dangerous when they are handled wrongly. Failing pressurized components can shoot metal pieces around. Although these aren't necessarily life threatening, they can cause serious injuries even at low pressures.

Canisters on their own pose additional risks: Air escaping from a pressurized canister can freeze whatever happens to be in its way. Don't hold any body parts in front of it.

Pneumatic and hydraulic cylinders can deliver large forces. Your body parts can't handle large forces.

## Chemical Fuel

The model airplanes there exist small internal combustion engines. These engines can be used to power robots either directly for propulsion or indirectly by driving an alternator or dynamo. A well designed system can power a robot for a very long time, but it's not advisable to use this power system indoors.

Note: This is another dangerous way of doing things. Fuel burns and is toxic. Small amounts of fuel in a open container can explode when ignited. Exhaust is toxic and a suffocation risk. Make sure of that you know what doing or get good life insurance.

# Actuation Devices

Actuation devices are the components of the robot that make it move (excluding your feet). Best known actuators are electric motors, servos and stepper motors and also pneumatic or hydraulic cylinders. Today there are new alternatives, some which wouldn't be out of place in a good SF-movie. One of the new types of actuators are Shape Memory Alloys (SMA). These are metal alloys that shrink or enlarge depending on how warm they are. Another new technique is the use of air-muscles.

## Motors

There are several different types of motors. Each motor type has several advantages as well as disadvantages depending on a particular robots design. See this Wikipedia article for basic information about the different electro motors.

### AC-motors

There are several different types of AC-motors, but their use is limited to high power stationary industrial robots. They are harder to use than DC-motors.

### DC-motors

DC-motors are very easy to use, but like most other motors their usefulness for robotics is very dependent on the gearing available. DC-motors are made much more effective if they have an efficient gear ratio for a particular task. If your priority is to have a fast spinning motor and torque is of little concern a low gearing or even no gearing may be what you need; however, most motors used in robots need torque over top speed so a motor with a high gear ratio could be more useful.

The control of a DC motor can be split into two parts: speed and direction.

#### Direction

The principle behind a H-bridge

Changing direction in which a DC-motor turns is very easy: simply reverse the polarity.

Both pairs of switches ( (S1A,S1B) and (S2A, S2B) )-see the picture on the right- will always switch together. This circuit is called an H-bridge. In a real design the switches can be several different components (Relays, transistors, FETs) or the whole circuit (without the motor) could be an IC (integrated circuit). use sugarcan relays

#### Speed

Speed is a little bit more complicated. Many beginners would try to slow down a motor by reducing its voltage with a variable resistor or other ways. This does not work well, because it will not only reduce the motor's speed, it will also reduce a motor's strength, while also consuming a lot of electricity as large amounts of heat are generated by the resistor.

A far better way is to use a PWM (Pulse-width modulation) device.

### Servo

What is a servo?

Servos are used in robotics for different purposes: e.g. to move a sensor around or to move the legs of a robot. Some users modify the servo so that they can use it as a DC-motor with a gearbox.

Controlling a servo is done with Pulse-width modulation. The length of the pulse is relative to the position the servo will turn to. The length of this pulses is usually between 1ms and 2ms, if so 1.5ms would be the center position. This pulse needs to be repeated with small intervals (otherwise the servo might turn to a "save" position or it might simply stay at its current position. This depends on the type of servo used).

### Stepper motor

We cover stepper motors in more detail in the next chapter, Robotics/Stepper Motors.

(The category-box overlaps some of the text here. This line added to keep the real content on the screen)

## Stepper Motors

### Stepper Motor Basics

• Degree of Rotation - Every stepper motor has a degree of rotation. This value indicates how far the rotor will spin around it's axis for each signal sent.
• Number of Coil - These motors drive coils in a pattern to advance the rotor position
• Driving a Coil - This is done by passing current through the coil. In stepper motors, all coils must be driven in both directions over a complete revolution.
• Sequencing - These motors require the electronic control to change which coil in being driven at the correct time. Without this the motor will hold in one position.
• H-Bridge Style Driver - ...

What's a stepper motor?

In robotics stepper motors are primarily used in stationary robots as they tend to consume quite a lot of power. They are ideal for movements that have to be accurate and are larger than 180°.

### Common Uses/Part Sources

• Floppy, hard disk, or CD/DVD-ROM drives - The heart of most these is the stepper motor. In most of these drives, there are two stepper motors. They position the read/write heads and they spin the medium.
• Printers, scanners, plotters, and copy machines - Most of these devices utilize stepper motors. They are used primarily to position the print head or optics on an (X,Y) coordinate system. One motor positions on the X axis and the other positions on the Y axis.
• CNC machines, routers, scanners, lathes etc - Used for X/Y/Z positioning of heads.

## Shape Memory Alloys

Here is a good introduction about what Shape Memory Alloys (SMA) are.

The main use of SMA in robotics is to imitate human muscles. One of the better known SMAs is Nitinol wire. It contracts about 5 to 7% of its length and consumes a lot of power.

One of the most popular nitinol driven robots is Stiquito.

## Air muscle

The concept of a fully autonomous, mission capable, legged robot has for years been a Holy Grail of roboticists. Development of such machines has been hampered by actuators and power technology and control schemes that cannot hope to compete with even some of the “simplest” systems found in the natural world.

### Biomimetics

Faced with such a daunting task, it is not surprising that more and more researchers are beginning to look toward biological mechanisms for inspiration.

Biology provides a wealth of inspiration for robot design. There are millions of species of animals that have evolved efficient solutions to locomotion and locomotion control.

Insects in particular are well known not only for their speed and agility but also for their ability to traverse some of the most difficult terrains imaginable; insects can be found navigating rocky ground, walking upside down, climbing vertical surfaces, or even walking on water. Furthermore, insects almost instantly respond to injury or removal of legs by altering stance and stepping pattern to maintain efficient locomotion with a reduced number of legs [1]. Given the ultimate goal of autonomy, this ability to reconfigure locomotion strategies will be crucial to the robustness of autonomous robots [2].

There are of course other mechanisms capable of producing locomotion, most notably wheels and caterpillar treads. While these devices are admittedly much easier to design and implement, they carry with them a set of disadvantages that inhibits their use in military or exploratory applications. Primary amongst these limitations is the simple fact that wheels, and to a lesser extent treads, are not capable of traversing terrain nearly as complex as that which a legged vehicle is capable of maneuvering over [2]. Even wheeled and tracked vehicles designed specifically for harsh terrains cannot maneuver over an obstacle significantly shorter than the vehicle itself; a legged vehicle on the other hand could be expected to climb an obstacle up to twice its own height, much like a cockroach can. This limitation on mobility alone means that in any environment without fairly flat, continuous terrain, a walking vehicle is far preferable to a wheeled or tracked one. Legged vehicles are also inherently more robust than those dependent on wheels or tracks. The loss of a single leg on a hexapod will result in only minimal loss in maneuverability; on a wheeled vehicle a damaged wheel could spell the end of mobility, and a damaged caterpillar tread almost always results in catastrophic failure. Finally, legged vehicles are far more capable of navigating an intermittent substrate—such as a slatted surface—than wheeled vehicles [3].

Given the preceding argument for the use of legged locomotion in certain environments, one is left with the daunting task of actually designing an efficient legged robot. While such a task is difficult to say the least, nature has provided us—literally—with a world full of templates. Animals can be found that are capable of navigation over almost any surface, and it is from these natural solutions to locomotion problems that engineers are more and more often seeking inspiration.

### Actuators

2. Actuator Selection The selection of actuators plays a pivotal role in any mobile robot design, as the shape, size, weight and strength of an actuator must all be taken into account, and the power source of the actuators often provides the greatest constraint on a robot’s potential abilities.

#### Muscle

Biological organisms have a great advantage over mechanical systems in that muscle, nature’s actuator of choice, has a favorable force-to-weight ratio and requires low levels of activation energy. Their tunable passive stiffness properties are also well suited for energy efficient legged locomotion. The most frequently used actuators, electric motors and pneumatic/hydraulic cylinders, are far from equivalent to their biological counterparts.

#### Electric motor

Electric motors are probably the most commonly used actuation and control devices in modern day robotics, and with good reason. Motors in a wide range of sizes are readily available and they are very easy to control. These devices are also fairly easy to implement, normally requiring just a few electrical connections. However, electric motors have several disadvantages. Most importantly, their force-to-weight ratio is far lower than that of pneumatic and hydraulic devices, and in a field such as legged robotics, where weight is of the utmost importance, this makes them unsuitable for many applications. Typically, electric systems have a power to weight ratio of 50-100 W/kg (including only motor and gear reducer, operating at rated power), whereas fluid systems produce 100-200 W/kg (including actuator and valve weights) [4] and biological muscle, which varies widely in properties, produces anywhere from 40-250 W/kg [5]. In addition, when trying to take advantage of an animal’s efficient biomechanical design, the drastic difference between the rotary motion of most electric motors and the linear motion of muscle can cause complications.

#### Pneumatic and hydraulic cylinder

Pneumatic and hydraulic cylinder systems eliminate some of the problems associated with electric motors [6]. As a general rule, they provide a significantly higher force-to-weight ratio than motors; an advantage that in itself often leads to their use, even given the increased complexity and weight of control valves and pressurized fluid lines required for operation. These actuators also produce linear motion, which makes them more suitable to serving a role equivalent to muscle. Unfortunately, air cylinders are better suited to “bang-bang” operation; that is, motion from one extreme to another with mechanical stops to halt motion. Smooth walking motion requires a much larger range of states, and the stiction present in most pressure cylinders makes even coarse position control difficult. Fluid pressure devices are still quite massive; for example, almost seventy-five percent of CWRU’s Robot III’s weight is composed of its actuators and valves [7].

#### Braided pneumatic actuator

Braided pneumatic actuators (BPAs) provide a number of advantages over conventional actuation devices, and share some important characteristics with biological muscle. These devices consist of two major components: an inflatable bladder around which is wrapped an expandable fiber mesh (Figure 1). The resulting actuator is significantly lighter than a standard air cylinder; however, the braided pneumatic actuator is actually capable of producing greater forces (and thus possesses a much higher force-to weight-ratio) than its heavier counterpart. When the bladder is filled with pressurized air, its volume tends to increase. Because of the constant length of the mesh fibers, this can only be accomplished by the actuator expanding radially while simultaneously contracting along its axis. The result is a muscle-like contraction that produces a force-length curve akin to the rising phase of actual muscle [8].

An important property of BPA to note is that at maximum contraction (L/Lo≈0.69) the actuator is incapable of producing force; conversely, the maximum possible force is produced when the actuator is fully extended. Therefore, similar to muscle, the force output of these actuators is self-limited by nature. While an electric motor controller could conceivably become unstable and drive a system until failure of either the structure or the motor, a braided pneumatic actuator driven by an unstable controller is less likely to be driven to the point of damaging itself or the surrounding structure. Because of this property, braided pneumatic actuators are well suited for the implementation of positive load feedback, which is known to be used by animals including cockroaches, cats and humans [9].

BPAs are also known as McKibben artificial muscles [10], air muscles, and rubbertuators. They were patented in 1957 by Gaylord and used by McKibben in orthotic devices [11]. Like biological muscle, BPAs are pull-only devices. This means that they must be used in opposing pairs, or opposing some other antagonist. This property is of significant importance for useful application of these devices, for although it requires the use of two actuators or sets of actuators at each joint, it allows the muscle-like property of co-contraction, also known as stiffness control. If one considers a joint in the human body, such as the elbow or knee, it should be obvious that whatever

Figure 1: A placeholder



position the joint is in the muscles that control that joint can be activated (flexed) without changing the joint angle. From an engineering standpoint, this is accomplished by increasing the force produced by each muscle in such a way that the net moment produced at the joint is zero. As a result, the joint angle remains the same but perturbations, such as the application of an outside force, result in less disturbance. From a practical standpoint, this means that the joint can be varied through a continuum of positions and compliances independently. The resulting joint can be stiff when needed, such as when bearing weight while walking, or compliant, as in cases of heel strike where compensation for uneven terrain may be needed.

The greatest impediment to widespread use of BPAs has been their relatively short fatigue life. Under operating conditions such as we desire, these devices are capable of a service life on the order of 10,000 cycles as they were originally designed. A significant improvement to these devices has been made by the Festo Corporation, which has recently introduced a new product called fluidic muscle. This operates on the same principles as a standard BPA, with the critical difference being that the fiber mesh is impregnated inside the expandable bladder. The resulting actuators have a demonstrated fatigue life on the order of 10,000,000 cycles at high pressure.

3. Previous Robots

Two previous robots developed at CWRU have provided significant insight and impetus for the design of Robot V. Both of these cockroach-based robots are non-autonomous, and rely on off board controllers and power supplies for operation.

Robot III was the first pneumatically powered robot built at CWRU, and relied on conventional pneumatic cylinders for actuation. This 15 kilogram robot was powerful, and was demonstrated to be capable of easily lifting payloads equivalent to its own weight. The fundamental failing of this robot was the difficulty inherent in the control of the pneumatic cylinders; although capable of maintaining stance robustly and cycling its legs in a cockroach manner, to date this robot has not demonstrated smooth locomotion [12].

Kinematically similar to its predecessor, Robot IV implemented braided pneumatic actuators in place of Robot III’s pneumatic cylinders. This robot was underpowered; it was barely able to lift itself, the valves were moved off-board for walking experiments. However, this robot was significantly easier to control, in large part because the valves allowed air to be trapped inside the actuators, so that joint stiffness could be varied as well as joint position. Using an open-loop controller, this robot was able to locomote [13]

4. Overview of Robot V

Design Case Western Reserve University’s most recent robot, Robot V (Ajax) like its predecessors Robot IV and Robot III is based on the death head cockroach Blaberus discoidalis. Although it is not feasible to capture the full range of motion exhibited by the insect—up to seven degrees of freedom per leg—analysis of leg motion during locomotion suggests that this is not necessary. This is because in many cases joints demonstrate only a small range of motion, while the majority of a leg’s movement is produced by a few joints. We have determined that three joints in the rear legs, four in the middle legs, and five in the front legs are sufficient to produce reasonable and robust walking [7] [14]. The different number of DOF in each set of limbs represents the task-oriented nature of each pair of legs. On the insect, the front legs are relatively small and weak, but highly dexterous (Figure 2), and are thus able to effectively manipulate objects or navigate difficult terrain. This dexterity is attained in the robot through three joints between the body and coxa. These joints are referred to (from most proximal to most distal) as γ, with an axis parallel to the intersection of the median and coronal planes (in the z direction); β, with an axis parallel to the median and transverse planes (in the y direction); and α, with

Figure 2: Schematic of front leg with axes of joint rotation

an axis parallel to the coronal and transverse planes (in the x direction). The two remaining joints are between the coxa and femur and the femur and tibia. The middle legs on the insect play an important role in weight support, and are critical for turning and climbing (rearing) functions; however they sacrifice some dexterity for power. On Robot V, the middle legs have only two degrees of freedom—α and β—between the body and coxa, and retain the single joint between the coxa and femur and the femur and tibia. Finally, the cockroach uses its rear legs primarily for locomotion, and although these limbs are not as agile as the others, they are larger and much more powerful; likewise, the rear legs of the robot have only one joint between each of the segments. The body-coxa joint uses of only the β joint. Although each leg has a unique design, one component they have in common is the tarsus, or foot, construction. This consists of a compliant member attached to the end of the tibia and a pair of claws. The compliant element is capable of bending to maintain contact with the ground, thus providing traction. The claws are angled differently on each leg to assist in its specific task; for example, the claws on the rear leg are angled backwards like spines, allowing the foot additional traction when propelling the robot forward.

4.1 Valves

Each joint is driven by two opposing sets of actuators, allowing for controlled motion in both directions (previous robots have used a single actuator set paired with a spring) [15]. Each actuator set is driven by two two-way valves; one for air inlet and one for air exhaust. This scheme doubles the number, and thus the weight, of valves as compared to Robot III; however, it allows for the implementation of stiffness control, or co-contraction. Because the pressures in opposing actuators can be independently varied, the same joint angle can be achieved using different combinations of actuator pressures; all that is required is that the moments on a given joint sum to zero at the desired position. As a result, a joint can be made very stiff by pressurizing both sets of actuators, or very compliant, by pressurizing one actuator only enough to overcome the mass properties of the limb to reach a desired position.

4.2 Stance bias

The actuators onboard a legged robot can generally be subdivided into two classes: those used to move the limb through the swing phase and those required to maintain stance and generate locomotion. One of the fundamental differences between these two types of actuators is the load that is required of them. The swing actuators need only provide the force necessary to overcome the weight and inertia of the limb, whereas the stance actuators must support not only a significant portion of the entire mass of the robot, but also provide the force necessary for locomotion. This disparity between operational demands can potentially lead to large, powerful stance actuators and small swing actuators (as can be seen in the human body with powerful quadriceps muscles which maintain stance, and the respectively weaker hamstring muscles, which are used for swing); however, because of limited options for robot actuator sizes, it is more often the case that the swing actuators are overpowered, whereas the stance actuators are either underpowered or just capable of meeting the demands placed on them. On Robot V this problem was resolved through the placement of torsion springs at some critical load bearing joints (specifically the coxa-femur and β joints) to provide a bias in the direction of stance. As a result, the forces required of the stance actuators are significantly reduced while the swing actuators must produce greater forces, but still remain within their operational range.

5. Initial Trials

Robot V, like Robot IV, was designed as an exoskeleton, where the structural members are placed outside and around the actuators. Not only did this allow a significant reduction in weight, but it also provided a limited protection for the actuators, which are susceptible to puncture and abrasion (Figure 3). The vast majority of the structural elements were made of 6061-T6 Aluminum, although axles and actuator mounting shafts were made of 1018 steel, and fasteners were made from stainless steel. All joint axles were mounted in nylon journal bearings.

Figure 3: Robot V (Ajax)


Whenever possible, actuators were directly mounted to both their insertion and their origin. This precluded the need for tendons, allowing the maximum possible length of actuator to be used. This in turn maximized the force and stroke available for each individual joint. The notable exception to this strategy was the β actuators, which were attached to a tendon and mounted parallel to the body. This was done to reduce the overall height of the robot. The first legs to be built were the middle legs. These were chosen for initial tests because they must be dexterous and forceful to maintain stance in a tripod gait. After completion of the first leg the range of motion (ROM) of each of its joints was measured and compared to the design values. These data are summarized below:

Joint ROM Desired ROM β 20° 30° α 25 40 c-f (coxa-femur) 40 50 f-t (femur-tibia) 75 75

These tests were performed at both 5.5 and 6.25 bar, with no significant difference between the results of the two, suggesting that at these pressures the actuators had reached their full contraction. Although the desired ROMs were not reached, the measured ROMs are in excess of those demonstrated by animal. The demonstrated ROM’s of the leg were deemed sufficient for walking and climbing. A gantry was constructed to support the middle legs for preliminary stance and motion tests. With only horizontal support—to prevent tipping—the legs were able to maintain stance while supporting their weight (three kilos) plus the weight of the valves for the actuators (one half kilo) and a gantry element (one kilo) without any pressurized air in the actuators. This capability, a result of the aforementioned stance bias, clearly demonstrates the ability of these legs to support not only the weight of the robot, but a significant payload as well. An open loop controller was then used to cycle the legs through “push-ups”; raising themselves from a minimum to a maximum height. In this fashion, the legs were able to lift the body approximately 6 cm. This process was repeated with additional payloads (beyond valve and gantry weight) of two and a half and five kilograms using 6 bar air. In both cases, the legs were able to attain the same height.

6. Ajax

Fully assembled—including valves—Robot V weighs 15 kilograms. Range of motion tests have been performed for all joints, and are summarized below. In many cases, specifically the femur-tibia joints of all legs, these ranges of motion are in excess of the desired ROM. In all cases, they are sufficient for walking and climbing.

JOINT ROM Front Leg γ 35° β 45 α 25 c-f 40 f-t 75 Middle Leg β 20 α 25 c-f 40 f-t 75 Rear Leg β 25 c-f 50 f-t 80

Ajax demonstrates a propensity to stand due to the preloads placed on the torsion springs; even without pressure in the actuators, the middle and rear

Figure 4: Robot V without activated actuators (top) and standing (bottom). Note that even when the actuators are un-pressurized, they maintain a near-stance position, with only the feet contacting the surface.

Legs maintain a near-stance position. Initial tests of the robot have shown that it is capable of supporting its weight in a standing position and of achieving stance both unloaded and with a five kilogram payload (Figure 4).

Further tests have shown that the robot is able to achieve a tripod stance and alternate between tripods, which is important for walking. These tasks were achieved using a simple open loop controller. Furthermore, the passive properties of the BPA’s are clearly highlighted in the robot’s ability to return to its desired position after suffering perturbations without the use of any form of active posture control. Using a feed forward controller with absolutely no feedback, the robot can produce reasonable forward locomotion. Although this is by no means the robust, agile walking that is the ultimate goal of this project, it is a clear demonstration of not only the robot’s capabilities, but also the advantages offered by the BPA’s. The ability to move using only an open loop controller is in large part a result of the passive properties of the actuators, which provide compensation for any instabilities in the controller itself and immediate response to perturbations without the need for controller intervention.

This can be contrasted with Robot III, which, even with kinematic and force feedback, was not able to walk. This failure of Robot III is attributed to the inability of both the pneumatic cylinders and posture controller to deal with the sudden changes in load associated with locomotion.

In short, the BPA’s act as filters, providing immediate response to perturbation; a task the controller is incapable of. This same process occurs in biological muscle, which responds nearly instantaneously to perturbation, but only slowly to neurological input [16]. With the addition of a biologically inspired closed loop controller in the future, Ajax is expected to display robust, insect-like locomotion.

7. Future Work

Although the mechanical aspects of this robot have been completed, the control system is still in its infancy. Because the mechanics of a system are inextricably linked to its control circuits, Ajax’s controller is expected to benefit from the close relationship between its design and that of the actual insect. This relationship is perhaps most prominent in the muscle-like nature of the braided pneumatic actuators.

Sensors will be added to provide not only joint position feedback, but force feedback as well. Joint angle can easily be determined with a potentiometer, as has been done on our previous robots. Force feedback will be attained through pressure measurements from the actuators, which, given actuator length, can be used to determine actuator force. Although strain gauges properly placed on the mounting elements of the actuators can produce sufficient force feedback, previous work has shown many desirable characteristics inherent in pressure transducers: they have much cleaner signals, do not require amplifiers, and do not exhibit cross talk; all disadvantages of strain gauges. In addition, strain gauges must be mounted directly adjacent to the actuator they are recording from; this requires more weight at distal points of the limb, (thusly increasing the moment of inertia of the limb) and generally reduces the usable available stroke of the actuator. We have demonstrated that a pressure transducer located down-line from an actuator produces a sufficient signal to determine actuator force.

An insect-inspired controller was developed for Robot III, and this will be modified for use on Robot V. It is a distributed hierarchical control system. The local to central progression includes circuits that control joint position and stiffness, inter-leg coordination and reflexes, intra-leg gait coordination, and body motion. The inter-leg coordination circuit solves the inverse kinematics problem for the legs and the centralized posture control system solves the force distribution problem.

### References

1. Delcomyn, F Foundations of Neurobiology W.H. Freedman and Company, New York, 1998.
2. Raibert, M.H., Hodgins, J.K., Legged Robots, “Biological Neural Networks in Invertebrate Neuroethology and Robotics” ed. By Beer, R.D., Ritzmann, R.E., and McKenna, T. 1993.
3. Espenschied, K.S., Quinn, R.D., Chiel, H.J., Beer, R.D. (1996). Biologically-Based Distributed Control and Local Reflexes Improve Rough Terrain Locomotion in a Hexapod Robot. Robotics and Autonomous Systems, Vol. 18, 59-64.
4. Binnard, M.B. (1995) Design of a Small Pneumatic Walking Robot. M.S. Thesis, M.I.T.
5. Davis S.T., Caldwell D.G “The Bio-Mimetic Design of a Robot Primate Using Pneumatic Muscle Actuators” Proceedings of the 4th International Conference on Climbing and Walking Robots (CLAWAR 2002), Karlsruhe, Germany, 24-26 Sept. 2001.
6. Song, S.M., Waldron, K.J., Machines That Walk MIT Press, Cambridge, Mass., 1989.
7. Bachmann, R.J. (2000) A Cockroach-Like Hexapod Robot for Running and Climbing. M.S. Thesis, CWRU.
8. Klute, G.K., B. Hannaford, “Modeling Pneumatic McKibben Artificial Muscle Actuators: Approaches and Experimental Results,” Submitted to the ASME Journal of Dynamic Systems, Measurements, and Control, November 1998, revised March 1999.
9. Prochazka, A., Gillard, D., and Bennett, D.J., “Implications of Positive Feedback in the Control of Movement” The American Physiological Society, 1997.
10. Nickel, V.L., J. Perry, and A.L. Garrett, “Development of useful function in the severely paralyzed hand,” “Journal of Bone and Joint Surgery,” Vol. 45A, No. 5, pp. 933-952, 1963.
11. Caldwell, D.G, Medrano-Cerda, G.A., and Bowler C.J. “Investigation of Bipedal Robot Locomotion Using Pneumatic Muscle Actuators” . IEEE International Conference on Robotics and Automation (ICRA'97), Albuquerque, NM.
12. Nelson, G.M. (2002) Learning About Control of Legged Locomotion Using A Hexapod With Compliant Pneumatic Actuators. Ph.D. Thesis, CWRU.
13. Bachmann, R.J., D.A. Kingsley, R.D.Quinn, and R.E. Ritzmann, "A Cockroach Robot with Artificial Muscles," Proceedings of the 5th International Conference on Climbing and Walking Robots (CLAWAR 2002), Paris, 25-27 Sept. 2002.
14. Watson, J. T. and R. E. Ritzmann (1998). Leg kinematics and muscle activity during treadmill running in the cockroach, Blaberus discoidalis:slow running. J. Comp. Physiol. A 182: 11-22.
15. Powers, A.C. (1996) Research in the Design and Construction of Biologically-Inspired Robots. M.S. Thesis, University of California, Berkeley.
16. Loeb, G.E., Brown, I.E., Cheng, E.J. (1998). A hierarchical foundation for models of sensorimotor control. Exp. Brain Res. 1999, 126: 1-18.

## Linear Electromagnetic

Linear Electromagnetic actuators consist of a hollow coil (solenoid) and a ferrometal rod. The rod is mounted loose in the coil and can move up and down. When current flows through the coil, the rod is pulled to the center of the coil. If the direction of the current is then reversed the solenoid will pull in the ferrometal rod. Due to Lenz's Law which states "For a current induced in a conductor, the current is in such a direction that its own magnetic field opposes the change that produced it." This means that an EMF will flow through the solenoid of the actuator to oppose the change in magnetic flux thus an electromagnetic actuator can never fully extend the full length of the rod.

Note to further modifiers: Feel free to tidy my Lenz's Law explanation up - i'm sure it could be written in a more elegant manner! --SamEEE 03:18, 3 February 2007 (UTC)

### Applications

This type of actuator is useful for momentary linear motion. e.g. closing a gripper.

### Design Considerations

Solenoids use a large amount of power this requires more battery power which in turn requires more battery power to move the robot. A general rule of thumb is to use a electromagnetic actuators for small operations and for larger operations prehaps consider the use of Pneumatics the output power/weight ratio is usually more favorable. For more information on Pnuematics please consult the corresponding section of this book.

#### Calculating Force

Calculating how strong the actuator is, isn't very easy. However it is possible by using a Newtonmeter to the line of action and measuring how many Newtons are exerted by the solenoid on the measuring device. There are also a way of measuring force though use of a formula however the forementioned method is usually the most practical.

## Piezoelectric Actuators

Piezoelectric actuators are actuators that take advantage of the piezoelectric effect found in certain materials.

### Piezoelectric Effect

The piezoelectric effect as shown when an electric potential is applied

Certain materials have a characteristic of generating an electric potential when compressed or expanded. The amount of potential across the surface is determined by the force of displacement.

Because an electric potential is created from a change in volume, a change in temperature also has the ability of generating an electric potential.

The piezoelectric effect also has an inverse effect. When a voltage is applied to a material with piezoelectric properties, the material expands or contracts depending on the polarity of the voltage applied. The inverse piezoelectric effect is the basis of piezoelectric motors.[24]

#### Materials with the Piezoelectric properties

Piezoelectricity naturally occurs in symmetrical crystals. Piezoelectric materials can also be manufactored as ceramics.

Crystals

• Quartz
• Tourmaline

Ceramics

• Barium Titanate

More Materials can be found by going here, and filtering for the piezoelectric category.

### Piezoelectric Actuators

The ability to change shape when a voltage is applied can be used to displace objects. This basically allows electrical energy to be converted to mechanical energy.[25] This can be used to rotate motors or even

#### Piezoelectric Motors

##### Linear

The concept behind a linear piezo motor is layering a stack of piezoelectric discs that will push on each other and eventually push on a surface at an angle which will propel the object forward. The distance the propeller pushes is limited, but the frequency can be very rapid. The input voltage can change the output speed and allows a great amount of accurate movements. The force exerted is minimal and lessens the worry of breaking smaller objects.

##### Rotary

A rotary motor can work in the same fashion as the linear motor, except when you apply this concept at a much steeper angle to an axle, the linear motion is turned into a rotational motion. Two of these linear motors applied on both sides of a disc in the same direction can spin the disc. This is the same concept in a pitching machine used to sling baseballs.

##### Stepper

Using a piezoelectric material for a stepper motor can give you better precision due to the short distances involved. By placing piezoelectric motors in oppposing directions operating at frequencies that are slightly out-of-phase, the rotation is slight between the time when piezoelectric motors have the disc in a “hold” state. The slight movements and rapid response allow the rotation to be precise.

##### Squiggle Motor[26]

New Scale Technologies has taken this concept and applied it to a nut and bolt to create a type of screwing effect. The vibrations caused by the piezoelectric material cause the nut to exhibit a “hula hoop” effect to the threads, moving the screw up or downward depending on polarity. This can be used to push an object on a small scale very accurately.

### Robotics Applications

Piezoelectric motors have the benefit of being very precise at very fast frequencies. They can also operate on a very small scale allowing robots to become smaller. Piezoelectric motors have the benefit of being able to exert a large displacement with a low driving voltage. Another benefit is the minimal amount of EMI/RFI noise created.

They can be wired in such a way to be senors as well. They can be used to determine the number of rotations, or if there is a force being exerted against a surface.

### References

1. ^ CRC and IEEE Press. The Electrical Engineering Handbook, 2nd Ed. Ed. Richard C. Dorf. CRC Press, 1997. Pg 1280.
2. ^ “Piezoelectric Actuator.” electronics-manufacturers.com. 21 October 2008.
3. Stutts, Dr. Daniel. Piezoelectric Motor Research. 21 October 2008.
4. Cook, Gordon. "An Introduction to Piezoelectric Motors." Sensors. 01 December 2001. 21 October 2008.
5. ^ "Squiggle Motors." New Scale Technologies. 21 October 2008.