Jorn Dokter / Mbed 2 deprecated TEB_branch2

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Committer:
JornD
Date:
Wed Oct 16 09:24:22 2019 +0000
Branch:
Branch2
Revision:
61:4c7de1e2f9fe
Parent:
58:897b67113094
Child:
63:734986afcddb
Child:
64:5a6bf0cd1c50
WORKING - started implementation of the EMG processing;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JornD 28:4a5671b3d88d 1 #ifndef global_h
JornD 28:4a5671b3d88d 2 #define global_h
JornD 28:4a5671b3d88d 3
JornD 40:82addb417220 4 //Structures
JornD 40:82addb417220 5 //--Motor data
JornD 40:82addb417220 6 struct motorReturnSub
JornD 40:82addb417220 7 {
JornD 49:a9ed4f4cdef7 8 int zerocounts;
JornD 40:82addb417220 9 int counts;
JornD 40:82addb417220 10 float angle;
JornD 40:82addb417220 11 float velocity;
JornD 40:82addb417220 12 };
JornD 40:82addb417220 13
JornD 40:82addb417220 14 struct motorData
JornD 40:82addb417220 15 {
JornD 40:82addb417220 16 motorReturnSub motor1;
JornD 40:82addb417220 17 motorReturnSub motor2;
JornD 40:82addb417220 18 motorReturnSub motor3;
JornD 40:82addb417220 19 };
JornD 49:a9ed4f4cdef7 20
JornD 40:82addb417220 21 //--PID controller settings
JornD 40:82addb417220 22 struct ControllerSettings //Controller settings of the discrete TF
JornD 40:82addb417220 23 {
JornD 40:82addb417220 24 float A;
JornD 40:82addb417220 25 float B;
JornD 40:82addb417220 26 float C;
JornD 40:82addb417220 27 float D;
JornD 40:82addb417220 28 float E;
JornD 40:82addb417220 29 };
JornD 49:a9ed4f4cdef7 30
JornD 40:82addb417220 31 //--Memory of Input/Output
JornD 40:82addb417220 32 struct MemoryIO
JornD 40:82addb417220 33 {
JornD 58:897b67113094 34 float Ym; //output, delayed once
JornD 58:897b67113094 35 float Ymm; //output, delayed twice
JornD 58:897b67113094 36 float Xm; //input, delayed once
JornD 58:897b67113094 37 float Xmm; //input, delayed twice
JornD 50:283a831f84a9 38 void ShiftValues(float CurX, float CurY) //Input: Current X, current Y
JornD 50:283a831f84a9 39 {
JornD 58:897b67113094 40 Ymm = Ym; //Y delayed once to Y delayed twice
JornD 58:897b67113094 41 Xmm = Xm; //X delayed once to X delayed twice
JornD 58:897b67113094 42 Ym = CurY; //Current Y to Y delayed once
JornD 58:897b67113094 43 Xm = CurX; //Current X to X delayed once
JornD 53:0aab2185b144 44 };
JornD 40:82addb417220 45 };
JornD 61:4c7de1e2f9fe 46
JornD 28:4a5671b3d88d 47 #endif