Updates error values
Dependents: locomotion_pid_action_refactor_EMG
errorFetch.h@2:d22c458a8a78, 2017-10-22 (annotated)
- Committer:
- tvlogman
- Date:
- Sun Oct 22 07:56:59 2017 +0000
- Revision:
- 2:d22c458a8a78
- Parent:
- 1:9e2c9237d88b
- Child:
- 3:71a7dd98fb2c
Changed errorFetch: now it takes a reference value as an argument instead of a refGen object. This to seperate concerns.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tvlogman | 0:cb9eda46a58c | 1 | #ifndef ERRORFETCH_H |
tvlogman | 0:cb9eda46a58c | 2 | #define ERRORFETCH_H |
tvlogman | 0:cb9eda46a58c | 3 | |
tvlogman | 0:cb9eda46a58c | 4 | #include "mbed.h" |
tvlogman | 0:cb9eda46a58c | 5 | #include "QEI.h" |
tvlogman | 0:cb9eda46a58c | 6 | #include "refGen.h" |
tvlogman | 0:cb9eda46a58c | 7 | |
tvlogman | 0:cb9eda46a58c | 8 | class errorFetch { |
tvlogman | 0:cb9eda46a58c | 9 | public: |
tvlogman | 2:d22c458a8a78 | 10 | errorFetch(float, float); // Constructor sets up the pin to read the reference from |
tvlogman | 0:cb9eda46a58c | 11 | volatile float e_pos; |
tvlogman | 0:cb9eda46a58c | 12 | volatile float e_int; |
tvlogman | 0:cb9eda46a58c | 13 | volatile float e_der; |
tvlogman | 0:cb9eda46a58c | 14 | volatile float e_prev; |
tvlogman | 0:cb9eda46a58c | 15 | |
tvlogman | 2:d22c458a8a78 | 16 | void fetchError(int counts, float ref); // Gets reference position on specified pin |
tvlogman | 0:cb9eda46a58c | 17 | |
tvlogman | 0:cb9eda46a58c | 18 | private: |
tvlogman | 0:cb9eda46a58c | 19 | const float gearRatio; |
tvlogman | 0:cb9eda46a58c | 20 | const float Ts; |
tvlogman | 0:cb9eda46a58c | 21 | }; |
tvlogman | 0:cb9eda46a58c | 22 | #endif |