Package with controller models
Information
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name |
Description |
CoolingCoilTemperatureSetpoint
|
Set point scheduler for cooling coil |
FanVFD
|
Controller for fan revolution |
HeatingCoilTemperatureSetpoint
|
Set point scheduler for heating coil |
PreHeatCoil
|
Controller for preheat coil |
RoomMixingBox
|
Controller for room mixing box |
Examples
|
Example models to test the components |
Set point scheduler for cooling coil
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Connectors
Modelica definition
Controller for fan revolution
Information
Extends from Modelica.Blocks.Interfaces.SISO (Single Input Single Output continuous control block).
Parameters
Type | Name | Default | Description |
Real | xSet_nominal | | Nominal setpoint (used for normalization) |
Real | r_N_min | 0.01 | Minimum normalized fan speed |
Connectors
Type | Name | Description |
input RealInput | u | Connector of Real input signal |
output RealOutput | y | Connector of Real output signal |
ControlBus | controlBus | |
input RealInput | u_m | Connector of measurement input signal |
Modelica definition
block FanVFD
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) ;
Modelica.Blocks.Math.Gain gaiMea(k=1/xSet_nominal)
;
parameter Real xSet_nominal ;
VAVReheat.Controls.ControlBus controlBus;
Modelica.Blocks.Routing.Extractor extractor(nin=6);
Modelica.Blocks.Sources.Constant off(k=r_N_min) ;
Modelica.Blocks.Sources.Constant on(k=1) ;
Modelica.Blocks.Math.Gain gaiSet(k=1/xSet_nominal)
;
Modelica.Blocks.Interfaces.RealInput u_m
;
parameter Real r_N_min=0.01 ;
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;
Set point scheduler for heating coil
Information
Extends from CoolingCoilTemperatureSetpoint (Set point scheduler for cooling coil).
Parameters
Connectors
Modelica definition
Controller for preheat coil
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
Type | Name | Description |
input RealInput | TAirSup | Supply air temperature after the coil [K] |
input RealInput | TSupSetHea | Heating set point temperature for supply air [K] |
output RealOutput | yVal | Control signal for valve [1] |
input RealInput | TMix | Mixed air temperature upstream of coil [K] |
output RealOutput | yPum | Control signal for pump [1] |
Modelica definition
model PreHeatCoil
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) ;
Modelica.Blocks.Sources.Constant zero(k=0) ;
Modelica.Blocks.Logical.Switch swiPumPreCoi ;
Modelica.Blocks.Logical.OnOffController preHeaOn(bandwidth=1)
;
Modelica.Blocks.Sources.Constant TPreHeaOn(k=273.15 + 10)
;
Modelica.Blocks.Sources.Constant one(k=1) ;
Modelica.Blocks.Interfaces.RealInput TAirSup(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TSupSetHea(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput yVal(unit="1")
;
Modelica.Blocks.Interfaces.RealInput TMix(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput yPum(unit="1")
;
Modelica.Blocks.Logical.Switch swiValOp
;
Modelica.StateGraph.InitialStep pumOff ;
Modelica.StateGraph.TransitionWithSignal toOn ;
inner Modelica.StateGraph.StateGraphRoot
stateGraphRoot;
Modelica.StateGraph.StepWithSignal pumOn ;
Modelica.StateGraph.TransitionWithSignal toOff(enableTimer=true, waitTime=30*
60) ;
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;
Controller for room mixing box
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
Type | Name | Default | Description |
MassFlowRate | m_flow_min | | Minimum mass flow rate [kg/s] |
Connectors
Type | Name | Description |
input RealInput | TRoo | Measured room temperature [K] |
output RealOutput | yHot | Signal for hot air damper |
output RealOutput | yCol | Signal for cold deck air damper |
input RealInput | mAir_flow | Measured air mass flow rate into the room |
input RealInput | TRooSetHea | Room temperature setpoint for heating [K] |
input RealInput | TRooSetCoo | Room temperature setpoint for cooling [K] |
input BooleanInput | yFan | Fan operation, true if fan is running |
Modelica definition
block RoomMixingBox
extends Modelica.Blocks.Icons.Block;
parameter Modelica.SIunits.MassFlowRate m_flow_min ;
Buildings.Controls.OBC.CDL.Continuous.LimPID conHea(
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI,
Td=60,
k=0.1,
Ti=120) ;
Buildings.Controls.OBC.CDL.Continuous.LimPID conCoo(
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI,
reverseAction=true,
Td=60,
k=0.1,
Ti=120) ;
Modelica.Blocks.Interfaces.RealInput TRoo(
final quantity="ThermodynamicTemperature",
final unit = "K", displayUnit = "degC", min=0)
;
Modelica.Blocks.Interfaces.RealOutput yHot ;
Modelica.Blocks.Interfaces.RealOutput yCol ;
Modelica.Blocks.Interfaces.RealInput mAir_flow
;
Buildings.Controls.OBC.CDL.Continuous.LimPID conFloRat(
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI,
Td=60,
k=0.1,
Ti=120) ;
Modelica.Blocks.Sources.Constant mAirSet(k=m_flow_min)
;
Buildings.Controls.OBC.CDL.Continuous.Max max
;
Modelica.Blocks.Interfaces.RealInput TRooSetHea(unit="K")
;
Modelica.Blocks.Interfaces.RealInput TRooSetCoo(unit="K")
;
Modelica.Blocks.Sources.RealExpression gaiHea(y=1 - gaiCoo.y)
;
Modelica.Blocks.Math.Product product;
Modelica.Blocks.Math.Product product1;
Buildings.Controls.OBC.CDL.Continuous.Max maxCoo
;
Buildings.Controls.OBC.CDL.Continuous.Add dTSet(k2=-1)
;
Buildings.Controls.OBC.CDL.Continuous.Add dTRooHea(k2=-1)
;
Buildings.Controls.OBC.CDL.Continuous.Limiter gaiCoo(uMax=1, uMin=0)
;
Buildings.Controls.OBC.CDL.Continuous.Division gaiCooUnl
;
Buildings.Controls.OBC.CDL.Logical.Switch swiHot ;
Buildings.Controls.OBC.CDL.Logical.Switch swiCoo ;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput yFan
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer(k=0) ;
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;