z domain to delay difference equations and applying pid controller

28 次查看(过去 30 天)
i want to convert z domain transfer function to time delay equations and then apply a discrete PID controller for it?
how can i code this?

采纳的回答

Sarvesh Kale
Sarvesh Kale 2023-3-6
编辑:Sarvesh Kale 2023-3-6
1.) convert z domain transfer function to time delay equations
suppose you have the following Z transform
sys = tf([1 2],[1 5 10],0.1,'Variable','z^-1')
sys = 1 + 2 z^-1 -------------------- 1 + 5 z^-1 + 10 z^-2 Sample time: 0.1 seconds Discrete-time transfer function.
So the above transfer function converts to the following equation in time domain
y[n] + 5y[n-1] + 10y[n-2] = x[n] + 2x[n-1]
the numerator of transfer function corresponds to the delays in input and the denominator polynomial represents the delays in the output
2.) How to apply a discrete PID controller ?
you can use the following code snippet to generate the pid controller values
sys = tf(1,[1 1])
sys = 1 ----- s + 1 Continuous-time transfer function.
pidtune(c2d(sys,0.1),'pid') % c2d converts from continuous domain to discrete domain
ans = Ts z-1 Kp + Ki * ------ + Kd * ------ z-1 Ts with Kp = 1.69, Ki = 2.59, Kd = 0.0779, Ts = 0.1 Sample time: 0.1 seconds Discrete-time PID controller in parallel form.
get more information on pidtune, tf and c2d by clicking on them
Thank you

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 PID Controller Tuning 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by