Control System Steady State Error for VTOL

I am designing the control system that have a crossover frequency is wc=6 rad/s, 90 degrees least phase margin,and steady-state error must be zero.
but I am having steady state error equal to 1, I am trying to make it 0 but it is not working.
need guidance on what I am doing wrong.
Equations that I am using (values of a and b are random):
My code:
clc
clear
close
%%
wc=6;
G=tf(0.51,[0.23 0.38 1]);
[mag,pahse]=bode(G,wc);
Kp=1/mag;
L=Kp*G;
pzmap(G)
axis ([-1 1 -3 3])
%%
margin(G); grid;
hold on
margin(L);
legend('G(s)','L(s)')
hold off
%%
%klead
a=10;
klead1=tf([a wc],[1 a*wc]);
klead2=tf([a wc],[1 a*wc]);
Klead=klead1*klead2;
L=Kp*G*Klead;
figure(2)
margin(L); grid;
%%
%klag
b=1;
Klag=tf([1 b],[1 0]);
L=Kp*G*Klead*Klag;
figure(3)
margin(L); grid;
e=feedback(L,1)
figure(4)
step(e); grid;
legend('Kp=0.0669')

 Respuesta aceptada

Sam Chak
Sam Chak el 5 de Dic. de 2022
Editada: Sam Chak el 5 de Dic. de 2022
The transfer function between the error signal and the input signal is defined by
where is the closed-loop system.
wc = 6;
Gp = tf(0.51, [0.23 0.38 1])
Gp = 0.51 --------------------- 0.23 s^2 + 0.38 s + 1 Continuous-time transfer function.
[mag, phase] = bode(Gp, wc);
Kp = 1/mag;
L = Kp*Gp;
pzmap(Gp)
axis ([-1 1 -3 3])
%%
margin(Gp); grid;
hold on
margin(L);
legend('G(s)','L(s)')
hold off
%%
%klead
a = 10;
klead1 = tf([a wc], [1 a*wc]);
klead2 = tf([a wc], [1 a*wc]);
Klead = klead1*klead2;
L = Kp*Gp*Klead;
figure(2)
margin(L); grid;
%%
%klag
b = 1;
Klag = tf([1 b], [1 0]);
L = Kp*Gp*Klead*Klag;
figure(3)
margin(L); grid;
Gcl = minreal(feedback(L, 1))
Gcl = 3317 s^3 + 7297 s^2 + 5174 s + 1194 ------------------------------------------------------------- s^5 + 121.7 s^4 + 7119 s^3 + 1.377e04 s^2 + 2.083e04 s + 1194 Continuous-time transfer function.
figure(4)
err = 1 - Gcl; % error signal
step(err); grid;
legend('Kp=0.0669')
It achieves zero steady state error for a unit step input.
yss = dcgain(Gcl)
yss = 1.0000
Another way to check is the steady-state output of . If the , then it is guaranteed to achieve zero steady state error.

5 comentarios

It is lucky that your chosen Lead-Lag compensator has the same mathematical structure as the PID with first-order filter on derivative term (PIDF). So, it is possible to manually tune a PID Controller for fast reference tracking, and to satisfy the design requirements at the same time.
Gp = tf(0.51, [0.23 0.38 1])
Gp = 0.51 --------------------- 0.23 s^2 + 0.38 s + 1 Continuous-time transfer function.
% PIDF Controller
kp = 4.4687;
ki = 11.7638;
kd = 2.7051;
Tf = 1/7775.4;
Gc = pid(kp, ki, kd, Tf)
Gc = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 4.47, Ki = 11.8, Kd = 2.71, Tf = 0.000129 Continuous-time PIDF controller in parallel form.
% Closed-loop system
Gcl = minreal(feedback(Gc*Gp, 1))
Gcl = 4.665e04 s^2 + 7.707e04 s + 2.028e05 ---------------------------------------------------- s^4 + 7777 s^3 + 5.95e04 s^2 + 1.109e05 s + 2.028e05 Continuous-time transfer function.
% Error signal
err = 1 - Gcl;
step(err); grid;
Gcp = Gc*Gp;
margin(Gcp)
Abdul Rahman Alam
Abdul Rahman Alam el 5 de Dic. de 2022
Editada: Abdul Rahman Alam el 5 de Dic. de 2022
Thank you, can I change values of a and b to achieve close to 90 degree phase margin or let it be?
Sam Chak
Sam Chak el 5 de Dic. de 2022
Regarding your original problem to your question, my Answer was to show you the difference between the Closed-loop transfer function , where you used the feedback() command, and the Error transfer function . Your original Lead-Lag compensator has successfully achieved zero steady-state error, despite it doesn't satisfy the design requirements.
Regarding the values for a and b, yes you can choose them according to design guidelines. However, I don't remember the exact procedure. I just remember that you need to find/select the dominant closed-loop poles, which generally can be estimated from the performance specifications.
Then, in order to place the dominant closed-loop poles at the desired location, you need estimate the angle contribution needed from the phase-lead portion of the Lead–Lag compensator. The graphical Root Locus rlocus() approach is probably more suitable.
Abdul Rahman Alam
Abdul Rahman Alam el 5 de Dic. de 2022
Editada: Abdul Rahman Alam el 5 de Dic. de 2022
@Sam Chak can you enlighthen me how did you get the values of (kp, ki, kd, Tf)? we only studied it as equations but dind't apply it on actual example. and is Tf stand for closed loop transfer function?
Sam Chak
Sam Chak el 5 de Dic. de 2022
Editada: Sam Chak el 5 de Dic. de 2022
If you find the explanation and MATLAB code helpful, please consider accepting ✔ and voting 👍 the Answer. Thanks a bunch! 🙏
Back to your query, clicking the link, you will find the PIDF controller, which stands for Proportional, Integral, and Derivative with first-order filter on derivative term.
So, the Tf is actually the time constant of the first-order filter, as shown in the Continuous-Time Controller Formula:
Note that Tf is usually a very small value so that it approximates ideal PID controller:
As mentioned previously, the values of (kp, ki, kd, Tf) were manually tuned until performance requirements were achieved. In fact, I used margin() iteratively to check that. Mine was the computer-assisted manual tuning.
If you are looking for the "Computer-tunes-it-for-me" approach, then try this powerful script:
Gp = tf(0.51, [0.23 0.38 1])
Gp = 0.51 --------------------- 0.23 s^2 + 0.38 s + 1 Continuous-time transfer function.
% Control Design
wc = 6; % desired crossover frequency
opts = pidtuneOptions('PhaseMargin', 90, 'DesignFocus', 'reference-tracking');
[Gc, info] = pidtune(Gp, 'PIDF', wc, opts)
Gc = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 4.34, Ki = 1.83, Kd = 2.43, Tf = 0.00146 Continuous-time PIDF controller in parallel form.
info = struct with fields:
Stable: 1 CrossoverFrequency: 6 PhaseMargin: 90
% Closed-loop transfer function
Gcl = minreal(feedback(Gc*Gp, 1))
Gcl = 3705 s^2 + 6607 s + 2785 ------------------------------------------ s^4 + 687.3 s^3 + 4842 s^2 + 9589 s + 2785 Continuous-time transfer function.
% Error transfer function
Ge = 1 - Gcl;
step(Ge); grid;
Gcp = Gc*Gp;
margin(Gcp)

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 5 de Dic. de 2022

Editada:

el 5 de Dic. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by