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 270 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
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
5bc1158
model doc improve
Oct 29, 2024
0834add
model doc update
Nov 6, 2024
f6c4875
model doc enhance
Nov 7, 2024
b29fabc
model doc update
Nov 13, 2024
abf5949
model doc update
Nov 13, 2024
5504a20
Merge pull request #4027 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Nov 20, 2024
c79029c
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Nov 20, 2024
42c9e86
avoided using getInstance() function
JayHuLBL Nov 20, 2024
2265980
remove unnecessary component
Nov 21, 2024
35aadd2
update example
Nov 21, 2024
1608824
Merge pull request #4054 from SenHuang19/issue2884_PID_autotuning
JayHuLBL Nov 21, 2024
0103cd4
Merge branch 'master' into issue2884_PID_autotuning
JayHuLBL Dec 11, 2024
76611ea
improved docuementation
JayHuLBL Dec 11, 2024
c355480
improved text
JayHuLBL Dec 19, 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
12 changes: 11 additions & 1 deletion Buildings/Controls/OBC/CDL/Reals/PID.mo
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ equation
fillColor={175,175,175},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None,
lineColor={0,0,0})}),
lineColor={0,0,0}),
Text(
extent={{226,60},{106,10}},
textColor={0,0,0},
textString=DynamicSelect("",String(y,
leftJustified=false,
significantDigits=3)))}),
Diagram(
coordinateSystem(
extent={{-220,-200},{220,200}}), graphics={Rectangle(
Expand Down Expand Up @@ -484,6 +490,10 @@ American Society of Heating Refrigerating and Air-Conditioning Engineers Inc. At
revisions="<html>
<ul>
<li>
October 23, 2023, by Michael Wetter:<br/>
Added value of control output <code>y</code> to icon.
</li>
<li>
May 20, 2022, by Michael Wetter:<br/>
Refactored implementation to use new derivative block from CDL package.<br/>
This is for
Expand Down
12 changes: 11 additions & 1 deletion Buildings/Controls/OBC/CDL/Reals/PIDWithReset.mo
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,13 @@ equation
fillColor={175,175,175},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None,
lineColor={0,0,0})}),
lineColor={0,0,0}),
Text(
extent={{226,60},{106,10}},
textColor={0,0,0},
textString=DynamicSelect("",String(y,
leftJustified=false,
significantDigits=3)))}),
Diagram(
coordinateSystem(
extent={{-220,-200},{220,200}}), graphics={Rectangle(
Expand Down Expand Up @@ -487,6 +493,10 @@ American Society of Heating Refrigerating and Air-Conditioning Engineers Inc. At
revisions="<html>
<ul>
<li>
October 23, 2023, by Michael Wetter:<br/>
Added value of control output <code>y</code> to icon.
</li>
<li>
May 20, 2022, by Michael Wetter:<br/>
Refactored implementation to use new derivative block from CDL package.<br/>
This is for
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.BaseClasses;
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 plus time-delay (FOPTD) 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 the FOPTD 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,-20},{140,20}}),
iconTransformation(extent={{100,-20},{140,20}})));
protected
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.3)
"Block that calculates the product of a constant and the input"
annotation (Placement(transformation(extent={{-60,-70},{-40,-50}})));
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=0.5)
"Block that calculates the product of a constant and the input"
annotation (Placement(transformation(extent={{-60,50},{-40,70}})));
Buildings.Controls.OBC.CDL.Reals.Multiply mul
"Block that calculates the product of the two inputs"
annotation (Placement(transformation(extent={{0,10},{20,30}})));
Buildings.Controls.OBC.CDL.Reals.Add add
"Block that calculates the sum of the two inputs"
annotation (Placement(transformation(extent={{0,-50},{20,-30}})));
Buildings.Controls.OBC.CDL.Reals.Divide div
"Block that calculates input 1 divided by input 2"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));

equation
connect(div.y, Td) annotation (Line(points={{82,0},{120,0}}, color={0,0,127}));
connect(gai1.u, L) annotation (Line(points={{-62,-60},{-120,-60}},
color={0,0,127}));
connect(gai1.y, add.u2) annotation (Line(points={{-38,-60},{-20,-60},{-20,-46},
{-2,-46}}, color={0,0,127}));
connect(add.u1, T) annotation (Line(points={{-2,-34},{-80,-34},{-80,60},{-120,
60}}, color={0,0,127}));
connect(gai2.u, T) annotation (Line(points={{-62,60},{-120,60}}, color={0,0,127}));
connect(mul.u2, L) annotation (Line(points={{-2,14},{-70,14},{-70,-60},{-120,-60}},
color={0,0,127}));
connect(gai2.y, mul.u1) annotation (Line(points={{-38,60},{-20,60},{-20,26},{-2,
26}}, color={0,0,127}));
connect(mul.y, div.u1) annotation (Line(points={{22,20},{40,20},{40,6},{58,6}},
color={0,0,127}));
connect(div.u2, add.y) annotation (Line(points={{58,-6},{40,-6},{40,-40},{22,-40}},
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={{-100,140},{100,100}},
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 controller.</p>
<h4>Main equations</h4>
<p align=\"center\" style=\"font-style:italic;\">
T<sub>d</sub> = 0.5 L T/(0.3 L + T),
</p>
<p>
where <code>T</code> is the time constant of the first-order plus time-delay (FOPTD) model
and <code>L</code> is the time delay of the FOPTD model.
</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;
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.BaseClasses;
block PIDGain "Identify the control gain of a PID controller"
Buildings.Controls.OBC.CDL.Interfaces.RealInput kp(
final min=1E-6)
"Gain of a first-order plus time-delay (FOPTD) 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 the FOPTD 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 the FOPTD model"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput k
"Control gain"
annotation (Placement(transformation(extent={{100,-20},{140,20}})));
protected
Buildings.Controls.OBC.CDL.Reals.Divide div1
"Block that calculates the inverse of the input"
annotation (Placement(transformation(extent={{-40,56},{-20,76}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant const(
final k=1)
"Constant value 1"
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));
Buildings.Controls.OBC.CDL.Reals.AddParameter add(
final p=0.2)
"Block that calculates the sum of the two inputs"
annotation (Placement(transformation(extent={{20,-40},{40,-20}})));
Buildings.Controls.OBC.CDL.Reals.Divide div2
"Block that calculates the ratio of the time constant to the time delay"
annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.45)
"Block that calculates the product of the two inputs"
annotation (Placement(transformation(extent={{-20,-40},{0,-20}})));
Buildings.Controls.OBC.CDL.Reals.Multiply mul
"Block that calculates the sum of the two inputs"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));

equation
connect(div1.u2, kp) annotation (Line(points={{-42,60},{-120,60}},
color={0,0,127}));
connect(const.y, div1.u1) annotation (Line(points={{-58,80},{-50,80},{-50,72},
{-42,72}}, color={0,0,127}));
connect(div2.u2, L) annotation (Line(points={{-62,-36},{-80,-36},{-80,-60},{
-120,-60}}, color={0,0,127}));
connect(div2.u1, T) annotation (Line(points={{-62,-24},{-80,-24},{-80,0},{
-120,0}}, color={0,0,127}));
connect(gai1.u, div2.y)
annotation (Line(points={{-22,-30},{-38,-30}}, color={0,0,127}));
connect(gai1.y, add.u)
annotation (Line(points={{2,-30},{18,-30}}, color={0,0,127}));
connect(mul.y, k) annotation (Line(points={{82,0},{120,0}}, color={0,0,127}));
connect(div1.y, mul.u1) annotation (Line(points={{-18,66},{48,66},{48,6},{58,
6}}, color={0,0,127}));
connect(mul.u2, add.y) annotation (Line(points={{58,-6},{48,-6},{48,-30},{42,
-30}}, color={0,0,127}));
annotation (defaultComponentName = "PIDGai",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-100,140},{100,100}},
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 of a PID model.</p>
<h4>Main equations</h4>
<p align=\"center\" style=\"font-style:italic;\">
k = 1/k<sub>p</sub> + (0.2 + 0.45 T/L),
</p>
<p>
where <code>k<sub>p</sub></code> is the gain of the first-order plus time-delay (FOPTD) model,
<code>T</code> is the time constant of the FOPTD model,
and <code>L</code> is the time delay of the FOPTD model.
</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 PIDGain;
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.BaseClasses;
block PIDIntegralTime "Identify the integral 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 plus time-delay (FOPTD) 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 the FOPTD model"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
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,-20},{140,20}})));
protected
Buildings.Controls.OBC.CDL.Reals.Add add1
"Block that calculates the sum of the two inputs"
annotation (Placement(transformation(extent={{-20,-40},{0,-20}})));
Buildings.Controls.OBC.CDL.Reals.Add add2
"Block that calculates the sum of the two inputs"
annotation (Placement(transformation(extent={{-20,10},{0,30}})));
Buildings.Controls.OBC.CDL.Reals.Divide div
"Block that calculates input 1 divided by input 2"
annotation (Placement(transformation(extent={{20,-10},{40,10}})));
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.4)
"Block that calculates the product of a constant and the input"
annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=0.8)
"Block that calculates the product of a constant and the input"
annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai3(
final k=0.1)
"Block that calculates the product of a constant and the input"
annotation (Placement(transformation(extent={{-80,10},{-60,30}})));
Buildings.Controls.OBC.CDL.Reals.Multiply mul
"Block that calculates the two inputs"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));

equation
connect(gai1.u, L) annotation (Line(points={{-82,-10},{-90,-10},{-90,-60},{
-120,-60}}, color={0,0,127}));
connect(gai3.u, T) annotation (Line(points={{-82,20},{-90,20},{-90,60},{-120,
60}}, color={0,0,127}));
connect(gai2.u, T) annotation (Line(points={{-82,60},{-120,60}},
color={0,0,127}));
connect(gai1.y, add2.u2) annotation (Line(points={{-58,-10},{-30,-10},{-30,14},
{-22,14}}, color={0,0,127}));
connect(add2.u1, gai2.y) annotation (Line(points={{-22,26},{-30,26},{-30,60},
{-58,60}}, color={0,0,127}));
connect(add1.u2, L) annotation (Line(points={{-22,-36},{-90,-36},{-90,-60},{
-120,-60}}, color={0,0,127}));
connect(add1.u1, gai3.y) annotation (Line(points={{-22,-24},{-40,-24},{-40,20},
{-58,20}}, color={0,0,127}));
connect(div.y, mul.u1)
annotation (Line(points={{42,0},{48,0},{48,6},{58,6}}, color={0,0,127}));
connect(mul.u2, L) annotation (Line(points={{58,-6},{50,-6},{50,-60},{-120,
-60}}, color={0,0,127}));
connect(mul.y, Ti)
annotation (Line(points={{82,0},{120,0}}, color={0,0,127}));
connect(div.u2, add1.y) annotation (Line(points={{18,-6},{10,-6},{10,-30},{2,
-30}},color={0,0,127}));
connect(div.u1, add2.y) annotation (Line(points={{18,6},{10,6},{10,20},{2,20}},
color={0,0,127}));
annotation (defaultComponentName = "PIDIntTim",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,-100},{100,100}},
lineColor={0,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-100,140},{100,100}},
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 integral time of a PID model.</p>
<h4>Main equations</h4>
<p align=\"center\" style=\"font-style:italic;\">
T<sub>i</sub> = L (0.4 L + 0.8 T)/(L + 0.1 T),
</p>
<p>
where <code>T</code> is the time constant of the first-order plus time-delay (FOPTD) model
and <code>L</code> is the time delay of the FOPTD model.
</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 PIDIntegralTime;
Loading