Test of pmic GPA with filter

Dependencies:   mbed

Fork of nucf446-cuboid-balance1_strong by RT2_Cuboid_demo

Revision:
8:d68e177e2571
Parent:
1:2e118d67eeae
Child:
12:93fd84766578
--- a/PI_Cntrl.h	Sat Mar 17 08:43:07 2018 +0000
+++ b/PI_Cntrl.h	Thu Mar 22 17:32:37 2018 +0000
@@ -1,22 +1,28 @@
-class PI_Cntrl{
-     public:
-                    PI_Cntrl(float a,float b);
-                    PI_Cntrl(float a,float b,float c);
-                    PI_Cntrl(float a,float b,float c,float d);
-         float operator()(float e){
-         return doStep(e);
-         }                    
-        virtual     ~PI_Cntrl();
-        void        reset(float);
-        float       doStep(float);
-    
-    private:
-    
-        float Tn;
-        float Kp;
-        float Ts;
-        float out_max;
-        float out_min;
-        float i_part_old;
-        float del;
+class PI_Cntrl
+{
+public:
+
+    PI_Cntrl(float Kp, float Tn);
+    PI_Cntrl(float Kp, float Tn, float uMax);
+    PI_Cntrl(float Kp, float Tn, float uMax, float uMin);
+
+    float operator()(float error) {
+        return doStep(error);
+    }
+
+    virtual     ~PI_Cntrl();
+
+    void        reset(float initValue);
+    float       doStep(float error);
+
+private:
+
+    float Tn;
+    float Kp;
+    float Ts;
+    float uMax;
+    float uMin;
+    float integralPart;
+    float deltaSaturation;
+
 };
\ No newline at end of file