modelPIDHysteresis

PID controller with anti-windup, output limiter and output hysteresis

Extends from Modelica.Blocks.Interfaces.SVcontrol (Single-Variable continuous controller).

Information

Block of a controller for set point tracking with a hysteresis element that switches the controller on and off.

If the controller is off, and the control error becomes larger than eOn, then the controller switches to on and remains on until the control error is smaller than eOff. When the controller is on, the set point tracking can be done using a P-, PI-, or PID-controller. In its off-mode, the control output is zero. Thus, the parameters yMin and yMax are used to constrain the output of the controller during its on mode only. This can be used, for example, to modulate a device between 0.3 and 1.0, and switch it to off when the control error is small enough.

Parameters

TypeNameDefaultDescription
Hysteresis
RealeOn1if off and control error > eOn, switch to set point tracking
RealeOff-eOnif on and control error < eOff, set y=0
Booleanpre_y_startfalseValue of hysteresis output at initial time
Set point tracking
Modelica.Blocks.Types.SimpleControllercontrollerTypeModelica.Blocks.Types.SimpleController.PIDType of controller
Realk1Gain of controller
Modelica.SIunits.TimeTiTime constant of Integrator block
Modelica.SIunits.TimeTdTime constant of Derivative block
RealyMax1Upper limit of output
RealyMin0Lower limit of output
Realwp1Set-point weight for Proportional block (0..1)
Realwd0Set-point weight for Derivative block (0..1)
RealNi0.9Ni*Ti is time constant of anti-windup compensation
RealNd10The higher Nd, the more ideal the derivative block
BooleanreverseActionfalseSet to true to enable reverse action (such as for a cooling coil controller)
Initialization
Modelica.Blocks.Types.InitPIDinitTypeModelica.Blocks.Types.InitPID.DoNotUse_InitialIntegratorStateType of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)
Realxi_start0Initial or guess value value for integrator output (= integrator state)
Realxd_start0Initial or guess value for state of derivative block
Realy_start0Initial value of output
Advanced
Booleanstricttrue= true, if strict limits with noEvent(..)

Connectors

TypeNameDefaultDescription
RealInputu_s (from SVcontrol)Connector of setpoint input signal
RealInputu_m (from SVcontrol)Connector of measurement input signal
RealOutputy (from SVcontrol)Connector of actuator output signal

Components

TypeNameDefaultDescription
LimPIDPIDController for room temperature
Modelica.Blocks.Logical.HysteresishysHysteresis element to switch controller on and off
Modelica.Blocks.Math.FeedbackfeeBac

Revisions

  • September 29, 2016, by Michael Wetter:
    Removed parameter limitsAtInit because it is no longer used in the PID controller.
  • April 13, 2016, by Michael Wetter:
    Set zer(final k=0) and made swi, zer and zer1 protected which they are also for IBPSA.Controls.Continuous.PIDHysteresis. These changes are not backwards compatible.
  • March 15, 2016, by Michael Wetter:
    Changed the default value to strict=true in order to avoid events when the controller saturates. Also assigned propogated values to be final. This is for issue 433.
  • February 24, 2010, by Michael Wetter:
    Changed PID controller from Modelica Standard Library to PID controller from Buildings library to allow reverse control action.
  • October 2, 2009, by Michael Wetter:
    Fixed error in default parameter eOn. Fixed error by introducing parameter Td, which used to be hard-wired in the PID controller.
  • February 14, 2009, by Michael Wetter:
    First implementation.