HuntsvilleEngineers mark
HE Reference Shelf — huntsvilleengineers.com
The Reference Shelf · Applied Engineering Math

PID control mathematics

The control law that turns three questions — how far off am I, how long have I been off, and which way is it heading — into one actuator command, plus the tuning math that keeps the answer from oscillating.

Also known as: PID tuning · Ziegler-Nichols · proportional-integral-derivative

The formula

The parallel (textbook) form:

u(t) = Kp·e(t) + Ki·∫₀ᵗ e(τ) dτ + Kd·de/dt

Reading: the output is a weighted sum of the present error, the accumulated error, and the trend of the error. e(t) = setpoint − measurement.

The standard (ISA) form, which is what most controller faceplates actually display:

u(t) = Kp·( e(t) + (1/Ti)·∫₀ᵗ e(τ) dτ + Td·de/dt )

Reading: same controller, but the integral and derivative actions are expressed as times — Ti = Kp/Ki (reset time) and Td = Kd/Kp (rate time). One overall gain scales all three terms.

In the Laplace domain:

C(s) = Kp + Ki/s + Kd·s

Reading: a pole at the origin (the integrator, which forces zero steady-state error) and two zeros you place to shape the loop.

The buildable derivative — pure Kd·s has unbounded high-frequency gain, so real controllers filter it:

Kd·s  →  Kd·s / (1 + s·Td/N),  N on the order of 10

Reading: derivative action rolls off above a corner frequency so sensor noise doesn't slam the actuator.

Ziegler–Nichols closed-loop tuning, from the ultimate gain Ku (proportional-only gain at which the loop sustains a steady oscillation) and the ultimate period Tu:

P:    Kp = 0.5·Ku
PI:   Kp = 0.45·Ku,  Ti = Tu/1.2
PID:  Kp = 0.6·Ku,   Ti = Tu/2,  Td = Tu/8

Reading: measure two numbers on the real plant, get a full gain set. Example: Ku = 10, Tu = 4 s gives Kp = 6, Ti = 2 s, Td = 0.5 s — equivalently Ki = Kp/Ti = 3, Kd = Kp·Td = 3.

Where you meet it

  • The thermal chamber on your bench. Every environmental chamber, reflow oven, and TEC driver in the building runs a PID loop on temperature. When the chamber overshoots a ramp-and-soak profile by 4 °C, the fix is in this entry, not in the chamber manual's troubleshooting page.
  • The test stand. Propellant valve position, load-frame force, dyno speed — closed-loop test articles are PID loops commanding actuators against a profile. Tuning them on dead-time-heavy plumbing is where the tidy textbook math meets reality.
  • Motor drives. A servo amplifier is nested PID: a current loop inside a velocity loop inside a position loop, each tuned roughly a decade apart in bandwidth so they don't fight.
  • The review board. "Why did the loop oscillate at 0.25 Hz during the hot case?" is a question you answer with Ku, Tu, and phase margin, not with adjectives. Tuning rationale belongs in the test report.

How it works

Each term buys something and costs something. Proportional action alone always leaves an offset on a plant without its own integrator: with a plant DC gain of 2 and Kp = 4, the loop settles at 8/9 of the setpoint — 11% short — because zero error would mean zero output. Crank Kp to shrink the offset and you trade away stability margin.

Integral action erases that offset — the integrator keeps pushing until the error is exactly zero — but it adds 90° of phase lag, which is the mathematical way of saying it makes the loop easier to destabilize. Derivative action is the counterweight: it adds phase lead and damping, which is why the ZN PID row tolerates a higher Kp (0.6·Ku) than the PI row (0.45·Ku). The price of derivative is noise gain, which is why the filter divisor N exists and why plenty of process loops in industry run PI and leave Td at zero on purpose.

The two implementation traps that account for most field misery:

  • Integral windup. Actuators saturate; math doesn't. During a big setpoint change the valve pegs at 100%, the integrator keeps accumulating error it can never act on, and when the process finally arrives the loop sails past the setpoint working off the stored charge. Anti-windup — clamping the integrator, or back-calculating it from the saturated output — is not optional on any loop with a real actuator.
  • Derivative kick. Step the setpoint and de/dt is momentarily enormous; the actuator gets hammered. Standard fix: take the derivative of the measurement instead of the error. Same disturbance rejection, no kick.

Know what ZN is actually giving you. Ziegler and Nichols targeted quarter-amplitude decay — each overshoot swing one-fourth the previous one — because they wanted maximum disturbance rejection [3]. That corresponds to lightly damped, visibly ringy behavior most modern applications would reject. Treat ZN output as a calibrated starting point and detune from there, usually by cutting Kp and lengthening Ti.

Limits of validity: the whole framework assumes a roughly linear plant near the operating point, a sample rate comfortably faster than the loop dynamics (the discrete velocity form Δu_k = Kp·(e_k − e_{k−1}) + Ki·T·e_k + (Kd/T)·(e_k − 2e_{k−1} + e_{k−2}) is what actually runs each PLC scan), and a plant that isn't dominated by dead time. Long transport delay eats phase margin that no amount of Td buys back; that's Smith predictor territory.

The mistake people make: typing gains from one form into a controller expecting another. Parallel, standard, and series forms use the same three letters and different arithmetic — Ki = 3 in parallel form is Ti = 2 s in standard form only after you divide by Kp. Vendors differ, and a gain set that was stable in the simulation will oscillate on the hardware for no reason other than a units-of-form mismatch. Check the manual's equation before you type a single number.

History

The math has a helmsman's fingerprints on it. Nicolas Minorsky (1885–1970), a Russian-born engineer who emigrated to the United States in 1918, worked on automatic ship steering for the U.S. Navy and noticed that a good helmsman doesn't just react to the current heading error — he accounts for how long the ship has been off course and how fast the bow is swinging. His paper "Directional stability of automatically steered bodies," published in May 1922 in the Journal of the American Society of Naval Engineers, put that observation into a formal three-term control law [1][2]. Sea trials of the steering gear on the battleship USS New Mexico followed in 1923, run by Minorsky for the Navy's Bureau of Construction, though the results went unreported until 1930 — and the gear was later removed because the crews opposed automatic steering [7].

Twenty years later the tuning problem got its field manual. John G. Ziegler and Nathaniel B. Nichols, working at Taylor Instrument Companies in Rochester, New York — pneumatic controllers, at the time — published "Optimum Settings for Automatic Controllers" in the Transactions of the ASME in 1942, giving plant operators simple recipes for setting the three knobs from two measured numbers [3][4]. The rules came from experiment and testing as much as from theory, which is exactly why they transferred to the plant floor.

The closing of the loop, so to speak, came in 1984: Karl Johan Åström and Tore Hägglund published a relay-feedback method in Automatica that excites the plant into a small controlled oscillation, extracts Ku and Tu automatically, and applies ZN-style rules — the basis of the "autotune" button on the controller sitting in your rack today [5][6].

Related tools

Sources

  1. https://en.wikipedia.org/wiki/PID_controller
  2. https://en.wikipedia.org/wiki/Nicolas_Minorsky
  3. https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method
  4. https://asmedigitalcollection.asme.org/fluidsengineering/article/64/8/759/1155342/Optimum-Settings-for-Automatic-Controllers
  5. https://www.scirp.org/reference/referencespapers?referenceid=902534
  6. https://warwick.ac.uk/fac/cross_fac/iatl/research/reinvention/archive/volume5issue2/hornsey/
  7. https://ieeexplore.ieee.org/document/1104827

Written by HE in our own words from the cited sources — engineering judgment included, your stamp still required. All entries →

★ The Reference Shelf

Reading is free. The shelf is for cardholders.

Your library card is an email address: pin it to your shelf, print the card, take the FE/PE quick-reference pack, read the Huntsville history. The shelf remembers what you reach for.

Already on the list? Enter with your subscribed email →