Fertig

Dependencies:   mbed

Fork of RT2_P3_students by TeamSurface

DiffCounter.h

Committer:
altb
Date:
2018-04-09
Revision:
1:a30512c3ac73
Parent:
0:78ca29b4c49e
Child:
3:769ce5f06d3e

File content as of revision 1:a30512c3ac73:


#ifndef DIFFCOUNTER_H_
#define DIFFCOUNTER_H_

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

#endif      // DIFFCOUNTER_H_