Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
DiffCounter.h@0:15be70d21d7c, 2018-01-10 (annotated)
- Committer:
- rtlabor
- Date:
- Wed Jan 10 16:08:07 2018 +0000
- Revision:
- 0:15be70d21d7c
balance cuboid
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rtlabor | 0:15be70d21d7c | 1 | /* DiffCounter Class, differentiate encoder counts for cuboid based on LP filter |
| rtlabor | 0:15be70d21d7c | 2 | and unwrapping |
| rtlabor | 0:15be70d21d7c | 3 | |
| rtlabor | 0:15be70d21d7c | 4 | 1/tau*(z-1) |
| rtlabor | 0:15be70d21d7c | 5 | G(z) = ------------ |
| rtlabor | 0:15be70d21d7c | 6 | z - a0 |
| rtlabor | 0:15be70d21d7c | 7 | */ |
| rtlabor | 0:15be70d21d7c | 8 | |
| rtlabor | 0:15be70d21d7c | 9 | class DiffCounter{ |
| rtlabor | 0:15be70d21d7c | 10 | public: |
| rtlabor | 0:15be70d21d7c | 11 | DiffCounter(float a,float b); |
| rtlabor | 0:15be70d21d7c | 12 | float operator()(short inc){ |
| rtlabor | 0:15be70d21d7c | 13 | return doStep(inc); |
| rtlabor | 0:15be70d21d7c | 14 | } |
| rtlabor | 0:15be70d21d7c | 15 | virtual ~DiffCounter(); |
| rtlabor | 0:15be70d21d7c | 16 | void reset(float,short); |
| rtlabor | 0:15be70d21d7c | 17 | float doStep(short inc); |
| rtlabor | 0:15be70d21d7c | 18 | float Ts; |
| rtlabor | 0:15be70d21d7c | 19 | |
| rtlabor | 0:15be70d21d7c | 20 | private: |
| rtlabor | 0:15be70d21d7c | 21 | |
| rtlabor | 0:15be70d21d7c | 22 | float alpha; |
| rtlabor | 0:15be70d21d7c | 23 | float a0; |
| rtlabor | 0:15be70d21d7c | 24 | short inc_old; |
| rtlabor | 0:15be70d21d7c | 25 | float v_old; |
| rtlabor | 0:15be70d21d7c | 26 | long del; |
| rtlabor | 0:15be70d21d7c | 27 | float inc2rad; |
| rtlabor | 0:15be70d21d7c | 28 | }; |