RobustAndOptimalControl.jl icon indicating copy to clipboard operation
RobustAndOptimalControl.jl copied to clipboard

zpk fails for a real valued uncertain system (with feedback)

Open uchytil opened this issue 9 months ago • 1 comments

Slightly more involved than the basic example in RobustAndOptimalControl.jl. However, it seems to be a ControlSystemsBase issue.

Attempting to create an uncertain feedback system with a simple filtered PD controller.

using ControlSystemsBase, MonteCarloMeasurements

ω = 4..12
ζ = 0.054..0.084

G  = tf([2*ζ/ω, 1],  [1/ω^2, 2*ζ/ω, 1, 0, 0])

C = 1.0 * tf([1, 1], [0.1, 1])
G_closed = feedback(C*G, 1)

zpk(G_closed)

Fails with

ERROR: ArgumentError: zpk model should be real-valued, but poles do not come in conjugate pairs.

which further affects other functions such as bodeplot.

(orr) pkg> st ControlSystemsBase
Status `~/Documents/FEL/ORR/orr/Project.toml`
  [aaaaaaaa] ControlSystemsBase v1.14.7
(orr) pkg> st MonteCarloMeasurements
Status `~/Documents/FEL/ORR/orr/Project.toml`
  [0987c9cc] MonteCarloMeasurements v1.4.5

uchytil avatar Apr 28 '25 15:04 uchytil

Thanks for the issue report. I'll have a look at fixing it soon, but for now, using a statespace representation as far as possible is recommended for numerical purposes, e.g., by converting G to statespace directly after creation, in which case asking for tzeros and poles should work

baggepinnen avatar Apr 29 '25 05:04 baggepinnen