sfbsg

Dependencies:   mbed

DiffCounter.h

Committer:
borlanic
Date:
2018-04-03
Revision:
0:8ab621116ccd

File content as of revision 0:8ab621116ccd:

/*  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;
};