What the simulator is for
A PID controller compares the setpoint with the process variable and drives its output to remove the error. This simulator puts a controller on a simple first-order process — gain K and time constant τ, the most common way to describe a process from a step test — and shows how the loop answers a setpoint step as you move the sliders. Tick the actions you want and watch what each one does.
- P (gain Kc): reacts to the error now. More gain, faster response.
- I (integral time Ti): keeps acting until the error is gone. A shorter Ti acts harder and adds overshoot.
- D (derivative time Td): reacts to how fast the PV is changing and damps the response.
Worked example
Take a process with gain K = 1.5 and time constant τ = 60 s, and a +10 % setpoint step. With P only and Kc = 0.571, the PV settles 5.4 % short of the setpoint. Proportional action needs an error to produce any output, so an offset always remains: offset = step ÷ (1 + K·Kc).
Tick I with Ti = 60 s (equal to τ) and the offset disappears: the PV reaches the setpoint in about 274 s with no overshoot. Raise Kc to 2 and cut Ti to 30 s and it settles faster, in about 121 s, but overshoots by 7.7 %.
A good starting point
For a first-order process, set Ti equal to the time constant τ, then choose how fast the closed loop should be. If λ is the closed-loop time constant you want, Kc = τ / (K·λ). λ = τ gives a calm response with no overshoot; a smaller λ gives a faster, harder-working loop.
| Setting | Value | Effect |
|---|---|---|
| Ti | τ | cancels the process lag |
| Kc | τ / (K·λ) | λ sets the closed-loop speed |
| Td | 0 (none) | add only on slow, clean loops |
Common mistakes
- Gain in engineering units. K must be in % of PV span per % of output; a gain in m³/h per % gives meaningless settings.
- Wrong controller form. These are ideal (ISA) form settings. Some systems use proportional band (100 / Kc) or repeats per minute (1 / Ti) instead.
- P-only on a loop that must hold its setpoint. Proportional action alone always leaves an offset; add integral action.
- Derivative on noisy loops. Flow and level loops rarely benefit from derivative action. Use PI unless the process is slow and clean, as many temperature loops are.
Basis
The process is first order, τ dPV/dt = −PV + K·u, solved exactly at each time step. The controller is the ideal (ISA) form u = Kc [e + (1/Ti)∫e dt + Td de/dt], with the derivative acting on PV (filtered) and the output limited to 0–100 % with anti-windup. Real processes also have dead time, which limits how fast a loop can be tuned: verify settings on the plant.