constructing discrete time system
10 次查看(过去 30 天)
显示 更早的评论
I consturcted the loop for disturbance rejection for discrete time system.
But I wonder, why two steps are different?
Gdtest case: discretization and then constructed closed loop
Gdd2 case: constructed closed loop and then discretized the closed loop
I'm confused which one is right.
And I wonder how to check output of controller which is input of system Gd.
Thank you in advance
s = tf('s');
G = 4000/(s*(s+10)*(s+20));
st = 0.02;
Gd= c2d(G,st,'foh');
Cdr = 20 + 100/s + 2*s/(s/1000 + 1);
Gdr0= c2d(Cdr,st,'foh');
Gdtest = feedback(Gd,Gdr0);
Gdd2= c2d(feedback(G, Cdr),st,'foh');
figure;
step(Gdtest)
figure;
step(Gdd2)
0 个评论
回答(1 个)
Paul
2023-12-13
Hi Junhwi,
The short answer is that the sample time, st, is too large for discretizing Cdr before forming the closed-loop system.
First, I think it's easier to see what's happening by using the zpk form instead of the tf form.
s = zpk('s');
Now form G and discretize it.
G = 4000/(s*(s+10)*(s+20))
st = 0.02;
Gd = c2d(G,st,'foh')
We see that all the poles have been mapped in accordance with z = exp(s*T).
exp(pole(G)*st)
Note that the sampling time, 0.02, is more 2x smaller than the smallest time constant in G, which is 1/20 = 0.05.
Form Cdr
Cdr = 20 + 100/s + 2*s/(s/1000 + 1)
The sample time, 0.02, is 20x larger than the smallest time constant in Cdr, which is 1/1000 = 0.001. Hence, the discretization will not be what we want.
Gdr0 = c2d(Cdr,st,'foh')
The pole at the origin s=0 in Cdr maps to z = 1, and the pole at s = -1000 maps to exp(-1000*st), which is effectively at the origin. This pole at the origin is an open-loop pole.
Now we form the closed-loop system, and because that open-loop pole at the origin isn't really in the correct location, the feedback is wrong and we get an unstable system (poles outside the unit circle)
Gdtest = feedback(Gd,Gdr0)
abs(pole(Gdtest))
Here, we form the continuous-time closed-loop system
feedback(G,Cdr)
Looking at the time constants associated with the poles
-1./real(pole(ans))
we see that the st is considerably smaller than all of them, except the time constant associated with the pole at s = -1008. So that pole will incorrectly map to the origin after discretization. BUT, that pole is a closed-loop pole (not an open-loop pole) and in this case it's nearly cancelled by the zero at s = -1000, which will also result in a near cancellation after discretization
Gdd2 = c2d(feedback(G, Cdr),st,'foh')
As expected, we have a closed-loop pole essentially at the origin and a zero there as well at z = 1.221e-6. So the fact that st is too large doesn't really have an impact when discretizing the closed-loop system.
The solution for the first case is to use a much smaller sample time
st = st/100;
Gd = c2d(G,st,'foh');
Gdr0 = c2d(Cdr,st,'foh');
Gdtest = feedback(Gd,Gdr0);
Gdd2 = c2d(feedback(G, Cdr),st,'foh');
figure; % put all three systems on the same plot
step(feedback(G,Cdr),Gdtest,Gdd2)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time and Frequency Domain Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!