add motor types, including gimbal

This commit is contained in:
Oskar Weigl
2018-01-22 15:14:00 -08:00
parent 6481e00d0e
commit 35944a5750
2 changed files with 12 additions and 2 deletions
+5 -2
View File
@@ -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.
+7
View File
@@ -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;