Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PID by
Diff: PID.cpp
- Revision:
- 4:e3cc82bee208
- Parent:
- 3:8172f254dff4
- Child:
- 5:43a44c2880a3
--- a/PID.cpp Wed Jul 03 02:40:06 2013 +0000 +++ b/PID.cpp Mon Jul 29 19:58:42 2013 +0000 @@ -34,7 +34,7 @@ currentError += targetPosition - currentPosition; // Sum of the errors the controller has incurred over time - integralError = currentError * dt; + integralError = currentError; // Cap the sum of errors to prevent excessive correction if (integralError < -windupGainGuard) { integralError = -windupGainGuard;