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

Files at this revision

API Documentation at this revision

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
--- 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.