how to write PID function in .m file
12 次查看(过去 30 天)
显示 更早的评论
i need a pid function in my m file. could anyone please write the function.
2 个评论
PUJARI MURAGA
2016-12-1
You are having state space model. Suppose I have differential equations then is it possible to do without converting them in state space/laplace ?
采纳的回答
Arkadiy Turevskiy
2012-5-14
编辑:Arkadiy Turevskiy
2014-10-27
This demo might help.
Arkadiy
2 个评论
Arkadiy Turevskiy
2012-5-17
well, how many inputs and outputs does you system have? If is a single-input-single output system, then everything shown in the demo is still applicable.If you more comfortable dealing with transfer functions, convert your state space system to a transfer function using tf:
ss_sys=ss(a,b,c,d);
tf_sys=tf(ss_sys);
更多回答(2 个)
Krishnendu Mukherjee
2012-5-14
a way is there : suppose ur tf is (1/a+s) which is to be fed to a pid controler. then the overall tf will be: (Kp+Ki/S+Kd.S).(i/S+a)/(1+(Kp+Ki/S+Kd.S).(i/S+a)). now if you want to give step input then : num=[............] den=[............] tf=num/den ster(tf) so you have to transfer the PID and the tf to a overall transfer function.
Daniel
2014-10-24
Please where's the demo? I'm also trying to write a matlab function for pid using the user-defined function block
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gain Scheduling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!