diff --git a/Firmware/MotorControl/low_level.c b/Firmware/MotorControl/low_level.c index d109aea0..9f20227c 100644 --- a/Firmware/MotorControl/low_level.c +++ b/Firmware/MotorControl/low_level.c @@ -91,6 +91,8 @@ Motor_t motors[] = { .enableTimeOut = false, }, // .gate_driver_regs Init by DRV8301_setup + .motor_type = MOTOR_TYPE_HIGH_CURRENT, + // .motor_type = MOTOR_TYPE_GIMBAL, .shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S] .phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup .current_control = { @@ -187,8 +189,9 @@ Motor_t motors[] = { .enableTimeOut = false, }, // .gate_driver_regs Init by DRV8301_setup - .shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S] - .phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup + .motor_type = MOTOR_TYPE_HIGH_CURRENT, + .shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S] + .phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup .current_control = { // Read out max_allowed_current to see max supported value for current_lim. // You can change DRV8301_ShuntAmpGain to get a different range. diff --git a/Firmware/MotorControl/low_level.h b/Firmware/MotorControl/low_level.h index 6589e91e..697d0a84 100644 --- a/Firmware/MotorControl/low_level.h +++ b/Firmware/MotorControl/low_level.h @@ -60,6 +60,12 @@ typedef enum { CTRL_MODE_POSITION_CONTROL } Motor_control_mode_t; +typedef enum { + MOTOR_TYPE_HIGH_CURRENT, + // MOTOR_TYPE_LOW_CURRENT, //Not yet implemented + MOTOR_TYPE_GIMBAL +} Motor_type_t; + typedef struct { float phB; float phC; @@ -149,6 +155,7 @@ typedef struct { Iph_BC_t DC_calib; DRV8301_Obj gate_driver; DRV_SPI_8301_Vars_t gate_driver_regs; //Local view of DRV registers + Motor_type_t motor_type; float shunt_conductance; float phase_current_rev_gain; //Reverse gain for ADC to Amps Current_control_t current_control;