Jorn Dokter / Mbed 2 deprecated TEB_branch2

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Committer:
JornD
Date:
Tue Oct 15 12:19:18 2019 +0000
Branch:
Branch2
Revision:
54:97c796f77ab3
Parent:
53:0aab2185b144
Child:
61:4c7de1e2f9fe
Changed variable name in the Shift function in MemoryIO;

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 54:97c796f77ab3 34 float Ym; //output, delayed once
JornD 54:97c796f77ab3 35 float Ymm; //output, delayed twice
JornD 54:97c796f77ab3 36 float Xm; //input, delayed once
JornD 54:97c796f77ab3 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 54:97c796f77ab3 40 Ymm = Ym; //Y delayed once to Y delayed twice
JornD 54:97c796f77ab3 41 Xmm = Xm; //X delayed once to X delayed twice
JornD 54:97c796f77ab3 42 Ym = CurY; //Current Y to Y delayed once
JornD 54:97c796f77ab3 43 Xm = CurX; //Current X to X delayed once
JornD 53:0aab2185b144 44 };
JornD 40:82addb417220 45 };
JornD 33:5e2e95c322da 46
JornD 28:4a5671b3d88d 47
JornD 28:4a5671b3d88d 48 #endif