Skip to the lesson
FixTheRobot Explore Robotics / Robot Foundations / Module 3 / Lesson 3

Robot Foundations · Module 3: Making a Robot Move

Commands Are Not Motion

Sending a command is not the same as arriving. Small differences between what was ordered and what happened add up.

  • Lesson 3 of 4
  • Beginner
  • No code
  • About 8 minutes

Tell Pip to drive both wheels at 0.5 m/s for 10 seconds and arithmetic says it will be exactly 5 m ahead, facing the same way. Try it on a real floor and it ends up well off to one side, pointing somewhere else. Nothing is broken. The arithmetic described a perfect robot, and no robot is perfect. This lesson is about the gap between the two, which is the reason robots need sensors at all.

What you will be able to do

  • Give three reasons a robot does not move exactly as commanded.
  • Explain why a small error in a wheel becomes a large error in position.
  • Say what open-loop control is and when it is good enough.
  • Explain why a heading error is more damaging than a distance error.

The idea

The formulas of the last two lessons assumed four things without saying so. Each one fails a little on a real robot.

Four assumptions of the motion formulas and how each fails on a real robot
The formula assumedWhat really happensEffect
Both wheels are exactly the size the program thinksTyres wear, squash under load and differ from each other by a percent or soEqual commands give a slow curve
Wheels never slipThey slip a little when accelerating, turning, or on dust and smooth floorsThe robot travels less far, or turns less, than the wheels did
A commanded speed is reached at onceA motor needs time to speed up, and a heavy robot more so. A low battery makes it weakerThe robot lags behind the command
The floor is flat and uniformSlopes, bumps, cables and carpet edges push the robot aroundSudden small changes of heading

These effects are small. A good robot might be wrong by one or two percent. The trouble is what happens to small errors over time.

Small errors grow

Suppose Pip's right tyre is 2% larger than the program believes. The program sends equal commands. The right wheel covers 2% more ground than the left, and by the formula of the last lesson that difference is a turning speed: Pip is steadily turning left, by about 1.9° every second, though it was told to go straight.

Pip commanded to drive straight for 10 secondsA dashed straight line shows the path the commands describe, 5 metres long. An orange curve shows the path actually driven: it starts along the line and bends steadily to the left, ending 0.83 metres from where the commands say the robot should be.where the commands say: 5 m straight ahead 0.83 m off where it really is
Equal commands to both wheels for 10 s, with one tyre 2% oversize. Dashed: the path the program believes. Orange: the path driven.
How the error of Pip with one tyre 2% oversize grows with time
AfterBelieved distanceHeading errorSideways error
1 s0.5 m1.9°1 cm
2 s1 m3.8°3 cm
5 s2.5 m9.5°21 cm
10 s5 m19.1°83 cm

Look at the last column. The sideways error does not grow in step with time. Doubling the time roughly quadruples it. That is because the mistake is in the heading, and a wrong heading sends every later centimetre of travel in the wrong direction.

An error in distance stays the size it is. An error in heading keeps producing new error for as long as the robot drives.

Open-loop control

Driving by commands alone, without checking the result, is open-loop control. The loop of sense, think, act is cut: the robot acts, and never looks.

The robot loopThe robot loop with its return path cut. Think sends fixed commands to Act, Act causes motion in the World, and a dashed line shows that the result is never sensed. SenseNot usedThinkFixed commandsActDo it WorldWhat really happened: unknown readings commands motion never checked
Open loop: the robot sends commands and never finds out what they did.

Open loop is not wrong. It is simple, and it works when the move is short, slow and nothing is in the way: backing 10 cm away from a wall, for example. It fails when the move is long, when precision matters, or when anything unexpected can happen. That describes almost every useful task.

You cannot fix this by measuring the tyres more carefully. Calibration helps, and good robots do it. But slip and bumps are different on every run, so no fixed correction removes them. The only cure is to look at what happened, which is the subject of the next lesson.

Words to know

Open-loop control
Sending commands without measuring their result. On Pip: "both wheels at 0.5 m/s for 10 s".
Error
The difference between what was wanted and what happened. On Pip: 0.83 m after the 10 s run.
Slip
A wheel turning without moving the robot by the matching amount. On Pip: on a dusty patch it travels less far than its wheels turned.
Lag (delay)
The time between sending a command and the robot fully responding. On Pip: it takes a fraction of a second to reach a new speed.
Drift
An error that keeps growing because each step builds on the error before it. On Pip: its believed position moves further from the truth the longer it drives.
Calibration
Measuring a robot's real dimensions and correcting the numbers the program uses. On Pip: driving a measured 5 m and adjusting the wheel radius in the program until the count agrees.
Disturbance
Anything that pushes the robot that the program did not command. On Pip: a cable on the floor, a slope, a nudge from a person.

A worked example: how much does a 2% tyre cost?

Pip is commanded 0.5 m/s on both wheels for 10 s. The right tyre is 2% oversize. The wheels are 0.3 m apart.

  1. Real wheel speeds. Left: 0.5 m/s. Right: 0.5 × 1.02 = 0.51 m/s.
  2. Turning speed. ω = (0.51 − 0.5) ÷ 0.3 = 0.0333 rad/s, about 1.9° per second.
  3. Heading after 10 s. 1.9° × 10 ≈ 19°. The program believes the heading is still 0°.
  4. Position. Stepping the motion model of module 2 forward with these speeds puts Pip at (4.96, 0.83). The program believes it is at (5, 0).
  5. The miss. The distance between those two points is 0.83 m.

A 2% error in one tyre, which is about a millimetre on Pip's wheels, became a miss of 83 cm after 5 m: enough to hit a door frame. And this example had no slip, no bumps and no delay. A real run has all of them.

Try it yourself

Find a clear stretch of floor about 5 m long and pick a target, such as a chair. Stand facing it, close your eyes, and walk to where you think it is. Open your eyes. (a) How far off are you, and in which direction? (b) Try again over 2 m. (c) What does this tell you about distance and open-loop error?

What to expect

Most people end up to one side, often by half a metre or more over 5 m, and much closer over 2 m. Your legs are not identical and neither are your steps, exactly like a robot's wheels. The error is mostly sideways, because a small error in direction early on carries you steadily off line. With your eyes open you would have corrected without noticing. That correction is feedback.

Common mistakes

"My robot curves, so the code must be wrong."

Possibly. But first check the hardware: unequal tyres, a dragging wheel or a loose motor produce a curve from perfectly correct code. Swap the wheels left to right. If the curve changes direction, it is the wheels.

"A more precise robot does not need sensors."

More precision makes the error grow more slowly. It never stops the growth. Even a robot accurate to one part in a thousand is lost after a long enough drive.

"The errors will cancel out on average."

Random errors partly cancel. Steady ones, such as a tyre that is too large, always push the same way and add up. And nothing ever cancels the collision that happened half way.

Remember this

  1. Real robots differ from the formulas: unequal wheels, slip, lag and uneven floors.
  2. Errors accumulate, and an error in heading is the worst kind because it misdirects all later motion.
  3. Open-loop control sends commands and does not check. It suits only short, slow, low-risk moves.
  4. Calibration reduces error. Only measuring the result removes it.

Check yourself

Three questions. Write an answer in your own words, then reveal the explanation. Nothing you type leaves your browser.

Question 1

A robot is told to drive 10 m straight, open loop. It arrives 9.6 m ahead and 0.1 m to the side. A second robot arrives 10 m along its path but 1.5 m to the side. Which had a distance error and which a heading error?

Explanation

The first has mainly a distance error: it went about 4% short, perhaps from slip or a wheel radius that is too large in the program. The second has a heading error: it travelled the right distance in a slightly wrong and steadily worsening direction. The second is the more dangerous kind, because it grows faster with distance.

Question 2

Why can careful calibration not remove the need for feedback?

Explanation

Calibration corrects errors that are the same on every run, such as wheel size and wheel base. Slip, bumps, a changing load and a draining battery differ from run to run and from moment to moment, so no number fixed in advance can cancel them. They have to be measured as they happen.

Question 3

Give one task where open-loop control is a reasonable choice, and say why.

Explanation

Any short, slow move where a small error does no harm: backing 10 cm out of a charging dock, nudging forward to press a bumper against a wall, opening a gripper fully. The move ends before much error can build up, and the cost of being slightly wrong is nothing.

What’s next

The robot has to look at what happened. The next lesson shows how little that takes: measure, compare with what you wanted, and correct in proportion.

Next lesson

Feedback: Measure, Compare, Correct

Compute an error and a proportional correction, and explain why a loop that keeps correcting beats a perfect plan.

The lab of this module (after lesson 4)

Make Your First Robot Move

Drive a robot by hand, read its state, compute the error to a target and write the loop that drives it there. About 25–35 minutes.

Where this goes on the site

Nothing below is needed to continue this course. These pages take the topic of this module further, and most assume more mathematics or Python than this course does.