Proportional, integral, derivative controller library. Ported from the Arduino PID library by Brett Beauregard.

Fork of PID by Aaron Berk

Revision:
1:cc91f529df79
Parent:
0:6e12a3e5af19
Child:
2:9ed1cad69d52
--- a/PID.cpp	Thu Sep 02 16:48:10 2010 +0000
+++ b/PID.cpp	Sun Nov 30 18:40:15 2014 +0000
@@ -271,7 +271,8 @@
     prevProcessVariable_  = scaledPV;
 
     //Scale the output from percent span back out to a real world number.
-    return ((controllerOutput_ * outSpan_) + outMin_);
+    //return ((controllerOutput_ * outSpan_) + outMin_);
+    return (controllerOutput_ + 1.0) / 2.0 * outSpan_ + outMin_; 
 
 }