Blog

PID Control: From Watt's Governor to Your Chiller

The oscillation a hunting chiller makes is badly tuned feedback. From Watt's 1788 governor to PID, and why your shower tap teaches all three terms.

Tan Kok XinTan Kok XinElectricity Fundamentals
Watt's flyball centrifugal governor in glowing blueprint style, spinning balls linked to a steam valve, illustrating feedback control

A Math Annex extra to Cobler's Electricity Fundamentals course.

There is a sound every plant person knows, even before they have a word for it. A chiller plant, or a big control valve on an air handler, that will not settle: it overshoots cold, then drifts hot, then swings cold again, sawing back and forth across the temperature you asked for and never quite landing on it. Operators call it hunting. It is the sound of feedback gone slightly wrong, and the machinery underneath it has a name almost nobody says out loud on the plant floor: PID control.

If you did an engineering degree, you met that name in a windowless room, buried under block diagrams and a fog of transfer functions, and quietly wondered what any of it was for. This is the answer the lecture skipped. Feedback control is probably the largest unnamed idea running your building right now, and once you see its shape, the whole subject stops being abstract and becomes something you can hear.

What is feedback control, really?

A machine that measures itself, compares the reading against a target, corrects the difference, and then does it again, forever, with no human hand on the wheel. Measure, compare, act, repeat. That loop is the entire idea. Everything else is refinement.

The first great industrial example belongs to an old friend of this course. James Watt, the same steam engineer whose name ended up stamped on every light bulb and motor nameplate you own, had a problem. His engines ran away when the load dropped: take the weight off, and the machine sped up dangerously. So in 1788 he fitted the flyball governor, an idea he adapted from the governors already spinning on windmills to keep the millstones a steady gap apart (Britannica). Two metal balls spin on a vertical shaft geared to the engine. When the engine speeds up, the balls fly outward and rise, and through a linkage that rising motion closes the steam valve, which slows the engine, which lets the balls fall again. The machine measures its own speed and throttles itself, with nobody watching. That is feedback, cast in brass, more than two centuries ago.

Why isn't a simple thermostat good enough?

Because the crudest version of the loop only knows two words, full blast and off, so it saws across the target instead of sitting on it.

You already own the crude version. A basic thermostat, or the fixed-speed aircon we pulled apart in the inverter article, watches the temperature and switches the compressor hard on when the room is too warm, then hard off when it dips below. On, off, on, off. The room temperature never rests at your setpoint; it wanders above and below it in a slow saw, because the only two corrections available are everything and nothing. It works, roughly. But it overshoots every cycle, and every overshoot is cooling you paid for and did not need.

The refined version does not switch. It trims. Instead of slamming a valve fully open or shut, it nudges the actuator to some in-between position, a little more here, a little less there, holding the target smoothly. The question is how much to nudge, and that is exactly the question PID answers.

What do the three terms of PID control actually do?

They are three instincts a good helmsman already has, written down as arithmetic.

The refined recipe came from watching one. In 1922, the engineer Nicolas Minorsky was working on automatic steering for US Navy ships, and rather than invent from scratch he studied how an experienced helmsman actually held a course (Wikipedia). A good helmsman does three things at once, and Minorsky turned each into a term. His three-term law was tested on the battleship USS New Mexico around 1923.

The cleanest way to feel all three is a shower tap. You want the water nice, and right now it is cold.

P, proportional, is how far off you are. The colder the water, the harder you crank toward hot. Big error, big correction; small error, small correction. On its own, P is honest but never quite satisfied: it tends to settle a touch cold and stay there, because as the error shrinks so does the push, and a small stubborn gap survives.

I, integral, is how long you have been off. If the water has sat a little too cold for a while, you keep nudging hotter, and keep nudging, until that lingering coldness is finally gone. I watches the accumulated error that P alone can never kill. Too much of it, though, and you overshoot into scalding before you notice.

D, derivative, is how fast it is changing. As the water rushes up toward nice, you feel it coming and back off early, so you do not blow straight past into a scald. D is anticipation. On a ship's tiller it is the instinct not just to correct the current heading but to ease off before the bow swings too far.

Turn harder the colder it is, keep nudging if it stays cold too long, back off as it approaches nice. That is P, I and D, and you have run all three in the shower your whole life.

Written down, the helmsman's three instincts are a single line:

$$u(t) = K_p\, e(t) + K_i \int_0^t e(\tau)\, d\tau + K_d\, \frac{de}{dt}$$

Here e is the error (how far from nice the water is), u is the correction your hand applies, and the three K numbers are how much the controller trusts each instinct: the present error, its accumulated history, and its speed of change. Tuning a loop is nothing more than choosing those three numbers, which is exactly what Ziegler and Nichols wrote the recipe for.

Why does a chiller "hunt"?

Because those three instincts are miscalibrated, so the loop keeps talking over itself instead of settling.

Hunting is the shower dance everyone has done: scald, freeze, scald, freeze, chasing a good temperature you keep flying past in both directions. In a chiller plant it is the same failure with bigger valves. Push the proportional response too hard, or lean too heavily on the integral term, and the loop overcorrects, then overcorrects the overcorrection, and the plant oscillates around setpoint forever. This is not a broken machine. It is a mistuned conversation.

Because it kept happening, someone wrote the recipe for calming it down. In 1942, John Ziegler and Nathaniel Nichols of Taylor Instrument published "Optimum Settings for Automatic Controllers" in the Transactions of the ASME, the first systematic method for tuning the three terms so a loop settles quickly without hunting (Wikipedia). Eighty years on it is still taught and still used. And the reason control has any theory at all to be tuned goes back further, to James Clerk Maxwell, who in 1868 wrote "On Governors" and put the mathematics of hunting on paper, explaining with equations why some governors settle and others shake themselves to pieces (Wikipedia).

How much of your building already runs on this?

A very large majority of it, quietly, everywhere a motor or a valve holds a number steady.

This is the part the lecture hall never made concrete. Surveys of industrial control put PID at more than 90 percent of all feedback loops, most of them running just the P and I terms. Karl Åström and Tore Hägglund, who wrote the standard text on it, cite figures above 95 percent, and a Honeywell survey of more than eleven thousand controllers across refining, chemicals and paper found roughly 97 percent using PID feedback (Desborough and Miller, 2002, cited in Åström and Hägglund, Advanced PID Control). None of these are laws of physics; they are what the surveys keep finding, and the shape holds: this one loop runs most of the automated world.

In your building specifically, it is nearly everything that moves and holds a value. Every variable-speed drive holding a motor at a target RPM runs a PID speed loop. Every air-handler damper trimming to a supply-air temperature, every chilled-water valve, every chiller staging sequence that decides when to bring the next compressor online, all PID or a close cousin of it. Step outside the building and it is your car's cruise control holding a speed up a hill, and the drone hovering dead still against a gust. Same four words: measure, compare, act, repeat.

For an operator, the payoff is a shift in what you hear. A hunting loop is not a machine that needs replacing, it is a conversation that needs retuning, and every cycle it overshoots it burns real energy, because each swing past setpoint is cooling or heating produced and then thrown away. Catching that, and knowing it is a tuning problem rather than a hardware one, is a big part of what Cobler's automation and control work does inside a chiller plant.

Once you know the loop, you cannot unsee it

The eye it gives you is the real prize. The float valve in a toilet cistern or a water tank is a feedback loop: the float measures the level, and as the water rises it closes the inlet, no electronics required. The cruise control, the thermostat, the governor, the helmsman, your own hand easing a shower tap toward nice, are all the same four beats. Measure, compare, act, repeat.

That is all PID ever was. Three plain instincts every good helmsman has, written down carefully enough that a valve can follow them and hold a number steady without ever tiring. They made you learn it because it runs the world. Nobody just told you it was the shower.

Go deeper on video

Reading explains; watching sometimes lands the picture. Full credit to the creators:

"PID Control: A brief introduction" by Brian Douglas


This is a Math Annex extra to Cobler's Electricity Fundamentals course. It sits closest to How Electric Motors Work, whose variable-speed drives run the speed loops described here, and to the Inverter Aircon piece, whose fixed-speed compressor is the crude on-off version of the same idea.

A hunting loop wastes energy on every overshoot, and it is a tuning problem, not a hardware one. Book a demo and we will show you where your building's loops are still sawing instead of settling.

FAQ

Frequently asked questions

Keep Reading

Related articles