Part 1 · How robots move

12Wheels: how rovers turn with no steering wheel

A rover has two wheels, two motors and nothing that steers. Drive one, watch what each wheel is told, and see that a difference between the wheels is what turns it.

This assumes: What makes something a robot?. About 9 minutes of reading.

Sit in a wheelchair with your hands on the two big wheels. To go straight, push both the same. To turn, push one harder than the other. To spin on the spot, push one forward and pull the other back. Nothing on the chair steers. There is no wheel to point; there are two wheels to push, and every path the chair can take comes from the difference between your two hands.

The rover from the first module turns the same way. This module puts you in the driving seat, with a readout of what each wheel is told, so that turning becomes arithmetic you can see.

Two motors, no steering

Look at the rover's underside in your head. Two wheels sit on one line across the body, one on the left and one on the right, and each has its own motor. Behind them is a small gray ball that carries the back of the body. That is everything that touches the floor.

Every turn of a wheel rolls it along the floor by the distance round its edge, so a wheel turning faster covers more floor in the same second. When both wheels turn at the same speed, the two sides cover the same distance and the body between them goes straight. When the right wheel turns faster, the right side covers more floor than the left. The two sides are bolted to one body, so the only way the right side can get ahead is for the body to swing round toward the left. The rover turns left, and the bigger the difference, the tighter the turn. That is differential drive: steering by wheel speed alone, with a body that turns toward whichever wheel is slower.

The gray ball at the back is a caster, a wheel or ball that is neither driven nor steered, which follows wherever the driven wheels take it, as a shopping trolley's swiveling front wheels do. The rover's is a ball, so it rolls in any direction, and it is made slippery on purpose so that it skates round when the rover spins.

Four motions from two numbers

A wheel rolls along the way it points and will not slide sideways. It can be dragged along its own direction, skidding, as you will see at the wall, but not across. Both of the rover's wheels point straight ahead, so all the body can do is roll, and swing. Picture the line through the two wheels, the axle line. A wheel can only go round a point that is off to its side, on that line, because going round anywhere else would mean moving partly sideways. So every motion the rover makes is either straight, or a swing about a point on the axle line, and where that point is depends on the two speeds.

Both wheels the same speed: straight ahead, or straight back, and no swing at all. One wheel a little slower: both wheels walk round circles about the same center, like two runners on the inside and outside lanes of a track. The center is out beyond the slower wheel, because that is the side whose lap is shorter; the closer the two speeds, the further out it sits and the wider the curve.

One wheel stopped: the center is the stopped wheel itself, which stays planted while the other wheel walks a circle round it. Wheels at the same speed in opposite directions: the center is midway between them, and the body spins on the spot, going nowhere at all.

A car cannot do that last one: its back wheels would have to slide sideways, and they will not, so a car turns only by rolling along a curve several meters across. A differential-drive rover turns on the spot in a space its own size, which is why a robot vacuum can get out of a corner and a warehouse robot can spin under a shelf.

Driving it

The box below has the rover in its walled pen and the yellow beacon. The view is from behind the rover's starting corner, so pushing forward drives it up the screen. An orange line is drawn on the floor behind the rover wherever it goes, and the Reset button above the controls puts the rover back in its corner and wipes the line.

Under the box is a round pad with a knob in it: a stick. Drag the knob, or click it once and hold the arrow keys: up and down drive, left and right turn. Let go and the wheels stop. A sentence beside the pad names the motion the wheels are making.

Under the pad, two bars show what each wheel is told, in radians per second. A radian is a unit of turning: something going round a circle has turned one radian when it has traveled one radius's length along the circle, which is about 57 degrees, and 6.3 of them make a whole turn. Every radian a wheel turns rolls it one radius along the floor, and the rover's wheels have a radius of 5 centimeters, so a wheel told 8 radians a second would cover 40 centimeters of floor a second. Each bar says "told", the speed the motor was asked for, and "turning", the speed the wheel actually reached, a little less, for a reason that comes after the tries. Below the bars, the ground line says what the body is doing: its speed in centimeters per second, and its turn rate in degrees per second, to the left or right.

The stick gives the box two numbers, how far forward you are pushing and how far to the side, and two rules mix them into the two wheel speeds. The forward push goes to both wheels. The sideways push is added to one wheel and taken from the other, so that pushing left speeds up the right wheel and slows the left. So push the knob to the top left corner, the same amount forward and left, and the left wheel gets forward minus left, which is nothing, while the right gets forward plus left: one wheel stopped. Push straight left and the two wheels get equal and opposite: the spin.

Whatever you ask for, the faster wheel is never told more than 8 radians a second, and the other is scaled down with it. The arrow keys push the knob for you: a turn key on its own pushes it all the way sideways, and a turn key held with a drive key only half as far, so the rover arcs instead of swinging round a stopped wheel.

Loading the simulation. The robot runs in your browser, so the first one takes a few seconds to arrive.

This is easier on a larger screen, but it works here too.

The keys and the knob go through the same mixing. Hold the up and right arrows together and the wheels are told 8.0 and 2.7: the rover curves right at about 75 degrees a second while moving 26 centimeters a second, and its line is a circle about 40 centimeters across. Drag the knob only halfway up and both wheels are told the same smaller number, and it goes straight at about 17 centimeters a second.

What you saw

Every motion came from the same two bars: equal for straight, unequal for a curve toward the shorter one, one empty for the swing, opposite for the spin.

The numbers on the ground line all follow from the two "turning" numbers on the bars. A wheel turning at 7.7 radians a second covers 7.7 times its 5-centimeter radius, about 38 centimeters of floor a second; one at 2.6 covers about 13; one at 3.3 about 17. The body sits midway between the wheels, so it moves at the average of the two. Two wheels at 38 gave 38. One at 38 and one at 0 gave 19. One at 38 and one at 13 gave 26. Two at 17 gave 17.

The turn rate follows from the difference, and the two wheels are 19 centimeters apart. Take the swing first. The moving wheel walks a circle whose radius is that 19 centimeters, so every 19 centimeters it covers is one radian of swing, and at 38 centimeters a second that is two radians a second, about 115 degrees. Put another way, the moving wheel gained 38 centimeters a second on the stopped one, and 38 across the 19 between them is two radians: the general rule. Whatever the two wheels do, the distance the outer one gains on the inner each second, across the spacing between them, is the swing in radians a second, because the body has to swing to make up exactly that gap.

The other two motions are the same rule with a different gap. In the spin the wheels went opposite ways, 38 forward and 38 back, so the gap was 76 a second, and 76 across 19 is four radians, about 230 degrees. In the curve the wheels covered 38 and 13, a gap of 25, and 25 across 19 is 1.3 radians, about 75 degrees. And since a radian is one radius of travel, a body traveling 26 centimeters a second while swinging 1.3 radians a second is going round a circle with a radius of 26 divided by 1.3, 20 centimeters: a circle 40 centimeters across. The swing and the spin read 110 and 220 rather than 115 and 230, a few per cent under the sums, because the wheels slip a little on the floor while the rover turns.

Told and turning

Two things in the readouts were not quite what the motors were told. A motor does not make a speed; it makes a push, and something has to decide how hard. Each motor here follows one rule: push in proportion to how far the wheel is short of the speed it was told. If the wheel ever reached that speed exactly, the rule would push nothing, and the floor's drag would slow the wheel again. So the wheel settles a little short, where the push equals the drag. Rolling along a floor costs little drag, so a wheel told 8.0 settled at 7.7. Scraping a wheel across the floor under the rover's weight costs far more, so against the wall the wheels settled further short, at about 7.

The "turning" number comes from a sensor on each wheel's axle that counts how far the wheel has turned. What no sensor on a wheel can tell is whether the floor went by underneath: against the wall the wheels turned, the body went nowhere, and the sensors reported turning all the same. That gap is why a robot cannot trust its wheels to tell it where it is, a problem a later module is about.

One honest note

While you hold the knob, you are the think step, and the rover is the remote-controlled car from the first module: it acts, and the sensing and deciding are yours; in the first module a script decided the two wheel speeds from what the rover sensed. In this simulation the wheels grip the floor well, so the rover does almost exactly what the two numbers say. A real rover on a carpet has one wheel grip a little better than the other, and told to go straight it drifts to one side. That is not a flaw in the idea; it is one more reason to keep sensing.

Watch

What are the 3 Types of Turns for an FLL Robot? — Builderdude35 (2:12 of it, starting at 0:00)

Why this video
It is the module's whole idea done on a real two-wheeled robot, on a mat, with the wheels in view. A LEGO Mindstorms robot does each of the three turns while a teenager who builds them says plainly what the wheels are doing: one forward and one back and it spins in place; one stopped and the other driving and it swings round the stopped wheel; both forward with one faster and it curves, the faster wheel on the outside. At the end he changes only the split of power between the two wheels and the curve tightens or opens. Nothing is steered; only the speeds change.
What to watch for
At 0:25 the spin turn: watch the two wheels go opposite ways and the robot turn about the point between them. At 0:49 the pivot turn: one wheel sits still and the robot swings round it. At 1:22 the smooth turn: both wheels forward, one faster, and the robot arcs like a car. From 1:57 the captions read 25/75, 45/75, 65/75, the power to the left and right wheels; the closer the two numbers get, the wider the curve.

Words introduced

differential drive
Steering by wheel speed alone. Two wheels on the same line across the body, each with its own motor; the same speed on both goes straight, a difference turns toward the slower wheel, and opposite speeds spin the body on the spot.
caster
A wheel or ball that is not driven and not steered. It carries weight and follows whatever the driven wheels do.
radian
A unit of turning. Something going round a circle has turned one radian when it has traveled one radius's length along the circle; that is about 57 degrees, and 6.3 radians make a whole turn.

Where next

Suggested next: 13. Legs and balance: why walking is hard — A rover cannot fall over. A dog can, every step it takes. Walk a four-legged robot, shove it, and see what four stiff legs can hold and what they cannot.