MaximaLabsOpen app

PID Control

The ISA-standard positional PID form plus three industrial refinements: anti-windup (clamping/conditional integration), split-range (one controller driving two complementary actuators), and cascade (a slow outer loop setting a fast inner loop's setpoint).

controlpidanti-windupcascade
Concept

A single PI(D) loop, positional form, with the integral carried as its own ODE state (so the same integrator that handles the process handles the controller — no separate discrete update rule to keep in sync). PI by default; set a nonzero derivative time to add derivative action, which acts on the measurement, not the setpoint (no setpoint-change "kick").

The math
Show the governing equations
u=ubias+Kc(e+IτI+τDd(PV)dt),dIdt=eu = u_{bias} + K_c\left(e + \frac{I}{\tau_I} + \tau_D\frac{d(PV)}{dt}\right), \quad \frac{dI}{dt} = e
Output clamped to [u_min, u_max]. Three industrial refinements on top of the bare loop:
Execution

Refinements

  • Anti-windup — clamping/conditional integration: while the output is saturated and the error would drive it further into the limit, the integral stops accumulating (and can still unwind once the error flips sign).
  • Split-range — one controller output drives two complementary actuators over the lower/upper halves of its range (e.g. cooling vs. heating on the same loop).
  • Cascade — a slow outer (primary) loop's output becomes the setpoint of a fast inner (secondary) loop.

Used directly by both the tank engine (level/temperature loops) and the pressure network engine (PID-driven valves).