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.FanVFD FanVFD Controller for fan revolution
Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint HeatingCoilTemperatureSetpoint Set point scheduler for heating coil
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

Modelica definition

block CoolingCoilTemperatureSetpoint "Set point scheduler for cooling coil" extends Modelica.Blocks.Icons.Block; import Buildings.Examples.VAVReheat.Controls.OperationModes; parameter Modelica.SIunits.Temperature TOn "Setpoint during on"; parameter Modelica.SIunits.Temperature TOff "Setpoint during off"; Modelica.Blocks.Sources.RealExpression TSetPoi(y=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.Controls.ControlBus controlBus; Modelica.Blocks.Routing.IntegerPassThrough mode; Modelica.Blocks.Interfaces.RealOutput TSet "Temperature set point"; equation connect(controlBus.controlMode, mode.u); connect(TSetPoi.y, TSet); end CoolingCoilTemperatureSetpoint;

Buildings.Examples.DualFanDualDuct.Controls.FanVFD Buildings.Examples.DualFanDualDuct.Controls.FanVFD

Controller for fan revolution

Buildings.Examples.DualFanDualDuct.Controls.FanVFD

Information

Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).

Parameters

TypeNameDefaultDescription
RealxSet_nominal Nominal setpoint (used for normalization)
Realr_N_min0.01Minimum normalized fan speed

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output RealOutputyConnector of Real output signal
ControlBuscontrolBus 
input RealInputu_mConnector of measurement input signal

Modelica definition

block FanVFD "Controller for fan revolution" extends Modelica.Blocks.Interfaces.SISO; import Buildings.Examples.VAVReheat.Controls.OperationModes; Buildings.Controls.Continuous.LimPID con( yMax=1, yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=60, Ti=10) "Controller"; Modelica.Blocks.Math.Gain gaiMea(k=1/xSet_nominal) "Gain to normalize measurement signal"; parameter Real xSet_nominal "Nominal setpoint (used for normalization)"; VAVReheat.Controls.ControlBus controlBus; Modelica.Blocks.Routing.Extractor extractor(nin=6); Modelica.Blocks.Sources.Constant off(k=r_N_min) "Off signal"; Modelica.Blocks.Sources.Constant on(k=1) "On signal"; Modelica.Blocks.Math.Gain gaiSet(k=1/xSet_nominal) "Gain to normalize setpoint signal"; Modelica.Blocks.Interfaces.RealInput u_m "Connector of measurement input signal"; parameter Real r_N_min=0.01 "Minimum normalized fan speed"; Modelica.Blocks.Continuous.FirstOrder firstOrder( initType=Modelica.Blocks.Types.Init.InitialState, y_start=r_N_min, T=60); equation connect(gaiMea.y, con.u_m); connect(con.y, extractor.u[OperationModes.occupied]); connect(con.y, extractor.u[OperationModes.unoccupiedWarmUp]); connect(con.y, extractor.u[OperationModes.unoccupiedPreCool]); connect(off.y, extractor.u[OperationModes.unoccupiedOff]); connect(off.y, extractor.u[OperationModes.safety]); connect(on.y, extractor.u[OperationModes.unoccupiedNightSetBack]); connect(controlBus.controlMode, extractor.index); connect(gaiSet.y, con.u_s); connect(u_m, gaiMea.u); connect(gaiSet.u, u); connect(extractor.y, firstOrder.u); connect(y, extractor.y); end FanVFD;

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

Modelica definition

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

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.InitPID.InitialState, Ti=120, strict=true, controllerType=Modelica.Blocks.Types.SimpleController.PI, 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 "Pump is off"; Modelica.StateGraph.TransitionWithSignal toOn "Switch pump on"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.StepWithSignal pumOn "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 RealInputTRooSetHeaRoom temperature setpoint for heating [K]
input RealInputTRooSetCooRoom temperature setpoint for cooling [K]
input BooleanInputyFanFan operation, true if fan is running

Modelica definition

block RoomMixingBox "Controller for room mixing box" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.MassFlowRate m_flow_min "Minimum mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.LimPID conHea( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, yMax=1, Td=60, yMin=0, k=0.1, Ti=120) "Controller for heating"; Buildings.Controls.OBC.CDL.Continuous.LimPID conCoo( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, yMax=1, reverseAction=true, Td=60, k=0.1, Ti=120, yMin=0) "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.Continuous.LimPID conFloRat( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, initType=Buildings.Controls.OBC.CDL.Types.Init.InitialState, yMax=1, Td=60, yMin=0, k=0.1, Ti=120) "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.Continuous.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.Continuous.Max maxCoo "Adds control signal for minimum flow rate of zone"; Buildings.Controls.OBC.CDL.Continuous.Add dTSet(k2=-1) "Difference in set point"; Buildings.Controls.OBC.CDL.Continuous.Add dTRooHea(k2=-1) "Difference in room air temperature compared to heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Limiter gaiCoo(uMax=1, uMin=0) "Gain of cooling"; Buildings.Controls.OBC.CDL.Continuous.Division gaiCooUnl "Gain of cooling, unlimited"; Buildings.Controls.OBC.CDL.Logical.Switch swiHot "Switch for heating"; Buildings.Controls.OBC.CDL.Logical.Switch swiCoo "Switch for cooling"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput yFan "Fan operation, true if fan is running"; Buildings.Controls.OBC.CDL.Continuous.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;