Margin gives wrong 0db point. (the second crossing of the 0db line not the first)

2 次查看(过去 30 天)
In the code below, brief explanation is:
Some parameters, Transfer function H, Controller C, Plant C*H, and bodeplot, margin
The error is in the last step, were margin provides me the second 0db crossing and not the first. Weird thing is that for a = 1, the (good) result is the first 0db crossing.
K = 450; a=3; m1 = 0.015; m2 = 0.045; M = m1+m2; k = 2200; d = 0.4; s=tf('s'); H = ((m2*(s)^2) + d*s + k )/((s^2)*((m1*m2*(s^2))+(d*M*s)+(k*M))); C = K* (((1/(2*pi*(20/a)))*s+1) / ((1/(2*pi*20*a))*s+1) ); CH = C*H; bodeplot(CH) [Gm,Pm,Wg,Wp] = margin(CH) margin(CH)

回答(1 个)

Craig
Craig 2011-11-16
Hi Max,
The MARGIN command computes the mimimum phase margin, which in the code example you provided does occur for the third 0dB crossover. So the MARGIN command is behaving as expected.
From the help for margin
" ... If there are several crossover points, margin returns the smallest margins (gain margin nearest to 0dB and phase margin nearest to 0 degrees). ... "
If you want all the margins you can use the ALLMARGIN command.
Thanks, -craig

Community Treasure Hunt

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

Start Hunting!

Translated by