Gain/phase margin calculated relative to -540.
Show older comments
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)
I understand that it will pick up phase crossover modulo 360° (as seen when using allmargin)
allmargin(G)
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°?
Accepted Answer
More Answers (1)
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)
gain margin is the same as a
db(1.5)
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.
Categories
Find more on Control System Toolbox 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!


