PID Control and Tuning
The three terms, Ziegler-Nichols and lambda tuning, derivative filtering and a complete oven-loop example.
The three terms
u(t) = Kp [ e(t) + (1 ÷ Ti) ∫ e dt + Td de/dt ]
PID is used in about nine control loops out of ten, from the thermostat of a 3D printer to the pressure control of a refinery. In the Laplace domain the controller is C(s) = Kp (1 + 1 ÷ (Ti s) + Td s) (Laplace Transforms and Transfer Functions).
Forms and units
| Form | Parameters | Note |
|---|---|---|
| Standard (ISA) | Kp, Ti (s or min), Td | the integral time scales with Kp; most process controllers |
| Parallel (independent) | Kp, Ki = Kp ÷ Ti, Kd = Kp Td | each term has its own gain; common in drives and PLC function blocks |
| Proportional band | PB (%) = 100 ÷ Kp | old process instruments; a 50 % band is Kp = 2 |
| Repeats per minute | 1 ÷ Ti in repeats per minute | the reciprocal of the integral time: check which a controller uses |
Always check the form and the units in the manual: the same numbers mean different things in different controllers. The oven’s lambda-tuned PI (Kp = 2.0, Ti = 120 s) is Ki = 0.0167 per second in the parallel form, and a proportional band of 50 percent.
What each term does
| Increase… | Rise time | Overshoot | Settling time | Steady-state error | Stability |
|---|---|---|---|---|---|
| Kp | shorter | larger | little change | smaller | worse |
| Ki (shorter Ti) | shorter | larger | longer | eliminated | worse |
| Kd (larger Td) | little change | smaller | shorter | none | better (if not noisy) |
P gives the main push, proportional to the error; I removes the offset by working until the error is zero, at the price of lag; D anticipates, adding a damping in proportion to the speed of change, but it amplifies noise.
Tuning rules
- Ziegler–Nichols reaction curve: from a step test fit K, τ and θ, then use Kp = 0.9 τ ÷ (K θ) and Ti = 3.33 θ for a PI, Kp = 1.2 τ ÷ (K θ), Ti = 2 θ, Td = 0.5 θ for a PID.
- Ziegler–Nichols ultimate gain: raise a P-only gain until the loop oscillates steadily at the ultimate gain Ku and period Pu; then PI: Kp = 0.45 Ku, Ti = Pu ÷ 1.2; PID: 0.6 Ku, Pu ÷ 2, Pu ÷ 8. Aggressive: designed for a quarter-wave decay, so expect 20 to 40 percent overshoot.
- Lambda (IMC) tuning: choose a closed-loop time constant λ (typically λ ≥ θ) and set Ti = τ, Kp = τ ÷ (K (λ + θ)). Smooth and robust; the trade-off is explicit.
- Cohen–Coon, SIMC, relay auto-tune and software tools: see the PID Tuner for the calculations and a response plot.
Worked example: five tunings of the oven
Worked example: K = 2, τ = 120 s, θ = 15 s, a 20 °C step and a 5 percent disturbance
- Reaction-curve rules: Kp = 0.9 × 120 ÷ (2 × 15) = 3.6, Ti = 3.33 × 15 = 50 s for the PI; for the PID 4.8, 30 s and 7.5 s.
- Ultimate-gain rules: the P-only loop oscillates when −arctan(ω τ) − ω θ = −180°, at ωu = 0.110 rad/s (period Pu = 57 s) with Ku = √(1 + (ωu τ)²) ÷ K = 6.61. The PI is then 2.97, 48 s and the PID 3.96, 29 s, 7.2 s.
- Lambda with λ = θ: Kp = 120 ÷ (2 × 30) = 2.0, Ti = 120 s.
| Tuning | Kp | Ti | Td | Overshoot (20 °C step) | Settling (2 %) | IAE (°C·s) | Peak deviation, 5 % disturbance | Phase margin |
|---|---|---|---|---|---|---|---|---|
| Ziegler–Nichols PI | 3.60 | 50 s | — | 18 % | 189 s | 766 | 1.67 °C | 26° |
| Ziegler–Nichols PID | 4.80 | 30 s | 7.5 s | 16 % | 106 s | 691 | 1.28 °C | 37° |
| Z–N ultimate-gain PI | 2.97 | 48 s | — | 16 % | 129 s | 700 | 1.76 °C | 32° |
| Z–N ultimate-gain PID | 3.96 | 29 s | 7.2 s | 20 % | 150 s | 743 | 1.33 °C | 37° |
| Lambda PI (λ = dead time) | 2.00 | 120 s | — | 5 % | 92 s | 648 | 2.06 °C | 61° |
Reading the table: the ultimate-gain and reaction-curve PID tunings are fast but have the least margin and ring; the lambda PI has the smallest overshoot (5 percent) and the best phase margin (61°) and settles first because it does not ring; the price is a slightly larger peak deviation under a disturbance. The right choice depends on whether the setpoint response or the disturbance response matters more, and on how much the process may change (a high margin tolerates a process whose gain or delay drifts).
Derivative action and noise
A pure derivative responds to every bit of noise. Real controllers therefore filter it with a first-order lag of Td ÷ N (N = 5 to 20), and take the derivative on the measurement rather than the error, so a setpoint step does not give a spike (derivative kick). With Kp = 4.8 and N = 10 the high-frequency gain is Kp (1 + N) = 53: 0.1 °C of sensor noise moves the heater by 5.3 percent, enough to wear a relay or a valve out. On slow, noisy loops (temperature, level, flow) use PI, not PID. Setpoint weighting and a two-degree-of-freedom form let you tune the disturbance response and the setpoint response separately.
Choosing P, PI or PID
| Process | Controller | Why |
|---|---|---|
| Flow, pressure (fast, little lag) | PI with low gain | noise makes D useless; I removes the offset |
| Level in a tank (an integrator) | P or PI, loosely tuned | a tank is already an integrator; only a small gain is needed, and averaging level is often desired |
| Temperature (slow, with lag and delay) | PI or PID | D helps with the big lag if the sensor is clean |
| Speed of a motor | PI | a fast inner loop |
| Position servo | PID or P with velocity feedback | a cascade of P (position), PI (velocity) and PI (current) |
| Pure dead-time processes | I only, or a predictor (Smith) | P and D can do nothing useful |
Related
- Previous: Time Response and Specifications. Next: Frequency Response and Bode Plots.
- PID Tuner.
- Motors, Drives and PID (PLC guide).
- Control Systems: the whole guide.
FAQ
Where do I start tuning?
Make a step test of the process with the loop in manual (Tuning and Troubleshooting Control Loops), read K, τ and θ, and compute a lambda or SIMC tuning. Then fine-tune on the real loop.
Why does the output oscillate after I increase the gain?
The loop gain at the frequency where the phase reaches −180° has reached 1. Reduce the gain or add phase lead (a derivative term) (Stability: Routh, Root Locus and Margins).
What is derivative kick?
A spike in the output when the setpoint changes, because the derivative of the error sees a step. Taking the derivative of the measurement instead avoids it.
Is auto-tune reliable?
Usually yes, for a stable process: a relay or a step test finds Ku and Pu or K, τ, θ. Check the result on the real process before trusting it.
References
- Åström, K. J., Hägglund, T., Advanced PID Control, ISA; Ziegler, J. G., Nichols, N. B., Optimum Settings for Automatic Controllers, Transactions of the ASME 64 (1942).
- Skogestad, S., Simple Analytic Rules for Model Reduction and PID Controller Tuning, Journal of Process Control 13 (2003) (SIMC).
- Seborg, D. E., et al., Process Dynamics and Control, Wiley; Smith, C. A., Corripio, A. B., Principles and Practice of Automatic Process Control.
Last reviewed: October 2026. Tuning constants are standard rules; results use the oven model.
