diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/PrimaryPumps/Subsequences/Speed_temperature.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/PrimaryPumps/Subsequences/Speed_temperature.mo index 0a414a33bd8..341245aaed5 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/PrimaryPumps/Subsequences/Speed_temperature.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/PrimaryPumps/Subsequences/Speed_temperature.mo @@ -181,7 +181,7 @@ protected "Constant integer source" annotation (Placement(transformation(extent={{-30,60},{-10,80}}))); - Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond triRes( + Buildings.Controls.OBC.ASHRAE.G36.Generic.TrimAndRespond triRes( final iniSet=maxPumSpe, final minSet=minPumSpe, final maxSet=maxPumSpe, @@ -247,8 +247,8 @@ protected annotation (Placement(transformation(extent={{50,-90},{70,-70}}))); Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar( - final p=1e-6) if - not primarySecondarySensors + final p=1e-6) + if not primarySecondarySensors "Pass non-zero divisor in case sum is zero" annotation (Placement(transformation(extent={{-10,-100},{10,-80}}))); diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/HotWaterSupplyTemperatureReset.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/HotWaterSupplyTemperatureReset.mo index 90bad5f9170..332be685ed4 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/HotWaterSupplyTemperatureReset.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/HotWaterSupplyTemperatureReset.mo @@ -161,7 +161,7 @@ protected "Check for non-condensing stage type" annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); - Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond triRes( + Buildings.Controls.OBC.ASHRAE.G36.Generic.TrimAndRespond triRes( final iniSet=TPlaHotWatSetMax, final minSet=THotWatSetMinNonConBoi, final maxSet=TPlaHotWatSetMax, @@ -195,7 +195,7 @@ protected "Check if any pumps are turned on" annotation (Placement(transformation(extent={{-120,80},{-100,100}}))); - Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond triRes1( + Buildings.Controls.OBC.ASHRAE.G36.Generic.TrimAndRespond triRes1( final iniSet=TPlaHotWatSetMax, final minSet=THotWatSetMinConBoi, final maxSet=TPlaHotWatSetMax, diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo index b316050cbad..3e3d1c94743 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo @@ -183,7 +183,7 @@ protected Buildings.Controls.OBC.CDL.Integers.Subtract subInt "Previous stage during stage change" - annotation (Placement(transformation(extent={{-62,70},{-42,90}}))); + annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt( final k=1) @@ -373,14 +373,15 @@ equation 52,80},{58,80}}, color={0,0,127})); - connect(conInt.y,subInt. u2) annotation (Line(points={{-98,70},{-72,70},{-72,74}, - {-64,74}}, + connect(conInt.y,subInt. u2) annotation (Line(points={{-98,70},{-72,70},{-72, + 74},{-62,74}}, color={255,127,0})); - connect(uStaSet,subInt. u1) annotation (Line(points={{-160,-90},{-128,-90},{-128, - 100},{-72,100},{-72,86},{-64,86}}, color={255,127,0})); + connect(uStaSet,subInt. u1) annotation (Line(points={{-160,-90},{-128,-90},{ + -128,100},{-72,100},{-72,86},{-62,86}}, + color={255,127,0})); - connect(subInt.y, extIndSig1.index) annotation (Line(points={{-40,80},{40,80}, + connect(subInt.y, extIndSig1.index) annotation (Line(points={{-38,80},{40,80}, {40,60},{70,60},{70,68}},color={255,127,0})); connect(matGai.y, extIndSig2.u) diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Status.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Status.mo index 073e644bf1c..682c70ddde3 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Status.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Status.mo @@ -67,9 +67,8 @@ protected final parameter Integer lowDia[nSta, nSta] = {if i<=j then 1 else 0 for i in 1:nSta, j in 1:nSta} "Lower diagonal unit matrix"; - Buildings.Controls.OBC.CDL.Logical.Not not1 - "Not unavailable" - annotation (Placement(transformation(extent={{20,-250},{40,-230}}))); + Buildings.Controls.OBC.CDL.Logical.Not not1 "Not available" + annotation (Placement(transformation(extent={{-60,-160},{-40,-140}}))); Buildings.Controls.OBC.CDL.Integers.Switch intSwi2 "Switch" @@ -122,7 +121,7 @@ protected Buildings.Controls.OBC.CDL.Integers.Less intLes[nSta] "Identifies stages that are below the current stage" - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + annotation (Placement(transformation(extent={{-180,-70},{-160,-50}}))); Buildings.Controls.OBC.CDL.Logical.And and1[nSta] "Identifies any available stage below the current stage" @@ -169,33 +168,20 @@ protected "Logical switch" annotation (Placement(transformation(extent={{180,-80},{200,-60}}))); - Buildings.Controls.OBC.CDL.Routing.RealExtractor extStaAva( - final allowOutOfRange=true, - final outOfRangeValue=nSta + 1, + CDL.Routing.BooleanExtractor extStaAva( final nin=nSta) "Extracts stage availability for the current stage" annotation (Placement(transformation(extent={{-200,-160},{-180,-140}}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThr( - final t=0.5) - "Detects if the current stage becomes unavailable" - annotation (Placement(transformation(extent={{-160,-160},{-140,-140}}))); - - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[nSta]( - final realTrue=fill(1, nSta), - final realFalse=fill(0, nSta)) - "Type converter" - annotation (Placement(transformation(extent={{-240,-160},{-220,-140}}))); - Buildings.Controls.OBC.CDL.Utilities.Assert cheStaAva1( final message="There are no available boiler stages. The staging cannot be performed.") "Checks if any stage is available" - annotation (Placement(transformation(extent={{-340,-140},{-320,-120}}))); + annotation (Placement(transformation(extent={{-320,-50},{-300,-30}}))); Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr( final nin=nSta) "Logical or" - annotation (Placement(transformation(extent={{-380,-140},{-360,-120}}))); + annotation (Placement(transformation(extent={{-360,-50},{-340,-30}}))); Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt( final k=1) @@ -206,6 +192,28 @@ protected "Logical And" annotation (Placement(transformation(extent={{220,70},{240,90}}))); + Buildings.Controls.OBC.CDL.Integers.GreaterEqualThreshold intGreEquThr( + final t=1) + "Check if index is in the range" + annotation (Placement(transformation(extent={{-380,-130},{-360,-110}}))); + + Buildings.Controls.OBC.CDL.Integers.LessEqualThreshold intLesEquThr1( + final t=nSta) + "Check if index is in the range" + annotation (Placement(transformation(extent={{-380,-210},{-360,-190}}))); + + Buildings.Controls.OBC.CDL.Logical.And and3 + "Check if index is in the range" + annotation (Placement(transformation(extent={{-320,-130},{-300,-110}}))); + + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1( + final k=1) + "Dummy index so the extractor will not have out of range index" + annotation (Placement(transformation(extent={{-320,-210},{-300,-190}}))); + + Buildings.Controls.OBC.CDL.Integers.Switch intSwi4 "Valid index" + annotation (Placement(transformation(extent={{-260,-180},{-240,-160}}))); + equation connect(staIndx.y, intGre.u1) annotation (Line(points={{-218,130},{-200,130},{ -200,90},{-182,90}}, color={255,127,0})); @@ -214,8 +222,8 @@ equation color={255,127,0})); connect(intGre.y, and2.u1) annotation (Line(points={{-158,90},{-150,90},{-150, 80},{-142,80}},color={255,0,255})); - connect(uAva, and2.u2) annotation (Line(points={{-440,-80},{-280,-80},{-280, - 72},{-142,72}}, color={255,0,255})); + connect(uAva, and2.u2) annotation (Line(points={{-440,-80},{-220,-80},{-220,72}, + {-142,72}}, color={255,0,255})); connect(staIndx.y, proInt1.u1) annotation (Line(points={{-218,130},{-70,130},{ -70,116},{-62,116}}, color={255,127,0})); connect(booToInt1.y, proInt1.u2) annotation (Line(points={{-78,80},{-70,80},{-70, @@ -224,20 +232,20 @@ equation annotation (Line(points={{-38,110},{-22,110}}, color={255,127,0})); connect(intToRea1.y, multiMin.u) annotation (Line(points={{2,110},{18,110}}, color={0,0,127})); - connect(intRep.y, intLes.u2) annotation (Line(points={{-278,200},{-260,200},{ - -260,-78},{-182,-78}}, color={255,127,0})); + connect(intRep.y, intLes.u2) annotation (Line(points={{-278,200},{-260,200},{-260, + -68},{-182,-68}}, color={255,127,0})); connect(staIndx.y, intLes.u1) annotation (Line(points={{-218,130},{-200,130},{ - -200,-70},{-182,-70}}, color={255,127,0})); - connect(uAva, and1.u2) annotation (Line(points={{-440,-80},{-280,-80},{-280, - -98},{-142,-98}}, color={255,0,255})); - connect(intLes.y, and1.u1) annotation (Line(points={{-158,-70},{-150,-70},{-150, + -200,-60},{-182,-60}}, color={255,127,0})); + connect(uAva, and1.u2) annotation (Line(points={{-440,-80},{-220,-80},{-220,-98}, + {-142,-98}}, color={255,0,255})); + connect(intLes.y, and1.u1) annotation (Line(points={{-158,-60},{-150,-60},{-150, -90},{-142,-90}}, color={255,0,255})); connect(proInt2.y, intToRea3.u) annotation (Line(points={{-38,-70},{-22,-70}}, color={255,127,0})); connect(intToRea3.y, multiMax.u) annotation (Line(points={{2,-70},{18,-70}}, color={0,0,127})); connect(staIndx.y, proInt2.u1) annotation (Line(points={{-218,130},{-200,130}, - {-200,-40},{-70,-40},{-70,-64},{-62,-64}}, color={255,127,0})); + {-200,-30},{-70,-30},{-70,-64},{-62,-64}}, color={255,127,0})); connect(booToInt2.y, proInt2.u2) annotation (Line(points={{-78,-90},{-70,-90}, {-70,-76},{-62,-76}}, color={255,127,0})); connect(multiMax.y, reaToInt1.u) @@ -256,36 +264,23 @@ equation annotation (Line(points={{122,-70},{178,-70}}, color={255,0,255})); connect(intLesEquThr.y, yLow) annotation (Line(points={{122,-70},{140,-70},{140, -90},{340,-90},{340,-80},{460,-80}}, color={255,0,255})); - connect(uAva, booToRea.u) annotation (Line(points={{-440,-80},{-280,-80},{ - -280,-150},{-242,-150}}, color={255,0,255})); connect(and2.y, booToInt1.u) annotation (Line(points={{-118,80},{-102,80}}, color={255,0,255})); - connect(lesThr.y, intSwi2.u2) annotation (Line(points={{-138,-150},{0,-150},{0, - -210},{98,-210}}, color={255,0,255})); connect(intGreThr.y, and4.u1) annotation (Line(points={{122,110},{140,110},{140,80},{218,80}}, color={255,0,255})); - connect(lesThr.y, and4.u2) - annotation (Line(points={{-138,-150},{210,-150},{210,72},{218,72}}, - color={255,0,255})); connect(and4.y, intSwi3.u2) annotation (Line(points={{242,80},{358,80}}, color={255,0,255})); connect(yAvaUp, yAvaUp) annotation (Line(points={{460,80},{460,80}}, color={255,127,0})); - connect(uAva, mulOr.u) annotation (Line(points={{-440,-80},{-400,-80},{-400,-130}, - {-392,-130},{-392,-130},{-382,-130}}, color={255,0,255})); + connect(uAva, mulOr.u) annotation (Line(points={{-440,-80},{-380,-80},{-380,-40}, + {-362,-40}}, color={255,0,255})); connect(mulOr.y, cheStaAva1.u) - annotation (Line(points={{-358,-130},{-342,-130}}, color={255,0,255})); - connect(booToRea.y, extStaAva.u) - annotation (Line(points={{-218,-150},{-202,-150}}, color={0,0,127})); - connect(extStaAva.y, lesThr.u) - annotation (Line(points={{-178,-150},{-162,-150}}, color={0,0,127})); + annotation (Line(points={{-338,-40},{-322,-40}}, color={255,0,255})); connect(and1.y, booToInt2.u) annotation (Line(points={{-118,-90},{-102,-90}}, color={255,0,255})); connect(u, intRep.u) annotation (Line(points={{-440,80},{-320,80},{-320,200}, {-302,200}}, color={255,127,0})); - connect(u, extStaAva.index) annotation (Line(points={{-440,80},{-300,80},{ - -300,-180},{-190,-180},{-190,-162}}, color={255,127,0})); connect(conInt.y, intSwi1.u1) annotation (Line(points={{122,-30},{160,-30},{160, -62},{178,-62}}, color={255,127,0})); connect(intSwi1.y, yAvaDow) annotation (Line(points={{202,-70},{320,-70},{320, @@ -294,22 +289,44 @@ equation -160},{80,-160},{80,-202},{98,-202}}, color={255,127,0})); connect(intSwi2.y, intSwi3.u1) annotation (Line(points={{122,-210},{350,-210}, {350,88},{358,88}}, color={255,127,0})); - connect(u, intSwi2.u3) annotation (Line(points={{-440,80},{-300,80},{-300, - -218},{98,-218}}, color={255,127,0})); + connect(u, intSwi2.u3) annotation (Line(points={{-440,80},{-400,80},{-400,-218}, + {98,-218}}, color={255,127,0})); connect(intSwi.y, intSwi3.u3) annotation (Line(points={{202,110},{340,110},{340, 72},{358,72}}, color={255,127,0})); connect(u, intSwi.u1) annotation (Line(points={{-440,80},{-300,80},{-300,160}, {160,160},{160,118},{178,118}}, color={255,127,0})); connect(reaToInt.y, intSwi.u3) annotation (Line(points={{82,110},{90,110},{90, 90},{160,90},{160,102},{178,102}}, color={255,127,0})); - connect(reaToInt1.y, intSwi1.u3) annotation (Line(points={{82,-70},{90,-70},{90, - -100},{170,-100},{170,-78},{178,-78}}, color={255,127,0})); connect(intSwi3.y, yAvaUp) annotation (Line(points={{382,80},{460,80}}, color={255,127,0})); - connect(lesThr.y, not1.u) annotation (Line(points={{-138,-150},{0,-150},{0,-240}, - {18,-240}}, color={255,0,255})); - connect(not1.y, yAvaCur) - annotation (Line(points={{42,-240},{460,-240}}, color={255,0,255})); + connect(conInt1.y, intSwi4.u3) annotation (Line(points={{-298,-200},{-280,-200}, + {-280,-178},{-262,-178}}, color={255,127,0})); + connect(and3.y, intSwi4.u2) annotation (Line(points={{-298,-120},{-280,-120},{ + -280,-170},{-262,-170}}, color={255,0,255})); + connect(intGreEquThr.y, and3.u1) + annotation (Line(points={{-358,-120},{-322,-120}}, color={255,0,255})); + connect(intLesEquThr1.y, and3.u2) annotation (Line(points={{-358,-200},{-340,-200}, + {-340,-128},{-322,-128}}, color={255,0,255})); + connect(u, intGreEquThr.u) annotation (Line(points={{-440,80},{-400,80},{-400, + -120},{-382,-120}}, color={255,127,0})); + connect(u, intLesEquThr1.u) annotation (Line(points={{-440,80},{-400,80},{-400, + -200},{-382,-200}}, color={255,127,0})); + connect(u, intSwi4.u1) annotation (Line(points={{-440,80},{-400,80},{-400,-162}, + {-262,-162}}, color={255,127,0})); + connect(intSwi4.y, extStaAva.index) annotation (Line(points={{-238,-170},{-190, + -170},{-190,-162}}, color={255,127,0})); + connect(uAva, extStaAva.u) annotation (Line(points={{-440,-80},{-220,-80},{-220, + -150},{-202,-150}}, color={255,0,255})); + connect(extStaAva.y, not1.u) + annotation (Line(points={{-178,-150},{-62,-150}}, color={255,0,255})); + connect(not1.y, intSwi2.u2) annotation (Line(points={{-38,-150},{-20,-150},{-20, + -210},{98,-210}}, color={255,0,255})); + connect(not1.y, and4.u2) annotation (Line(points={{-38,-150},{210,-150},{210,72}, + {218,72}}, color={255,0,255})); + connect(reaToInt1.y, intSwi1.u3) annotation (Line(points={{82,-70},{90,-70},{90, + -100},{160,-100},{160,-78},{178,-78}}, color={255,127,0})); + connect(extStaAva.y, yAvaCur) annotation (Line(points={{-178,-150},{-140,-150}, + {-140,-240},{460,-240}}, color={255,0,255})); annotation (defaultComponentName = "sta", Icon(graphics={ Rectangle(