Fertig

Dependencies:   mbed

Fork of RT2_P3_students by TeamSurface

Revision:
8:8ed679044a72
Parent:
1:a30512c3ac73
diff -r 72982ede2ff6 -r 8ed679044a72 PI_Cntrl.h
--- a/PI_Cntrl.h	Tue Apr 17 09:06:47 2018 +0000
+++ b/PI_Cntrl.h	Tue Apr 17 11:47:35 2018 +0000
@@ -2,17 +2,35 @@
 #define PI_CNTRL_H_
 
 
-class PI_Cntrl{
-     public:
+class PI_Cntrl
+{
+public:
 
-// ....    
+    PI_Cntrl(float Kp, float Tn, float Ts);
+    PI_Cntrl(float Kp, float Tn, float Ts, float uMax);
+    PI_Cntrl(float Kp, float Tn, float Ts, float uMax, float uMin);
 
+    float operator()(float error) {
+        return doStep((double)error);
+    }
+
+    virtual     ~PI_Cntrl();
 
-    private:
+    void        reset(float initValue);
+    float       doStep(double error);
+
+private:
+
+    double b0;
+    double b1;
+    double b2;
+    double s;
+    double uMax;
+    double uMin;
     
-    // ....
-    
-    };
+    void        setCoefficients(float Kp, float Tn, float Ts);
+
+};
     
     
 #endif      // PI_CNTRL_H_
\ No newline at end of file