Fertig

Dependencies:   mbed

Fork of RT2_P3_students by TeamSurface

Revision:
0:78ca29b4c49e
Child:
1:a30512c3ac73
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DiffCounter.h	Tue Apr 03 08:47:41 2018 +0000
@@ -0,0 +1,28 @@
+/*  DiffCounter Class, differentiate encoder counts for cuboid based on LP filter
+    and unwrapping
+    
+        1/tau*(z-1)        
+G(z) = ------------
+         z - a0
+*/
+
+class DiffCounter{
+     public:
+                    DiffCounter(float a,float b);
+        float operator()(short inc){
+         return doStep(inc);
+         }
+        virtual     ~DiffCounter();
+        void        reset(float,short);
+        float       doStep(short inc);
+        float       Ts;
+    
+    private:
+    
+        float alpha;
+        float a0;
+        short inc_old;
+        float v_old;
+        long del;
+        float inc2rad;
+};
\ No newline at end of file