Skip to content

PID Controller ​

Proportional-Integral-Derivative controller: out = Kp·e + Ki·∫e dt + Kd·de/dt. Setting any gain to zero disables that term and the icon label shrinks to the active letters (e.g. "PI" when Kd = 0). Two optional clamps are available: an anti-windup clamp on the I term's contribution and a saturation clamp on the final output. Each clamp turns on its own little saturation-curve icon inside the body so the active limits are visible at a glance.

Category: Continuous

Ports ​

PortKindSignalNotes
inControl inputReal
outControl outputReal

Parameters ​

ParameterTypeDefaultUnitsDescriptionID
KpNumber1—Proportional gain. Set to 0 to disable the P term (the icon label drops the 'P').kp
KiNumber0.1—Integral gain. Set to 0 to disable the I term (the icon label drops the 'I' and the integrator stops accumulating even if Ki is later restored; the saturation toggle and limits remain in the dialog and are honoured when Ki is non-zero).ki
KdNumber0.01—Derivative gain (backward-difference). Set to 0 to disable the D term (drops the 'D' from the icon).kd
I₀Number0—Initial value of the integrator state at sim_time = 0.initial_integrator
I saturationChoice: Off / OnOff—Clamp the integral term's contribution (Ki·∫e dt) to [I_min, I_max]. Standard anti-windup: once the contribution hits a limit, the integrator state itself is back-solved so further input in the same direction cannot grow it.i_saturation
I_maxNumber1—Upper saturation limit on Ki·∫e dt.i_upper_limit
I_minNumber-1—Lower saturation limit on Ki·∫e dt.i_lower_limit
Output saturationChoice: Off / OnOff—Clamp the final summed output (P + I + D) to [Out_min, Out_max] after every step. Independent of the I-term anti-windup clamp above — you can use either, both, or neither.out_saturation
Out_maxNumber1—Upper saturation limit on the final output.out_upper_limit
Out_minNumber-1—Lower saturation limit on the final output.out_lower_limit

Used in samples ​

In the course ​