01 / EXPLANATION
How a PID controller works
A PID controller calculates an input to a plant from the difference between a target and a measurement. Its three terms answer different questions: how large is the error now, how long has it persisted, and how fast is the signal changing?
Start with three signals: SP, PV, MV
SP is the setpoint, PV the measured process variable, and MV the manipulated variable. In a heating example, SP and PV can be temperatures while MV is a fraction of heater power. The error e = SP − PV has the same units as PV.
The action direction matters. If more power raises temperature, a positive error should increase heating. A cooling valve may have the opposite relationship. Choosing more favourable gains cannot correct the wrong control-action direction.
What P, I and D contribute
P responds to the current error. Increasing Kp increases its contribution to the output. This can speed up the response, but excessive gain can cause oscillation. With proportional-only control, a plant with finite static gain can retain a steady-state offset.
I accumulates error over time and helps remove a constant offset in a stable, unsaturated regime. When the output is already at a limit, accumulation can delay recovery. Inspect MV, output limits and anti-windup as well as PV.
D responds to the rate of change of either error or measurement, depending on the implementation. It can add damping but is sensitive to measurement noise. Differentiating error also responds to a setpoint step; differentiating PV removes that particular source of a kick. The filter and derivative source are part of the tuning, not minor implementation details.
Kp/Ti/Td is not Kp/Ki/Kd
The ideal continuous-time ISA form is shown below. It explains the parameters; an implemented algorithm also accounts for sampling, filtering, limits and operating modes.
u(t) = Kp · [e(t) + (1/Ti) ∫e(t)dt + Td · de(t)/dt]
Ti and Td have units of time. With fixed Kp, decreasing a positive Ti strengthens integral action rather than weakening it. In the parallel form the three gains are independent. For matching ideal forms without additional filters, Ki = Kp/Ti and Kd = Kp·Td. Do not transfer numbers between controllers without checking their forms and units.
A short numerical example
Let Kp = 2 %/°C, Ti = 10 s, Td = 0, and let the error remain at 5 °C. The proportional contribution is 10 %. Starting from zero, the ideal integral contribution grows by 1 percentage point in the first second: (2/10)·5·1 = 1. This calculates controller terms; it is not a recommended heater tuning.
With Ti reduced to 5 s and everything else unchanged, the integral contribution grows by 2 percentage points per second. Increasing Kp in the ISA form changes every enabled term. Comparing parameters only makes sense alongside the formula, signal scaling and output limits.
Why the right formula is not enough
Dead time means an input change is not visible immediately. Noise can provoke unnecessary output movement. Saturation limits what the controller can achieve at all. Adding D or strengthening I does not make these effects disappear.
Test setpoint tracking separately from disturbance rejection. A tuning that suits one scenario may be unsuitable for another. The next material provides a model-based comparison procedure, not authorization to test physical equipment.
Turn the explanation into an experiment
PIDLAB lets you build stands and investigate PID loops in simulation. These materials need no account; the workspace requires sign-in. For access and teaching enquiries, contact info@pidlab.io.
Sign in to the lab User guide