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?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Sam Chak
le 28 Fév 2023
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 commentaires
Voir également
Catégories
En savoir plus sur PID Controller Tuning dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


