MATLAB Answers

How to write a system to PID

2 ビュー (過去 30 日間)
Kevin Tran
Kevin Tran 2020 年 5 月 17 日
回答済み: Nikhil Sonavane 2020 年 5 月 20 日
Hi guys,
I'm currently in a course in control engineering and still pretty new on the whole subject. I got this system: y''+25y'+25y=u
The problem is I want to make a PID where I can change the parameters Kp, TI and TD. I know how to write the system into matlab with ode45:
[T2,Y2]=ode45(@diffeq2,[0 10],[0;0]);
function dy = diffeq2(t,y)
if t < 0
u = 0;
u = 1;
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = u - 10*y(2) - 25*y(1);
but I have no idea how to change the script so I can change the parameters Kp, TI and TD for example to Kp=1 TI=0.1 and TD=0.2 to get a better step response like my professor did. He didn't show how to do it just that with those parameters you will get a better step response and then he showed the graph but no script on how to do it. I have searched everywhere and watched several videos for hours without understanding anything. So my last resort is asking the matlab community for help.
Thanks in advance if you can help me!

  0 件のコメント


回答 (1 件)

Nikhil Sonavane
Nikhil Sonavane 2020 年 5 月 20 日
I would suggest you go through the Design and implement PID controllers which has several videos and documents which may help you solve your query.

  0 件のコメント



Community Treasure Hunt

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

Start Hunting!

Translated by