Numero Uno / PID

Dependents:   PID_VelocityExample TheProgram

Fork of PID by Aaron Berk

Revision:
2:690958d56f3e
Parent:
0:6e12a3e5af19
--- a/PID.h	Fri Sep 25 13:10:29 2015 +0000
+++ b/PID.h	Tue Oct 06 10:16:40 2015 +0000
@@ -146,12 +146,16 @@
      * @param bias The bias for the controller output.
      */
     void setBias(float bias);
-
+    
+    // set the deadzone
+    void setDeadzone(float top, float bottom);
+    
     /**
      * PID calculation.
      *
      * @return The controller output as a float between outMin and outMax.
      */
+        
     float compute(void);
 
     //Getters.
@@ -186,6 +190,7 @@
     float prevProcessVariable_;
     //The output that affects the process variable.
     float controllerOutput_; 
+    float controllerOutputSum_;
     float prevControllerOutput_;
 
     //We work in % for calculations so these will scale from
@@ -201,7 +206,10 @@
     float accError_;
     //The controller output bias.
     float bias_;
-
+    //The controller deadzone.
+    float deadzoneTop_;
+    float deadzoneBottom_;
+        
     //The interval between samples.
     float tSample_;