blockStageIndex

Evaluation of stage index from staging signals

Information

This block is used to compute the stage index for a group of multiple equipment such as CHW pumps or chillers.

  • At initial time, stage 0 is active – all units are disabled.
  • From stage 0, the transition to the next higher available stage is triggered when the lead unit is enabled (u1Lea = true) and if at least one stage is available.
  • From any stage i (1 ≤ i ≤ nSta), the transition to the next higher or lower available stage j (1 ≤ j ≤ nSta, j ≠ i) is triggered when stage i has been active for the minimum runtime and there is a stage up command u1Up or stage down command u1Dow, respectively.
  • From any stage i (1 ≤ i ≤ nSta), the transition to stage 0 is triggered when stage i has been active for the minimum runtime and the lead unit is disabled (u1Lea = false).

Unavailable stages are handled by the following requirements.

  • Any unavailable stage (u1Ava[i] = false) is skipped during staging events.
  • If all higher (resp. lower) stages are unavailable, then the transition to a higher (resp. lower) stage is blocked.
  • If the current stage is unavailable, the transition to the next higher available stage is triggered.
  • Stage transitions due to availability conditions are not subject to the minimum stage runtime requirement.

Caveats

The only way to transition to stage 0 is by disabling the lead unit (u1Lea = false). The stage down command u1Dow cannot be used to transition below stage 1.

When the current stage becomes unavailable, the transition to the next higher available stage is triggered. However, it can happen that equipment that is enabled at the current stage is no longer available while the current stage is not deemed unavailable – for example if a lead/lag alternate equipment remains available. In this case, the equipment rotation logic must stage on the lead/lag alternate equipment to replace the faulty equipment.

Parameters

TypeNameDefaultDescription
Booleanhave_inpAvatrueSet to true if stage availability is provided with input signal, false for stages always available
IntegernStaNumber of stages
RealdtRun0Minimum runtime of each stage

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputu1LeaLead unit enable signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputu1UpStage up command
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputu1DowStage down command
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nSta]u1AvaStaStage available signal
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutputyStage index

Components

TypeNameDefaultDescription
Modelica.StateGraph.InitialStepWithSignalsta0Stage 0 – All units disabled
Modelica.StateGraph.StepWithSignal[nSta]staStage i>0
Modelica.StateGraph.TransitionWithSignal[nSta]sta0ToStaTransition from stage 0 to stage i>0
Modelica.StateGraph.StateGraphRootstateGraphRootState graph root
Modelica.StateGraph.TransitionWithSignal[nSta,nSta]staToStaTransition to higher or lower stage
Buildings.Controls.OBC.CDL.Logical.And[nSta]runAndTrnRuntime condition met AND stage transition command
Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicatorrepReplicate
Modelica.StateGraph.TransitionWithSignal[nSta]staToSta0Transition from stage i>0 to stage 0
Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicatorrep2Replicate
Buildings.Controls.OBC.CDL.Logical.NotnotLeaTrue if lead unit is disabled
Buildings.Controls.OBC.CDL.Logical.MultiAndupAndEnaStage up and lead unit enabled and higher stage available
Utilities.FirstTrueIndexidxFirActReturn index of first active stage
Buildings.Controls.OBC.CDL.Logical.Not[nSta]unaTrue if stage is not available
Buildings.Controls.OBC.CDL.Logical.And[nSta]runAndEnaRuntime condition met AND lead enable signal false
Buildings.Controls.OBC.CDL.Routing.BooleanExtractorstaUnaReturn true if current stage is unavailable
Buildings.Controls.OBC.CDL.Integers.MaxmaxIntMaximum between current stage index and 1
Buildings.Controls.OBC.CDL.Integers.Sources.ConstantoneConstant
PlaceholderLogical[nSta]pasDirect pass-through when no minimum runtime
FirstTrueIndexidxFirAvaReturn index of first available stage
LastTrueIndexidxLasAvaReturn index of last available stage
Buildings.Controls.OBC.CDL.Integers.GreaterhigAvaReturn true if there is any higher stage available
Buildings.Controls.OBC.CDL.Integers.LesslowAvaReturn true if there is any lower stage available
Buildings.Controls.OBC.CDL.Logical.Timer[nSta]timTimer for minimum runtime
PlaceholderLogical[nSta]phAvaStaPlaceholder value if signal is not available
Buildings.Controls.OBC.CDL.Logical.MultiAnddowAndEnaStage down and lead unit enabled and lower stage available
Buildings.Controls.OBC.CDL.Logical.OrupOrDowStage up or down
Buildings.Controls.OBC.CDL.Integers.SwitchidxNexReturn index of next stage to be enabled
Buildings.Controls.OBC.CDL.Integers.Less[nSta]intLesEquReturn true if index less or equal to active stage index minus one
Buildings.Controls.OBC.CDL.Integers.Sources.Constant[nSta]idxStaAllStage indices
Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicatorintScaRepReplicate signal
Buildings.Controls.OBC.CDL.Logical.And[nSta]andAvaTrue if previous condition met and stage available
LastTrueIndexidxNexLowAvaReturn index of next lower available stage
FirstTrueIndexidxNexHigAvaReturn index of next higher available stage
Buildings.Controls.OBC.CDL.Integers.Greater[nSta]intGreEquReturn true if index greater or equal to active stage index plus one
Buildings.Controls.OBC.CDL.Logical.And[nSta]andAva1True if previous condition met and stage available
Buildings.Controls.OBC.CDL.Logical.OrupOrActUnaStage up command or active stage unavailable
TrueArrayConditionaltruIdxNexGenerate array with true value at index of next stage to be enabled
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicatorrepVecReplicate vector
Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator[nSta]rep3Replicate signal
Buildings.Controls.OBC.CDL.Logical.And[nSta,nSta]matTrnGenerate matrix with a maximum of one true element where transition must fire
Buildings.Controls.OBC.CDL.Logical.AndactUnaHigAvaActive stage unavailable and higher stage available
Buildings.Controls.OBC.CDL.Logical.Or[nSta]upOrDowOrActUnaStage up or down command or active stage unavailable (not subject to runtime requirement)
Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicatorrep1Replicate
TrueArrayConditionaltruNexHigAvaGenerate array with true element at index of next higher available stage (if any, otherwise all false)
Buildings.Controls.OBC.CDL.Conversions.BooleanToIntegerbooToIntCast to integer

Revisions

  • March 29, 2024, by Antoine Gautier:
    First implementation.