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
935f3d30
Commit
935f3d30
authored
Sep 07, 2017
by
Kristian Soltesz
Browse files
Added controller bode plos to example
parent
0fad7f11
Changes
1
Show whitespace changes
Inline
Side-by-side
example.m
View file @
935f3d30
...
@@ -42,13 +42,20 @@ T = @(K)feedback(L(K),1);
...
@@ -42,13 +42,20 @@ T = @(K)feedback(L(K),1);
KS
=
@
(
K
)
feedback
(
K
,
P
);
KS
=
@
(
K
)
feedback
(
K
,
P
);
PS
=
@
(
K
)
feedback
(
P
,
K
)
PS
=
@
(
K
)
feedback
(
P
,
K
)
% Bode magnitudes (to verify robustness constraints)
wMin
=
w
(
1
);
wMin
=
w
(
1
);
wMax
=
w
(
end
);
wMax
=
w
(
end
);
close
all
close
all
% Controller dynamics
figure
(
1
)
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'
,
...
'NorthWest'
)
% Bode magnitudes (to verify robustness constraints)
figure
(
3
)
subplot
(
311
)
subplot
(
311
)
bodemag
(
S
(
K1
),{
wMin
,
wMax
},
'b'
,
S
(
K2
),
'r'
,
S
(
K3
),
'g'
)
bodemag
(
S
(
K1
),{
wMin
,
wMax
},
'b'
,
S
(
K2
),
'r'
,
S
(
K3
),
'g'
)
hold
on
hold
on
...
@@ -76,7 +83,7 @@ plot([wMin wMax],Mks*[1 1],'k')
...
@@ -76,7 +83,7 @@ plot([wMin wMax],Mks*[1 1],'k')
title
(
'Noise sensitivity'
)
title
(
'Noise sensitivity'
)
% Load disturbance response (to compute IE and IAE)
% Load disturbance response (to compute IE and IAE)
figure
(
2
)
figure
(
4
)
step
(
PS
(
K1
),
'b'
,
PS
(
K2
),
'r'
,
PS
(
K3
),
'g'
,
P
,
'k'
)
step
(
PS
(
K1
),
'b'
,
PS
(
K2
),
'r'
,
PS
(
K3
),
'g'
,
P
,
'k'
)
hold
on
hold
on
title
(
'Load step response'
)
title
(
'Load step response'
)
...
@@ -86,3 +93,5 @@ legend('IE-optimal','IAE-optimal','IAE-optimal w. filter','Open-loop',...
...
@@ -86,3 +93,5 @@ legend('IE-optimal','IAE-optimal','IAE-optimal w. filter','Open-loop',...
Write
Preview
Markdown
is supported
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