Forráskód Böngészése

解决能量回收没有产生负扭矩的问题

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin 2 éve
szülő
commit
26e0938e6e
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      Applications/foc/motor/motor.c

+ 2 - 1
Applications/foc/motor/motor.c

@@ -1552,6 +1552,7 @@ static void mc_motor_runstop(void) {
 		cpu_exit_critical(mask);
 	}
 }
+
 static void mc_process_throttle_torque(float vol) __attribute__((unused));
 static void mc_process_throttle_torque(float vol) {
 	float torque = throttle_get_torque(&motor.controller, vol);
@@ -1562,7 +1563,7 @@ static void mc_process_throttle_torque(float vol) {
 			return;
 		}
 #endif
-		if (mot_contrl_set_ebreak(&motor.controller, true)) {
+		if (!mot_contrl_ebrk_is_running(&motor.controller) && mot_contrl_set_ebreak(&motor.controller, true)) {
 			return;
 		}
 	}