blockStageIndex
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
0is 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 stagej(1 ≤ j ≤ nSta,j ≠ i) is triggered when stageihas been active for the minimum runtime and there is a stage up commandu1Upor stage down commandu1Dow, respectively. -
From any stage
i(1 ≤ i ≤ nSta), the transition to stage0is triggered when stageihas 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
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_inpAva | true | Set to true if stage availability is provided with input signal, false for stages always available |
| Integer | nSta | Number of stages | |
| Real | dtRun | 0 | Minimum runtime of each stage |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | u1Lea | Lead unit enable signal | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | u1Up | Stage up command | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | u1Dow | Stage down command | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nSta] | u1AvaSta | Stage available signal | |
| Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput | y | Stage index |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.StateGraph.InitialStepWithSignal | sta0 | Stage 0 – All units disabled | |
| Modelica.StateGraph.StepWithSignal[nSta] | sta | Stage i>0 | |
| Modelica.StateGraph.TransitionWithSignal[nSta] | sta0ToSta | Transition from stage 0 to stage i>0 | |
| Modelica.StateGraph.StateGraphRoot | stateGraphRoot | State graph root | |
| Modelica.StateGraph.TransitionWithSignal[nSta,nSta] | staToSta | Transition to higher or lower stage | |
| Buildings.Controls.OBC.CDL.Logical.And[nSta] | runAndTrn | Runtime condition met AND stage transition command | |
| Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator | rep | Replicate | |
| Modelica.StateGraph.TransitionWithSignal[nSta] | staToSta0 | Transition from stage i>0 to stage 0 | |
| Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator | rep2 | Replicate | |
| Buildings.Controls.OBC.CDL.Logical.Not | notLea | True if lead unit is disabled | |
| Buildings.Controls.OBC.CDL.Logical.MultiAnd | upAndEna | Stage up and lead unit enabled and higher stage available | |
| Utilities.FirstTrueIndex | idxFirAct | Return index of first active stage | |
| Buildings.Controls.OBC.CDL.Logical.Not[nSta] | una | True if stage is not available | |
| Buildings.Controls.OBC.CDL.Logical.And[nSta] | runAndEna | Runtime condition met AND lead enable signal false | |
| Buildings.Controls.OBC.CDL.Routing.BooleanExtractor | staUna | Return true if current stage is unavailable | |
| Buildings.Controls.OBC.CDL.Integers.Max | maxInt | Maximum between current stage index and 1 | |
| Buildings.Controls.OBC.CDL.Integers.Sources.Constant | one | Constant | |
| PlaceholderLogical[nSta] | pas | Direct pass-through when no minimum runtime | |
| FirstTrueIndex | idxFirAva | Return index of first available stage | |
| LastTrueIndex | idxLasAva | Return index of last available stage | |
| Buildings.Controls.OBC.CDL.Integers.Greater | higAva | Return true if there is any higher stage available | |
| Buildings.Controls.OBC.CDL.Integers.Less | lowAva | Return true if there is any lower stage available | |
| Buildings.Controls.OBC.CDL.Logical.Timer[nSta] | tim | Timer for minimum runtime | |
| PlaceholderLogical[nSta] | phAvaSta | Placeholder value if signal is not available | |
| Buildings.Controls.OBC.CDL.Logical.MultiAnd | dowAndEna | Stage down and lead unit enabled and lower stage available | |
| Buildings.Controls.OBC.CDL.Logical.Or | upOrDow | Stage up or down | |
| Buildings.Controls.OBC.CDL.Integers.Switch | idxNex | Return index of next stage to be enabled | |
| Buildings.Controls.OBC.CDL.Integers.Less[nSta] | intLesEqu | Return true if index less or equal to active stage index minus one | |
| Buildings.Controls.OBC.CDL.Integers.Sources.Constant[nSta] | idxStaAll | Stage indices | |
| Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicator | intScaRep | Replicate signal | |
| Buildings.Controls.OBC.CDL.Logical.And[nSta] | andAva | True if previous condition met and stage available | |
| LastTrueIndex | idxNexLowAva | Return index of next lower available stage | |
| FirstTrueIndex | idxNexHigAva | Return index of next higher available stage | |
| Buildings.Controls.OBC.CDL.Integers.Greater[nSta] | intGreEqu | Return true if index greater or equal to active stage index plus one | |
| Buildings.Controls.OBC.CDL.Logical.And[nSta] | andAva1 | True if previous condition met and stage available | |
| Buildings.Controls.OBC.CDL.Logical.Or | upOrActUna | Stage up command or active stage unavailable | |
| TrueArrayConditional | truIdxNex | Generate array with true value at index of next stage to be enabled | |
| Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator | repVec | Replicate vector | |
| Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator[nSta] | rep3 | Replicate signal | |
| Buildings.Controls.OBC.CDL.Logical.And[nSta,nSta] | matTrn | Generate matrix with a maximum of one true element where transition must fire | |
| Buildings.Controls.OBC.CDL.Logical.And | actUnaHigAva | Active stage unavailable and higher stage available | |
| Buildings.Controls.OBC.CDL.Logical.Or[nSta] | upOrDowOrActUna | Stage up or down command or active stage unavailable (not subject to runtime requirement) | |
| Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator | rep1 | Replicate | |
| TrueArrayConditional | truNexHigAva | Generate array with true element at index of next higher available stage (if any, otherwise all false) | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger | booToInt | Cast to integer |
Revisions
-
March 29, 2024, by Antoine Gautier:
First implementation.