MATLAB Answers

Full state feedback controller with I servomechanism

26 ビュー (過去 30 日間)
Martin Maier
Martin Maier 2019 年 12 月 25 日
I'm trying to calculate the gain matrix K for a full state feedback controller with an I servomechanism. The problem in my calculation is, that with the calculated K the steady state error is really big. But the ss-error should be 0 due to the I servomechanism. I also calculated the K with the place() function but this yields to the same result.
Do anybody know any possible reasons for that?
A = [0 1;
-0.05 0.4];
B = [0;
5.886];
C = [1 0];
D = [0];
sys_shifted = ss(A,B,C,D);
%% Transform the System from Continous to Discrete
Ts = 10e-3; % Samplingtime in s
sysd_ol = c2d(sys_shifted,Ts);
%% Define Discrete Poles
% poles for the desired damping ratio and natural frequenzy
p(1) = exp((Realpart + Imagpart*1i)*Ts);
p(2) = exp((Realpart - Imagpart*1i)*Ts);
% pole for the servomechanism
p(3) = exp(-800*Ts); % place somewhere far left on the left half plane
%% Adopte System for Controller and Servomechanism Desgin
A_ol = [sysd_ol.A(1,1) sysd_ol.A(1,2) 0;
sysd_ol.A(2,1) sysd_ol.A(2,2) 0;
-sysd_ol.C(1,1) sysd_ol.C(1,2) 0];
B_ol = [sysd_ol.B(1,1) 0;
sysd_ol.B(2,1) 0;
0 1];
C_ol = [sysd_ol.C(1,1) sysd_ol.C(1,2) 0];
D_ol = [0];
%% Calculate Transform Matrix and calculate the control canonical form
%Determine the system characteristic polynomial
CharPoly = poly(A_ol);
% Extract the a0,a1,a2
a0 = CharPoly(4);
a1 = CharPoly(3);
a2 = CharPoly(2);
% Creat inverse Controllability matrix
Pinv_ccf = [a1 a2 1;
a2 1 0;
1 0 0];
% Calculate Transform Matrix
P = [B_ol(:,1) A_ol*B_ol(:,1) A_ol^2*B_ol(:,1)];
Tccf = P * Pinv_ccf;
% Calculate Accf, Bccf, Cccf, Dccf
Accf = inv(Tccf)*A_ol*Tccf;
Bccf = inv(Tccf)*B_ol;
Cccf = C_ol * Tccf;
Dccf = D_ol;
%% Calculate The Alphas
ppoly = poly(p);
alpha0 = ppoly(4);
alpha1 = ppoly(3);
alpha2 = ppoly(2);
%% Calculate Kccf and K
Kccf = [alpha0-a0 alpha1-a1 alpha2-a2];
K_all = Kccf*inv(Tccf);
%% System for Full State Feedback with Servomechanism
A_cl = A_ol - B_ol(:,1) * K_all;
sysc_fsf = ss(A_cl,B_ol(:,2),C_ol,D_ol,Ts);

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by