derivative filter in PID control loop
4 次查看(过去 30 天)
显示 更早的评论
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...
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!