Explorar el Código

标定电机命令后,使用标定数据替代DQ电流

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin hace 2 años
padre
commit
9dc19ea414
Se han modificado 3 ficheros con 8 adiciones y 7 borrados
  1. 7 4
      Applications/app/app.c
  2. 0 3
      Applications/prot/can_foc_msg.c
  3. 1 0
      Applications/prot/can_foc_msg.h

+ 7 - 4
Applications/app/app.c

@@ -82,11 +82,14 @@ static u32 app_report_task(void *p) {
 		return 200;
 	}
 	can_report_power(0x45);
-	can_report_dq_current(0x45);
 	can_report_foc_status(0x45);
-	can_report_phase_voltage(0x45);
-	can_report_mpta_values(0x45);
-	can_report_phase_current(0x45);
+	can_report_dq_voltage(0X45);
+	if (motor.controller.b_mtpa_calibrate) {
+		can_report_mpta_values(0x45);
+	}else {
+		can_report_dq_current(0x45);
+	}
+
 	if (mot_params_rs_ested()) {
 		can_report_mot_params_ested(mot_params_get_est_rs(), R_TYPE);
 	}

+ 0 - 3
Applications/prot/can_foc_msg.c

@@ -122,9 +122,6 @@ void can_mcast_foc_status2(void) {
 
 void can_report_mpta_values(u8 can) {
 	u8 data[8];
-	if (!motor.controller.b_mtpa_calibrate) {
-		return;
-	}
 	encoder_can_key(data, CMD_2_CAN_KEY(Foc_Report_MTPA_DQ_Angle));
 	encode_s16(data + 2, S16Q5(mot_contrl_get_current_vector(&motor.controller)));
 	encode_s16(data + 4, S16Q5(motor.controller.out_idq_filterd.d));

+ 1 - 0
Applications/prot/can_foc_msg.h

@@ -19,6 +19,7 @@ void can_plot1(s16 v1);
 void can_plot2(s16 v1, s16 v2);
 void can_plot3(s16 v1, s16 v2, s16 v3);
 void can_report_mot_params_ested(float v, u8 type);
+void can_report_dq_voltage(u8 can);
 
 #endif	/*_Can_Foc_Msg_H__ */