blockPIDWithEnable
PID controller with enable signal
Extends from Modelica.Blocks.Icons.Block.
Information
Controller that is identical to Buildings.Controls.OBC.CDL.Reals.PIDWithReset, except that it has an enable input signal that can be used to deactivate the PID output and instead output a constant signal.
-
When the input
uEnaswitches totrue, the integral term of the PID controller is reset so that the output is equal toy_reset, and afterwards this controller will produce at its outputythe output of the PID controller. -
When the input
uEna=false, the output of the controller is set toy_neutraland the setpoint is overridden by the measurement signal in order to avoid time integration of the control error.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Types.SimpleController | controllerType | Buildings.Controls.OBC.CDL.Types.SimpleController.PI | Type of controller |
| Real | r | 1 | Typical range of control error, used for scaling the control error |
| Boolean | reverseActing | true | Set to true for reverse acting, or false for direct acting control action |
| Real | y_reset | yMin | Value to which the controller output is reset if the boolean trigger has a rising edge |
| Real | y_neutral | y_reset | Value to which the controller output is reset when the controller is disabled |
| Control gains | |||
| Real | k | 1 | Gain of controller |
| Real | Ti | 0.5 | Time constant of integrator block |
| Real | Td | 0.1 | Time constant of derivative block |
| Limits | |||
| Real | yMax | 1 | Upper limit of output |
| Real | yMin | 0 | Lower limit of output |
| Advanced › Integrator anti-windup | |||
| Real | Ni | 0.9 | Ni*Ti is time constant of anti-windup compensation |
| Advanced › Derivative block | |||
| Real | Nd | 10 | The higher Nd, the more ideal the derivative block |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Interfaces.RealInput | u_s | Setpoint input signal | |
| Buildings.Controls.OBC.CDL.Interfaces.RealInput | u_m | Measurement input signal | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | uEna | Enable signal. If true, PID is active and y will be equal to the PID output, otherwise y will be y_neutral | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | y | Control output signal | |
| Buildings.Controls.OBC.CDL.Reals.PIDWithReset | conPID | PID controller | |
| Buildings.Controls.OBC.CDL.Reals.Switch | swiInp | Switch to select input signal | |
| Buildings.Controls.OBC.CDL.Reals.Switch | swiOut | Switch to select output signal |
Revisions
-
November 15, 2025, by Michael Wetter:
Moved toBuildings.Controls.OBC.Utilities.PIDWithEnableas there were identical implementations inBuildings.DHCand inBuildings.Templates. -
March 29, 2024, by Antoine Gautier:
First implementation.