Cuboid
Dependencies: mbed
Diff: DiffCounter.h
- Revision:
- 0:15be70d21d7c
- Child:
- 8:d68e177e2571
diff -r 000000000000 -r 15be70d21d7c DiffCounter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DiffCounter.h Wed Jan 10 16:08:07 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