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
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)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4