%{ ELEC-E8116 Model-based Control Systems Exercise 7 %} clearvars; close all; clc; %% w0=10; % desired closed-loop bandwidth A=1e-4; % desired disturbance attenuation inside bandwidth M=1.5 ; % desired bound on hinfnorm(S) & hinfnorm(T) s=tf('s'); G=200/(10*s+1)/(0.05*s+1)^2; Gd=100/(10*s+1); W11=(s/M+w0)/(s+w0*A); % Sensitivity weight 1 (1st order) W22=((s/sqrt(M)+w0)^2)/((s+w0*sqrt(A))^2); % Sensitivity weight 2 (2nd order) %% [K1,CL,GAM,INFO]=mixsyn(G,W11,[],[]); L1=G*K1; % loop transfer function S1=inv(1+L1); % Sensitivity T1=1-S1; % complementary sensitivity %% [K2,CL,GAM,INFO]=mixsyn(G,W22,[],[]); L2=G*K2; % loop transfer function S2=inv(1+L2); % Sensitivity T2=1-S2; % complementary sensitivity %% %{ For the 2nd order weight the curve increases 40 dB/decade and the slope is 2. %} figure(1); clf; w_range = logspace(-2,2); bodemag(S1,'b-', 1/W11, 'r--', w_range) hold on; bodemag(S2,'g-.', 1/W22,'c.', w_range) yline(10^0, '-.') grid on; legend('S1','1/W11','S2','1/W22')