Gain/phase margin calculated relative to -540.

4 vues (au cours des 30 derniers jours)
Jaco-Louis Venter
Jaco-Louis Venter le 2 Nov 2022
Modifié(e) : Paul le 13 Nov 2022
I am an assistant lecturer for an undergrad control course. Given the following system students are asked to calculate the gain and phase margins.
I came accross the following issue while checking some work. The system is created and is clearly unstable due to the dead-time. I use margin to plot and calculate the required values. However, margin calculates both the gain and phase margins relative to -540° instead of -180°.
G = tf(50, poly([-2 -5]),'IODelay',1);
margin(G,{0.1,12})
[GM, PM] = margin(G)
Warning: The closed-loop system is unstable.
GM = 1.2998
PM = 71.2891
I understand that it will pick up phase crossover modulo 360° (as seen when using allmargin)
allmargin(G)
ans = struct with fields:
GainMargin: [0.3030 1.2998 3.7070 7.6660 13.1972 20.3054 28.9916 39.2569 51.1008 64.5238 79.5259 96.1070 114.2672 134.0065 155.3249 178.2224 202.6991 228.7549 256.3898 285.6039 316.3971 348.7694 382.7209 5.0535e+03] GMFrequency: [1.9827 7.1647 13.0823 19.2080 25.4056 31.6358 37.8830 44.1404 50.4040 56.6719 62.9429 69.2160 75.4908 81.7669 88.0440 94.3219 100.6005 106.8796 113.1592 119.4391 125.7194 131.9999 138.2807 502.6548] PhaseMargin: 71.2891 PMFrequency: 6.0490 DelayMargin: 0.2057 DMFrequency: 6.0490 Stable: 0
and according to the margin documentation it is supposed to return the minimum margins, which in this case should be GM=0.303 (or -10.37 dB).
What causes this to fail? And why is the phase margin calculated relative to a 180° +-k360° if it does actually cross -180°?

Réponse acceptée

Andrew Ouellette
Andrew Ouellette le 10 Nov 2022
Modifié(e) : Andrew Ouellette le 11 Nov 2022
Hi Jaco-Louis,
From the documentation page for margin:
the smallest gain margin (the one closest to 0dB) is returned when there are multiple crossover frequencies.
Since 2.28 dB is closer to 0dB than -10.37dB, this output is expected.
  2 commentaires
Jaco-Louis Venter
Jaco-Louis Venter le 11 Nov 2022
Thank you for your answer, but I must beg to differ on this.
First consider what "smallest" means. Let a=-1, b=0 for demonstration
I'll concede that "smallest" can reffer to both actual value (a<b) or magnitude (|b|<|a|). Clearly this can be somewhat ambigious. If margin is meant to return the value closest to 0dB, then I would suggest explicitly stating that in the documentation. Furthermore, if you consider the magnitude values of the gain margins (which are more closely related to the physical meaning of these plots, and in many cases more useful in understanding the fundamental principles at play) the argument of "closest to 0dB" translates to "closest to 1" which is certainly not the intuitive interpretation of "smallest".
Secondly, and most importantly: negative (and not positive) gain margins (in dB) indicate instability of the system when the loop is closed with unity feedback. This relates to the encirclement of -1 on the Nyquist plot of the openloop transfer function (the direction of encirclement indicates whether it is RPH zero or pole surplus, but this does not really hold for instability caused by dead-time, since the closed loop TF will have "predicting" terms in the denominator. Something not really covered by typical pole analysis).
The gain margin refers to the amount of gain that can be added to the system before stability is lost. A negative gain margin indicates that the gain must be decreased if stability is to be achieved. So the positive gain margin returned in the example above is actually the false positive of stability.
Thirdly: I understand that the interpretation of gain and phase margins gets a bit more complicated when there are mutliple crossover frequencies, but considering the Nyquist plot gives a very clear indication of instability.
G1 = tf(50, poly([-2 -5]),'IODelay',1); % will be unstable in closed loop
G2 = 0.28*G1; % reducing the gain of the sytem to obtain stability
% this uses the value of that first, and unreported gain margin
% (0.2<0.303 must reduce by more to obtain full stability, not just
% marginal) I use a large reduction to make the lack of encirclement clear.
nyquist(G1,G2);
xlim([-4,0.1])
step(feedback(G1,1)); % unstable
step(feedback(G2,1)); %stable
Fourthly: I understand the need for the modulo 360° argument in cases where teh phase starts below -180° or stays above 180°. If we then look at encirclements of -1, all 180+-k360 are equivalent. However, in the case of above the first crossing of a 180+-k360 already has a magnitude greater than 1, indicating an encirclement of -1.
Please reconsider your answer and whether or not it is supported by the frequency domain theory.
Andrew Ouellette
Andrew Ouellette le 11 Nov 2022
I agree with your analysis- I misspoke in my previous reply about the negative gain margin, so I have edited out that portion of my answer.
The help text for "margin" which you can access from executing the following command:
help margin
Includes this bit: "If there are several crossover points, margin returns the smallest margins (gain margin nearest to 0dB and phase margin nearest to 0 degrees)."
This description is not present in the documentation page for "margin", so I will be forwarding this oversight to the approprirate team.
The "allmargin" command you mentioned previously does appear to include the relevant margins for determining stability.

Connectez-vous pour commenter.

Plus de réponses (1)

Paul
Paul le 13 Nov 2022
Modifié(e) : Paul le 13 Nov 2022
Hi Jaco-Louis
From the Question: "... according to the margin documentation it is supposed to return the minimum margins, which in this case should be GM=0.303 (or -10.37 dB). What causes this to fail? And why is the phase margin calculated relative to a 180° +-k360° if it does actually cross -180°?
As to the first question, as has already been answered by @Andrew Ouellette, margin uses the closest to 0 db as the minimum gain margin, and I assume that this really means closest in an absolute value sense, i.e., margin() could return a negative margin if it was closest to 0 dB. I agree with you that margin could be much more clear about its criterion. Having said that, it's not clear to me if you would prefer that margin() use the absolute margin rather than dB margin. If so, as in this example, any "negative" margin will always be smaller ( < 1) than any "positive" margin (> 1). Some people compare margins by distance to the -1 point, so a
db(.5)
ans = -6.0206
gain margin is the same as a
db(1.5)
ans = 3.5218
gain margin.
As to the second question, the gain margin(s) (not the phase margin) is computed at the 180 + k*360 crossovers, as shown in the results from allmargin. I'm not sure what the concern is (or was?).
Finally, I'd like to point out that a "negative margin" does not, by itself, indicate the closed-loop system is unstable. A stable, closed-loop system can have one (or more) negative gain margins. I think (but don't quote me) that an an open-loop, unstable system must have at least one negative gain margin for the closed-loop sytem to be stable. Stable, open-loop systems can also have negative gain margins when the closed-loop system is stable. Furthermore, if the closed-loop system is unstable, as in this Question, the smallest "gain margin" does not, in general, indicate how much the loop gain needs to be increased (or decreased if a "negative margin") to recover closed-loop stabiity. That determination also needs to factor in the number of unstable, open-loop poles.

Catégories

En savoir plus sur Control System Toolbox dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by