modelLimPID_Hysteresis

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
SimpleControllercontrollerTypeSimpleController.PIDType of controller
BooleanderMeastrue=true avoid derivative kick
Realyb0Output bias. May improve simulation
Realk_s1Setpoint input scaling: k_s*u_s. May improve simulation
Realk_m1Measurement input scaling: k_m*u_m. May improve simulation
RealyMaxModelica.Constants.infUpper limit of output
RealyMin-yMaxLower limit of output
Parameters: Tuning Controls
Realk1Controller gain: +/- for direct/reverse acting
SI.TimeTi0.5Time constant of Integrator block
SI.TimeTd0.1Time constant of Derivative block
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
Initialization
.Modelica.Blocks.Types.InitPIDinitType.Modelica.Blocks.Types.InitPID.NoInitType 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
Booleanstrictfalse= true, if strict limits with noEvent(..)
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

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
LimPIDPID
Modelica.Blocks.Logical.HysteresishysHysteresis element to switch controller on and off
Modelica.Blocks.Math.FeedbackfeeBac

Revisions

Modified from IBPSA Library