Updates error values
Dependents: locomotion_pid_action_refactor_EMG
errorFetch.h@4:2af658a4e54b, 2017-10-26 (annotated)
- Committer:
- tvlogman
- Date:
- Thu Oct 26 14:02:01 2017 +0000
- Revision:
- 4:2af658a4e54b
- Parent:
- 3:71a7dd98fb2c
changed so it has a seperate fetchMotorPosition function
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 | |
tvlogman | 0:cb9eda46a58c | 7 | class errorFetch { |
tvlogman | 0:cb9eda46a58c | 8 | public: |
tvlogman | 2:d22c458a8a78 | 9 | errorFetch(float, float); // Constructor sets up the pin to read the reference from |
tvlogman | 0:cb9eda46a58c | 10 | volatile float e_pos; |
tvlogman | 0:cb9eda46a58c | 11 | volatile float e_int; |
tvlogman | 0:cb9eda46a58c | 12 | volatile float e_der; |
tvlogman | 0:cb9eda46a58c | 13 | volatile float e_prev; |
tvlogman | 0:cb9eda46a58c | 14 | |
tvlogman | 4:2af658a4e54b | 15 | double fetchMotorPosition(int counts); |
tvlogman | 4:2af658a4e54b | 16 | void fetchError(double motorPosition, double 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 |