Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

Committer:
tvlogman
Date:
Fri Oct 20 12:24:03 2017 +0000
Revision:
0:cb9eda46a58c
Child:
1:9e2c9237d88b
Should work now but not tested

Who changed what in which revision?

UserRevisionLine numberNew 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 0:cb9eda46a58c 10 errorFetch(QEI, float, float, refGen); // 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 0:cb9eda46a58c 16 void getError(); // Gets reference position on specified pin
tvlogman 0:cb9eda46a58c 17 refGen ref;
tvlogman 0:cb9eda46a58c 18
tvlogman 0:cb9eda46a58c 19 private:
tvlogman 0:cb9eda46a58c 20 QEI motorEncoder;
tvlogman 0:cb9eda46a58c 21 const float gearRatio;
tvlogman 0:cb9eda46a58c 22 const float Ts;
tvlogman 0:cb9eda46a58c 23 };
tvlogman 0:cb9eda46a58c 24 #endif