Engineering & Inventions · Machines & robotics

Why automatic controllers overshoot and oscillate

A controller that corrects too hard, or on an out-of-date reading, swings past its target and back. Meet the three-term PID controller, the way engineers tune it and the failures no tuning can fix.

4 short lessons · about 25 minutes · 2 sources · updated November 2026

A steam engine with two weighted balls on hinged arms around an upright spindle, linked by a rod to a valve on the steam pipe, beside a flywheel.

What you will learn

  • Say what each of the three control terms does with the error
  • Explain why proportional control alone leaves a standing offset
  • State what causes a control loop to become unstable
  • Predict what raising each gain does to overshoot, settling and stability

Lesson 1 of 4 · 6 min

How a ship's helmsman became the PID controller

Before you readIn 1922 an engineer built automatic ship steering with two kinds of correction, and the ship wandered about 2 degrees either side of its course. After he added a third kind, how far did it wander?

Correct.Not quite. The answer is About a sixth of a degree.

The ship wandered only a sixth of a degree, better than most helmsmen could manage. This lesson is about the three habits of a helmsman that became the PID controller.

In 1922 an engineer named Nicolas Minorsky was designing automatic steering for US Navy ships. He started by watching a helmsman. The helmsman didn't steer on the current course error alone. He also allowed for how long the ship had been off course, and for how fast the error was changing.

Minorsky turned those three habits into mathematics. The result is the PID controller, short for proportional, integral, derivative. It's now used to hold temperatures, pressures, speeds and practically any other quantity that can be measured.

A PID controller works from one number, the error. That's the gap between the value you want, called the setpoint, and the value a sensor measures, called the process variable. The controller responds to the error in three ways at once and adds the results to get its output, such as how far to open a valve.

The proportional term looks at the present. A large error now gives a large output. The integral term looks at the past. It adds up the error over time, so a small error that won't go away builds into a large push.

The derivative term looks ahead. It reads how fast the error is changing and pushes against that change, which damps the motion before it overshoots.

Each term has a gain, a number that sets its weight. Set a gain to zero and that term drops out. A PI controller, with no derivative term, is common, because derivative action is sensitive to noisy measurements.

Check yourselfA PID controller keeps raising its output while the error stays small but persistent. Which of the three terms is responsible?

Correct.Not quite. The answer is The integral term, because it adds up past error and keeps growing until the error is gone.

A small error gives the proportional term a correspondingly small contribution that doesn't grow. The derivative term responds to the rate of change, and a steady, persistent error is barely changing. Only the integral term accumulates, and that's exactly how it removes a residual error that proportional action can't.

Proportional control on its own has a flaw that's easy to miss. It needs an error to produce any output. If the error ever reached zero, the output would drop to zero too, and whatever was holding the process in place would be gone. So the loop settles a little short and stays there. That leftover gap is called the steady-state error, or offset.

Steam engines showed it first. James Watt's governor, a set of spinning steel balls on a spindle, became the industry standard for holding an engine's speed. Yet the speed still varied with the load. The heavier the load, the bigger the gap between the speed wanted and the speed delivered.

Minorsky met the same flaw at sea. Proportional steering held a course against small disturbances, but a stiff, steady gale left the ship off its heading.

The integral term is the fix. It keeps adding up the leftover error, and its push grows until the error is gone. Then it stops growing and holds, supplying the steady output that proportional action never could.

Try to recallA purely proportional temperature controller settles about two degrees below its setpoint and stays there. Why, and what removes the gap?

Proportional output is generated by the error. It's the error times a gain, so at zero error the heater would get no signal at all. The loop comes to rest at whatever error produces just enough output to hold the temperature, and here that's two degrees short. The controller isn't broken.

The integral term removes the gap. It adds up the error over time, so a lasting two-degree gap keeps raising the output. As the temperature climbs, the proportional share shrinks and the integral share replaces it. At zero error the integral term stops growing and holds.

Minorsky's controller went to sea on the Navy ship USS New Mexico. With the proportional and integral terms, the ship wandered about 2 degrees either side of its course. Adding the derivative term cut that to a sixth of a degree, better than most helmsmen could manage.

The Navy didn't adopt it, because the crews resisted. The idea outlived the objection. A PID controller reacts to the error now, to its past and to where it's heading.

Lessons in this topic

  1. How a ship's helmsman became the PID controller

    A PID controller reacts to how big an error is now, how long it has lasted and how fast it's changing. See what each of the three terms does, and why the first one alone always falls short.

    Essentials · 6 min

  2. Why a controller that pushes too hard starts to swing

    A strong correction is fine. A strong correction based on an out-of-date reading makes a loop swing wider and wider. See why, and what raising each of the three gains does.

    Essentials · 6 min

  3. Tuning a controller by making it oscillate on purpose

    The classic way to set a controller's three gains is to push the loop into oscillation and then back off. Follow the steps, the formula built on them and the risks.

    Deeper · 6 min

  4. The failures tuning can't fix

    Windup, noise and step changes break a correctly tuned loop. Each has its own fix, and none of them is a gain.

    Deeper · 7 min

Three quick stories from this topic

The helmsman in the controller

The three-term PID controller was worked out in 1922 from watching a ship's helmsman

Nicolas Minorsky noticed that a helmsman reacts to how far off course the ship is, how long it has been off, and how fast the error is changing. Those became the controller's proportional, integral and derivative terms.

It beat the helmsmen

In trials on USS New Mexico, two of the terms held the ship within 2 degrees of its course. Adding the third cut that to a sixth of a degree, better than most helmsmen could manage.

The Navy passed

The Navy didn't adopt the system, because personnel resisted it. The same three terms now regulate temperatures, pressures, speeds and flow rates across industry.

The torpedo's secret

An 1860s torpedo kept its depth with a pendulum its inventor named The Secret

The Whitehead torpedo's depth sensor alone proved inadequate. Set to react strongly, it overshot and became unstable. A pendulum that sensed the dive angle damped the swings, because the angle shows how fast the depth is changing.

Too much gain

Steering by depth alone was proportional control. With the gain too high it became unstable and overshot, so the torpedo couldn't hold a depth.

Derivative control before it had a name

The pendulum detected the dive or climb angle, and so the rate of change of depth. Reacting to that rate is what engineers now call derivative control.

Integral windup

A controller can overshoot its target because of error it stored while at full power

While a heater runs flat out toward a new setpoint, the controller's integral term keeps adding up the gap. That total can't make the heater work any harder. It holds the heat on after the target is reached, until the overshoot drains it.

It has to be paid back

The loop overshoots and keeps going until an error of the opposite sign unwinds the stored total.

Not a tuning problem

Suspend integration outside the controllable region, bound the total or back-calculate it. No choice of gains fixes windup.

Sources

This topic is part of The limits engineers have to design around, a guided path through related topics.

  • How feedback keeps a machine on target

    Cruise control holds your speed on a hill it can't see. Follow the loop that does it, from measuring the gap to correcting it, and find out why correcting faster can cause new problems.

    4 lessons · 15 min

  • Simple machines and mechanical advantage

    Levers, pulleys, ramps, wedges, screws and wheels all trade distance for force. See how each does it, why none saves any work, and how to find them inside a bicycle or a crane.

    4 lessons · 16 min

  • How robots work

    A robot senses, decides and acts in a loop. See what its sensors, computer and motors each do, why walking is harder for it than chess, and how much of today's robots is still a person at the controls.

    4 lessons · 16 min

  • How electric circuits work

    A circuit is a loop that lets charge carry energy from a source to whatever does the work. Learn what voltage, current and resistance measure, how they connect, and why a short circuit trips a breaker.

    4 lessons · 16 min

  • Why engineers choose one material over another

    How stiffness, strength, toughness, mass and shape make a material right for one job and a poor choice for another.

    4 lessons · 15 min

  • How electricity is generated

    Almost every power station spins a magnet inside coils of wire. See how a generator works, how steam, water and wind turn it, why steam plants waste most of their heat, and why solar panels are the exception.

    4 lessons · 16 min

All engineering & inventions topics · Take the quiz