PID Lab
Performance metrics
- Overshoot
- —
- Settling time
- —
- Steady-state error
- —
- Mean error over the final samples
- —
- IAE
- —
- ISE
- —
Metric definitions
IAE = ∫|e| dt and ISE = ∫e² dt over the full run. Measurement is interpolated linearly between samples. Reference is held over each interval.
Overshoot is the peak excursion beyond the target in the direction of the latest reference step, as a percentage of step size. At startup the initial measurement is the baseline. Load or mode changes restart evaluation. Overshoot is undefined for a load change or manual operation.
Settling requires ≥3 s and ≥3 intervals inside ±2% of the step size (or setpoint magnitude), at least ±0.001 units. The check also considers the current command and commands still in transit. The final mean error describes the final samples. Steady-state error requires sufficient observation, low variation and proximity to the model equilibrium.
Compare runs
Up to four complete runs per browser tab. Select runs to overlay their traces.
Browser storage is unavailable. Runs are available until you leave this page.
Run conditions differ. Check the model, limits, initial values, setpoints, disturbances, mode and timing.
Runs for a different process appear in the table only. Select the same process to overlay the traces.
| Trace | Name | Tuning and conditions | Mₚ | tₛ | e∞ | Final mean | IAE | ISE | Actions |
|---|
Models and tuning
Parallel PID and discretisation
eₖ = rₖ − yₖ
Pₖ = Kp·eₖ
ΔIₖ = Ki·Ts·eₖ
Dₖ = (Tf·Dₖ₋₁ − Kd·(yₖ − yₖ₋₁)) / (Tf + Ts)
uₖ = clamp(Pₖ + Iₖ + Dₖ + b, Umin, Umax)
The integrator uses the current error (backward Euler). The derivative on measurement uses a first-order filter discretised by backward Euler. D starts at zero. P omits I and D, PI omits D. Zero Ki or Kd also disables the corresponding term.
With anti-windup enabled, the integral increment is limited to the available output headroom in its direction. In manual and on the first sample back in auto, I = u − P − D. If integration is disabled, the same value becomes the bias b for bumpless transfer.
Process equations and model limits
FOPDT: T·dy/dt = K·u(t−L) + d − y. The controller output is held until the next sample. Each constant input segment uses the exact exponential update. For fractional L the interval is split at the delayed command boundary. The configured prehistory output applies for t < 0.
Pump: T·dp/dt = max(0, Hₘₐₓ·(u/100)² − R·q²) − p, q = max(0, q₀ + d). The update is exponential. The model represents lumped inertia and quadratic losses. Water hammer, cavitation, and pump curves are outside its scope.
Tank: ΔV = (Qin − Qout − Qoverflow)·Ts/3600, h = V/A. Inflow is proportional to valve opening. Outflow is limited by available volume. Excess above A·H is reported as overflow. Displayed flows are interval averages and outlet demand is independent of hydrostatic head.
Scheduled steps take effect at the first sample at or after the programmed time. Steps at the final sample or later are skipped. Live inputs take priority on the same sample. A run supports up to 30,000 intervals.
What to look for when tuning
P moves the output with the error. If a nonzero command is needed at the operating point, proportional-only control without bias leaves an offset. I accumulates error and supplies the command at e ≈ 0. At saturation, accumulated error can delay recovery from the limit.
D opposes rapid movement of the measurement. Its filter limits the response to fast changes. With high gain and dead time, the controller can change output several times before the process responds. Oscillations show up in the trace. Overshoot appears when the measurement crosses and moves beyond the target.
This simulation is intended for engineering analysis and learning. Applying algorithms to real equipment requires separate calculations, testing and safety verification.