PI¶
PI controller with limits and anti-windup (Modelica LimPID: back-calculation with Ni), its integral relaxed to the reset value while disabled
FastSmoothBuildings.Controls.PI, model (source)
Purpose
A PI controller with limits and anti-windup, and a reset without events: while it is disabled, its integral relaxes to the value that gives the reset output, instead of being reset by a trigger. The limits are smoothLimit, which reaches them exactly.
Equations
With the control error e and the integral I,
yunl = k (e + I), y = smoothLimit(yunl, yMin, yMax, dY),
dI/dt = enable (e/Ti + (y − yunl) / (k Ni Ti)) + (1 − enable) (yReset/k − e − I) / τReset, I(0) = yReset/k.
enable= 1: the integral of e/Ti, with back-calculation: when the output is limited, y − yunl draws the integral back with the anti-windup gainNi.enable= 0: the integral relaxes with the time constanttauResetso that the unlimited output tends toyReset; the controller restarts from there when it is enabled again.
enable is a Real and the two parts are blended by it, so it can be the output of a
Hysteresis. The output is not multiplied by
enable: a model that needs no output while disabled multiplies it, as
HeatPumpControl does.
Parameters
| Name | Default | Meaning |
|---|---|---|
k, Ti | gain and integral time | |
yMin, yMax | 0, 1 | limits of the output |
Ni | 0.9 | anti-windup gain |
yReset | yMin | output after a reset |
tauReset | 30 s | time constant of the reset while disabled |
dY | 10−3 (yMax − yMin) |
half-width of the smooth limits |
dY and tauReset are the smoothing of the controller: a calibration or an optimal control
problem can widen them.
Relation to the Modelica Standard Library
The limits and the anti-windup of LimPID (back-calculation with Ni); the reset of a
trigger is replaced by the relaxation above.
Use
In EmissionPI, HeatPumpControl and HVAC.IdealHeatingCoolingPI. See Validation.PIControl.
Parameters¶
| Parameter | Type | Unit | Default | Description |
|---|---|---|---|---|
| k | Real | Gain | ||
| Ti | Real | s | Integral time | |
| yMin | Real | 0 | ||
| yMax | Real | 1 | ||
| Ni | Real | 0.9 | Anti-windup gain | |
| yReset | Real | yMin | Output after a reset | |
| tauReset | Real | s | 30 | Time constant of the reset while disabled |
| dY | Real | 1e-3*(yMax - yMin) | Width of the smooth limits |
Revisions¶
- October 2026: moved from trano's
FastModel.Controls.