Buggy bois / Mbed 2 deprecated HEATS_2

Dependencies:   mbed

Revision:
8:5ed6685f6edd
Parent:
6:477382219bcf
--- a/PID.h	Thu Mar 28 01:07:54 2019 +0000
+++ b/PID.h	Sun Mar 31 20:31:30 2019 +0000
@@ -28,14 +28,12 @@
     
     float compute (float currVal)
     {
-    float currErr = setPoint - (currVal);
+    float currErr = setPoint - currVal;
     float controlAction;
     
-    if (currVal > *inMax_) {*inMax_ = currVal;}
-    if (currVal < *inMin_) {*inMin_ = currVal;}
-    
-    
-    
+    //if (currVal > *inMax_) {*inMax_ = currVal; *inMin_ = -1.0f*currVal;}
+    //if (currVal < *inMin_) {*inMin_ = currVal; *inMax_ = -1.0f*currVal;}
+
     controlAction = prevControlAction - (PrevErr*Kp_) + (Kp_*currErr)+ (Ki_*Ts*currErr) + ((Kd_/Ts)*(currErr - PrevErr - PrevErr + PrevPrevErr));
    
     prevControlAction = controlAction;