Explorar el Código

mot_contrl_mode 从能量回收进入扭矩模式,先把目标扭矩设置为0,防止倒转

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin hace 2 años
padre
commit
fa18f8a881
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      Applications/foc/core/controller.c

+ 2 - 0
Applications/foc/core/controller.c

@@ -122,6 +122,8 @@ u8 mot_contrl_mode(mot_contrl_t *ctrl) {
 			}else if (preMode == CTRL_MODE_CURRENT) {
 				ctrl->target_torque_raw = line_ramp_get_interp(&ctrl->ramp_target_current);
 				PI_Controller_Reset(&ctrl->pi_vel_lim, ctrl->target_torque_raw);
+			}else if (preMode == CTRL_MODE_EBRAKE) {
+				line_ramp_set_target(&ctrl->ramp_input_torque, 0);
 			}
 		}else if ((preMode == CTRL_MODE_TRQ) && (ctrl->mode_running == CTRL_MODE_SPD)) {
 			PI_Controller_Reset(&ctrl->pi_vel, ctrl->target_torque);