Browse Source

硬件保护停机后,关闭foc,使速度能归0

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 3 years ago
parent
commit
1d91e6bb1e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Applications/foc/motor/motor.c

+ 5 - 0
Applications/foc/motor/motor.c

@@ -509,6 +509,11 @@ void MC_Protect_IRQHandler(void){
 	if (!motor.b_start) {
 		return;
 	}
+	_mc_internal_init(CTRL_MODE_OPEN, false);
+	adc_stop_convert();
+	pwm_stop();
+	PMSM_FOC_Stop();
+	pwm_up_enable(true);
 	PMSM_FOC_SetCriticalError(FOC_CRIT_Phase_Err);
 }