diff --git a/Core/Bsp/bsp_motor.c b/Core/Bsp/bsp_motor.c index 4ef1e09..a73d7fe 100644 --- a/Core/Bsp/bsp_motor.c +++ b/Core/Bsp/bsp_motor.c @@ -71,6 +71,11 @@ void motor_set_speed(motor_id_t motor_id, int16_t speed) default: return; } + /* 纠正左右电机物理方向差异 */ + if (motor_id == MOTOR_3 || motor_id == MOTOR_4) { + speed = -speed; + } + /* 限制速度范围 (ARR=3599) */ if (speed > 3599) speed = 3599; if (speed < -3599) speed = -3599;