Buildings.Templates.Components.Controls

Control blocks

Information

This package contains control blocks.

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

Package Content

Name Description
Buildings.Templates.Components.Controls.MultipleCommands MultipleCommands Block that converts command signals for multiple units
Buildings.Templates.Components.Controls.StatusEmulator StatusEmulator Block that emulates the status of an equipment
Buildings.Templates.Components.Controls.Validation Validation Package with validation models

Buildings.Templates.Components.Controls.MultipleCommands Buildings.Templates.Components.Controls.MultipleCommands

Block that converts command signals for multiple units

Buildings.Templates.Components.Controls.MultipleCommands

Information

This block computes the following variables based on a Boolean array representing the On/Off command signal for a group of multiple units, such as parallel fans or pumps.

Parameters

TypeNameDefaultDescription
IntegernUni Number of units

Connectors

TypeNameDescription
input BooleanInputy1[nUni]Command signal
output BooleanOutputy1OneOn/Off signal: true if at least one unit is commanded On
output RealOutputnUniOnBouNumber of units that are commanded On, with lower bound of 1
output RealOutputnUniOnNumber of units that are commanded On

Modelica definition

block MultipleCommands "Block that converts command signals for multiple units" parameter Integer nUni(final min=1, start=1) "Number of units"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1[nUni] "Command signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1One "On/Off signal: true if at least one unit is commanded On"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput nUniOnBou "Number of units that are commanded On, with lower bound of 1"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput nUniOn "Number of units that are commanded On"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[nUni] "Convert to real"; Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum(nin=nUni) "Total"; Buildings.Controls.OBC.CDL.Reals.Max max1 "Maximum value"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one(final k=1) "Constant one"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr(nin=nUni) "Returns true if at least one unit is commanded on"; equation connect(booToRea.y, mulSum.u); connect(max1.y, nUniOnBou); connect(mulSum.y, nUniOn); connect(one.y, max1.u2); connect(mulSum.y, max1.u1); connect(y1, booToRea.u); connect(y1, mulOr.u); connect(y1One, mulOr.y); end MultipleCommands;

Buildings.Templates.Components.Controls.StatusEmulator Buildings.Templates.Components.Controls.StatusEmulator

Block that emulates the status of an equipment

Buildings.Templates.Components.Controls.StatusEmulator

Information

This block emulates the status of an equipment, i.e., the current on/off state as reported by the hardware itself.

The implementation is based on Buildings.Fluid.BaseClasses.ActuatorFilter and the model is configured with yLim=0.5 so that the delay between the on command and the on status is equal to the delay between the off command and the off status (about 2 s with the default parameter settings). Note that this delay may not be representative of the actual dynamics of certain equipment such as chillers or heat pumps. In addition, this block uses the equipment command signal to generate the status signal, which in turn can lead to inconsistencies with certain equipment that run cyclically at low load and where the status then comes and goes.

Parameters

TypeNameDefaultDescription
TimeyLim0.5Value of filtered signal above which the equipment reports on status [s]
TimeriseTime10Rise time of the filter (time to reach 99.6 % of the speed) [s]
Initialization
InitinitTypeModelica.Blocks.Types.Init.I...Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)
Realy_start0.0Initial value of output (remaining states are in steady state)

Connectors

TypeNameDescription
input BooleanInputy1Equipment run command
output BooleanOutputy1_actualEquipment status

Modelica definition

block StatusEmulator "Block that emulates the status of an equipment" parameter Modelica.Units.SI.Time yLim=0.5 "Value of filtered signal above which the equipment reports on status"; parameter Modelica.Units.SI.Time riseTime=10 "Rise time of the filter (time to reach 99.6 % of the speed)"; parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)"; parameter Real y_start=0.0 "Initial value of output (remaining states are in steady state)"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1 "Equipment run command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1_actual "Equipment status"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(final realTrue=1, final realFalse=0) "Convert to real"; Fluid.BaseClasses.ActuatorFilter fil( final f=fCut, final initType=initType, final y_start=y_start) "Filter signal"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(final t=yLim) "Compare filtered signal to zero to trigger true status"; protected final parameter Modelica.Units.SI.Frequency fCut=5/(2*Modelica.Constants.pi* riseTime) "Cut-off frequency of filter"; equation connect(y1, booToRea.u); connect(booToRea.y,fil. u); connect(greThr.y, y1_actual); connect(fil.y, greThr.u); end StatusEmulator;