Proportional, integral, derivative controller library. Ported from the Arduino PID library by Brett Beauregard.
Revision 1:227ce995f635, committed 2017-03-14
- Comitter:
- ItamarGrin
- Date:
- Tue Mar 14 09:58:11 2017 +0000
- Parent:
- 0:6e12a3e5af19
- Commit message:
- V2.0 Working PID
Changed in this revision
PID.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 6e12a3e5af19 -r 227ce995f635 PID.cpp --- a/PID.cpp Thu Sep 02 16:48:10 2010 +0000 +++ b/PID.cpp Tue Mar 14 09:58:11 2017 +0000 @@ -238,7 +238,7 @@ scaledSP = 0; } - float error = scaledSP - scaledPV; + float error = abs(scaledSP - scaledPV); //Check and see if the output is pegged at a limit and only //integrate if it is not. This is to prevent reset-windup.