derivative filter in PID control loop

조회 수: 4 (최근 30일)
Usman
Usman 2018년 5월 16일
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개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by