diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/AutoTuner/AMIGO/PID.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/AutoTuner/AMIGO/PID.mo index 8918f37119c..621c305ffd9 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/AutoTuner/AMIGO/PID.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/AutoTuner/AMIGO/PID.mo @@ -48,7 +48,7 @@ protected annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); equation - connect(derTim.Td, Td) + connect(derTim.Td, Td) annotation (Line(points={{12,-60},{120,-60}}, color={0,0,127})); connect(intTim.Ti, Ti) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/HalfPeriodRatio.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/HalfPeriodRatio.mo index ad2deaaf0b5..1cd6c315233 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/HalfPeriodRatio.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/HalfPeriodRatio.mo @@ -38,12 +38,12 @@ protected final k=0) "Minimum value for the horizon length" annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); - Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler tOnSam(final y_start= - Buildings.Controls.OBC.CDL.Constants.eps) + Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler tOnSam( + final y_start=Buildings.Controls.OBC.CDL.Constants.eps) "Block that samples tOn when the tuning period ends" annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); - Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler tOffSam(final y_start= - Buildings.Controls.OBC.CDL.Constants.eps) + Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler tOffSam( + final y_start=Buildings.Controls.OBC.CDL.Constants.eps) "Block that samples tOff when the tuning period ends" annotation (Placement(transformation(extent={{-80,-60},{-60,-80}}))); Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samAddtOntOff @@ -175,10 +175,10 @@ lengths of the On period and the Off period, respectively. An On period is defined as the period when the relay switch output of the relay controller is true. Likewise, an Off period is defined as the period when the relay switch output is false. -See details of the relay switch output in +See details of the relay switch output in + Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller.

-

This block also detects when a PID tuning period should start and end. Specifically, the tuning period is triggered to begin when either ton @@ -186,8 +186,8 @@ or toff becomes positive. The tuning period is triggered to end when either ton or toff changes after the tuning period starts, as illustrated below:

-

-\"image\" +

+\"image\"

References

diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOffPeriod.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOffPeriod.mo index 3657091a883..ce58c3f0c51 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOffPeriod.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOffPeriod.mo @@ -118,8 +118,8 @@ First implementation
This block processes a relay switch output and calculates the length of the On period, tOn, and the length of the Off period, tOff, as shown below.

-

-\"image\" +

+\"image\"

Note that tOn is sampled when the relay switch output becomes false. diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/HalfPeriodRatio.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/HalfPeriodRatio.mo index 14c9885e879..d98898a9c54 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/HalfPeriodRatio.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/HalfPeriodRatio.mo @@ -76,13 +76,16 @@ Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.HalfPeriodR

diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/NormalizedTimeDelay.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/NormalizedTimeDelay.mo index aba2d92ab16..ef33d42ca63 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/NormalizedTimeDelay.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/Validation/NormalizedTimeDelay.mo @@ -2,7 +2,7 @@ within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Vali model NormalizedTimeDelay "Test model for calculating the normalized time delay" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.NormalizedTimeDelay norTimDel(gamma=3) "Calculate the normalized time delay" - annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse rho( amplitude=1, width=0.7, @@ -12,7 +12,7 @@ model NormalizedTimeDelay "Test model for calculating the normalized time delay" annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation connect(rho.y, norTimDel.rho) - annotation (Line(points={{-28,0},{-10,0}}, color={0,0,127})); + annotation (Line(points={{-28,0},{-12,0}}, color={0,0,127})); annotation ( experiment( StopTime=1.0, diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Controller.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Controller.mo index 98afb5c65fe..de387db0da7 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Controller.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Controller.mo @@ -120,8 +120,8 @@ equation fillPattern=FillPattern.Solid, fillColor={175,175,175}, textString="Relay"), - Line(points={{-70,24},{-34,24},{-34,58},{38,58},{38,24},{66,24}}, color= - {28,108,200})}), Diagram( + Line(points={{-70,24},{-34,24},{-34,58},{38,58},{38,24},{66,24}}, color + ={28,108,200})}), Diagram( coordinateSystem(preserveAspectRatio=false)), Documentation(info="

diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/ResponseProcess.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/ResponseProcess.mo index efd36089ae9..08e85830e74 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/ResponseProcess.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/ResponseProcess.mo @@ -6,7 +6,7 @@ block ResponseProcess parameter Real yLow(min=1E-6) = 0.5 "Lower value for the output"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput on - "Relay switch. True: tuning on perid, False: tuningoff period" + "Relay switch. True: tuning on perid, False: tuning off period" annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}), iconTransformation(extent={{-140,-80},{-100,-40}}))); Buildings.Controls.OBC.CDL.Interfaces.RealInput tim( diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/TimeConstantDelay.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/TimeConstantDelay.mo index 2ef0cd3ec72..339a1456aa6 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/TimeConstantDelay.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/TimeConstantDelay.mo @@ -18,7 +18,7 @@ block TimeConstantDelay "Gain" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}), iconTransformation(extent={{-140,-20},{-100,20}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealInput ratioLT + Buildings.Controls.OBC.CDL.Interfaces.RealInput rat "Ratio between the time constant and the time delay" annotation (Placement(transformation(extent={{-140,-70},{-100,-30}}), iconTransformation(extent={{-140,-80},{-100,-40}}))); @@ -85,7 +85,7 @@ protected equation connect(absk.u, k) annotation (Line(points={{-82,0},{-120,0}}, color={0,0,127})); - connect(ratioLT, exp.u) + connect(rat, exp.u) annotation (Line(points={{-120,-50},{-82,-50}}, color={0,0,127})); connect(relDeaBan.y, div1.u1) annotation (Line(points={{22,40},{28,40},{28,0}, {-4,0},{-4,-14},{-2,-14}}, color={0,0,127})); @@ -116,8 +116,7 @@ equation connect(div3.y, T) annotation (Line(points={{-18,70},{120,70}}, color={0,0,127})); connect(mul2.u2, T) annotation (Line(points={{-2,78},{-10,78},{-10,70},{120, - 70}}, - color={0,0,127})); + 70}}, color={0,0,127})); connect(mul2.u1, exp.u) annotation (Line(points={{-2,90},{-90,90},{-90,-50},{-82, -50}}, color={0,0,127})); connect(mul2.y, L) annotation (Line(points={{22,84},{92,84},{92,-60},{120,-60}}, diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mo index 6cc7db7289d..41fcc681a3f 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mo @@ -27,8 +27,8 @@ equation 6},{-12,6}}, color={0,0,127})); connect(k.y, timConDel.k) annotation (Line(points={{-38,0},{-12,0}}, color={0,0,127})); - connect(ratioLT.y, timConDel.ratioLT) annotation (Line(points={{-38,-40},{-20, - -40},{-20,-6},{-12,-6}}, color={0,0,127})); + connect(ratioLT.y, timConDel.rat) annotation (Line(points={{-38,-40},{-20,-40}, + {-20,-6},{-12,-6}}, color={0,0,127})); annotation ( experiment( StopTime=1.0, diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo index 6dc8a6be0a8..871b949f93d 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/ControlProcessModel.mo @@ -100,7 +100,8 @@ protected final y_start=1) "Block that samples the time constant when the tuning period ends" annotation (Placement(transformation(extent={{70,10},{90,30}}))); - Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samtau(final y_start=0.5) + Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samtau( + final y_start=0.5) "Block that samples the normalized time delay when the tuning period ends" annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai( @@ -110,8 +111,7 @@ protected equation connect(gain.u, u) annotation (Line(points={{-86,28},{-88,28},{-88,80},{-120, - 80}}, - color={0,0,127})); + 80}}, color={0,0,127})); connect(gain.tOn, tOn) annotation (Line(points={{-86,20},{-94,20},{-94,40},{ -120,40}}, color={0,0,127})); connect(gain.tOff, tOff) annotation (Line(points={{-86,12},{-94,12},{-94,-20}, @@ -137,19 +137,15 @@ equation color={0,0,127})); connect(samk.trigger, triEnd) annotation (Line(points={{-44,8},{-44,-90},{80, -90},{80,-120}}, color={255,0,255})); - connect(gain.k, samk.u) - annotacolor={0,0,127})); connect(samk.y, k) annotation (Line(points={{-32,20},{-20,20},{-20,70},{120, - 70}}, - color={0,0,127})); + 70}}, color={0,0,127})); connect(timConDel.tOn, samtOn.y) annotation (Line(points={{-2,26},{-28,26},{ -28,60},{-48,60}},color={0,0,127})); connect(samtOn.u, tOn) annotation (Line(points={{-72,60},{-94,60},{-94,40},{-120,40}}, color={0,0,127})); connect(samtOn.trigger, triEnd) annotation (Line(points={{-60,48},{-60,-20},{ - -44,-20},{-44,-90},{80,-90},{80,-120}}, - color={255,0,255})); + -44,-20},{-44,-90},{80,-90},{80,-120}}, color={255,0,255})); connect(gai.y, addPar.u) annotation (Line(points={{-14,-60},{-10,-60}}, color={0,0,127})); connect(tau, samtau.u) @@ -162,9 +158,11 @@ equation -60,-90},{-60,-72}}, color={255,0,255})); connect(addPar.y, div.u2) annotation (Line(points={{14,-60},{20,-60},{20,-40}, {6,-40},{6,-26},{10,-26}}, color={0,0,127})); - connect(div.y, timConDel.ratioLT) annotation (Line(points={{34,-20},{36,-20}, - {36,0},{-12,0},{-12,14},{-2,14}}, color={0,0,127})); - annotation ( + connect(div.y, timConDel.rat) annotation (Line(points={{34,-20},{36,-20},{36, + 0},{-12,0},{-12,14},{-2,14}}, color={0,0,127})); + connect(gain.k, samk.u) + annotation (Line(points={{-62,20},{-56,20}}, color={0,0,127})); +annotation ( defaultComponentName = "conProMod", Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( @@ -192,7 +190,7 @@ equation 34}}, color={28,108,200}), Line(points={{-58,36},{82,36}}, color={28,108,200}, pattern=LinePattern.Dash)}), - Diagram(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false)), Documentation(revisions="

", info=" -

This block calculates the model parameters of a first-order time delayed model. -Specifically, it employs -Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimedelayed.BaseClasses.Gain and +

+This block calculates the model parameters of a first-order time delayed model. +Specifically, it employs + +Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimedelayed.BaseClasses.Gain +and + Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimedelayed.BaseClasses.TimeConstantDelay -to identify the gain and the time constant/the time delay, respectively.

-

This block is inactive by default and is active once the tuning period starts, i.e., triSta becomes true; -It then calculates the model parameters at the time when the tuning period ends, i.e., triEnd becomes true. +to identify the gain, the time constant and the time delay, respectively. +

+

+The calculations are disabled by default. They will be enabled once the tuning period starts, +i.e., triSta becomes true; +It then calculates the model parameters at the time when the tuning period ends, +i.e., triEnd becomes true.

Refer to -Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller for detailed explanation of the parameters yHig, yLow, and deaBan. +Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller for detailed explanation +of the parameters yHig, yLow, and deaBan.

")); end ControlProcessModel; diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.png b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.png new file mode 100644 index 00000000000..9076999be0f Binary files /dev/null and b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.png differ diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.svg b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.svg new file mode 100644 index 00000000000..677392e9229 --- /dev/null +++ b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/OnOff.svg @@ -0,0 +1,472 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Time Relay Switch Output True False + + + + + + tOff tOn tOff On period diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.png b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.png new file mode 100644 index 00000000000..49a18a11db4 Binary files /dev/null and b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.png differ diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.svg b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.svg new file mode 100644 index 00000000000..da5bd64f78f --- /dev/null +++ b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/algorithm.svg @@ -0,0 +1,449 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tuning Period Time tOff becomespositive Relay Switch Output True False tOff changesafter the tuningperiod starts + diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Onoff.png b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Onoff.png deleted file mode 100644 index 8df6d9259ae..00000000000 Binary files a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/Onoff.png and /dev/null differ diff --git a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/algorithm.png b/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/algorithm.png deleted file mode 100644 index 25617c41edd..00000000000 Binary files a/Buildings/Resources/Images/Controls/OBC/Utilities/PIDWithAutotuning/Relay/algorithm.png and /dev/null differ diff --git a/Buildings/Resources/Scripts/Dymola/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mos b/Buildings/Resources/Scripts/Dymola/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mos index 13d8afd483d..f2ce5275f20 100644 --- a/Buildings/Resources/Scripts/Dymola/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mos +++ b/Buildings/Resources/Scripts/Dymola/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimedelayed/BaseClasses/Validation/TimeConstantDelay.mos @@ -1,6 +1,6 @@ simulateModel("Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimedelayed.BaseClasses.Validation.TimeConstantDelay", method="Cvode", tolerance=1e-06, resultFile="TimeConstantDelay"); -createPlot(id=1, position={15, 15, 1101, 667}, y={"tOn.y"}, range={0.0, 1.0, -0.1, 0.20000000000000004}, grid=true, subPlot=101, colors={{28,108,200}}); -createPlot(id=1, position={15, 15, 1101, 667}, y={"k.y"}, range={0.0, 1.0, 0.8, 1.2000000000000002}, grid=true, subPlot=102, colors={{28,108,200}}); -createPlot(id=1, position={15, 15, 1101, 667}, y={"ratioLT.y"}, range={0.0, 1.0, 0.20000000000000004, 0.5000000000000001}, grid=true, subPlot=103, colors={{28,108,200}}); -createPlot(id=1, position={15, 15, 1101, 667}, y={"timConDel.T"}, range={0.0, 1.0, -0.1, 0.20000000000000004}, grid=true, subPlot=104, colors={{28,108,200}}); -createPlot(id=1, position={15, 15, 1101, 667}, y={"timConDel.L"}, range={0.0, 1.0, -0.05, 0.05}, grid=true, subPlot=105, colors={{28,108,200}}); \ No newline at end of file +createPlot(id=1, position={15, 15, 1101, 667}, y={"tOn.y"}, range={0.0, 1.0, -0.1, 0.2}, grid=true, subPlot=101, colors={{28,108,200}}); +createPlot(id=1, position={15, 15, 1101, 667}, y={"k.y"}, range={0.0, 1.0, 0.8, 1.2}, grid=true, subPlot=102, colors={{28,108,200}}); +createPlot(id=1, position={15, 15, 1101, 667}, y={"ratioLT.y"}, range={0.0, 1.0, 0.2, 0.5}, grid=true, subPlot=103, colors={{28,108,200}}); +createPlot(id=1, position={15, 15, 1101, 667}, y={"timConDel.T"}, range={0.0, 1.0, -0.1, 0.2}, grid=true, subPlot=104, colors={{28,108,200}}); +createPlot(id=1, position={15, 15, 1101, 667}, y={"timConDel.L"}, range={0.0, 1.0, -0.05, 0.05}, grid=true, subPlot=105, colors={{28,108,200}});