Skip to content

Commit 710819a

Browse files
committed
FIX pid error fixed from previous to current
1 parent 3a2d607 commit 710819a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/pid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ float PIDController::operator() (float error){
2525
// Discrete implementations
2626
// proportional part
2727
// u_p = P *e(k)
28-
float proportional = P * error_prev;
28+
float proportional = P * error;
2929
// Tustin transform of the integral part
3030
// u_ik = u_ik_1 + I*Ts/2*(ek + ek_1)
3131
float integral = integral_prev + I*Ts*0.5*(error + error_prev);

0 commit comments

Comments
 (0)