Selaa lähdekoodia

过压欠压采样1档,并同步更新恢复值;无感驱动使用的电感参数更新

Ye Jin 5 kuukautta sitten
vanhempi
sitoutus
8444f37f6a

+ 37 - 31
User project/1.FrameLayer/Source/main.c

@@ -209,12 +209,15 @@ void mn_voParaSet(void)
                 spi_stResolverOut.swSpiThetaOffsetPu = (SWORD)I2C_uwMControlRead[3];
                 cp_stMotorPara.swIpeakMaxA = (SWORD)I2C_uwMControlRead[4];
                 cp_stControlPara.swAlmOverCurrentVal = (SWORD)I2C_uwMControlRead[5];
-                cp_stControlPara.swAlmOverVolVal3 = (SWORD)I2C_uwMControlRead[6];
-                cp_stControlPara.swAlmUnderVolVal2 = (SWORD)I2C_uwMControlRead[7];
+                cp_stControlPara.swAlmOverVolVal1 = (SWORD)I2C_uwMControlRead[6];
+                cp_stControlPara.swAlmUnderVolVal1 = (SWORD)I2C_uwMControlRead[7];
                 cp_stControlPara.swAlmOverSpdVal = (SWORD)I2C_uwMControlRead[8];
                 cp_stControlPara.swAlmOverHeatCeVal = (SWORD)I2C_uwMControlRead[9];
                 cp_stControlPara.swAlmRecOHeatVal = (SWORD)I2C_uwMControlRead[10];
                 cp_stControlPara.swAlmPwrLimitStartTempVal = (SWORD)I2C_uwMControlRead[11];
+                
+                cp_stControlPara.swAlmRecOVVal = (SWORD)(cp_stControlPara.swAlmOverVolVal1 - ALM_VLT_REC_ERRVAL);//updata recover data
+                cp_stControlPara.swAlmRecUVVal = (SWORD)(cp_stControlPara.swAlmUnderVolVal1 + ALM_VLT_REC_ERRVAL);
             }
             else
             {
@@ -337,12 +340,15 @@ void mn_voParaUpdate(void)
         spi_stResolverOut.swSpiThetaOffsetPu = MC_UpcInfo.stMContorlInfo.uwSPIPosOffsetNow;
         cp_stMotorPara.swIpeakMaxA = (SWORD)MC_UpcInfo.stMContorlInfo.uwIPeakMaxA;
         cp_stControlPara.swAlmOverCurrentVal = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamOCurA;
-        cp_stControlPara.swAlmOverVolVal3 = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamOVolV;
-        cp_stControlPara.swAlmUnderVolVal2 = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamUVolV;
+        cp_stControlPara.swAlmOverVolVal1 = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamOVolV;
+        cp_stControlPara.swAlmUnderVolVal1 = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamUVolV;
         cp_stControlPara.swAlmOverSpdVal = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamOverSpdRpm;
         cp_stControlPara.swAlmOverHeatCeVal = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamOverHeatCe;
         cp_stControlPara.swAlmRecOHeatVal = (SWORD)MC_UpcInfo.stMContorlInfo.uwAlamRecHeatCe;
         cp_stControlPara.swAlmPwrLimitStartTempVal = (SWORD)MC_UpcInfo.stMContorlInfo.uwPwrLimitStartCe;
+        
+        cp_stControlPara.swAlmRecOVVal = (SWORD)(cp_stControlPara.swAlmOverVolVal1 - ALM_VLT_REC_ERRVAL);
+        cp_stControlPara.swAlmRecUVVal = (SWORD)(cp_stControlPara.swAlmUnderVolVal1 + ALM_VLT_REC_ERRVAL);
 
         cp_stFlg.ParaMotorDriveUpdateFinishFlg = TRUE;
         cp_stFlg.ParaMCInfoUpdateFlg = FALSE;
@@ -471,8 +477,8 @@ void mn_voEEUperParaUpdate(void)
         Syspara2.stMControlPara.uwSPIPosOffsetNow.uwReal = spi_stResolverOut.swSpiThetaOffsetPu;
         Syspara2.stMControlPara.uwIPeakMaxA.uwReal = (UWORD)cp_stMotorPara.swIpeakMaxA;
         Syspara2.stMControlPara.uwAlamOCurA.uwReal = (UWORD)cp_stControlPara.swAlmOverCurrentVal;
-        Syspara2.stMControlPara.uwAlamOVolV.uwReal = (UWORD)cp_stControlPara.swAlmOverVolVal3;
-        Syspara2.stMControlPara.uwAlamUVolV.uwReal = (UWORD)cp_stControlPara.swAlmUnderVolVal2;
+        Syspara2.stMControlPara.uwAlamOVolV.uwReal = (UWORD)cp_stControlPara.swAlmOverVolVal1;
+        Syspara2.stMControlPara.uwAlamUVolV.uwReal = (UWORD)cp_stControlPara.swAlmUnderVolVal1;
         Syspara2.stMControlPara.uwAlamOverSpdRpm.uwReal = (UWORD)cp_stControlPara.swAlmOverSpdVal;
         Syspara2.stMControlPara.uwAlamOverHeatCe.uwReal = (UWORD)cp_stControlPara.swAlmOverHeatCeVal;
         Syspara2.stMControlPara.uwAlamRecHeatCe.uwReal = (UWORD)cp_stControlPara.swAlmRecOHeatVal;
@@ -618,31 +624,31 @@ void mn_voSoftwareInit(void)
 ************************************************************************/
 void mn_voMtParInit(void)
 {
-    mn_swIdTurn1Pu = (SWORD)(((SLONG)M_LD_TURN1_ID_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Ld
-    mn_slLdTurn1Pu = ((SLONG)M_LD_TURN1_LD_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Ld
-    mn_swIdTurn2Pu = (SWORD)(((SLONG)M_LD_TURN2_ID_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Ld
-    mn_slLdTurn2Pu = ((SLONG)M_LD_TURN2_LD_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Ld
-    if (mn_swIdTurn1Pu == mn_swIdTurn2Pu)
-    {
-        mn_swKLdSat = 0;
-    }
-    else
-    {
-        mn_swKLdSat = (SWORD)(((mn_slLdTurn2Pu - mn_slLdTurn1Pu) << 10) / (mn_swIdTurn2Pu - mn_swIdTurn1Pu)); // Q10
-    }
-
-    mn_swIqTurn1Pu = (SWORD)(((SLONG)M_LQ_TURN1_IQ_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Lq
-    mn_slLqTurn1Pu = ((SLONG)M_LQ_TURN1_LQ_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Lq
-    mn_swIqTurn2Pu = (SWORD)(((SLONG)M_LQ_TURN2_IQ_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Lq
-    mn_slLqTurn2Pu = ((SLONG)M_LQ_TURN2_LQ_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Lq
-    if (mn_swIqTurn1Pu == mn_swIqTurn2Pu)
-    {
-        mn_swKLqSat = 0;
-    }
-    else
-    {
-        mn_swKLqSat = (SWORD)(((mn_slLqTurn2Pu - mn_slLqTurn1Pu) << 10) / (mn_swIqTurn2Pu - mn_swIqTurn1Pu)); // Q10
-    }
+//    mn_swIdTurn1Pu = (SWORD)(((SLONG)M_LD_TURN1_ID_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Ld
+//    mn_slLdTurn1Pu = ((SLONG)M_LD_TURN1_LD_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Ld
+//    mn_swIdTurn2Pu = (SWORD)(((SLONG)M_LD_TURN2_ID_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Ld
+//    mn_slLdTurn2Pu = ((SLONG)M_LD_TURN2_LD_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Ld
+//    if (mn_swIdTurn1Pu == mn_swIdTurn2Pu)
+//    {
+//        mn_swKLdSat = 0;
+//    }
+//    else
+//    {
+//        mn_swKLdSat = (SWORD)(((mn_slLdTurn2Pu - mn_slLdTurn1Pu) << 10) / (mn_swIdTurn2Pu - mn_swIdTurn1Pu)); // Q10
+//    }
+//
+//    mn_swIqTurn1Pu = (SWORD)(((SLONG)M_LQ_TURN1_IQ_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Lq
+//    mn_slLqTurn1Pu = ((SLONG)M_LQ_TURN1_LQ_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Lq
+//    mn_swIqTurn2Pu = (SWORD)(((SLONG)M_LQ_TURN2_IQ_AP << 14) / (SWORD)cof_uwIbAp); // Q14, saturation current of Lq
+//    mn_slLqTurn2Pu = ((SLONG)M_LQ_TURN2_LQ_MH << 10) / cof_uwLbHm; // Q10, saturation inductance of Lq
+//    if (mn_swIqTurn1Pu == mn_swIqTurn2Pu)
+//    {
+//        mn_swKLqSat = 0;
+//    }
+//    else
+//    {
+//        mn_swKLqSat = (SWORD)(((mn_slLqTurn2Pu - mn_slLqTurn1Pu) << 10) / (mn_swIqTurn2Pu - mn_swIqTurn1Pu)); // Q10
+//    }
 }
 
 /************************************************************************

+ 48 - 48
User project/2.MotorDrive/Source/alarm.c

@@ -534,31 +534,14 @@ void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
         /*=======================================================================
         Over voltage
         =======================================================================*/
-        /* Over voltage level 3 */
-
-        if (in->uwVdcPu > coef->ulOvrVltLvl3ValPu) // 45V
-        {
-            alm_stDecCt.ulOvrVltLvl3++;
-            if (alm_stDecCt.ulOvrVltLvl3 >= coef->ulOvrVltLvl3ValCt) // 1ms
-            {
-                alm_stDecCt.ulOvrVltLvl3 = coef->ulOvrVltLvl3ValCt;
-                // alm_unAction.bit.ThrPhsShrt = 1;
-                alm_unCode.bit.OvrVlt = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.ulOvrVltLvl3 = 0;
-        }
-
-//        /* Over voltage level 2 */
-//        if (in->uwVdcPu > coef->ulOvrVltLvl2ValPu) // 44V
+//        /* Over voltage level 3 */
+//
+//        if (in->uwVdcPu > coef->ulOvrVltLvl3ValPu) // 45V
 //        {
-//            alm_stDecCt.ulOvrVltLvl2++;
-//            if (alm_stDecCt.ulOvrVltLvl2 >= coef->ulOvrVltLvl2ValCt) // 10ms
+//            alm_stDecCt.ulOvrVltLvl3++;
+//            if (alm_stDecCt.ulOvrVltLvl3 >= coef->ulOvrVltLvl3ValCt) // 1ms
 //            {
-//                alm_stDecCt.ulOvrVltLvl2 = coef->ulOvrVltLvl2ValCt;
+//                alm_stDecCt.ulOvrVltLvl3 = coef->ulOvrVltLvl3ValCt;
 //                // alm_unAction.bit.ThrPhsShrt = 1;
 //                alm_unCode.bit.OvrVlt = 1;
 //                alm_unAction.bit.PWMOff = 1;
@@ -566,16 +549,16 @@ void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
 //        }
 //        else
 //        {
-//            alm_stDecCt.ulOvrVltLvl2 = 0;
+//            alm_stDecCt.ulOvrVltLvl3 = 0;
 //        }
-//
-//        /* Over voltage level 1 */
-//        if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // 43V
+
+//        /* Over voltage level 2 */
+//        if (in->uwVdcPu > coef->ulOvrVltLvl2ValPu) // 44V
 //        {
-//            alm_stDecCt.ulOvrVltLvl1++;
-//            if (alm_stDecCt.ulOvrVltLvl1 >= coef->ulOvrVltLvl1ValCt) // 2s
+//            alm_stDecCt.ulOvrVltLvl2++;
+//            if (alm_stDecCt.ulOvrVltLvl2 >= coef->ulOvrVltLvl2ValCt) // 10ms
 //            {
-//                alm_stDecCt.ulOvrVltLvl1 = coef->ulOvrVltLvl1ValCt;
+//                alm_stDecCt.ulOvrVltLvl2 = coef->ulOvrVltLvl2ValCt;
 //                // alm_unAction.bit.ThrPhsShrt = 1;
 //                alm_unCode.bit.OvrVlt = 1;
 //                alm_unAction.bit.PWMOff = 1;
@@ -583,42 +566,59 @@ void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
 //        }
 //        else
 //        {
-//            alm_stDecCt.ulOvrVltLvl1 = 0;
+//            alm_stDecCt.ulOvrVltLvl2 = 0;
 //        }
-        /*=======================================================================
-        Under voltage
-        =======================================================================*/
-        /* Under voltage level 2 */
-        if (in->uwVdcCompPu < coef->ulUndrVltLvl2ValPu) // 160v
+
+        /* Over voltage level 1 */
+        if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // 43V
         {
-            alm_stDecCt.ulUndrVltLvl2++;
-            if (alm_stDecCt.ulUndrVltLvl2 >= coef->ulUndrVltLvl2ValCt) // 1ms
+            alm_stDecCt.ulOvrVltLvl1++;
+            if (alm_stDecCt.ulOvrVltLvl1 >= coef->ulOvrVltLvl1ValCt) // 2s
             {
-                alm_stDecCt.ulUndrVltLvl2 = coef->ulUndrVltLvl2ValCt;
+                alm_stDecCt.ulOvrVltLvl1 = coef->ulOvrVltLvl1ValCt;
+                // alm_unAction.bit.ThrPhsShrt = 1;
+                alm_unCode.bit.OvrVlt = 1;
                 alm_unAction.bit.PWMOff = 1;
-                alm_unCode.bit.UndrVlt = 1;
             }
         }
         else
         {
-            alm_stDecCt.ulUndrVltLvl2 = 0;
+            alm_stDecCt.ulOvrVltLvl1 = 0;
         }
-
-        //      /* Under voltage level 1 */
-//        if (in->uwVdcCompPu < coef->ulUndrVltLvl1ValPu) // 190V
+        /*=======================================================================
+        Under voltage
+        =======================================================================*/
+//        /* Under voltage level 2 */
+//        if (in->uwVdcCompPu < coef->ulUndrVltLvl2ValPu) // 160v
 //        {
-//            alm_stDecCt.ulUndrVltLvl1++;
-//            if (alm_stDecCt.ulUndrVltLvl1 >= coef->ulUndrVltLvl1ValCt) // 2s
+//            alm_stDecCt.ulUndrVltLvl2++;
+//            if (alm_stDecCt.ulUndrVltLvl2 >= coef->ulUndrVltLvl2ValCt) // 1ms
 //            {
-//                alm_stDecCt.ulUndrVltLvl1 = coef->ulUndrVltLvl1ValCt;
+//                alm_stDecCt.ulUndrVltLvl2 = coef->ulUndrVltLvl2ValCt;
 //                alm_unAction.bit.PWMOff = 1;
 //                alm_unCode.bit.UndrVlt = 1;
 //            }
 //        }
 //        else
 //        {
-//            alm_stDecCt.ulUndrVltLvl1 = 0;
+//            alm_stDecCt.ulUndrVltLvl2 = 0;
 //        }
+
+              /* Under voltage level 1 */
+        if (in->uwVdcCompPu < coef->ulUndrVltLvl1ValPu) // 190V
+        {
+            alm_stDecCt.ulUndrVltLvl1++;
+            if (alm_stDecCt.ulUndrVltLvl1 >= coef->ulUndrVltLvl1ValCt) // 2s
+            {
+                alm_stDecCt.ulUndrVltLvl1 = coef->ulUndrVltLvl1ValCt;
+                alm_unAction.bit.PWMOff = 1;
+                alm_unCode.bit.UndrVlt = 1;
+            }
+        }
+        else
+        {
+            alm_stDecCt.ulUndrVltLvl1 = 0;
+        }
         alm_pvt_blTbsFirstFlg = TRUE;
     }
     else

+ 2 - 2
User project/3.BasicFunction/Include/i2c_master.h

@@ -261,11 +261,11 @@
     }
 #define I2CuwAlamOVolV                            \
     {                                             \
-        ((UWORD)ALM_OVR_VLT_LVL3_VAL), 0, 0, 0, 0 \
+        ((UWORD)ALM_OVR_VLT_LVL1_VAL), 0, 0, 0, 0 \
     }
 #define I2CuwAlamUVolV                             \
     {                                              \
-        ((UWORD)ALM_UNDR_VLT_LVL2_VAL), 0, 0, 0, 0 \
+        ((UWORD)ALM_UNDR_VLT_LVL1_VAL), 0, 0, 0, 0 \
     }
 #define I2CuwAlamOverSpdRpm                  \
     {                                        \

+ 2 - 2
User project/3.BasicFunction/Source/canAppl.c

@@ -100,8 +100,8 @@ void Can_voUpdateMC_UpcInfo(void)
     MC_UpcInfo.stMContorlInfo.uwSPIPosOffsetNow = spi_stResolverOut.swSpiThetaOffsetPu;
     MC_UpcInfo.stMContorlInfo.uwIPeakMaxA = cp_stMotorPara.swIpeakMaxA;
     MC_UpcInfo.stMContorlInfo.uwAlamOCurA = cp_stControlPara.swAlmOverCurrentVal;
-    MC_UpcInfo.stMContorlInfo.uwAlamOVolV = cp_stControlPara.swAlmOverVolVal3;
-    MC_UpcInfo.stMContorlInfo.uwAlamUVolV = cp_stControlPara.swAlmUnderVolVal2;
+    MC_UpcInfo.stMContorlInfo.uwAlamOVolV = cp_stControlPara.swAlmOverVolVal1;
+    MC_UpcInfo.stMContorlInfo.uwAlamUVolV = cp_stControlPara.swAlmUnderVolVal1;
     MC_UpcInfo.stMContorlInfo.uwAlamOverSpdRpm = cp_stControlPara.swAlmOverSpdVal;
     MC_UpcInfo.stMContorlInfo.uwAlamOverHeatCe = cp_stControlPara.swAlmOverHeatCeVal;
     MC_UpcInfo.stMContorlInfo.uwAlamRecHeatCe = cp_stControlPara.swAlmRecOHeatVal;

+ 24 - 22
User project/4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/user.h

@@ -111,15 +111,15 @@ Update Time
 #define M_LD_NOLOAD_MH      22250   // unit: 0.01uH, D axis inductance
 #define M_LQ_NOLOAD_MH      23000   // unit: 0.01uH, Q axis inductance
 #define M_LD_TURN1_ID_AP    5000    // unit: 0.01A,
-#define M_LD_TURN1_LD_MH    11000   // unit: 0.01uH,D axis inductance
+#define M_LD_TURN1_LD_MH    22250   // unit: 0.01uH,D axis inductance
 #define M_LD_TURN2_ID_AP    700     // unit: 0.01A,
-#define M_LD_TURN2_LD_MH    11000   // unit: 0.01uH,D axis inductance
-#define M_LD_MIN_MH         11000   // unit: 0.01uH,D axis inductance
+#define M_LD_TURN2_LD_MH    22250   // unit: 0.01uH,D axis inductance
+#define M_LD_MIN_MH         22250   // unit: 0.01uH,D axis inductance
 #define M_LQ_TURN1_IQ_AP    200     // unit: 0.01A,
-#define M_LQ_TURN1_LQ_MH    11500   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN1_LQ_MH    23000   // unit: 0.01uH,Q axis inductance
 #define M_LQ_TURN2_IQ_AP    700     // unit: 0.01A,
-#define M_LQ_TURN2_LQ_MH    11500   // unit: 0.01uH,Q axis inductance
-#define M_LQ_MIN_MH         11500   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN2_LQ_MH    23000   // unit: 0.01uH,Q axis inductance
+#define M_LQ_MIN_MH         23000   // unit: 0.01uH,Q axis inductance
 #define M_JD                2500    // unit: 10-7Kg*m2, Rotational inertia
 #define M_MAGNETIC_MATERIAL Ferrite // unit:Null
 #define M_FLUX_WB           8920    // unit: 0.001mWb, Flux linkage
@@ -140,21 +140,21 @@ Update Time
 #define M_LD_NOLOAD_MH      16000    // unit: 0.01uH, D axis inductance
 #define M_LQ_NOLOAD_MH      16750   // unit: 0.01uH, Q axis inductance
 #define M_LD_TURN1_ID_AP    5000    // unit: 0.01A,
-#define M_LD_TURN1_LD_MH    7650    // unit: 0.01uH,D axis inductance
+#define M_LD_TURN1_LD_MH    16000    // unit: 0.01uH,D axis inductance
 #define M_LD_TURN2_ID_AP    700     // unit: 0.01A,
-#define M_LD_TURN2_LD_MH    7650    // unit: 0.01uH,D axis inductance
-#define M_LD_MIN_MH         7650    // unit: 0.01uH,D axis inductance
+#define M_LD_TURN2_LD_MH    16000    // unit: 0.01uH,D axis inductance
+#define M_LD_MIN_MH         16000    // unit: 0.01uH,D axis inductance
 #define M_LQ_TURN1_IQ_AP    200     // unit: 0.01A,
-#define M_LQ_TURN1_LQ_MH    10200   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN1_LQ_MH    16750   // unit: 0.01uH,Q axis inductance
 #define M_LQ_TURN2_IQ_AP    700     // unit: 0.01A,
-#define M_LQ_TURN2_LQ_MH    10200   // unit: 0.01uH,Q axis inductance
-#define M_LQ_MIN_MH         10200   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN2_LQ_MH    16750   // unit: 0.01uH,Q axis inductance
+#define M_LQ_MIN_MH         16750   // unit: 0.01uH,Q axis inductance
 #define M_JD                2500    // unit: 10-7Kg*m2, Rotational inertia
 #define M_MAGNETIC_MATERIAL Ferrite // unit:Null
 #define M_FLUX_WB           7336    // 5056    // unit: 0.001mWb, Flux linkage
 #define M_ID_MAX_AP         0       //-25      // unit: 0.01A, Max d axis current
 #define M_ID_MIN_AP         -600    // unit: 0.01A, Min d axis current
-#define M_IS_PEAK_MAX_AP    3200    // unit: 0.01A, Max phase current(below base speed)
+#define M_IS_PEAK_MAX_AP    3600    // unit: 0.01A, Max phase current(below base speed)
 #define M_POWER_MAX_WT      600     // unit: W, Max power
 #define M_R_SPD_RPM         5000    // unit: r/min, rate spd
 #define M_R_PWR_WT          250     // unit: W, rate power
@@ -169,21 +169,21 @@ Update Time
 #define M_LD_NOLOAD_MH      16000    // unit: 0.01uH, D axis inductance
 #define M_LQ_NOLOAD_MH      16750   // unit: 0.01uH, Q axis inductance
 #define M_LD_TURN1_ID_AP    5000    // unit: 0.01A,
-#define M_LD_TURN1_LD_MH    7650    // unit: 0.01uH,D axis inductance
+#define M_LD_TURN1_LD_MH    16000    // unit: 0.01uH,D axis inductance
 #define M_LD_TURN2_ID_AP    700     // unit: 0.01A,
-#define M_LD_TURN2_LD_MH    7650    // unit: 0.01uH,D axis inductance
-#define M_LD_MIN_MH         7650    // unit: 0.01uH,D axis inductance
+#define M_LD_TURN2_LD_MH    16000    // unit: 0.01uH,D axis inductance
+#define M_LD_MIN_MH         16000    // unit: 0.01uH,D axis inductance
 #define M_LQ_TURN1_IQ_AP    200     // unit: 0.01A,
-#define M_LQ_TURN1_LQ_MH    10200   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN1_LQ_MH    16750   // unit: 0.01uH,Q axis inductance
 #define M_LQ_TURN2_IQ_AP    700     // unit: 0.01A,
-#define M_LQ_TURN2_LQ_MH    10200   // unit: 0.01uH,Q axis inductance
-#define M_LQ_MIN_MH         10200   // unit: 0.01uH,Q axis inductance
+#define M_LQ_TURN2_LQ_MH    16750   // unit: 0.01uH,Q axis inductance
+#define M_LQ_MIN_MH         16750   // unit: 0.01uH,Q axis inductance
 #define M_JD                2500    // unit: 10-7Kg*m2, Rotational inertia
 #define M_MAGNETIC_MATERIAL Ferrite // unit:Null
 #define M_FLUX_WB           7336    // 5056    // unit: 0.001mWb, Flux linkage
 #define M_ID_MAX_AP         0       //-25      // unit: 0.01A, Max d axis current
 #define M_ID_MIN_AP         -600    // unit: 0.01A, Min d axis current
-#define M_IS_PEAK_MAX_AP    3200    // unit: 0.01A, Max phase current(below base speed)
+#define M_IS_PEAK_MAX_AP    3600    // unit: 0.01A, Max phase current(below base speed)
 #define M_POWER_MAX_WT      600     // unit: W, Max power
 #define M_R_SPD_RPM         5000    // unit: r/min, rate spd
 #define M_R_PWR_WT          250     // unit: W, rate power
@@ -273,12 +273,14 @@ Update Time
 #define ALM_REC_ALL_TM 5000 // unit: ms, Time of duration(TBC)
 /* Recover time of IPM OC */
 #define ALM_IPM_OC_REC_TM 200 // unit: ms, Time of duration(TBC)
+/* Recover value of over voltage and under voltage error*/
+#define ALM_VLT_REC_ERRVAL 30 // unit: 0.1V
 /* Recover time & value of over voltage */
-#define ALM_OVR_VLT_REC_VAL (ALM_OVR_VLT_LVL1_VAL - 30) // unit: 0.1V
+#define ALM_OVR_VLT_REC_VAL (ALM_OVR_VLT_LVL1_VAL - ALM_VLT_REC_ERRVAL) // unit: 0.1V
 #define ALM_OVR_VLT_REC_TM  100                         // unit: ms, Time of duration(TBC)
 #define ALM_OVR_VLT_REC_TM1 150                         // unit: ms, Time of duration(TBC)
 /* Recover time & value of under voltage */
-#define ALM_UNDR_VLT_REC_VAL (ALM_UNDR_VLT_LVL1_VAL + 30) // unit: 0.1V
+#define ALM_UNDR_VLT_REC_VAL (ALM_UNDR_VLT_LVL1_VAL + ALM_VLT_REC_ERRVAL) // unit: 0.1V
 #define ALM_UNDR_VLT_REC_TM  200                          // unit: ms, Time of duration(TBC)
 #define ALM_UNDR_VLT_REC_TM1 400                          // unit: ms, Time of duration(TBC)
 /* Recover time & value of IPM over heat */

+ 4 - 2
User project/4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Source/glbcof.c

@@ -82,8 +82,10 @@ void cof_voSysInit(void)
 
     cof_uwCurMaxPu = (UWORD)(((ULONG)cp_stMotorPara.swIpeakMaxA << 14) / cof_uwIbAp); /* Q14, Max phase current (peak value) */
     cof_uwPwrMaxPu = (UWORD)(((ULONG)M_POWER_MAX_WT << 14) * 10 / cof_uwPbWt);        /* Q14, Max power of motor input */
-    cof_uwLdMinPu = (UWORD)(((ULONG)M_LD_MIN_MH << 10) / cof_uwLbHm);                 /* Q10, D axis inductance */
-    cof_uwLqMinPu = (UWORD)(((ULONG)M_LQ_MIN_MH << 10) / cof_uwLbHm);                 /* Q10, Q axis inductance */
+//    cof_uwLdMinPu = (UWORD)(((ULONG)M_LD_MIN_MH << 10) / cof_uwLbHm);                 /* Q10, D axis inductance */
+//    cof_uwLqMinPu = (UWORD)(((ULONG)M_LQ_MIN_MH << 10) / cof_uwLbHm);                 /* Q10, Q axis inductance */
+    cof_uwLdMinPu = (UWORD)(((ULONG)cp_stMotorPara.swLdmH << 10) / cof_uwLbHm);                 /* Q10, D axis inductance */
+    cof_uwLqMinPu = (UWORD)(((ULONG)cp_stMotorPara.swLqmH << 10) / cof_uwLbHm);                 /* Q10, Q axis inductance */
 
     /*=======================================================================
                              Time value