what is the code to implement a disturbance of 0.2 in the system at 400 sec that would test the disturbance rejection of the controller and allow the system to return to 1?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi All,
Can anyone help me with MATLAB code for a disturbace of 0.2 at 400 seconds that would test the disturbance rejection of the PID controller and allow the system to return to 1?
I need to test the tuning by applying a disturbance at 400 seconds to see how the controller responds in that case in MATLAB code.
Help very much appreiciated!!
Thanking you
0 件のコメント
回答 (1 件)
Sam Chak
2023 年 2 月 28 日
Since your system is not provided, here is a simple example to demonstrate the disturbance rejection capability of a PID controller for a Double Integrator system.
s = tf('s');
m = 5;
Gp = 1/(m*s^2) % Plant
% PID controller
Kp = 2.460; % proportional gain
Ki = 0.324; % integral gain
Kd = 4.650; % derivative gain
N = 114.29; % 1st-order derivative filter coefficient
Gc = pid(Kp, Ki, Kd, 1/N)
margin(Gc*Gp)
% closed-loop transfer function from Disturbance R(s) to Output Y(s)
Gcd = feedback(Gp, Gc)
step(Gcd), grid on % Response to a Unit step disturbance
If the output response to a unit step disturbance D(s) = 1 goes to zero in 50 seconds, then rest assured that the output will track the unit step reference R(s) = 1.
% closed-loop transfer function from Reference R(s) to Output Y(s)
Gcl = feedback(Gc*Gp, 1)
step(Gcl, 60), grid on % Step Response
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!