Mirror actuator for RT2 lab

Dependencies:   FastPWM

Revision:
15:9f32f64eee5b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Library_Cntrl/PID_Cntrl.h	Sun May 02 08:17:06 2021 +0000
@@ -0,0 +1,34 @@
+#ifndef PID_CNTRL_H_
+#define PID_CNTRL_H_
+
+class PID_Cntrl
+{
+public:
+
+    PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax);
+
+    float operator()(float error) {
+        return doStep((double)error);
+    }
+
+    virtual     ~PID_Cntrl();
+
+    void        reset(float initValue);
+    float       doStep(double error);
+    void        set_limits(double ,double );
+    float       get_ulimit(void);
+    
+private:
+
+    double Iold;
+    double eold,yold,del;
+    double uMax;
+    double uMin;
+    double Ts;
+    double P,I,D;
+    double p, Ka;
+    void setCoefficients(float P, float I, float D, float tau_f, float Ts);
+
+};
+
+#endif
\ No newline at end of file