MATLAB Optimizing Gain Margin in Matlab Bode Diagram

AI Thread Summary
In the discussion about obtaining the gain margin from a Bode diagram in MATLAB, a discrepancy arises between the expected phase crossover at -180 degrees and the observed crossover at -540 degrees using the "Margin" function. The user questions whether to adhere to the traditional -180-degree reference or accept MATLAB's output of -540 degrees. It is suggested that the system may be a non-minimum phase system, which could explain the phase shift. The Nyquist stability criterion is recommended for analysis over the simpler Barkhausen stability criterion in this context. Additionally, the user provides MATLAB code for the transfer function, which includes a numerator and denominator, along with an input delay.
reik6149
Messages
2
Reaction score
0
For the Matlab bode diagram, normally when we want to obtain the gain margin, we have to cross the line from phase -180 and touch the curve. (Picture1 is what I did) however from the matlab, the gain margin crossover is start from -540 instead of -180 degree by using "Margin" function(Picture2 is what Matlab shown).

Attached is the problem's picture, may I know should I stick with -180 like the "picture1" ? or just follow what the Matlab show which is -540?

picture1.png


Picture2.png


What i guess is, due to the gain margin is positive, thus the system auto change to -540 so the gain margin will be negative? Does this make any sense?
 
Physics news on Phys.org
OK, here is the code in matlab

num=[24];
den=[11.5 1];
g=tf(num,den);
set(g,'inputdelay',2.3)
bode(g)
margin(g)...-2.3
24 . e
--------------
11.5s + 1
 

Similar threads

Back
Top