Implementing a improper discrete-time transfer function into Simulink.
5 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to model a discrete-time control system in Simulink. The control system uses the inverse of a second-order transfer function inside an inner loop. The plant takes the form of:
P(s) = (3.332*s + 4.679)/(s^2+30.97*s+45.5)
s = tf('s');
P = (3.332*s + 4.679)/(s^2+30.97*s+45.5);
First, I calculated P(s)^-1.
P_inv = inv(P);
Trying to implement this improper function into Simulink is not possible so I then performed these steps suggested by MathWorks support team to work around this.
[r,p,k]=residue(P_inv.num{1},P_inv.den{1});
sys1 = tf(r(1),[1,-p(1)]);
sysk1 = k(1)*s;
sysk2 = k(2);
After breaking down the improper function, I discretized it accordingly:
Ts = 0.005;
d_sys1 = c2d(sys1,Ts)
d_sysk1 = c2d(sysk1,Ts,'matched') % <--- problem
The problem is that the resulting d_sysk1 is yet another improper function taking the form of:
d_sysk1 =
59.99 z - 59.99
Sample time: 0.005 seconds
Discrete-time transfer function.
Is there something I am doing incorrectly? I need to implement an inverse and discrete transformation of P(s).
Thanks in advanced, Daniel
0 个评论
回答(1 个)
Zack Peters
2016-9-29
The improperness of your system translates to using derivatives in your math. This works out fine in theory because the inverse of the system can perfect cancel out the poles/zeros of the plant. However in the practice side of things, derivatives on machines are very noisy and extremely unstable. One idea to move your system from improper to proper is to multiply the inverse with a low-pass filter of the same order, making it proper.
It will move the poles of your system for sure, but if a the right filter is applied, it can be minimized. Here is someone else who asked in a similar question (and the same lpf response): https://www.mathworks.com/matlabcentral/newsreader/view_thread/317605
By the way, do you have the control block diagram of your system? I might be able to help more if you show it.
~Zack
2 个评论
Zack Peters
2016-9-30
Hi Daniel,
It's possible that the state-space block may not have the same error constraints that the transfer-function block has. I just tried converting the inverse of P to a state-space an put it into a model and simulated without any problems.
It sounds like you want it discretized so maybe convert to a discrete state-space instead? I think this should work.
~Zack
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Additional Math and Discrete 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!