Implementing a improper discrete-time transfer function into Simulink.
5 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Zack Peters
on 29 Sep 2016
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 Comments
Zack Peters
on 30 Sep 2016
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
See Also
Categories
Find more on Additional Math and Discrete in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!