mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
LP-289 prevent initialization with non-zero pid->I accumulator (dangerous if kI is low)
This commit is contained in:
parent
ebc4b16d9a
commit
fb5f9034ea
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user