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 status is off at the start of the simulation. This is hardcoded and cannot be modified.

The delay between the on command and the on status is the same as the delay between the off command and the off status. This delay can be adjusted with the parameter delayTime.

Note that the default 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, despite being steadily commanded on. In such cases, the actual status comes and goes, whereas the status computed with this block will remain continuously on.

Parameters

TypeNameDefaultDescription
RealdelayTime2Delay time [s]

Connectors

TypeNameDescription
input BooleanInputy1Equipment run command
output BooleanOutputy1_actualEquipment status

Modelica definition

block StatusEmulator "Block that emulates the status of an equipment" parameter Real delayTime( final quantity="Time", final unit="s")=2 "Delay time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1 "Equipment run command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1_actual "Equipment status"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.InitialStepWithSignal off(nOut=1, nIn=1) "Off status (initial state)"; Modelica.StateGraph.TransitionWithSignal offToOn(final enableTimer=delayTime > 0, final waitTime=delayTime) "Transition from off to on status"; Modelica.StateGraph.StepWithSignal on(nIn=1, nOut=1) "On status"; Modelica.StateGraph.TransitionWithSignal onToOff(final enableTimer=delayTime > 0, final waitTime=delayTime) "Transition from on to off status"; Buildings.Controls.OBC.CDL.Logical.Not notY1 "Return true if equipment commanded off"; equation connect(y1, offToOn.condition); connect(off.outPort[1], offToOn.inPort); connect(on.active, y1_actual); connect(notY1.y, onToOff.condition); connect(on.outPort[1], onToOff.inPort); connect(offToOn.outPort, on.inPort[1]); connect(onToOff.outPort, off.inPort[1]); connect(y1, notY1.u); end StatusEmulator;