Proportional, integral, derivative controller library. Ported from the Arduino PID library by Brett Beauregard.
Fork of PID by
Revision 2:9ed1cad69d52, committed 2014-12-01
- Comitter:
- iou16
- Date:
- Mon Dec 01 08:17:44 2014 +0000
- Parent:
- 1:cc91f529df79
- Commit message:
- test
Changed in this revision
PID.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PID.cpp Sun Nov 30 18:40:15 2014 +0000 +++ b/PID.cpp Mon Dec 01 08:17:44 2014 +0000 @@ -259,8 +259,8 @@ controllerOutput_ = scaledBias + Kc_ * (error + (tauR_ * accError_) - (tauD_ * dMeas)); //Make sure the computed output is within output constraints. - if (controllerOutput_ < 0.0) { - controllerOutput_ = 0.0; + if (controllerOutput_ < -1.0) { + controllerOutput_ = -1.0; } else if (controllerOutput_ > 1.0) { controllerOutput_ = 1.0; }