Commit f8ba8a51 authored by Kristian Soltesz's avatar Kristian Soltesz
Browse files

slight update to example

parent b1203ab9
......@@ -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 parameters
p0 = p1; % hot start
[K2,p2] = pidIAE(P,Ms,Mt,Mks,p1,w) % IAE-optimal PID withot filter
% 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 with 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 with 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
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