Commit 935f3d30 authored by Kristian Soltesz's avatar Kristian Soltesz
Browse files

Added controller bode plos to example

parent 0fad7f11
...@@ -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',...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment