Quote:
|
Originally Posted by 10intheCrunch
...
Three, what circumstances are you dealing with integer overflow? We've never had anything close to that high an integral, much less wanted it (it would cause the motor to swing all the way over and jam the arm into the robot...). Perhaps we have radically different output systems, but our integral never really gets higher than 30-50 (and that can be dangerous).
|
Typically, if you are running near the edge of your control abilities (pushing your hardware to the limits, which I am *always* doing), when the output saturates (e.g. ->254 in IFI systems) and you have not made your setpoint (velocity or position) the error term grows without bounds. The solution is simple: stop accumulating errors if the output saturates.
In the code I posted (above), we have a torque limit and stop accumulating the integral error when that has been hit.
Cheers!