stability_margins doesn't find gain=1 crossover frequency correctly for DT systems
See original GitHub issuestability_margins doesn’t find gain=1 crossover frequency correctly for DT systems, but it seems to mostly do so for CT systems. I think the probelm may be in how margins.poly_z_mag1_crossing
is finding roots, but there were a few steps in that function I couldn’t follow, e.g. why H(z)*H(1/z)=1 implies |H(z)| = 1.
Example:
import control as ct
omegan = 2*np.pi
zeta = 0.2
plant = 1.1*ct.tf(omegan**2, [1, 2*zeta*omegan, omegan**2])
Ts = .05
plantdisc = ct.c2d(plant,Ts,'zoh')
#_ = ct.bode_plot(plant, margins=True) # gives correct gain=1 crossover freq
_ = ct.bode_plot(plantdisc, margins=True) # no gain=1/no phase margin given

As an example of what it should look like, here is Matlab:
omegan = 2*pi;
zeta = 0.2;
plant = 1.1*tf(omegan^2, [1, 2*zeta*omegan, omegan^2])
Ts = .05;
plantdisc = c2d(plant,Ts,'zoh')
margin(plantdisc)

Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
MATLAB allmargin - MathWorks
This MATLAB function computes the gain margin, phase margin, delay margin, and the corresponding crossover frequencies for the SISO or MIMO negative ...
Read more >How do I determine the stability of the system having multiple ...
Then look at the higher frequency phase crossovers and if they all have sufficient gain margin, then you should not have a stability...
Read more >Frequency Response Analysis & Design
Stable systems with low stability margins work only on paper; when implemented in real time, they are frequently unstable. • The way uncertainty...
Read more >Op Amps for Everyone Design Guide (Rev. B)
Op amps can't exist without feedback, and feedback has inherent stability problems, ... Inverting Op Amp: Feedback Loop Broken for Loop Gain Calculation....
Read more >What is the phase margin when there are multiple gain ...
I think what matters is the distance to the -1 point in all cases. With Bode, I would consider PM at all crossover...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If we can get this sorted out before ~22 March, we can do a 0.9.0 release that week to make it easy for students to install.
In any case there should be a check, whether the current results are accurate enough and give a warning if not.