Discritization of transfer function

3 views (last 30 days)
uttam gavand
uttam gavand on 5 Jun 2019
Commented: uttam gavand on 8 Jun 2019
Namaste,
I want to implement higher order transfer function in microcontroller. I have used 'c2d' command with all available options but not getting satisfactory results.
So I want to use Al-alaoui transform (s=[8(1-z^-1)]/[7*T(1+(1/(7*z)))] where T is 0.1sec in my program) into my program. I have used symbolic toolbox but not getting simplified results.
Can anyone help me
  2 Comments
David Wilson
David Wilson on 5 Jun 2019
Here's my take on your problem: I've invented an arbitrary continuous TF (since you neglected to tell us what you are dealing with), and then discretised it in a variety of ways, including your "AA" method. Results are relatively poor, except at small sample times.
tau = 2; zeta = 0.5;
Gc = tf([5 2],conv([6 5 4],[tau^2 2*tau*zeta 1])) % continuous TF
Ts = 1; % sampling time [s]
B = cell2mat(Gc.Numerator);
A = cell2mat(Gc.Denominator);
G = poly2sym(B,s)/poly2sym(A,s);
syms s z T
Gd = subs(G,s,8*(1-1/z)/(7*T*(1+1/7/z)))
Gd = subs(Gd,T,Ts); [N,D] = numden(Gd); Gd1 = tf(sym2poly(N), sym2poly(D),Ts);
%Gd = subs(Gd2,T,Ts); [N,D] = numden(Gd); Gd2 = tf(sym2poly(N), sym2poly(D),Ts);
Gd2 = c2d(Gc,Ts,'zoh');
Gd3 = c2d(Gc,Ts,'foh');
Gd4 = c2d(Gc,Ts,'tustin');
step(Gc, Gd1, Gd2, Gd3, Gd4)
legend('G_c','AA')
uttam gavand
uttam gavand on 8 Jun 2019
Thank you ?, with some modifications achieved my desired output.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!