13Legs 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.
This assumes: The parts of a robot, Wheels: how rovers turn with no steering wheel. About 9 minutes of reading.
Stand on one leg and close your eyes. Within a second or two you start to sway, and something in your ankle and hip pushes back, over and over, without your asking. Standing is a thing you keep doing, and if you stopped, you would be on the floor.
A table does none of that. Four legs, a top, and it stands for a hundred years without correcting anything. The four-legged robot in the box below is somewhere between the table and you, and a shove is what shows where.
Why a rover never falls
The rover from the last module touched the floor in three places: two wheels and a caster, spread across its body. Its weight pressed straight down somewhere in the middle of those three, and nothing it did could change that. Spin, skid, hit a wall, get shoved: its weight still landed between its wheels. A rover cannot fall over, and it cannot do anything about the floor either: a step, a curb, a staircase, and the trip is over.
A wheel has to roll over whatever is in front of it, and a step taller than its axle simply pushes it back. A leg lifts its foot and puts it down on top of the step, whatever its height. That is what legs buy. The price is that the moment a foot leaves the floor the body is resting on fewer points than it was, and that is what makes walking hard. To say why, it helps to have two ideas from the table.
The patch under your feet
The first idea is that a body's weight, though spread through every part of it, pulls down as if from one spot. Balance a ruler on a fingertip: there is one place along it where it rests, and everywhere else it tips. That spot is the ruler's balance point, the one spot through which its whole weight can be taken to pull straight down. Every body has one, and from here on "where the weight lands" means the spot on the floor directly below it.
The second idea is what holds the weight up. Draw a line around everything touching the floor. For a table that is the four leg-ends, and the line encloses a rectangle. That rectangle is the table's base of support: the patch of floor enclosed by whatever is touching it, and the only place the floor can push up. Picture a plank across two bricks. Set a weight down between the bricks and the plank rests, because there is a brick on each side to share it. Set it down beyond one brick and the plank tips over that brick, because every support is now on one side of the weight and nothing is on the other. A body is the same: it stays up as long as its weight lands inside its base of support, and tips the moment the weight gets outside. Push the top of a table sideways and its feet stay put while the top leans, so the spot below the balance point slides toward the edge of the rectangle. Let go before it reaches the edge and the table settles back; push it past and over it goes.
A dog standing on four feet has the same rectangle under it, and its weight lands in the middle. Lift one foot and the rectangle becomes a triangle, still a patch with room in it; that is how a dog walks slowly, one foot at a time. Lift two feet and the base of support shrinks to the line between the two still down. The weight now has to land on that line, or the body starts to tip. That is a knife edge. A dog in a hurry lifts two feet at once anyway: each foot then waits for one other instead of three, so every foot steps twice as often and the dog covers ground twice as fast. It pays for the speed by living on that knife edge for most of every step.
The trot
A gait is the pattern in which a walker lifts and places its feet, repeated step after step. The robot in the box has one, the trot, in which diagonal pairs of legs move together: front-left with rear-right, then front-right with rear-left. One pair is on the ground while the other is in the air, and then they swap. A dog jogging along a sidewalk is trotting.
The diagonal pair is the trick that makes the knife edge liveable. The line between a front foot and the opposite rear foot runs under the middle of the body, close to where its weight lands, so the body is nearly balanced on it the moment the other pair lifts. It does start to tip, but a trot is quick: the swinging pair is back on the floor in a fraction of a second, before the tip has gone far. Walking is a series of small falls, each caught by the next pair of feet.
Each foot's step has two parts. Its stance is the time it spends on the ground, carrying weight and pushing the body along: a planted foot grips the floor and stays put, so when its leg swings backward at the hip the body is carried forward over the foot instead, the way your own foot stays on the sidewalk while the rest of you passes over it. Its swing is the time in the air, on its way to where it will land next. In the box, stance lasts a little over half of each step, so for a small part of every step both pairs are down at once and the body gets its rectangle back.
What the robot's controller does, and does not do
The robot below is the Unitree Go2, a real four-legged robot the size of a small dog, drawn from the same files the physical one is built from. It has three motors in each leg: two at the hip, one swinging the leg out to the side and one forward and back, and one at the knee. Twelve motors, every one a servo of the kind you met on the arm: tell it an angle and it holds it.
The controller in the box is about as simple as a walking controller can be. For each foot it has a path drawn in advance, measured from the hip: back along the floor during stance, up and forward through the air during swing, land, repeat. Every fraction of a second it works out where on its path each foot should be, and turns that spot into the three angles that put the foot there: the thigh and the shin are fixed lengths on three hinges, so for any spot the foot can reach there is one set of angles that reaches it, and finding it is geometry, not guesswork. Your stick sets how far the feet travel each step and in which direction, which is all the steering there is: push forward and every planted foot moves straight back relative to the body, carrying it forward; push sideways and every planted foot moves a little way round the body's center, so it turns on the spot.
Here is the part that matters. That controller never reads anything back. It does not know whether the body is level or tipping, whether a foot landed or is waving in the air. It runs through its rehearsed dance with its eyes shut; by the first module's test it is barely a robot at all: it acts, and never senses. That is deliberate, because it makes the shove a clean experiment: whatever the robot does when you shove it is done by the servos, holding their angles, and by nothing else. A servo holds its angle by the rover's rule for wheel speed: push in proportion to the gap between where it is and where it was told to be. Push it off its angle and it pushes back, harder the further it is pushed, which is what a spring does. So the robot is a body on four stiff springs; in this simulation the servos are a good deal stiffer than the real robot's, because without a controller that corrects, stiffness is all it has.
Walking it
The box shows the robot on an open floor, and the view follows it as it walks. Under the box is the rover's stick: drag the knob, or click it once and hold the arrow keys, up and down to walk, left and right to turn. Let go and the robot finishes its step and stands. A sentence beside the stick says what it is doing. Two buttons, Small shove and Big shove, knock the body sideways. An orange line marks where the body has been. Above the box, Reset stands the robot up again where it started, and Slow runs everything at a quarter speed, which is the only way to see what happens in a shove.
Under the stick, four dots show the four feet as seen from above, nose at the top; each dot lights while that foot is on the floor, and a count says how many are down, from 0 of 4 to 4 of 4. A line reads the body's height and tilt, and the ground line its speed and turn rate.
This is easier on a larger screen, but it works here too.
What you saw
The small shove and the big one were the same event with one difference: whether the line down from the body's weight got past the feet. In the small one it did not: the body rocked onto the two legs on one side, they bent and pushed back harder the more they bent, and the body settled, as a table does when you let go before it tips (press Slow and shove again to watch it at a quarter speed). In the big one the weight went past the feet, every leg was pressing on one side of it with nothing under the other, no spring could help, and over it went.
A real dog, and a real Go2, would have done something the moment the tilt began: moved a foot. Step out to the side and the base of support widens to catch the weight, and a fall becomes a stagger, as when someone bumps you on a train. But to step out you have to know you are tipping, and that takes a sensor reading the body's tilt and a controller that notices and decides where to put the foot. The robot in the box has the sensor in its body and does not read it. It holds; it never corrects.
That is why walking is hard. Standing still is impossible the moment something pushes you, unless you keep noticing and keep correcting. Walking is harder still, because every step is a small deliberate fall onto the next pair of feet, and a real walking controller places each foot where it will catch the body, several times a second, on every kind of floor. Noticing the gap between where you are and where you meant to be, and doing something about it, is the subject of a whole part of this course, and legs are where a robot needs it most.
Watch
Why Walking Robots are Easy — James Bruton (3:47 of it, starting at 11:02)
- Why this video
- It is this module's argument built on a bench. A maker builds a two-legged walker with a heavy carriage that slides side to side, shifts the weight over one foot, lifts the other, slides the legs and takes a step, and it walks. Then he says why it has to walk so slowly: it has no sense of balance, so the weight must be fully over one foot before anything moves, and moving the mass faster would tip it, and the cure for that is to measure the robot's tilt and control the mass from the reading. A robot that only holds, and what it would take to make one that corrects, in four minutes of real hardware.
- What to watch for
- At 11:22 the two lead diving weights, added so there is enough mass to over-balance the robot onto one foot while the other is lifted. At 12:05 the first steps: watch the carriage slide right, the left foot lift, the legs slide past each other, and the foot come down, and how long the robot waits with its weight over one foot before it dares to lift the other. At 12:31 "it hasn't got any sense of balance", which is why it goes slowly. At 14:10 why it cannot go faster: the moving mass would tip it, unless the robot measured its own angle and corrected as it went.
Words introduced
- balance point
- The one spot in a body through which its whole weight can be taken to pull straight down. Hold a thing up under that spot and it balances; anywhere else and it tips.
- base of support
- The patch of floor enclosed by whatever is touching it. A body stays up while the line straight down from its weight lands inside that patch, and topples when it lands outside.
- gait
- The pattern in which a walker lifts and places its feet, repeated step after step.
- trot
- The gait in which diagonal pairs of legs move together, front-left with rear-right and front-right with rear-left, one pair on the ground while the other swings.
- stance
- The part of a step during which a foot is on the ground, carrying weight and pushing the body along.
- swing
- The part of a step during which a foot is in the air, on its way to where it will land next.
Where next
Suggested next: 14. Flying: four motors and a lot of math the robot does for you
