Преглед изворни кода

电机参数不再使用宏定义的方式,改为通过配置写入或者通过配置自动生成的autogen_config.h中定义

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui пре 2 година
родитељ
комит
af8bd2cbc2

+ 5 - 0
Applications/foc/foc_config.h

@@ -46,6 +46,11 @@
 /* 限速/速度环等情况下的最大负扭矩,一般给0,不产生拖拽感 */
 #define CONFIG_MAX_NEG_TORQUE 0.0F
 
+#define CONFIG_CURRENT_LOOP_DECOUPE    //电流环解耦
+#define CONFIG_SENSORLESS_MAX_IDC 30
+#define CONFIG_SENSORLESS_MAX_TORQUE 100
+#define CONFIG_SENSORLESS_MAX_SPEED 4000
+
 #define CONFIG_ENABLE_IAB_REC 1   // for phase current debug
 
 #ifdef CONFIG_SPEED_LADRC

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

@@ -58,7 +58,7 @@ float motor_get_lq_from_iq(s16 iq) {
 	}
 	return iq_lq_map[0].lq;
 #else
-	return MOTOR_Lq;
+	return mc_conf()->m.lq;
 #endif
 }
 

+ 2 - 0
Applications/foc/motor/motor_param.h

@@ -26,6 +26,7 @@ void motor_mpta_fw_lookup(float rpm, float torque, DQ_t *dq_out);
 float motor_get_lq_from_iq(s16 iq);
 float motor_get_ebreak_toruqe(float rpm);
 
+#if 0
 #if CONFIG_MOT_TYPE==MOTOR_BLUESHARK_NEW1
 #define MOTOR_R   0.010f
 #define MOTOR_Ld (0.000120f*0.5f)
@@ -153,6 +154,7 @@ float motor_get_ebreak_toruqe(float rpm);
 
 #define CONFIG_CURRENT_BANDWITH  1000.0f /* 电流环带宽 */
 
+#endif
 #endif
 
 #endif /* _MOTOR_PARAM_H__ */