question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

stability_margins doesn't find gain=1 crossover frequency correctly for DT systems

See original GitHub issue

stability_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
image

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)
image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
murrayrmcommented, Mar 12, 2021

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.

1reaction
bnavigatorcommented, Mar 12, 2021

In any case there should be a check, whether the current results are accurate enough and give a warning if not.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found