mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-21 23:44:48 +08:00
add motor types, including gimbal
This commit is contained in:
@@ -91,6 +91,8 @@ Motor_t motors[] = {
|
|||||||
.enableTimeOut = false,
|
.enableTimeOut = false,
|
||||||
},
|
},
|
||||||
// .gate_driver_regs Init by DRV8301_setup
|
// .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]
|
.shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S]
|
||||||
.phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup
|
.phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup
|
||||||
.current_control = {
|
.current_control = {
|
||||||
@@ -187,8 +189,9 @@ Motor_t motors[] = {
|
|||||||
.enableTimeOut = false,
|
.enableTimeOut = false,
|
||||||
},
|
},
|
||||||
// .gate_driver_regs Init by DRV8301_setup
|
// .gate_driver_regs Init by DRV8301_setup
|
||||||
.shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S]
|
.motor_type = MOTOR_TYPE_HIGH_CURRENT,
|
||||||
.phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup
|
.shunt_conductance = 1.0f / SHUNT_RESISTANCE, //[S]
|
||||||
|
.phase_current_rev_gain = 0.0f, // to be set by DRV8301_setup
|
||||||
.current_control = {
|
.current_control = {
|
||||||
// Read out max_allowed_current to see max supported value for current_lim.
|
// Read out max_allowed_current to see max supported value for current_lim.
|
||||||
// You can change DRV8301_ShuntAmpGain to get a different range.
|
// You can change DRV8301_ShuntAmpGain to get a different range.
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ typedef enum {
|
|||||||
CTRL_MODE_POSITION_CONTROL
|
CTRL_MODE_POSITION_CONTROL
|
||||||
} Motor_control_mode_t;
|
} 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 {
|
typedef struct {
|
||||||
float phB;
|
float phB;
|
||||||
float phC;
|
float phC;
|
||||||
@@ -149,6 +155,7 @@ typedef struct {
|
|||||||
Iph_BC_t DC_calib;
|
Iph_BC_t DC_calib;
|
||||||
DRV8301_Obj gate_driver;
|
DRV8301_Obj gate_driver;
|
||||||
DRV_SPI_8301_Vars_t gate_driver_regs; //Local view of DRV registers
|
DRV_SPI_8301_Vars_t gate_driver_regs; //Local view of DRV registers
|
||||||
|
Motor_type_t motor_type;
|
||||||
float shunt_conductance;
|
float shunt_conductance;
|
||||||
float phase_current_rev_gain; //Reverse gain for ADC to Amps
|
float phase_current_rev_gain; //Reverse gain for ADC to Amps
|
||||||
Current_control_t current_control;
|
Current_control_t current_control;
|
||||||
|
|||||||
Reference in New Issue
Block a user