We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6836b3 commit 4fe57a8Copy full SHA for 4fe57a8
src/common/pid.cpp
@@ -29,7 +29,7 @@ float PIDController::operator() (float error){
29
// Tustin transform of the integral part
30
// u_ik = u_ik_1 + I*Ts/2*(ek + ek_1)
31
// 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;
+ float integral = integral_prev + I*Ts*0.5f*(error + error_prev) - integral_antiwindup_prev*I;
33
// antiwindup - limit the output
34
float integral_constrained = _constrain(integral, -limit, limit);
35
integral_antiwindup_prev = integral - integral_constrained;
0 commit comments