Buildings.Obsolete.Controls.Continuous

Package with obsolete models for continuous time control

Information

This package contains obsolete models for continuous time control.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Obsolete.Controls.Continuous.PIDHysteresis PIDHysteresis PID controller with anti-windup, output limiter and output hysteresis
Buildings.Obsolete.Controls.Continuous.PIDHysteresisTimer PIDHysteresisTimer PID controller with anti-windup, hysteresis and timer to prevent short cycling
Buildings.Obsolete.Controls.Continuous.Examples Examples Collection of models that illustrate model use and test models

Buildings.Obsolete.Controls.Continuous.PIDHysteresis Buildings.Obsolete.Controls.Continuous.PIDHysteresis

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

Buildings.Obsolete.Controls.Continuous.PIDHysteresis

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.

Extends from Modelica.Blocks.Interfaces.SVcontrol (Single-Variable continuous controller), Buildings.Obsolete.BaseClasses.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

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
SimpleControllercontrollerTypeModelica.Blocks.Types.Simple...Type of controller
Realk1Gain of controller
TimeTi Time constant of Integrator block [s]
TimeTd Time constant of Derivative block [s]
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
BooleanreverseActingtrueSet to true for reverse acting, or false for direct acting control action
Initialization
InitinitTypeModelica.Blocks.Types.Init.I...Type 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

TypeNameDescription
input RealInputu_sConnector of setpoint input signal
input RealInputu_mConnector of measurement input signal
output RealOutputyConnector of actuator output signal

Modelica definition

model PIDHysteresis "PID controller with anti-windup, output limiter and output hysteresis" extends Modelica.Blocks.Interfaces.SVcontrol; extends Buildings.Obsolete.BaseClasses.ObsoleteModel; parameter Real eOn = 1 "if off and control error > eOn, switch to set point tracking"; parameter Real eOff = -eOn "if on and control error < eOff, set y=0"; parameter Boolean pre_y_start=false "Value of hysteresis output at initial time"; parameter Modelica.Blocks.Types.SimpleController controllerType=Modelica.Blocks.Types.SimpleController.PI "Type of controller"; parameter Real k=1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti "Time constant of Integrator block"; parameter Modelica.Units.SI.Time Td "Time constant of Derivative block"; parameter Real yMax=1 "Upper limit of output"; parameter Real yMin=0 "Lower limit of output"; parameter Real wp=1 "Set-point weight for Proportional block (0..1)"; parameter Real wd=0 "Set-point weight for Derivative block (0..1)"; parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; parameter Boolean reverseActing = true "Set to true for reverse acting, or false for direct acting control action"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.InitialState "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"; parameter Real xi_start=0 "Initial or guess value value for integrator output (= integrator state)"; parameter Real xd_start=0 "Initial or guess value for state of derivative block"; parameter Real y_start=0 "Initial value of output"; parameter Boolean strict=true "= true, if strict limits with noEvent(..)"; Buildings.Controls.Continuous.LimPID PID( final controllerType=controllerType, final k=k, final Ti=Ti, final yMax=yMax, final yMin=yMin, final wp=wp, final wd=wd, final Ni=Ni, final Nd=Nd, final initType=initType, final xi_start=xi_start, final xd_start=xd_start, final y_start=y_start, final Td=Td, final reverseActing=reverseActing, final strict=strict) "Controller for room temperature"; Modelica.Blocks.Logical.Hysteresis hys( final pre_y_start=pre_y_start, final uLow=eOff, final uHigh=eOn) "Hysteresis element to switch controller on and off"; Modelica.Blocks.Math.Feedback feeBac; protected Modelica.Blocks.Logical.Switch swi; Modelica.Blocks.Sources.Constant zer(final k=0) "Zero signal"; Modelica.Blocks.Logical.Switch swi1; equation assert(eOff < eOn, "Wrong controller parameters. Require eOff < eOn."); connect(zer.y, swi.u3); connect(swi.y, y); connect(u_m, PID.u_m); connect(hys.y, swi.u2); connect(PID.y, swi.u1); connect(u_s, feeBac.u1); connect(u_m, feeBac.u2); connect(feeBac.y, hys.u); connect(u_s, swi1.u1); connect(hys.y, swi1.u2); connect(u_m, swi1.u3); connect(swi1.y, PID.u_s); end PIDHysteresis;

Buildings.Obsolete.Controls.Continuous.PIDHysteresisTimer Buildings.Obsolete.Controls.Continuous.PIDHysteresisTimer

PID controller with anti-windup, hysteresis and timer to prevent short cycling

Buildings.Obsolete.Controls.Continuous.PIDHysteresisTimer

Information

Block of a controller for set point tracking with a hysteresis element that switches the controller on and off, and a timer that prevents the controller to short cycle.

The controller is similar to Buildings.Obsolete.Controls.Continuous.PIDHysteresis but in addition, it has a timer that prevents the controller from switching to on too fast. When the controller switches off, the timer starts and avoids the controller from switching on until minOffTime seconds elapsed.

Extends from Modelica.Blocks.Interfaces.SVcontrol (Single-Variable continuous controller), Buildings.Obsolete.BaseClasses.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Parameters

TypeNameDefaultDescription
On/off controller
RealminOffTime600Minimum time that devices needs to be off before it can run again
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
SimpleControllercontrollerTypeModelica.Blocks.Types.Simple...Type of controller
Realk1Gain of controller
TimeTi Time constant of Integrator block [s]
TimeTd Time constant of Derivative block [s]
RealyMax1Upper limit of modulating output
RealyMin0.3Lower limit of modulating output (before switch to 0)
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
BooleanreverseActingtrueSet to true for reverse acting, or false for direct acting control action
Initialization
InitinitTypeModelica.Blocks.Types.Init.I...Type 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

TypeNameDescription
input RealInputu_sConnector of setpoint input signal
input RealInputu_mConnector of measurement input signal
output RealOutputyConnector of actuator output signal
output RealOutputtOnTime since boiler switched on
output RealOutputtOffTime since boiler switched off
output BooleanOutputonOutputs true if boiler is on

Modelica definition

model PIDHysteresisTimer "PID controller with anti-windup, hysteresis and timer to prevent short cycling" extends Modelica.Blocks.Interfaces.SVcontrol; extends Buildings.Obsolete.BaseClasses.ObsoleteModel; parameter Real minOffTime=600 "Minimum time that devices needs to be off before it can run again"; parameter Real eOn = 1 "if off and control error > eOn, switch to set point tracking"; parameter Real eOff = -eOn "if on and control error < eOff, set y=0"; parameter Boolean pre_y_start=false "Value of hysteresis output at initial time"; parameter Modelica.Blocks.Types.SimpleController controllerType=Modelica.Blocks.Types.SimpleController.PI "Type of controller"; parameter Real k=1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti "Time constant of Integrator block"; parameter Modelica.Units.SI.Time Td "Time constant of Derivative block"; parameter Real yMax=1 "Upper limit of modulating output"; parameter Real yMin=0.3 "Lower limit of modulating output (before switch to 0)"; parameter Real wp=1 "Set-point weight for Proportional block (0..1)"; parameter Real wd=0 "Set-point weight for Derivative block (0..1)"; parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; parameter Boolean reverseActing = true "Set to true for reverse acting, or false for direct acting control action"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.InitialState "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"; parameter Real xi_start=0 "Initial or guess value value for integrator output (= integrator state)"; parameter Real xd_start=0 "Initial or guess value for state of derivative block"; parameter Real y_start=0 "Initial value of output"; parameter Boolean strict=true "= true, if strict limits with noEvent(..)"; Modelica.Blocks.Interfaces.RealOutput tOn "Time since boiler switched on"; Modelica.Blocks.Interfaces.RealOutput tOff "Time since boiler switched off"; Buildings.Controls.Continuous.LimPID con( final controllerType=controllerType, final k=k, final Ti=Ti, final Td=Td, final wp=wp, final wd=wd, final Ni=Ni, final Nd=Nd, final initType=initType, final xi_start=xi_start, final xd_start=xd_start, final y_start=y_start, final yMin=yMin, final yMax=yMax, final reverseActing=reverseActing, final strict=strict) "Controller to track setpoint"; Buildings.Controls.Continuous.OffTimer offHys; Modelica.Blocks.Logical.Timer onTimer; Modelica.Blocks.Logical.Timer offTimer; Modelica.Blocks.Interfaces.BooleanOutput on "Outputs true if boiler is on"; Modelica.Blocks.Math.Feedback feeBac; Modelica.Blocks.Logical.Hysteresis hys( final pre_y_start=pre_y_start, final uLow=eOff, final uHigh=eOn) "Hysteresis element to switch controller on and off"; protected Modelica.Blocks.Sources.Constant zer(final k=0) "Zero signal"; Modelica.Blocks.Logical.Switch switch2; Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold(threshold= minOffTime); Modelica.Blocks.Logical.And and3; Modelica.Blocks.Logical.Not not1; Modelica.Blocks.Logical.Switch switch1; equation connect(u_m, con.u_m); connect(zer.y,switch2. u3); connect(switch2.y, y); connect(and3.y,switch2. u2); connect(greaterEqualThreshold.y, and3.u1); connect(offHys.y, greaterEqualThreshold.u); connect(con.y,switch2. u1); connect(onTimer.y, tOn); connect(offTimer.y, tOff); connect(and3.y, on); connect(and3.y, onTimer.u); connect(and3.y, not1.u); connect(not1.y, offTimer.u); connect(and3.y, switch1.u2); connect(u_s, switch1.u1); connect(u_m, switch1.u3); connect(switch1.y, con.u_s); connect(u_s, feeBac.u1); connect(u_m, feeBac.u2); connect(feeBac.y, hys.u); connect(hys.y, offHys.u); connect(hys.y, and3.u2); end PIDHysteresisTimer;