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?
13 次查看(过去 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 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!