feat: add 0xA9 feedforward frame and wire feedforward controller to motor output
- host 0xA9 frame → master_machine decode → robot_cmd publish via gimbal_feedforward topic → gimbal subscribe → yaw_motor.feed_input - add DM_Feedforward_Controller_s with Kp and feed_input fields - add feedforward term (Kp * feed_input) to motor control output - add DM_Feedforward_Kp to motor init config
This commit is contained in:
@@ -54,11 +54,17 @@ typedef struct
|
||||
float total_angle; // multi-turn angle (degrees)
|
||||
} DM_Motor_Measure_s;
|
||||
|
||||
typedef struct{
|
||||
float Kp;
|
||||
float feed_input;
|
||||
} DM_Feedforward_Controller_s;
|
||||
|
||||
/* DM motor instance (runtime state) */
|
||||
typedef struct
|
||||
{
|
||||
DM_Motor_Measure_s measure;
|
||||
Motor_Controller_s motor_controller;
|
||||
DM_Feedforward_Controller_s feedforward_controller;
|
||||
|
||||
CANInstance *motor_can_instance; // CAN communication instance
|
||||
DaemonInstance *motor_daemon; // daemon watchdog
|
||||
@@ -75,6 +81,7 @@ 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;
|
||||
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