Find a controller for a feedback-loop
7 views (last 30 days)
Show older comments
We are working on an automation project to stabilize the altitude of an airplane. However, we've encountered an issue that seems unsolvable for us, at least for the moment, in the final phase of this project. After identifying the transfer function G shown below,
G(s) =
1.5284e-05 (s+4.288) (s-4.286)
--------------------------------
s (s+4.142) (s-4.14) (s+0.00053)
%% Plant, G
s = tf('s');
G = zpk((1.5284e-05*(s + 4.288)*(s - 4.286))/(s*(s + 4.142)*(s - 4.14)*(s + 0.00053)))
which has a positive pole, we attempted to create a feedback loop to achieve stability. We used the Sisotool's auto-tuning method LGQ and obtained a controller C_i to multiply with G, resulting in the function G_i.
C_i =
-9.4134e08 (s+4.142) (s+0.02969) (s^2 - 0.02844s + 0.001059)
------------------------------------------------------------
s (s+28.99) (s+4.288) (s^2 - 14.21s + 513.2)
%% LQG controller
Ci = zpk((-9.4134e08*(s + 4.142)*(s + 0.02969)*(s^2 - 0.02844*s + 0.001059))/(s*(s + 28.99)*(s + 4.288)*(s^2 - 14.21*s + 513.2)))
Gc =
-14387 (s-4.286) (s+4.288) (s+4.142) (s+0.02969) (s^2 - 0.02844s + 0.001059)
-------------------------------------------------------------------------------------------
(s+0.7861) (s+4.088) (s+4.193) (s^2 + 8.283s + 17.15) (s^2 + 0.5465s + 0.1494) (s^2 + 1.171s + 0.9972)
%% Closed-loop system
Gcl = feedback(Ci*G, 1)
step(Gcl, 60), grid on
Now, our current challenge is to find a controller C to apply within our closed-loop system, ensuring that we meet the project's requirements without compromising the stability achieved in the previous steps. Below are the requirements.
Requirements: Perfect tracking of constant references for output variation, with a response time not exceeding 15 seconds and any oscillations within 10% of the steady-state value.
After several attempts, it seems that there isn't any value capable of keeping the system stable while having a pole at zero. Is there any suggestion to overcome this problem? We can send the MATLAB code or the PDF with all the steps taken until the derivation of the G(s) function.
0 Comments
Accepted Answer
Sam Chak
on 5 Mar 2024
Edited: Sam Chak
on 5 Mar 2024
Hi @Davide
Sometimes, it can be time-consuming to find a suitable controller that stabilizes unstable non-minimum phase systems while also meeting the performance requirements. In the case of a 4th-order plant, using a compensator of the same order is often the first line of defense against instability, as a higher-order controller can sometimes overkill. With that in mind, could you please evaluate whether the following step response performance is satisfactory?
s = tf('s');
%% Plant, Gp
Gp = zpk((1.5284e-05*(s + 4.288)*(s - 4.286))/(s*(s + 4.142)*(s - 4.14)*(s + 0.00053)))
%% Compensator, Gc
cz = [-4.30348002560136;
-0.000283361299755098 + 0.00216280953262624i;
-0.000283361299755098 - 0.00216280953262624i];
cp = [ 5.56024649650068 + 12.7047387632996i;
5.56024649650068 - 12.7047387632996i;
-14.6428725917671;
-4.51120949748476];
ck = -180243364.417473;
Gc = zpk(cz, cp, ck)
%% Closed-loop system, Gcl
Gcl = feedback(Gc*Gp, 1);
%% Pre-filter, Gf
fz = [];
fp = [-0.000283361299755046 + 0.00216280953262625i;
-0.000283361299755046 - 0.00216280953262625i;
-4.30348002560136;
-4.28800000000001];
fk = 8.78016218952211e-05;
Gf = zpk(fz, fp, fk)
%% Filtered Closed-loop system
Gfc = tf(minreal(series(Gf, Gcl)))
S = stepinfo(Gfc);
step(Gfc, 60), grid on
xline(S.SettlingTime, '--', sprintf('Settling Time: %.3f sec', S.SettlingTime), 'color', '#7F7F7F', 'LabelVerticalAlignment', 'bottom')
More Answers (1)
Mathieu NOE
on 5 Mar 2024
hello
engineering is a mix of knowledge and art. The art of the engineer is to split a complex problem into smaller , simpler tasks. Or check if the complex model can be simplified before we jump into controller design tasks...
here you see that some zeroes and poles are numerically very close (we say "zero poles cancellation - or almost")
If you make the Bode plot you would immediately see that what seemed a complex TF can be viewed as a simple integrator + first order low pass filter. I have no doubt that you can easily design a PID (even just a P) controller in that case
here the two Bode plots overlay perfectly
%% Plant, G
s = tf('s');
G = zpk((1.5284e-05*(s + 4.288)*(s - 4.286))/(s*(s + 4.142)*(s - 4.14)*(s + 0.00053)));
% Bode plot
freq = logspace(-9,3,100);
[g,p] = bode(G,2*pi*freq);
g = squeeze(g);
p = squeeze(p);
% Simplifed TF = 1.5284e-05/(s*(s + 2*pi*fc))
fc = interp1(p,freq,-135); % second pole of simplified TF
G1 = zpk(1.5284e-05/(s*(s + 2*pi*fc)));
[g1,p1] = bode(G1,2*pi*freq);
g1 = squeeze(g1);
p1 = squeeze(p1);
figure(1)
subplot(2,1,1),semilogx(freq,20*log10(g),'b',freq,20*log10(g1),'*r');
subplot(2,1,2),semilogx(freq,p,'b',freq,p1,'*r');
See Also
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!