Control Systems
PID Controller
Proportional-Integral-Derivative — the workhorse of process control
A PID controller computes a control signal from three terms acting on the error (setpoint minus measurement). Proportional reacts to current error. Integral accumulates past error to eliminate steady-state offset. Derivative anticipates by reacting to error rate. The sum drives the actuator. Tunable gains Kp, Ki, Kd shape transient and steady-state response. Used in 95% of industrial control loops: temperature, flow, pressure, motor speed, motion control. Tuning methods include Ziegler-Nichols, lambda tuning, and auto-tuning.
- TermsProportional, integral, derivative
- OutputKp e + Ki ∫e dt + Kd de/dt
- Use rate~95% of industrial control loops
- TuningZiegler-Nichols, lambda, auto-tune
- P onlySteady-state error
- PI commonSufficient for most processes
Interactive visualization
Press play, or step through manually. The visualization is yours to drive — try it before reading on.
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Why PID matters
- Universal. Works on most linear processes without a model.
- Industrial control. Temperature, flow, pressure, level loops.
- Motion control. Servo position and velocity loops.
- Robotics. Joint control in arms, drones, vehicles.
- HVAC. Building thermostats and zone controls.
- Power. Generator excitation, frequency, voltage regulation.
- Robust. Forgiving of model errors and parameter changes.
Common misconceptions
- More Kp is better. Excess gain causes oscillation.
- D term always helps. Amplifies noise; often hurts more than helps.
- Tuning once is enough. Process changes (load, season) may need retuning.
- Anti-windup optional. Saturated actuators wreck PID without it.
- Same gains for all. Each loop differs; copy-paste rarely works.
- PID solves everything. Highly nonlinear or constrained systems may need MPC.
Frequently asked questions
What is a PID controller?
A controller that computes its output as the sum of three terms based on the error e between setpoint and measurement. Proportional term Kp times e responds to present error. Integral term Ki times integral of e over time accumulates past error. Derivative term Kd times de/dt responds to rate of change. The combined signal drives the actuator (valve, heater, motor).
What does each term do?
Proportional: bigger error means bigger correction. Reduces but doesn't eliminate steady-state error. Integral: keeps adding to output as long as error persists. Eliminates steady-state error but slows response and adds phase lag. Derivative: reacts to error trend. Adds damping and faster response but amplifies sensor noise. Tuning balances them.
How is a PID tuned?
Ziegler-Nichols: increase Kp until system oscillates at ultimate gain Ku and period Tu, then set Kp = 0.6 Ku, Ti = Tu/2, Td = Tu/8. Lambda tuning: aims for first-order response with chosen time constant lambda. Internal Model Control (IMC) tuning: based on plant model. Modern auto-tuners apply step or relay tests and compute gains automatically.
Why is integral wind-up dangerous?
When the actuator saturates (valve fully open, motor at max), the error persists but the actuator can't respond. The integral term keeps accumulating, building a large bias. When error finally reverses, the integrator must unwind through all that accumulated value, causing huge overshoot. Anti-windup techniques (clamping, back-calculation) prevent this.
When is derivative not used?
Derivative amplifies high-frequency noise. Noisy measurements (flow, level often) make Kd impractical. Derivative on setpoint causes huge spikes when setpoint steps; derivative-on-measurement-only fixes this. Many real loops are PI rather than PID. PID excels in motion control, fast servo, and well-filtered processes where derivative pays off.
What are advanced variants?
PI plus feedforward (adding model-based predictions). Cascade control (outer loop sets inner loop's setpoint — heater outer, motor inner). Gain scheduling (adjust gains based on operating point). Adaptive control (learn parameters online). Model predictive control (MPC) handles constraints and multivariable systems but PID still dominates simple loops due to robustness.
What's the difference between position and velocity form?
Position form computes total output from absolute terms. Velocity form computes change in output from incremental terms (delta-u rather than u). Velocity form simplifies bumpless transfer between manual and auto modes and avoids integral windup naturally. Most digital implementations use velocity form. Mathematically equivalent for linear cases.