A fast, integer based PID controller suitable for Arduino.
The clear() function does not affect the coefficients and, therefore, should not clear the error flag().
Thanks to a generous PR.
This release implements update #4. Thanks to @Elijahg
This release changes the API to achieve better performance. Previous releases were about 60% slower than ArduinoPID (embarrassing!). This release, though it has reduced functionality, is about 30% faster than ArduinoPID. Also, extensive work has gone into verification. This PID controller is correct against my Python based reference for a broad range of parameter combinations.
You should switch to using this release ASAP. Sorry for the breakage!
After testing against the great ArduinoPID I'm confident that the controller functions properly. Many thanks to Brett Beauregard.
This release fixes the derivative term.
Thanks to @br3ttb for setting me straight!