Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

QUIZ 1

LMVFC SYSTEMS

Submitted by: Flt Lt M Ali


Roll No: 195123
Questions

1. Controller transfer function is evaluated as

2. is evaluated as 2.2618

3. Wc comes out to be 6.2882 rad/sec

4. MT and MS come out to be 1.2844 and 1.1944 respectively

5. GM and PM of closed loop system T comes out to be

6. Frequency response of H-inf controller is


Frequency response of PI controller is given as

7. Step response of closed loop system is given as

8.

(a) Controller transfer function is given by


(b) Is evaluated as 3.7716

(c) Wc comes out to be 9.837 rad/sec

(d) MT and MS come out to be 1.5094 and 1.3448 respectively

(e) GM and PM of closed loop system comes out to be

(f) Frequency response of H-inf controller is

Frequency response of PI controller is


(g) Step response of Closed loop system is given as

MATLAB CODE
%% Part 1 using wp
clc
clear all
close all
s=tf('s'); % Laplace transform variable 's'
G=tf(4,[0.0004 0.0396 0.96 -1]); % Plant to be controlled
wb=10; % desired closed-loop bandwidth
A=1/10000; % desired disturbance attenuation inside
bandwidth
M=1.5 ; % desired bound on hinfnorm(S) &
hinfnorm(T)
Wp=(s/M+wb)/(s+wb*A);
Wu=1 % Empty control weight
systemnames = 'G Wu Wp'; % Plant & weight definition
inputvar = '[ r(1);u(1)]'; % Inputs
outputvar = '[Wu;Wp;r-G]'; % Outputs
input_to_G = '[u]';
input_to_Wu = '[u]';
input_to_Wp = '[r-G]';
sysoutname = 'P'; % Generalized Plant
cleanupsysic = 'yes';
P=sysic % Finding P
[Kinf,ginf,gopt] = mixsyn(G,Wp,Wu,[]);
Gamma_min=gopt; %Gamma minimum for H-inf
controller
s=tf('s');
K=tf(Kinf); % Controller transfer function
L=(G*K); % Open loop system
S=1/(1+G*K); % Sensitivity
T=G*K/(1+G*K); % Complimentary sensitivity
Ms=getPeakGain(S) %Ms
Mt=getPeakGain(T) %Mt
[Gm,Pm,Wgm,Wc]=margin(L) % Wc gives crossover frequency
of open loop system
figure('Name','Bode Diag of Closed Loop System');
margin(T) % Closed loop response, Wc, GM and PM
figure
margin(K) % Frequency response of H inf controller
K_c=1.25;
tau=1.5;
K_s=K_c*(1+1/tau*s);
figure
margin(K_s) % Frequency response of PI controller
step(T) % Step response of closed loop system
%% Part 2 using wp2
clc
clear all
close all
s=tf('s'); % Laplace transform variable 's'
G=tf(4,[0.0004 0.0396 0.96 -1]); % Plant to be controlled
wb=10; % desired closed-loop bandwidth
A=1/10000; % desired disturbance attenuation inside
bandwidth
sA=sqrt(A);
M=1.5 ; % desired bound on hinfnorm(S) &
hinfnorm(T)
sM=sqrt(M);
Wp1=(s/sM+wb)/(s+wb*sA);
Wp2=Wp1*Wp1;
Wu=1 % Empty control weight
systemnames = 'G Wu Wp2'; % Plant & weight definition
inputvar = '[ r(1);u(1)]'; % Inputs
outputvar = '[Wu;Wp2;r-G]'; % Outputs
input_to_G = '[u]';
input_to_Wu = '[u]';
input_to_Wp2 = '[r-G]';
sysoutname = 'P'; % Generalized Plant
cleanupsysic = 'yes';
P=sysic % Finding P
[Kinf,ginf,gopt] = mixsyn(G,Wp2,Wu,[]);
Gamma_min=gopt; %Gamma minimum for H-inf
controller
s=tf('s');
K=tf(Kinf); % Controller transfer function
L=(G*K); % Open loop system
S=1/(1+G*K); % Sensitivity
T=G*K/(1+G*K); % Complimentary sensitivity
Ms=getPeakGain(S) %Ms
Mt=getPeakGain(T) %Mt
[Gm,Pm,Wgm,Wc]=margin(L) % Wc gives crossover frequency
of open loop system
figure('Name','Bode Diag of Closed Loop System');
margin(T) % Closed loop response, Wc, GM and PM
figure
margin(K) % Frequency response of H inf controller
K_c=1.25;
tau=1.5;
K_s=K_c*(1+1/tau*s);
figure
margin(K_s) % Frequency response of PI controller
step(T) % Step response of closed loop system

You might also like