Преглед на файлове

支持A1电机外特性

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin преди 2 години
родител
ревизия
698730378d
променени са 2 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 2 0
      Applications/foc/motor/A1_motor_config.c
  2. 2 2
      Applications/foc/motor/motor_param.c

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

@@ -1,3 +1,5 @@
+#define MOTOR_STATOR_5N
+
 #ifndef MOTOR_STATOR_5N
 static torque_map_t mtpa_fw_map[11][10] = {
  { // 转速:0-2000

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

@@ -7,6 +7,7 @@
 #include "libs/logger.h"
 
 #if defined(CONFIG_MOTOR_TORQUE_CONF)
+#include CONFIG_MOTOR_TORQUE_CONF
 #define MOT_HAVE_MAPS
 #define MOT_USE_PHASE_I //表示使用电流矢量和RPM查表,获取D轴电流,iq = 开根号(电流矢量的平方 - D轴电流的平方)
 #ifndef MOTOR_STATOR_5N
@@ -19,7 +20,6 @@ static int map_rpm[] = {2000, 3000, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 75
 #define TRQ_MAX_IDX 10
 static int map_rpm[] = {4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000};
 #endif
-#include CONFIG_MOTOR_TORQUE_CONF
 #endif
 
 /* 根据电机外特性map,获取当前转速下的最大扭矩,主要给计算当前扭矩需求使用 */
@@ -161,7 +161,7 @@ static void get_torque_range(s16 z, int index, int max_index, int *left, int *ri
 	*right = low_right;
 }
 
-void motor_mpta_fw_lookup(float rpm, float torque, DQ_t *dq_out) {
+void motor_mpta_fw_lookup(float rpm, float torque, dq_t *dq_out) {
 	bool neg_trq = false;
 	s16 itorque = torque * 10;
 	if (itorque < 0) {