Part 2 · How robots sense

16Touch and force: feeling the world

The arm's jaws are around an egg, and a panel reports every push the arm feels, in newtons. Close the jaws a half degree at a time, watch the squeeze climb, and find the step that cracks it.

This assumes: Grippers and hands: holding on. About 9 minutes of reading.

Pick an egg out of the carton. Your fingers close on it, stop the moment they touch, squeeze a little, and lift, and at no point do you think about how hard. The arm in the last module could not do that. It lifted an empty hand to the bin with complete confidence, because nothing told it the block had gone. This module gives the arm the sense it was missing, and lets you find out what a hand that cannot feel does to an egg.

What a push feels like to a robot

Press your fingertip on the table. You feel it stop, and you feel how hard you are pressing. Both are the same fact seen from two sides: the table is pushing back on your finger exactly as hard as your finger pushes on it, and your fingertip reports that push to you. A robot that can feel is one that measures the pushes on it, in newtons, and passes the numbers to its computer. The last module measured in newtons: a kilogram weighs about ten of them, so the block weighed half a newton, and the jaws could squeeze it with thirty-seven.

The device that does the measuring is a force sensor: a sensor that reports how hard it is being pushed, in newtons. Inside most of them is a strain gauge, and its trick is worth knowing. A thin zigzag of metal foil is glued to a piece of metal that is built to bend, by a hair, under load. Push on the metal and it bends, and the outside of a bend is stretched, as the skin on the outside of a bent finger is; the foil glued there stretches with it, and a stretched track of foil is a little longer and a little thinner. Electricity passes through a longer, thinner track a little less easily, the way water passes less easily through a longer, narrower pipe. The change is tiny, but a circuit can measure it, and once the sensor has been pressed with known weights, the circuit turns that tiny change into a number of newtons. On a robot the sensor goes where the push is: one built into a jaw feels what the jaws squeeze, and one bolted between the wrist and the hand feels whatever the hand pushes against.

A robot can also feel with no sensor at all, by listening to its own motors. An electric motor's push comes from magnets shoving on the electricity flowing through the wire wound inside it, and the more that flows the harder the shove, so the flow, its current, is a measure of the push. Every servo on this arm measures its own current. So when the jaw stalls on something, the jaw motor's current says roughly how hard it is squeezing. Roughly, because the reading is the motor's whole effort, the weight of whatever it carries included, and it is coarse: a light touch is lost in it. But it costs nothing, and a great many robots make do with it.

The closest thing to a fingertip is a tactile sensor: a patch of many tiny pressure sensors, like a skin, that reports not only how hard something presses but where, and in what shape. With one on each jaw, a robot can tell a corner from a face and feel an egg start to slip.

The box

The arm starts with its jaws around an egg standing on the table, the fixed jaw beside it and the moving jaw open above it. Two sliders. The one marked Gripper is the moving jaw, starting at 69°, wide open; smaller numbers close it. The one marked Shoulder lift starts at −10.5°, and larger numbers tip the whole arm forward and down. Once you have clicked a slider's knob, the arrow keys move it a half degree at a time, the smallest step either can take. Under them a panel marked Touch lists every part of the arm that is pushing on something, and how hard, or says "touching nothing". The moving jaw's line says Moving jaw; the fixed jaw is part of the hand itself, so its line says Gripper. The numbers do not come from a sensor: the simulation knows every push exactly and the panel shows them, as a perfect force sensor on every part of the arm would. A red arrow is drawn wherever the arm touches something, pointing the way the arm is being pushed, one centimeter long for every newton.

The egg is set to crack at eight newtons, about the weight of a full pint glass, pressed by either jaw for a tenth of a second. A cracked egg flushes red and stays that way until Reset, which puts the sliders back and a fresh egg down.

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.

What you saw

Two lines, always equal, one for each jaw. They read the same because they must: the moving jaw presses the egg, and since the egg is going nowhere, the fixed jaw must be pressing it back exactly as hard from the other side. A squeeze is one number felt from both sides.

The squeeze grew in steps, and here is where the newtons came from. The module on a robot's parts said a servo nudges its motor until the joint is where it was told. Here is the rest: the servo compares where the jaw is with where it was told to be, and pushes in proportion to the gap, a small gap a small push, up to the most the motor can give. It is a stiff servo: it takes a gap of only a few hundredths of a degree to bring out a push of several newtons, so the jaw follows the slider almost exactly, and a half degree on the slider is a half degree of jaw. Before 18.5° that half degree was empty air. After it, every half degree pressed the jaw a fraction of a millimeter further into the egg, and an egg squashed by a fraction of a millimeter pushes back, like a very hard spring: in this simulation about three newtons for each half degree. The egg, holding the jaw those few hundredths of a degree short, is exactly what brings that push out of the servo. The servo never asked for newtons. It was asked for degrees, and the newtons followed from what was in the way.

That is the lesson of the crack. The servo cannot see the egg. At 17° the egg was squashed by the amount that pushes back with seven newtons; at 16.5°, a little more, and ten was over the line. Eight newtons is not a real egg's number: a hen's egg squeezed evenly across its middle takes a few times that, and pressed on a point a good deal less. Eight was chosen because it puts the crack one half degree of the slider away from a safe grip, and one half degree is what a hand that cannot feel has no way to notice. By 12° the squash would have needed more push than the motor has. The last module worked that ceiling out: 2.94 newton meters over the eight centimeters from the hinge to the egg is about thirty-seven newtons. So the jaw stopped there, held open by the egg, the motor pressing with everything it had, and every setting below asked for more than it could give, so the number stopped climbing. A hand with no force sensor and a servo told "close" does exactly this to an egg, and reports nothing, because it has nothing to report with.

The table was the same story with no spring in it. The fixed jaw's tip was a few millimeters above the table at 1.5° and on it at 2°. But a table does not squash: the first hair of pressing that a fraction of a degree past the surface would have needed asks for more push than the shoulder motor has, and a half degree on the slider is many times the few hundredths of a degree the servo needs to reach its ceiling, so the first reading after the touch was already close to it and the next half degree was there. That ceiling is smaller here, a little over thirty newtons, for the reason the last module gave: the same 2.94 newton meters, plus about half a newton meter from the arm's own weight leaning forward, spread over the eleven centimeters from the shoulder's hinge, which in this pose sits that far behind the jaw tip, a longer lever than the eight from the jaw's hinge to the egg. Thirty newtons almost at once, then, and no more however far you dragged. To the panel, the table and the egg are the same kind of event: a part of the arm is pushing on something, and here is how hard.

What you did that the arm did not

You stopped at 17°. You read the number, decided seven newtons was enough, and left the slider alone, and the egg survived. That is the whole of what a force sensor buys a robot: not a gentler motor, but a number to stop on. A robot with a force sensor in its jaw closes slowly, reads the sensor every few milliseconds, and the moment it says five newtons, holds the jaw where it is. Told to pick up a block instead, the same rule squeezes to five newtons and stops there too. The robot never has to know which it was holding. It only has to feel.

The same number answers the other question the last module left open. A jaw that has closed on nothing reports that it is touching nothing; a jaw that has closed on something reports a push. So a robot with a force sensor knows whether the grasp worked, in newtons rather than from where the jaw happened to stop; the arm in the last module, whose script looked at neither, carried an empty hand to the bin.

Closing until the sensor says stop is a rule that reads a sensor and acts on it, and rules like that are the next part of this course. Here, the point is the number itself.

What the simulation leaves out

The egg here is a hard shell that gives a few millimeters under the full squeeze and never breaks apart; a real shell gives a tenth of that. Real jaws have rubber pads that squash far more than the shell does, which softens the steps. A real force sensor is never perfect: its number wobbles a little from one reading to the next, creeps as the sensor warms up, and a sensor at the wrist feels the weight of the hand as well as what the hand is touching, so the robot has to subtract its own hand before the number means anything. And the panel here can feel a push on every part of the arm at once, which no real arm can: a force sensor at the wrist feels the sum of everything below it, a sensor in a jaw feels that jaw, a tactile pad feels its own patch, and a motor's current feels only its own joint. Every real robot feels the world through a few small windows.

Watch

Tactile Sensing — WillowGaragevideo (1:30 of it, starting at 0:00)

Why this video
A real robot, the PR2, with pressure sensors in the pads of its gripper, doing what the words say a robot with a sense of touch can do and the arm in the box cannot: closing on a household object and stopping at the moment of contact, feeling it start to slip and squeezing harder, feeling the table when it sets something down, and letting go when a person tugs. The narration is plain, and every claim is shown on the robot as it is said.
What to watch for
At 0:24, what happened before the sensors: the strong joints crushed household objects without knowing. From 0:35, the gripper closes and stops the moment it feels contact, which is the stop you made yourself at 17°. At 0:43 the object slips and the grip force goes up; at 0:50 the robot feels the table through its fingertips as it sets the object down and stops pushing.

Words introduced

force sensor
A sensor that reports how hard it is being pushed, in newtons. Fitted in a robot's jaw or at its wrist, it is how the robot feels what it touches.
strain gauge
A thin zigzag of metal foil glued to a part that bends a hair under load. Stretched, the foil passes electricity a little less easily, and that change is read as a force. The sensing element inside most force sensors.
current
The flow of electricity through a wire or a motor. A motor pushes harder when more flows, so its current is a measure of its push.
tactile sensor
A patch of many tiny pressure sensors, like a skin, that reports not only how hard something presses but where, and in what shape.

Where next

Suggested next: 17. Measuring distance: sonar and lidar — Five beams on the rover's nose, each reporting one number, the distance to the first thing in its way. Watch a box walk from beam to beam as the rover turns past it, and find the thing twenty centimeters in front of the nose that no beam can see.