How can i get the control effort/output of the PID?
78 ビュー (過去 30 日間)
古いコメントを表示
sys = (2.293*s + 9.172)/(s^2 + 10.29*s + 25.17);
Kp = 5; Ki = 50; Kd = 0.5;
7 件のコメント
Jon
2020 年 9 月 22 日
Now I see what you are doing I will post my response as an "Answer". Hope this helps. If it answers your question you can accept it. Otherwise please follow up with further comments to the "Answer".
採用された回答
Jon
2020 年 9 月 22 日
So I see you are on the right track, you are trying to define the appropriate closed loop transfer functions but using MATLAB's feedback function instead of doing the block diagram algebra by hand. That seems like a good approach. I think you just need to look more at the details of how you are applying the feedback function.
I see you want the closed loop output of the controller to a setpoint change. In this case the forward path would be the PID controller's transfer function, but the feedback path would be the rest of the elements in the closed loop, in this case, the plant or as you call it sys. Note in your case the closed loop always consists of two elements the controller and the plant, but what part of it is the forward path and what part is the feedback path depends upon what output you are interested in. When you are interested in the plant output as the "output" then the controller and the system are in the forward path with unity feedback, that is 1 in the feedback path. When you want the controller output as the "output" then the forward path is just the controller, and the feedback path is the system.
So, for example for your y_zn calculation you should use
y_zn = lsim(feedback(zn_cont,sys),sp,t);
similar for the others.
13 件のコメント
Jon
2020 年 11 月 9 日
Is it for an academic assignment just to get experience using Simulink? If so then what problem are you having using Simulink? If you don't have much experience using Simulink I would recommend first completing the Simulink on-ramp training. It will get you going very quickly https://www.mathworks.com/learn/tutorials/simulink-onramp.html
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で PID Controller Tuning についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!