How can i get the control effort/output of the PID?

78 ビュー (過去 30 日間)
Rupali Gawde
Rupali Gawde 2020 年 9 月 21 日
コメント済み: Jon 2020 年 11 月 9 日
sys = (2.293*s + 9.172)/(s^2 + 10.29*s + 25.17);
Kp = 5; Ki = 50; Kd = 0.5;
  7 件のコメント
Rupali Gawde
Rupali Gawde 2020 年 9 月 22 日
編集済み: Rupali Gawde 2020 年 9 月 22 日
Find code in attachment. Please help and check the last section "Control Effort". Please help correct the code if needed. I need to find the output from all the 4 controllers -ZN-PID, GA-PID, PSO-PID, ABC-PID, TLBO-PID.
Thanks.
Jon
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
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
Jon 2020 年 11 月 9 日
Why, you will get the same answer as with lsim.
Jon
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 ExchangePID Controller Tuning についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by