The numerator returned from ord2 function is not directly compatible with tf2zpk function.

4 visualizaciones (últimos 30 días)
Background
Let's say there's a design requirement to build an overdamped closed loop system, such that second order LTI LPF ZIC prototype transfer function is choosen with omega_n = 1 rad/s and zeta = 2.
[num,den] = ord2(1,2)
sys = tf(num,den)
Then the output on the command window will be
num =
1
den =
1 4 1
sys =
Transfer function:
1
-------------
s^2 + 4 s + 1
Problem
This is a trouble if i want to convert it directly to zpk model.
[num,den] = ord2(1,2)
[z,p,k] = tf2zpk(num,den)
sys = zpk(z,p,k)
The output on the command window will be
num =
1
den =
1 4 1
z =
0
0
p =
-3.7321
-0.2679
k = 1
sys =
Transfer function:
s^2
-------------------
(s+3.732) (s+0.2679)
This is clearly different as we now have zeros in the transfer function.
Proposed Solution
The num returned by ord2 should be [0 0 1] instead of just 1.
I guess the problem was overlooked because they came from different toolboxes, ord2 came from Control System Toolbox while tf2zpk came from Signal Processing Toolbox.
And also the prototype given by ord2 is only LPF, there are other prototypes such as HPF, APF (all-pass filter), BPF, BSF.
  1 comentario
James Richard
James Richard el 31 de Jul. de 2022
Editada: James Richard el 31 de Jul. de 2022
My current solution would be
[num,den] = ord2(1,2)
sys = tf(num,den)
sys = zpk(sys)
But by doing this way i have to extract z, p, k again from the sys using zpkdata if i want to use it. It's just one extra step, but may be worth to explain it here.
[z, p, k] = zpkdata(sys)
I'm not sure how to format my whole post here, I just want to share my problem so that someone could google it and let other answer if they think they have better solution.

Iniciar sesión para comentar.

Respuesta aceptada

Paul
Paul el 31 de Jul. de 2022
Editada: Paul el 31 de Jul. de 2022
Hi James,
I'm not sure this really is a problem; all functions are working as documented. A shorter way to get the z,p,k of the continuous time representation is
[num,den] = ord2(1,2);
[z,p,k] = tf2zp(num,den)
z = 0×1 empty double column vector
p = 2×1
-3.7321 -0.2679
k = 1
For sure, be careful when mixing functionality from different toolboxes.
  1 comentario
James Richard
James Richard el 31 de Jul. de 2022
Ok my fault. It's clearly documented. This is not because of mixing functionally. But my wrong intuition.
Who whould've tought that just small chamge in letter of k between tf2zpk and tf2zp could change night and day.
It should be renamed into tf2zpkpos tf2zpkneg or something better...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Model Identification en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by