Generic control sequences
Information
This package contains generic primary plant control sequences.
Package Content
| Name |
Description |
ChillerLifts
|
Calculate the maximum and minimum enabled chiller lifts |
IdentifyStage
|
Identify current chiller stage according to the proven on status of the chillers |
TimerWithReset
|
Timer measuring the time from the time instant where the Boolean input became true |
PlantEnable
|
Package of sequences for enabling plant and the associated devices |
Validation
|
Collection of validation models |
Calculate the maximum and minimum enabled chiller lifts
Information
Block that outputs the maximum and minimum lifts of the enabled chillers. It is
based on ASHRAE Guideline 36-2021, section 5.20.4.14.
yLifMin and yLifMax shall be calculated as the averages of
minChiLif and maxChiLif for operating chillers, respectively.
Parameters
| Type | Name | Default | Description |
| Integer | nChi | 2 | Total number of chillers |
| Real | minChiLif[nChi] | {12,12} | Minimum LIFT of each chiller [K] |
| Real | maxChiLif[nChi] | {18,18} | Maximum LIFT of each chiller [K] |
Connectors
| Type | Name | Description |
| input BooleanInput | uChi[nChi] | Vector of chillers proven on status: true=ON |
| output RealOutput | yLifMax | Maximum LIFT among enabled chillers [K] |
| output RealOutput | yLifMin | Minimum LIFT among enabled chillers [K] |
Modelica definition
block ChillerLifts
parameter Integer nChi = 2 ;
parameter Real minChiLif[nChi](
final unit=
fill("K",nChi),
final quantity=
fill("TemperatureDifference",nChi))={12, 12}
;
parameter Real maxChiLif[nChi](
final unit=
fill("K",nChi),
final quantity=
fill("TemperatureDifference",nChi))={18, 18}
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChi[nChi]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yLifMax(
final unit="K")
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yLifMin(
final unit="K")
;
protected
Buildings.Controls.OBC.CDL.Reals.Sources.Constant minLif[nChi](
final k=minChiLif)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant zeoCon[nChi](
final k=
fill(0, nChi))
;
Buildings.Controls.OBC.CDL.Reals.Switch swi[nChi] ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxLif[nChi](
final k=maxChiLif)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi1[nChi]
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant one(
final k=1)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[nChi]
;
Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum(nin=nChi)
;
Buildings.Controls.OBC.CDL.Reals.MultiSum minLifSum(nin=nChi)
;
Buildings.Controls.OBC.CDL.Reals.MultiSum maxLifSum(nin=nChi)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr chiOn(nin=nChi)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi2
;
Buildings.Controls.OBC.CDL.Reals.Divide maxLifMea
;
Buildings.Controls.OBC.CDL.Reals.Divide minLifMea
;
Buildings.Controls.OBC.CDL.Reals.Switch swi4 ;
Buildings.Controls.OBC.CDL.Reals.Switch swi3 ;
equation
connect(uChi, swi.u2);
connect(zeoCon.y, swi.u3);
connect(minLif.y, swi.u1);
connect(uChi, swi1.u2);
connect(zeoCon.y, swi1.u3);
connect(maxLif.y, swi1.u1);
connect(uChi, booToRea.u);
connect(uChi,chiOn. u);
connect(chiOn.y, swi2.u2);
connect(mulSum.y, swi2.u1);
connect(swi2.y, maxLifMea.u2);
connect(maxLifSum.y, maxLifMea.u1);
connect(chiOn.y, swi4.u2);
connect(maxLifMea.y, swi4.u1);
connect(minLifSum.y, minLifMea.u1);
connect(swi2.y, minLifMea.u2);
connect(minLifMea.y, swi3.u1);
connect(chiOn.y, swi3.u2);
connect(minLif[1].y, swi3.u3);
connect(maxLif[1].y, swi4.u3);
connect(swi4.y, yLifMax);
connect(swi3.y, yLifMin);
connect(swi1.y, maxLifSum.u);
connect(booToRea.y, mulSum.u);
connect(swi.y, minLifSum.u);
connect(one.y, swi2.u3);
end ChillerLifts;
Identify current chiller stage according to the proven on status of the chillers
Information
This subsequence is not directly specified in ASHRAE Guideline 36-2021 as it provides
a side calculation about the generalization of the staging
sequences for any number of chillers and stages provided by the
user.
The subsequence outputs the current chiller stage index ySta according
to the current chillers proven on status uChi
and the given staging matrix staMat, which specifies which chillers
should be enabled at each stage.
Parameters
| Type | Name | Default | Description |
| Integer | nSta | 3 | Number of chiller stages |
| Integer | nChi | 2 | Number of chillers |
| Integer | staMat[nSta, nChi] | {{1,0},{0,1},{1,1}} | Staging matrix with chiller stage as row index and chiller as column index |
Connectors
| Type | Name | Description |
| input BooleanInput | uChi[nChi] | Vector of chiller proven on status: true=ON |
| output IntegerOutput | ySta | Current stage index |
Modelica definition
block IdentifyStage
parameter Integer nSta = 3
;
parameter Integer nChi = 2
;
parameter Integer staMat[nSta, nChi] = {{1,0},{0,1},{1,1}}
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChi[nChi]
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput ySta
;
protected
final parameter Real staInd[nSta] = {i
for i
in 1:nSta}
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator booVecRep(
final nin=nChi,
final nout=nSta)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[nSta,nChi]
;
Buildings.Controls.OBC.CDL.Integers.Equal intEqu[nSta,nChi]
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea [nSta,nChi]
;
Buildings.Controls.OBC.CDL.Reals.MatrixMax rowMax(
final nRow=nSta,
final nCol=nChi)
;
Buildings.Controls.OBC.CDL.Reals.MatrixMin rowMin(
final nRow=nSta,
final nCol=nChi)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul[nSta]
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con[nSta](
final k=staInd)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul1[nSta]
;
Buildings.Controls.OBC.CDL.Reals.MultiSum curSta(
final nin=nSta)
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt ;
Buildings.Controls.OBC.CDL.Integers.Sources.Constant chiStaMatr[nSta,nChi](
final k=staMat)
;
equation
connect(uChi, booVecRep.u);
connect(booVecRep.y, booToInt.u);
connect(chiStaMatr.y, intEqu.u1);
connect(booToInt.y, intEqu.u2);
connect(intEqu.y, booToRea.u);
connect(booToRea.y,rowMax. u);
connect(booToRea.y,rowMin. u);
connect(rowMax.y, mul.u1);
connect(rowMin.y, mul.u2);
connect(mul.y, mul1.u1);
connect(con.y, mul1.u2);
connect(mul1.y, curSta.u);
connect(curSta.y, reaToInt.u);
connect(reaToInt.y, ySta);
end IdentifyStage;
Timer measuring the time from the time instant where the Boolean input became true
Information
This block is similar to
Buildings.Controls.OBC.CDL.Logical.Timer,
but introduces an additional Boolean input signal reset,
which resets the timer.
When reset becomes true:
y=0 and passed=false.
Parameters
| Type | Name | Default | Description |
| Real | t | 0 | Threshold time for comparison [s] |
Connectors
| Type | Name | Description |
| input BooleanInput | u | Input that switches timer on if true, and off if false |
| input BooleanInput | reset | Reset signal |
| output RealOutput | y | Elapsed time [s] |
| output BooleanOutput | passed | True if the elapsed time is greater than threshold |
Modelica definition