Package with controller models
Information
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name |
Description |
ControlBus
|
Empty control bus that is adapted to the signals connected to it |
CoolingCoilTemperatureSetpoint
|
Set point scheduler for cooling coil |
DuctStaticPressureSetpoint
|
Computes the duct static pressure setpoint |
Economizer
|
Controller for economizer |
EconomizerTemperatureControl
|
Controller for economizer mixed air temperature |
FanVFD
|
Controller for fan revolution |
MixedAirTemperatureSetpoint
|
Mixed air temperature setpoint for economizer |
ModeSelector
|
Finite State Machine for the operational modes |
OperationModes
|
Enumeration for modes of operation |
PreCoolingStarter
|
Outputs true when precooling should start |
RoomTemperatureSetpoint
|
Set point scheduler for room temperature |
RoomVAV
|
Controller for room VAV box |
State
|
Block that outputs the mode if the state is active, or zero otherwise |
Examples
|
Example models to test the components |
Types and constants
type OperationModes = enumeration(
occupied ,
unoccupiedOff ,
unoccupiedNightSetBack ,
unoccupiedWarmUp ,
unoccupiedPreCool ,
safety ) ;
Empty control bus that is adapted to the signals connected to it
Information
This connector defines the expandable connector
ControlBus that
is used to connect control signals.
Note, this connector is empty. When using it, the actual content is
constructed by the signals connected to this bus.
Extends from Modelica.Icons.SignalBus (Icon for signal bus).
Modelica definition
Set point scheduler for cooling coil
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
Temperature | TCooOn | 273.15 + 12 | Cooling setpoint during on [K] |
Temperature | TCooOff | 273.15 + 30 | Cooling setpoint during off [K] |
Connectors
Modelica definition
Computes the duct static pressure setpoint
Information
Extends from Modelica.Blocks.Interfaces.MISO (Multiple Input Single Output continuous control block).
Parameters
Type | Name | Default | Description |
Integer | nin | 1 | Number of inputs |
AbsolutePressure | pMin | 100 | Minimum duct static pressure setpoint [Pa] |
AbsolutePressure | pMax | 410 | Maximum duct static pressure setpoint [Pa] |
Real | k | 0.1 | Gain of controller |
Time | Ti | 60 | Time constant of integrator block [s] |
Time | Td | 60 | Time constant of derivative block [s] |
SimpleController | controllerType | Modelica.Blocks.Types.Simple... | Type of controller |
Connectors
Type | Name | Description |
input RealInput | u[nin] | Connector of Real input signals |
output RealOutput | y | Connector of Real output signal |
input RealInput | TOut | Outside air temperature |
Modelica definition
model DuctStaticPressureSetpoint
extends Modelica.Blocks.Interfaces.MISO;
parameter Modelica.SIunits.AbsolutePressure pMin(displayUnit="Pa") = 100
;
parameter Modelica.SIunits.AbsolutePressure pMax(displayUnit="Pa") = 410
;
parameter Real k=0.1 ;
parameter Modelica.SIunits.Time Ti=60 ;
parameter Modelica.SIunits.Time Td=60 ;
parameter Modelica.Blocks.Types.SimpleController controllerType=Modelica.Blocks.Types.SimpleController.PID
;
Buildings.Controls.Continuous.LimPID limPID(
controllerType=controllerType,
k=k,
Ti=Ti,
Td=Td,
initType=Modelica.Blocks.Types.InitPID.InitialState);
protected
Buildings.Utilities.Math.Max max(
final nin=nin);
Modelica.Blocks.Sources.Constant ySet(k=0.9)
;
Modelica.Blocks.Math.Add dp(
final k2=-1) ;
Modelica.Blocks.Sources.Constant pMaxSig(k=pMax);
Modelica.Blocks.Sources.Constant pMinSig(k=pMin);
Modelica.Blocks.Math.Add pSet ;
Modelica.Blocks.Math.Product product;
public
Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=283.15, uHigh=284.15)
;
Modelica.Blocks.Interfaces.RealInput TOut ;
protected
Modelica.Blocks.Sources.Constant zero(k=0) ;
public
Modelica.Blocks.Logical.Switch switch1;
equation
connect(max.u, u);
connect(ySet.y, limPID.u_s);
connect(max.y, limPID.u_m);
connect(limPID.y, product.u1);
connect(pMaxSig.y, dp.u1);
connect(pMinSig.y, dp.u2);
connect(dp.y, product.u2);
connect(pMinSig.y, pSet.u2);
connect(pSet.y, y);
connect(hysteresis.u, TOut);
connect(product.y, switch1.u1);
connect(zero.y, switch1.u3);
connect(switch1.y, pSet.u1);
connect(hysteresis.y, switch1.u2);
end DuctStaticPressureSetpoint;
Controller for economizer
Information
This is a controller for an economizer with
that adjust the outside air dampers to meet the set point
for the mixing air, taking into account the minimum outside
air requirement and an override for freeze protection.
Parameters
Type | Name | Default | Description |
Temperature | TFreSet | 277.15 | Lower limit for mixed air temperature for freeze protection [K] |
TemperatureDifference | dT | 1 | Temperture offset to activate economizer [K] |
VolumeFlowRate | VOut_flow_min | VOut_flow_min( ... | Minimum outside air volume flow rate [m3/s] |
Real | k | 1 | Gain of controller |
Time | Ti | | Time constant of integrator block [s] |
Connectors
Type | Name | Description |
input RealInput | TSupHeaSet | Supply temperature setpoint for heating |
input RealInput | TSupCooSet | Supply temperature setpoint for cooling |
input RealInput | TMix | Measured mixed air temperature |
ControlBus | controlBus | |
input RealInput | VOut_flow | Measured outside air flow rate |
input RealInput | TRet | Return air temperature |
output RealOutput | yOA | Control signal for outside air damper |
output RealOutput | yRet | Control signal for return air damper |
Modelica definition
block Economizer
import Buildings.Examples.VAVReheat.Controls.OperationModes;
parameter Modelica.SIunits.Temperature TFreSet=277.15
;
parameter Modelica.SIunits.TemperatureDifference dT(min=0.1) = 1
;
parameter Modelica.SIunits.VolumeFlowRate VOut_flow_min(min=0)
;
Modelica.Blocks.Interfaces.RealInput TSupHeaSet
;
Modelica.Blocks.Interfaces.RealInput TSupCooSet
;
Modelica.Blocks.Interfaces.RealInput TMix ;
ControlBus controlBus;
Modelica.Blocks.Interfaces.RealInput VOut_flow
;
Modelica.Blocks.Interfaces.RealInput TRet ;
Modelica.Blocks.Math.Gain gain(k=1/VOut_flow_min) ;
Buildings.Controls.Continuous.LimPID conV_flow(
controllerType=Modelica.Blocks.Types.SimpleController.PI,
k=k,
Ti=Ti,
yMax=0.995,
yMin=0.005,
Td=60) ;
Modelica.Blocks.Sources.Constant uni(k=1) ;
parameter Real k=1 ;
parameter Modelica.SIunits.Time Ti ;
Modelica.Blocks.Interfaces.RealOutput yOA
;
Modelica.Blocks.Routing.Extractor extractor(nin=6, index(start=1, fixed=true))
;
Modelica.Blocks.Sources.Constant closed(k=0) ;
Modelica.Blocks.Math.Max max
;
MixedAirTemperatureSetpoint TSetMix ;
EconomizerTemperatureControl yOATMix(Ti=Ti, k=k)
;
Buildings.Controls.Continuous.LimPID yOATFre(
k=k,
Ti=Ti,
Td=60,
controllerType=Modelica.Blocks.Types.SimpleController.PI,
yMax=1,
yMin=0)
;
Modelica.Blocks.Math.Min min
;
Modelica.Blocks.Sources.Constant TFre(k=TFreSet)
;
Modelica.Blocks.Interfaces.RealOutput yRet
;
Buildings.Controls.OBC.CDL.Continuous.AddParameter invSig(p=1, k=-1)
;
equation
connect(VOut_flow, gain.u);
connect(gain.y, conV_flow.u_m);
connect(uni.y, conV_flow.u_s);
connect(controlBus.controlMode, extractor.index);
connect(max.y, extractor.u[
Integer(OperationModes.occupied)]);
connect(closed.y, extractor.u[
Integer(OperationModes.unoccupiedOff)]);
connect(closed.y, extractor.u[
Integer(OperationModes.unoccupiedNightSetBack)]);
connect(max.y, extractor.u[
Integer(OperationModes.unoccupiedWarmUp)]);
connect(max.y, extractor.u[
Integer(OperationModes.unoccupiedPreCool)]);
connect(closed.y, extractor.u[
Integer(OperationModes.safety)]);
connect(TSupHeaSet, TSetMix.TSupHeaSet);
connect(TSupCooSet, TSetMix.TSupCooSet);
connect(controlBus, TSetMix.controlBus);
connect(yOATMix.TRet, TRet);
connect(controlBus.TOut, yOATMix.TOut);
connect(yOATMix.TMix, TMix);
connect(yOATMix.TMixSet, TSetMix.TSet);
connect(yOATMix.yOA, max.u1);
connect(min.u2, conV_flow.y);
connect(min.y, max.u2);
connect(yOATFre.u_s, TMix);
connect(TFre.y, yOATFre.u_m);
connect(yOATFre.y, min.u1);
connect(yRet, invSig.y);
connect(extractor.y, invSig.u);
connect(extractor.y, yOA);
end Economizer;
Controller for economizer mixed air temperature
Information
This controller outputs the control signal for the outside
air damper in order to regulate the mixed air temperature
TMix
.
Implementation
If the control error Tmix,set - Tmix < 0,
then more outside air is needed provided that Tout < Tret,
where
Tout is the outside air temperature and
Tret is the return air temperature.
However, if Tout ≥ Tret,
then less outside air is needed.
Hence, the control gain need to switch sign depending on this difference.
This is accomplished by taking the difference between these signals,
and then switching the input of the controller.
A hysteresis is used to avoid chattering, for example if
TRet
has numerical noise in the simulation, or
measurement error in a real application.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
Real | k | 1 | Gain of controller |
Time | Ti | | Time constant of integrator block [s] |
Connectors
Type | Name | Description |
output RealOutput | yOA | Control signal for outside air damper |
input RealInput | TRet | Return air temperature |
input RealInput | TOut | Outside air temperature |
input RealInput | TMix | Mixed air temperature |
input RealInput | TMixSet | Setpoint for mixed air temperature |
Modelica definition
block EconomizerTemperatureControl
extends Modelica.Blocks.Icons.Block;
import Buildings.Examples.VAVReheat.Controls.OperationModes;
Buildings.Controls.Continuous.LimPID con(
k=k,
Ti=Ti,
yMax=0.995,
yMin=0.005,
Td=60,
controllerType=Modelica.Blocks.Types.SimpleController.PI)
;
parameter Real k=1 ;
parameter Modelica.SIunits.Time Ti ;
Modelica.Blocks.Logical.Switch swi1;
Modelica.Blocks.Logical.Switch swi2;
Modelica.Blocks.Interfaces.RealOutput yOA
;
Modelica.Blocks.Interfaces.RealInput TRet ;
Modelica.Blocks.Interfaces.RealInput TOut ;
Modelica.Blocks.Interfaces.RealInput TMix ;
Modelica.Blocks.Interfaces.RealInput TMixSet
;
Modelica.Blocks.Logical.Hysteresis hysConGai(uLow=-0.1, uHigh=0.1)
;
Modelica.Blocks.Math.Feedback feedback;
equation
connect(swi1.y, con.u_s);
connect(swi2.y, con.u_m);
connect(con.y, yOA);
connect(swi1.u1, TMix);
connect(swi2.u3, TMix);
connect(swi1.u3, TMixSet);
connect(swi2.u1, TMixSet);
connect(feedback.u1, TRet);
connect(TOut, feedback.u2);
connect(feedback.y, hysConGai.u);
connect(hysConGai.y, swi2.u2);
connect(hysConGai.y, swi1.u2);
end EconomizerTemperatureControl;
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 |
Init | initType | Modelica.Blocks.Types.Init.N... | Type of initialization (1: no init, 2: steady state, 3/4: initial output) |
Real | y_start | 0 | Initial or guess value of output (= state) |
Setpoint tracking |
SimpleController | controllerType | .Modelica.Blocks.Types.Simpl... | Type of controller |
Real | k | 0.5 | Gain of controller |
Time | Ti | 15 | Time constant of integrator block [s] |
Connectors
Type | Name | Description |
input RealInput | u | Connector of Real input signal |
output RealOutput | y | Connector of Real output signal |
input RealInput | u_m | Connector of measurement input signal |
input BooleanInput | uFan | Set to true to enable the fan on |
Modelica definition
block FanVFD
extends Modelica.Blocks.Interfaces.SISO;
import Buildings.Examples.VAVReheat.Controls.OperationModes;
Buildings.Controls.Continuous.LimPID con(
yMax=1,
Td=60,
yMin=r_N_min,
k=k,
Ti=Ti,
controllerType=controllerType,
reset=Buildings.Types.Reset.Disabled)
;
Modelica.Blocks.Math.Gain gaiMea(k=1/xSet_nominal)
;
parameter Real xSet_nominal ;
Modelica.Blocks.Sources.Constant off(k=0) ;
Modelica.Blocks.Math.Gain gaiSet(k=1/xSet_nominal)
;
Modelica.Blocks.Interfaces.RealInput u_m
;
parameter Real r_N_min=0.01 ;
parameter Modelica.Blocks.Types.Init initType=Modelica.Blocks.Types.Init.NoInit
;
parameter Real y_start=0 ;
parameter Modelica.Blocks.Types.SimpleController
controllerType=.Modelica.Blocks.Types.SimpleController.PI
;
parameter Real k=0.5 ;
parameter Modelica.SIunits.Time Ti=15 ;
Buildings.Controls.OBC.CDL.Logical.Switch swi;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uFan
;
equation
connect(gaiMea.y, con.u_m);
connect(gaiSet.y, con.u_s);
connect(u_m, gaiMea.u);
connect(gaiSet.u, u);
connect(con.y, swi.u1);
connect(off.y, swi.u3);
connect(swi.u2, uFan);
connect(swi.y, y);
end FanVFD;
Mixed air temperature setpoint for economizer
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Connectors
Type | Name | Description |
input RealInput | TSupHeaSet | Supply temperature setpoint for heating |
input RealInput | TSupCooSet | Supply temperature setpoint for cooling |
ControlBus | controlBus | |
output RealOutput | TSet | Mixed air temperature setpoint |
Modelica definition
model MixedAirTemperatureSetpoint
extends Modelica.Blocks.Icons.Block;
Modelica.Blocks.Routing.Extractor TSetMix(
nin=6,
index(start=2, fixed=true)) ;
Modelica.Blocks.Sources.Constant off(k=273.15 + 13)
;
Buildings.Utilities.Math.Average ave(nin=2);
Modelica.Blocks.Interfaces.RealInput TSupHeaSet
;
Modelica.Blocks.Interfaces.RealInput TSupCooSet
;
Modelica.Blocks.Sources.Constant TPreCoo(k=273.15 + 13)
;
ControlBus controlBus;
Modelica.Blocks.Interfaces.RealOutput TSet ;
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;
Finite State Machine for the operational modes
Parameters
Type | Name | Default | Description |
TemperatureDifference | delTRooOnOff | 1 | Deadband in room temperature between occupied on and occupied off [K] |
Temperature | TRooSetHeaOcc | 293.15 | Set point for room air temperature during heating mode [K] |
Temperature | TRooSetCooOcc | 299.15 | Set point for room air temperature during cooling mode [K] |
Temperature | TSetHeaCoiOut | 303.15 | Set point for air outlet temperature at central heating coil [K] |
Connectors
Modelica definition
model ModeSelector
Modelica.StateGraph.InitialStep initialStep;
Modelica.StateGraph.Transition start ;
State unOccOff(
mode=Buildings.Examples.VAVReheat.Controls.OperationModes.unoccupiedOff,
nIn=3,
nOut=4) ;
State unOccNigSetBac(
nOut=2,
mode=Buildings.Examples.VAVReheat.Controls.OperationModes.unoccupiedNightSetBack,
nIn=1) ;
Modelica.StateGraph.Transition t2(
enableTimer=true,
waitTime=60,
condition=TRooMinErrHea.y > delTRooOnOff/2);
parameter Modelica.SIunits.TemperatureDifference delTRooOnOff(min=0.1)=1
;
parameter Modelica.SIunits.Temperature TRooSetHeaOcc=293.15
;
parameter Modelica.SIunits.Temperature TRooSetCooOcc=299.15
;
parameter Modelica.SIunits.Temperature TSetHeaCoiOut=303.15
;
Modelica.StateGraph.Transition t1(condition=delTRooOnOff/2 < -TRooMinErrHea.y,
enableTimer=true,
waitTime=30*60);
inner Modelica.StateGraph.StateGraphRoot stateGraphRoot;
ControlBus cb;
Modelica.Blocks.Routing.RealPassThrough TRooSetHea
;
State morWarUp(mode=Buildings.Examples.VAVReheat.Controls.OperationModes.unoccupiedWarmUp,
nIn=2,
nOut=1) ;
Modelica.StateGraph.TransitionWithSignal t6(enableTimer=true, waitTime=60);
Modelica.Blocks.Logical.LessEqualThreshold occThrSho(threshold=1800)
;
Modelica.StateGraph.TransitionWithSignal t5;
State occ( mode=Buildings.Examples.VAVReheat.Controls.OperationModes.occupied,
nIn=3)
;
Modelica.Blocks.Routing.RealPassThrough TRooMin;
Modelica.Blocks.Math.Feedback TRooMinErrHea ;
Modelica.StateGraph.Transition t3(condition=TRooMin.y + delTRooOnOff/2 >
TRooSetHeaOcc
or occupied.y);
Modelica.Blocks.Routing.BooleanPassThrough occupied
;
Modelica.StateGraph.TransitionWithSignal t4(enableTimer=false);
State morPreCoo( nIn=2,
mode=Buildings.Examples.VAVReheat.Controls.OperationModes.unoccupiedPreCool,
nOut=1) ;
Modelica.StateGraph.Transition t7(condition=TRooMin.y - delTRooOnOff/2 <
TRooSetCooOcc
or occupied.y);
Modelica.Blocks.Logical.And and1;
Modelica.Blocks.Routing.RealPassThrough TRooAve ;
Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=TRooAve.y <
TRooSetCooOcc);
PreCoolingStarter preCooSta(TRooSetCooOcc=TRooSetCooOcc)
;
Modelica.StateGraph.TransitionWithSignal t9;
Modelica.Blocks.Logical.Not not1;
Modelica.Blocks.Logical.And and2;
Modelica.Blocks.Logical.Not not2;
Modelica.StateGraph.TransitionWithSignal t8
;
Modelica.Blocks.MathInteger.Sum sum(nu=5);
Modelica.Blocks.Interfaces.BooleanOutput yFan
;
Modelica.Blocks.MathBoolean.Or or1(nu=4);
equation
connect(start.outPort, unOccOff.inPort[1]);
connect(initialStep.outPort[1], start.inPort);
connect(unOccOff.outPort[1], t2.inPort);
connect(t2.outPort, unOccNigSetBac.inPort[1]);
connect(unOccNigSetBac.outPort[1], t1.inPort);
connect(t1.outPort, unOccOff.inPort[2]);
connect(cb.dTNexOcc, occThrSho.u);
connect(t6.outPort, morWarUp.inPort[1]);
connect(t5.outPort, morWarUp.inPort[2]);
connect(unOccNigSetBac.outPort[2], t5.inPort);
connect(cb.TRooMin, TRooMin.u);
connect(TRooSetHea.y, TRooMinErrHea.u1);
connect(TRooMin.y, TRooMinErrHea.u2);
connect(unOccOff.outPort[2], t6.inPort);
connect(morWarUp.outPort[1], t3.inPort);
connect(cb.occupied, occupied.u);
connect(occ.outPort[1], t4.inPort);
connect(t4.outPort, unOccOff.inPort[3]);
connect(occThrSho.y, and1.u1);
connect(and1.y, t6.condition);
connect(and1.y, t5.condition);
connect(cb.TRooAve, TRooAve.u);
connect(booleanExpression.y, and1.u2);
connect(preCooSta.y, t9.condition);
connect(t9.outPort, morPreCoo.inPort[1]);
connect(unOccOff.outPort[3], t9.inPort);
connect(cb, preCooSta.controlBus);
connect(morPreCoo.outPort[1], t7.inPort);
connect(t7.outPort, occ.inPort[2]);
connect(t3.outPort, occ.inPort[1]);
connect(occThrSho.y, not1.u);
connect(not1.y, and2.u2);
connect(and2.y, t4.condition);
connect(occupied.y, not2.u);
connect(not2.y, and2.u1);
connect(cb.TRooSetHea, TRooSetHea.u);
connect(t8.outPort, occ.inPort[3]);
connect(unOccOff.outPort[4], t8.inPort);
connect(occupied.y, t8.condition);
connect(morPreCoo.y, sum.u[1]);
connect(morWarUp.y, sum.u[2]);
connect(occ.y, sum.u[3]);
connect(unOccOff.y, sum.u[4]);
connect(unOccNigSetBac.y, sum.u[5]);
connect(sum.y, cb.controlMode);
connect(yFan, or1.y);
connect(unOccNigSetBac.active, or1.u[1]);
connect(occ.active, or1.u[2]);
connect(morWarUp.active, or1.u[3]);
connect(morPreCoo.active, or1.u[4]);
end ModeSelector;
Outputs true when precooling should start
Information
Extends from Modelica.Blocks.Interfaces.BooleanSignalSource (Base class for Boolean signal sources).
Parameters
Type | Name | Default | Description |
Temperature | TOutLim | 286.15 | Limit for activating precooling [K] |
Temperature | TRooSetCooOcc | | Set point for room air temperature during cooling mode [K] |
Connectors
Modelica definition
Set point scheduler for room temperature
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
Temperature | THeaOn | 293.15 | Heating setpoint during on [K] |
Temperature | THeaOff | 285.15 | Heating setpoint during off [K] |
Temperature | TCooOn | 297.15 | Cooling setpoint during on [K] |
Temperature | TCooOff | 303.15 | Cooling setpoint during off [K] |
Connectors
Modelica definition
Controller for room VAV box
Information
Controller for terminal box of VAV system with reheat.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Connectors
Type | Name | Description |
input RealInput | TRooHeaSet | Setpoint temperature for room for heating [K] |
input RealInput | TRooCooSet | Setpoint temperature for room for cooling [K] |
input RealInput | TRoo | Measured room temperature [K] |
input RealInput | TDis | Measured supply air temperature after heating coil [K] |
output RealOutput | yVal | Signal for heating coil valve |
output RealOutput | yDam | Signal for VAV damper |
Modelica definition
block RoomVAV
extends Modelica.Blocks.Icons.Block;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TRooHeaSet(
final quantity="ThermodynamicTemperature",
final unit = "K",
displayUnit = "degC",
min=0)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TRooCooSet(
final quantity="ThermodynamicTemperature",
final unit = "K",
displayUnit = "degC",
min=0)
;
Modelica.Blocks.Interfaces.RealInput TRoo(
final quantity="ThermodynamicTemperature",
final unit = "K",
displayUnit = "degC",
min=0)
;
Modelica.Blocks.Interfaces.RealInput TDis(
final quantity="ThermodynamicTemperature",
final unit = "K",
displayUnit = "degC",
min=0)
;
Modelica.Blocks.Interfaces.RealOutput yVal ;
Modelica.Blocks.Interfaces.RealOutput yDam ;
Buildings.Controls.OBC.CDL.Continuous.LimPID conHea(
yMax=1,
xi_start=0.1,
Td=60,
yMin=0,
k=0.1,
Ti=120,
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI)
;
Buildings.Controls.Continuous.LimPID conCoo(
yMax=1,
Td=60,
k=0.1,
Ti=120,
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI,
reverseAction=true)
;
protected
parameter Real kDamHea = 0.5
;
Buildings.Controls.OBC.CDL.Continuous.Max maxDam
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one(k=1);
Buildings.Controls.OBC.CDL.Continuous.Add add
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zero(k=0.1);
Buildings.Controls.OBC.CDL.Continuous.Min minDam
;
Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum(
final k={1,kDamHea,-kDamHea},
nin=3);
equation
connect(conHea.u_m, TRoo);
connect(conCoo.u_m, TRoo);
connect(conCoo.y, add.u2);
connect(conHea.y,yVal);
connect(zero.y, maxDam.u1);
connect(maxDam.y, add.u1);
connect(add.y, minDam.u1);
connect(one.y, minDam.u2);
connect(minDam.y, yDam);
connect(one.y, mulSum.u[1]);
connect(TDis, mulSum.u[2]);
connect(TRoo, mulSum.u[3]);
connect(maxDam.u2, mulSum.y);
connect(conHea.u_s, TRooHeaSet);
connect(TRooCooSet, conCoo.u_s);
end RoomVAV;
Block that outputs the mode if the state is active, or zero otherwise
Information
Extends from Modelica.StateGraph.StepWithSignal (Ordinary step (= step that is not active when simulation starts). Connector 'active' is true when the step is active).
Parameters
Type | Name | Default | Description |
Integer | nIn | 1 | Number of input connections |
Integer | nOut | 1 | Number of output connections |
OperationModes | mode | | Enter enumeration of mode |
Connectors
Modelica definition