Currently, when setting a finite integral coefficient, the iOut term will reach some value. If the coefficient is then set to zero, the iOut term keeps its last value.
I don't think this is a bug as such, but is unexpected behaviour. For example, if at some point we call setCoefficients(0.0, 0.0, 0.0) we would expect the output to become zero. Instead, the output changes to some non-zero value equal to the current value of iOut. Calling reset() will set iOut to zero and "fix" the problem, but also resets everything else, so isn't a great solution.
so that setting the integral coefficient to zero instantly removes its effect from the output. Note that the integral windup limits are still respected in case the integral windup minimum is set > 0 for some reason.
Currently, when setting a finite integral coefficient, the
iOut
term will reach some value. If the coefficient is then set to zero, theiOut
term keeps its last value.I don't think this is a bug as such, but is unexpected behaviour. For example, if at some point we call
setCoefficients(0.0, 0.0, 0.0)
we would expect the output to become zero. Instead, the output changes to some non-zero value equal to the current value ofiOut
. Callingreset()
will setiOut
to zero and "fix" the problem, but also resets everything else, so isn't a great solution.This change modifies the line:
to
so that setting the integral coefficient to zero instantly removes its effect from the output. Note that the integral windup limits are still respected in case the integral windup minimum is set > 0 for some reason.