margin() returns incorrect gain margin for open-loop unstable system

33 次查看(过去 30 天)
I am wondering if anyone knows why MATLAB returns an incorrect value for gain margin when using margin() with a system that is open-loop unstable, or whether this is a bug that should be reported.
See the following example:
>> Gol1
Gol1 =
0.00074321 (z+0.9875)
---------------------
(z-1.001) (z-0.9619)
Sample time: 0.04 seconds
Discrete-time zero/pole/gain model.
>> [Gm,Pm,Wgm,Wpm]=margin(Gol1)
Gm =
0.0316
Pm =
48.7296
Wgm =
0
Wpm =
0.7615
Manually applying the Jury stability criterion to the above discrete-time system results in a range of stability of 0 < K < ~50.6. margin(), on the other hand, returns a gain margin of -30dB/0.0316 at 0 rad/s for some reason.
The bode plots generated using margin() or bode() clearly shows the -180deg phase crossover near ~6.8 rad/s with ~34dB of gain margin, which is the correct result. Why does margin() return the wrong Gm and Wgm values?

采纳的回答

Arkadiy Turevskiy
Arkadiy Turevskiy 2014-11-26
编辑:Arkadiy Turevskiy 2014-11-26
I don't agree that "MATLAB returns incorrect value". If you read the documentation for margin , you will see the section I posted below as an image (at the very end of the answer). Notice the text I highlighted in yellow. The important thing here is that margin returns minimum gain margin, i.e., if the phase is -180 at several frequencies, the answer is for the frequency where the gain margin is the lowest.
Now take your system and evaluate gain and phase at w = 0 rad/sec:
This shows that at 0 rad/sec the phase is -180, and gain is 31.7 dB (ignore small numerical differences with your 30db) - so the answer that margin returns.
If you want to get not just the minimal gain margin, but all of them, use allmargin :
You see that this system has 3 gain margins, and margin returned the lowest one, as intended.
  1 个评论
Bryan
Bryan 2014-12-2
Thank you for the comprehensive response. The existence of multiple gain margins and the fact that margin() returns the smallest was something that I didn't understand yet. I've since done some research and I think I understand it better. It's good to learn about allmargin() as well. Thanks!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by