Buildings.Fluid.HydronicConfigurations.Controls

Package with control blocks

Information

This package contains control blocks used in the models from Buildings.Fluid.HydronicConfigurations.

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

Package Content

Name Description
Buildings.Fluid.HydronicConfigurations.Controls.OperatingModes OperatingModes Package with operating mode definitions
Buildings.Fluid.HydronicConfigurations.Controls.PIDWithOperatingMode PIDWithOperatingMode PID controller with operating mode input
Buildings.Fluid.HydronicConfigurations.Controls.Validation Validation Validation models

Buildings.Fluid.HydronicConfigurations.Controls.PIDWithOperatingMode Buildings.Fluid.HydronicConfigurations.Controls.PIDWithOperatingMode

PID controller with operating mode input

Buildings.Fluid.HydronicConfigurations.Controls.PIDWithOperatingMode

Information

This block adds the following features to Buildings.Controls.OBC.CDL.Reals.PIDWithReset.

Parameters

TypeNameDefaultDescription
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type 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_neutral0Value to which the controller output is reset at disable time
Control gains
Realk1Gain of controller
RealTi0.5Time constant of integrator block [s]
RealTd0.1Time constant of derivative block [s]
Limits
RealyMax1Upper limit of output
RealyMin0Lower limit of output
Integrator reset
Realy_resety_neutralValue to which the controller output is reset at enable time or change-over switch
Advanced
Integrator anti-windup
RealNi0.9Ni*Ti is time constant of anti-windup compensation
Derivative block
RealNd10The higher Nd, the more ideal the derivative block

Connectors

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

Modelica definition

block PIDWithOperatingMode "PID controller with operating mode input" parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=100*Buildings.Controls.OBC.CDL.Constants.eps)=1 "Gain of controller"; parameter Real Ti(unit="s")=0.5 "Time constant of integrator block"; parameter Real Td(unit="s")=0.1 "Time constant of derivative block"; parameter Real r( min=100*Buildings.Controls.OBC.CDL.Constants.eps)=1 "Typical range of control error, used for scaling the control error"; parameter Real yMax=1 "Upper limit of output"; parameter Real yMin=0 "Lower limit of output"; parameter Real Ni( min=100*Buildings.Controls.OBC.CDL.Constants.eps)=0.9 "Ni*Ti is time constant of anti-windup compensation"; parameter Real Nd( min=100*Buildings.Controls.OBC.CDL.Constants.eps)=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 Real y_reset=y_neutral "Value to which the controller output is reset at enable time or change-over switch"; parameter Real y_neutral=0 "Value to which the controller output is reset at disable time"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u_s "Connector of setpoint input signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u_m "Connector of measurement input signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y "Connector of actuator output signal"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput mode "Control mode"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPID( final controllerType=controllerType, final k=k, final Ti=Ti, final Td=Td, final r=r, final yMax=yMax, final yMin=yMin, final Ni=Ni, final Nd=Nd, final xi_start=y_neutral, final yd_start=y_neutral, final reverseActing=reverseActing, final y_reset=y_reset) "Controller"; Buildings.Controls.OBC.CDL.Integers.Change cha "Monitor change of signal value"; Buildings.Controls.OBC.CDL.Reals.Multiply mulSet "Multiply input with mapping coefficient"; Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(final nin=3) "Select mapping coefficient based on operating mode"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant map_ms[3](k={0,1,-1}) "Map set point and measured values depending on actual operating mode"; Buildings.Controls.OBC.CDL.Reals.Multiply mulMea "Multiply input with mapping coefficient"; Buildings.Controls.OBC.CDL.Reals.Switch swi; Buildings.Controls.OBC.CDL.Integers.LessEqualThreshold isDis(t=Controls.OperatingModes.disabled) "Returns true if disabled"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant disVal(k=y_neutral) "Value when disabled"; Buildings.Controls.OBC.CDL.Integers.AddParameter addPar(final p=1) "Convert mode index to array index"; equation connect(cha.y, conPID.trigger); connect(u_s, mulSet.u2); connect(extIndSig.y, mulSet.u1); connect(u_m, mulMea.u2); connect(extIndSig.y, mulMea.u1); connect(mulMea.y, conPID.u_m); connect(mulSet.y, conPID.u_s); connect(mode, cha.u); connect(swi.y, y); connect(conPID.y, swi.u3); connect(isDis.y, swi.u2); connect(mode, isDis.u); connect(disVal.y, swi.u1); connect(addPar.y, extIndSig.index); connect(mode, addPar.u); connect(map_ms.y, extIndSig.u); end PIDWithOperatingMode;