You didn't comment...
It looks like this commit is what broke it:
fb5f9034eab3ba32f8408b2f4b1a7a5a40ecf644
$ git diff ebc4b16d9a613ad48037a567554dccbbdc327a43 dcb3d760db41665584fa1497a65693158203e152 flight/libraries/math/pid.c
diff --git a/flight/libraries/math/pid.c b/flight/libraries/math/pid.c
index 4fba369..32f386f 100644
--- a/flight/libraries/math/pid.c
+++ b/flight/libraries/math/pid.c
@@ -6,7 +6,7 @@
* @{
*
* @file pid.c
- * @author The LibrePilot Project,
http://www.librepilot.org Copyright (C) 2016.
+ * @author The LibrePilot Project,
http://www.librepilot.org Copyright (C) 2017.
* The OpenPilot Team,
http://www.openpilot.org Copyright (C) 2012.
* @brief Methods to work with PID structure
*
@@ -221,7 +221,10 @@ float pid2_apply(
pid->D = 0.0f;
// t=0, u=u0, y=y0, v=u
- pid->I = (pid->u0 - pid->va) / pid->vb - pid->kp * (pid->beta * r - y);
+ // pid->I = (pid->u0 - pid->va) / pid->vb - pid->kp * (pid->beta * r - y);
+ // this is dangerous, if pid->I starts nonzero with very low or zero kI, then
+ // it will never settle!
+ pid->I = 0.0f;
}
// compute proportional part