Hi everyone,
I have a problem and I cannot understand it at all and consequently I faced many problems. I appreciate if you could kindly help me.
I have a controller C and a open loop transfer function Go as attached. I am trying to find the closed loop transfer function.
1- First see what sisotool give to me which is what I expect and is the correct results (see Sisotool in the attachment).
2- Now, we know that the close loop transfer function equation is:
Gcloseloop=(C*Go)/(1+C*Go)
bode(Gcloseloop)
I have ploted this equation by bode(Gcloseloop) and suprisingly, I get what you can see in equation_bode picture in the attachment. As you can see it is compltely different with that of sisotool.
3-Now, if I use the following function, I get another result as you can see in seies-feedback picture in the attachement.
bode(feedback(series(C,Go),1)).
Can anyone says that why this happens and how can I get the same results of stage 1 by 2 and 3?
Many thanks in advance for your help.

1 comentario

Don Pickerel
Don Pickerel el 28 de Sept. de 2021
I have a similar question. When I do an open loop bode in sisotool, I am getting a different result from "bode" (and evidently "allmargin" for the exact same transfer function.
I"m using r2019b.

Iniciar sesión para comentar.

Respuestas (1)

Paul
Paul hace alrededor de 19 horas
The moral of this story is to prefer zpk over tf form as early in the process as possible and use interconnection commands, like @doc:series and @doc:feedback, instead of algebraic manipulations.
load Gcz
load Gz_Loop
Gcz
Gcz =
0.02644 z^9 - 0.2207 z^8 + 0.8148 z^7 - 1.746 z^6 + 2.391 z^5 - 2.167 z^4 + 1.297 z^3 - 0.4939 z^2 + 0.1082 z - 0.01034 ----------------------------------------------------------------------------------------------------------------------- z^9 - 8.601 z^8 + 32.84 z^7 - 73.02 z^6 + 104.2 z^5 - 98.97 z^4 + 62.51 z^3 - 25.32 z^2 + 5.963 z - 0.622 Name: C Sample time: 5e-05 seconds Discrete-time transfer function.
Gz_Loop
Gz_Loop =
0.0727 z^2 + 0.1747 z + 0.01659 ------------------------------------ z^4 - 2.696 z^3 + 2.64 z^2 - 0.944 z Sample time: 5e-05 seconds Discrete-time transfer function.
Form the closed-loop system in four ways.
sys1 = feedback(Gcz*Gz_Loop,1); % tf
sys2 = feedback(zpk(Gcz*Gz_Loop),1); % convert product to zpk
sys3 = feedback(zpk(Gcz)*zpk(Gz_Loop),1); % convert each to zpk
sys4 = (Gcz*Gz_Loop)/(1 + Gcz*Gz_Loop); % tf algebra, don't do this
sys4 has 26 poles
numel(pole(sys4))
ans = 26
even though the closed-loop system should only have 9 + 4 = 13. In theory, the additional 13 poles in sys4 are cancelled by 13 zeros, but numerically that's not the case, presumbably because the high order polynomials involved have many poles and zeros densely bunched around z =1.
Plot the pole-zero plots, zoom in around z = 1
figure
tiledlayout,llim = 0.94;
nexttile,pzplot(sys1);xlim([llim,1.03]),title('sys1')
nexttile,pzplot(sys2);xlim([llim,1.03]),title('sys2')
nexttile,pzplot(sys3);xlim([llim,1.03]),title('sys3')
nexttile,pzplot(sys4);xlim([llim,1.03]),title('sys4')
The maps for sys1, sys2, and sys3 look somewhat similar, but they're really not the same. sys4 is clearly different.
Show the entire map for sys4
figure;pzplot(sys4);title('sys4');
It sure looks a lot different, presumably inaccurate due to closely spaced roots of the high-order numerator and denominator polynomials. And I just realized that the full plot doesn't show the pair of poles and pair of zeros very close to z = 1 that are shown in the zoomed in version in the tiled layout. No idea why that would be the case. @Andrew Ouellette, any ideas?
bode plots of all four. The blue (sys1) and purple (sys4) curves match the .fig files attached to the question and the gold curve matches the .png file from sisotool attached to the question.
figure
bode(sys1,sys2,sys3,sys4); % blue, red, gold, purple
That sys3 (convert each to zpk and then use @doc:feedback) is correct can be verified by resorting to symbolics.
syms z
num1 = poly2sym(Gcz.num{:},z); num2 = poly2sym(Gz_Loop.num{:},z);
den1 = poly2sym(Gcz.den{:},z); den2 = poly2sym(Gz_Loop.den{:},z);
H(z) = num1*num2/(den1*den2 + num1*num2);
syms w real
figure
fplot(subplot(211),20*log10(abs(H(exp(1j*w*Gcz.Ts)))),[5e-5,pi]/Gcz.Ts);
set(gca,'XScale','log');
fplot(subplot(212),180/pi*(angle(H(exp(1j*w*Gcz.Ts)))),[5e-5,pi]/Gcz.Ts);
set(gca,'XScale','log');

Categorías

Más información sobre Get Started with Control System Toolbox en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 6 de Jun. de 2019

Respondida:

hace alrededor de 19 horas

Community Treasure Hunt

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

Start Hunting!

Translated by