Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: BREMS/BREMSStructs.h
- Revision:
- 42:030e0ec4eac5
- Child:
- 70:5e39beeb4a21
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BREMS/BREMSStructs.h Fri Jan 06 07:54:22 2017 +0000 @@ -0,0 +1,36 @@ +#ifndef __BREMS_STRUCTS_H +#define __BREMS_STRUCTS_H + +#include "mbed.h" + +#include "FastPWM.h" +#include "PwmIn.h" +#include "PositionSensor.h" + +typedef struct { + FastPWM *a, *b, *c; + DigitalOut *en; + PwmIn *throttle_in; + PositionSensorEncoder *pos; + Serial *pc; +} IOStruct; + +typedef struct { + float adval1, adval2, adval3; + float vbus; + float p_mech, last_p_mech, w; + float ia_supp_offset, ib_supp_offset; +} ReadDataStruct; + +typedef struct { + float ia, ib, alpha, beta, d, q, vd, vq, valpha, vbeta, p; +} FOCStruct; + +typedef struct { + float d_integral, q_integral; + float last_d, last_q; + float d_ref, q_ref; + float d_filtered, q_filtered; +} ControlStruct; + +#endif \ No newline at end of file