Bayley Wang
/
foc-ed_in_the_bot_compact
robot
BREMS/BREMSStructs.h
- Committer:
- bwang
- Date:
- 2017-03-12
- Revision:
- 84:dd32640942a4
- Parent:
- 83:eb3704d4943f
File content as of revision 84:dd32640942a4:
#ifndef __BREMS_STRUCTS_H #define __BREMS_STRUCTS_H #include "mbed.h" #include "FastPWM.h" #include "PwmIn.h" #include "PositionSensor.h" #include "PreferenceWriter.h" typedef struct { FastPWM *a, *b, *c; DigitalOut *en; PwmIn *throttle_in; PositionSensorEncoder *pos; Serial *pc; PreferenceWriter *pref; } IOStruct; typedef struct { float adval1, adval2, adval3; float vbus; float p_mech, last_p_mech, w; float ia_supp_offset, ib_supp_offset; bool err_throttle_disabled, err_pos_invalid; bool err_not_driving; } 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; float user_cmd; float torque_percent; bool enabled; } ControlStruct; #endif