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

回答(1 个)

Sam Chak
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
Gp = 1 ----- 5 s^2 Continuous-time transfer function.
% 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)
Gc = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 2.46, Ki = 0.324, Kd = 4.65, Tf = 0.00875 Continuous-time PIDF controller in parallel form.
margin(Gc*Gp)
% closed-loop transfer function from Disturbance R(s) to Output Y(s)
Gcd = feedback(Gp, Gc)
Gcd = s^2 + 114.3 s ----------------------------------------------- 5 s^4 + 571.5 s^3 + 533.9 s^2 + 281.5 s + 37.03 Continuous-time transfer function.
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)
Gcl = 533.9 s^2 + 281.5 s + 37.03 ----------------------------------------------- 5 s^4 + 571.5 s^3 + 533.9 s^2 + 281.5 s + 37.03 Continuous-time transfer function.
step(Gcl, 60), grid on % Step Response

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by