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

Revision:
1:227ce995f635
Parent:
0:6e12a3e5af19
--- 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.