ソースを参照

母线限流,取母线绝对值,母线电流计算取负号,负放电,正发电

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 3 年 前
コミット
170bc02e78
1 ファイル変更2 行追加2 行削除
  1. 2 2
      Applications/foc/core/PMSM_FOC_Core.c

+ 2 - 2
Applications/foc/core/PMSM_FOC_Core.c

@@ -483,7 +483,7 @@ static __INLINE void PMSM_FOC_FieldWeak(void) {
 static __INLINE float PMSM_FOC_Limit_iDC(float maxTrq) {
 #if 1
 	PI_Ctrl_Power.max = maxTrq;
-	float errRef = eRamp_get_intepolation(&gFoc_Ctrl.rtLim.DCCurrLimRamp) - gFoc_Ctrl.out.s_FilteriDC;
+	float errRef = eRamp_get_intepolation(&gFoc_Ctrl.rtLim.DCCurrLimRamp) - ABS(gFoc_Ctrl.out.s_FilteriDC);
 	return PI_Controller_run(gFoc_Ctrl.pi_power, errRef);
 #else
 	return maxTrq;
@@ -1025,7 +1025,7 @@ void PMSM_FOC_Calc_Current(void) {
 	if (id_thr >= 100.0f) {
 		id_thr = 100.0f;
 	}
-	float raw_idc = m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
+	float raw_idc = -m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
 #else
 	float raw_idc = get_vbus_current();
 #endif