Buildings.Obsolete.Controls.Continuous.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples for the use of models that can be found in Buildings.Obsolete.Controls.Continuous.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Obsolete.Controls.Continuous.Examples.PIDHysteresis PIDHysteresis Example model for PID controller with hysteresis
Buildings.Obsolete.Controls.Continuous.Examples.PIDHysteresisTimer PIDHysteresisTimer Example model for PID controller with hysteresis and timer

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

Example model for PID controller with hysteresis

Buildings.Obsolete.Controls.Continuous.Examples.PIDHysteresis

Information

Example that demonstrates the use of the PID controller with hysteresis. The control objective is to keep the temperature of the energy storage cap at 40°C. The controller con is parameterized to switch on if the control error is bigger than eon=1. The output of the controller remains above ymin=0.3 until the control error is smaller than eoff=-1, at which time the controller outputs y=0 until the control error is again bigger than 1. The figure below shows the control error con.feeBac.y and the control signal con.y.

Control error.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model PIDHysteresis "Example model for PID controller with hysteresis" extends Modelica.Icons.Example; Buildings.Obsolete.Controls.Continuous.PIDHysteresis con( pre_y_start=false, yMin=0.3, Ti=600, Td=60); Modelica.Blocks.Sources.Constant TSet(k=273.15 + 40, y(unit="K")) "Set point"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor cap(C=1000000, T(start= 313.15, fixed=true)); Buildings.HeatTransfer.Sources.PrescribedTemperature TBC; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(G=20); Modelica.Blocks.Math.Gain gain(k=2000); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temSen; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow Q_flow; Modelica.Blocks.Sources.Sine sine( f=1/86400, offset=273.15, amplitude=20, phase=-1.5707963267949, y(unit="K")); equation connect(TSet.y, con.u_s); connect(TBC.port, theCon.port_a); connect(theCon.port_b, cap.port); connect(con.y, gain.u); connect(cap.port, temSen.port); connect(temSen.T, con.u_m); connect(gain.y, Q_flow.Q_flow); connect(Q_flow.port, cap.port); connect(sine.y, TBC.T); end PIDHysteresis;

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

Example model for PID controller with hysteresis and timer

Buildings.Obsolete.Controls.Continuous.Examples.PIDHysteresisTimer

Information

Example that demonstrates the use of the PID controller with hysteresis and off timer. The example is identical to Buildings.Obsolete.Controls.Continuous.Examples.PIDHysteresis, except that the controller also has an off timer. This timer keeps the control signal at y=0 for a period of minOffTime=1000 seconds. This may be used to avoid short-cycling if the load is small and the system has little heat capacity.

The figure below shows the control error con.feeBac.y and the control signal con.y.

Control error.
Control signal.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model PIDHysteresisTimer "Example model for PID controller with hysteresis and timer" extends Modelica.Icons.Example; Buildings.Obsolete.Controls.Continuous.PIDHysteresisTimer con( yMin=0.3, minOffTime=10000, Ti=60, Td=10); Modelica.Blocks.Sources.Constant TSet(k=273.15 + 40, y(unit="K")) "Set point"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor cap(C=100000, T(start= 293.15, fixed=true)); Buildings.HeatTransfer.Sources.PrescribedTemperature TBC; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(G=10); Modelica.Blocks.Math.Gain gain(k=800); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temSen; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow Q_flow; Modelica.Blocks.Sources.Sine sine( f=1/86400, offset=273.15, amplitude=20, phase=-1.5707963267949); equation connect(TSet.y, con.u_s); connect(TBC.port, theCon.port_a); connect(theCon.port_b, cap.port); connect(con.y, gain.u); connect(cap.port, temSen.port); connect(temSen.T, con.u_m); connect(gain.y, Q_flow.Q_flow); connect(Q_flow.port, cap.port); connect(sine.y, TBC.T); end PIDHysteresisTimer;