derivative filter in PID control loop

4 vues (au cours des 30 derniers jours)
Usman
Usman le 16 Mai 2018
Hi, I am using a driving cycle and a PID driver that follows the velocity in the driving cycle as a reference. I have the Kp,Ki,Kd values 15,10,1 respectively. However my loop doesn't follow the speed properly. I may require to implement a filter in the derivative part which I am not sure how to do. Please , help me out how to define the derivative term with the filter using MATLAB only . I am not using any transfer functions neither Simulink . It works in a FOR loop and give results.
Kp=15; % Proportional gain
Ki=10; % Integral gain
Kd=1; % Derivative gain
tauI=1/Ki;
tauD=1/Kd;
e(i) = v_cycle(i)-v_act(i);
deriv = (v_act(i)-v_act(i-1))/dT;
integ = integ+e(i)*dT;
u(i)=(Kp*e(i)) + ((Kp/tauI)*integ) - (Kp*tauD*deriv);
This is some part of my code...

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by