blockPIDWithEnable

PID controller with enable signal

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output 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 uEna switches to true, the integral term of the PID controller is reset so that the output is equal to y_reset, and afterwards this controller will produce at its output y the output of the PID controller.
  • When the input uEna=false, the output of the controller is set to y_neutral and the setpoint is overridden by the measurement signal in order to avoid time integration of the control error.

Parameters

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Types.SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.Types.SimpleController.PIType of controller
Realr1Typical range of control error, used for scaling the control error
BooleanreverseActingtrueSet to true for reverse acting, or false for direct acting control action
Realy_resetyMinValue to which the controller output is reset if the boolean trigger has a rising edge
Realy_neutraly_resetValue to which the controller output is reset when the controller is disabled
Control gains
Realk1Gain of controller
RealTi0.5Time constant of integrator block
RealTd0.1Time constant of derivative block
Limits
RealyMax1Upper limit of output
RealyMin0Lower limit of output
Advanced › Integrator anti-windup
RealNi0.9Ni*Ti is time constant of anti-windup compensation
Advanced › Derivative block
RealNd10The higher Nd, the more ideal the derivative block

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.RealInputu_sSetpoint input signal
Buildings.Controls.OBC.CDL.Interfaces.RealInputu_mMeasurement input signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputuEnaEnable 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.RealOutputyControl output signal

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Reals.PIDWithResetconPIDPID controller
Buildings.Controls.OBC.CDL.Reals.SwitchswiInpSwitch to select input signal
Buildings.Controls.OBC.CDL.Reals.SwitchswiOutSwitch to select output signal

Revisions

  • November 15, 2025, by Michael Wetter:
    Moved to Buildings.Controls.OBC.Utilities.PIDWithEnable as there were identical implementations in Buildings.DHC and in Buildings.Templates.
  • March 29, 2024, by Antoine Gautier:
    First implementation.