Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits

Control sequences for terminal units

Information

This package contains control sequences for terminal units.

Package Content

Name Description
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Controller Controller Controller for room VAV box
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.ModeAndSetPoints ModeAndSetPoints Output zone setpoint with operation mode selection
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat Reheat Sequences for VAV reheat terminal unit
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.SetPoints SetPoints Generic sequences of generating setpoints for terminal units control
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Validation Validation Collection of validation models

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Controller Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Controller

Controller for room VAV box

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Controller

Information

Controller for terminal box of VAV system with reheat according to ASHRAE Guideline 36, Part 5.E. It outputs damper position yDam, hot water valve position yVal, AHU cooling supply temperature setpoint reset request yZonTemResReq, and static pressure setpoint reset request yZonPreResReq.

The sequence consists of four subsequences.

a. Heating and cooling control loop

The subsequence is implementd according to Part 5.B.5. The measured zone temperature TZon, zone setpoints temperatures TZonHeaSet and TZonCooSet are inputs to the block conHeaLoo and conCooLoo to generate the control loop signal.

b. Active airflow setpoint calculation

This sequence sets the active maximum and minimum airflow according to Part 5.E.3-5. Depending on operation modes uOpeMod, it sets the airflow rate limits for cooling and heating supply. See Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SetPoints.ActiveAirFlow.

c. Damper and valve control

This sequence sets the damper and valve position for VAV reheat terminal unit. The implementation is according to Part 5.E.6. According to heating and cooling control loop signal, it calculates the discharge air temperature setpoint TDisHeaSet. Along with the defined maximum and minimum airflow, measured zone temperature, the sequence outputs yDam, yVal, TDisHeaSet and discharge airflow rate setpoint VDisSet_flow. See Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves.

d. System reset requests generation

According to Part 5.E.9, this sequence outputs the system reset requests, i.e. cooling supply air temperature reset requests yZonTemResReq, static pressure reset requests yZonPreResReq, hot water reset requests yHeaValResReq, and the boiler plant reset requests yHeaPlaReq. See Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests.

Parameters

TypeNameDefaultDescription
TimesamplePeriod Sample period of component, set to the same value as the trim and respond that process yPreSetReq [s]
VolumeFlowRateV_flow_nominal Volume flow rate of this thermal zone [m3/s]
AreaAFlo Area of the zone [m2]
Cooling loop signal
SimpleControllercontrollerTypeCooBuildings.Controls.OBC.CDL.T...Type of controller
RealkCoo0.1Gain for cooling control loop signal [1/K]
TimeTiCoo900Time constant of integrator block for cooling control loop signal [s]
TimeTdCoo0.1Time constant of derivative block for cooling control loop signal [s]
Heating loop signal
SimpleControllercontrollerTypeHeaBuildings.Controls.OBC.CDL.T...Type of controller
RealkHea0.1Gain for heating control loop signal [1/K]
TimeTiHea900Time constant of integrator block for heating control loop signal [s]
TimeTdHea0.1Time constant of derivative block for heating control loop signal [s]
Valve
SimpleControllercontrollerTypeValBuildings.Controls.OBC.CDL.T...Type of controller
RealkVal0.5Gain of controller for valve control
TimeTiVal300Time constant of integrator block for valve control [s]
TimeTdVal0.1Time constant of derivative block for valve control [s]
Damper
SimpleControllercontrollerTypeDamBuildings.Controls.OBC.CDL.T...Type of controller
RealkDam0.5Gain of controller for damper control [1]
TimeTiDam300Time constant of integrator block for damper control [s]
TimeTdDam0.1Time constant of derivative block for damper control [s]
Airflow setpoint
Zone sensors
Booleanhave_occSenfalseSet to true if the zone has occupancy sensor
Booleanhave_winSenfalseSet to true if the zone has window status sensor
Booleanhave_CO2SenfalseSet to true if the zone has CO2 sensor
Nominal conditions
VolumeFlowRateVDisCooSetMax_flowV_flow_nominalZone maximum cooling airflow setpoint [m3/s]
VolumeFlowRateVDisSetMin_flow0.15*V_flow_nominalZone minimum airflow setpoint [m3/s]
VolumeFlowRateVDisHeaSetMax_flowV_flow_nominalZone maximum heating airflow setpoint [m3/s]
VolumeFlowRateVDisConMin_flow0.1*V_flow_nominalVAV box controllable minimum [m3/s]
RealVOutPerAre_flow3e-4Outdoor air rate per unit area [m3/(s.m2)]
VolumeFlowRateVOutPerPer_flow2.5e-3Outdoor air rate per person [m3/s]
RealCO2Set894CO2 setpoint in ppm
Damper and valve
Parameters
TemperatureDifferencedTDisZonSetMax11Zone maximum discharge air temperature above heating setpoint [K]
TemperatureTDisMin283.15Lowest discharge air temperature [K]
System requests
Parameters
Booleanhave_heaWatCoitrueFlag, true if there is a hot water coil
Booleanhave_heaPlafalseFlag, true if there is a boiler plant
TemperatureDifferenceerrTZonCoo_12.8Limit value of difference between zone temperature and cooling setpoint for generating 3 cooling SAT reset requests [K]
TemperatureDifferenceerrTZonCoo_21.7Limit value of difference between zone temperature and cooling setpoint for generating 2 cooling SAT reset requests [K]
TemperatureDifferenceerrTDis_117Limit value of difference between discharge air temperature and its setpoint for generating 3 hot water reset requests [K]
TemperatureDifferenceerrTDis_28.3Limit value of difference between discharge air temperature and its setpoint for generating 2 hot water reset requests [K]
Duration times
TimedurTimTem120Duration time of zone temperature exceeds setpoint [s]
TimedurTimFlo60Duration time of airflow rate less than setpoint [s]
TimedurTimDisAir300Duration time of discharge air temperature is less than setpoint [s]

Connectors

TypeNameDescription
input RealInputTZonHeaSetSetpoint temperature for room for heating [K]
input RealInputTZonCooSetSetpoint temperature for room for cooling [K]
input RealInputTZonMeasured room temperature [K]
input RealInputTDisMeasured supply air temperature after heating coil [K]
input RealInputVDis_flowMeasured discharge airflow rate [m3/s]
input RealInputTSupAHUAHU supply air temperature [K]
input RealInputppmCO2Measured CO2 concentration
input RealInputnOccNumber of occupants
input BooleanInputuWinWindow status, true if open, false if closed
input IntegerInputuOpeModZone operation mode
output RealOutputyValSignal for heating coil valve [1]
output RealOutputyDamSignal for VAV damper [1]
output IntegerOutputyZonTemResReqZone cooling supply air temperature reset request
output IntegerOutputyZonPreResReqZone static pressure reset requests

Modelica definition

block Controller "Controller for room VAV box" parameter Modelica.SIunits.Time samplePeriod "Sample period of component, set to the same value as the trim and respond that process yPreSetReq"; parameter Modelica.SIunits.VolumeFlowRate V_flow_nominal "Volume flow rate of this thermal zone"; parameter Modelica.SIunits.Area AFlo "Area of the zone"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeCoo= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kCoo(final unit="1/K") = 0.1 "Gain for cooling control loop signal"; parameter Modelica.SIunits.Time TiCoo=900 "Time constant of integrator block for cooling control loop signal"; parameter Modelica.SIunits.Time TdCoo=0.1 "Time constant of derivative block for cooling control loop signal"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeHea= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kHea(final unit="1/K")=0.1 "Gain for heating control loop signal"; parameter Modelica.SIunits.Time TiHea=900 "Time constant of integrator block for heating control loop signal"; parameter Modelica.SIunits.Time TdHea=0.1 "Time constant of derivative block for heating control loop signal"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeVal= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kVal=0.5 "Gain of controller for valve control"; parameter Modelica.SIunits.Time TiVal=300 "Time constant of integrator block for valve control"; parameter Modelica.SIunits.Time TdVal=0.1 "Time constant of derivative block for valve control"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeDam= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kDam(final unit="1")=0.5 "Gain of controller for damper control"; parameter Modelica.SIunits.Time TiDam=300 "Time constant of integrator block for damper control"; parameter Modelica.SIunits.Time TdDam=0.1 "Time constant of derivative block for damper control"; parameter Boolean have_occSen=false "Set to true if the zone has occupancy sensor"; parameter Boolean have_winSen=false "Set to true if the zone has window status sensor"; parameter Boolean have_CO2Sen=false "Set to true if the zone has CO2 sensor"; parameter Modelica.SIunits.VolumeFlowRate VDisCooSetMax_flow=V_flow_nominal "Zone maximum cooling airflow setpoint"; parameter Modelica.SIunits.VolumeFlowRate VDisSetMin_flow=0.15*V_flow_nominal "Zone minimum airflow setpoint"; parameter Modelica.SIunits.VolumeFlowRate VDisHeaSetMax_flow=V_flow_nominal "Zone maximum heating airflow setpoint"; parameter Modelica.SIunits.VolumeFlowRate VDisConMin_flow=0.1*V_flow_nominal "VAV box controllable minimum"; parameter Real VOutPerAre_flow(final unit = "m3/(s.m2)")=3e-4 "Outdoor air rate per unit area"; parameter Modelica.SIunits.VolumeFlowRate VOutPerPer_flow=2.5e-3 "Outdoor air rate per person"; parameter Real CO2Set=894 "CO2 setpoint in ppm"; parameter Modelica.SIunits.TemperatureDifference dTDisZonSetMax=11 "Zone maximum discharge air temperature above heating setpoint"; parameter Modelica.SIunits.Temperature TDisMin=283.15 "Lowest discharge air temperature"; parameter Boolean have_heaWatCoi=true "Flag, true if there is a hot water coil"; parameter Boolean have_heaPla=false "Flag, true if there is a boiler plant"; parameter Modelica.SIunits.TemperatureDifference errTZonCoo_1=2.8 "Limit value of difference between zone temperature and cooling setpoint for generating 3 cooling SAT reset requests"; parameter Modelica.SIunits.TemperatureDifference errTZonCoo_2=1.7 "Limit value of difference between zone temperature and cooling setpoint for generating 2 cooling SAT reset requests"; parameter Modelica.SIunits.TemperatureDifference errTDis_1=17 "Limit value of difference between discharge air temperature and its setpoint for generating 3 hot water reset requests"; parameter Modelica.SIunits.TemperatureDifference errTDis_2=8.3 "Limit value of difference between discharge air temperature and its setpoint for generating 2 hot water reset requests"; parameter Modelica.SIunits.Time durTimTem=120 "Duration time of zone temperature exceeds setpoint"; parameter Modelica.SIunits.Time durTimFlo=60 "Duration time of airflow rate less than setpoint"; parameter Modelica.SIunits.Time durTimDisAir=300 "Duration time of discharge air temperature is less than setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonHeaSet( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Setpoint temperature for room for heating"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonCooSet( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Setpoint temperature for room for cooling"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Measured room temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Measured supply air temperature after heating coil"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis_flow( final unit="m3/s", quantity="VolumeFlowRate") "Measured discharge airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupAHU( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "AHU supply air temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput ppmCO2 if have_CO2Sen "Measured CO2 concentration"; Buildings.Controls.OBC.CDL.Interfaces.RealInput nOcc if have_occSen "Number of occupants"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWin if have_winSen "Window status, true if open, false if closed"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod "Zone operation mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal( min=0, max=1, final unit="1") "Signal for heating coil valve"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yDam( min=0, max=1, final unit="1") "Signal for VAV damper"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonTemResReq "Zone cooling supply air temperature reset request"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonPreResReq "Zone static pressure reset requests"; Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SetPoints.ActiveAirFlow actAirSet( final AFlo=AFlo, final have_occSen=have_occSen, final have_winSen=have_winSen, final have_CO2Sen=have_CO2Sen, final VDisCooSetMax_flow=VDisCooSetMax_flow, final VDisSetMin_flow=VDisSetMin_flow, final VDisHeaSetMax_flow=VDisHeaSetMax_flow, final VDisConMin_flow=VDisConMin_flow, final VOutPerAre_flow=VOutPerAre_flow, final VOutPerPer_flow=VOutPerPer_flow, final CO2Set=CO2Set) "Active airflow rate setpoint"; Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves damVal( final controllerTypeVal=controllerTypeVal, final kVal=kVal, final TiVal=TiVal, final TdVal=TdVal, final controllerTypeDam=controllerTypeDam, final kDam=kDam, final TiDam=TiDam, final TdDam=TdDam, final dTDisZonSetMax=dTDisZonSetMax, final TDisMin=TDisMin, V_flow_nominal=max(VDisCooSetMax_flow, VDisHeaSetMax_flow)) "Damper and valve controller"; Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests sysReq( final samplePeriod=samplePeriod, final have_heaWatCoi=have_heaWatCoi, final have_heaPla=have_heaPla, final errTZonCoo_1=errTZonCoo_1, final errTZonCoo_2=errTZonCoo_2, final errTDis_1=errTDis_1, final errTDis_2=errTDis_2, final durTimTem=durTimTem, final durTimFlo=durTimFlo, final durTimDisAir=durTimDisAir) "Number of system requests"; Buildings.Controls.OBC.CDL.Continuous.LimPID conHeaLoo( final controllerType=controllerTypeHea, final k=kHea, final Ti=TiHea, final Td=TdHea, final yMax=1, final yMin=0, reset=Buildings.Controls.OBC.CDL.Types.Reset.Parameter) "Heating loop signal"; Buildings.Controls.OBC.CDL.Continuous.LimPID conCooLoo( final controllerType=controllerTypeCoo, final k=kCoo, final Ti=TiCoo, final Td=TdCoo, final yMax=1, final yMin=0, reverseAction=true, reset=Buildings.Controls.OBC.CDL.Types.Reset.Parameter) "Cooling loop signal"; protected Buildings.Controls.OBC.CDL.Integers.Equal isUnOcc "Output true if unoccupied"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conIntUn( final k=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.unoccupied) "Constant signal for unoccupied mode"; Buildings.Controls.OBC.CDL.Logical.Not isNotUn "Output true if not unoccupied"; equation connect(sysReq.TZonCooSet, TZonCooSet); connect(sysReq.TZon, TZon); connect(sysReq.VDisSet_flow, damVal.VDisSet_flow); connect(sysReq.VDis_flow, VDis_flow); connect(sysReq.TDisHeaSet, damVal.TDisHeaSet); connect(damVal.yDam, yDam); connect(damVal.yHeaVal, yVal); connect(damVal.VDis_flow, VDis_flow); connect(damVal.TDis, TDis); connect(sysReq.TDis, TDis); connect(sysReq.uDam, damVal.yDam); connect(damVal.yHeaVal, sysReq.uHeaVal); connect(TZon, damVal.TZon); connect(damVal.TSup, TSupAHU); connect(actAirSet.VActCooMax_flow, damVal.VActCooMax_flow); connect(actAirSet.VActCooMin_flow, damVal.VActCooMin_flow); connect(actAirSet.VActMin_flow, damVal.VActMin_flow); connect(actAirSet.VActHeaMin_flow, damVal.VActHeaMin_flow); connect(actAirSet.VActHeaMax_flow, damVal.VActHeaMax_flow); connect(damVal.THeaSet, TZonHeaSet); connect(actAirSet.VActCooMax_flow, damVal.VActCooMax_flow); connect(actAirSet.VActCooMin_flow, damVal.VActCooMin_flow); connect(actAirSet.VActMin_flow, damVal.VActMin_flow); connect(actAirSet.VActHeaMin_flow, damVal.VActHeaMin_flow); connect(actAirSet.VActHeaMax_flow, damVal.VActHeaMax_flow); connect(actAirSet.uOpeMod, uOpeMod); connect(sysReq.yZonTemResReq, yZonTemResReq); connect(sysReq.yZonPreResReq, yZonPreResReq); connect(actAirSet.ppmCO2, ppmCO2); connect(actAirSet.nOcc, nOcc); connect(actAirSet.uWin, uWin); connect(TZonHeaSet, conHeaLoo.u_s); connect(TZonCooSet, conCooLoo.u_s); connect(TZon, conHeaLoo.u_m); connect(TZon, conCooLoo.u_m); connect(conCooLoo.y, damVal.uCoo); connect(conHeaLoo.y, damVal.uHea); connect(conCooLoo.y, sysReq.uCoo); connect(damVal.uOpeMod, uOpeMod); connect(conIntUn.y, isUnOcc.u1); connect(uOpeMod, isUnOcc.u2); connect(isUnOcc.y, isNotUn.u); connect(isNotUn.y, conCooLoo.trigger); connect(isNotUn.y, conHeaLoo.trigger); end Controller;

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.ModeAndSetPoints Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.ModeAndSetPoints

Output zone setpoint with operation mode selection

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.ModeAndSetPoints

Information

Block that outputs zone setpoint temperature (TZonCooSet, TZonHeaSet) and system operation mode (yOpeMod). When operation mode is in freeze protection setback mode, it also outputs a level 3 freeze protection alarm yFreProSta. The sequences are implemented according to ASHRAE Guideline 36, Part 5.B.3 and 5.C.6.

The sequence consists of two subsequences.

Operation mode selector

The subsequence outputs 7 types system operation mode (occupied, warmup, cool-down, setback, freeze protection setback, setup, unoccupied) according to current time, the time to next occupied hours tNexOcc, current zone temperature TZon. See Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.OperationMode.

Zone setpoint temperature reset

This sequence is implemented according to Part 5.B.3. It sets zone setpoint according to the global giving setpoint, local setpoint adjustments, demand limits adjustment, window status and occupancy stataus. See Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.SetPoints.ZoneTemperatures.

Parameters

TypeNameDefaultDescription
IntegernumZonnumZon( ...Total number of served VAV boxes
TemperatureTZonHeaOn293.15Heating setpoint during on [K]
TemperatureTZonHeaOff285.15Heating setpoint during off [K]
TemperatureTZonCooOn297.15Cooling setpoint during on [K]
TemperatureTZonCooOff303.15Cooling setpoint during off [K]
Operation mode
Parameters
TimepreWarCooTim10800Maximum cool-down/warm-up time [s]
TemperatureDifferencebouLim1.1Value limit to indicate the end of setback/setup mode [K]
TemperatureTZonFreProOn277.55Threshold zone temperature value to activate freeze protection mode [K]
TemperatureTZonFreProOff280.35Threshold zone temperature value to finish the freeze protection mode [K]
Test setting
TimewarCooTim1800Defined cool-down/warm-up time [s]
Setpoint adjust
Sensors
Booleanhave_occSenfalseCheck if the zone has occupancy sensor
Booleanhave_winSenfalseCheck if the zone has window status sensor
Adjustable settings
BooleancooAdjfalseFlag, set to true if both cooling and heating setpoint are adjustable separately
BooleanheaAdjfalseFlag, set to true if heating setpoint is adjustable
BooleansinAdjfalseFlag, set to true if both cooling and heating setpoint are adjustable through a single common knob
BooleanignDemLimtrueFlag, set to true to exempt individual zone from demand limit setpoint adjustment
Limits
TemperatureTZonCooOnMax300.15Maximum cooling setpoint during on [K]
TemperatureTZonCooOnMin295.15Minimum cooling setpoint during on [K]
TemperatureTZonHeaOnMax295.15Maximum heating setpoint during on [K]
TemperatureTZonHeaOnMin291.15Minimum heating setpoint during on [K]
TemperatureTZonCooSetWinOpe322.15Cooling setpoint when window is open [K]
TemperatureTZonHeaSetWinOpe277.15Heating setpoint when window is open [K]
Demands settings
TemperatureDifferenceincTSetDem_10.56Cooling setpoint increase value when cooling demand limit level 1 is imposed [K]
TemperatureDifferenceincTSetDem_21.1Cooling setpoint increase value when cooling demand limit level 2 is imposed [K]
TemperatureDifferenceincTSetDem_32.2Cooling setpoint increase value when cooling demand limit level 3 is imposed [K]
TemperatureDifferencedecTSetDem_10.56Heating setpoint decrease value when heating demand limit level 1 is imposed [K]
TemperatureDifferencedecTSetDem_21.1Heating setpoint decrease value when heating demand limit level 2 is imposed [K]
TemperatureDifferencedecTSetDem_32.2Heating setpoint decrease value when heating demand limit level 3 is imposed [K]
IntegercooDemLimLevConBuildings.Controls.OBC.ASHRA...Cooling demand limit level
IntegerheaDemLimLevConBuildings.Controls.OBC.ASHRA...Heating demand limit level
BooleanwinStaConfalseWindow status, set to true if window is open

Connectors

TypeNameDescription
input RealInputTZon[numZon]Measured zone temperatures [K]
input RealInputtNexOccTime to next occupied period [s]
input RealInputsetAdj[numZon]Setpoint adjustment value [K]
input RealInputheaSetAdj[numZon]Heating setpoint adjustment value [K]
input BooleanInputuOccCurrent occupancy period, true if it is in occupant period
input BooleanInputuOccSen[numZon]Occupancy sensor (occupied=true, unoccupied=false)
input BooleanInputuWinSta[numZon]Window status (open=true, close=false)
output RealOutputTZonCooSet[numZon]Cooling setpoint temperature [K]
output RealOutputTZonHeaSet[numZon]Heating setpoint temperature [K]
output IntegerOutputyOpeModOperation mode

Modelica definition

block ModeAndSetPoints "Output zone setpoint with operation mode selection" parameter Integer numZon(min=2) "Total number of served VAV boxes"; parameter Modelica.SIunits.Temperature TZonHeaOn=293.15 "Heating setpoint during on"; parameter Modelica.SIunits.Temperature TZonHeaOff=285.15 "Heating setpoint during off"; parameter Modelica.SIunits.Temperature TZonCooOn=297.15 "Cooling setpoint during on"; parameter Modelica.SIunits.Temperature TZonCooOff=303.15 "Cooling setpoint during off"; parameter Modelica.SIunits.Time preWarCooTim=10800 "Maximum cool-down/warm-up time"; parameter Modelica.SIunits.TemperatureDifference bouLim=1.1 "Value limit to indicate the end of setback/setup mode"; parameter Modelica.SIunits.Temperature TZonFreProOn=277.55 "Threshold zone temperature value to activate freeze protection mode"; parameter Modelica.SIunits.Temperature TZonFreProOff=280.35 "Threshold zone temperature value to finish the freeze protection mode"; parameter Modelica.SIunits.Time warCooTim=1800 "Defined cool-down/warm-up time"; parameter Boolean have_occSen=false "Check if the zone has occupancy sensor"; parameter Boolean have_winSen=false "Check if the zone has window status sensor"; parameter Boolean cooAdj=false "Flag, set to true if both cooling and heating setpoint are adjustable separately"; parameter Boolean heaAdj=false "Flag, set to true if heating setpoint is adjustable"; parameter Boolean sinAdj=false "Flag, set to true if both cooling and heating setpoint are adjustable through a single common knob"; parameter Boolean ignDemLim=true "Flag, set to true to exempt individual zone from demand limit setpoint adjustment"; parameter Modelica.SIunits.Temperature TZonCooOnMax=300.15 "Maximum cooling setpoint during on"; parameter Modelica.SIunits.Temperature TZonCooOnMin=295.15 "Minimum cooling setpoint during on"; parameter Modelica.SIunits.Temperature TZonHeaOnMax=295.15 "Maximum heating setpoint during on"; parameter Modelica.SIunits.Temperature TZonHeaOnMin=291.15 "Minimum heating setpoint during on"; parameter Modelica.SIunits.Temperature TZonCooSetWinOpe=322.15 "Cooling setpoint when window is open"; parameter Modelica.SIunits.Temperature TZonHeaSetWinOpe=277.15 "Heating setpoint when window is open"; parameter Modelica.SIunits.TemperatureDifference incTSetDem_1=0.56 "Cooling setpoint increase value when cooling demand limit level 1 is imposed"; parameter Modelica.SIunits.TemperatureDifference incTSetDem_2=1.1 "Cooling setpoint increase value when cooling demand limit level 2 is imposed"; parameter Modelica.SIunits.TemperatureDifference incTSetDem_3=2.2 "Cooling setpoint increase value when cooling demand limit level 3 is imposed"; parameter Modelica.SIunits.TemperatureDifference decTSetDem_1=0.56 "Heating setpoint decrease value when heating demand limit level 1 is imposed"; parameter Modelica.SIunits.TemperatureDifference decTSetDem_2=1.1 "Heating setpoint decrease value when heating demand limit level 2 is imposed"; parameter Modelica.SIunits.TemperatureDifference decTSetDem_3=2.2 "Heating setpoint decrease value when heating demand limit level 3 is imposed"; parameter Integer cooDemLimLevCon=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.DemandLimitLevels.cooling0 "Cooling demand limit level"; parameter Integer heaDemLimLevCon=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.DemandLimitLevels.heating0 "Heating demand limit level"; parameter Boolean winStaCon=false "Window status, set to true if window is open"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[numZon]( each final unit="K", each quantity="ThermodynamicTemperature") "Measured zone temperatures"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc( final unit="s", quantity="Time") "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput setAdj[numZon]( each final unit="K", each quantity="ThermodynamicTemperature") if (cooAdj or sinAdj) "Setpoint adjustment value"; Buildings.Controls.OBC.CDL.Interfaces.RealInput heaSetAdj[numZon]( each final unit="K", each quantity="ThermodynamicTemperature") if heaAdj "Heating setpoint adjustment value"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOcc "Current occupancy period, true if it is in occupant period"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOccSen[numZon] if have_occSen "Occupancy sensor (occupied=true, unoccupied=false)"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWinSta[numZon] if have_winSen "Window status (open=true, close=false)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonCooSet[numZon]( each final unit="K", each quantity="ThermodynamicTemperature") "Cooling setpoint temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonHeaSet[numZon]( each final unit="K", each quantity="ThermodynamicTemperature") "Heating setpoint temperature"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yOpeMod "Operation mode"; Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.SetPoints.ZoneTemperatures TZonSet[numZon]( each final have_occSen=have_occSen, each final have_winSen=have_winSen, each final cooAdj=cooAdj, each final heaAdj=heaAdj, each final sinAdj=sinAdj, each final ignDemLim=ignDemLim, each final TZonCooOnMax=TZonCooOnMax, each final TZonCooOnMin=TZonCooOnMin, each final TZonHeaOnMax=TZonHeaOnMax, each final TZonHeaOnMin=TZonHeaOnMin, each final TZonCooSetWinOpe=TZonCooSetWinOpe, each final TZonHeaSetWinOpe=TZonHeaSetWinOpe, each final incTSetDem_1=incTSetDem_1, each final incTSetDem_2=incTSetDem_2, each final incTSetDem_3=incTSetDem_3, each final decTSetDem_1=decTSetDem_1, each final decTSetDem_2=decTSetDem_2, each final decTSetDem_3=decTSetDem_3) "Zone set point temperature"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant cooDemLimLev[numZon]( each k=cooDemLimLevCon) "Cooling demand limit level"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant heaDemLimLev[numZon]( each k=heaDemLimLevCon) "Heating demand limit level"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSetRooHeaOn( final k=TZonHeaOn) "Heating on setpoint"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSetRooHeaOff( final k=TZonHeaOff) "Heating off set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSetRooCooOn( final k=TZonCooOn) "Cooling on setpoint"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSetRooCooOff( final k=TZonCooOff) "Cooling off set point"; Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.OperationMode opeModSel( final numZon=numZon, final preWarCooTim=preWarCooTim, final bouLim=bouLim, final TZonFreProOn=TZonFreProOn, final TZonFreProOff=TZonFreProOff) "Operation mode selector"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant tCooDowHeaUp[numZon]( each final k=warCooTim) "Cool down and heat up time (assumed as constant)"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant cloWin[numZon]( each k=false) if not have_winSen "Closed window status"; protected Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep(nout=numZon) "Duplicate input to multiple outputs"; Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep1(nout=numZon) "Duplicate input to multiple outputs"; Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep2(nout=numZon) "Duplicate input to multiple outputs"; Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep3(nout=numZon) "Duplicate input to multiple outputs"; Buildings.Controls.OBC.CDL.Routing.IntegerReplicator intRep(nout=numZon); equation connect(TZonSet.uCooDemLimLev,cooDemLimLev. y); connect(heaDemLimLev.y,TZonSet. uHeaDemLimLev); connect(tCooDowHeaUp.y,opeModSel. cooDowTim); connect(tCooDowHeaUp.y,opeModSel. warUpTim); connect(TSetRooCooOn.y,opeModSel.TZonCooSetOcc); connect(opeModSel.TZonHeaSetOcc,TSetRooHeaOn. y); connect(opeModSel.TZonHeaSetUno,TSetRooHeaOff. y); connect(opeModSel.TZonCooSetUno,TSetRooCooOff. y); connect(TZonSet.TZonCooSet, TZonCooSet); connect(TZonSet.TZonHeaSet, TZonHeaSet); connect(opeModSel.yOpeMod, yOpeMod); connect(opeModSel.TZon, TZon); connect(setAdj, TZonSet.setAdj); connect(heaSetAdj, TZonSet.heaSetAdj); connect(TZonSet.uOccSen, uOccSen); connect(TZonSet.uWinSta, uWinSta); connect(uWinSta, opeModSel.uWinSta); connect(cloWin.y, opeModSel.uWinSta); connect(TSetRooCooOn.y, reaRep.u); connect(reaRep.y, TZonSet.TZonCooSetOcc); connect(TSetRooHeaOn.y, reaRep1.u); connect(reaRep1.y, TZonSet.TZonHeaSetOcc); connect(TSetRooHeaOff.y, reaRep2.u); connect(reaRep2.y, TZonSet.TZonHeaSetUno); connect(TSetRooCooOff.y, reaRep3.u); connect(reaRep3.y, TZonSet.TZonCooSetUno); connect(opeModSel.yOpeMod, intRep.u); connect(intRep.y, TZonSet.uOpeMod); connect(uOcc, opeModSel.uOcc); connect(tNexOcc, opeModSel.tNexOcc); end ModeAndSetPoints;