Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1859 from lbl-srg/issue1853_limPartype
Issue1853 lim partype
  • Loading branch information
mwetter committed Apr 3, 2020
2 parents dad55ed + 25f3e25 commit b91cbd7
Show file tree
Hide file tree
Showing 49 changed files with 1,578 additions and 883 deletions.
329 changes: 198 additions & 131 deletions Buildings/Controls/OBC/ASHRAE/G36_PR1/AHUs/MultiZone/VAV/Controller.mo

Large diffs are not rendered by default.

Expand Up @@ -7,18 +7,27 @@ block Controller "Multi zone VAV AHU economizer control sequence"
"Set to true if mixed air temperature measurement is enabled";
parameter Boolean use_G36FrePro=false
"Set to true to use G36 freeze protection";
parameter Modelica.SIunits.TemperatureDifference delTOutHis=1
parameter Real delTOutHis(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=1
"Delta between the temperature hysteresis high and low limit"
annotation (Evaluate=true, Dialog(tab="Advanced", group="Hysteresis"));
parameter Modelica.SIunits.SpecificEnergy delEntHis=1000
annotation (Dialog(tab="Advanced", group="Hysteresis"));
parameter Real delEntHis(
final unit="J/kg",
final quantity="SpecificEnergy")=1000
"Delta between the enthalpy hysteresis high and low limits"
annotation (Evaluate=true, Dialog(tab="Advanced",group="Hysteresis",enable=use_enthalpy));
parameter Modelica.SIunits.Time retDamFulOpeTim=180
annotation (Dialog(tab="Advanced",group="Hysteresis",enable=use_enthalpy));
parameter Real retDamFulOpeTim(
final unit="s",
final quantity="Time")=180
"Time period to keep RA damper fully open before releasing it for minimum outdoor airflow control at disable to avoid pressure fluctuations"
annotation (Evaluate=true, Dialog(tab="Advanced", group="Delays at disable"));
parameter Modelica.SIunits.Time disDel=15
annotation (Dialog(tab="Advanced", group="Delays at disable"));
parameter Real disDel(
final unit="s",
final quantity="Time")=15
"Short time delay before closing the OA damper at disable to avoid pressure fluctuations"
annotation (Evaluate=true, Dialog(tab="Advanced", group="Delays at disable"));
annotation (Dialog(tab="Advanced", group="Delays at disable"));

parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeMinOut=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
Expand All @@ -27,12 +36,16 @@ block Controller "Multi zone VAV AHU economizer control sequence"
parameter Real kMinOut(final unit="1")=0.05
"Gain of controller for minimum outdoor air"
annotation (Dialog(group="Minimum outdoor air"));
parameter Modelica.SIunits.Time TiMinOut=1200
parameter Real TiMinOut(
final unit="s",
final quantity="Time")=1200
"Time constant of controller for minimum outdoor air intake"
annotation (Dialog(group="Minimum outdoor air",
enable=controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Modelica.SIunits.Time TdMinOut=0.1
parameter Real TdMinOut(
final unit="s",
final quantity="Time")=0.1
"Time constant of derivative block for minimum outdoor air intake"
annotation (Dialog(group="Minimum outdoor air",
enable=controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
Expand All @@ -43,85 +56,95 @@ block Controller "Multi zone VAV AHU economizer control sequence"
"Type of controller"
annotation(Dialog(group="Freeze protection", enable=use_TMix));

parameter Modelica.SIunits.Temperature TFreSet = 279.15
parameter Real TFreSet(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")= 279.15
"Lower limit for mixed air temperature for freeze protection, used if use_TMix=true"
annotation(Dialog(group="Freeze protection", enable=use_TMix));
parameter Real kFre(final unit="1/K") = 0.1
"Gain for mixed air temperature tracking for freeze protection, used if use_TMix=true"
annotation(Dialog(group="Freeze protection", enable=use_TMix));

parameter Modelica.SIunits.Time TiFre(max=TiMinOut)=120
parameter Real TiFre(
final unit="s",
final quantity="Time",
final max=TiMinOut)=120
"Time constant of controller for mixed air temperature tracking for freeze protection. Require TiFre < TiMinOut"
annotation(Dialog(group="Freeze protection",
enable=use_TMix
and (controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PID)));

parameter Modelica.SIunits.Time TdFre=0.1
"Time constant of derivative block for freeze protection"
annotation (Dialog(group="Economizer freeze protection",
enable=use_TMix and
(controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PID)));
parameter Real TdFre(
final unit="s",
final quantity="Time")=0.1
"Time constant of derivative block for freeze protection"
annotation (Dialog(group="Economizer freeze protection",
enable=use_TMix and
(controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PID)));

parameter Modelica.SIunits.Time delta=5
parameter Real delta(
final unit="s",
final quantity="Time")=5
"Time horizon over which the outdoor air flow measurment is averaged";
parameter Real uHeaMax=-0.25
"Lower limit of controller input when outdoor damper opens for modulation control. Require -1 < uHeaMax < uCooMin < 1."
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uCooMin=+0.25
"Upper limit of controller input when return damper is closed for modulation control. Require -1 < uHeaMax < uCooMin < 1."
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));

parameter Real uOutDamMax(
final min=-1,
final max=1,
final unit="1") = (uHeaMax + uCooMin)/2
"Maximum loop signal for the OA damper to be fully open. Require -1 < uHeaMax < uOutDamMax <= uRetDamMin < uCooMin < 1."
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uRetDamMin(
final min=-1,
final max=1,
final unit="1") = (uHeaMax + uCooMin)/2
"Minimum loop signal for the RA damper to be fully open. Require -1 < uHeaMax < uOutDamMax <= uRetDamMin < uCooMin < 1."
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));

parameter Real retDamPhyPosMax(
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the return air damper"
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real retDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the return air damper"
annotation (Evaluate=true,
Dialog(tab="Commissioning", group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real outDamPhyPosMax(
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the outdoor air damper"
annotation (Evaluate=true, Dialog(tab="Commissioning",
group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real outDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the outdoor air damper" annotation (
Evaluate=true, Dialog(tab="Commissioning", group="Physical damper position limits"));
"Physically fixed minimum position of the outdoor air damper"
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));

Buildings.Controls.OBC.CDL.Interfaces.RealInput uTSup(final unit="1")
"Signal for supply air temperature control (T Sup Control Loop Signal in diagram)"
annotation (Placement(transformation(extent={{-200,20},{-160,60}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature") "Outdoor air (OA) temperature"
annotation (Placement(transformation(extent={{-200,130},{-160,170}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOutCut(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"OA temperature high limit cutoff. For differential dry bulb temeprature condition use return air temperature measurement"
annotation (Placement(transformation(extent={{-200,100},{-160,140}})));
Expand All @@ -136,6 +159,7 @@ block Controller "Multi zone VAV AHU economizer control sequence"
annotation (Placement(transformation(extent={{-200,50},{-160,90}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TMix(
final unit="K",
final displayUnit="degC",
final quantity = "ThermodynamicTemperature") if use_TMix
"Measured mixed air temperature, used for freeze protection"
annotation (Placement(transformation(extent={{-200,-70},{-160,-30}})));
Expand Down Expand Up @@ -286,12 +310,13 @@ equation
annotation (Line(points={{118,46},{98,46}}, color={0,0,127}));
connect(TMix, freProTMix.TMix)
annotation (Line(points={{-180,-50},{-120,-50},{-120,-60},{60,-60},{60,-10},
{79,-10}},
{78,-10}},
color={0,0,127}));
connect(freProTMix.yFrePro, retDamMinFre.u1)
annotation (Line(points={{101,-4},{104,-4},{104,46},{118,46}}, color={0,0,127}));
annotation (Line(points={{102,-13},{104,-13},{104,46},{118,46}},
color={0,0,127}));
connect(freProTMix.yFreProInv, outDamMaxFre.u2)
annotation (Line(points={{101,-16},{104,-16},{104,-46},{118,-46}},
annotation (Line(points={{102,-7},{104,-7},{104,-46},{118,-46}},
color={0,0,127}));
connect(freProSta.y, damLim.uFreProSta)
annotation (Line(points={{-118,-130},{-90,-130},{-90,6},{-82,6}}, color={255,127,0}));
Expand Down
Expand Up @@ -5,22 +5,32 @@ block Enable
parameter Boolean use_enthalpy = true
"Set to true to evaluate outdoor air enthalpy in addition to temperature"
annotation(Dialog(group="Conditional"));
parameter Modelica.SIunits.TemperatureDifference delTOutHis=1
parameter Real delTOutHis(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=1
"Delta between the temperature hysteresis high and low limit"
annotation(Evaluate=true, Dialog(tab="Advanced", group="Hysteresis"));
parameter Modelica.SIunits.SpecificEnergy delEntHis=1000
annotation(Dialog(tab="Advanced", group="Hysteresis"));
parameter Real delEntHis(
final unit="J/kg",
final quantity="SpecificEnergy")=1000
"Delta between the enthalpy hysteresis high and low limits"
annotation(Evaluate=true, Dialog(tab="Advanced", group="Hysteresis", enable = use_enthalpy));
parameter Modelica.SIunits.Time retDamFulOpeTim=180
annotation(Dialog(tab="Advanced", group="Hysteresis", enable = use_enthalpy));
parameter Real retDamFulOpeTim(
final unit="s",
final quantity="Time")=180
"Time period to keep RA damper fully open before releasing it for minimum outdoor airflow control
at disable to avoid pressure fluctuations"
annotation(Evaluate=true, Dialog(tab="Advanced", group="Delays at disable"));
parameter Modelica.SIunits.Time disDel=15
annotation(Dialog(tab="Advanced", group="Delays at disable"));
parameter Real disDel(
final unit="s",
final quantity="Time")=15
"Short time delay before closing the OA damper at disable to avoid pressure fluctuations"
annotation(Evaluate=true, Dialog(tab="Advanced", group="Delays at disable"));
annotation(Dialog(tab="Advanced", group="Delays at disable"));

Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut(
final unit="K",
final displayUnit="degC",
final quantity = "ThermodynamicTemperature")
"Outdoor air temperature"
annotation (Placement(transformation(extent={{-320,250},{-280,290}}),
Expand All @@ -33,6 +43,7 @@ block Enable
iconTransformation(extent={{-140,40},{-100,80}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOutCut(
final unit="K",
final displayUnit="degC",
final quantity = "ThermodynamicTemperature")
"OA temperature high limit cutoff. For differential dry bulb temeprature condition use return air temperature measurement"
annotation (Placement(transformation(extent={{-320,210},{-280,250}}),
Expand Down Expand Up @@ -109,15 +120,21 @@ block Enable
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
trueHoldDuration=600) "10 min on/off delay"
annotation (Placement(transformation(extent={{0,200},{20,220}})));
CDL.Logical.And andEnaDis "Logical and that checks freeze protection stage and zone state"
Buildings.Controls.OBC.CDL.Logical.And andEnaDis
"Logical and that checks freeze protection stage and zone state"
annotation (Placement(transformation(extent={{40,30},{60,50}})));

protected
final parameter Modelica.SIunits.TemperatureDifference TOutHigLimCutHig = 0
final parameter Real TOutHigLimCutHig(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")= 0
"Hysteresis high limit cutoff";
final parameter Real TOutHigLimCutLow = TOutHigLimCutHig - delTOutHis
"Hysteresis low limit cutoff";
final parameter Modelica.SIunits.SpecificEnergy hOutHigLimCutHig = 0
final parameter Real hOutHigLimCutHig(
final unit="J/kg",
final quantity="SpecificEnergy")= 0
"Hysteresis block high limit cutoff";
final parameter Real hOutHigLimCutLow = hOutHigLimCutHig - delEntHis
"Hysteresis block low limit cutoff";
Expand Down
Expand Up @@ -3,15 +3,15 @@ block Limits
"Multi zone VAV AHU minimum outdoor air control - damper position limits"

constant Real yMin=-1 "Lower limit of control loop signal"
annotation (Evaluate=true,Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
constant Real yMax=1 "Upper limit of control loop signal"
annotation (Evaluate=true,Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uRetDamMin(
final min=yMin,
final max=yMax,
final unit="1") = 0.5
"Minimum control signal for the return air damper position limit"
annotation (Evaluate=true,Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));

parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
Expand All @@ -22,13 +22,17 @@ block Limits
final unit="1")=0.05 "Gain of damper limit controller"
annotation (Dialog(group="Controller"));

parameter Modelica.SIunits.Time Ti=1200
parameter Real Ti(
final unit="s",
final quantity="Time")=1200
"Time constant of damper limit controller integrator block"
annotation (Dialog(group="Controller",
enable=controllerType == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerType == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));

parameter Modelica.SIunits.Time Td=0.1
parameter Real Td(
final unit="s",
final quantity="Time")=0.1
"Time constant of damper limit controller derivative block"
annotation (Dialog(group="Controller",
enable=controllerType == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
Expand All @@ -38,29 +42,25 @@ block Limits
final min=0,
final max=1,
final unit="1") = 1 "Physically fixed maximum position of the return air damper"
annotation (Evaluate=true, Dialog(tab="Commissioning",
group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real retDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the return air damper"
annotation (Evaluate=true, Dialog(tab="Commissioning",
group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real outDamPhyPosMax(
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the outdoor air damper"
annotation (Evaluate=true,
Dialog(tab="Commissioning", group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real outDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the outdoor air damper"
annotation (Evaluate=true,
Dialog(tab="Commissioning", group="Physical damper position limits"));
annotation (Dialog(tab="Commissioning", group="Physical damper position limits"));

Buildings.Controls.OBC.CDL.Interfaces.RealInput VOut_flow_normalized(
final unit="1")
Expand Down
Expand Up @@ -6,25 +6,27 @@ block Modulation
final max=0,
final unit="1")=-0.25
"Lower limit of controller input when outdoor damper opens (see diagram)"
annotation (Evaluate=true,Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uMax(
final min=0,
final unit="1")=+0.25
"Upper limit of controller input when return damper is closed (see diagram)"
annotation (Evaluate=true,Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uOutDamMax(
final min=-1,
final max=1,
final unit="1") = (uMin + uMax)/2
"Maximum loop signal for the OA damper to be fully open"
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real uRetDamMin(
final min=-1,
final max=1,
final unit="1") = (uMin + uMax)/2
"Minimum loop signal for the RA damper to be fully open"
annotation (Evaluate=true, Dialog(tab="Commissioning", group="Controller"));
parameter Modelica.SIunits.Time samplePeriod = 300
annotation (Dialog(tab="Commissioning", group="Controller"));
parameter Real samplePeriod(
final unit="s",
final quantity="Time")= 300
"Sample period of component, used to limit the rate of change of the dampers (to avoid quick opening that can result in frost)";

Buildings.Controls.OBC.CDL.Interfaces.RealInput uTSup(final unit="1")
Expand Down

0 comments on commit b91cbd7

Please sign in to comment.