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:
2026-06-07 16:22:16 +08:00
parent 89aa777d5c
commit ed6d509c72
3 changed files with 18 additions and 5 deletions
+4 -1
View File
@@ -52,7 +52,10 @@ void GimbalInit()
.motor_type = DM_MOTOR,
},
.ctrl_mode = DM_MODE_VELOCITY,
.DM_Feedforward_Kp = 0.9f,
.feedforward_config = {
.Kp = 0.9f,
.dir = OUTPUT_DIRECTION_REVERSE,
},
.mit_kp = 0, .mit_kd = 0,
};
yaw_motor = DMMotorInit(&yaw_config);