Test of pmic GPA with filter

Dependencies:   mbed

Fork of nucf446-cuboid-balance1_strong by RT2_Cuboid_demo

Revision:
15:1e8e90b4e3a1
Parent:
13:186867e79092
diff -r fa8706c9c984 -r 1e8e90b4e3a1 PI_Cntrl.h
--- a/PI_Cntrl.h	Wed Apr 04 12:16:58 2018 +0000
+++ b/PI_Cntrl.h	Wed Apr 04 13:26:23 2018 +0000
@@ -7,21 +7,23 @@
     PI_Cntrl(float Kp, float Tn, float Ts, float uMax, float uMin);
 
     float operator()(float error) {
-        return doStep(error);
+        return doStep((double)error);
     }
 
     virtual     ~PI_Cntrl();
 
     void        reset(float initValue);
-    float       doStep(float error);
+    float       doStep(double error);
 
 private:
 
-    float b0;
-    float b1;
-    float b2;
-    float s;
-    float uMax;
-    float uMin;
+    double b0;
+    double b1;
+    double b2;
+    double s;
+    double uMax;
+    double uMin;
+    
+    void        setCoefficients(float Kp, float Tn, float Ts);
 
 };
\ No newline at end of file