blockStageChangeCommand

Generate stage change command

Information

The plant equipment is staged in part based on required capacity, Qrequired, relative to nominal capacity of a given stage, Qstage. This ratio is the operative part load ratio, OPLR.

OPLR = Qrequired / Qstage

If both primary and secondary hot water temperatures and flow rates are available, the sensors in the primary loop are used for calculating Qrequired. If a heat recovery chiller is piped into the secondary return, the sensors in the primary loop are used. (These conditions are implemented in Buildings.Templates.Plants.Controls.HeatPumps.AirToWater.)

The required capacity is calculated based on return temperature, active supply temperature setpoint and measured flow through the associated circuit flow meter.

The required capacity used in logic is a rolling average over a period of dtMea of instantaneous values sampled at minimum once every 30 s.

When a stage up or stage down transition is initiated, Qrequired is held fixed at its last value until the longer of the successful completion of the stage change and the duration dtRun.

The nominal capacity of a given stage, Qstage, is calculated as the sum of the design capacities of all units enabled in a given stage.

Staging is executed per the conditions below subject to the following requirements.

  • Each stage has a minimum runtime of dtRun. (This condition is implemented in Buildings.Templates.Plants.Controls.Utilities.StageIndex.)
  • Timers are reset to zero at the completion of every stage change.
  • Any unavailable stage is skipped during staging events, but staging conditionals in the current stage are evaluated as per usual.

A stage up command is triggered if any of the following is true:

A stage down command is triggered if both of the following are true:

  • Next available lower stage OPLR < plrSta for a duration of dtRun.
  • The failsafe stage up condition is not true.

Details

A staging matrix staEqu is required as a parameter. See the documentation of Buildings.Templates.Plants.Controls.StagingRotation.EquipmentEnable for the associated definition and requirements.

An "if" condition is used to generate the stage up and down command as opposed to a "when" condition. This means that the command remains true as long as the condition is verified. This is necessary, for example, if no higher stage is available when a stage up command is triggered. Using a "when" condition – which is only valid at the point in time at which the condition becomes true – would prevent the plant from staging when a higher stage becomes available again. To avoid multiple consecutive stage changes, the block that receives the stage up and down command and computes the stage index must enforce a minimum stage runtime of dtRun.

Parameters

TypeNameDefaultDescription
Buildings.Templates.Plants.Controls.Types.ApplicationtypType of application
Booleanhave_pumSecSet to true for primary-secondary distribution, false for primary-only
Booleanhave_inpPlrStafalseSet to true to use an input signal for SPLR, false to use a parameter
RealplrSta0.9Staging part load ratio
Real[nEqu,nSta]traStaEqu{{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}Transpose of staging matrix
Real[:,:]staEquStaging matrix – Equipment required for each stage
IntegernStasize(staEqu, 1)Number of stages
IntegernEqusize(staEqu, 2)Number of equipment
Real[nEqu]capEquDesign capacity of each equipment
RealdtRun900Runtime with exceeded staging part load ratio before staging event is triggered
RealdtMea300Duration used to compute the moving average of required capacity
Realcp_defaultDefault specific heat capacity used to compute required capacity
Realrho_defaultDefault density used to compute required capacity
RealdTDelta-T triggering stage up command (>0)
RealdtPri900Runtime with high primary-setpoint Delta-T before staging up
RealdtSec600Runtime with high secondary-primary and secondary-setpoint Delta-T before staging up

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nSta]u1AvaStaStage available signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputu1StaProStaging process in progress
Buildings.Controls.OBC.CDL.Interfaces.RealInputuPlrStaInput signal for staging part load ratio
Buildings.Controls.OBC.CDL.Interfaces.IntegerInputuStaStage index
Buildings.Controls.OBC.CDL.Interfaces.RealInputTRetReturn temperature used to compute required capacity
Buildings.Controls.OBC.CDL.Interfaces.RealInputTSupSetActive supply temperature setpoint used to compute required capacity
Buildings.Controls.OBC.CDL.Interfaces.RealInputV_flowVolume flow rate used to compute required capacity
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputy1UpStage up command
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputy1DowStage down command
Buildings.Controls.OBC.CDL.Interfaces.RealInputTPriSupPrimary supply temperature
Buildings.Controls.OBC.CDL.Interfaces.RealInputTSecSupSecondary supply temperature

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[nEqu,nSta]traMatStaEquTranspose of staging matrix
Buildings.Controls.OBC.CDL.Routing.RealExtractor[nEqu]reqEquStaExtract equipment required at given stage
Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicatorintScaRepReplicate signal
Buildings.Controls.OBC.CDL.Reals.Multiply[nEqu]capEquStaCapacity of each equipment required at given stage
Buildings.Controls.OBC.CDL.Reals.Sources.Constant[nEqu]capEquParCapacity of each equipment
Buildings.Controls.OBC.CDL.Reals.MultiSumcapStaCompute nominal capacity of active stage
Buildings.Controls.OBC.CDL.Reals.GreatergreCompare OPLR to SPLR (hysteresis is to avoid chattering with some simulators)
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.TimerWithResettimUpTimer
Buildings.Controls.OBC.CDL.Reals.LesslesCompare OPLR to SPLR (hysteresis is to avoid chattering with some simulators)
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.TimerWithResettimDowTimer
Utilities.HoldRealholHold value of required capacity at stage change
Buildings.Controls.OBC.CDL.Integers.MaxmaxIntMaximum between stage index and 1
Buildings.Controls.OBC.CDL.Integers.Sources.ConstantoneConstant
Buildings.Controls.OBC.CDL.Integers.Sources.Constant[nSta]idxStaStage index
Buildings.Controls.OBC.CDL.Integers.Less[nSta]idxStaLesActReturn true if stage index lower than active stage index
Buildings.Controls.OBC.CDL.Logical.And[nSta]idxStaLesActAvaReturn true if stage index lower than active stage index and stage available
Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicatorintScaRep1Replicate signal
Utilities.LastTrueIndexidxLasTruIndex of next available lower stage
Buildings.Controls.OBC.CDL.Integers.MaxmaxInt1Maximum between stage index and 1
Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicatorintScaRep2Replicate signal
Buildings.Controls.OBC.CDL.Routing.RealExtractor[nEqu]reqEquStaLowExtract equipment required at next available lower stage
Buildings.Controls.OBC.CDL.Reals.Multiply[nEqu]capEquStaLowCapacity of each equipment required at next available lower stage
Buildings.Controls.OBC.CDL.Reals.MultiSumcapStaLowCompute nominal capacity of next available lower stage
Buildings.Controls.OBC.CDL.Integers.MinminIntMinimum between stage index and 1
Buildings.Controls.OBC.CDL.Conversions.IntegerToRealintToReaConvert to real value
Buildings.Controls.OBC.CDL.Reals.MultiplysetZerSet nominal capacity to zero if no lower available stage
Buildings.Controls.OBC.CDL.Reals.MultiplysplTimCapStaSPLR times capacity of active stage
Buildings.Controls.OBC.CDL.Reals.MultiplysplTimCapStaLowSPLR times capacity of next available lower stage
Utilities.PlaceholderRealparPlrStaParameter value for SPLR
Buildings.Controls.OBC.CDL.Logical.FallingEdgeendStaProTrue when staging process terminates
LoadAveragecapReqCompute required capacity
FailsafeConditionfaiSafFailsafe stage up condition
Buildings.Controls.OBC.CDL.Logical.OreffOrFaiSafEfficiency OR failsafe condition met
Buildings.Controls.OBC.CDL.Logical.NotnotFaiSafFailsafe stage up condition is not true
Buildings.Controls.OBC.CDL.Logical.AndeffAndNotFaiSafEfficiency condition met AND failsafe stage up condition is not true

Revisions

  • May 31, 2024, by Antoine Gautier:
    Refactored using LoadAverage block and added failsafe condition.
  • March 29, 2024, by Antoine Gautier:
    First implementation.