Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Kristian Soltesz
PIDopt
Commits
f8ba8a51
Commit
f8ba8a51
authored
Jan 08, 2018
by
Kristian Soltesz
Browse files
slight update to example
parent
b1203ab9
Changes
1
Hide whitespace changes
Inline
Side-by-side
example.m
View file @
f8ba8a51
...
...
@@ -26,15 +26,13 @@ p0 = [0 0 0]'; % Parameters of any PID controller, which stabilizes P.
w
=
defaultGrid
(
P
);
% default angular frequency grid
[
K1
,
p1
]
=
pidIE
(
P
,
Ms
,
Mt
,
Mks
,
p0
,
w
)
% IE-optial PID
controller
without filter
[
K1
,
p1
]
=
pidIE
(
P
,
Ms
,
Mt
,
Mks
,
p0
,
w
)
% IE-optial PID without filter
% IAE-optimal design
[
K2
,
p2
]
=
pidIAE
(
P
,
Ms
,
Mt
,
Mks
,
p1
,
w
)
%
Hot-start with K1 parame
ter
s
p0
=
p1
;
% hot start
[
K2
,
p2
]
=
pidIAE
(
P
,
Ms
,
Mt
,
Mks
,
p1
,
w
)
%
IAE-optimal PID withot fil
ter
% IAE-optimal design with filter
[
K3
,
p3
,
w
]
=
pidfIAE
(
P
,
Ms
,
Mt
,
Mks
,
p2
,
w
);
% Hot-start with K2 parameters
K3
p3
p0
=
p2
;
% hot start
[
K3
,
p3
]
=
pidfIAE
(
P
,
Ms
,
Mt
,
Mks
,
p2
,
w
)
% IAE-optimal PID with filter
%% Evaluation
% Closed-loop transfer functions
...
...
@@ -53,7 +51,7 @@ figure(1)
bode
(
K1
,{
wMin
,
wMax
},
'b'
,
K2
,
'r'
,
K3
,
'g'
)
hold
on
title
(
'Controller'
)
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal w
.
filter'
,
'Location'
,
...
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal w
ith
filter'
,
'Location'
,
...
'NorthWest'
)
% Bode magnitudes (to verify robustness constraints)
...
...
@@ -65,7 +63,7 @@ ylim([1e-1 2*Ms])
set
(
gca
,
'ytick'
,[
1
Ms
])
plot
([
wMin
wMax
],
Ms
*
[
1
1
],
'k'
)
title
(
'Sensitivity magnitude'
)
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal w
.
filter'
,
'Constraint'
,
...
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal w
ith
filter'
,
'Constraint'
,
...
'Location'
,
'NorthWest'
)
subplot
(
312
)
...
...
@@ -89,11 +87,5 @@ figure(3)
step
(
PS
(
K1
),
'b'
,
PS
(
K2
),
'r'
,
PS
(
K3
),
'g'
,
P
,
'k'
)
hold
on
title
(
'Load step response'
)
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal w. filter'
,
'Open-loop'
,
...
'Location'
,
'East'
)
legend
(
'IE-optimal'
,
'IAE-optimal'
,
'IAE-optimal with filter'
,
'Open-loop'
,
...
'Location'
,
'East'
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment