Просмотр исходного кода

mc_set_foc_mode重命名为mc_set_ctrl_mode

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin 2 лет назад
Родитель
Сommit
bd586473d4

+ 3 - 3
Applications/foc/commands.c

@@ -252,7 +252,7 @@ static void process_foc_command(foc_cmd_body_t *command) {
 		{
 		{
 			u8 mode = decode_u8(command->data);
 			u8 mode = decode_u8(command->data);
 			sys_debug("ctl mode = %d, len = %d\n", mode, command->len);
 			sys_debug("ctl mode = %d, len = %d\n", mode, command->len);
-			if (!mc_set_foc_mode(mode)) {
+			if (!mc_set_ctrl_mode(mode)) {
 				erroCode = mot_contrl_get_errcode(&motor.controller);
 				erroCode = mot_contrl_get_errcode(&motor.controller);
 			}
 			}
 			response[len++] = motor.controller.mode_req;
 			response[len++] = motor.controller.mode_req;
@@ -445,12 +445,12 @@ static void process_foc_command(foc_cmd_body_t *command) {
 			u8 start = decode_u8((u8 *)command->data);
 			u8 start = decode_u8((u8 *)command->data);
 			if (start == 1) {
 			if (start == 1) {
 				sys_debug("start mpta cali\n");
 				sys_debug("start mpta cali\n");
-				if (mc_set_foc_mode(CTRL_MODE_CURRENT)) {
+				if (mc_set_ctrl_mode(CTRL_MODE_CURRENT)) {
 					mot_contrl_mtpa_calibrate(&motor.controller, true);
 					mot_contrl_mtpa_calibrate(&motor.controller, true);
 				}
 				}
 			}else {
 			}else {
 				mot_contrl_mtpa_calibrate(&motor.controller, false);
 				mot_contrl_mtpa_calibrate(&motor.controller, false);
-				mc_set_foc_mode(CTRL_MODE_TRQ);
+				mc_set_ctrl_mode(CTRL_MODE_TRQ);
 			}
 			}
 			break;
 			break;
 		}
 		}

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

@@ -326,7 +326,7 @@ void mot_params_ind_flux(float id, float iq) {
 	flux_wait_cnt = 0;
 	flux_wait_cnt = 0;
 	flux_do_cnt = 0;
 	flux_do_cnt = 0;
 	b_flux_ested = false;
 	b_flux_ested = false;
-	mc_set_foc_mode(CTRL_MODE_CURRENT);
+	mc_set_ctrl_mode(CTRL_MODE_CURRENT);
 	mot_contrl_set_current(&motor.controller ,iq);
 	mot_contrl_set_current(&motor.controller ,iq);
 	shark_timer_post(&_flux_ind_timer, 10);
 	shark_timer_post(&_flux_ind_timer, 10);
 	motVelRadusPers = motor.controller.foc.mot_vel_radusPers;
 	motVelRadusPers = motor.controller.foc.mot_vel_radusPers;

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

@@ -628,7 +628,7 @@ u16 mc_get_ebrk_time(void) {
 	return 0xFFFF;
 	return 0xFFFF;
 }
 }
 
 
-bool mc_set_foc_mode(u8 mode) {
+bool mc_set_ctrl_mode(u8 mode) {
 	if (mode == motor.mode) {
 	if (mode == motor.mode) {
 		return true;
 		return true;
 	}
 	}
@@ -1641,7 +1641,7 @@ void Sched_MC_mTask(void) {
 				}
 				}
 			}else if (motor_encoder_may_error() == ENCODER_AB_ERR) {
 			}else if (motor_encoder_may_error() == ENCODER_AB_ERR) {
 				if (mc_set_critical_error(FOC_CRIT_ENC_AB_Err)) {
 				if (mc_set_critical_error(FOC_CRIT_ENC_AB_Err)) {
-					mc_crit_err_add(FOC_CRIT_ENC_AB_Err, enc_delta_err1, enc_delta_err2);
+					mc_crit_err_add(FOC_CRIT_ENC_AB_Err, enc_delta_err1, enc_delta_err2);
 				}
 				}
 			}
 			}
 		}
 		}

+ 1 - 1
Applications/foc/motor/motor.h

@@ -91,7 +91,7 @@ void mc_set_throttle_r(bool use, u8 r);
 void mc_use_throttle(void);
 void mc_use_throttle(void);
 bool mc_current_sensor_calibrate(float current);
 bool mc_current_sensor_calibrate(float current);
 bool mc_encoder_zero_calibrate(s16 vd);
 bool mc_encoder_zero_calibrate(s16 vd);
-bool mc_set_foc_mode(u8 mode);
+bool mc_set_ctrl_mode(u8 mode);
 bool mc_is_epm(void);
 bool mc_is_epm(void);
 bool mc_start_epm(bool epm);
 bool mc_start_epm(bool epm);
 bool mc_start_epm_move(epm_dir_t dir, bool is_command);
 bool mc_start_epm_move(epm_dir_t dir, bool is_command);