瀏覽代碼

默认限流,限速放到foc_config.h中

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 4 年之前
父節點
當前提交
76b9dfe66e
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      Applications/foc/core/foc_core.c
  2. 0 3
      Applications/foc/core/foc_core.h
  3. 3 0
      Applications/foc/foc_config.h

+ 1 - 1
Applications/foc/core/foc_core.c

@@ -23,7 +23,7 @@ void PMSM_FOC_CoreInit(void) {
 	PMSM_FOC_Init();
 	PMSM_FOC_Init();
 	pmsm_foc.FOC_In  = PMSM_FOC_GetInputs();
 	pmsm_foc.FOC_In  = PMSM_FOC_GetInputs();
 	pmsm_foc.FOC_Out = PMSM_FOC_GetOutputs();
 	pmsm_foc.FOC_Out = PMSM_FOC_GetOutputs();
-	PMSM_FOC_iBusLimit(S16Q5(Default_DC_iLimit));
+	PMSM_FOC_iBusLimit(S16Q5(Default_iDC_Limit));
 	PMSM_FOC_SpeedLimit(S32Q4(Default_Spd_Limit));
 	PMSM_FOC_SpeedLimit(S32Q4(Default_Spd_Limit));
 }
 }
 
 

+ 0 - 3
Applications/foc/core/foc_core.h

@@ -2,9 +2,6 @@
 #define _FOC_CORE_H__
 #define _FOC_CORE_H__
 #include "foc_type.h"
 #include "foc_type.h"
 
 
-#define Default_DC_iLimit 40
-#define Default_Spd_Limit 2000
-
 void PMSM_FOC_CoreInit(void);
 void PMSM_FOC_CoreInit(void);
 void PMSM_FOC_Schedule(void);
 void PMSM_FOC_Schedule(void);
 void PMSM_FOC_Start(u8 nCtrlMode);
 void PMSM_FOC_Start(u8 nCtrlMode);

+ 3 - 0
Applications/foc/foc_config.h

@@ -1,6 +1,9 @@
 #ifndef _FOC_CONFIG_H__
 #ifndef _FOC_CONFIG_H__
 #define _FOC_CONFIG_H__
 #define _FOC_CONFIG_H__
 
 
+#define Default_iDC_Limit 30     /* 默认母线电流最大值, 单位 A */
+#define Default_Spd_Limit 5200   /* 默认速度最大值, 单位 RPM */
+
 /* 转把 */
 /* 转把 */
 #define THROTTLE_LOW_VALUE 0.2f /* 转把最小值 */
 #define THROTTLE_LOW_VALUE 0.2f /* 转把最小值 */
 #define THROTTLE_MAX_VALUE 4.9f /* 转把最大值 */
 #define THROTTLE_MAX_VALUE 4.9f /* 转把最大值 */