Isolated proportional gain term from control output to decouple tuning parameters.

Fork of PID by Aaron Berk

Files at this revision

API Documentation at this revision

Comitter:
wretrop
Date:
Wed Apr 20 21:27:43 2016 +0000
Parent:
0:6e12a3e5af19
Commit message:
Isolated P term from other gain values.

Changed in this revision

PID.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6e12a3e5af19 -r f61c47297c2c PID.cpp
--- a/PID.cpp	Thu Sep 02 16:48:10 2010 +0000
+++ b/PID.cpp	Wed Apr 20 21:27:43 2016 +0000
@@ -256,7 +256,8 @@
     }
 
     //Perform the PID calculation.
-    controllerOutput_ = scaledBias + Kc_ * (error + (tauR_ * accError_) - (tauD_ * dMeas));
+    //controllerOutput_ = scaledBias + Kc_ * (error + (tauR_ * accError_) - (tauD_ * dMeas));
+    controllerOutput_ = scaledBias + Kc_ * error + (tauR_ * accError_) - (tauD_ * dMeas);
 
     //Make sure the computed output is within output constraints.
     if (controllerOutput_ < 0.0) {