Buildings.Examples.DualFanDualDuct.Controls

Package with controller models

Information

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint CoolingCoilTemperatureSetpoint Set point scheduler for cooling coil
Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint HeatingCoilTemperatureSetpoint Set point scheduler for heating coil
Buildings.Examples.DualFanDualDuct.Controls.MixedAirTemperatureSetpoint MixedAirTemperatureSetpoint Mixed air temperature setpoint for economizer
Buildings.Examples.DualFanDualDuct.Controls.PreHeatCoil PreHeatCoil Controller for preheat coil
Buildings.Examples.DualFanDualDuct.Controls.RoomMixingBox RoomMixingBox Controller for room mixing box
Buildings.Examples.DualFanDualDuct.Controls.Examples Examples Example models to test the components

Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint

Set point scheduler for cooling coil

Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint

Information

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
TemperatureTOn Setpoint during on [K]
TemperatureTOff Setpoint during off [K]

Connectors

TypeNameDescription
ControlBuscontrolBus 
output RealOutputTSetTemperature set point [K]

Modelica definition

block CoolingCoilTemperatureSetpoint "Set point scheduler for cooling coil" extends Modelica.Blocks.Icons.Block; import Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes; parameter Modelica.Units.SI.Temperature TOn(displayUnit="degC") "Setpoint during on"; parameter Modelica.Units.SI.Temperature TOff(displayUnit="degC") "Setpoint during off"; Modelica.Blocks.Sources.RealExpression TSetPoi( y(final unit="K", displayUnit="degC")=if (mode.y == Integer(OperationModes.occupied) or mode.y == Integer(OperationModes.unoccupiedPreCool) or mode.y == Integer(OperationModes.safety)) then TOn else TOff) "Air temperature setpoint"; VAVReheat.BaseClasses.Controls.ControlBus controlBus; Modelica.Blocks.Routing.IntegerPassThrough mode; Modelica.Blocks.Interfaces.RealOutput TSet( final unit="K", displayUnit="degC") "Temperature set point"; equation connect(controlBus.controlMode, mode.u); connect(TSetPoi.y, TSet); end CoolingCoilTemperatureSetpoint;

Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint

Set point scheduler for heating coil

Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint

Information

Extends from CoolingCoilTemperatureSetpoint (Set point scheduler for cooling coil).

Parameters

TypeNameDefaultDescription
TemperatureTOn Setpoint during on [K]
TemperatureTOff Setpoint during off [K]

Connectors

TypeNameDescription
ControlBuscontrolBus 
output RealOutputTSetTemperature set point [K]

Modelica definition

block HeatingCoilTemperatureSetpoint "Set point scheduler for heating coil" import Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes; extends CoolingCoilTemperatureSetpoint(TSetPoi( y=if (mode.y == Integer(OperationModes.unoccupiedOff)) then TOff else TOn)); end HeatingCoilTemperatureSetpoint;

Buildings.Examples.DualFanDualDuct.Controls.MixedAirTemperatureSetpoint Buildings.Examples.DualFanDualDuct.Controls.MixedAirTemperatureSetpoint

Mixed air temperature setpoint for economizer

Buildings.Examples.DualFanDualDuct.Controls.MixedAirTemperatureSetpoint

Information

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputTSupHeaSetSupply temperature setpoint for heating [K]
input RealInputTSupCooSetSupply temperature setpoint for cooling [K]
output RealOutputTSetMixed air temperature setpoint [K]
ControlBuscontrolBus 

Modelica definition

model MixedAirTemperatureSetpoint "Mixed air temperature setpoint for economizer" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Routing.Extractor TSetMix( nin=6, index(start=2, fixed=true)) "Mixed air setpoint temperature extractor"; Modelica.Blocks.Sources.Constant off(k=273.15 + 13) "Setpoint temperature to close damper"; Buildings.Utilities.Math.Average ave(nin=2); Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupHeaSet( final unit="K", displayUnit="degC") "Supply temperature setpoint for heating"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupCooSet( final unit="K", displayUnit="degC") "Supply temperature setpoint for cooling"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TSet( final unit="K", displayUnit="degC") "Mixed air temperature setpoint"; Modelica.Blocks.Sources.Constant TPreCoo(k=273.15 + 13) "Setpoint during pre-cooling"; VAVReheat.BaseClasses.Controls.ControlBus controlBus; Modelica.Blocks.Routing.Multiplex2 multiplex2_1; equation connect(TSetMix.u[1], ave.y); connect(ave.y, TSetMix.u[1]); connect(off.y, TSetMix.u[2]); connect(off.y, TSetMix.u[3]); connect(off.y, TSetMix.u[4]); connect(TPreCoo.y, TSetMix.u[5]); connect(off.y, TSetMix.u[6]); connect(controlBus.controlMode, TSetMix.index); connect(TSetMix.y, TSet); connect(multiplex2_1.y, ave.u); connect(TSupCooSet, multiplex2_1.u2[1]); connect(TSupHeaSet, multiplex2_1.u1[1]); end MixedAirTemperatureSetpoint;

Buildings.Examples.DualFanDualDuct.Controls.PreHeatCoil Buildings.Examples.DualFanDualDuct.Controls.PreHeatCoil

Controller for preheat coil

Buildings.Examples.DualFanDualDuct.Controls.PreHeatCoil

Information

Controller for the preheat coil. If the air inlet temperature is below a minimum temperature, such as 10°C, the preheat coil is activated. It then switches the pump on, and regulates the valve to meet the set point temperature for the supply air.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputTAirSupSupply air temperature after the coil [K]
input RealInputTSupSetHeaHeating set point temperature for supply air [K]
output RealOutputyValControl signal for valve [1]
input RealInputTMixMixed air temperature upstream of coil [K]
output RealOutputyPumControl signal for pump [1]

Modelica definition

model PreHeatCoil "Controller for preheat coil" extends Modelica.Blocks.Icons.Block; Buildings.Controls.Continuous.LimPID preHeaCoiCon( yMax=1, yMin=0, Td=60, initType=Modelica.Blocks.Types.Init.InitialState, Ti=120, strict=true, k=0.1) "Controller for pre-heating coil"; Modelica.Blocks.Sources.Constant zero(k=0) "Zero output signal"; Modelica.Blocks.Logical.Switch swiPumPreCoi "Switch for preheat coil pump"; Modelica.Blocks.Logical.OnOffController preHeaOn(bandwidth=1) "Switch to enable preheat coil"; Modelica.Blocks.Sources.Constant TPreHeaOn(k=273.15 + 10) "Temperature when preheat coil is switched on."; Modelica.Blocks.Sources.Constant one(k=1) "Outputs 1"; Modelica.Blocks.Interfaces.RealInput TAirSup(unit="K") "Supply air temperature after the coil"; Modelica.Blocks.Interfaces.RealInput TSupSetHea(unit="K") "Heating set point temperature for supply air"; Modelica.Blocks.Interfaces.RealOutput yVal(unit="1") "Control signal for valve"; Modelica.Blocks.Interfaces.RealInput TMix(unit="K") "Mixed air temperature upstream of coil"; Modelica.Blocks.Interfaces.RealOutput yPum(unit="1") "Control signal for pump"; Modelica.Blocks.Logical.Switch swiValOp "Switch to close valve if pump is not running"; Modelica.StateGraph.InitialStep pumOff(nIn=1, nOut=1) "Pump is off"; Modelica.StateGraph.TransitionWithSignal toOn "Switch pump on"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.StepWithSignal pumOn(nIn=1, nOut=1) "Pump on"; Modelica.StateGraph.TransitionWithSignal toOff(enableTimer=true, waitTime=30* 60) "Switch pump off"; Modelica.Blocks.Logical.Not not1; equation connect(preHeaOn.reference,TPreHeaOn. y); connect(zero.y, swiPumPreCoi.u3); connect(one.y, swiPumPreCoi.u1); connect(TAirSup, preHeaCoiCon.u_m); connect(TSupSetHea, preHeaCoiCon.u_s); connect(TMix, preHeaOn.u); connect(yPum, swiPumPreCoi.y); connect(zero.y, swiValOp.u3); connect(swiValOp.y, yVal); connect(pumOff.outPort[1], toOn.inPort); connect(toOn.condition, preHeaOn.y); connect(pumOn.inPort[1], toOn.outPort); connect(toOff.inPort, pumOn.outPort[1]); connect(preHeaOn.y, not1.u); connect(not1.y, toOff.condition); connect(toOff.outPort, pumOff.inPort[1]); connect(pumOn.active, swiPumPreCoi.u2); connect(pumOn.active, swiValOp.u2); connect(preHeaCoiCon.y, swiValOp.u1); end PreHeatCoil;

Buildings.Examples.DualFanDualDuct.Controls.RoomMixingBox Buildings.Examples.DualFanDualDuct.Controls.RoomMixingBox

Controller for room mixing box

Buildings.Examples.DualFanDualDuct.Controls.RoomMixingBox

Information

This controller outputs the control signal for the air damper for the hot deck and the cold deck. The control signal for the hot deck is the larger of the two signals needed to track the room heating temperature setpoint, and the minimum air flow rate.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_min Minimum mass flow rate [kg/s]

Connectors

TypeNameDescription
input RealInputTRooMeasured room temperature [K]
output RealOutputyHotSignal for hot air damper
output RealOutputyColSignal for cold deck air damper
input RealInputmAir_flowMeasured air mass flow rate into the room
input BooleanInputyFanFan operation, true if fan is running
input RealInputTRooSetHeaRoom temperature setpoint for heating [K]
input RealInputTRooSetCooRoom temperature setpoint for cooling [K]

Modelica definition

block RoomMixingBox "Controller for room mixing box" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.MassFlowRate m_flow_min "Minimum mass flow rate"; Buildings.Controls.OBC.CDL.Reals.PID conHea( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, Td=60, k=0.1, Ti=120) "Controller for heating"; Buildings.Controls.OBC.CDL.Reals.PID conCoo( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, reverseActing=false, Td=60, k=0.1, Ti=120) "Controller for cooling (acts on damper)"; Modelica.Blocks.Interfaces.RealInput TRoo( final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Measured room temperature"; Modelica.Blocks.Interfaces.RealOutput yHot "Signal for hot air damper"; Modelica.Blocks.Interfaces.RealOutput yCol "Signal for cold deck air damper"; Modelica.Blocks.Interfaces.RealInput mAir_flow "Measured air mass flow rate into the room"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput yFan "Fan operation, true if fan is running"; Buildings.Controls.OBC.CDL.Reals.PID conFloRat( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, Td=60, k=0.1, Ti=120, r=m_flow_min) "Controller for mass flow rate"; Modelica.Blocks.Sources.Constant mAirSet(k=m_flow_min) "Set point for minimum air flow rate"; Buildings.Controls.OBC.CDL.Reals.Max max "Adds control signal for minimum flow rate of zone"; Modelica.Blocks.Interfaces.RealInput TRooSetHea(unit="K") "Room temperature setpoint for heating"; Modelica.Blocks.Interfaces.RealInput TRooSetCoo(unit="K") "Room temperature setpoint for cooling"; Modelica.Blocks.Sources.RealExpression gaiHea(y=1 - gaiCoo.y) "Gain for adding minimum flow rate to cooling signal"; Modelica.Blocks.Math.Product product; Modelica.Blocks.Math.Product product1; Buildings.Controls.OBC.CDL.Reals.Max maxCoo "Adds control signal for minimum flow rate of zone"; Buildings.Controls.OBC.CDL.Reals.Subtract dTSet "Difference in set point"; Buildings.Controls.OBC.CDL.Reals.Subtract dTRooHea "Difference in room air temperature compared to heating setpoint"; Buildings.Controls.OBC.CDL.Reals.Limiter gaiCoo(uMax=1, uMin=0) "Gain of cooling"; Buildings.Controls.OBC.CDL.Reals.Divide gaiCooUnl "Gain of cooling, unlimited"; Buildings.Controls.OBC.CDL.Reals.Switch swiHot "Switch for heating"; Buildings.Controls.OBC.CDL.Reals.Switch swiCoo "Switch for cooling"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(k=0) "Zero signal"; equation connect(mAir_flow, conFloRat.u_m); connect(conHea.y, max.u1); connect(conHea.u_s, TRooSetHea); connect(conCoo.u_s, TRooSetCoo); connect(TRoo, conCoo.u_m); connect(TRoo, conHea.u_m); connect(conFloRat.y, product.u1); connect(product.y, max.u2); connect(product.u2, gaiHea.y); connect(mAirSet.y, conFloRat.u_s); connect(dTSet.u1, TRooSetCoo); connect(dTSet.u2, TRooSetHea); connect(dTRooHea.u1, TRoo); connect(dTRooHea.u2, TRooSetHea); connect(gaiCooUnl.u1, dTRooHea.y); connect(dTSet.y, gaiCooUnl.u2); connect(gaiCooUnl.y, gaiCoo.u); connect(gaiCoo.y, product1.u2); connect(conFloRat.y, product1.u1); connect(conCoo.y, maxCoo.u1); connect(maxCoo.u2, product1.y); connect(swiHot.y, yHot); connect(swiHot.u1, max.y); connect(yCol, swiCoo.y); connect(swiCoo.u1, maxCoo.y); connect(swiCoo.u2, yFan); connect(zer.y, swiCoo.u3); connect(zer.y, swiHot.u3); connect(yFan, swiHot.u2); end RoomMixingBox;