Getting from here to there
Animals have found dozens of ways to move: fish swim, birds fly, snakes slither, horses gallop, kangaroos hop, and geckos walk up walls. Robot designers have the same choice to make, and no single answer is best. A robot that delivers parcels across a warehouse floor, one that climbs the rubble of a collapsed building, one that inspects a wind turbine and one that welds car doors need completely different ways of moving.
In What is a robot? you met the sense–think–act loop, and in How robots sense the world the first part of it. This lesson is about the last part, act: the bodies, motors, gears and batteries that let a robot move itself or move things. At the end you will calculate exactly how a two-wheeled robot must drive its wheels to go round in a circle.
Wheels, tracks, legs, propellers and arms
Wheels are the most common choice for robots that move about, because on a flat floor nothing wastes less energy. Warehouse robots, robot vacuums, hospital delivery robots and most school robots roll on wheels. Many have just two driven wheels, one on each side, plus a little free-spinning wheel or ball to stop them tipping over. Steps, deep mud and stairs defeat them.
Tracks, like those on a tank or a snow vehicle, spread the robot's weight over a long belt, so it can cross soft ground, sand and rubble. Robots that search collapsed buildings or inspect pipes often use tracks. Tracks have to skid sideways to turn, which wastes energy and wears them out.
Legs can step over obstacles, climb stairs and cross rocky ground where wheels get stuck. Four-legged robots such as ANYmal (from Switzerland), Spot (from the United States) and the Unitree robots (from China) inspect factories, tunnels and power stations. But legs are hard: the robot must balance all the time, and planning where to put each foot takes a lot of computing. You will see how in Legged locomotion.
Propellers let drones fly. A drone with four propellers, called a quadcopter, spins two of them clockwise and two anticlockwise so that it does not twirl round, and steers by making some propellers spin faster than others. Flying lets a robot go anywhere and see everything from above, but it uses a lot of energy, because the drone must push air down every second just to stay up. Underwater robots use propellers too, called thrusters.
Arms are different: instead of moving the robot, they move things. A factory arm is a chain of stiff links joined by motorised joints, ending in a gripper, a welding torch, a paint sprayer or a suction cup.
| How it moves | Good at | Hard part | Examples |
|---|---|---|---|
| Wheels | flat floors, saving energy | steps, mud, stairs | warehouse robots, robot vacuums |
| Tracks | soft ground, rubble | turning wastes energy | rescue and pipe-inspection robots |
| Legs | stairs, rocks, gaps | balance, lots of computing | four-legged inspection robots, humanoids |
| Propellers | going anywhere, seeing from above | short battery life | camera drones, delivery drones |
| Arms | moving objects precisely | only reach so far | welding, packing, surgical robots |
Motors: how a robot turns electricity into movement
Almost every robot moves with electric motors. (A few big machines use oil pressure, called hydraulics, or air pressure, called pneumatics, but motors are by far the most common.) Inside a motor, magnets and coils of wire push against each other when electricity flows, and that push turns a shaft. Lumenary EE explains how in Magnetism and motors. Here are the three kinds you will meet most often.
Definition— DC motor
A DC motor spins steadily when connected to a battery. Give it more voltage and it spins faster; swap the wires round and it spins the other way. On its own it has no idea how far it has turned, so robots often add an encoder (from the last lesson) to count its turns. To control its speed, a robot usually switches the power on and off very quickly, hundreds or thousands of times a second: the longer the "on" part of each flicker, the faster it goes.
Definition— servo motor
A hobby servo is a small box holding a DC motor, a set of gears, a sensor that measures the angle of the output shaft, and a tiny control circuit. You don't tell it "spin"; you tell it "go to 90 degrees", and it turns there and holds that angle, pushing back if something tries to move it. Most hobby servos can only turn about half a circle. Robot arms, model aircraft and walking toys use them.
Definition— stepper motor
A stepper motor turns in small, exact steps. A common kind takes 200 steps to go once round, so each step is degrees. Send it 50 steps and it turns exactly a quarter of a circle. 3D printers, camera sliders and some small robots use steppers because they can move to an exact position without needing a sensor.
Drones use another kind, the brushless motor, which is efficient and very long-lasting, and large robot arms use powerful motors with built-in sensors in every joint.
Gears: trading speed for strength
A small electric motor spins remarkably fast, often thousands of turns per minute, but it is weak: you could stop its shaft by pinching it. A robot's wheels need the opposite: to turn slowly, but strongly enough to push the robot along. Gears make that trade.
Each time a tooth of the small gear passes the meeting point, one tooth of the big gear passes too. So for the 36-tooth gear to go round once, the 12-tooth gear must go round times. The big gear turns 3 times more slowly, but it turns with about 3 times the turning force (engineers call turning force torque), minus a little lost to friction. The number is called the gear ratio, written 3 : 1.
Analogy, not a formal construction
A bicycle's gears do the same job for your legs. In a low gear you pedal round and round while the bike creeps uphill: fast pedalling, slow wheel, lots of force. In a high gear each push of the pedal moves you a long way, but it is hard to get going.
Example— A small robot's gearbox
The small motors in many school robot kits come with a gearbox built on. Suppose a motor spins 9,600 times a minute with nothing attached, and its gearbox has a ratio of 48 : 1. Then the wheel turns at most times a minute, slow enough for a robot, and with about 48 times the motor's turning force (less what friction takes).
Degrees of freedom
How many different ways can something move? A door can only swing on its hinges: one way. A drawer can only slide in and out: one way. Roboticists count these independent ways of moving.
Definition— degrees of freedom
The degrees of freedom of a body or a robot are the number of separate numbers you need to say exactly where it is and how it is turned. A door has 1 (its angle), a train on a track has 1 (how far along it is), and a robot on a flat floor has 3: how far east, how far north, and which way it is facing.
A robot arm usually has one motor per joint, and each joint adds a degree of freedom. To put a tool anywhere within reach and point it in any direction, an arm needs 6: three to choose the position (left–right, forwards–backwards, up–down) and three to choose how the tool is turned. That is why so many factory arms have exactly 6 joints. Your own arm, from shoulder to wrist, has 7, which is one more than strictly needed: that spare lets you keep your hand still on a table while you move your elbow. A drone flying in the air has 6 degrees of freedom too, although it has only 4 propellers to control them; you will see in Aerial robots how it manages.
Something curious happens with the two-wheeled robot. On a flat floor it has 3 degrees of freedom, but it has only 2 motors, and there is no way to make it slide straight sideways: it must turn and drive instead. A car has the same problem, which is why parking in a tight gap takes several moves back and forth. Some robots use special wheels with little rollers around their rims that can slide sideways, so they can move in any direction.
Driving in a circle
Our two-wheeled robot steers by driving its wheels at different speeds. Equal speeds: it goes straight. Left wheel faster: it curves to the right. Right wheel faster: it curves to the left. Wheels at equal speeds in opposite directions: it spins on the spot.
Suppose you want it to drive round a circle. How fast must each wheel go? The trick is to notice that the two wheels travel round two different circles.
The distance round a circle of radius is , where . The middle of the robot follows a circle of radius . The wheels are a distance apart, so the inner wheel is closer to the centre and the outer wheel farther away:
- inner wheel's path in one lap: ;
- outer wheel's path in one lap: .
Both wheels must finish the lap at the same moment, so each wheel's speed is its path length divided by the lap time. Finally, a wheel of diameter rolls for each turn, so to know how many times a wheel must turn each minute, divide its speed by and multiply by 60.
Here is the whole calculation for a small robot with wheels 16 cm apart and 6.5 cm across, driving once round the circle in 20 seconds, for circles of several sizes. Press Run.
import math
TRACK = 0.16 # metres between the centres of the two wheels
WHEEL_DIAMETER = 0.065 # metres
LAP_TIME = 20.0 # seconds to drive once round the circle
def wheel_speeds(radius):
# radius: metres from the centre of the circle to the middle of the robot
inner_path = 2 * math.pi * (radius - TRACK / 2) # one lap, inner wheel
outer_path = 2 * math.pi * (radius + TRACK / 2) # one lap, outer wheel
return inner_path / LAP_TIME, outer_path / LAP_TIME
def turns_per_minute(speed):
# how many times a wheel turns each minute to roll at this speed
circumference = math.pi * WHEEL_DIAMETER
return speed / circumference * 60
print("circle radius | inner wheel | outer wheel")
for radius in [1.0, 0.5, 0.2, 0.08, 0.0]:
inner, outer = wheel_speeds(radius)
print(f" {radius:4.2f} m | {inner:6.3f} m/s {turns_per_minute(inner):5.1f} rpm"
f" | {outer:6.3f} m/s {turns_per_minute(outer):5.1f} rpm")("rpm" means revolutions, or turns, per minute.) Read the table from the top.
- For a 1 m circle, the wheels are nearly matched: the inner wheel rolls at 0.289 m/s (84.9 rpm) and the outer at 0.339 m/s (99.7 rpm). Big circles are nearly straight lines.
- For a 0.5 m circle, the inner wheel needs 38.8 rpm and the outer 53.5 rpm.
- For a 0.08 m circle, exactly half the track width, the inner wheel's speed is 0: it stays still while the robot pivots round it.
- For a 0 m circle, the inner wheel goes backwards (−7.4 rpm) while the outer goes forwards (7.4 rpm): the robot spins on the spot.
Try changing the program: drive the 1 m circle twice as fast by setting LAP_TIME = 10.0; put bigger wheels on by changing WHEEL_DIAMETER; or add a radius of 0.05 to the list and see the inner wheel go backwards.
A real robot needs one more thing: sensors. If one wheel slips or one motor is slightly weaker, the robot drifts off its circle. In Wheeled robots and odometry you will use encoders to track exactly where the robot has got to, and in Feedback and PID control you will make the motors correct themselves.
Batteries: why robots run out
A robot that moves about carries its energy with it, almost always in a rechargeable battery. Two measurements matter:
- Energy is how much work the battery can do when full, measured in watt-hours (Wh).
- Power is how fast the robot uses energy, measured in watts (W).
The time a battery lasts is roughly energy ÷ power.
Example— How long will it last?
A small educational robot has a 10 Wh battery. Driving around, its motors and computer use about 5 W, so it lasts about hours. Sitting still with only its computer running, it might use 1 W and last 10 hours.
Now a small camera drone with a 60 Wh battery. Its propellers must hold it up the whole time, so it uses perhaps 150 W, and it flies for only about hours, which is 24 minutes.
That is why robots that walk or fly run out of charge much sooner than robots that roll, and why a good robot keeps an eye on its battery gauge and, like a robot vacuum, heads back to its charging dock before it runs out. Knowing when to recharge is part of a robot's autonomy too.
Batteries also need respect. The lithium-ion batteries in phones and robots store a lot of energy in a small space; if one is crushed, punctured, short-circuited (its two ends connected directly by metal) or charged with the wrong charger, it can overheat and even catch fire. Robot kits for learners use ordinary AA batteries or small, protected packs with their own chargers. Use the charger that came with a battery, stop using any battery that is swollen, damaged or hot, and leave larger batteries to adults with the right training. Lumenary EE's Power and energy explains watts and watt-hours further.
Common misconceptions
Misconception
"Legs are always better than wheels, because animals have legs." On flat ground, wheels are simpler, cheaper and use far less energy. Animals have legs partly because a living wheel would need a joint that spins freely without stopping, which bodies cannot easily grow. Engineers choose legs only where the ground demands them.
Misconception
"A bigger gear ratio makes a robot better." It makes the wheels stronger but slower. A robot geared too low crawls; a robot geared too high may not be able to start moving or climb a slope. The right ratio depends on the job.
Misconception
"To turn, a two-wheeled robot needs a steering wheel." It steers by driving its two wheels at different speeds, as the table above shows. This is called differential drive, and it is how most robot vacuums and many warehouse robots turn.
Misconception
"A full battery always gives the same running time." The time depends on the power being used: driving uphill, carrying a load, or flying in wind all use more power and drain the battery faster. Batteries also deliver less energy when they are cold, and hold less as they get old.
Exercises
Some exercises are calculations you can do with a pencil or a calculator; two ask you to write a little Python.
1. How robots move
Warm-upHumanA team in Valparaíso is designing a robot to inspect an old building with staircases, narrow corridors and loose rubble, and to carry a camera to every floor. Which way of moving suits it best?
2. How robots move
CoreHumanA small motor spins 7,500 times a minute. It drives a wheel through a gearbox with a ratio of 25 : 1 (the motor turns 25 times for each turn of the wheel). How many times a minute does the wheel turn?
3. How robots move
Warm-upHumanA stepper motor takes 200 steps to go once round. How many steps must it take to turn three quarters of a circle (270 degrees)?
4. How robots move
CoreHumanWhy do so many factory robot arms have 6 joints?
5. How robots move
CoreHumanA four-legged robot carries a 30 Wh battery. While walking it uses about 90 W. Roughly how many minutes can it walk on a full charge?
6. How robots move
CoreComputationalWrite wheel_turns(distance, diameter), which returns how many times a wheel with the given diameter must turn to roll the given distance (both in the same units, for example metres).
The starter divides by the diameter, which is not quite right. Fix it. For a wheel 0.065 m across rolling 1 m, the answer should be about 4.9 turns.
7. How robots move
StretchComputationalWrite wheel_speeds(radius, track, lap_time) for a two-wheeled robot driving once round a circle in lap_time seconds. radius is measured to the middle of the robot, and track is the distance between its wheels (both in metres). Return a pair (inner_speed, outer_speed) in metres per second.
The starter gives both wheels the speed of the middle of the robot, which would make it drive straight. For a 0.5 m circle with a 0.16 m track and a 20 s lap, the answer should be about (0.132, 0.182).
Further reading and resources
- ROBOTS: your guide to the world of robotics · IEEE SpectrumCompare how hundreds of real robots move, from wheeled and legged robots to drones and swimming robots.
- Modern Robotics · Kevin M. Lynch and Frank C. ParkA university textbook with free videos. Its first chapters, on configuration space and degrees of freedom, are a good next step when you are older.