Part 3 · How robots are controlled
27Stiff or soft: holding an egg without breaking it
The spring rule from the proportional arm is aimed at an egg, with its stiffness on a slider. Stiff, the jaw shuts in a blink and cracks the egg; soft, it creeps closed and holds it; too soft, and it never arrives.
This assumes: Touch and force: feeling the world, Push, patience and a brake: what PID stands for. About 9 minutes of reading.
Pick an egg up off the table, and then pick up a brick. Your hand does not close to a different position for each one. It closes until it meets something, and then presses with however much you decided on: a little for the egg, a lot for the brick. What you chose was not where your fingers would end up but how hard they would push on whatever stopped them.
The proportional control module put a spring on the SO-101's shoulder and ran it at two stiffnesses side by side, and its verdict was that stiffer was better: less sag, less knocked about. This module is the same spring on a different joint, the jaw, aimed at an egg, and here stiffer is not better. The question changes from how well the spring gets the joint to its target to what the spring does to whatever gets in its way.
The same rule, a different question
Under proportional control the push was the gain times the gap, and that module said this is a spring: stretch it further and it pulls harder. The gap the arm settled at, the steady-state error, was the fault. The spring could only hold the arm up by staying stretched, so the arm sagged.
Now aim that spring somewhere the joint cannot go. Tell the jaw to shut all the way, with an egg between the jaws. The jaw swings until it meets the egg and stops. The gap does not close, and the spring goes on pulling, by the stiffness times the gap. But nothing is sagging now. That pull goes straight into the egg. The gap has stopped being a fault and become the squeeze. The egg holds the jaw some distance short of shut, and the spring pushes on the egg in proportion to that distance. Choose the stiffness, and you have chosen how hard the egg is squeezed, without measuring anything.
That is the idea behind impedance control: rather than tuning a controller to get a joint to its target, you choose how the joint should feel when something pushes back on it. You give it a spring of chosen stiffness toward the target, the push it makes for each degree it is held away, and a damper beside it that leans against motion, like the brake of the PID module. The arithmetic is P and D over again. What changes is the intention. A PID controller is judged by how well it arrives. An impedance controller is judged by what happens when it cannot.
The touch and force module closed this same jaw on this same egg with the arm's own servo, a half degree at a time, and found the servo so stiff that every half degree was three more newtons; the crack was one click from a safe grip, and the only way to hold the egg was a force sensor and a number to stop on. A soft spring is the other way round. It never needs to know the egg is there.
The box
The arm starts as it did in the touch and force module: the jaws around an egg on the table, the fixed jaw beside it and the moving jaw open above it at 69 degrees. The jaw's servo has been taken away and the spring put in its place; the other joints are held by their own servos. One slider, Stiffness, runs from 0 to 6 in newton meters per radian, the unit the gain had. A stiffness of 1 is about a sixtieth of a newton meter of twist for each degree of gap, and what matters here is that 2 is twice as stiff as 1. The damper is fixed at a small size. Close the jaw sends the jaw's target from 69 degrees to 2, all but shut, so the egg is in the way. It also puts a fresh egg down and clears the chart, so every press starts the same. There is no Reset; Close the jaw is the reset.
The chart's top panel is the jaw's angle against its target. The bottom panel is the squeeze, how hard the jaw is pressing the egg, in newtons, with a dashed line at 8, the force that cracks it, as in the touch and force module. The line under the chart says where the jaw is, how far short of its target it stopped, how hard it is squeezing, and whether the egg is whole. A cracked egg flushes red.
This is easier on a larger screen, but it works here too.
What changed, and what did not
Look at where the jaw stopped in the two tries: 16 degrees short, then 14. The stiff spring squeezed the egg three times as hard and got two degrees for it. That is because the egg is a very stiff spring of its own. The touch and force module measured about three newtons for every half degree it is squashed, so nine or ten extra newtons is about two degrees of squash, and two degrees is what you saw.
Two springs pushing on each other settle where their pushes match. The jaw's spring, stretched 14 or 16 degrees from its target, pushes on the egg; the egg, squashed a fraction of a millimeter, pushes back. The soft spring stretched 16 degrees pushes a little, so the egg barely has to squash to match it. The stiff spring stretched 14 degrees pushes hard, and the egg has to squash further to push back that hard, which is past what it can take. The jaw ended in nearly the same place both times. The force was the thing that changed, and the force is what the egg cares about.
This is the steady-state error of the proportional module turned to use. There, a gap of a few degrees with a spring behind it was the arm's failure to arrive. Here it is the whole design: the joint is meant not to arrive, and the gap it is stopped at, times the stiffness, is the force it applies. An impedance controller is a way of applying a chosen force to the world with nothing but a spring and something in the way.
Finding the window
The line is near the middle of the slider. At 2 the squeeze settles at about 7 newtons and the egg stays whole; at 2.5 it reaches about 8.5 and the egg cracks. Every half step on the slider is about a newton and a half.
Soft has its own price. The jaw at 1 took two seconds to reach the egg where the stiff one took a third of a second, and at 0.5 it took half a minute. Every real joint has some friction, a drag that has to be paid before anything moves, and this jaw's is about a quarter of a newton meter, roughly what a spring of 0.5 gives when the gap is 30 degrees. As the jaw closes, the gap shrinks and the spring's pull shrinks with it, so the surplus over the drag dwindles and the jaw slows to a crawl. The same drag is why the squeeze at 1 kept creeping up for several seconds after the jaw reached the egg. While the jaw is still creeping in, the drag takes its share of the pull and the egg gets the rest, and only as the jaw comes to rest does the egg get all of it. In this simulation the drag is a gentle one that slows a joint rather than stopping it dead. A real joint's friction can hold a slow jaw stuck short of the egg, and keep a share of the spring's pull for good.
So the window is narrow: from about 1, where the spring beats the drag briskly enough to close in a couple of seconds, to 2, under the line. A stiffness that is safe for the egg is one that closes slowly, grips lightly, and would be pushed open by a good tug. Your own hand has the same problem: a grip soft enough for an egg is not one to hold a hammer with.
Stiff or soft
Which stiffness is right, then, depends on what the joint is going to meet. The block from the grippers module took thirty-seven newtons and did not mind. For the block, turn the slider to 6: the jaw snaps shut, holds hard, and nothing is lost. The egg is why stiffness is a choice at all.
Giving way when pushed is called compliance, and a compliant joint is a soft one: something in its path moves it instead of being crushed by it. Robots are made compliant on purpose wherever they touch things that were not exactly where the plan said. An arm fitting a peg into a hole jams if it is stiff and a hair off line, and slides in if it is soft, because the hole's edge nudges the soft arm into place. A walking robot's legs meet a floor that is never quite where it was expected, and stiff legs would hammer it. A robot working beside people is made soft so that bumping into someone is a nudge, not a blow. And a machine tool cutting metal is made as stiff as possible, because there the whole point is to hold a position against a load. Many robots switch: stiff while moving through empty air, where accuracy is everything, and soft in the last centimeter before contact.
The damper, fixed here, is the other half of the choice. It changes nothing about where the jaw settles or how hard it squeezes; what it changes is the arrival. At a stiffness of 6 the jaw hit the egg at about 25 newtons and settled at 18. With no damper at all it would hit at over 40, because nothing slows the jaw before the egg does. A real robot's spring and damper are chosen as a pair: how stiff, and how much to lean against the motion on the way in.
What the simulation leaves out
The spring here is the only thing driving the jaw, and it commands twist directly: so many newton meters, whatever the jaw happens to be doing. Most servos do not work that way. They carry their own stiff position loop inside, the one that made every half degree in the touch and force module cost three newtons, and no request from outside makes such a servo soft. Impedance control needs motors that can be told a twist rather than an angle, and a good account of the friction in the joint: the force that lands on the world is the spring's pull less whatever the joint's own drag eats, so a drag the controller does not know is a force it does not know. Some robots get compliance another way: a real spring built into the joint between the motor and the link, so that the softness is in the metal and no controller has to make it.
And this controller cannot tell whether the egg is there. It squeezes gently by construction, and would squeeze empty air with the same rule and report nothing. The touch and force module's sensor and this module's spring are answers to the same problem from opposite ends, and a hand that has both, a soft grip and a number to read, is the one that holds the egg.
Watch
10. Robotic Arms - Virtual Spring Control (IROS 2020 Tutorial Series) — HEBI Robotics (7:05 of it, starting at 0:02)
- Why this video
- This is a real six-joint arm with a spring that is not made of metal, and the person who set it pushes the arm around with his own hands while he says what the spring is doing. The words put the spring on a jaw and aim it at an egg; here the same spring holds the tip of an arm at a point in the room, and you watch the elbow and shoulder go wherever he puts them while the tip stays put, and hear him say he is feeling a stiffness that pulls the arm back toward its target. That pull on his hand is the squeeze on the egg: a joint made to behave like a spring pushes on whatever holds it away from its target, and the stiffness decides how hard. His hand is the thing in the way, and it is a hand, so the arm was made soft enough for one.
- What to watch for
- At 1:38 he switches the spring on and at 1:55 pushes the arm around: the tip stays where it was put while the rest of the arm moves, and at 2:04 he says he is feeling a stiffness that stops him moving the tip away. At 2:36 a second kind of spring holds only the tip's direction, and from 2:56 he swings the arm about and the tip keeps facing the camera. At 4:21 he says the gains set how stiff the spring is and the damping how it settles, the two numbers on this page. At 6:15 he describes a second spring that sets how hard the tip presses on a pipe, which is the egg's squeeze by another name, and at 6:36 says the whole point: soft in the directions where the world should move the robot, stiff in the ones where the robot must hold.
Words introduced
- impedance control
- Controlling a joint by choosing how it should feel when something pushes back on it. The joint is given a spring of chosen stiffness toward its target, with a damper beside it, and the push it makes on whatever stops it is the stiffness times how far short it is held.
- stiffness
- How hard a spring pushes back for each unit it is bent. For a joint under impedance control, the push it makes for each degree it is held away from its target. A stiff joint holds its position against anything; a soft one gives.
- compliance
- Giving way when pushed. A compliant joint is a soft one, so that something in its path moves it instead of being crushed by it. Robots that touch people, fragile things, or the ground are made compliant on purpose.
Where next
Suggested next: 28. Maps, and knowing where you are on one
