Quote:
|
Originally Posted by maxlobovsky
Wouldn't it be vice-versa? I thought that the integral is neccesary for reaching the right value.
how is this the integral? This looks proportional to me, just the current error.
|
Note the "+=" that says add the right hand side to the left hand side. Which is an integral
e.g.
Foo += Something
is equivalent to
Foo = Foo + Something;
Therefore Foo is accumulating the integral of Something.
You are correct that the integral is needed to drive the error term to zero, but for position stuff that is rarely needed (particularly in low performance systems like what we are working on). WHat is really needed is to drive the servo *close* enough to the correct position that you don't care about the residual error. Integral terms are hard to get right and lead to a lot of instability and are really useless in a dynamic environment as they are fighting your ability to change the setpoint. They only make sense if your servo is relatively static or has a constant force in one direction that needs to be compensated for with the integral term. But if the error amount is dynamic and changing sign, the integral term just gets in the way.