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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user