Robust control system calculations

AI Thread Summary
The discussion revolves around robust control system calculations using MATLAB, specifically focusing on H-infinity controller design and analysis. The user shares their MATLAB code for two controller designs, detailing the transfer function definitions, weight selections, and the implementation of the mixsyn function for controller synthesis. The analysis includes step response plots and Bode magnitude plots to compare the performance of both designs. Additionally, the user addresses multiplicative uncertainty using the ucover function to fit uncertainty weights. The conversation emphasizes the importance of showing work for effective tutorial assistance.
Naibos77
Messages
3
Reaction score
0
4.JPG
can i solve this problem i didnt go university due to Covid-19
3.JPG
 
Physics news on Phys.org
Welcome to PF.

Before we can give you tutorial help, we need to see your attempt at solving this problem. Show us your work.
 
okey for problem 1 i wrote this MATLAB code :

1.JPG
2.JPG


clear all;
clc;
% Defining TF
s=tf('s');
G=4/((s-1)*(0.02*s+1)^2);
Gd=100/(10*s+1);

% Weight Selection
M=1.8; wb=20; A=1e-4;
Wp=tf([1/M wb], [1 wb*A]);
Wu=1;

% Hinf Controller Design
[K,CL,gamma]=mixsyn(G,Wp,Wu,[]);

[K_num, K_den] = ss2tf(K.a,K.b,K.c,K.d);

Ks = tf(K_num, K_den);

% Analysis
Gcl = minreal(feedback(G*Ks,1));

figure(1)
step(Gcl)
grid on

L = G*Ks;
S = minreal(1 / (1 + L));
KS = Ks*S;

figure(2)
bodemag(S,'b',KS,'g',gamma/Wp,'b--',ss(gamma/Wu),'g--')
legend('S','KS','gamma/Wp','gamma/Wu','Location','SE')
grid on

%figure(2)
%sigma(S,'b',KS,'g',gamma/Ws,'b--',ss(gamma/Wu),'g--')
%legend('S','KS','gamma/Ws','gamma/Wu','Location','SE')
%grid on

% Second Controller Weights
M2=1.5; wb2=10; A2=1e-4; n = 2;
Wp2 = (s/M2^(1/n) + wb2)^n / (s + wb2*A2^(1/n))^n;
Wu2=1;

% Second Hinf Controller Design
[K2,CL2,gamma2]=mixsyn(G,Wp2,Wu,[]);

[K2_num, K2_den] = ss2tf(K2.a,K2.b,K2.c,K2.d);

K2s = tf(K2_num, K2_den);

% Analysis
G2cl = minreal(feedback(G*K2s,1));

figure(3)
step(Gcl, G2cl)
legend('Design 1', 'Design 2')
grid on

L2 = G*K2s;
S2 = minreal(1 / (1 + L2));
KS2 = K2s*S2;

figure(4)
bodemag(S2,'b',KS2,'g',gamma2/Wp2,'b--',ss(gamma2/Wu2),'g--')
legend('S2','KS2','gamma2/Wp2','gamma2/Wu2','Location','SE')
grid on

figure(5)
bodemag(S,'b',S2,'m',gamma/Wp,'b--',gamma2/Wp2,'m--')
legend('S','S2','gamma/Wp','gamma2/Wp2','Location','SE')
grid on

figure(6)
step(S*Gd, S2*Gd, 2)
legend('Design 1', 'Design 2')
grid on
 
for question 2 :
clear all
clcDelta_I = ultidyn('Delta_I', [1 1]);
Delta_I = ultidyn('Delta_I', [1 1]);

G = tf(1,[0.1 1])

G1 = G*tf(1,[.05 1])

G2 = G*tf([-.01 1],[.01 1])

G3 = G*tf(4,[1 2 4])

G4 = G*tf(100,[1 2 100])
array = stack(1,G1,G2,G3,G4);
Garray = frd(array,logspace(-1,3,60));

rel_err = (Garray - G) / G;
figure(1)
bodemag(rel_err)
grid on

% Fitting multiplicative uncertainty weight
[Gp,Info] = ucover(Garray,G,1);

figure(2)
bodemag(rel_err,'b--',Info.W1,'r',{0.1,1000})
grid on

% Multiplicative Uncertainty Weight in tf form
[num_wI den_wI] = ss2tf(Info.W1.a,Info.W1.b,Info.W1.c,Info.W1.d);
wIs = tf(num_wI, den_wI);

% Other representation of Gp
Gp2 = G * (1 + wIs * Delta_I)

relative.JPG
 
Back
Top