Prechádzať zdrojové kódy

【V3.1.254.63】 调试软件

CHENJIE-PC\QiXiang_CHENJIE 3 rokov pred
rodič
commit
c2218c7fcf

+ 3 - 3
inc/AppConfig.h

@@ -2,9 +2,9 @@
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-12-06 17:17:21
+ * @LastEditTime : 2021-12-07 10:07:44
  * @Description  : App Config H file 配置文件,可以针对不同参数进行更改
- * @FilePath     : \undefinedc:\Work_Files\Files\4830\SDK\PLAT\project\ec616_0h00\apps\qx_app\inc\AppConfig.h
+ * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppConfig.h
  */
 
 #ifndef APPCONFIG_H
@@ -14,7 +14,7 @@
 #define DATA_MODULE_TYPE (1)           // 1表示NB模块,2表示4G cat1
 #define EOLSTATE (0)                   // 1表示下线检测跳过,使用默认值,0表示使用下线检测
 #define DEFAULT_SN "RLTEST00000000001" //默认上传的SN编码
-#define APPSWVERSION 0x0301FF3F        //数据模块软件版本号
+#define APPSWVERSION 0x0301FE3F        //数据模块软件版本号
 #define RELAYCONFIG 1                  //继电器配置
 #define TCP_ADD "iotp.fast-fun.cn"     //数据上传的地址
 #define TCP_PORT 8712                  //数据上传的端口

+ 2 - 2
src/AppTaskMain.c

@@ -3,7 +3,7 @@
  * @Date         : 2021-10-14 09:27:15
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-11-12 16:03:37
+ * @LastEditTime : 2021-12-07 10:09:47
  * @Description  : 主要负责:1.工作模式转换2.定时器定时3.定时保存运行数据4.异常状态重启
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\src\AppTaskMain.c
  */
@@ -129,7 +129,7 @@ static void MainTask(void *arg)
                 osDelay(1000);
                 EC_SystemReset();
             }
-            if (BcuDataInfo.appDataModify) //BCU数据实时保存
+            if (BcuDataInfo.appDataModify) // BCU数据实时保存
             {
                 SaveBcuData();
             }

+ 3 - 3
src/AppTaskTcp.c

@@ -259,8 +259,8 @@ static void TcpDataInfoAssembleSend()
     }
     case BATT_DISCHARGE_SYM:
     {
-        BattSendFreq = AppDataInfo.BattInfoSendFreqNomal;
-        // BattSendFreq = 1;
+        // BattSendFreq = AppDataInfo.BattInfoSendFreqNomal;
+        BattSendFreq = 10;
         GpsSendFreq = AppDataInfo.PosInfoSendFreqHigh;
         break;
     }
@@ -584,7 +584,7 @@ static void TcpDataInfoAssembleSend()
             sprintf((char *)rbuf, "B-%d,%d,%d,%d,%d,%d,%d,%d,%d,,\
                                 %d,%d,%d,%d,,\
                                 %d,%d,%d,%d,%d,%d,%d,%d",
-                    socd_pct_ahSoc, socd_pct_ekfSoc, socd_pct_estSoc, socd_pct_battSoc, socd_pct_vcuSoc, battSOC * 10, socd_pct_cellBattSoc, sohv_Q_packCapArrEo[9], cdmv_ohm_deltR[sfmd_idx_cellUMin],
+                    socd_pct_ahSoc, socd_pct_ekfSoc, socd_pct_estSoc, socd_pct_battSoc, socd_pct_vcuSoc, battSOC * 10, socd_pct_cellBattSoc, sohv_Q_packCapArrEo[9], cdmv_ohm_deltR[cand_Nr_cellNr - 1],
                     battI - 10000, maxCellVol, minCellVol, sfmd_V_cellUAvrg,
                     cand_Nr_cellNr, cand_Q_cellCap, cand_V_chrgStartStat, test_cellCap[cand_Nr_cellNr - 1], sorv_ohm_cellREo[cand_Nr_cellNr - 1], test_countEn, ihd_tm_parkTime, sohd_Q_chrgEo);
         }

+ 2 - 2
src/EmbeddedCoder_src/BCUCal.c

@@ -91,8 +91,8 @@ const uint16_T sfmc_flg_cellUDiffThrRec2 = 250U; /* 压差过大2级故障恢复
 
 const uint16_T sohc_Q_countThr = 60U;       /*soh计算需充入电量阈值*/
 const uint16_T sohc_Q_updateDeltThr = 200U; /*soh更新 偏差允许阈值*/
-const uint16_T sohc_pct_low = 300U;
-const uint16_T sohc_pct_up = 500U;
+const uint16_T sohc_pct_low = 0U;
+const uint16_T sohc_pct_up = 0U;
 
 const uint16_T socc_pct_battSocLow = 0U;                     /* SOC下限值; */
 const uint16_T socc_pct_battSocUp = 930U;                    /* SOC上限值; */

+ 32 - 25
src/EmbeddedCoder_src/SOR.c

@@ -1,6 +1,14 @@
+/*
+ * @Author       : ChenJie
+ * @Date         : 2021-12-06 17:12:12
+ * @Version      : V3.0
+ * @LastEditors  : ChenJie
+ * @LastEditTime : 2021-12-07 10:31:33
+ * @Description  : file content
+ * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\src\EmbeddedCoder_src\SOR.c
+ */
 #include "SOR.h"
 
-
 boolean_T FirstRun_SOR;
 
 void SOR_Init(void)
@@ -13,54 +21,53 @@ void SOR(void)
     static uint16_T sorn_ohm_cellREE[cmnc_num_cellUNumMax];
     static uint16_T sorn_ohm_cellREEArr[5][cmnc_num_cellUNumMax];
     uint16_T sorn_ohm_cellRSum[cmnc_num_cellUNumMax];
-	static uint16_T sorn_V_cellU[cmnc_num_cellUNumMax];
-	static uint8_T sorn_num_ctn;
-	static int16_T sorn_I_curr;
+    static uint16_T sorn_V_cellU[cmnc_num_cellUNumMax];
+    static uint8_T sorn_num_ctn;
+    static int16_T sorn_I_curr;
     uint16_T i;
     uint16_T j;
-	socd_pct_battSoc = 600;
+    // socd_pct_battSoc = 600;
     //
-    if(FirstRun_SOR)
+    if (FirstRun_SOR)
     {
         sorn_num_ctn = 0;
         sorn_I_curr = sfmd_I_curr;
-        memcpy(sorn_V_cellU,sfmv_V_cellU, sizeof(sfmv_V_cellU));
+        memcpy(sorn_V_cellU, sfmv_V_cellU, sizeof(sfmv_V_cellU));
     }
-    if(FirstRun_SOR)
+    if (FirstRun_SOR)
     {
-        if(ArrMax((&(sorv_ohm_cellREi[0])) , cmnc_num_cellUNum) > 65000)
+        if (ArrMax((&(sorv_ohm_cellREi[0])), cmnc_num_cellUNum) > 65000)
         {
-            memset(sorn_ohm_cellREE,0, sizeof(sorn_ohm_cellREE));
+            memset(sorn_ohm_cellREE, 0, sizeof(sorn_ohm_cellREE));
         }
         else
         {
-            memcpy(sorn_ohm_cellREE,sorv_ohm_cellREi, sizeof(sorv_ohm_cellREi));
+            memcpy(sorn_ohm_cellREE, sorv_ohm_cellREi, sizeof(sorv_ohm_cellREi));
         }
     }
 
-    
-    if(socd_pct_battSoc >= 550 && socd_pct_battSoc <= 700 && sorn_num_ctn < 5)
+    if (socd_pct_battSoc >= 0 && socd_pct_battSoc <= 1000 && sorn_num_ctn < 5)
     {
-        if(sfmd_I_curr - sorn_I_curr > 200 || sfmd_I_curr - sorn_I_curr < -200)
+        if (sfmd_I_curr - sorn_I_curr > 200 || sfmd_I_curr - sorn_I_curr < -200)
         {
-            for(i = 0;i < cmnc_num_cellUNum;i++)
+            for (i = 0; i < cmnc_num_cellUNum; i++)
             {
-                sorn_ohm_cellREEArr[sorn_num_ctn][i] = (uint16_T)( ((real_T)(sorn_V_cellU[i] - sfmv_V_cellU[i]) * 0.001) / ((real_T)(sorn_I_curr - sfmd_I_curr) * 0.1) * 1000000 );
+                sorn_ohm_cellREEArr[sorn_num_ctn][i] = (uint16_T)(((real_T)(sorn_V_cellU[i] - sfmv_V_cellU[i]) * 0.001) / ((real_T)(sorn_I_curr - sfmd_I_curr) * 0.1) * 1000000);
             }
             sorn_num_ctn = sorn_num_ctn + 1;
-            memset(sorn_ohm_cellRSum,0, sizeof(sorn_ohm_cellRSum));
-            for(i = 0;i < cmnc_num_cellUNum;i++)
+            memset(sorn_ohm_cellRSum, 0, sizeof(sorn_ohm_cellRSum));
+            for (i = 0; i < cmnc_num_cellUNum; i++)
             {
-                for(j = 0;j < sorn_num_ctn;j++)
+                for (j = 0; j < sorn_num_ctn; j++)
                 {
-                    sorn_ohm_cellRSum[i] =  sorn_ohm_cellRSum[i] + sorn_ohm_cellREEArr[j][i];
+                    sorn_ohm_cellRSum[i] = sorn_ohm_cellRSum[i] + sorn_ohm_cellREEArr[j][i];
                 }
-                sorn_ohm_cellREE[i] = sorn_ohm_cellRSum[i]/sorn_num_ctn;
+                sorn_ohm_cellREE[i] = sorn_ohm_cellRSum[i] / sorn_num_ctn;
             }
-        } 
+        }
     }
-    memcpy(sorv_ohm_cellREo,sorn_ohm_cellREE, sizeof(sorn_ohm_cellREE));
-	sorn_I_curr = sfmd_I_curr;
-    memcpy(sorn_V_cellU,sfmv_V_cellU, sizeof(sfmv_V_cellU));
+    memcpy(sorv_ohm_cellREo, sorn_ohm_cellREE, sizeof(sorn_ohm_cellREE));
+    sorn_I_curr = sfmd_I_curr;
+    memcpy(sorn_V_cellU, sfmv_V_cellU, sizeof(sfmv_V_cellU));
     FirstRun_SOR = false;
 }