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

FormParametersNote
Standard (ISA)Kp, Ti (s or min), Tdthe integral time scales with Kp; most process controllers
Parallel (independent)Kp, Ki = Kp ÷ Ti, Kd = Kp Tdeach term has its own gain; common in drives and PLC function blocks
Proportional bandPB (%) = 100 ÷ Kpold process instruments; a 50 % band is Kp = 2
Repeats per minute1 ÷ Ti in repeats per minutethe 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 timeOvershootSettling timeSteady-state errorStability
Kpshorterlargerlittle changesmallerworse
Ki (shorter Ti)shorterlargerlongereliminatedworse
Kd (larger Td)little changesmallershorternonebetter (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.
TuningKpTiTdOvershoot (20 °C step)Settling (2 %)IAE (°C·s)Peak deviation, 5 % disturbancePhase margin
Ziegler–Nichols PI3.6050 s—18 %189 s7661.67 °C26°
Ziegler–Nichols PID4.8030 s7.5 s16 %106 s6911.28 °C37°
Z–N ultimate-gain PI2.9748 s—16 %129 s7001.76 °C32°
Z–N ultimate-gain PID3.9629 s7.2 s20 %150 s7431.33 °C37°
Lambda PI (λ = dead time)2.00120 s—5 %92 s6482.06 °C61°
Three tunings of the same oven loop01002003004005006000102030time (s)oven temperature rise (°C)Ziegler–Nichols PID: overshoot 16 %Ziegler–Nichols PI: overshoot 18 %Lambda PI (λ = dead time): overshoot 5 %setpoint 20 °COven: K = 2 °C per %, τ = 120 s, dead time 15 s. Heater limited to ±50 %. The disturbance and the settings areon the PID page.
The step responses of three of the tunings.

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

ProcessControllerWhy
Flow, pressure (fast, little lag)PI with low gainnoise makes D useless; I removes the offset
Level in a tank (an integrator)P or PI, loosely tuneda 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 PIDD helps with the big lag if the sensor is clean
Speed of a motorPIa fast inner loop
Position servoPID or P with velocity feedbacka cascade of P (position), PI (velocity) and PI (current)
Pure dead-time processesI only, or a predictor (Smith)P and D can do nothing useful

Related

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.