Skip to content

Commit

Permalink
merged master and updated the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JayHuLBL committed Jan 5, 2024
1 parent f32752e commit 975d2fe
Show file tree
Hide file tree
Showing 60 changed files with 266 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected
annotation (Placement(transformation(extent={{-100,-80},{-80,-60}})));

Buildings.Controls.OBC.CDL.Logical.Not not2 "Logical not"
annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
annotation (Placement(transformation(extent={{-40,-60},{-20,-40}})));

Buildings.Controls.OBC.CDL.Logical.And disPla
"Disable chiller plant"
Expand All @@ -110,9 +110,9 @@ protected
"Check if outdoor temperature is lower than chiller lockout temperature"
annotation (Placement(transformation(extent={{-100,-140},{-80,-120}})));

Buildings.Controls.OBC.CDL.Logical.Or3 disPlaCon
Buildings.Controls.OBC.CDL.Logical.Or disPlaCon
"Disable chiller plant conditions"
annotation (Placement(transformation(extent={{40,-88},{60,-68}})));
annotation (Placement(transformation(extent={{60,-88},{80,-68}})));

Buildings.Controls.OBC.CDL.Logical.Not not3 "Logical not"
annotation (Placement(transformation(extent={{-140,-80},{-120,-60}})));
Expand All @@ -133,6 +133,10 @@ protected
"Difference between chiller lockout temperature and outdoor temperature"
annotation (Placement(transformation(extent={{-140,-140},{-120,-120}})));

Buildings.Controls.OBC.CDL.Logical.Or or1
"Disable chiller plant conditions"
annotation (Placement(transformation(extent={{-20,-110},{0,-90}})));

equation
connect(enaSch.y[1], schOn.u)
annotation (Line(points={{-118,50},{-102,50}}, color={0,0,127}));
Expand All @@ -150,17 +154,16 @@ equation
annotation (Line(points={{-78,50},{0,50},{0,80.875},{38,80.875}},
color={255,0,255}));
connect(schOn.y, not2.u)
annotation (Line(points={{-78,50},{-40,50},{-40,-50},{-22,-50}},
annotation (Line(points={{-78,50},{-50,50},{-50,-50},{-42,-50}},
color={255,0,255}));
connect(enaPla.y, plaSta.u)
annotation (Line(points={{62,80},{138,80}},color={255,0,255}));
connect(plaSta.y, yPla)
annotation (Line(points={{162,80},{210,80}}, color={255,0,255}));
connect(disPlaCon.y, disPla.u2) annotation (Line(points={{62,-78},{80,-78},{
80,-26},{98,-26}}, color={255,0,255}));
connect(not2.y, disPlaCon.u1) annotation (Line(points={{2,-50},{20,-50},{20,
-70},{38,-70}},
color={255,0,255}));
connect(disPlaCon.y, disPla.u2) annotation (Line(points={{82,-78},{90,-78},{90,
-26},{98,-26}}, color={255,0,255}));
connect(not2.y, disPlaCon.u1) annotation (Line(points={{-18,-50},{20,-50},{20,
-78},{58,-78}}, color={255,0,255}));
connect(hasReq.y, not3.u)
annotation (Line(points={{-118,90},{-20,90},{-20,70},{-180,70},{-180,-70},{-142,
-70}}, color={255,0,255}));
Expand All @@ -181,21 +184,20 @@ equation
color={0,0,127}));
connect(sub1.y, hys.u)
annotation (Line(points={{-118,-130},{-102,-130}}, color={0,0,127}));
connect(hys.y, disPlaCon.u3) annotation (Line(points={{-78,-130},{-60,-130},{
-60,-86},{38,-86}},
color={255,0,255}));
connect(hys.y, notLoc.u) annotation (Line(points={{-78,-130},{-60,-130},{-60,10},
{-22,10}}, color={255,0,255}));
connect(notLoc.y, enaPla.u[4]) annotation (Line(points={{2,10},{20,10},{20,82.625},
{38,82.625}},color={255,0,255}));
connect(disPla.y, plaSta.clr) annotation (Line(points={{122,-18},{130,-18},{
130,74},{138,74}},
color={255,0,255}));
connect(enaTim1.passed, disPlaCon.u2) annotation (Line(points={{-78,-78},{38,
-78}}, color={255,0,255}));
130,74},{138,74}}, color={255,0,255}));
connect(enaTim.passed, disPla.u1) annotation (Line(points={{-118,-18},{98,-18}},
color={255,0,255}));

color={255,0,255}));
connect(enaTim1.passed, or1.u1) annotation (Line(points={{-78,-78},{-40,-78},{
-40,-100},{-22,-100}}, color={255,0,255}));
connect(hys.y, or1.u2) annotation (Line(points={{-78,-130},{-60,-130},{-60,-108},
{-22,-108}}, color={255,0,255}));
connect(or1.y, disPlaCon.u2) annotation (Line(points={{2,-100},{20,-100},{20,-86},
{58,-86}}, color={255,0,255}));
annotation (
defaultComponentName = "plaEna",
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-180},{200,180}})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,20 @@ protected
annotation (Placement(transformation(extent={{-100,290},{-80,310}})));
Buildings.Controls.OBC.CDL.Logical.Switch logSwi1 "Logical switch"
annotation (Placement(transformation(extent={{-40,230},{-20,250}})));
Buildings.Controls.OBC.CDL.Reals.Sources.ModelTime modTim
"Simulation time"
annotation (Placement(transformation(extent={{-200,220},{-180,240}})));
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(final t=1)
"Check if it has passed initial time"
annotation (Placement(transformation(extent={{-140,220},{-120,240}})));
Buildings.Controls.OBC.CDL.Integers.Equal intEqu
"Check if the stage setpoint is zero"
annotation (Placement(transformation(extent={{-140,270},{-120,290}})));
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt(
final k=0) "Constant zero"
annotation (Placement(transformation(extent={{-220,290},{-200,310}})));

Buildings.Controls.OBC.CDL.Logical.Sources.Constant con2(final k=true)
"Constant true"
annotation (Placement(transformation(extent={{-200,220},{-180,240}})));
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel(
final delayTime=1,
final delayOnInit=true)
"Check if it has passed initial time"
annotation (Placement(transformation(extent={{-140,220},{-120,240}})));
equation
connect(lat.y,chiDemRed.uDemLim)
annotation (Line(points={{-118,150},{-100,150},{-100,129},{-82,129}},
Expand Down Expand Up @@ -605,8 +606,6 @@ equation
{10,88},{58,88}}, color={255,0,255}));
connect(or2.y, minChiWatFlo.uUpsDevSta) annotation (Line(points={{2,150},{10,150},
{10,47},{18,47}}, color={255,0,255}));
connect(modTim.y, greThr.u)
annotation (Line(points={{-178,230},{-142,230}}, color={0,0,127}));
connect(intEqu.y, and1.u2) annotation (Line(points={{-118,280},{-110,280},{-110,
292},{-102,292}}, color={255,0,255}));
connect(conInt.y, intEqu.u1) annotation (Line(points={{-198,300},{-180,300},{-180,
Expand All @@ -615,8 +614,6 @@ equation
272},{-142,272}}, color={255,127,0}));
connect(cha.up, and1.u1) annotation (Line(points={{-178,156},{-170,156},{-170,
300},{-102,300}}, color={255,0,255}));
connect(greThr.y, logSwi1.u2) annotation (Line(points={{-118,230},{-80,230},{-80,
240},{-42,240}}, color={255,0,255}));
connect(and1.y, logSwi1.u3) annotation (Line(points={{-78,300},{-60,300},{-60,
232},{-42,232}}, color={255,0,255}));
connect(cha.up, logSwi1.u1) annotation (Line(points={{-178,156},{-170,156},{-170,
Expand All @@ -632,6 +629,10 @@ equation
connect(endUp.endStaTri, nexChi.endPro) annotation (Line(points={{42,-279},{
60,-279},{60,-300},{-160,-300},{-160,163},{-82,163}}, color={255,0,
255}));
connect(con2.y, truDel.u)
annotation (Line(points={{-178,230},{-142,230}}, color={255,0,255}));
connect(truDel.y, logSwi1.u2) annotation (Line(points={{-118,230},{-80,230},{
-80,240},{-42,240}}, color={255,0,255}));
annotation (
defaultComponentName="upProCon",
Diagram(coordinateSystem(preserveAspectRatio=false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ protected
annotation (Placement(transformation(extent={{280,-140},{300,-120}})));
Buildings.Controls.OBC.CDL.Logical.Switch logSwi1 "Logical switch"
annotation (Placement(transformation(extent={{380,-132},{400,-112}})));
Buildings.Controls.OBC.CDL.Reals.Sources.ModelTime modTim
"Simulation time"
annotation (Placement(transformation(extent={{182,-220},{202,-200}})));
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(final t=1)
"Check if it has passed initial time"
annotation (Placement(transformation(extent={{240,-220},{260,-200}})));
Buildings.Controls.OBC.CDL.Logical.And and7 "Logical and"
annotation (Placement(transformation(extent={{280,-100},{300,-80}})));
Buildings.Controls.OBC.CDL.Logical.And and8 "Logical and"
Expand All @@ -229,7 +223,14 @@ protected
Buildings.Controls.OBC.CDL.Logical.And and9
"Logical and"
annotation (Placement(transformation(extent={{-220,-90},{-200,-70}})));

Buildings.Controls.OBC.CDL.Logical.Sources.Constant con2(final k=true)
"Constant true"
annotation (Placement(transformation(extent={{180,-220},{200,-200}})));
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel(
final delayTime=1,
final delayOnInit=true)
"Check if it has passed initial time"
annotation (Placement(transformation(extent={{240,-220},{260,-200}})));
equation
connect(switch1.y,triSam. u)
annotation (Line(points={{-218,70},{108,70}}, color={0,0,127}));
Expand Down Expand Up @@ -258,8 +259,7 @@ equation
connect(triSam1.u,booToRea. y)
annotation (Line(points={{178,10},{82,10}}, color={0,0,127}));
connect(edg.y,lat1. u) annotation (Line(points={{-358,170},{-340,170},{-340,
200},{98,200}},
color={255,0,255}));
200},{98,200}}, color={255,0,255}));
connect(switch2.y,reaToInt. u)
annotation (Line(points={{182,200},{198,200}}, color={0,0,127}));
connect(and3.y,lat1. clr) annotation (Line(points={{62,120},{80,120},{80,194},
Expand All @@ -277,8 +277,7 @@ equation
connect(uAvaDow, intToRea.u)
annotation (Line(points={{-460,30},{-322,30}}, color={255,127,0}));
connect(holIniSta.y, not3.u) annotation (Line(points={{-298,170},{-280,170},{
-280,-60},{-262,-60}},
color={255,0,255}));
-280,-60},{-262,-60}}, color={255,0,255}));
connect(and6.y, and1.u1) annotation (Line(points={{-158,-80},{-150,-80},{-150,
-190},{-142,-190}}, color={255,0,255}));
connect(and6.y, edg1.u)
Expand All @@ -288,16 +287,15 @@ equation
connect(uPla, falEdg.u) annotation (Line(points={{-460,170},{-420,170},{-420,
-20},{-82,-20}}, color={255,0,255}));
connect(falEdg.y, or3.u1) annotation (Line(points={{-58,-20},{140,-20},{140,-50},
{158,-50}}, color={255,0,255}));
{158,-50}}, color={255,0,255}));
connect(uPla, edg.u)
annotation (Line(points={{-460,170},{-382,170}}, color={255,0,255}));
connect(and3.u1, and6.y) annotation (Line(points={{38,120},{-150,120},{-150,
-80},{-158,-80}},
color={255,0,255}));
-80},{-158,-80}}, color={255,0,255}));
connect(lat1.y, switch2.u2) annotation (Line(points={{122,200},{158,200}},
color={255,0,255}));
connect(or1.y, staChaHol2.u) annotation (Line(points={{62,-50},{78,-50}},
color={255,0,255}));
color={255,0,255}));
connect(staChaHol2.y, triSam.trigger) annotation (Line(points={{102,-50},{120,
-50},{120,58}}, color={255,0,255}));
connect(edg1.y, or1.u1) annotation (Line(points={{-58,-80},{0,-80},{0,-50},{38,
Expand All @@ -315,33 +313,25 @@ equation
connect(not2.y, and4.u2) annotation (Line(points={{-358,50},{-340,50},{-340,62},
{-322,62}}, color={255,0,255}));
connect(and4.y, switch1.u2) annotation (Line(points={{-298,70},{-242,70}},
color={255,0,255}));
color={255,0,255}));
connect(conInt.y,intEqu. u1) annotation (Line(points={{202,-160},{238,-160}},
color={255,127,0}));
color={255,127,0}));
connect(intEqu.y,and5. u2) annotation (Line(points={{262,-160},{270,-160},{
270,-138},{278,-138}},
color={255,0,255}));
270,-138},{278,-138}}, color={255,0,255}));
connect(and5.y,logSwi1. u3) annotation (Line(points={{302,-130},{378,-130}},
color={255,0,255}));
connect(modTim.y,greThr. u)
annotation (Line(points={{204,-210},{238,-210}}, color={0,0,127}));
connect(greThr.y,logSwi1. u2) annotation (Line(points={{262,-210},{340,-210},
{340,-122},{378,-122}},
color={255,0,255}));
color={255,0,255}));
connect(edg2.y, and2.u2) annotation (Line(points={{-18,-170},{-10,-170},{-10,-138},
{-2,-138}}, color={255,0,255}));
connect(and6.y, and2.u1) annotation (Line(points={{-158,-80},{-150,-80},{-150,
-130},{-2,-130}}, color={255,0,255}));
connect(and7.y, logSwi2.u3) annotation (Line(points={{302,-90},{378,-90}},
color={255,0,255}));
color={255,0,255}));
connect(and8.y, logSwi3.u3) annotation (Line(points={{302,-50},{378,-50}},
color={255,0,255}));
color={255,0,255}));
connect(intEqu.y, and7.u2) annotation (Line(points={{262,-160},{270,-160},{
270,-98},{278,-98}},
color={255,0,255}));
270,-98},{278,-98}}, color={255,0,255}));
connect(intEqu.y, and8.u2) annotation (Line(points={{262,-160},{270,-160},{
270,-58},{278,-58}},
color={255,0,255}));
270,-58},{278,-58}}, color={255,0,255}));
connect(or3.y, triSam1.trigger) annotation (Line(points={{182,-50},{190,-50},{
190,-2}}, color={255,0,255}));
connect(triSam1.y, greThr1.u) annotation (Line(points={{202,10},{210,10},{210,
Expand All @@ -357,14 +347,9 @@ equation
connect(cha.up, logSwi3.u1) annotation (Line(points={{322,106},{370,106},{370,
-34},{378,-34}}, color={255,0,255}));
connect(cha.y, logSwi2.u1) annotation (Line(points={{322,100},{360,100},{360,
-74},{378,-74}},
color={255,0,255}));
-74},{378,-74}}, color={255,0,255}));
connect(cha.down, logSwi1.u1) annotation (Line(points={{322,94},{350,94},{350,
-114},{378,-114}}, color={255,0,255}));
connect(greThr.y, logSwi2.u2) annotation (Line(points={{262,-210},{340,-210},
{340,-82},{378,-82}}, color={255,0,255}));
connect(greThr.y, logSwi3.u2) annotation (Line(points={{262,-210},{340,-210},
{340,-42},{378,-42}}, color={255,0,255}));
connect(logSwi1.y, yChaDowEdg)
annotation (Line(points={{402,-122},{460,-122}}, color={255,0,255}));
connect(logSwi2.y, yChaEdg)
Expand Down Expand Up @@ -393,6 +378,14 @@ equation
annotation (Line(points={{-358,-80},{-222,-80}}, color={255,0,255}));
connect(pre1.y, and6.u2) annotation (Line(points={{422,-250},{430,-250},{430,
-280},{-190,-280},{-190,-88},{-182,-88}}, color={255,0,255}));
connect(con2.y, truDel.u)
annotation (Line(points={{202,-210},{238,-210}}, color={255,0,255}));
connect(truDel.y, logSwi3.u2) annotation (Line(points={{262,-210},{340,-210},{
340,-42},{378,-42}}, color={255,0,255}));
connect(truDel.y, logSwi2.u2) annotation (Line(points={{262,-210},{340,-210},{
340,-82},{378,-82}}, color={255,0,255}));
connect(truDel.y, logSwi1.u2) annotation (Line(points={{262,-210},{340,-210},{
340,-122},{378,-122}}, color={255,0,255}));
annotation (defaultComponentName = "cha",
Icon(graphics={
Rectangle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,13 @@ protected
"Efficiency condition of the current stage"
annotation (Placement(transformation(extent={{-100,170},{-80,190}})));

Buildings.Controls.OBC.CDL.Logical.Or3 orStaUp "Or for staging up"
annotation (Placement(transformation(extent={{-20,110},{0,130}})));
Buildings.Controls.OBC.CDL.Logical.Or orStaUp
"Or for staging up"
annotation (Placement(transformation(extent={{20,110},{40,130}})));

Buildings.Controls.OBC.CDL.Logical.Or or2
"Or for staging up"
annotation (Placement(transformation(extent={{-40,110},{-20,130}})));

Buildings.Controls.OBC.CDL.Logical.Switch logSwi "Logical switch"
annotation (Placement(transformation(extent={{80,70},{100,90}})));
Expand Down Expand Up @@ -254,13 +259,9 @@ equation
Line(points={{-180,140},{-120,140},{-120,101},{-102,101}}, color={0,0,127}));
connect(dpChiWatPum_local, faiSafCon.dpChiWatPum_local) annotation (Line(
points={{-180,110},{-150,110},{-150,98},{-102,98}}, color={0,0,127}));
connect(effCon.y, orStaUp.u1) annotation (Line(points={{-78,180},{-40,180},{-40,
128},{-22,128}}, color={255,0,255}));
connect(faiSafCon.y, orStaUp.u2) annotation (Line(points={{-78,100},{-50,100},
{-50,120},{-22,120}}, color={255,0,255}));
connect(intGreThr.y, logSwi.u2) annotation (Line(points={{-98,-100},{20,-100},
{20,80},{78,80}}, color={255,0,255}));
connect(orStaUp.y, logSwi.u1) annotation (Line(points={{2,120},{10,120},{10,88},
connect(orStaUp.y, logSwi.u1) annotation (Line(points={{42,120},{60,120},{60,88},
{78,88}}, color={255,0,255}));
connect(sub1.y, hysTSup1.u)
annotation (Line(points={{-88,-30},{-80,-30},{-80,-40},{-62,-40}}, color={0,0,127}));
Expand Down Expand Up @@ -288,8 +289,6 @@ equation
{-140,-36},{-112,-36}}, color={0,0,127}));
connect(uAvaCur, not1.u)
annotation (Line(points={{-180,20},{-122,20}}, color={255,0,255}));
connect(not1.y, orStaUp.u3) annotation (Line(points={{-98,20},{-40,20},{-40,112},
{-22,112}}, color={255,0,255}));
connect(dpChiWatPumSet_remote, faiSafCon.dpChiWatPumSet_remote) annotation (
Line(points={{-180,80},{-150,80},{-150,94},{-102,94}}, color={0,0,127}));
connect(dpChiWatPum_remote, faiSafCon.dpChiWatPum_remote) annotation (Line(
Expand All @@ -308,6 +307,14 @@ equation
{20,-110},{20,-186},{38,-186}}, color={255,0,255}));
connect(uPla, edg.u)
annotation (Line(points={{-180,-180},{-22,-180}}, color={255,0,255}));
connect(not1.y, orStaUp.u2) annotation (Line(points={{-98,20},{10,20},{10,112},
{18,112}}, color={255,0,255}));
connect(faiSafCon.y, or2.u2) annotation (Line(points={{-78,100},{-60,100},{-60,
112},{-42,112}}, color={255,0,255}));
connect(effCon.y, or2.u1) annotation (Line(points={{-78,180},{-60,180},{-60,120},
{-42,120}}, color={255,0,255}));
connect(or2.y, orStaUp.u1)
annotation (Line(points={{-18,120},{18,120}}, color={255,0,255}));
annotation (defaultComponentName = "staUp",
Icon(coordinateSystem(extent={{-100,-100},{100,100}}),
graphics={
Expand Down
Loading

0 comments on commit 975d2fe

Please sign in to comment.