From e87b2f9216387e3c2933c71b20809160d60e7efd Mon Sep 17 00:00:00 2001 From: SenHuang19 Date: Wed, 28 Aug 2024 22:06:09 -0400 Subject: [PATCH 1/4] improve graphic and make the tuning stop when the setppint changes --- .../PIDWithAutotuning/FirstOrderAMIGO.mo | 296 ++++++++++-------- 1 file changed, 161 insertions(+), 135 deletions(-) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo index b0a31b76d92..33999f6fe19 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo @@ -86,7 +86,7 @@ block FirstOrderAMIGO iconTransformation(extent={{100,-20},{140,20}}))); Buildings.Controls.OBC.CDL.Reals.Sources.CivilTime modTim "Simulation time" - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + annotation (Placement(transformation(extent={{-160,180},{-140,200}}))); Buildings.Controls.OBC.Utilities.PIDWithInputGains con( final controllerType=conTyp, final r=r, @@ -102,10 +102,10 @@ block FirstOrderAMIGO annotation (Placement(transformation(extent={{-50,-70},{-30,-50}}))); Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PID PIDPar if with_D "Autotuner of gains for a PID controller" - annotation (Placement(transformation(extent={{80,0},{100,20}}))); + annotation (Placement(transformation(extent={{80,92},{100,112}}))); Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PI PIPar if not with_D "Autotuner of gains for a PI controller" - annotation (Placement(transformation(extent={{80,40},{100,60}}))); + annotation (Placement(transformation(extent={{84,156},{104,176}}))); Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller rel( final r=r, final yHig=yHig, @@ -113,13 +113,13 @@ block FirstOrderAMIGO final deaBan=deaBan, final reverseActing=reverseActing) "Relay controller" - annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); + annotation (Placement(transformation(extent={{-60,120},{-40,140}}))); Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.ResponseProcess resPro( final yHig=yHig - yRef, final yLow=yRef - yLow) "Identify the on and off period length, the half period ratio, and the moments when the tuning starts and ends" - annotation (Placement(transformation(extent={{0,10},{20,30}}))); + annotation (Placement(transformation(extent={{0,100},{20,120}}))); Buildings.Controls.OBC.CDL.Reals.Switch swi "Switch between a PID controller and a relay controller" annotation (Placement(transformation(extent={{140,-30},{160,-10}}))); @@ -140,11 +140,17 @@ block FirstOrderAMIGO final yLow=yRef - yLow, final deaBan=deaBan) "Calculates the parameters of a first-order time delayed model" - annotation (Placement(transformation(extent={{40,40},{60,60}}))); + annotation (Placement(transformation(extent={{32,154},{52,174}}))); Buildings.Controls.OBC.CDL.Logical.Latch inTunPro "Outputs true if the controller is conducting the autotuning process" - annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); + annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); + Buildings.Controls.OBC.CDL.Logical.FallingEdge falEdg + "Check if the setpoint changes during an autotuning process" + annotation (Placement(transformation(extent={{-148,220},{-128,240}}))); + Buildings.Controls.OBC.CDL.Logical.Or or2 + "Check if the autotuning is completed or aborted" + annotation (Placement(transformation(extent={{-84,220},{-64,240}}))); protected final parameter Boolean with_D=controllerType == Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Types.SimpleController.PID "Boolean flag to enable derivative action" @@ -157,79 +163,79 @@ protected Buildings.Controls.OBC.CDL.Utilities.Assert assMes2( message="*** Warning: the relay output needs to be asymmetric. Check the value of yHig, yLow and yRef.") "Warning message when the relay output is symmetric" - annotation (Placement(transformation(extent={{100,200},{120,220}}))); + annotation (Placement(transformation(extent={{150,370},{170,390}}))); Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1(final k=yHig) "Higher value for the relay output" - annotation (Placement(transformation(extent={{-160,230},{-140,250}}))); + annotation (Placement(transformation(extent={{-160,390},{-140,410}}))); Buildings.Controls.OBC.CDL.Reals.Sources.Constant con2(final k=yRef) "Reference value for the relay output" - annotation (Placement(transformation(extent={{-160,200},{-140,220}}))); + annotation (Placement(transformation(extent={{-160,360},{-140,380}}))); Buildings.Controls.OBC.CDL.Reals.Sources.Constant con3(final k=yLow) "Lower value for the relay output" - annotation (Placement(transformation(extent={{-160,170},{-140,190}}))); + annotation (Placement(transformation(extent={{-160,330},{-140,350}}))); Buildings.Controls.OBC.CDL.Reals.Subtract sub "Difference between the higher value and the reference value of the relay output" - annotation (Placement(transformation(extent={{-100,220},{-80,240}}))); + annotation (Placement(transformation(extent={{-100,370},{-80,390}}))); Buildings.Controls.OBC.CDL.Reals.Subtract sub1 "Difference between the reference value and the lower value of the relay output" - annotation (Placement(transformation(extent={{-100,180},{-80,200}}))); + annotation (Placement(transformation(extent={{-100,330},{-80,350}}))); Buildings.Controls.OBC.CDL.Reals.Subtract sub2 "Symmetricity level of the relay output" - annotation (Placement(transformation(extent={{-40,200},{-20,220}}))); + annotation (Placement(transformation(extent={{-40,350},{-20,370}}))); Buildings.Controls.OBC.CDL.Reals.Abs abs1 "Absolute value" - annotation (Placement(transformation(extent={{0,200},{20,220}}))); + annotation (Placement(transformation(extent={{0,338},{20,358}}))); Buildings.Controls.OBC.CDL.Reals.Greater gre "Check if the relay output is asymmetric" - annotation (Placement(transformation(extent={{60,200},{80,220}}))); + annotation (Placement(transformation(extent={{60,390},{80,370}}))); Buildings.Controls.OBC.CDL.Reals.Sources.Constant con4(final k=1e-3) "Threshold for checking if the input is larger than 0" - annotation (Placement(transformation(extent={{0,170},{20,190}}))); + annotation (Placement(transformation(extent={{0,378},{20,398}}))); Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter yRel( final k=yMax - yMin) "Relay output multiplied by the possible range of the output" - annotation (Placement(transformation(extent={{40,90},{60,110}}))); + annotation (Placement(transformation(extent={{40,210},{60,230}}))); Buildings.Controls.OBC.CDL.Logical.Nand nand "Check if an autotuning is ongoing while a new autotuning request is received" - annotation (Placement(transformation(extent={{120,-92},{140,-72}}))); + annotation (Placement(transformation(extent={{80,20},{100,40}}))); Buildings.Controls.OBC.CDL.Utilities.Assert assMes1( message="*** Warning: An autotuning is ongoing and the new tuning request is ignored.") "Warning message when an autotuning tuning is ongoing while a new autotuning request is received" - annotation (Placement(transformation(extent={{150,-92},{170,-72}}))); + annotation (Placement(transformation(extent={{140,20},{160,40}}))); Buildings.Controls.OBC.CDL.Logical.Edge edgReq "True only when a new request is received" - annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); + annotation (Placement(transformation(extent={{12,-50},{32,-30}}))); Buildings.Controls.OBC.CDL.Logical.TrueDelay tunStaDel( final delayTime=0.001) "A small time delay for the autotuning start time to avoid false alerts" - annotation (Placement(transformation(extent={{80,-60},{100,-40}}))); + annotation (Placement(transformation(extent={{10,20},{30,40}}))); Buildings.Controls.OBC.CDL.Reals.AddParameter addPar( final p=yMin) "Sums the inputs" - annotation (Placement(transformation(extent={{80,90},{100,110}}))); + annotation (Placement(transformation(extent={{80,210},{100,230}}))); Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler sam_u_s( final y_start=u_s_start) "Recording the setpoint" - annotation (Placement(transformation(extent={{-100,130},{-80,150}}))); + annotation (Placement(transformation(extent={{-122,284},{-102,304}}))); Buildings.Controls.OBC.CDL.Logical.Nand nand1 "Check if an autotuning is ongoing while the setpoint changes" - annotation (Placement(transformation(extent={{100,130},{120,150}}))); + annotation (Placement(transformation(extent={{94,290},{114,310}}))); Buildings.Controls.OBC.CDL.Reals.Subtract sub3 "Change of the setpoint" - annotation (Placement(transformation(extent={{-40,110},{-20,130}}))); + annotation (Placement(transformation(extent={{-40,264},{-20,284}}))); Buildings.Controls.OBC.CDL.Reals.Abs abs2 "Absolute value of the setpoint change" - annotation (Placement(transformation(extent={{0,130},{20,150}}))); + annotation (Placement(transformation(extent={{0,284},{20,304}}))); Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr( final t=setHys, final h=0.5*setHys) "Check if the setpoint changes" - annotation (Placement(transformation(extent={{40,130},{60,150}}))); - Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(message= - "In " + getInstanceName() - + ": the setpoint must not change when an autotuning tuning is ongoing.") + annotation (Placement(transformation(extent={{40,290},{60,310}}))); + Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(message="In " + + getInstanceName() + + ": the setpoint must not change when an autotuning tuning is ongoing. This ongoing autotuning will thus abort.") "Warning message when the setpoint changes during tuning process" - annotation (Placement(transformation(extent={{140,130},{160,150}}))); + annotation (Placement(transformation(extent={{150,290},{170,310}}))); equation connect(con.u_s, u_s) annotation (Line(points={{-52,-60},{-60,-60},{-60,-20},{ @@ -242,126 +248,146 @@ equation {-98,-70}}, color={0,0,127})); connect(samTd.y,con. Td) annotation (Line(points={{-118,-100},{-60,-100},{-60, -64},{-52,-64}}, color={0,0,127})); - connect(resPro.on, rel.yOn) annotation (Line(points={{-2,20},{-10,20},{-10,4}, - {-38,4}}, color={255,0,255})); - connect(modTim.y, resPro.tim) annotation (Line(points={{-38,50},{-26,50},{-26, - 26},{-2,26}},color={0,0,127})); - connect(resPro.tau, conProMod.tau) annotation (Line(points={{22,20},{34,20},{34, - 42},{38,42}}, color={0,0,127})); - connect(conProMod.tOff, resPro.tOff) annotation (Line(points={{38,46},{30,46}, - {30,24},{22,24}},color={0,0,127})); - connect(resPro.tOn, conProMod.tOn) annotation (Line(points={{22,28},{26,28},{26, - 54},{38,54}}, color={0,0,127})); - connect(rel.yDif, conProMod.u) annotation (Line(points={{-38,10},{-14,10},{-14, - 58},{38,58}}, color={0,0,127})); - connect(PIDPar.kp, conProMod.k) annotation (Line(points={{78,16},{66,16},{66,58}, - {62,58}}, color={0,0,127})); - connect(PIDPar.T, conProMod.T) annotation (Line(points={{78,10},{70,10},{70,54}, - {62,54}}, color={0,0,127})); - connect(PIDPar.L, conProMod.L) annotation (Line(points={{78,4},{74,4},{74,46}, - {62,46}}, color={0,0,127})); - connect(PIDPar.k, samk.u) annotation (Line(points={{102,17},{110,17},{110,78}, - {-154,78},{-154,-40},{-102,-40}},color={0,0,127})); - connect(PIDPar.Ti, samTi.u) annotation (Line(points={{102,10},{112,10},{112, - 80},{-160,80},{-160,-70},{-122,-70}}, + connect(resPro.on, rel.yOn) annotation (Line(points={{-2,110},{-30,110},{-30, + 124},{-38,124}}, + color={255,0,255})); + connect(modTim.y, resPro.tim) annotation (Line(points={{-138,190},{-4,190},{ + -4,126},{-10,126},{-10,116},{-2,116}}, + color={0,0,127})); + connect(resPro.tau, conProMod.tau) annotation (Line(points={{22,110},{30,110}, + {30,156}}, color={0,0,127})); + connect(conProMod.tOff, resPro.tOff) annotation (Line(points={{30,160},{26, + 160},{26,114},{22,114}}, + color={0,0,127})); + connect(resPro.tOn, conProMod.tOn) annotation (Line(points={{22,118},{22,168}, + {30,168}}, color={0,0,127})); + connect(rel.yDif, conProMod.u) annotation (Line(points={{-38,130},{18,130},{ + 18,172},{30,172}}, + color={0,0,127})); + connect(PIDPar.kp, conProMod.k) annotation (Line(points={{78,108},{64,108},{ + 64,172},{54,172}}, + color={0,0,127})); + connect(PIDPar.T, conProMod.T) annotation (Line(points={{78,102},{60,102},{60, + 148},{62,148},{62,168},{54,168}}, + color={0,0,127})); + connect(PIDPar.L, conProMod.L) annotation (Line(points={{78,96},{58,96},{58, + 150},{60,150},{60,160},{54,160}}, + color={0,0,127})); + connect(PIDPar.k, samk.u) annotation (Line(points={{102,109},{102,110},{146, + 110},{146,78},{-154,78},{-154,-40},{-102,-40}}, + color={0,0,127})); + connect(PIDPar.Ti, samTi.u) annotation (Line(points={{102,102},{118,102},{118, + -6},{-124,-6},{-124,-70},{-122,-70}}, color={0,0,127})); - connect(PIPar.kp, conProMod.k) annotation (Line(points={{78,56},{66,56},{66, - 58},{62,58}}, + connect(PIPar.kp, conProMod.k) annotation (Line(points={{82,172},{54,172}}, color={0,0,127})); - connect(PIPar.T, conProMod.T) annotation (Line(points={{78,50},{70,50},{70,54}, - {62,54}}, color={0,0,127})); - connect(PIPar.L, conProMod.L) annotation (Line(points={{78,44},{74,44},{74,46}, - {62,46}}, color={0,0,127})); - connect(PIPar.k, samk.u) annotation (Line(points={{102,56},{110,56},{110,78}, - {-154,78},{-154,-40},{-102,-40}},color={0,0,127})); - connect(PIPar.Ti, samTi.u) annotation (Line(points={{102,44},{112,44},{112,80}, - {-160,80},{-160,-70},{-122,-70}}, color={0,0,127})); - connect(resPro.triSta, conProMod.triSta) annotation (Line(points={{22,16},{44, - 16},{44,38}}, color={255,0,255})); - connect(PIDPar.Td, samTd.u) annotation (Line(points={{102,3},{114,3},{114,76}, - {-148,76},{-148,-100},{-142,-100}}, color={0,0,127})); + connect(PIPar.T, conProMod.T) annotation (Line(points={{82,166},{62,166},{62, + 168},{54,168}}, + color={0,0,127})); + connect(PIPar.L, conProMod.L) annotation (Line(points={{82,160},{54,160}}, + color={0,0,127})); + connect(PIPar.k, samk.u) annotation (Line(points={{106,172},{156,172},{156,70}, + {-148,70},{-148,-40},{-102,-40}},color={0,0,127})); + connect(PIPar.Ti, samTi.u) annotation (Line(points={{106,160},{166,160},{166, + 48},{-140,48},{-140,-70},{-122,-70}}, + color={0,0,127})); + connect(resPro.triSta, conProMod.triSta) annotation (Line(points={{22,106},{ + 36,106},{36,152}}, + color={255,0,255})); + connect(PIDPar.Td, samTd.u) annotation (Line(points={{102,95},{102,94},{112, + 94},{112,88},{-162,88},{-162,-100},{-142,-100}}, + color={0,0,127})); connect(swi.y, y) annotation (Line(points={{162,-20},{200,-20}}, color={0,0,127})); connect(u_m,con. u_m) annotation (Line(points={{-20,-140},{-20,-110},{-40,-110}, {-40,-72}}, color={0,0,127})); - connect(swi.u3,con. y) annotation (Line(points={{138,-28},{60,-28},{60,-60},{-28, - -60}}, color={0,0,127})); - connect(inTunPro.y, swi.u2) annotation (Line(points={{42,-40},{50,-40},{50,-20}, + connect(swi.u3,con. y) annotation (Line(points={{138,-28},{56,-28},{56,-60},{ + -28,-60}}, + color={0,0,127})); + connect(inTunPro.y, swi.u2) annotation (Line(points={{-18,30},{-6,30},{-6,-20}, {138,-20}}, color={255,0,255})); - connect(inTunPro.u, triTun) annotation (Line(points={{18,-40},{-6,-40},{-6,-90}, - {60,-90},{60,-140}}, color={255,0,255})); - connect(inTunPro.clr, resPro.triEnd) annotation (Line(points={{18,-46},{10, - -46},{10,0},{30,0},{30,12},{22,12}}, color={255,0,255})); - connect(rel.trigger, triTun) annotation (Line(points={{-56,-2},{-56,-20},{-6,-20}, - {-6,-90},{60,-90},{60,-140}}, color={255,0,255})); - connect(resPro.trigger, triTun) annotation (Line(points={{-2,14},{-6,14},{-6,-90}, - {60,-90},{60,-140}}, color={255,0,255})); + connect(inTunPro.u, triTun) annotation (Line(points={{-42,30},{-56,30},{-56, + 46},{-14,46},{-14,-90},{60,-90},{60,-140}}, + color={255,0,255})); + connect(rel.trigger, triTun) annotation (Line(points={{-56,118},{-56,108},{ + -90,108},{-90,56},{60,56},{60,-140}}, + color={255,0,255})); + connect(resPro.trigger, triTun) annotation (Line(points={{-2,104},{-14,104},{ + -14,-90},{60,-90},{60,-140}}, + color={255,0,255})); connect(nand.y, assMes1.u) - annotation (Line(points={{142,-82},{148,-82}}, color={255,0,255})); + annotation (Line(points={{102,30},{138,30}}, color={255,0,255})); connect(nand.u2, edgReq.y) - annotation (Line(points={{118,-90},{102,-90}}, color={255,0,255})); + annotation (Line(points={{78,22},{40,22},{40,-40},{34,-40}}, color={255,0,255})); connect(edgReq.u, triTun) - annotation (Line(points={{78,-90},{60,-90},{60,-140}}, color={255,0,255})); - connect(tunStaDel.y, nand.u1) annotation (Line(points={{102,-50},{110,-50},{110, - -82},{118,-82}}, color={255,0,255})); - connect(tunStaDel.u, inTunPro.y) annotation (Line(points={{78,-50},{50,-50},{50, - -40},{42,-40}}, color={255,0,255})); - connect(con1.y, sub.u1) annotation (Line(points={{-138,240},{-120,240},{-120,236}, - {-102,236}}, color={0,0,127})); - connect(con2.y, sub.u2) annotation (Line(points={{-138,210},{-120,210},{-120,224}, - {-102,224}}, color={0,0,127})); - connect(sub1.u1, con2.y) annotation (Line(points={{-102,196},{-120,196},{-120, - 210},{-138,210}}, color={0,0,127})); - connect(sub1.u2, con3.y) annotation (Line(points={{-102,184},{-120,184},{-120, - 180},{-138,180}}, color={0,0,127})); - connect(sub.y, sub2.u1) annotation (Line(points={{-78,230},{-60,230},{-60,216}, - {-42,216}}, color={0,0,127})); + annotation (Line(points={{10,-40},{-14,-40},{-14,-90},{60,-90},{60,-140}}, + color={255,0,255})); + connect(tunStaDel.y, nand.u1) annotation (Line(points={{32,30},{78,30}}, color={255,0,255})); + connect(tunStaDel.u, inTunPro.y) annotation (Line(points={{8,30},{-18,30}}, + color={255,0,255})); + connect(con1.y, sub.u1) annotation (Line(points={{-138,400},{-108,400},{-108, + 386},{-102,386}}, color={0,0,127})); + connect(con2.y, sub.u2) annotation (Line(points={{-138,370},{-110,370},{-110, + 374},{-102,374}}, color={0,0,127})); + connect(sub1.u1, con2.y) annotation (Line(points={{-102,346},{-122,346},{-122, + 370},{-138,370}}, color={0,0,127})); + connect(sub1.u2, con3.y) annotation (Line(points={{-102,334},{-120,334},{-120, + 340},{-138,340}}, color={0,0,127})); + connect(sub.y, sub2.u1) annotation (Line(points={{-78,380},{-60,380},{-60,366}, + {-42,366}}, color={0,0,127})); connect(sub1.y, sub2.u2) - annotation (Line(points={{-78,190},{-60,190},{-60,204},{-42,204}}, color={0,0,127})); + annotation (Line(points={{-78,340},{-60,340},{-60,354},{-42,354}}, color={0,0,127})); connect(abs1.u, sub2.y) - annotation (Line(points={{-2,210},{-18,210}}, color={0,0,127})); + annotation (Line(points={{-2,348},{-12,348},{-12,360},{-18,360}}, color={0,0,127})); connect(abs1.y, gre.u1) - annotation (Line(points={{22,210},{58,210}},color={0,0,127})); + annotation (Line(points={{22,348},{52,348},{52,380},{58,380}}, color={0,0,127})); connect(gre.y, assMes2.u) - annotation (Line(points={{82,210},{98,210}}, color={255,0,255})); - connect(con4.y, gre.u2) annotation (Line(points={{22,180},{40,180},{40,202},{58, - 202}}, color={0,0,127})); - connect(rel.y, yRel.u) annotation (Line(points={{-38,16},{-20,16},{-20,100},{ - 38,100}}, color={0,0,127})); + annotation (Line(points={{82,380},{148,380}},color={255,0,255})); + connect(con4.y, gre.u2) annotation (Line(points={{22,388},{58,388}}, + color={0,0,127})); + connect(rel.y, yRel.u) annotation (Line(points={{-38,136},{-6,136},{-6,220},{ + 38,220}}, color={0,0,127})); connect(yRel.y, addPar.u) - annotation (Line(points={{62,100},{78,100}}, color={0,0,127})); - connect(addPar.y, swi.u1) annotation (Line(points={{102,100},{130,100},{130,-12}, - {138,-12}}, color={0,0,127})); - connect(rel.u_m, u_m) annotation (Line(points={{-50,-2},{-50,-34},{-20,-34},{-20, - -140}}, color={0,0,127})); - connect(rel.u_s, u_s) annotation (Line(points={{-62,10},{-170,10},{-170,-20},{ - -200,-20}}, color={0,0,127})); - connect(sam_u_s.u, u_s) annotation (Line(points={{-102,140},{-170,140},{-170,-20}, - {-200,-20}}, color={0,0,127})); - connect(sam_u_s.y, sub3.u1) annotation (Line(points={{-78,140},{-60,140},{-60, - 126},{-42,126}}, color={0,0,127})); - connect(sub3.u2, u_s) annotation (Line(points={{-42,114},{-60,114},{-60,100},{ - -170,100},{-170,-20},{-200,-20}}, color={0,0,127})); + annotation (Line(points={{62,220},{78,220}}, color={0,0,127})); + connect(addPar.y, swi.u1) annotation (Line(points={{102,220},{130,220},{130, + -12},{138,-12}}, color={0,0,127})); + connect(rel.u_m, u_m) annotation (Line(points={{-50,118},{-50,-44},{-20,-44}, + {-20,-140}}, color={0,0,127})); + connect(rel.u_s, u_s) annotation (Line(points={{-62,130},{-158,130},{-158,-20}, + {-200,-20}},color={0,0,127})); + connect(sam_u_s.u, u_s) annotation (Line(points={{-124,294},{-154,294},{-154, + 254},{-170,254},{-170,-20},{-200,-20}}, color={0,0,127})); + connect(sam_u_s.y, sub3.u1) annotation (Line(points={{-100,294},{-48,294},{ + -48,280},{-42,280}}, color={0,0,127})); + connect(sub3.u2, u_s) annotation (Line(points={{-42,268},{-60,268},{-60,254}, + {-170,254},{-170,-20},{-200,-20}},color={0,0,127})); connect(sub3.y, abs2.u) - annotation (Line(points={{-18,120},{-10,120},{-10,140},{-2,140}}, color={0,0,127})); + annotation (Line(points={{-18,274},{-10,274},{-10,294},{-2,294}}, color={0,0,127})); connect(nand1.y, assMes3.u) - annotation (Line(points={{122,140},{138,140}}, color={255,0,255})); + annotation (Line(points={{116,300},{148,300}}, color={255,0,255})); connect(greThr.y, nand1.u1) - annotation (Line(points={{62,140},{98,140}}, color={255,0,255})); - connect(nand1.u2, tunStaDel.y) annotation (Line(points={{98,132},{80,132},{80, - 120},{120,120},{120,-50},{102,-50}}, color={255,0,255})); - connect(conProMod.triEnd, resPro.triEnd) - annotation (Line(points={{56,38},{56,12},{22,12}}, color={255,0,255})); - connect(conProMod.tunSta, samk.trigger) annotation (Line(points={{62,42},{62,-14}, - {-90,-14},{-90,-28}}, color={255,0,255})); - connect(samTi.trigger, conProMod.tunSta) annotation (Line(points={{-110,-58},{ - -110,-14},{62,-14},{62,42}}, color={255,0,255})); - connect(samTd.trigger, conProMod.tunSta) annotation (Line(points={{-130,-88},{ - -130,-14},{62,-14},{62,42}}, color={255,0,255})); - connect(sam_u_s.trigger, triTun) annotation (Line(points={{-90,128},{-90,60}, - {-72,60},{-72,-116},{60,-116},{60,-140}}, color={255,0,255})); + annotation (Line(points={{62,300},{92,300}}, color={255,0,255})); + connect(conProMod.tunSta, samk.trigger) annotation (Line(points={{54,156},{54, + -14},{-110,-14},{-110,-22},{-90,-22},{-90,-28}}, color={255,0,255})); + connect(samTi.trigger, conProMod.tunSta) annotation (Line(points={{-110,-58}, + {-110,-42},{-130,-42},{-130,-14},{54,-14},{54,156}}, color={255,0,255})); + connect(samTd.trigger, conProMod.tunSta) annotation (Line(points={{-130,-88}, + {-130,-14},{54,-14},{54,156}}, color={255,0,255})); + connect(sam_u_s.trigger, triTun) annotation (Line(points={{-112,282},{-112,56}, + {-14,56},{-14,-90},{60,-90},{60,-140}}, color={255,0,255})); connect(abs2.y, greThr.u) - annotation (Line(points={{22,140},{38,140}}, color={0,0,127})); - + annotation (Line(points={{22,294},{30,294},{30,300},{38,300}}, color={0,0,127})); + connect(nand1.u2, triTun) annotation (Line(points={{92,292},{54,292},{54,260}, + {-112,260},{-112,56},{60,56},{60,-140}}, color={255,0,255})); + connect(falEdg.u, nand1.y) annotation (Line(points={{-150,230},{-156,230},{ + -156,316},{124,316},{124,300},{116,300}}, color={255,0,255})); + connect(falEdg.y, or2.u1) + annotation (Line(points={{-126,230},{-86,230}}, color={255,0,255})); + connect(resPro.triEnd, or2.u2) annotation (Line(points={{22,102},{-2,102},{-2, + 64},{-124,64},{-124,222},{-86,222}}, color={255,0,255})); + connect(or2.y, inTunPro.clr) annotation (Line(points={{-62,230},{-62,146},{ + -70,146},{-70,24},{-42,24}}, color={255,0,255})); + connect(conProMod.triEnd, or2.y) annotation (Line(points={{48,152},{48,150},{ + -12,150},{-12,230},{-62,230}}, color={255,0,255})); annotation (defaultComponentName = "PIDWitTun", Documentation(info="

@@ -558,5 +584,5 @@ Icon(coordinateSystem(extent={{-100,-100},{100,100}}), "Td = " + String(con.Td, leftJustified=false, significantDigits=3)))}), -Diagram(coordinateSystem(extent={{-180,-120},{180,260}}))); +Diagram(coordinateSystem(extent={{-180,-120},{180,420}}))); end FirstOrderAMIGO; From 5f4f37eb5c552c95c14498d26f056f4f35c28bd9 Mon Sep 17 00:00:00 2001 From: SenHuang19 Date: Wed, 28 Aug 2024 22:06:26 -0400 Subject: [PATCH 2/4] rebase --- ...amples_WetCoilCounterFlowPControlAutoTuning.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_HeatExchangers_Examples_WetCoilCounterFlowPControlAutoTuning.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_HeatExchangers_Examples_WetCoilCounterFlowPControlAutoTuning.txt index 317cf22a1bd..60ccfda3b4c 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_HeatExchangers_Examples_WetCoilCounterFlowPControlAutoTuning.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_HeatExchangers_Examples_WetCoilCounterFlowPControlAutoTuning.txt @@ -1,4 +1,4 @@ -last-generated=2024-06-14 +last-generated=2024-08-28 statistics-initialization= { "nonlinear": "1", @@ -12,11 +12,11 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -hex.m1_flow=[1.000000014901161e-01, 9.799395687878132e-03, 3.891929611563683e-02, 1.243012398481369e-02, 4.082757979631424e-02, 1.002543978393078e-02, 4.832808673381805e-02, 8.020547218620768e-03, 5.314406007528305e-03, 8.957910351455212e-03, 1.455424912273884e-02, 1.926885917782784e-02, 2.135048806667328e-02, 2.181801572442055e-02, 2.197562903165817e-02, 2.217586152255535e-02, 2.238752692937851e-02, 1.900335587561131e-02, 8.295463398098946e-03, 5.835996009409428e-03, 4.895612131804228e-03, 4.280225839465857e-03, 3.848579945042729e-03, 3.540420206263661e-03, 3.315708367154002e-03, 3.146618371829391e-03, 3.019300056621432e-03, 2.400044817477461e-03, 1.637312350794674e-03, 2.243597526103258e-03, 2.796528395265341e-03, 2.920550759881735e-03, 2.911846851930022e-03, 2.852245233952999e-03, 2.987440209835768e-03, 3.261285834014416e-03, 3.841469530016184e-03, 4.812328144907951e-03, 6.299466360360384e-03, 8.400643244385719e-03, 1.102966628968716e-02, 1.399938482791185e-02, 1.708998903632164e-02, 2.015193365514278e-02, 2.325768955051899e-02, 2.656054496765137e-02, 3.021474927663803e-02, 3.438415378332138e-02, 3.92632819712162e-02, 4.510772228240967e-02, 5.227047204971313e-02, 5.964099988341331e-02, 6.503266096115112e-02, 6.954372674226761e-02, 7.368407398462298e-02, 7.7583983540535e-02, 8.132047206163409e-02, 8.495523780584335e-02, 8.853314071893692e-02, 9.502344578504562e-02, 9.911808371543884e-02, 9.98750776052475e-02, 9.998374432325363e-02, 9.999824315309525e-02, 9.99998077750206e-02, 9.999997913837433e-02, 9.999999403953552e-02, 6.94853663444519e-02, 1.178969349712133e-02, 5.948134139180183e-02, 8.125735819339752e-02, 6.601621955633163e-02, 5.363185703754425e-02, 4.590350762009621e-02, 4.133545234799385e-02, 3.871942311525345e-02, 3.723839297890663e-02, 3.639515861868858e-02, 3.590912371873856e-02, 3.56258898973465e-02, 3.54599691927433e-02, 3.536252304911613e-02, 3.530532494187355e-02, 3.527173399925232e-02, 3.525185585021973e-02, 3.524012491106987e-02, 3.523324802517891e-02, 3.522916883230209e-02, 3.522676229476929e-02, 3.522535786032677e-02, 3.522451967000961e-02, 3.522401303052902e-02, 3.522370010614395e-02, 3.522352874279022e-02, 3.522343561053276e-02, 3.522338718175888e-02, 3.522336110472679e-02, 3.52233462035656e-02, 3.52233424782753e-02, 3.52233462035656e-02, 3.52233462035656e-02] +hex.m1_flow=[1.000000014901161e-01, 9.799432009458542e-03, 3.891919180750847e-02, 1.243046205490828e-02, 4.082696512341499e-02, 1.002532709389925e-02, 4.832734540104866e-02, 8.020637556910506e-03, 5.314625799655914e-03, 8.958352729678154e-03, 1.455431710928679e-02, 1.92690659314394e-02, 2.135027758777142e-02, 2.181769907474518e-02, 2.197558619081974e-02, 2.217577584087849e-02, 2.238770946860313e-02, 1.900346763432026e-02, 8.295981213450432e-03, 5.836155265569687e-03, 4.895756486803293e-03, 4.280341323465109e-03, 3.848697990179062e-03, 3.540519159287214e-03, 3.315780078992248e-03, 3.146667731925845e-03, 3.019342431798577e-03, 2.400425029918548e-03, 1.63733633235097e-03, 2.243706025183201e-03, 2.796564716845751e-03, 2.920576138421893e-03, 2.911866642534733e-03, 2.852289704605937e-03, 2.987469313666224e-03, 3.261293284595013e-03, 3.841446712613106e-03, 4.81226434931159e-03, 6.299380213022232e-03, 8.400506339967251e-03, 1.102946326136589e-02, 1.399910729378462e-02, 1.708975434303284e-02, 2.015165239572525e-02, 2.325739525258541e-02, 2.656046114861965e-02, 3.021510131657124e-02, 3.438419103622437e-02, 3.926325589418411e-02, 4.510769248008728e-02, 5.227017402648926e-02, 5.964123830199242e-02, 6.503219157457352e-02, 6.954351812601089e-02, 7.368373125791552e-02, 7.758348435163501e-02, 8.131985366344455e-02, 8.495456725358963e-02, 8.853244036436081e-02, 9.502384811639786e-02, 9.911741316318512e-02, 9.987517446279526e-02, 9.998403489589691e-02, 9.999805688858032e-02, 9.999977797269821e-02, 9.999997168779373e-02, 9.999999403953552e-02, 9.638431668281555e-02, 7.521868497133255e-02, 5.959918722510338e-02, 4.966063424944878e-02, 4.356332123279572e-02, 3.999096527695656e-02, 3.795749694108963e-02, 3.680560737848282e-02, 3.614643216133118e-02, 3.576439619064331e-02, 3.554118424654007e-02, 3.541027009487152e-02, 3.533336520195007e-02, 3.528804704546928e-02, 3.526141494512558e-02, 3.524576872587204e-02, 3.523655980825424e-02, 3.523116186261177e-02, 3.522800281643867e-02, 3.522611781954765e-02, 3.522498905658722e-02, 3.522432222962379e-02, 3.522393479943275e-02, 3.522370383143425e-02, 3.522356227040291e-02, 3.522347658872604e-02, 3.522341698408127e-02, 3.522337973117828e-02, 3.52233499288559e-02, 3.522332385182381e-02, 3.522331267595291e-02, 3.522329404950142e-02, 3.522328287363052e-02, 3.522328659892082e-02] hex.m2_flow=[3.429285809397697e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02, 2.800000086426735e-02] con.u_s=[2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.981499938964844e+02, 2.975499877929688e+02, 2.966499938964844e+02, 2.9575e+02, 2.948500061035156e+02, 2.939500122070312e+02, 2.930499877929688e+02, 2.921499938964844e+02, 2.9125e+02, 2.903500061035156e+02, 2.894500122070312e+02, 2.885499877929688e+02, 2.876499938964844e+02, 2.8675e+02, 2.858500061035156e+02, 2.849500122070312e+02, 2.840499877929688e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.831499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02] -con.u_m=[2.931499938964844e+02, 2.881471862792969e+02, 2.874449157714844e+02, 2.892806091308594e+02, 2.839073791503906e+02, 2.898591613769531e+02, 2.858397521972656e+02, 2.896682434082031e+02, 2.948145751953125e+02, 2.94484619140625e+02, 2.926266784667969e+02, 2.904584350585938e+02, 2.890349731445312e+02, 2.884889831542969e+02, 2.883428649902344e+02, 2.882951354980469e+02, 2.882661437988281e+02, 2.885406799316406e+02, 2.929259338378906e+02, 2.952376708984375e+02, 2.961018676757812e+02, 2.966226196289062e+02, 2.969822998046875e+02, 2.972457275390625e+02, 2.974365234375e+02, 2.975864868164062e+02, 2.977091979980469e+02, 2.978600463867188e+02, 2.981324768066406e+02, 2.98277587890625e+02, 2.98239013671875e+02, 2.981739196777344e+02, 2.981340026855469e+02, 2.9812060546875e+02, 2.981119995117188e+02, 2.980509643554688e+02, 2.979117736816406e+02, 2.976292419433594e+02, 2.971192626953125e+02, 2.962571105957031e+02, 2.950943298339844e+02, 2.9381982421875e+02, 2.924999389648438e+02, 2.912912292480469e+02, 2.902102661132812e+02, 2.892289123535156e+02, 2.88315673828125e+02, 2.874531860351562e+02, 2.866369934082031e+02, 2.858726501464844e+02, 2.851712951660156e+02, 2.846004333496094e+02, 2.842941589355469e+02, 2.841333923339844e+02, 2.840352172851562e+02, 2.839737243652344e+02, 2.839374084472656e+02, 2.839192199707031e+02, 2.839145812988281e+02, 2.838818054199219e+02, 2.838653259277344e+02, 2.839319763183594e+02, 2.840171508789062e+02, 2.841050720214844e+02, 2.841924438476562e+02, 2.842044677734375e+02, 2.842045593261719e+02, 2.844039916992188e+02, 2.909552307128906e+02, 2.877339477539062e+02, 2.846883239746094e+02, 2.850060729980469e+02, 2.857023315429688e+02, 2.864142761230469e+02, 2.87008056640625e+02, 2.874368591308594e+02, 2.877175903320312e+02, 2.878914489746094e+02, 2.879963073730469e+02, 2.880589294433594e+02, 2.880961608886719e+02, 2.881182250976562e+02, 2.881312561035156e+02, 2.88138916015625e+02, 2.881434631347656e+02, 2.881461486816406e+02, 2.881477355957031e+02, 2.881486511230469e+02, 2.881492004394531e+02, 2.881495361328125e+02, 2.881497192382812e+02, 2.881498413085938e+02, 2.8814990234375e+02, 2.881499633789062e+02, 2.881499633789062e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02] -hex.Q1_flow=[0e+00, 8.008525390625e+02, 1.574509155273438e+03, 9.598690795898438e+02, 1.509545776367188e+03, 8.314747924804688e+02, 1.7153447265625e+03, 7.317942504882809e+02, 5.666944580078125e+02, 6.581214599609375e+02, 8.624087524414062e+02, 1.050914184570312e+03, 1.13723779296875e+03, 1.159449096679688e+03, 1.16414501953125e+03, 1.16655029296875e+03, 1.16838232421875e+03, 1.056565185546875e+03, 6.666392211914062e+02, 5.0991796875e+02, 4.334904479980469e+02, 3.830501098632812e+02, 3.467495422363281e+02, 3.193536376953125e+02, 2.992341918945312e+02, 2.836605224609375e+02, 2.708881225585938e+02, 2.496213836669921e+02, 2.180754241943359e+02, 2.079737548828125e+02, 2.16202880859375e+02, 2.242102508544922e+02, 2.285453186035156e+02, 2.29474853515625e+02, 2.320776977539062e+02, 2.40506103515625e+02, 2.604377136230469e+02, 2.992744445800781e+02, 3.663895263671875e+02, 4.726472778320312e+02, 6.016434936523438e+02, 7.317376708984375e+02, 8.542926025390625e+02, 9.589669799804688e+02, 1.047934814453125e+03, 1.126118774414062e+03, 1.19691259765625e+03, 1.261974853515625e+03, 1.321740356445312e+03, 1.375974365234375e+03, 1.424050659179688e+03, 1.453165893554688e+03, 1.463758544921875e+03, 1.470341064453125e+03, 1.474701049804688e+03, 1.477328491210938e+03, 1.478709594726562e+03, 1.479173706054688e+03, 1.478926391601562e+03, 1.486778930664062e+03, 1.479446655273438e+03, 1.472607421875e+03, 1.466693237304688e+03, 1.460934326171875e+03, 1.455834106445312e+03, 1.457299438476562e+03, 1.457313110351562e+03, 1.288331787109375e+03, 7.568871459960938e+02, 1.476864013671875e+03, 1.434335083007812e+03, 1.368208374023438e+03, 1.319508056640625e+03, 1.275893432617188e+03, 1.241416137695312e+03, 1.217293579101562e+03, 1.20173779296875e+03, 1.19213232421875e+03, 1.186320678710938e+03, 1.1828359375e+03, 1.180760131835938e+03, 1.179529052734375e+03, 1.178802124023438e+03, 1.178373657226562e+03, 1.178119873046875e+03, 1.1779697265625e+03, 1.177881713867188e+03, 1.177829467773438e+03, 1.177798583984375e+03, 1.177780639648438e+03, 1.177769897460938e+03, 1.177763427734375e+03, 1.177759399414062e+03, 1.177757202148438e+03, 1.177755981445312e+03, 1.17775537109375e+03, 1.177755004882812e+03, 1.1777548828125e+03, 1.177754760742188e+03, 1.1777548828125e+03, 1.1777548828125e+03] -hex.Q2_flow=[0e+00, -9.823609008789062e+02, -1.40096826171875e+03, -1.01654931640625e+03, -1.494255859375e+03, -9.302499389648438e+02, -1.525973266601562e+03, -8.844354248046869e+02, -5.766068725585938e+02, -6.429981689453125e+02, -8.349686889648438e+02, -1.023248840332031e+03, -1.12299853515625e+03, -1.15493017578125e+03, -1.162782592773438e+03, -1.16580224609375e+03, -1.16783447265625e+03, -1.101102783203125e+03, -7.145115356445312e+02, -5.269418334960938e+02, -4.438111572265625e+02, -3.901462707519531e+02, -3.518876953125e+02, -3.232227783203125e+02, -3.030870666503906e+02, -2.86881103515625e+02, -2.735665283203125e+02, -2.544134216308593e+02, -2.228457641601562e+02, -2.093706359863281e+02, -2.158947906494141e+02, -2.237151184082031e+02, -2.281623229980469e+02, -2.293626708984375e+02, -2.3112890625e+02, -2.388393707275391e+02, -2.567418212890625e+02, -2.920544128417969e+02, -3.536243591308594e+02, -4.564125366210938e+02, -5.82278076171875e+02, -7.130078735351562e+02, -8.35980224609375e+02, -9.416583251953125e+02, -1.031559326171875e+03, -1.110180053710938e+03, -1.180991577148438e+03, -1.24581591796875e+03, -1.305273803710938e+03, -1.3592626953125e+03, -1.407292236328125e+03, -1.44120068359375e+03, -1.45687255859375e+03, -1.465573852539062e+03, -1.471053466796875e+03, -1.474446899414062e+03, -1.476382934570312e+03, -1.47726171875e+03, -1.47733837890625e+03, -1.48214697265625e+03, -1.479381958007812e+03, -1.473913208007812e+03, -1.468219604492188e+03, -1.462490966796875e+03, -1.457040405273438e+03, -1.457309692382812e+03, -1.457313720703125e+03, -1.373270263671875e+03, -8.44130126953125e+02, -1.343333129882812e+03, -1.429890625e+03, -1.386951171875e+03, -1.338377197265625e+03, -1.29113818359375e+03, -1.252255981445312e+03, -1.224331787109375e+03, -1.20606494140625e+03, -1.194725830078125e+03, -1.187861694335938e+03, -1.183749145507812e+03, -1.181300415039062e+03, -1.17984814453125e+03, -1.178990356445312e+03, -1.178484985351562e+03, -1.178185668945312e+03, -1.17800830078125e+03, -1.177904541015625e+03, -1.177843017578125e+03, -1.177806518554688e+03, -1.177785278320312e+03, -1.177772705078125e+03, -1.177765014648438e+03, -1.17776025390625e+03, -1.177757568359375e+03, -1.177756103515625e+03, -1.177755493164062e+03, -1.177755126953125e+03, -1.1777548828125e+03, -1.1777548828125e+03, -1.1777548828125e+03, -1.1777548828125e+03] -hex.QLat2_flow=[0e+00, -6.118687744140625e+02, -8.875252075195312e+02, -6.390120849609375e+02, -9.306366577148438e+02, -5.805853881835938e+02, -9.608472900390625e+02, -5.485404663085934e+02, -3.387897338867188e+02, -3.864946594238281e+02, -5.202697143554688e+02, -6.45977783203125e+02, -7.095077514648438e+02, -7.291743774414062e+02, -7.339454956054688e+02, -7.358116455078125e+02, -7.370817260742188e+02, -6.929219970703125e+02, -4.353491821289062e+02, -3.037178344726562e+02, -2.433479919433594e+02, -2.037762756347656e+02, -1.753660736083984e+02, -1.539808502197266e+02, -1.393938446044922e+02, -1.273692474365234e+02, -1.174692077636719e+02, -1.034595260620116e+02, -7.991397094726557e+01, -6.953504180908203e+01, -7.432122039794922e+01, -8.017205047607422e+01, -8.349315643310547e+01, -8.439765930175781e+01, -8.562483215332031e+01, -9.130222320556641e+01, -1.044275588989258e+02, -1.302554168701172e+02, -1.750077362060547e+02, -2.512617492675781e+02, -3.421306457519531e+02, -4.359482421875e+02, -5.208724365234375e+02, -5.920370483398438e+02, -6.511632690429688e+02, -7.01760986328125e+02, -7.46406982421875e+02, -7.864715576171875e+02, -8.225046997070312e+02, -8.546004028320312e+02, -8.826246337890625e+02, -9.018363037109375e+02, -9.1048974609375e+02, -9.153230590820312e+02, -9.183797607421875e+02, -9.202758178710938e+02, -9.213616943359375e+02, -9.218600463867188e+02, -9.219122314453125e+02, -9.2477880859375e+02, -9.230382690429688e+02, -9.19927734375e+02, -9.167344970703125e+02, -9.135220336914062e+02, -9.104606323242188e+02, -9.106502075195312e+02, -9.106529541015625e+02, -8.585176391601562e+02, -5.237025756835938e+02, -8.5232861328125e+02, -8.952094116210938e+02, -8.693079223632812e+02, -8.4073681640625e+02, -8.1267822265625e+02, -7.893203735351562e+02, -7.723917846679688e+02, -7.612457275390625e+02, -7.54296630859375e+02, -7.500780029296875e+02, -7.475458984375e+02, -7.460366821289062e+02, -7.451409912109375e+02, -7.4461181640625e+02, -7.442999877929688e+02, -7.44115234375e+02, -7.440057983398438e+02, -7.439417114257812e+02, -7.439036865234375e+02, -7.438812255859375e+02, -7.438681030273438e+02, -7.438603515625e+02, -7.438555908203125e+02, -7.438526611328125e+02, -7.438510131835938e+02, -7.438501586914062e+02, -7.438497314453125e+02, -7.438494873046875e+02, -7.43849365234375e+02, -7.43849365234375e+02, -7.43849365234375e+02, -7.43849365234375e+02] -hex.QSen2_flow=[0e+00, -3.704920959472656e+02, -5.134429931640625e+02, -3.775372924804688e+02, -5.636192016601562e+02, -3.4966455078125e+02, -5.651259155273438e+02, -3.358949584960936e+02, -2.378171234130859e+02, -2.565035400390625e+02, -3.14698974609375e+02, -3.7727099609375e+02, -4.134908142089844e+02, -4.257558898925781e+02, -4.288370971679688e+02, -4.299906311035156e+02, -4.307527465820312e+02, -4.081807556152344e+02, -2.791623229980469e+02, -2.232239990234375e+02, -2.004631500244141e+02, -1.863699951171875e+02, -1.765216217041016e+02, -1.692419281005859e+02, -1.636932067871094e+02, -1.595118713378906e+02, -1.560973052978516e+02, -1.509539031982422e+02, -1.429317932128906e+02, -1.398355865478516e+02, -1.415735778808594e+02, -1.435430755615234e+02, -1.446691589355469e+02, -1.449650115966797e+02, -1.455040740966797e+02, -1.475371551513672e+02, -1.523142700195312e+02, -1.617989959716797e+02, -1.786166076660156e+02, -2.051508026123047e+02, -2.401474151611328e+02, -2.770596008300781e+02, -3.151077575683594e+02, -3.496212768554688e+02, -3.803960571289062e+02, -4.084190368652344e+02, -4.345846557617188e+02, -4.593443298339844e+02, -4.827690734863281e+02, -5.046622619628906e+02, -5.246676025390625e+02, -5.393643798828125e+02, -5.463828125e+02, -5.502507934570312e+02, -5.526737060546875e+02, -5.541710205078125e+02, -5.55021240234375e+02, -5.554017333984375e+02, -5.554261474609375e+02, -5.573681640625e+02, -5.563436279296875e+02, -5.539854125976562e+02, -5.51485107421875e+02, -5.48968994140625e+02, -5.465797729492188e+02, -5.46659423828125e+02, -5.466608276367188e+02, -5.14752685546875e+02, -3.204275817871094e+02, -4.910045471191406e+02, -5.346812133789062e+02, -5.176432495117188e+02, -4.976403503417969e+02, -4.784598999023438e+02, -4.62935546875e+02, -4.519400024414062e+02, -4.448192749023438e+02, -4.404292602539062e+02, -4.377837219238281e+02, -4.362032470703125e+02, -4.352638244628906e+02, -4.347071533203125e+02, -4.343785400390625e+02, -4.3418505859375e+02, -4.340704345703125e+02, -4.340025634765625e+02, -4.339627990722656e+02, -4.339392395019531e+02, -4.3392529296875e+02, -4.339171752929688e+02, -4.33912353515625e+02, -4.33909423828125e+02, -4.339075927734375e+02, -4.339065856933594e+02, -4.339060363769531e+02, -4.3390576171875e+02, -4.339056396484375e+02, -4.339055480957031e+02, -4.339055480957031e+02, -4.339055480957031e+02, -4.339055480957031e+02] +con.u_m=[2.931499938964844e+02, 2.881471862792969e+02, 2.87445068359375e+02, 2.892804260253906e+02, 2.839074401855469e+02, 2.898592224121094e+02, 2.858396606445312e+02, 2.896683349609375e+02, 2.948144836425781e+02, 2.944845275878906e+02, 2.92626708984375e+02, 2.904584045410156e+02, 2.890348510742188e+02, 2.884890747070312e+02, 2.883429870605469e+02, 2.882951354980469e+02, 2.882662048339844e+02, 2.885406799316406e+02, 2.929256896972656e+02, 2.952376403808594e+02, 2.961017761230469e+02, 2.9662255859375e+02, 2.969822692871094e+02, 2.972456970214844e+02, 2.974364929199219e+02, 2.975864562988281e+02, 2.977091674804688e+02, 2.978599853515625e+02, 2.981323852539062e+02, 2.982776184082031e+02, 2.982389831542969e+02, 2.981738891601562e+02, 2.981339721679688e+02, 2.9812060546875e+02, 2.981119995117188e+02, 2.980509033203125e+02, 2.979117431640625e+02, 2.976292724609375e+02, 2.971193542480469e+02, 2.962572326660156e+02, 2.950943908691406e+02, 2.938199157714844e+02, 2.925000610351562e+02, 2.912912902832031e+02, 2.902103576660156e+02, 2.892289428710938e+02, 2.883155822753906e+02, 2.874531555175781e+02, 2.866370239257812e+02, 2.858726806640625e+02, 2.851713256835938e+02, 2.846004638671875e+02, 2.842942199707031e+02, 2.841333923339844e+02, 2.840351867675781e+02, 2.839736938476562e+02, 2.839374389648438e+02, 2.839192199707031e+02, 2.839146118164062e+02, 2.838818054199219e+02, 2.838653564453125e+02, 2.839319763183594e+02, 2.840171203613281e+02, 2.841050720214844e+02, 2.841924133300781e+02, 2.842044677734375e+02, 2.842045288085938e+02, 2.842248229980469e+02, 2.846465759277344e+02, 2.853110656738281e+02, 2.8603466796875e+02, 2.866990966796875e+02, 2.87218994140625e+02, 2.875774841308594e+02, 2.878054809570312e+02, 2.879446411132812e+02, 2.880281372070312e+02, 2.880778503417969e+02, 2.881072692871094e+02, 2.88124755859375e+02, 2.881350708007812e+02, 2.881412658691406e+02, 2.881448669433594e+02, 2.8814697265625e+02, 2.88148193359375e+02, 2.8814892578125e+02, 2.881493530273438e+02, 2.881496276855469e+02, 2.881497802734375e+02, 2.881498718261719e+02, 2.8814990234375e+02, 2.881499328613281e+02, 2.881499633789062e+02, 2.881499633789062e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02, 2.881499938964844e+02] +hex.Q1_flow=[0e+00, 8.008524780273438e+02, 1.5745205078125e+03, 9.59880615234375e+02, 1.509537231445312e+03, 8.314715576171875e+02, 1.715317749023438e+03, 7.318002929687497e+02, 5.667024536132812e+02, 6.5814599609375e+02, 8.624013061523438e+02, 1.050931030273438e+03, 1.137240600585938e+03, 1.159442138671875e+03, 1.164138549804688e+03, 1.166548217773438e+03, 1.168383544921875e+03, 1.056568359375e+03, 6.666577758789062e+02, 5.099210510253906e+02, 4.334978332519531e+02, 3.830565185546875e+02, 3.467546997070312e+02, 3.193574523925781e+02, 2.992366943359375e+02, 2.836629333496094e+02, 2.708905334472656e+02, 2.496359405517577e+02, 2.180829620361328e+02, 2.079718780517578e+02, 2.162033843994141e+02, 2.242107391357422e+02, 2.285458831787109e+02, 2.294739990234375e+02, 2.320791473388672e+02, 2.405070037841797e+02, 2.604395141601562e+02, 2.992701721191406e+02, 3.663821716308594e+02, 4.7263818359375e+02, 6.016305541992188e+02, 7.317265625e+02, 8.542841186523438e+02, 9.589598388671875e+02, 1.047926025390625e+03, 1.126116943359375e+03, 1.196919311523438e+03, 1.261974243164062e+03, 1.321740966796875e+03, 1.375972412109375e+03, 1.424053344726562e+03, 1.453169189453125e+03, 1.463759521484375e+03, 1.47033984375e+03, 1.47471240234375e+03, 1.47731201171875e+03, 1.478698364257812e+03, 1.479172973632812e+03, 1.478926513671875e+03, 1.486780883789062e+03, 1.479451049804688e+03, 1.472607421875e+03, 1.46669287109375e+03, 1.460934692382812e+03, 1.455840209960938e+03, 1.45729541015625e+03, 1.457310302734375e+03, 1.44086572265625e+03, 1.390764526367188e+03, 1.344937744140625e+03, 1.299102661132812e+03, 1.259305419921875e+03, 1.229501953125e+03, 1.20948486328125e+03, 1.19687939453125e+03, 1.189181396484375e+03, 1.184544067382812e+03, 1.181770629882812e+03, 1.180117919921875e+03, 1.179159423828125e+03, 1.178584838867188e+03, 1.17824365234375e+03, 1.178042358398438e+03, 1.177924072265625e+03, 1.177854858398438e+03, 1.177814575195312e+03, 1.177790405273438e+03, 1.17777587890625e+03, 1.177767333984375e+03, 1.177762329101562e+03, 1.177759399414062e+03, 1.177757568359375e+03, 1.177756469726562e+03, 1.177755737304688e+03, 1.177755249023438e+03, 1.1777548828125e+03, 1.177754516601562e+03, 1.17775439453125e+03, 1.177754150390625e+03, 1.177754028320312e+03, 1.177754150390625e+03] +hex.Q2_flow=[0e+00, -9.823670654296875e+02, -1.400969604492188e+03, -1.016562805175781e+03, -1.494252563476562e+03, -9.302456665039062e+02, -1.525967895507812e+03, -8.844346313476557e+02, -5.766284790039062e+02, -6.430133666992188e+02, -8.349697265625e+02, -1.023242858886719e+03, -1.123073364257812e+03, -1.15489599609375e+03, -1.162775146484375e+03, -1.165800537109375e+03, -1.167833374023438e+03, -1.101104370117188e+03, -7.145556030273438e+02, -5.269667358398438e+02, -4.438186645507812e+02, -3.901510620117188e+02, -3.5189111328125e+02, -3.232251281738281e+02, -3.030906066894531e+02, -2.868833618164062e+02, -2.735691223144531e+02, -2.544220275878905e+02, -2.228554077148437e+02, -2.093755950927734e+02, -2.158961944580078e+02, -2.237143402099609e+02, -2.281635284423828e+02, -2.293612213134766e+02, -2.311274566650391e+02, -2.388428497314453e+02, -2.567422485351562e+02, -2.920486755371094e+02, -3.536205444335938e+02, -4.564024353027344e+02, -5.822686767578125e+02, -7.1299755859375e+02, -8.359698486328125e+02, -9.416398315429688e+02, -1.031558349609375e+03, -1.110177368164062e+03, -1.180996215820312e+03, -1.245819702148438e+03, -1.305273193359375e+03, -1.359256958007812e+03, -1.407293823242188e+03, -1.441200927734375e+03, -1.456876831054688e+03, -1.4655693359375e+03, -1.471063598632812e+03, -1.474442993164062e+03, -1.476375244140625e+03, -1.477261108398438e+03, -1.477337646484375e+03, -1.4821474609375e+03, -1.479382690429688e+03, -1.473913208007812e+03, -1.4682197265625e+03, -1.462490966796875e+03, -1.457044921875e+03, -1.457308471679688e+03, -1.457312866210938e+03, -1.449156616210938e+03, -1.41054638671875e+03, -1.364805419921875e+03, -1.31637255859375e+03, -1.272501342773438e+03, -1.238522583007812e+03, -1.215185913085938e+03, -1.200334228515625e+03, -1.1912412109375e+03, -1.185767578125e+03, -1.182498168945312e+03, -1.180558349609375e+03, -1.179417114257812e+03, -1.17873779296875e+03, -1.178330810546875e+03, -1.17809375e+03, -1.17795458984375e+03, -1.177873046875e+03, -1.177825317382812e+03, -1.177796875e+03, -1.17777978515625e+03, -1.177769653320312e+03, -1.177763793945312e+03, -1.177760375976562e+03, -1.177758178710938e+03, -1.1777568359375e+03, -1.177755981445312e+03, -1.17775537109375e+03, -1.177755004882812e+03, -1.177754516601562e+03, -1.17775439453125e+03, -1.177754150390625e+03, -1.17775390625e+03, -1.177754028320312e+03] +hex.QLat2_flow=[0e+00, -6.118740844726562e+02, -8.87526611328125e+02, -6.39020751953125e+02, -9.306354370117188e+02, -5.805825805664062e+02, -9.6084326171875e+02, -5.485398559570309e+02, -3.388067016601562e+02, -3.865060119628906e+02, -5.202728881835938e+02, -6.459698486328125e+02, -7.095833740234375e+02, -7.291434326171875e+02, -7.339407958984375e+02, -7.358106079101562e+02, -7.37081298828125e+02, -6.92923095703125e+02, -4.35383544921875e+02, -3.037465209960938e+02, -2.433535308837891e+02, -2.037796783447266e+02, -1.753681945800781e+02, -1.539824066162109e+02, -1.393966064453125e+02, -1.273708801269531e+02, -1.174711685180664e+02, -1.034645156860351e+02, -7.992140960693354e+01, -6.953993988037109e+01, -7.432206726074219e+01, -8.017134857177734e+01, -8.349410247802734e+01, -8.439630126953125e+01, -8.562378692626953e+01, -9.130491638183594e+01, -1.044278869628906e+02, -1.302513275146484e+02, -1.750060272216797e+02, -2.512543792724609e+02, -3.421239318847656e+02, -4.359411315917969e+02, -5.208651123046875e+02, -5.920211791992188e+02, -6.511651000976562e+02, -7.017588500976562e+02, -7.464093627929688e+02, -7.864749755859375e+02, -8.225046997070312e+02, -8.545948486328125e+02, -8.826276245117188e+02, -9.01836181640625e+02, -9.104949340820312e+02, -9.153184814453125e+02, -9.183887939453125e+02, -9.202698974609375e+02, -9.213551025390625e+02, -9.218597412109375e+02, -9.219119262695312e+02, -9.24779052734375e+02, -9.230391235351562e+02, -9.199277954101562e+02, -9.167344970703125e+02, -9.135220336914062e+02, -9.104631958007812e+02, -9.106494750976562e+02, -9.1065234375e+02, -9.056475830078125e+02, -8.829721069335938e+02, -8.56291748046875e+02, -8.277177734375e+02, -8.015123901367188e+02, -7.810126953125e+02, -7.66818603515625e+02, -7.577352294921875e+02, -7.521535034179688e+02, -7.487863159179688e+02, -7.467714233398438e+02, -7.455745239257812e+02, -7.44875732421875e+02, -7.444579467773438e+02, -7.442048950195312e+02, -7.440585327148438e+02, -7.439725952148438e+02, -7.439223022460938e+02, -7.43892822265625e+02, -7.43875244140625e+02, -7.438646850585938e+02, -7.438584594726562e+02, -7.438548583984375e+02, -7.438527221679688e+02, -7.438513793945312e+02, -7.438505859375e+02, -7.438500366210938e+02, -7.438496704101562e+02, -7.43849365234375e+02, -7.4384912109375e+02, -7.438490600585938e+02, -7.43848876953125e+02, -7.438487548828125e+02, -7.438488159179688e+02] +hex.QSen2_flow=[0e+00, -3.704929809570312e+02, -5.134429931640625e+02, -3.775420837402344e+02, -5.636171875e+02, -3.496630859375e+02, -5.651245727539062e+02, -3.358947753906248e+02, -2.3782177734375e+02, -2.565073547363281e+02, -3.146968688964844e+02, -3.772730102539062e+02, -4.134899597167969e+02, -4.257525939941406e+02, -4.288344116210938e+02, -4.299899597167969e+02, -4.307520751953125e+02, -4.081813659667969e+02, -2.791720275878906e+02, -2.232202301025391e+02, -2.004651336669922e+02, -1.863713989257812e+02, -1.765229187011719e+02, -1.692427215576172e+02, -1.636940155029297e+02, -1.595124969482422e+02, -1.560979309082031e+02, -1.5095751953125e+02, -1.429339904785156e+02, -1.398356628417969e+02, -1.415741271972656e+02, -1.435429840087891e+02, -1.446694183349609e+02, -1.449649200439453e+02, -1.455036773681641e+02, -1.475379333496094e+02, -1.523143615722656e+02, -1.6179736328125e+02, -1.786145172119141e+02, -2.051480560302734e+02, -2.401447448730469e+02, -2.770564270019531e+02, -3.151047668457031e+02, -3.496186828613281e+02, -3.803932189941406e+02, -4.084185485839844e+02, -4.345869445800781e+02, -4.593447265625e+02, -4.827685241699219e+02, -5.046621398925781e+02, -5.246661987304688e+02, -5.393646850585938e+02, -5.463818969726562e+02, -5.502509155273438e+02, -5.526747436523438e+02, -5.54173095703125e+02, -5.550200805664062e+02, -5.554014282226562e+02, -5.5542578125e+02, -5.573683471679688e+02, -5.563436279296875e+02, -5.539854125976562e+02, -5.514851684570312e+02, -5.48968994140625e+02, -5.465816650390625e+02, -5.466590576171875e+02, -5.466604614257812e+02, -5.435089721679688e+02, -5.275743408203125e+02, -5.085137023925781e+02, -4.8865478515625e+02, -4.709889221191406e+02, -4.575098571777344e+02, -4.483673706054688e+02, -4.425989990234375e+02, -4.390877380371094e+02, -4.36981201171875e+02, -4.35726806640625e+02, -4.349838256835938e+02, -4.345413513183594e+02, -4.342798156738281e+02, -4.341258850097656e+02, -4.340352478027344e+02, -4.339819641113281e+02, -4.339507751464844e+02, -4.339324951171875e+02, -4.339215698242188e+02, -4.339150390625e+02, -4.339111938476562e+02, -4.33908935546875e+02, -4.339076232910156e+02, -4.339067993164062e+02, -4.339062805175781e+02, -4.339059448242188e+02, -4.339057312011719e+02, -4.339055480957031e+02, -4.339053955078125e+02, -4.339053649902344e+02, -4.339052429199219e+02, -4.339051818847656e+02, -4.339052124023438e+02] From 0a8bd364d374c26d36b54aff9ae6f523fdb8ff28 Mon Sep 17 00:00:00 2001 From: SenHuang19 Date: Thu, 29 Aug 2024 07:51:49 -0400 Subject: [PATCH 3/4] make the tuning stop when the setppint changes --- .../Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo | 12 ++++++------ .../FirstOrderTimedelayed/ControlProcessModel.mo | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo index 33999f6fe19..13741ea8db9 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo @@ -354,7 +354,7 @@ equation {-20,-140}}, color={0,0,127})); connect(rel.u_s, u_s) annotation (Line(points={{-62,130},{-158,130},{-158,-20}, {-200,-20}},color={0,0,127})); - connect(sam_u_s.u, u_s) annotation (Line(points={{-124,294},{-154,294},{-154, + connect(sam_u_s.u, u_s) annotation (Line(points={{-124,294},{-142,294},{-142, 254},{-170,254},{-170,-20},{-200,-20}}, color={0,0,127})); connect(sam_u_s.y, sub3.u1) annotation (Line(points={{-100,294},{-48,294},{ -48,280},{-42,280}}, color={0,0,127})); @@ -376,18 +376,18 @@ equation {-14,56},{-14,-90},{60,-90},{60,-140}}, color={255,0,255})); connect(abs2.y, greThr.u) annotation (Line(points={{22,294},{30,294},{30,300},{38,300}}, color={0,0,127})); - connect(nand1.u2, triTun) annotation (Line(points={{92,292},{54,292},{54,260}, + connect(nand1.u2, triTun) annotation (Line(points={{92,292},{80,292},{80,260}, {-112,260},{-112,56},{60,56},{60,-140}}, color={255,0,255})); connect(falEdg.u, nand1.y) annotation (Line(points={{-150,230},{-156,230},{ -156,316},{124,316},{124,300},{116,300}}, color={255,0,255})); connect(falEdg.y, or2.u1) annotation (Line(points={{-126,230},{-86,230}}, color={255,0,255})); - connect(resPro.triEnd, or2.u2) annotation (Line(points={{22,102},{-2,102},{-2, - 64},{-124,64},{-124,222},{-86,222}}, color={255,0,255})); + connect(resPro.triEnd, or2.u2) annotation (Line(points={{22,102},{24,102},{24, + 64},{-98,64},{-98,222},{-86,222}}, color={255,0,255})); connect(or2.y, inTunPro.clr) annotation (Line(points={{-62,230},{-62,146},{ -70,146},{-70,24},{-42,24}}, color={255,0,255})); - connect(conProMod.triEnd, or2.y) annotation (Line(points={{48,152},{48,150},{ - -12,150},{-12,230},{-62,230}}, color={255,0,255})); + connect(conProMod.triEnd, resPro.triEnd) + annotation (Line(points={{48,152},{48,102},{22,102}}, color={255,0,255})); annotation (defaultComponentName = "PIDWitTun", Documentation(info="

diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo index c7408705d41..9e65a51b799 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo @@ -123,7 +123,7 @@ protected annotation (Placement(transformation(extent={{80,-80},{100,-60}}))); Buildings.Controls.OBC.CDL.Utilities.Assert assMes4(message="In " + getInstanceName() + - ": an autotuning fails, see earlier warnings for possible reasons, the controller gains are unchanged.") + ": an autotuning fails, the controller gains are unchanged.") "Warning message when an autotuning fails" annotation (Placement(transformation(extent={{134,50},{154,70}}))); Buildings.Controls.OBC.CDL.Logical.Not not2 "Check if an error occurs" From 3c24f43f62baf7f6ae3258269c814b326d762d86 Mon Sep 17 00:00:00 2001 From: SenHuang19 Date: Thu, 29 Aug 2024 22:26:25 -0400 Subject: [PATCH 4/4] format improve --- .../PIDWithAutotuning/FirstOrderAMIGO.mo | 74 +++++++------------ 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo index 13741ea8db9..90ed0bf547f 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo @@ -144,13 +144,13 @@ block FirstOrderAMIGO Buildings.Controls.OBC.CDL.Logical.Latch inTunPro "Outputs true if the controller is conducting the autotuning process" annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); - Buildings.Controls.OBC.CDL.Logical.FallingEdge falEdg "Check if the setpoint changes during an autotuning process" annotation (Placement(transformation(extent={{-148,220},{-128,240}}))); Buildings.Controls.OBC.CDL.Logical.Or or2 "Check if the autotuning is completed or aborted" annotation (Placement(transformation(extent={{-84,220},{-64,240}}))); + protected final parameter Boolean with_D=controllerType == Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Types.SimpleController.PID "Boolean flag to enable derivative action" @@ -231,9 +231,9 @@ protected final h=0.5*setHys) "Check if the setpoint changes" annotation (Placement(transformation(extent={{40,290},{60,310}}))); - Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(message="In " + - getInstanceName() + - ": the setpoint must not change when an autotuning tuning is ongoing. This ongoing autotuning will thus abort.") + Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(message= + "In " + getInstanceName() + + ": the setpoint must not change when an autotuning tuning is ongoing. This ongoing autotuning will thus abort.") "Warning message when the setpoint changes during tuning process" annotation (Placement(transformation(extent={{150,290},{170,310}}))); @@ -249,81 +249,63 @@ equation connect(samTd.y,con. Td) annotation (Line(points={{-118,-100},{-60,-100},{-60, -64},{-52,-64}}, color={0,0,127})); connect(resPro.on, rel.yOn) annotation (Line(points={{-2,110},{-30,110},{-30, - 124},{-38,124}}, - color={255,0,255})); + 124},{-38,124}}, color={255,0,255})); connect(modTim.y, resPro.tim) annotation (Line(points={{-138,190},{-4,190},{ - -4,126},{-10,126},{-10,116},{-2,116}}, - color={0,0,127})); + -4,126},{-10,126},{-10,116},{-2,116}}, color={0,0,127})); connect(resPro.tau, conProMod.tau) annotation (Line(points={{22,110},{30,110}, - {30,156}}, color={0,0,127})); + {30,156}}, color={0,0,127})); connect(conProMod.tOff, resPro.tOff) annotation (Line(points={{30,160},{26, - 160},{26,114},{22,114}}, - color={0,0,127})); + 160},{26,114},{22,114}}, color={0,0,127})); connect(resPro.tOn, conProMod.tOn) annotation (Line(points={{22,118},{22,168}, - {30,168}}, color={0,0,127})); + {30,168}}, color={0,0,127})); connect(rel.yDif, conProMod.u) annotation (Line(points={{-38,130},{18,130},{ - 18,172},{30,172}}, - color={0,0,127})); + 18,172},{30,172}}, color={0,0,127})); connect(PIDPar.kp, conProMod.k) annotation (Line(points={{78,108},{64,108},{ - 64,172},{54,172}}, - color={0,0,127})); + 64,172},{54,172}}, color={0,0,127})); connect(PIDPar.T, conProMod.T) annotation (Line(points={{78,102},{60,102},{60, - 148},{62,148},{62,168},{54,168}}, - color={0,0,127})); + 148},{62,148},{62,168},{54,168}}, color={0,0,127})); connect(PIDPar.L, conProMod.L) annotation (Line(points={{78,96},{58,96},{58, - 150},{60,150},{60,160},{54,160}}, - color={0,0,127})); + 150},{60,150},{60,160},{54,160}}, color={0,0,127})); connect(PIDPar.k, samk.u) annotation (Line(points={{102,109},{102,110},{146, - 110},{146,78},{-154,78},{-154,-40},{-102,-40}}, - color={0,0,127})); + 110},{146,78},{-154,78},{-154,-40},{-102,-40}}, color={0,0,127})); connect(PIDPar.Ti, samTi.u) annotation (Line(points={{102,102},{118,102},{118, - -6},{-124,-6},{-124,-70},{-122,-70}}, - color={0,0,127})); + -6},{-124,-6},{-124,-70},{-122,-70}}, color={0,0,127})); connect(PIPar.kp, conProMod.k) annotation (Line(points={{82,172},{54,172}}, - color={0,0,127})); + color={0,0,127})); connect(PIPar.T, conProMod.T) annotation (Line(points={{82,166},{62,166},{62, - 168},{54,168}}, - color={0,0,127})); - connect(PIPar.L, conProMod.L) annotation (Line(points={{82,160},{54,160}}, - color={0,0,127})); + 168},{54,168}}, color={0,0,127})); + connect(PIPar.L, conProMod.L) annotation (Line(points={{82,160},{54,160}}, color={0,0,127})); connect(PIPar.k, samk.u) annotation (Line(points={{106,172},{156,172},{156,70}, {-148,70},{-148,-40},{-102,-40}},color={0,0,127})); connect(PIPar.Ti, samTi.u) annotation (Line(points={{106,160},{166,160},{166, - 48},{-140,48},{-140,-70},{-122,-70}}, - color={0,0,127})); + 48},{-140,48},{-140,-70},{-122,-70}}, color={0,0,127})); connect(resPro.triSta, conProMod.triSta) annotation (Line(points={{22,106},{ - 36,106},{36,152}}, - color={255,0,255})); + 36,106},{36,152}}, color={255,0,255})); connect(PIDPar.Td, samTd.u) annotation (Line(points={{102,95},{102,94},{112, - 94},{112,88},{-162,88},{-162,-100},{-142,-100}}, - color={0,0,127})); + 94},{112,88},{-162,88},{-162,-100},{-142,-100}}, color={0,0,127})); connect(swi.y, y) annotation (Line(points={{162,-20},{200,-20}}, color={0,0,127})); connect(u_m,con. u_m) annotation (Line(points={{-20,-140},{-20,-110},{-40,-110}, {-40,-72}}, color={0,0,127})); connect(swi.u3,con. y) annotation (Line(points={{138,-28},{56,-28},{56,-60},{ - -28,-60}}, - color={0,0,127})); + -28,-60}}, color={0,0,127})); connect(inTunPro.y, swi.u2) annotation (Line(points={{-18,30},{-6,30},{-6,-20}, {138,-20}}, color={255,0,255})); connect(inTunPro.u, triTun) annotation (Line(points={{-42,30},{-56,30},{-56, - 46},{-14,46},{-14,-90},{60,-90},{60,-140}}, - color={255,0,255})); + 46},{-14,46},{-14,-90},{60,-90},{60,-140}}, color={255,0,255})); connect(rel.trigger, triTun) annotation (Line(points={{-56,118},{-56,108},{ - -90,108},{-90,56},{60,56},{60,-140}}, - color={255,0,255})); + -90,108},{-90,56},{60,56},{60,-140}}, color={255,0,255})); connect(resPro.trigger, triTun) annotation (Line(points={{-2,104},{-14,104},{ - -14,-90},{60,-90},{60,-140}}, - color={255,0,255})); + -14,-90},{60,-90},{60,-140}}, color={255,0,255})); connect(nand.y, assMes1.u) annotation (Line(points={{102,30},{138,30}}, color={255,0,255})); connect(nand.u2, edgReq.y) annotation (Line(points={{78,22},{40,22},{40,-40},{34,-40}}, color={255,0,255})); connect(edgReq.u, triTun) annotation (Line(points={{10,-40},{-14,-40},{-14,-90},{60,-90},{60,-140}}, - color={255,0,255})); + color={255,0,255})); connect(tunStaDel.y, nand.u1) annotation (Line(points={{32,30},{78,30}}, color={255,0,255})); connect(tunStaDel.u, inTunPro.y) annotation (Line(points={{8,30},{-18,30}}, - color={255,0,255})); + color={255,0,255})); connect(con1.y, sub.u1) annotation (Line(points={{-138,400},{-108,400},{-108, 386},{-102,386}}, color={0,0,127})); connect(con2.y, sub.u2) annotation (Line(points={{-138,370},{-110,370},{-110, @@ -343,7 +325,7 @@ equation connect(gre.y, assMes2.u) annotation (Line(points={{82,380},{148,380}},color={255,0,255})); connect(con4.y, gre.u2) annotation (Line(points={{22,388},{58,388}}, - color={0,0,127})); + color={0,0,127})); connect(rel.y, yRel.u) annotation (Line(points={{-38,136},{-6,136},{-6,220},{ 38,220}}, color={0,0,127})); connect(yRel.y, addPar.u)