Package with sequences that output control setpoints
Information
This package contains generic setpoint sequences for
either AHU or terminal units control.
Package Content
Name |
Description |
GroupStatus
|
Block that outputs the zone group status |
OperationMode
|
Block that outputs the operation mode |
TrimAndRespond
|
Block to inplement trim and respond logic |
ZoneStatus
|
Block that outputs zone temperature status |
ZoneStatusDuplicator
|
Duplicate zone status output |
Validation
|
Collection of validation models |
Block that outputs the zone group status
Information
This sequence sums up the zone level status calculation to find the outputs that are
needed to define the zone group operation mode.
It requires following inputs from zone level controller:
-
zonOcc
: if the zone-level local override switch indicates the zone is
occupied,
-
uOcc
: if the zone is occupied according to its occupancy schedule,
-
tNexOcc
: time to next occupied period,
-
uCooTim
: required cooldown time,
-
uWarTim
: required warm-up time,
-
uOccHeaHig
: if the zone temperature is lower than the occupied
heating setpoint,
-
uHigOccCoo
: if the zone temperature is higher than the occupied
cooling setpoint,
-
uUnoHeaHig
: if the zone temperature is lower than the unoccupied
heating setpoint,
-
THeaSetOff
: zone unoccupied heating setpoint,
-
uEndSetBac
: if the zone could end the setback mode,
-
uHigUnoCoo
: if the zone temperature is higher than its unoccupied
cooling setpoint,
-
TCooSetOff
: zone unoccupied cooling setpoint,
-
uEndSetUp
: if the zone could end the setup mode,
-
TZon
: zone temperature,
-
uWin
: True when the window is open, false when the window is close
or the zone does not have window status sensor.
The sequence gives following outputs for zone group level calculation:
-
uGroOcc
: the zone group should be in occupied mode when there is any
zone becoming occupied according its schedule or due to the local override,
-
nexOcc
: the shortest time to the next occupied period among all the
zones in the group,
-
yCooTim
: longest cooldown time,
-
yWarTim
: longest warm-up time,
-
yOccHeaHig
: if there is zone with temperature being lower than the
occupied heating setpoint, so the group could be in the warm-up mode,
-
yHigOccCoo
: if there is zone with temperature being higher than the
occupied cooling setpoint, so the group could be in the cooldown mode,
-
yColZon
: total number of zones that the temperature is lower than the
unoccupied heating setpoint,
-
ySetBac
: check if the group could be into setback mode due to that
the average zone temperature is lower than the average unoccupied heating setpoint,
-
yEndSetBac
: check if the group should end setback mode due to that
all the zone temperature are above their unoccupied heating setpoint by a limited
value,
-
yHotZon
: total number of zones that the temperature is higher than the
unoccupied cooling setpoint,
-
ySetUp
: check if the group could be into setup mode due to that
the average zone temperature is higher than the average unoccupied cooling setpoint,
-
yEndSetUp
: check if the group should end setup mode due to that
all the zone temperature are below their unoccupied cooling setpoint by a limited
value,
-
TZonMax
: maximum zone temperature in the zone group,
-
TZonMin
: minimum zone temperature in the zone group,
-
yOpeWin
: total number of opening windows.
Parameters
Type | Name | Default | Description |
Integer | numZon | 5 | Number of zones in building |
Integer | numZonGro | numZon | Number of zones in group |
Boolean | zonGroMsk[numZon] | fill(true, numZon) | Boolean array mask of zones included in group |
Advanced |
Real | uLow | -0.1 | Low limit of the hysteresis for checking temperature difference |
Real | uHigh | 0.1 | High limit of the hysteresis for checking temperature difference |
Connectors
Type | Name | Description |
input BooleanInput | zonOcc[numZon] | True when the zone is set to be occupied due to the override |
input BooleanInput | uOcc[numZon] | True when the zone is occupied according to the occupancy schedule |
input RealInput | tNexOcc[numZon] | Time to next occupied period [s] |
input RealInput | uCooTim[numZon] | Cool down time [s] |
input RealInput | uWarTim[numZon] | Warm-up time [s] |
input BooleanInput | uOccHeaHig[numZon] | True when the zone temperature is lower than the occupied heating setpoint |
input BooleanInput | uHigOccCoo[numZon] | True when the zone temperature is higher than the occupied cooling setpoint |
input BooleanInput | uUnoHeaHig[numZon] | True when the zone temperature is lower than the unoccupied heating setpoint |
input RealInput | THeaSetOff[numZon] | Zone unoccupied heating setpoint [K] |
input BooleanInput | uEndSetBac[numZon] | True when the zone could end the setback mode |
input BooleanInput | uHigUnoCoo[numZon] | True when the zone temperature is higher than its unoccupied cooling setpoint |
input RealInput | TCooSetOff[numZon] | Zone unoccupied cooling setpoint [K] |
input BooleanInput | uEndSetUp[numZon] | True when the zone could end the setup mode |
input RealInput | TZon[numZon] | Zone temperature [K] |
input BooleanInput | uWin[numZon] | True when the window is open, false when the window is close or the zone does not have window status sensor |
output BooleanOutput | uGroOcc | True when the zone group is in occupied mode |
output RealOutput | nexOcc | Time to next occupied period [s] |
output RealOutput | yCooTim | Cool down time [s] |
output RealOutput | yWarTim | Warm-up time [s] |
output BooleanOutput | yOccHeaHig | True when there is zone with temperature being lower than the occupied heating setpoint |
output BooleanOutput | yHigOccCoo | True when there is zone with temperature being higher than the occupied cooling setpoint |
output IntegerOutput | yColZon | Total number of cold zones |
output BooleanOutput | ySetBac | Run setback mode |
output BooleanOutput | yEndSetBac | True when the group should end setback mode |
output IntegerOutput | yHotZon | Total number of hot zones |
output BooleanOutput | ySetUp | Run setup mode |
output BooleanOutput | yEndSetUp | True when the group should end setup mode |
output RealOutput | TZonMax | Maximum zone temperature in the zone group [K] |
output RealOutput | TZonMin | Minimum zone temperature in the zone group [K] |
output IntegerOutput | yOpeWin | Total number of open windows |
Modelica definition
block GroupStatus
parameter Integer numZon(
final min=1)=5 ;
parameter Integer numZonGro(
final min=1)=numZon ;
parameter Boolean zonGroMsk[numZon]=
fill(true, numZon)
;
parameter Real uLow=-0.1
;
parameter Real uHigh=0.1
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput zonOcc[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOcc[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc[numZon](
final unit=
fill("s", numZon),
final quantity=
fill("Time", numZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput uCooTim[numZon](
final unit=
fill("s", numZon),
final quantity=
fill("Time", numZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput uWarTim[numZon](
final unit=
fill("s", numZon),
final quantity=
fill("Time", numZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOccHeaHig[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHigOccCoo[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uUnoHeaHig[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSetOff[numZon](
final unit=
fill("K", numZon),
displayUnit=
fill("degC", numZon),
final quantity=
fill("ThermodynamicTemperature", numZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetBac[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHigUnoCoo[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSetOff[numZon](
final unit=
fill("K", numZon),
displayUnit=
fill("degC", numZon),
final quantity=
fill("ThermodynamicTemperature", numZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetUp[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[numZon](
final unit=
fill("K", numZon),
displayUnit=
fill("degC", numZon),
final quantity=
fill("ThermodynamicTemperature", numZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWin[numZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput uGroOcc
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput nexOcc(
final quantity="Time",
final unit="s") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOccHeaHig
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigOccCoo
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yColZon
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput ySetBac
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetBac
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yHotZon
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput ySetUp
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetUp
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonMax(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonMin(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yOpeWin
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hysSetBac(
final uLow=uLow,
final uHigh=uHigh)
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hysSetUp(
final uLow=uLow,
final uHigh=uHigh)
;
protected
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter zonOccFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uOccFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter tNexOccFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter uCooTimFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter uWarTimFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uOccHeaHigFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uHigOccCooFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uUnoHeaHigFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter THeaSetOffFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uEndSetBacFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uHigUnoCooFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter TCooSetOffFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uEndSetUpFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.RealVectorFilter TZonFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uWinFil(
final nin=numZon,
final nout=numZonGro,
final msk=zonGroMsk) ;
Buildings.Controls.OBC.CDL.Reals.MultiMax cooDowTim(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.MultiMax warUpTim(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr1(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.MultiMax maxTem(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.MultiMin minTem(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[numZonGro]
;
Buildings.Controls.OBC.CDL.Integers.MultiSum totColZon(
final nin=numZonGro) ;
Buildings.Controls.OBC.CDL.Logical.MultiAnd endSetBac(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[numZonGro]
;
Buildings.Controls.OBC.CDL.Integers.MultiSum totHotZon(
final nin=numZonGro) ;
Buildings.Controls.OBC.CDL.Logical.MultiAnd endSetUp(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.MultiSum sumUnoHea(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.Subtract difUnoHea
;
Buildings.Controls.OBC.CDL.Reals.Divide div1 ;
Buildings.Controls.OBC.CDL.Integers.Sources.Constant totZon(
final k=numZonGro) ;
Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea ;
Buildings.Controls.OBC.CDL.Reals.MultiSum sumUnoCoo(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.MultiSum sumTem(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Reals.Subtract difUnoCoo
;
Buildings.Controls.OBC.CDL.Reals.Divide div2 ;
Buildings.Controls.OBC.CDL.Reals.MultiMin minToNexOcc(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr schOcc(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Logical.MultiOr oveRidOcc(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Logical.Or groOcc
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2[numZonGro]
;
Buildings.Controls.OBC.CDL.Integers.MultiSum totOpeWin(
final nin=numZonGro)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(
final realTrue=0,
final realFalse=1)
;
Buildings.Controls.OBC.CDL.Reals.Multiply proOcc
;
equation
connect(maxTem.y, TZonMax);
connect(minTem.y, TZonMin);
connect(cooDowTim.y, yCooTim);
connect(warUpTim.y, yWarTim);
connect(mulOr.y, yOccHeaHig);
connect(mulOr1.y, yHigOccCoo);
connect(totColZon.y, yColZon);
connect(endSetBac.y, yEndSetBac);
connect(totHotZon.y, yHotZon);
connect(endSetUp.y, yEndSetUp);
connect(booToInt.y, totColZon.u);
connect(booToInt1.y, totHotZon.u);
connect(totZon.y, intToRea.u);
connect(sumTem.y, difUnoCoo.u1);
connect(sumUnoHea.y, difUnoHea.u1);
connect(intToRea.y, div1.u2);
connect(intToRea.y, div2.u2);
connect(difUnoHea.y, div1.u1);
connect(difUnoCoo.y, div2.u1);
connect(div1.y, hysSetBac.u);
connect(hysSetBac.y, ySetBac);
connect(div2.y, hysSetUp.u);
connect(hysSetUp.y, ySetUp);
connect(groOcc.y, uGroOcc);
connect(oveRidOcc.y, groOcc.u1);
connect(schOcc.y, groOcc.u2);
connect(totOpeWin.y, yOpeWin);
connect(booToInt2.y, totOpeWin.u);
connect(schOcc.y, booToRea.u);
connect(minToNexOcc.y, proOcc.u2);
connect(booToRea.y, proOcc.u1);
connect(proOcc.y, nexOcc);
connect(zonOcc, zonOccFil.u);
connect(uOcc, uOccFil.u);
connect(zonOccFil.y, oveRidOcc.u);
connect(uOccFil.y, schOcc.u);
connect(tNexOcc, tNexOccFil.u);
connect(tNexOccFil.y, minToNexOcc.u);
connect(uCooTim, uCooTimFil.u);
connect(uCooTimFil.y, cooDowTim.u);
connect(uWarTim, uWarTimFil.u);
connect(uWarTimFil.y, warUpTim.u);
connect(uOccHeaHig, uOccHeaHigFil.u);
connect(uOccHeaHigFil.y, mulOr.u);
connect(uHigOccCoo, uHigOccCooFil.u);
connect(uHigOccCooFil.y, mulOr1.u);
connect(uUnoHeaHig, uUnoHeaHigFil.u);
connect(uUnoHeaHigFil.y, booToInt.u);
connect(THeaSetOff, THeaSetOffFil.u);
connect(THeaSetOffFil.y, sumUnoHea.u);
connect(uEndSetBac, uEndSetBacFil.u);
connect(uEndSetBacFil.y, endSetBac.u);
connect(uHigUnoCoo, uHigUnoCooFil.u);
connect(uHigUnoCooFil.y, booToInt1.u);
connect(TCooSetOff, TCooSetOffFil.u);
connect(TCooSetOffFil.y, sumUnoCoo.u);
connect(uEndSetUp, uEndSetUpFil.u);
connect(uEndSetUpFil.y, endSetUp.u);
connect(TZon, TZonFil.u);
connect(TZonFil.y, sumTem.u);
connect(TZonFil.y, maxTem.u);
connect(TZonFil.y, minTem.u);
connect(uWin, uWinFil.u);
connect(uWinFil.y, booToInt2.u);
connect(sumTem.y, difUnoHea.u2);
connect(sumUnoCoo.y, difUnoCoo.u2);
end GroupStatus;
Block that outputs the operation mode
Information
This block outputs VAV system operating mode. It is implemented according to
ASHRAE guideline G36, section 5.4.3, section 5.4.4, section 5.4.5 and section 5.4.6.
Note that, from the user's point of view, schedules can be a set for individual zones,
or they can be set for an entire zone group, depending on how the user interface is
implemented. From the point of view of the BAS, individual zone schedules are
superimposed to create a zone-group schedule, which then drives system behavior.
-
All zones in each zone group shall be in the same zone-group operating mode. If one
zone in a zone group is placed in any zone-group operating mode other than unoccupied
mode (due to override, sequence logic, or scheduled occupancy), all zones in that
group shall enter that mode.
-
A zone group may be in only one mode at a given time.
Each zone group shall have the operating modes shown below.
Occupied Mode
A zone group is in the occupied mode when
occupancy input uOcc
is true. This input shall be retrieved from
other sequences that specifies occupancy variation and time remaining to the
next occupied period tNexOcc
. A zone group could be in the occupied
mode when any of the following is true:
-
The time of day is between the zone group's scheduled occupied start and stop times.
-
The schedules have been overriden by the occupant override system.
-
Any zone local override timer is nonzero.
Warm-up Mode
Warm-up mode shall start based on the zone with the longest calculated warm-up
time maxWarUpTim
requirement, but no earlier than 3 hours
(preWarCooTim
) before the start of the scheduled occupied period,
and shall end at the scheduled occupied start time. Zones where the window switch
indicates that a window is open shall be ignored. Note that for each zone,
the optimal warm-up time shall be obtained from an Optimal Start sequences,
computed in a separate block. The figure below shows the sequence.
Cooldown Mode
Cooldown mode shall start based on the zone with the longest calculated
cooldown time maxCooDowTim
requirement, but no earlier than 3 hours
(preWarCooTim
) before the start of the scheduled occupied period,
and shall end at the scheduled occupied start time. Zones where the window switch
indicates that a window is open shall be ignored. Note that for each zone,
the optimal cooldown time shall be obtained from an Optimal Start sequences,
computed in a separate block.
Setback Mode
During unoccupied mode, if any 5 zones (or all zones, if fewer than 5)
in the zone group fall below their unoccupied heating setpoints, or if the average
zone temperature of the zone group falls below the average unoccupied heating setpoint
(uSetBac
becomes true), the zone group shall enter setback mode until
all spaces in the zone group are 1 °C (2 °F) above their
unoccupied setpoints (uEndSetBac
becomes true).
Freeze Protection Setback Mode
During unoccupied Mode, if any single zone falls below 4 °C
(40 °F), the zone group shall enter setback mode until all zones
are above 7 °C (45 °F), and a Level 3 alarm shall be set.
Setup Mode
During unoccupied mode, if any 5 zones (or all zones, if fewer than 5)
in the zone group rise above their unoccupied cooling setpoints, or if the average
zone temperature of the zone group rises above the average unoccupied cooling setpoint
(uSetUp
becomes true), the zone group shall enter setup mode until
all spaces in the zone group are 1 °C (2 °F) below their
unoccupied setpoints. Zones where the window switch indicates that a window is
open shall be ignored.
Unoccupied Mode
Unoccupied mode shall be active if the zone group is not in any other mode.
Parameters
Type | Name | Default | Description |
Integer | numZon | | Number of zones |
Real | preWarCooTim | 10800 | Maximum cool-down or warm-up time [s] |
Real | TZonFreProOn | 277.15 | Threshold temperature to activate the freeze protection mode [K] |
Real | TZonFreProOff | 280.15 | Threshold temperature to end the freeze protection mode [K] |
Connectors
Type | Name | Description |
input BooleanInput | uOcc | Zone occupancy status: true=occupied, false=unoccupied |
input RealInput | tNexOcc | Time to next occupied period [s] |
input RealInput | maxCooDowTim | Maximum cool-down time among all the zones [s] |
input BooleanInput | uHigOccCoo | True when there is zone with the temperature being higher than the occupied cooling setpoint |
input RealInput | maxWarUpTim | Maximum warm-up time among all the zones [s] |
input BooleanInput | uOccHeaHig | True when there is zone with the temperature being lower than the occupied heating setpoint |
input IntegerInput | uOpeWin | Total number of zones with opening window |
input IntegerInput | totColZon | Total number of cold zone |
input BooleanInput | uSetBac | True when the average zone temperature falls below the average unoccupied heating setpoint |
input BooleanInput | uEndSetBac | True when the setback mode could end |
input RealInput | TZonMin | Minimum zone temperature [K] |
input IntegerInput | totHotZon | Total number of hot zone |
input BooleanInput | uSetUp | True when the average zone temperature rises above the average unoccupied cooling setpoint |
input BooleanInput | uEndSetUp | True when the setup mode could end |
output IntegerOutput | yOpeMod | Operation mode |
Modelica definition
block OperationMode
parameter Integer numZon(min=1) ;
parameter Real preWarCooTim(
final unit="s",
final quantity="Time") = 10800
;
parameter Real TZonFreProOn(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=277.15
;
parameter Real TZonFreProOff(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=280.15
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOcc
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc(
final unit="s",
final quantity="Time")
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput maxCooDowTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHigOccCoo
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput maxWarUpTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOccHeaHig
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeWin
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput totColZon
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uSetBac
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetBac
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonMin(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput totHotZon
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uSetUp
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetUp
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yOpeMod
;
protected
Buildings.Controls.OBC.CDL.Reals.Sources.Constant occModInd(
final k=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.occupied)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant unoPerInd(
final k=0.0)
;
Buildings.Controls.OBC.CDL.Reals.Switch corCooDowTim ;
Buildings.Controls.OBC.CDL.Reals.Switch corWarUpTim ;
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr(
final t=4) ;
Buildings.Controls.OBC.CDL.Logical.Latch lat
;
Buildings.Controls.OBC.CDL.Logical.Latch lat1
;
Buildings.Controls.OBC.CDL.Logical.Latch lat2
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys2(
final pre_y_start=true,
final uHigh=0,
final uLow=-60)
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys3(
final pre_y_start=true,
final uHigh=0,
final uLow=-60)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub5
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys4(
final pre_y_start=false,
final uHigh=0,
final uLow=-60)
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys5(
final pre_y_start=false,
final uHigh=0,
final uLow=-60)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub6
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys9(
final pre_y_start=false,
final uLow=-0.1,
final uHigh=0.1)
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys10(
final pre_y_start=false,
final uLow=-0.1,
final uHigh=0.1)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxWarCooTime(
final k=preWarCooTim)
;
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr2(
final t=4) ;
Buildings.Controls.OBC.CDL.Integers.Add addInt ;
Buildings.Controls.OBC.CDL.Integers.Add addInt1 ;
Buildings.Controls.OBC.CDL.Integers.Add addInt2 ;
Buildings.Controls.OBC.CDL.Integers.Add addInt3 ;
Buildings.Controls.OBC.CDL.Integers.Add addInt4 ;
Buildings.Controls.OBC.CDL.Integers.Add addInt5 ;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger occMod
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger freProSetBacMod
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger setUpMod
;
Buildings.Controls.OBC.CDL.Logical.Edge edg
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
final trueHoldDuration=preWarCooTim)
;
Buildings.Controls.OBC.CDL.Logical.Edge edg1
;
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1(
final trueHoldDuration=preWarCooTim)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea1(
final realTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.warmUp)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(
final realTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.coolDown)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3(
final integerTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.unoccupied)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea6(
final realTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.setUp)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea4(
final realTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.freezeProtection)
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea3(
final realTrue=Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.setBack)
;
Buildings.Controls.OBC.CDL.Utilities.Assert assMes(
final message="Level 3 alarm: freeze protection setback")
;
Buildings.Controls.OBC.CDL.Logical.Not not2 ;
Buildings.Controls.OBC.CDL.Logical.And and1 ;
Buildings.Controls.OBC.CDL.Logical.And and2
;
Buildings.Controls.OBC.CDL.Logical.Or or1
;
Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3 or3
;
Buildings.Controls.OBC.CDL.Logical.Or or4
;
Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3 or5
;
Buildings.Controls.OBC.CDL.Logical.Or or6
;
Buildings.Controls.OBC.CDL.Reals.Switch swi
;
Buildings.Controls.OBC.CDL.Reals.Switch swi3
;
Buildings.Controls.OBC.CDL.Reals.Switch swi4
;
Buildings.Controls.OBC.CDL.Reals.Switch swi5
;
Buildings.Controls.OBC.CDL.Logical.Not not5 ;
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold notOcc(
final t=1)
;
Buildings.Controls.OBC.CDL.Logical.And and3
;
Buildings.Controls.OBC.CDL.Logical.Not not1 ;
Buildings.Controls.OBC.CDL.Utilities.Assert winOpe(
final message="Level 4 alarm: window open during modes other than occupied mode")
;
Buildings.Controls.OBC.CDL.Reals.Switch swi1
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod1
;
Buildings.Controls.OBC.CDL.Reals.Switch swi2
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod2
;
Buildings.Controls.OBC.CDL.Logical.And and4 ;
Buildings.Controls.OBC.CDL.Logical.And and5
;
Buildings.Controls.OBC.CDL.Integers.Sources.Constant totZon(
final k=numZon) ;
Buildings.Controls.OBC.CDL.Integers.Equal allCol
;
Buildings.Controls.OBC.CDL.Integers.Equal allHot
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant actFreProTem(
final k=TZonFreProOn)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant endFreProTem(
final k=TZonFreProOff)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub1
;
Buildings.Controls.OBC.CDL.Logical.Or or2
;
Buildings.Controls.OBC.CDL.Logical.Or or7
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub3
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub4
;
Buildings.Controls.OBC.CDL.Logical.Edge endSetBac
;
Buildings.Controls.OBC.CDL.Logical.Edge endSetUp
;
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr1(
final t=1) ;
Buildings.Controls.OBC.CDL.Integers.Add addInt6
;
Buildings.Controls.OBC.CDL.Integers.Add addInt7
;
equation
connect(swi.y, occMod.u);
connect(occModInd.y, swi.u1);
connect(unoPerInd.y, swi.u3);
connect(intGreThr.y, or1.u1);
connect(lat.y, booToRea3.u);
connect(unoPerInd.y, swi3.u1);
connect(or3.y, swi3.u2);
connect(lat1.y, booToRea4.u);
connect(or3.y, swi4.u2);
connect(unoPerInd.y, swi4.u1);
connect(lat2.y, booToRea6.u);
connect(or3.y, swi5.u2);
connect(unoPerInd.y, swi5.u1);
connect(swi3.y, setBacMod.u);
connect(swi4.y, freProSetBacMod.u);
connect(swi5.y, setUpMod.u);
connect(or5.y, or6.u1);
connect(or6.y, not2.u);
connect(not2.y,booToInt3. u);
connect(and1.y,booToRea1. u);
connect(and1.y, or3.u1);
connect(uOcc, swi.u2);
connect(uOcc, or3.u3);
connect(hys2.y, corCooDowTim.u2);
connect(hys3.y, corWarUpTim.u2);
connect(sub5.y, hys4.u);
connect(sub6.y, hys5.u);
connect(hys9.y, lat1.u);
connect(hys10.y, lat1.clr);
connect(maxWarCooTime.y, corCooDowTim.u3);
connect(maxWarCooTime.y, corWarUpTim.u3);
connect(booToRea3.y, swi3.u3);
connect(booToRea4.y, swi4.u3);
connect(booToRea6.y, swi5.u3);
connect(lat1.y, not5.u);
connect(not5.y, assMes.u);
connect(maxCooDowTim, corCooDowTim.u1);
connect(maxWarUpTim, corWarUpTim.u1);
connect(totColZon, intGreThr.u);
connect(totHotZon, intGreThr2.u);
connect(intGreThr2.y, or4.u1);
connect(setBacMod.y, addInt2.u1);
connect(freProSetBacMod.y, addInt2.u2);
connect(setUpMod.y, addInt3.u2);
connect(addInt2.y, addInt3.u1);
connect(addInt3.y, addInt4.u1);
connect(booToInt3.y, addInt4.u2);
connect(addInt5.y, yOpeMod);
connect(notOcc.y, and3.u2);
connect(and3.y, not1.u);
connect(addInt5.y, notOcc.u);
connect(not1.y, winOpe.u);
connect(booToRea.y, swi1.u3);
connect(uOcc, swi1.u2);
connect(swi1.y, setBacMod1.u);
connect(setBacMod1.y, addInt.u1);
connect(addInt.y, addInt1.u2);
connect(occMod.y, addInt1.u1);
connect(addInt1.y, addInt5.u1);
connect(addInt4.y, addInt5.u2);
connect(booToRea1.y, swi2.u3);
connect(unoPerInd.y, swi1.u1);
connect(unoPerInd.y, swi2.u1);
connect(swi2.y, setBacMod2.u);
connect(setBacMod2.y, addInt.u2);
connect(and4.y, booToRea.u);
connect(and4.y, or3.u2);
connect(hys4.y, and2.u1);
connect(uOccHeaHig, and5.u2);
connect(hys5.y, and5.u1);
connect(truFalHol1.u, edg.y);
connect(and5.y, edg.u);
connect(and2.y, edg1.u);
connect(edg1.y, truFalHol.u);
connect(lat2.y, or5.u1);
connect(lat1.y, or5.u2);
connect(lat.y, or5.u3);
connect(or3.y, or6.u2);
connect(allCol.y, or1.u2);
connect(allHot.y, or4.u2);
connect(totZon.y, allCol.u2);
connect(totZon.y, allHot.u2);
connect(sub.y, hys9.u);
connect(sub1.y, hys10.u);
connect(TZonMin, sub1.u1);
connect(endFreProTem.y, sub1.u2);
connect(or1.y, or2.u1);
connect(or2.y, lat.u);
connect(uSetBac, or2.u2);
connect(or4.y, or7.u1);
connect(or7.y, lat2.u);
connect(uSetUp, or7.u2);
connect(uOcc, swi2.u2);
connect(truFalHol.y, and4.u2);
connect(hys4.y, and4.u1);
connect(truFalHol1.y, and1.u2);
connect(hys5.y, and1.u1);
connect(uHigOccCoo, and2.u2);
connect(maxWarCooTime.y, sub4.u1);
connect(maxWarUpTim, sub4.u2);
connect(sub3.y, hys2.u);
connect(sub4.y, hys3.u);
connect(uEndSetBac, endSetBac.u);
connect(endSetBac.y, lat.clr);
connect(uEndSetUp, endSetUp.u);
connect(endSetUp.y, lat2.clr);
connect(uOpeWin, intGreThr1.u);
connect(intGreThr1.y, and3.u1);
connect(totColZon, addInt6.u2);
connect(uOpeWin, addInt6.u1);
connect(addInt6.y, allCol.u1);
connect(totHotZon, addInt7.u2);
connect(uOpeWin, addInt7.u1);
connect(addInt7.y, allHot.u1);
connect(maxCooDowTim, sub3.u2);
connect(maxWarCooTime.y, sub3.u1);
connect(corCooDowTim.y, sub5.u1);
connect(tNexOcc, sub5.u2);
connect(corWarUpTim.y, sub6.u1);
connect(tNexOcc, sub6.u2);
connect(actFreProTem.y, sub.u1);
connect(TZonMin, sub.u2);
end OperationMode;
Block to inplement trim and respond logic
Information
This block implements the trim and respond logic according to ASHRAE guideline G36,
PART 5.A.15 (trim and respond setpoint reset logic).
The trim and respond logic shall reset setpoint within the range minSet
to
maxSet
.
When the associated device is off (uDevSta=false
), the setpoint
shall be iniSet
.
The reset logic shall be active while the associated device is proven
on (uDevSta=true
), starting delTim
after initial
device start command.
When active, every time step samplePeriod
, trim the setpoint by
triAmo
.
If there are more than numIgnReq
requests, respond by changing
the setpoint by resAmo*(numOfReq-numIgnReq)
, i.e., the number of
requests minus the number of ignored requests, but no more than maxRes
.
In other words, every time step
samplePeriod
:
- Change setpoint by
triAmo
;
- If
numOfReq > numIgnReq
, also change setpoint by resAmo*(numOfReq
-numIgnReq)
but no more than maxRes
.
Parameters
Type | Name | Default | Description |
Real | iniSet | | Initial setpoint |
Real | minSet | | Minimum setpoint |
Real | maxSet | | Maximum setpoint |
Real | delTim | | Delay time [s] |
Real | samplePeriod | | Sample period of component [s] |
Integer | numIgnReq | | Number of ignored requests |
Real | triAmo | | Trim amount |
Real | resAmo | | Respond amount (must have opposite sign of triAmo) |
Real | maxRes | | Maximum response per time interval (must have same sign as resAmo) |
Connectors
Type | Name | Description |
input IntegerInput | numOfReq | Number of requests from zones/systems |
input BooleanInput | uDevSta | On/Off status of the associated device |
output RealOutput | y | Setpoint that have been reset |
Modelica definition
block TrimAndRespond
parameter Real iniSet ;
parameter Real minSet ;
parameter Real maxSet ;
parameter Real delTim(
final unit="s",
final quantity="Time",
final min=100*1E-15) ;
parameter Real samplePeriod(
final unit="s",
final quantity="Time",
final min=1E-3)
;
parameter Integer numIgnReq ;
parameter Real triAmo ;
parameter Real resAmo ;
parameter Real maxRes ;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput numOfReq
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uDevSta
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y
;
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim(
final delayTime=delTim + samplePeriod,
final delayOnInit=true)
;
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr
;
Buildings.Controls.OBC.CDL.Reals.Switch netRes ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant resAmoCon(
final k=resAmo)
;
Buildings.Controls.OBC.CDL.Reals.Multiply pro
;
Buildings.Controls.OBC.CDL.Reals.Multiply pro1
;
Buildings.Controls.OBC.CDL.Reals.Multiply pro2
;
Buildings.Controls.OBC.CDL.Discrete.UnitDelay uniDel(
final samplePeriod=samplePeriod,
final y_start=iniSet)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi
;
Buildings.Controls.OBC.CDL.Reals.Switch swi1
;
Buildings.Controls.OBC.CDL.Reals.Switch swi2
;
Buildings.Controls.OBC.CDL.Reals.Switch swi3 ;
Buildings.Controls.OBC.CDL.Discrete.Sampler sampler(
final samplePeriod=samplePeriod)
;
Buildings.Controls.OBC.CDL.Reals.LessThreshold lesThr1
;
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr2
;
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr1
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(
final k=-1)
;
protected
Buildings.Controls.OBC.CDL.Reals.Sources.Constant iniSetCon(k=iniSet)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant numIgnReqCon(k=numIgnReq)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant triAmoCon(k=triAmo)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxResCon(k=maxRes)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxSetCon(k=maxSet)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant zerTri(k=0)
;
Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea
;
Buildings.Controls.OBC.CDL.Reals.Subtract difReqIgnReq
;
Buildings.Controls.OBC.CDL.Reals.Add add1
;
Buildings.Controls.OBC.CDL.Reals.Add add2 ;
Buildings.Controls.OBC.CDL.Reals.Min minInp
;
Buildings.Controls.OBC.CDL.Reals.Min min1
;
Buildings.Controls.OBC.CDL.Logical.And and2
;
Buildings.Controls.OBC.CDL.Logical.Not not1 ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant minSetCon(k=minSet)
;
Buildings.Controls.OBC.CDL.Reals.Max maxInp
;
Buildings.Controls.OBC.CDL.Utilities.Assert assMes(
final message="Trim amount 'triAmo' and respond amount 'resAmo' must have opposite signs.")
;
Buildings.Controls.OBC.CDL.Utilities.Assert assMes2(
final message="Respond amount 'resAmo' and maximum respond amount 'maxRes' must have same sign.")
;
Buildings.Controls.OBC.CDL.Reals.Abs abs ;
Buildings.Controls.OBC.CDL.Reals.Abs abs1 ;
equation
connect(difReqIgnReq.y, greThr.u);
connect(pro.y, minInp.u1);
connect(triAmoCon.y, add2.u1);
connect(add2.y, netRes.u1);
connect(iniSetCon.y, swi.u3);
connect(swi.y, y);
connect(maxSetCon.y, min1.u2);
connect(add1.y, min1.u1);
connect(uniDel.y, add1.u1);
connect(triAmoCon.y, swi1.u1);
connect(zerTri.y, swi1.u3);
connect(greThr.y, and2.u2);
connect(and2.y, netRes.u2);
connect(iniSetCon.y, swi2.u1);
connect(swi2.y, swi.u1);
connect(swi2.y, uniDel.u);
connect(uDevSta, not1.u);
connect(not1.y, swi2.u2);
connect(min1.y, maxInp.u1);
connect(minSetCon.y, maxInp.u2);
connect(numOfReq, intToRea.u);
connect(intToRea.y, sampler.u);
connect(difReqIgnReq.y, pro.u1);
connect(uDevSta, tim.u);
connect(tim.y, swi.u2);
connect(tim.y, swi1.u2);
connect(and2.u1, tim.y);
connect(maxInp.y, swi2.u3);
connect(triAmoCon.y, pro1.u1);
connect(resAmoCon.y, pro1.u2);
connect(pro1.y, lesThr1.u);
connect(lesThr1.y, assMes.u);
connect(resAmoCon.y, pro2.u1);
connect(maxResCon.y, pro2.u2);
connect(pro2.y, greThr2.u);
connect(greThr2.y, assMes2.u);
connect(resAmoCon.y, abs.u);
connect(abs.y, pro.u2);
connect(maxResCon.y, abs1.u);
connect(abs1.y, minInp.u2);
connect(minInp.y, swi3.u1);
connect(resAmoCon.y, greThr1.u);
connect(greThr1.y, swi3.u2);
connect(netRes.y, add1.u2);
connect(swi1.y, netRes.u3);
connect(minInp.y, gai.u);
connect(gai.y, swi3.u3);
connect(swi3.y, add2.u2);
connect(numIgnReqCon.y, difReqIgnReq.u2);
connect(sampler.y, difReqIgnReq.u1);
end TrimAndRespond;
Block that outputs zone temperature status
Information
This block outputs single zone status. It includes outputs as following:
-
the times for cooling-down (
yCooTim
) and warm-up (yWarTim
) the zone,
-
THeaSetOn
: the zone occupied heating setpoint,
-
yOccHeaHig
: if the zone temperature is lower than the occupied heating
setpoint,
-
TCooSetOn
: the zone occupied cooling setpoint,
-
yHigOccCoo
: if the zone temperature is higher than the occupied cooling
setpoint,
-
THeaSetOff
: the zone unoccupied heating setpoint,
-
yUnoHeaHig
: if the zone temperature is lower than the unoccupied heating
setpoint,
-
yEndSetBac
: if the zone temperature is higher than the unoccupied heating
setpoint with the given limit bouLim
, then the zone should be out of the
setback mode,
-
TCooSetOff
: the zone unoccupied cooling setpoint,
-
yHigUnoCoo
: if the zone temperature is higher than the unoccupied cooling
setpoint,
-
yEndSetUp
: if the zone temperature is lower than the unoccupied cooling
setpoint with the given limit bouLim
, then the zone should be out of the
setup mode.
Parameters
Type | Name | Default | Description |
Real | THeaSetOcc | 293.15 | Occupied heating setpoint [K] |
Real | THeaSetUno | 285.15 | Unoccupied heating setpoint [K] |
Real | TCooSetOcc | 297.15 | Occupied cooling setpoint [K] |
Real | TCooSetUno | 303.15 | Unoccupied cooling setpoint [K] |
Real | bouLim | 1 | Threshold of temperature difference for indicating the end of setback or setup mode [K] |
Boolean | have_winSen | false | Check if the zone has window status sensor |
Advanced |
Real | uLow | -0.1 | Low limit of the hysteresis for checking temperature difference |
Real | uHigh | 0.1 | High limit of the hysteresis for checking temperature difference |
Connectors
Type | Name | Description |
input RealInput | cooDowTim | Cool-down time retrieved from optimal cool-down block [s] |
input RealInput | warUpTim | Warm-up time retrieved from optimal warm-up block [s] |
input BooleanInput | uWin | Window status: true=open, false=close |
input RealInput | TZon | Single zone temperature [K] |
output RealOutput | yCooTim | Cool-down time [s] |
output RealOutput | yWarTim | Warm-up time [s] |
output RealOutput | THeaSetOn | Occupied heating setpoint [K] |
output BooleanOutput | yOccHeaHig | True when the zone temperature is lower than the occupied heating setpoint |
output RealOutput | TCooSetOn | Occupied cooling setpoint temperature [K] |
output BooleanOutput | yHigOccCoo | True when the zone temperature is higher than the occupied cooling setpoint |
output RealOutput | THeaSetOff | Unoccupied heating setpoint [K] |
output BooleanOutput | yUnoHeaHig | True when the zone temperature is lower than the unoccupied heating setpoint |
output BooleanOutput | yEndSetBac | True when the zone could end setback mode |
output RealOutput | TCooSetOff | Unoccupied cooling setpoint [K] |
output BooleanOutput | yHigUnoCoo | True when the zone temperature is higher than the unoccupied cooling setpoint |
output BooleanOutput | yEndSetUp | True when the zone could end setup mode |
Modelica definition
block ZoneStatus
parameter Real THeaSetOcc(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=293.15
;
parameter Real THeaSetUno(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=285.15
;
parameter Real TCooSetOcc(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=297.15
;
parameter Real TCooSetUno(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")=303.15
;
parameter Real bouLim(
final unit="K",
displayUnit="K",
final quantity="TemperatureDifference",
final min=0.5) = 1
;
parameter Boolean have_winSen=false
;
parameter Real uLow=-0.1
;
parameter Real uHigh=0.1
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput cooDowTim(
final unit="s",
final quantity="Time")
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput warUpTim(
final unit="s",
final quantity="Time")
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWin
if have_winSen
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim(
final unit="s",
final quantity="Time") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaSetOn(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOccHeaHig
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TCooSetOn(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigOccCoo
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaSetOff(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yUnoHeaHig
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetBac
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TCooSetOff(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature") ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigUnoCoo
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetUp
;
protected
Buildings.Controls.OBC.CDL.Reals.Multiply pro ;
Buildings.Controls.OBC.CDL.Reals.Multiply pro1 ;
Buildings.Controls.OBC.CDL.Reals.Subtract sub
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys(
final uLow=uLow,
final uHigh=uHigh)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub1
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys1(
final uLow=uLow,
final uHigh=uHigh)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub2
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys2(
final uLow=uLow,
final uHigh=uHigh)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub5
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys5(
final uLow=uLow,
final uHigh=uHigh)
;
Buildings.Controls.OBC.CDL.Logical.Not not1 ;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea ;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(
final k=false)
if not have_winSen
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant occHeaSet(
final k=THeaSetOcc)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant unoHeaSet(
final k=THeaSetUno)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant occCooSet(
final k=TCooSetOcc)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant unoCooSet(
final k=TCooSetUno)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub3
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys3(
final uLow=0,
final uHigh=bouLim)
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub4
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys4(
final uLow=0,
final uHigh=bouLim)
;
Buildings.Controls.OBC.CDL.Logical.And and2
;
Buildings.Controls.OBC.CDL.Logical.And and1
;
Buildings.Controls.OBC.CDL.Logical.And and3
;
Buildings.Controls.OBC.CDL.Logical.Or or2
;
Buildings.Controls.OBC.CDL.Logical.And and5
;
Buildings.Controls.OBC.CDL.Logical.Or or1
;
equation
connect(cooDowTim, pro.u1);
connect(warUpTim, pro1.u1);
connect(booToRea.y, pro.u2);
connect(booToRea.y, pro1.u2);
connect(sub.y, hys.u);
connect(sub1.y, hys1.u);
connect(uWin, not1.u);
connect(sub2.y, hys2.u);
connect(sub5.y, hys5.u);
connect(not1.y, booToRea.u);
connect(pro.y, yCooTim);
connect(pro1.y, yWarTim);
connect(con.y, not1.u);
connect(TZon,sub. u2);
connect(unoCooSet.y, TCooSetOff);
connect(unoHeaSet.y, THeaSetOff);
connect(occHeaSet.y, THeaSetOn);
connect(occCooSet.y, TCooSetOn);
connect(unoHeaSet.y, sub2.u1);
connect(unoHeaSet.y, sub3.u2);
connect(sub3.y, hys3.u);
connect(sub4.y, hys4.u);
connect(occHeaSet.y,sub. u1);
connect(TZon, sub2.u2);
connect(TZon, sub3.u1);
connect(and2.y, yOccHeaHig);
connect(hys.y, and2.u1);
connect(hys1.y, and1.u1);
connect(hys2.y, and3.u1);
connect(hys3.y, or2.u1);
connect(hys5.y, and5.u1);
connect(hys4.y, or1.u1);
connect(not1.y, and2.u2);
connect(not1.y, and1.u2);
connect(and1.y, yHigOccCoo);
connect(and3.y, yUnoHeaHig);
connect(or2.y, yEndSetBac);
connect(and5.y, yHigUnoCoo);
connect(or1.y, yEndSetUp);
connect(uWin, or2.u2);
connect(uWin, or1.u2);
connect(con.y, or2.u2);
connect(con.y, or1.u2);
connect(not1.y, and3.u2);
connect(not1.y, and5.u2);
connect(TZon, sub1.u1);
connect(occCooSet.y, sub1.u2);
connect(TZon, sub5.u1);
connect(unoCooSet.y, sub5.u2);
connect(unoCooSet.y, sub4.u1);
connect(TZon, sub4.u2);
end ZoneStatus;
Duplicate zone status output
Information
This block duplicates the signals of nZon
by converting the
input vector-valued signals of dimension nZon
to a matrix-valued
output of dimension [nGro, nZon]
.
This block prevent the use of for
loops in the connectors between
zones and zone groups by connecting all the zones to each
Buildings.Obsolete.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.GroupStatus.
Parameters
Type | Name | Default | Description |
Integer | nZon | 1 | Number of zones in input |
Integer | nGro | 1 | Number of groups in output |
Connectors
Type | Name | Description |
input BooleanInput | zonOcc[nZon] | True when the zone is set to be occupied due to the override |
input BooleanInput | uOcc[nZon] | True when the zone is occupied according to the occupancy schedule |
input RealInput | tNexOcc[nZon] | Time to next occupied period [s] |
input RealInput | uCooTim[nZon] | Cool down time [s] |
input RealInput | uWarTim[nZon] | Warm-up time [s] |
input BooleanInput | uOccHeaHig[nZon] | True when the zone temperature is lower than the occupied heating setpoint |
input BooleanInput | uHigOccCoo[nZon] | True when the zone temperature is higher than the occupied cooling setpoint |
input BooleanInput | uUnoHeaHig[nZon] | True when the zone temperature is lower than the unoccupied heating setpoint |
input RealInput | THeaSetOff[nZon] | Zone unoccupied heating setpoint [K] |
input BooleanInput | uEndSetBac[nZon] | True when the zone could end the setback mode |
input BooleanInput | uHigUnoCoo[nZon] | True when the zone temperature is higher than its unoccupied cooling setpoint |
input RealInput | TCooSetOff[nZon] | Zone unoccupied cooling setpoint [K] |
input BooleanInput | uEndSetUp[nZon] | True when the zone could end the setup mode |
input RealInput | TZon[nZon] | Zone temperature [K] |
input BooleanInput | uWin[nZon] | True when the window is open, false when the window is close or the zone does not have window status sensor |
output BooleanOutput | yzonOcc[nGro, nZon] | True when the zone is set to be occupied due to the override |
output BooleanOutput | yOcc[nGro, nZon] | True when the zone is occupied according to the occupancy schedule |
output RealOutput | ytNexOcc[nGro, nZon] | Time to next occupied period [s] |
output RealOutput | yCooTim[nGro, nZon] | Cool down time [s] |
output RealOutput | yWarTim[nGro, nZon] | Warm-up time [s] |
output BooleanOutput | yOccHeaHig[nGro, nZon] | True when the zone temperature is lower than the occupied heating setpoint |
output BooleanOutput | yHigOccCoo[nGro, nZon] | True when the zone temperature is higher than the occupied cooling setpoint |
output BooleanOutput | yUnoHeaHig[nGro, nZon] | True when the zone temperature is lower than the unoccupied heating setpoint |
output RealOutput | yTHeaSetOff[nGro, nZon] | Zone unoccupied heating setpoint [K] |
output BooleanOutput | yEndSetBac[nGro, nZon] | True when the zone could end the setback mode |
output BooleanOutput | yHigUnoCoo[nGro, nZon] | True when the zone temperature is higher than its unoccupied cooling setpoint |
output RealOutput | yTCooSetOff[nGro, nZon] | Zone unoccupied cooling setpoint [K] |
output BooleanOutput | yEndSetUp[nGro, nZon] | True when the zone could end the setup mode |
output RealOutput | yTZon[nGro, nZon] | Zone temperature [K] |
output BooleanOutput | yWin[nGro, nZon] | True when the window is open, false when the window is close or the zone does not have window status sensor |
Modelica definition
block ZoneStatusDuplicator
parameter Integer nZon(
final min=1)=1 ;
parameter Integer nGro(
final min=1)=1 ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput zonOcc[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOcc[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc[nZon](
final unit=
fill("s", nZon),
final quantity=
fill("Time", nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput uCooTim[nZon](
final unit=
fill("s", nZon),
final quantity=
fill("Time", nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput uWarTim[nZon](
final unit=
fill("s", nZon),
final quantity=
fill("Time", nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOccHeaHig[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHigOccCoo[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uUnoHeaHig[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSetOff[nZon](
final unit=
fill("K", nZon),
displayUnit=
fill("degC", nZon),
final quantity=
fill("ThermodynamicTemperature", nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetBac[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHigUnoCoo[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSetOff[nZon](
final unit=
fill("K", nZon),
displayUnit=
fill("degC", nZon),
final quantity=
fill("ThermodynamicTemperature", nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEndSetUp[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[nZon](
final unit=
fill("K", nZon),
displayUnit=
fill("degC", nZon),
final quantity=
fill("ThermodynamicTemperature", nZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWin[nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yzonOcc[nGro, nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOcc[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput ytNexOcc[nGro, nZon](
final unit=
fill("s", nGro, nZon),
final quantity=
fill("Time", nGro, nZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim[nGro,nZon](
final unit=
fill("s", nGro, nZon),
final quantity=
fill("Time", nGro, nZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim[nGro,nZon](
final unit=
fill("s", nGro, nZon),
final quantity=
fill("Time", nGro, nZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOccHeaHig[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigOccCoo[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yUnoHeaHig[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTHeaSetOff[nGro, nZon](
final unit=
fill("K", nGro, nZon),
displayUnit=
fill("degC", nGro, nZon),
final quantity=
fill("ThermodynamicTemperature", nGro, nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetBac[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigUnoCoo[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTCooSetOff[nGro, nZon](
final unit=
fill("K", nGro, nZon),
displayUnit=
fill("degC", nGro, nZon),
final quantity=
fill("ThermodynamicTemperature", nGro, nZon))
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetUp[nGro,nZon]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTZon[nGro, nZon](
final unit=
fill("K", nGro, nZon),
displayUnit=
fill("degC", nGro, nZon),
final quantity=
fill("ThermodynamicTemperature", nGro, nZon)) ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yWin[nGro,nZon]
;
protected
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator zonOccDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uOccDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator tNexOccDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator uCooTimDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator uWarTimDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uOccHeaHigDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uHigOccCooDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uUnoHeaHigDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator THeaSetOffDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uEndSetBacDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uHigUnoCooDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator TCooSetOffDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uEndSetUpDup(
final nin=nZon,
final nout=nGro)
;
Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator TZonDup(
final nin=nZon,
final nout=nGro) ;
Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uWinDup(
final nin=nZon,
final nout=nGro)
;
equation
connect(zonOcc, zonOccDup.u);
connect(uOcc,uOccDup. u);
connect(tNexOcc, tNexOccDup.u);
connect(uCooTim, uCooTimDup.u);
connect(uWarTim, uWarTimDup.u);
connect(uOccHeaHig, uOccHeaHigDup.u);
connect(uHigOccCoo, uHigOccCooDup.u);
connect(uUnoHeaHig, uUnoHeaHigDup.u);
connect(THeaSetOff, THeaSetOffDup.u);
connect(uEndSetBac, uEndSetBacDup.u);
connect(uHigUnoCoo, uHigUnoCooDup.u);
connect(TCooSetOff, TCooSetOffDup.u);
connect(uEndSetUp, uEndSetUpDup.u);
connect(TZon, TZonDup.u);
connect(uWin, uWinDup.u);
connect(zonOccDup.y, yzonOcc);
connect(uOccDup.y, yOcc);
connect(ytNexOcc, tNexOccDup.y);
connect(yCooTim, uCooTimDup.y);
connect(uWarTimDup.y, yWarTim);
connect(uOccHeaHigDup.y, yOccHeaHig);
connect(uHigOccCooDup.y, yHigOccCoo);
connect(uUnoHeaHigDup.y, yUnoHeaHig);
connect(THeaSetOffDup.y, yTHeaSetOff);
connect(uEndSetBacDup.y, yEndSetBac);
connect(uHigUnoCooDup.y, yHigUnoCoo);
connect(TCooSetOffDup.y, yTCooSetOff);
connect(uEndSetUpDup.y, yEndSetUp);
connect(TZonDup.y, yTZon);
connect(uWinDup.y, yWin);
end ZoneStatusDuplicator;