feat: add direction flag to feedforward controller with init config struct
- add DM_Feedforward_Init_Config_s with Kp and dir fields - replace plain DM_Feedforward_Kp in DM_Motor_Init_Config_s - apply direction flag in DMMotorControl to negate feedforward when reverse - set yaw feedforward: Kp=0.9, dir=REVERSE
This commit is contained in:
@@ -56,6 +56,7 @@ typedef struct
|
||||
|
||||
typedef struct{
|
||||
float Kp;
|
||||
Output_Reverse_Flag_e dir;
|
||||
float feed_input;
|
||||
} DM_Feedforward_Controller_s;
|
||||
|
||||
@@ -76,12 +77,19 @@ typedef struct
|
||||
|
||||
} DMMotorInstance;
|
||||
|
||||
/* Feedforward controller init config */
|
||||
typedef struct
|
||||
{
|
||||
float Kp;
|
||||
Output_Reverse_Flag_e dir;
|
||||
} DM_Feedforward_Init_Config_s;
|
||||
|
||||
/* DM motor init config */
|
||||
typedef struct
|
||||
{
|
||||
Motor_Init_Config_s motor_config; // generic motor PID and setting config
|
||||
DM_Motor_Ctrl_Mode_e ctrl_mode; // default control mode
|
||||
float DM_Feedforward_Kp;
|
||||
DM_Feedforward_Init_Config_s feedforward_config;
|
||||
float mit_kp; // MIT mode KP (only for MIT mode)
|
||||
float mit_kd; // MIT mode KD (only for MIT mode)
|
||||
} DM_Motor_Init_Config_s;
|
||||
|
||||
Reference in New Issue
Block a user