Balancing is a loop
Try standing a broom upright on the palm of your hand. You cannot set it up once and walk away. You watch the handle, see it start to lean, and move your hand under it. The broom leans again, a different way, and you move again. Seeing, deciding and moving run round and round in a circle, many times a second.
That circle is called feedback: the result of what you did (where the broom ended up) is fed back into what you do next. Machines balance, steer and hold a temperature with the same circle, a control loop. Something measures, a controller decides, and a motor or heater acts.
An upright pole needs the loop because it is unstable. Any lean, however small, lets gravity pull the top further over, and the further it leans the harder it is pulled. Left alone, a lean of one degree becomes a fall in about a second.
The rig in the scene
The cart runs on two steel rods and is pulled by a toothed belt from a motor at the left end. The pole sits on a hinge on the cart. On the hinge’s axle is an encoder, a disc with fine slots that a light sensor counts, so it reports the tilt a hundred times a second. The grey box is the controller. Its rule is simple: push the cart towards the side the pole leans to, with a force proportional to the lean.
How hard it pushes for each degree is the gain, in newtons per degree. The controller also adds a little for how fast the tilt is changing. That part acts like a shock absorber: as the pole swings back towards upright it eases off the push before the pole gets there.
Too little gain
Moving the cart under the pole is what straightens it. If the cart accelerates towards the lean faster than gravity tips the pole, the pole comes back. For this rig the bare minimum works out at the combined weight of cart and pole, 11.3 newtons, for every radian (57°) of tilt: about 0.2 newtons per degree. Below it the motor never pushes hard enough, and the pole falls.
A little above that minimum the cart does catch the pole, but so slowly that it has to chase it a long way, and in the scene it runs into the end of the rail first.
Enough gain
With about 1 newton per degree the tap tips the pole by about 4°, the cart darts some 40 centimetres under it, and after a couple of smaller swings the pole stands upright again. The cart then drifts back to the middle.
Try it: slide Controller gain up to 2.6 N/° and choose On under Show the feedback. On the strip chart the tilt swings wider with every push until the motor slams from one force limit to the other.
Too much gain
Why should pushing harder be worse? Because every reading is old news. Sensing, filtering, computing and getting the motor going take time, here 50 milliseconds. A strong controller reacts hard to where the pole was, and by the time its push arrives the pole has already moved. The push carries the pole past upright, the next reading says it now leans the other way, and the next big push comes late too. Each correction overshoots more than the one before.
From about 1.7 newtons per degree the swings still die away, but slowly. From about 2.2 they grow instead, until the motor reaches its 25 newton limit and the pole shakes back and forth for good. It is the same as adjusting a shower whose hot water takes seconds to arrive: turn the tap hard each time it feels wrong and you swing between too hot and too cold.
Engineers call the room between “too little” and “too much” the stability margin. They choose gains in the middle of it, and they work to make the loop faster, because the shorter the delay, the harder the controller can push before it starts to overshoot.
Feedback everywhere
The same loop keeps a room at its set temperature, a car at its cruising speed, a drone level in a gust and a rocket upright on its flame. Your body runs it too: you stand still only because your muscles are corrected, many times a second, by what your inner ear and your feet report.
What this model leaves out
The pole only tips left and right; a real one can fall in any direction and needs a second cart axis or a wheeled base. The motor is an ideal force with a limit, ignoring the belt’s stretch and the time the motor’s current takes to build. All the delays are lumped into one 50 millisecond lag; good rigs are faster, which lets them use higher gains. The second loop that brings the cart back to the middle, by asking the pole to lean very slightly, is part of the controller but is not one of the controls. Between tests the scene stands the fallen pole back up by itself, which a real rig would do with a swing-up routine or a person’s hand. And the scene runs at half speed so the swings can be seen.
