Skip to content

Commit 4fe57a8

Browse files
committed
typo in antiwindup #59
1 parent e6836b3 commit 4fe57a8

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
@@ -29,7 +29,7 @@ float PIDController::operator() (float error){
2929
// Tustin transform of the integral part
3030
// u_ik = u_ik_1 + I*Ts/2*(ek + ek_1)
3131
// method uses the antiwindup Foxboro method : https://core.ac.uk/download/pdf/289952713.pdf
32-
float integral = integral_prev + I*Ts*0.5f*(error + error_prev) + integral_antiwindup_prev*I;
32+
float integral = integral_prev + I*Ts*0.5f*(error + error_prev) - integral_antiwindup_prev*I;
3333
// antiwindup - limit the output
3434
float integral_constrained = _constrain(integral, -limit, limit);
3535
integral_antiwindup_prev = integral - integral_constrained;

0 commit comments

Comments
 (0)