Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue2884 pid autotuning #2957

Open
wants to merge 256 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
49c156d
Merge branch 'SenHuang19-issue2884_PID_autotuning' into issue2884_PID…
mwetter Apr 11, 2022
2c50bc5
Reverted to version from master (only changes in format
mwetter Apr 11, 2022
e022aea
Merge branch 'master' into issue2884_PID_autotuning
mwetter May 27, 2022
96d1174
remove the new modules from CDL package and add those modules to the …
Jun 3, 2022
54846c7
restructure the PIDAutotuning package
Jun 9, 2022
af3a06e
clean up and add documentation
Jun 10, 2022
998f78e
clean the relay package
Jun 12, 2022
0c9ca3c
fix typos in the validation examples for the relay package
Jun 12, 2022
9c58b5c
fix some issues in the SystemIdentification package
Jun 13, 2022
147fa41
remove the model inheritance and update the doc
SenHuang19 Aug 8, 2022
d4eff4b
remove unused scripts
Aug 9, 2022
dff0c17
update the model doc for AMIGO
Aug 9, 2022
1dc6b5a
fix one issue in the implementation
Aug 9, 2022
59fa7e0
clean up
Aug 10, 2022
6c9fd38
cleanup the models and remove the model inheritance in the validation…
Aug 12, 2022
52bde73
fix breaking links and add the full path of models
Aug 12, 2022
2922afa
update the package order
Aug 12, 2022
39feaff
remove the junk files
Aug 12, 2022
4b5a4fa
remove extra empty lines
Aug 12, 2022
3d7c2c2
update the AMIGO package
Aug 24, 2022
8544b35
clean up
Aug 26, 2022
b294e20
clean up again
Aug 26, 2022
5658039
fix the uppercase in the script path
Sep 9, 2022
7c61926
Merge branch 'issue2884_PID_autotuning' of https://github.com/SenHuan…
Sep 9, 2022
143d700
update the script
Sep 13, 2022
aecac0f
update the script
Sep 13, 2022
5d6386a
remove the folder that is uneeded
Sep 14, 2022
5c7e96f
temp remove the folder
Sep 14, 2022
1e75f9f
change the folder name back
Sep 14, 2022
6ecc818
fix issues in the syntax and example scripts
Sep 26, 2022
04cf03b
fix the html issues and clean up the model
Oct 6, 2022
16460f9
fix the typos in the script
Oct 6, 2022
69fbd3c
update the references
Oct 6, 2022
7bb91f4
more clean ups
Oct 12, 2022
2d7ae04
remove scripts that are not needed
Oct 17, 2022
675d2b6
remove scripts that are not needed
Oct 17, 2022
85a3b37
remove the reference dataset that are not needed
Oct 17, 2022
a008aef
fix one typo in the model doc
Oct 17, 2022
408eb01
remove the exta <p>
Oct 17, 2022
4ee4e79
small fix to model diagram
Oct 17, 2022
9fe60db
update the model doc and small fix to the connections
Oct 17, 2022
2fe712b
restore the change to irrelevent file
Oct 18, 2022
acd807a
correct the connections and update the doc
Nov 16, 2022
6165588
regenerate the reference dataset
Nov 16, 2022
82b25f4
fix typos in the doc
Nov 18, 2022
094e66e
Merge pull request #3089 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Nov 18, 2022
4962fdb
refactored pacakge order
JayHuLBL Nov 18, 2022
e0629c0
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Nov 18, 2022
2ec3888
improved mos scripts [ci skip]
JayHuLBL Nov 18, 2022
bab8eb0
add units to the time related input
Nov 22, 2022
73bdecd
Merge pull request #3166 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Nov 28, 2022
4020ba5
removed BOM
JayHuLBL Nov 28, 2022
03c127b
improved html format [ci skip]
JayHuLBL Dec 1, 2022
6445f67
improved connections [ci skip]
JayHuLBL Dec 1, 2022
c1180c9
update the doc and add more parameters
Dec 2, 2022
abc55bd
update the model doc and making some parameters final
Feb 28, 2023
0a205a7
Merge pull request #3184 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Mar 9, 2023
2877ce8
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Mar 9, 2023
7bf9f2e
improved formating and implementation, removed BOM
JayHuLBL Mar 9, 2023
8494743
update the model doc
Mar 10, 2023
224a2b8
Merge pull request #3291 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Mar 15, 2023
54ee248
improving test
JayHuLBL Mar 16, 2023
efde60f
condense the reference data for validation
Apr 7, 2023
e5a2df1
update the reference data
Apr 7, 2023
e701a61
Merge pull request #3326 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Apr 7, 2023
4341dbe
merged upstream
JayHuLBL Apr 7, 2023
78f28bf
merged master
JayHuLBL Apr 7, 2023
531485f
merged master
JayHuLBL Apr 13, 2023
323905b
improved naming and comments
JayHuLBL Apr 13, 2023
c309e7b
added release note
JayHuLBL Apr 13, 2023
e79aff7
removed BOM
JayHuLBL Apr 13, 2023
c847714
corrected html link
JayHuLBL Apr 19, 2023
cbab666
merged master
JayHuLBL Apr 24, 2023
5c2aa82
updated cdl instantiation
JayHuLBL Apr 24, 2023
0e9c3f4
Revised documentation [ci skip]
mwetter May 2, 2023
537491d
Revised documentation
mwetter May 2, 2023
1a5eee4
Revised documentation, moved connectors
mwetter May 2, 2023
ea78af0
Revised documentation, moved connectors [ci skip]
mwetter May 2, 2023
304f133
Fixed typo
mwetter May 8, 2023
5851898
Updated documentation
mwetter May 8, 2023
398bd97
Updated documentation
mwetter May 8, 2023
abde11f
Aligned connector to grid
mwetter May 8, 2023
a85ebc5
Aligned connector to grid
mwetter May 8, 2023
44c33ea
Aligned connector to grid
mwetter May 8, 2023
9730720
Updated info section
mwetter May 8, 2023
4102bbe
Aligned connector on icon and diagram layer
mwetter May 8, 2023
86e32b1
Merge branch 'master' into issue2884_PID_autotuning
Jun 7, 2023
89a6440
minor changes to the comments and eliminate the dataset from python i…
Jun 19, 2023
1a22747
add a boolean input to control when to perform the autotuning
Jun 19, 2023
ec7ef99
minor doc update
Jun 19, 2023
454539e
update the plotting script
Jun 19, 2023
8e8c29f
update the reference dataset
Jun 19, 2023
4567527
minor updates to model doc
Jun 19, 2023
67a8ee0
update script and reference dataset
Jun 19, 2023
84425c1
update the input port name
Jun 19, 2023
74c5022
update model doc
Jun 19, 2023
2c8e2f3
add baseclasses and model icon
Jun 19, 2023
461b449
update the reference dataset
Jun 19, 2023
c7c87f6
clean the reference dataset
Jun 19, 2023
9779816
update the model doc and fix the broken links
Jun 20, 2023
70bb22e
merged master
JayHuLBL Jun 22, 2023
bcfeea9
merge remote
JayHuLBL Jun 22, 2023
d235a88
resolve comflicts
Jun 22, 2023
b5ac123
fix format and breaking links
Jun 24, 2023
7e3c862
remove extra space
Jun 24, 2023
bdd7017
typo and format fix
Jun 26, 2023
787b791
doc refine and format
Jun 26, 2023
2aa0cc4
doc update and typo fix
Jun 26, 2023
134a752
Merge pull request #3444 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Jun 29, 2023
560b2ee
cleaned BOM
JayHuLBL Jun 30, 2023
1d8ee1d
deleted obsolete OMC script
JayHuLBL Jun 30, 2023
39fb783
deleted obsolete OMC script
JayHuLBL Jun 30, 2023
3b44963
modified format
JayHuLBL Jul 5, 2023
e626a1e
cleaning up the documentation and comments
JayHuLBL Jul 18, 2023
896a65a
update model doc
Jul 23, 2023
751f1ed
update the example scripts
Jul 23, 2023
38916f1
update the reference dataset
Jul 23, 2023
8f2f408
minor changes to the model doc
Jul 25, 2023
4b78fe1
model doc update
Jul 25, 2023
b49a99e
Merge pull request #3465 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Jul 28, 2023
b597094
removed BOM
JayHuLBL Jul 28, 2023
c8d7087
improved documentation
JayHuLBL Jul 28, 2023
820acc0
merged master
JayHuLBL Aug 17, 2023
fc32973
added controller type
JayHuLBL Aug 18, 2023
3849805
merged master
JayHuLBL Aug 30, 2023
5788d03
merged master
JayHuLBL Sep 11, 2023
45bc874
corrected order file
JayHuLBL Sep 11, 2023
11d9596
add reset to the tuning process
Sep 19, 2023
6300092
update the scripts and reference dataset
Sep 19, 2023
e8ea074
improve the doc
Sep 20, 2023
4117195
Merge pull request #3529 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Sep 20, 2023
0809e92
renamed class
JayHuLBL Sep 21, 2023
5fef24b
merged master
JayHuLBL Sep 21, 2023
7700fad
added instance comment
JayHuLBL Sep 21, 2023
f69db63
merged master
JayHuLBL Sep 21, 2023
0ea3169
updated revision note
JayHuLBL Sep 21, 2023
5bd2846
improved validation model to show retriggering tuning process
JayHuLBL Sep 28, 2023
da9a596
merged master
JayHuLBL Sep 28, 2023
84827ed
Merge branch 'master' into issue2884_PID_autotuning
mwetter Oct 23, 2023
7176717
Revised models
mwetter Oct 23, 2023
bd77a97
Revised model, added dynamic display
mwetter Oct 23, 2023
ea3ed17
Added output variables
mwetter Oct 23, 2023
fed5f5a
Corrected wrong annotation
mwetter Oct 23, 2023
3809c88
Added icon for OMEdit
mwetter Oct 23, 2023
dd3afde
Corrected wrong annotation
mwetter Oct 23, 2023
b84979c
Added icon for OMEdit
mwetter Oct 23, 2023
3ddeb66
corrected text
JayHuLBL Oct 26, 2023
f23f77a
improved graphic [ci skip]
JayHuLBL Oct 31, 2023
370c893
Changed component layout, changed TunMon to tunMon
mwetter Nov 1, 2023
933502e
Changed minimum length to 1 ms rather than 0.01 ms, and introduced it…
mwetter Nov 1, 2023
05f681e
Corrected English and used consistent names
mwetter Nov 1, 2023
74dc25d
improved real comparison to avoid results difference between dymola a…
JayHuLBL Nov 1, 2023
ca7da6a
add supports for direct acting
Nov 28, 2023
064c9eb
add one more realistic control example
Nov 28, 2023
e8959f3
clean up and add scripts/reference data
Nov 29, 2023
9934e8b
model doc update
Dec 1, 2023
488eee7
cleanup
Dec 1, 2023
a9116ca
update the model doc
Dec 1, 2023
6cc4a31
fix false alarms
Dec 1, 2023
b228299
add final
Dec 6, 2023
635481b
remove if in the equation
Dec 6, 2023
7fd01d4
model rename
Dec 6, 2023
ceb42c8
Merge pull request #3590 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Dec 14, 2023
3500494
reimplemented on-off controller as the OnOffController will be obsolete
JayHuLBL Dec 15, 2023
faa2108
corrected package order [ci skip]
JayHuLBL Dec 15, 2023
5981335
fix the model doc
Dec 15, 2023
7d11d84
minor format fix
Dec 15, 2023
7ecfcfb
model doc fix
Dec 15, 2023
bf463d9
remove extra space
Dec 15, 2023
e9cab00
correct the definition of control error
Dec 15, 2023
8f68c8c
plot script and ref data update
Dec 15, 2023
f367eb8
Merge pull request #3609 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Dec 15, 2023
2560b37
improved documentation and the implementation
JayHuLBL Dec 15, 2023
52e5fdc
updated comments
JayHuLBL Dec 15, 2023
2d2f14a
fix model doc
Dec 16, 2023
3365ad5
revert the changes to system identification
Dec 18, 2023
332eedf
Merge pull request #3611 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Dec 20, 2023
5188025
improved graphical
JayHuLBL Dec 21, 2023
7900320
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Dec 21, 2023
5638a1f
updated release note
JayHuLBL Dec 21, 2023
be5273a
fixed broken links
JayHuLBL Dec 21, 2023
f66192c
resized the font
JayHuLBL Dec 21, 2023
a6fa148
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Dec 22, 2023
6e3739c
changed the nominal flow and water temperature [ci skip]
JayHuLBL Dec 22, 2023
9574d7e
remove the generic pi settings
Dec 25, 2023
65f2f44
fix issues in the plotting scripts
Dec 25, 2023
9eae03f
model doc update
Dec 28, 2023
4a43c6c
add the openmodelica script
Dec 28, 2023
e663755
update the reference dataset
Dec 28, 2023
dbc6419
remove space and typo
Dec 28, 2023
6925d59
minor changes to fix typo and remove extra space
Dec 28, 2023
b9e8333
remove reference data that doesnt change
Dec 28, 2023
7c1aa5b
remove the incompatible codes and improve model doc
Jan 3, 2024
324bf9f
Merge pull request #3619 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Jan 5, 2024
1187fb1
improved comment
JayHuLBL Jan 5, 2024
5efddf4
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Jan 9, 2024
38e5586
updated modelTime to civilTime
JayHuLBL Jan 9, 2024
afd8317
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Mar 1, 2024
d1212bd
refactored txt format
JayHuLBL Mar 4, 2024
45048b4
Merge branch 'master' into issue2884_PID_autotuning
mwetter Mar 8, 2024
63be78f
Issue2884 pid autotuning - revision (#3691)
mwetter Mar 12, 2024
4844875
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Mar 18, 2024
47c9610
improve the model doc and parameters
Apr 4, 2024
3eafba5
resolve the inconsistent default values
Apr 4, 2024
d0b695d
assign better values of parameters
Apr 4, 2024
8253d4b
reference data update
SenHuang19 Apr 4, 2024
dd85335
improve model doc
SenHuang19 Apr 4, 2024
19ec42c
reference data update
SenHuang19 Apr 4, 2024
af7e4f0
cleaup
SenHuang19 Apr 4, 2024
b6fd68c
improve the model doc
SenHuang19 Apr 9, 2024
924cc25
Merge pull request #3777 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Apr 9, 2024
5559e35
Merge branch 'issue2884_PID_autotuning' of https://github.com/lbl-srg…
JayHuLBL Apr 9, 2024
b44f185
merged master
JayHuLBL Apr 9, 2024
5b7ea91
updated comments [ci skip]
JayHuLBL Apr 9, 2024
b212cdc
merged master
JayHuLBL Apr 12, 2024
baea7ee
update model doc
SenHuang19 Apr 19, 2024
ba859c6
improve the model doc
SenHuang19 Apr 22, 2024
2b82578
Merge pull request #3814 from SenHuang19/issue2884_PID_autotuning
JayHuLBL May 2, 2024
518629e
improved the text
JayHuLBL May 2, 2024
8f20f32
add exception handling
SenHuang19 Jun 14, 2024
044c307
add new inputs
SenHuang19 Jun 14, 2024
6b77796
update the example
SenHuang19 Jun 14, 2024
3bacb48
reference data update
SenHuang19 Jun 14, 2024
31f8968
model and doc improve
SenHuang19 Jun 18, 2024
0919cf6
example update
SenHuang19 Jun 18, 2024
8c19758
model doc update
SenHuang19 Jun 24, 2024
e7e0d47
model doc update
SenHuang19 Jun 24, 2024
3b5b6d2
format update
SenHuang19 Jun 25, 2024
9393609
format update
SenHuang19 Jun 26, 2024
924f8eb
improve model doc and add hys for checking differences
SenHuang19 Jun 27, 2024
2886795
add Hys for comparing values
SenHuang19 Jun 27, 2024
3facc3e
improve the model doc
SenHuang19 Jun 27, 2024
4f49f33
update the hys
SenHuang19 Jun 28, 2024
0e1a2ac
model doc improve
SenHuang19 Jul 1, 2024
46a82f2
Merge pull request #3914 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Aug 12, 2024
e091054
merged master
JayHuLBL Aug 12, 2024
b0eb43d
Merge branch 'issue2884_PID_autotuning' of https://github.com/lbl-srg…
JayHuLBL Aug 12, 2024
10d77ae
improved the check of the setpoint change
JayHuLBL Aug 12, 2024
1f3bf1f
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Aug 22, 2024
6fc1be9
merged master and updated reference
JayHuLBL Aug 22, 2024
4b77030
improved graphical
JayHuLBL Aug 22, 2024
5eac28f
improved graphic
JayHuLBL Aug 23, 2024
e87b2f9
improve graphic and make the tuning stop when the setppint changes
SenHuang19 Aug 29, 2024
5f4f37e
rebase
SenHuang19 Aug 29, 2024
0a8bd36
make the tuning stop when the setppint changes
SenHuang19 Aug 29, 2024
3c24f43
format improve
SenHuang19 Aug 30, 2024
7803032
Merge pull request #3987 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Sep 3, 2024
b408dce
improved graphical
JayHuLBL Sep 3, 2024
611004b
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Sep 3, 2024
8757c90
updated release note
JayHuLBL Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO;
block PI "Identify the parameters of a PI controller"
Buildings.Controls.OBC.CDL.Interfaces.RealInput kp(
final min=1E-6)
"Gain of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-140,40},{-100,80}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time constant of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
iconTransformation(extent={{-140,-20},{-100,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time delay of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput k
"Control gain signal"
annotation (Placement(transformation(extent={{100,40},{140,80}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Ti(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time constant signal for the integral term"
annotation (Placement(transformation(extent={{100,-50},{140,-10}})));
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIGain gain
"Calculate the control gain"
annotation (Placement(transformation(extent={{-10,20},{10,40}})));
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIIntegralTime
integralTime
"Calculate the integral time"
annotation (Placement(transformation(extent={{-10,-40},{10,-20}})));

equation
connect(gain.k, k) annotation (Line(points={{12,30},{80,30},{80,60},{120,60}},
color={0,0,127}));
connect(integralTime.Ti, Ti) annotation (Line(points={{12,-30},{94,-30},{94,
-30},{120,-30}},
color={0,0,127}));
connect(integralTime.T, gain.T) annotation (Line(points={{-12,-24},{-40,-24},
{-40,30},{-12,30}}, color={0,0,127}));
connect(integralTime.L, gain.L) annotation (Line(points={{-12,-36},{-20,-36},
{-20,24},{-12,24}}, color={0,0,127}));
connect(T, gain.T) annotation (Line(points={{-120,0},{-40,0},{-40,30},{-12,30}},
color={0,0,127}));
connect(L, gain.L) annotation (Line(points={{-120,-60},{-20,-60},{-20,24},{
-12,24}}, color={0,0,127}));
connect(gain.kp, kp) annotation (Line(points={{-12,36},{-40,36},{-40,60},{
-120,60}}, color={0,0,127}));
annotation (defaultComponentName = "PI",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-154,148},{146,108}},
textString="%name",
textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false)),
Documentation(revisions="<html>
<ul>
<li>
June 1, 2022, by Sen Huang:<br/>
First implementation<br/>
</li>
</ul>
</html>", info="<html>
<p>
This block calculates the control gain and the integral time of a PI model.
</p>
<p>Please refer to the following block for detailed information:</p>
<ul>
<li>
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIGain\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.AutoTuner.AMIGO.PIGain</a>
</li>
<li>
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIIntegralTime\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.AutoTuner.AMIGO.PIIntegralTime</a>
</li>
</ul>
</html>"));
end PI;
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO;
block PID "Identify the parameters of a PID controller"
Buildings.Controls.OBC.CDL.Interfaces.RealInput kp(
final min=1E-6)
"Gain of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-140,40},{-100,80}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time constant of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
iconTransformation(extent={{-140,-20},{-100,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time delay of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput k
"Control gain signal"
annotation (Placement(transformation(extent={{100,30},{140,70}}),
iconTransformation(extent={{100,50},{140,90}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Ti(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Connector for time constant signal for the integral term"
annotation (Placement(transformation(extent={{100,-20},{140,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Td(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Connector for time constant signal for the derivative term"
annotation (Placement(transformation(extent={{100,-80},{140,-40}}),
iconTransformation(extent={{100,-90},{140,-50}})));
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDGain gai
"Calculate the control gain"
annotation (Placement(transformation(extent={{-10,40},{10,60}})));
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDIntegralTime
intTim "Calculate the integral time"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDDerivativeTime
derTim "Calculate the derivative time"
annotation (Placement(transformation(extent={{-10,-70},{10,-50}})));

equation
connect(derTim.Td, Td) annotation (Line(points={{12,-60},{120,-60}},
color={0,0,127}));
connect(intTim.Ti, Ti)
annotation (Line(points={{12,0},{120,0}}, color={0,0,127}));
connect(gai.k, k) annotation (Line(points={{12,50},{120,50}},
color={0,0,127}));
connect(intTim.T, gai.T) annotation (Line(points={{-12,6},{-40,6},{-40,50},{-12,
50}}, color={0,0,127}));
connect(derTim.T, gai.T) annotation (Line(points={{-12,-54},{-40,-54},{-40,50},
{-12,50}}, color={0,0,127}));
connect(intTim.L, gai.L) annotation (Line(points={{-12,-6},{-26,-6},{-26,44},
{-12,44}}, color={0,0,127}));
connect(derTim.L, gai.L) annotation (Line(points={{-12,-66},{-26,-66},{-26,44},
{-12,44}}, color={0,0,127}));
connect(kp, gai.kp) annotation (Line(points={{-120,60},{-20,60},{-20,56},{-12,
56}}, color={0,0,127}));
connect(T, gai.T) annotation (Line(points={{-120,0},{-80,0},{-80,6},{-40,6},{
-40,50},{-12,50}}, color={0,0,127}));
connect(L, gai.L) annotation (Line(points={{-120,-60},{-26,-60},{-26,44},{-12,
44}}, color={0,0,127}));
annotation (defaultComponentName = "PID",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-154,148},{146,108}},
textString="%name",
textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false)),
Documentation(revisions="<html>
<ul>
<li>
June 1, 2022, by Sen Huang:<br/>
First implementation<br/>
</li>
</ul>
</html>", info="<html>
<p>
This block calculates the control gain, the integral time, and the derivative time of a PID model.
</p>
<p>Please refer to the following block for detailed information:</p>
<ul>
<li>
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDGain\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.AutoTuner.AMIGO.PIDGain</a>
</li>
<li>
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDIntegralTime\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.AutoTuner.AMIGO.PIDIntegralTime</a>
</li>
<li>
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.PIDDerivativeTime\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.AutoTuner.AMIGO.PIDDerivativeTime</a>
</li>
</ul>
</html>"));
end PID;
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO;
block PIDDerivativeTime "Identify the derivative time of a PID controller"
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time constant of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-140,40},{-100,80}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time delay of a first order time-delayed model"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Td(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
"Time constant signal for the derivative term"
annotation (Placement(transformation(extent={{100,-16},{140,24}}),
iconTransformation(extent={{100,-20},{140,20}})));
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(final k=0.3)
"Calculate the product of 0.3 and the time delay"
annotation (Placement(transformation(extent={{-80,-70},{-60,-50}})));
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai2(final k=0.5)
"Calculate the product of 0.5 and the input time constant"
annotation (Placement(transformation(extent={{-80,30},{-60,50}})));
Buildings.Controls.OBC.CDL.Continuous.Multiply mul
"Calculate the product of the output of gai2 and the input time constant"
annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
Buildings.Controls.OBC.CDL.Continuous.Add add
"Calculate the sum of the output of gai1 and the input time constant"
annotation (Placement(transformation(extent={{-40,-64},{-20,-44}})));
Buildings.Controls.OBC.CDL.Continuous.Divide div
"Calculate the output of mul divided by the output of add"
annotation (Placement(transformation(extent={{20,-6},{40,14}})));

equation
connect(div.y, Td) annotation (Line(points={{42,4},{120,4}}, color={0,0,127}));
connect(gai1.u, L) annotation (Line(points={{-82,-60},{-96,-60},{-96,-60},{-120,
-60}}, color={0,0,127}));
connect(gai1.y, add.u2) annotation (Line(points={{-58,-60},{-42,-60}},
color={0,0,127}));
connect(add.u1, T) annotation (Line(points={{-42,-48},{-48,-48},{-48,60},{
-120,60}}, color={0,0,127}));
connect(gai2.u, T) annotation (Line(points={{-82,40},{-90,40},{-90,60},{-120,
60}}, color={0,0,127}));
connect(mul.u2, L) annotation (Line(points={{-42,4},{-96,4},{-96,-60},{-120,
-60}}, color={0,0,127}));
connect(gai2.y, mul.u1) annotation (Line(points={{-58,40},{-52,40},{-52,16},{
-42,16}}, color={0,0,127}));
connect(mul.y, div.u1) annotation (Line(points={{-18,10},{18,10}},
color={0,0,127}));
connect(div.u2, add.y) annotation (Line(points={{18,-2},{12,-2},{12,-54},{-18,
-54}}, color={0,0,127}));
annotation (defaultComponentName = "PIDDerTim",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-154,148},{146,108}},
textString="%name",
textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false)),
Documentation(revisions="<html>
<ul>
<li>
June 1, 2022, by Sen Huang:<br/>
First implementation<br/>
</li>
</ul>
</html>", info="<html>
<p>This block calculates the derivative time of a PID model.</p>
<h4>Main equations</h4>
<p align=\"center\" style=\"font-style:italic;\">
T<sub>d</sub> = 0.5LT/(0.3L+T),
</p>
<p>
where <code>T</code> is the time constant of the first-order time-delayed model
and <code>L</code> is the time delay of the first-order time-delayed model.
</p>
<h4>Validation</h4>
<p>
This block was validated analytically, see
<a href=\"modelica://Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.Validation.PIDDerivativeTime\">
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.Validation.PIDDerivativeTime</a>.
</p>
<h4>References</h4>
<p>
Åström, Karl Johan and Tore Hägglund (2004)
\"Revisiting the Ziegler–Nichols step response method for PID control.\"
Journal of process control 14.6 (2004): 635-650.
</p>
</html>"));
end PIDDerivativeTime;
Loading