Browse Source

【V3.0.0.44】
Merge remote-tracking branch 'QX/V3-7250-QTF' into V3-V30XX-6060

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
291845cb37

+ 5 - 2
inc/AppConfig.h

@@ -2,7 +2,7 @@
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-11-05 14:52:10
+ * @LastEditTime : 2021-11-16 17:48:51
  * @Description  : App Config H file 配置文件,可以针对不同参数进行更改
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\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 0x03000023        //数据模块软件版本号
+#define APPSWVERSION 0x0300002C        //数据模块软件版本号
 #define RELAYCONFIG 0                  //继电器配置
 #define TCP_ADD "iotp.fast-fun.cn"     //数据上传的地址
 #define TCP_PORT 8712                  //数据上传的端口
@@ -127,6 +127,9 @@ typedef struct _AppAlgorithmType
     BOOL sfmd_flg_heatCirClosFltE;
     BOOL sfmd_flg_heatCirOpenFltE;
     BOOL sfmd_flg_heatRunFltE;
+    UINT16 iscv_Q_remainCpEE[28];
+    UINT32 iscd_tm_totalEE;
+    BOOL sfmd_flg_iscFltEE;
 } AppAlgorithmData;
 typedef struct _AppDataHeader
 {

+ 1 - 0
inc/EmbeddedCoder_inc/BCU.h

@@ -3,6 +3,7 @@
 #include "SFM.h"
 #include "SPM.h"
 #include "CM.h"
+#include "ISC.h"
 #include "TMS.h"
 #include "BCUCal.h"
 #include "BCUDisp.h"

+ 2 - 0
inc/EmbeddedCoder_inc/BCUCal.h

@@ -83,6 +83,8 @@ extern const uint16_T sfmc_T_disChrgMosTOverThrRec2;
 
 extern const uint16_T sohc_Q_countThr;                       /*                    */
 extern const uint16_T sohc_Q_updateDeltThr;                 /*                    */
+extern const uint16_T sohc_pct_low;
+extern const uint16_T sohc_pct_up;
 
 
 extern const uint16_T socc_pct_battSocLow;                    /* SOC下限值; */

+ 145 - 146
inc/EmbeddedCoder_inc/BCUDisp.h

@@ -1,146 +1,145 @@
-
-#include "rtwtypes.h"
-#include "BCUCal.h"
-
-extern uint16_T appv_V_cellU[cmnc_num_cellUNumMax];                        /* 静态电压 */
-extern uint8_T appd_st_preCyc;
-
-extern uint16_T blcv_Q_reqCpEi[cmnc_num_cellUNumMax];                      /*均衡需求容量 读取量(数组); */
-extern uint16_T blcv_Q_reqCpEo[cmnc_num_cellUNumMax];                      /*均衡需求容量 写入量(数组); */
-extern uint32_T blcv_Q_totalCpEi[cmnc_num_cellUNumMax];                    /*累计均衡容量 读取量(数组); */
-extern uint32_T blcv_Q_totalCpEo[cmnc_num_cellUNumMax];                    /*累计均衡容量 写入量(数组); */
-extern boolean_T blcv_flg_excute[cmnc_num_cellUNumMax];                    /*均衡执行请求标志位 (数组); */
-
-extern boolean_T ihd_flg_HVILFlt;                        /* 保护板上传的高压互锁故障 */
-extern boolean_T ihd_flg_DTCClear;                       /* 上位机发送的故障清楚指令;*/
-extern uint8_T ihd_st_authFaild;                         /* 底层诊断的认证失败故障;*/
-extern int16_T ihd_I_curr;                               /*电池包电流; */
-extern uint8_T ihd_st_chrgConnect;                       /*充电器连接状态; */
-extern uint16_T ihd_P_gas;                               /*气体浓度 */
-extern uint16_T ihd_T_ACPlugT;                           /*慢充插头温度 +40 */
-extern uint16_T ihd_T_DCPlugT;                           /*快充插头温度+40 */
-extern uint16_T ihd_T_bdtemp;                            /*板子温度 */
-extern uint16_T ihd_T_heatPanT1;                         /*加热板温度1+40 */
-extern uint16_T ihd_T_heatPanT2;                         /*加热板温度2 +40 */
-extern uint16_T ihd_T_mosT;                              /*Mos温度+40 */
-extern boolean_T ihd_flg_EESaveFlt;                      /*EE存储故障 */
-extern boolean_T ihd_flg_battULowFlt;                    /*保护板上传的总压欠压故障; */
-extern boolean_T ihd_flg_battUOverFlt;                   /*保护板上传的总压过压故障; */
-extern boolean_T ihd_flg_cellULowFlt;                    /*保护板上传的单体欠压故障; */
-extern boolean_T ihd_flg_cellUOverFlt;                   /*保护板上传的单体过压故障; */
-extern boolean_T ihd_flg_chrgCurrOverFlt;                /*保护板上传的充电过流故障; */
-extern boolean_T ihd_flg_chrgModTLowFlt;                 /*保护板上传的充电模组温度过低故障; */
-extern boolean_T ihd_flg_chrgModTOverFlt;                /*保护板上传的充电模组温度过高故障; */
-extern boolean_T ihd_flg_chrgMosClosFlt;                 /*充电Mos失效 */
-extern boolean_T ihd_flg_chrgMosTOverFlt;                /*保护板上传的充电Mos温度过高故障; */
-extern boolean_T ihd_flg_currOpenFlt;                    /*保护板上传的电流开路故障 */
-extern boolean_T ihd_flg_disChrgCurrOverFlt;             /*保护板上传的放电过流故障; */
-extern boolean_T ihd_flg_disChrgModTLowFlt;              /*保护板上传的放电模组温度过低故障; */
-extern boolean_T ihd_flg_disChrgModTOverFlt;             /*保护板上传的放电模组温度过高故障; */
-extern boolean_T ihd_flg_disChrgMosClosFlt;              /*放电Mos失效 */
-extern boolean_T ihd_flg_disChrgMosTOverFlt;             /*保护板上传的放电Mos温度过高故障; */
-extern boolean_T ihd_flg_urtRecFlt;                      /*内网通讯故障 */
-extern uint16_T ihd_pct_soc;                             /*保护板SOC */
-extern uint16_T ihd_pct_soh;                             /*保护板SOH */
-extern uint8_T ihd_st_workStat;                          /*电池工作状态 */
-extern uint16_T ihd_tm_parkTime;                         /*驻车时间; */
-extern uint16_T ihv_T_modT[cmnc_num_modTNumMax];                           /*模组温度(数组)+40 */
-extern uint16_T ihv_V_cellU[cmnc_num_cellUNumMax];                         /*电池单体电压(数组); */
-extern boolean_T ihd_st_chrgMosControl;    
-extern boolean_T ihd_st_disChrgMosControl; 
-extern boolean_T ihd_st_relayControl;    
-extern uint8_T ihd_st_heatForceControl;
-extern uint8_T ihd_st_EOLState;
-extern boolean_T ihd_flg_urtRecFlg;
-
-extern int16_T sfmd_I_curr;                              /*处理后整包电流 */
-extern uint16_T sfmd_T_modTMax;                          /*处理后模组温度最小 */
-extern uint16_T sfmd_T_modTMin;                          /*处理后模组温度最大 */
-extern uint16_T sfmd_idx_modTMax;                          /*处理后模组温度最小 */
-extern uint16_T sfmd_idx_modTMin;                          /*处理后模组温度最大 */
-extern uint16_T sfmd_V_cellUAvrg;                        /*处理后单体电压平均 */
-extern uint16_T sfmd_V_cellUMax;                         /*处理后单体电压最大 */
-extern uint16_T sfmd_V_cellUMin;                         /*处理后单体电压最小 */
-extern uint16_T sfmd_idx_cellUMin;
-extern uint16_T sfmd_idx_cellUMax;
-extern boolean_T sfmd_flg_cellUDisable;                  /*单体电压有效标志位 ; 0为有效;1为无效 */
-extern boolean_T sfmd_flg_currDisable;                   /*电流有效标志位 ; 0为有效;1为无效 */
-extern boolean_T sfmd_flg_modTDisable;                   /*模组温度有效标志位 ; 0为有效;1为无效 */
-extern uint16_T sfmd_num_fltNum;                         /*故障数量 */
-extern uint8_T sfmd_st_fltAct;                           /*故障禁止指令 */
-extern uint8_T sfmd_st_fltLevel;                         /*故障等级 */
-extern uint16_T sfmv_T_modT[cmnc_num_modTNumMax];                          /*处理后模组温度 */
-extern uint16_T sfmv_V_cellU[cmnc_num_cellUNumMax];                        /*处理后单体电压 */
-extern uint16_T sfmv_idx_fltCode[20];                    /*诊断故障码(数组) */
-extern uint16_T sfmd_V_battU;                            /* 处理过后的总电压 */
-extern boolean_T sfmd_flg_mainCirClosFltEi;              /*主回路常闭故障读取量 */  
-extern boolean_T sfmd_flg_mainCirClosFltEo;              /*主回路常闭故障写入量 */  
-extern boolean_T sfmd_flg_heatCirClosFltEi;              /*加热回路常闭故障读取量 */  
-extern boolean_T sfmd_flg_heatCirClosFltEo;              /*加热回路常闭故障写入量 */  
-extern boolean_T sfmd_flg_heatCirOpenFltEi;              /*加热回路常开故障读取量 */  
-extern boolean_T sfmd_flg_heatCirOpenFltEo;              /*加热回路常开故障写入量 */  
-extern boolean_T sfmd_flg_heatRunFltEi;
-extern boolean_T sfmd_flg_heatRunFltEo;
-extern boolean_T sfmd_flg_iscFltEi;
-extern boolean_T sfmd_flg_iscFltEo;
-
-extern uint16_T socd_pct_ahSoc;                          /*安时SOC; */
-extern uint16_T socd_pct_estSoc;                         /*估算SOC;*/
-extern uint16_T socd_flg_EEsave;                         /*实时存储标志位;*/
-extern uint16_T socd_pct_ekfSoc;                         /*EKFSOC;*/
-extern uint16_T socd_pct_battSoc;                        /*电池真实SOC; */
-extern uint16_T socd_pct_battSocEi;                      /*电池真实SOC 读取量; */
-extern uint16_T socd_pct_battSocEo;                      /*电池真实SOC 写入量; */
-extern uint16_T socd_pct_bcuSoc;                         /*电池显示SOC; */
-extern uint16_T socd_pct_bcuSocEi;                       /*电池显示SOC读取量; */
-extern uint16_T socd_pct_bcuSocEo;                       /*电池显示SOC写入量; */
-extern uint16_T socd_pct_bcuSoc_Delay;                   /*电池显示SOC延时; */
-extern uint16_T socv_pct_cellSoc[cmnc_num_cellUNumMax];
-extern uint16_T socd_pct_cellBattSoc;
-extern boolean_T socd_flg_cellSocDisable;
-
-extern uint16_T sohd_Q_chrgEi;                           /*充入容量读取量; */
-extern uint16_T sohd_Q_chrgEo;                           /*充入容量写入量; */
-extern boolean_T sohd_flg_chrgEndEi;                     /*充电结束标志位读取量; */
-extern boolean_T sohd_flg_chrgEndEo;                     /*充电结束标志位写入量; */
-extern uint16_T sohd_pct_bcuSoh;                         /*电池SOH; */
-extern uint16_T sohd_pct_bcuSoh_Delay;                   /*电池SOH延时; */
-extern uint16_T sohd_tm_chrgStartStatEi;                 /*充电前静置时间读取量; */
-extern uint16_T sohd_tm_chrgStartStatEo;                 /*充电前静置时间写入量; */
-extern uint16_T sohv_Q_cellCap[cmnc_num_cellUNumMax];                      /*单体容量 */
-extern uint16_T sohv_Q_cellCapArrEi[cmnc_num_cellUNumMax];                 /*单体容量(数组) 读取量 */
-extern uint16_T sohv_Q_cellCapArrEo[cmnc_num_cellUNumMax];                 /*单体容量(数组) 写入量 */
-extern uint16_T sohv_Q_packCapArrEi[10];                 /*10次整包容量(数组)读取量; */
-extern uint16_T sohv_Q_packCapArrEo[10];                 /*10次整包容量(数组)写入量; */
-extern uint16_T sohv_V_chrgStartStatEi[cmnc_num_cellUNumMax];              /*充电开始时刻的单体电压(数组)读取量; */
-extern uint16_T sohv_V_chrgStartStatEo[cmnc_num_cellUNumMax];              /*充电开始时刻的单体电压(数组)写入量; */
-
-extern boolean_T iscd_flg_flt;
-extern uint16_T iscv_Q_remainCpEi[cmnc_num_cellUNumMax];
-extern uint32_T iscd_tm_totalEi;
-extern uint16_T iscv_Q_remainCpEo[cmnc_num_cellUNumMax];
-extern uint32_T iscd_tm_totalEo;
-
-extern uint8_T tmsd_st_heatAct;                          /*热管理请求状态; */
-
-extern uint8_T cmd_st_chrgMod;                           /* 充电模式  */
-extern uint8_T cmd_st_chrgSt;                            /* 充电状态  */
-extern int16_T cmd_I_chrgCurrReq;                       /* 充电需求电流  */
-extern uint8_T cmd_idx_chrgEndReason;                    /* 充电结束原因  */
-
-extern uint16_T cand_Nr_cellNr;                          /*循环发送的单体编号; */
-extern uint16_T cand_Q_cellCap;                          /*循环发送的单体容量; */
-extern uint16_T cand_V_chrgStartStat;                    /*循环发送的充电前单体电压; */
-extern uint16_T cand_Q_reqCp;                            /*循环发送的单体需求均衡容量; */
-extern uint16_T cand_Q_totalCp;                          /*循环发送的单体累计均衡容量; */
-
-extern int16_T  cdmv_V_deltOCV[cmnc_num_cellUNumMax];
-extern int16_T  cdmv_ohm_deltR[cmnc_num_cellUNumMax];
-extern boolean_T cdmd_flg_deltOCVDisable;
-
-extern uint16_T test_efkSocMin;
-extern uint16_T test_efkSocMax;
-extern real_T test_UpMin;
-extern real_T test_UpMax;
-extern uint16_T test_ekfSoc;
-extern uint16_T test_ekfSoc0;
+
+#include "rtwtypes.h"
+#include "BCUCal.h"
+
+extern uint16_T appv_V_cellU[cmnc_num_cellUNumMax];                        /* 静态电压 */
+extern uint8_T appd_st_preCyc;
+
+extern uint16_T blcv_Q_reqCpEi[cmnc_num_cellUNumMax];                      /*均衡需求容量 读取量(数组); */
+extern uint16_T blcv_Q_reqCpEo[cmnc_num_cellUNumMax];                      /*均衡需求容量 写入量(数组); */
+extern uint32_T blcv_Q_totalCpEi[cmnc_num_cellUNumMax];                    /*累计均衡容量 读取量(数组); */
+extern uint32_T blcv_Q_totalCpEo[cmnc_num_cellUNumMax];                    /*累计均衡容量 写入量(数组); */
+extern boolean_T blcv_flg_excute[cmnc_num_cellUNumMax];                    /*均衡执行请求标志位 (数组); */
+
+extern boolean_T ihd_flg_HVILFlt;                        /* 保护板上传的高压互锁故障 */
+extern boolean_T ihd_flg_DTCClear;                       /* 上位机发送的故障清楚指令;*/
+extern uint8_T ihd_st_authFaild;                         /* 底层诊断的认证失败故障;*/
+extern int16_T ihd_I_curr;                               /*电池包电流; */
+extern uint8_T ihd_st_chrgConnect;                       /*充电器连接状态; */
+extern uint16_T ihd_P_gas;                               /*气体浓度 */
+extern uint16_T ihd_T_ACPlugT;                           /*慢充插头温度 +40 */
+extern uint16_T ihd_T_DCPlugT;                           /*快充插头温度+40 */
+extern uint16_T ihd_T_bdtemp;                            /*板子温度 */
+extern uint16_T ihd_T_heatPanT1;                         /*加热板温度1+40 */
+extern uint16_T ihd_T_heatPanT2;                         /*加热板温度2 +40 */
+extern uint16_T ihd_T_mosT;                              /*Mos温度+40 */
+extern boolean_T ihd_flg_EESaveFlt;                      /*EE存储故障 */
+extern boolean_T ihd_flg_battULowFlt;                    /*保护板上传的总压欠压故障; */
+extern boolean_T ihd_flg_battUOverFlt;                   /*保护板上传的总压过压故障; */
+extern boolean_T ihd_flg_cellULowFlt;                    /*保护板上传的单体欠压故障; */
+extern boolean_T ihd_flg_cellUOverFlt;                   /*保护板上传的单体过压故障; */
+extern boolean_T ihd_flg_chrgCurrOverFlt;                /*保护板上传的充电过流故障; */
+extern boolean_T ihd_flg_chrgModTLowFlt;                 /*保护板上传的充电模组温度过低故障; */
+extern boolean_T ihd_flg_chrgModTOverFlt;                /*保护板上传的充电模组温度过高故障; */
+extern boolean_T ihd_flg_chrgMosClosFlt;                 /*充电Mos失效 */
+extern boolean_T ihd_flg_chrgMosTOverFlt;                /*保护板上传的充电Mos温度过高故障; */
+extern boolean_T ihd_flg_currOpenFlt;                    /*保护板上传的电流开路故障 */
+extern boolean_T ihd_flg_disChrgCurrOverFlt;             /*保护板上传的放电过流故障; */
+extern boolean_T ihd_flg_disChrgModTLowFlt;              /*保护板上传的放电模组温度过低故障; */
+extern boolean_T ihd_flg_disChrgModTOverFlt;             /*保护板上传的放电模组温度过高故障; */
+extern boolean_T ihd_flg_disChrgMosClosFlt;              /*放电Mos失效 */
+extern boolean_T ihd_flg_disChrgMosTOverFlt;             /*保护板上传的放电Mos温度过高故障; */
+extern boolean_T ihd_flg_urtRecFlt;                      /*内网通讯故障 */
+extern uint16_T ihd_pct_soc;                             /*保护板SOC */
+extern uint16_T ihd_pct_soh;                             /*保护板SOH */
+extern uint8_T ihd_st_workStat;                          /*电池工作状态 */
+extern uint16_T ihd_tm_parkTime;                         /*驻车时间; */
+extern uint16_T ihv_T_modT[cmnc_num_modTNumMax];                           /*模组温度(数组)+40 */
+extern uint16_T ihv_V_cellU[cmnc_num_cellUNumMax];                         /*电池单体电压(数组); */
+extern boolean_T ihd_st_chrgMosControl;    
+extern boolean_T ihd_st_disChrgMosControl; 
+extern boolean_T ihd_st_relayControl;    
+extern uint8_T ihd_st_heatForceControl;
+extern uint8_T ihd_st_EOLState;
+extern boolean_T ihd_flg_urtRecFlg;
+
+extern int16_T sfmd_I_curr;                              /*处理后整包电流 */
+extern uint16_T sfmd_T_modTMax;                          /*处理后模组温度最小 */
+extern uint16_T sfmd_T_modTMin;                          /*处理后模组温度最大 */
+extern uint16_T sfmd_idx_modTMax;                          /*处理后模组温度最小 */
+extern uint16_T sfmd_idx_modTMin;                          /*处理后模组温度最大 */
+extern uint16_T sfmd_V_cellUAvrg;                        /*处理后单体电压平均 */
+extern uint16_T sfmd_V_cellUMax;                         /*处理后单体电压最大 */
+extern uint16_T sfmd_V_cellUMin;                         /*处理后单体电压最小 */
+extern uint16_T sfmd_idx_cellUMin;
+extern uint16_T sfmd_idx_cellUMax;
+extern boolean_T sfmd_flg_cellUDisable;                  /*单体电压有效标志位 ; 0为有效;1为无效 */
+extern boolean_T sfmd_flg_currDisable;                   /*电流有效标志位 ; 0为有效;1为无效 */
+extern boolean_T sfmd_flg_modTDisable;                   /*模组温度有效标志位 ; 0为有效;1为无效 */
+extern uint16_T sfmd_num_fltNum;                         /*故障数量 */
+extern uint8_T sfmd_st_fltAct;                           /*故障禁止指令 */
+extern uint8_T sfmd_st_fltLevel;                         /*故障等级 */
+extern uint16_T sfmv_T_modT[cmnc_num_modTNumMax];                          /*处理后模组温度 */
+extern uint16_T sfmv_V_cellU[cmnc_num_cellUNumMax];                        /*处理后单体电压 */
+extern uint16_T sfmv_idx_fltCode[20];                    /*诊断故障码(数组) */
+extern uint16_T sfmd_V_battU;                            /* 处理过后的总电压 */
+extern boolean_T sfmd_flg_mainCirClosFltEi;              /*主回路常闭故障读取量 */  
+extern boolean_T sfmd_flg_mainCirClosFltEo;              /*主回路常闭故障写入量 */  
+extern boolean_T sfmd_flg_heatCirClosFltEi;              /*加热回路常闭故障读取量 */  
+extern boolean_T sfmd_flg_heatCirClosFltEo;              /*加热回路常闭故障写入量 */  
+extern boolean_T sfmd_flg_heatCirOpenFltEi;              /*加热回路常开故障读取量 */  
+extern boolean_T sfmd_flg_heatCirOpenFltEo;              /*加热回路常开故障写入量 */  
+extern boolean_T sfmd_flg_heatRunFltEi;
+extern boolean_T sfmd_flg_heatRunFltEo;
+extern boolean_T sfmd_flg_iscFltEi;
+extern boolean_T sfmd_flg_iscFltEo;
+
+extern uint16_T socd_pct_ahSoc;                          /*安时SOC; */
+extern uint16_T socd_pct_estSoc;                         /*估算SOC;*/
+extern uint16_T socd_flg_EEsave;                         /*实时存储标志位;*/
+extern uint16_T socd_pct_ekfSoc;                         /*EKFSOC;*/
+extern uint16_T socd_pct_battSoc;                        /*电池真实SOC; */
+extern uint16_T socd_pct_battSocEi;                      /*电池真实SOC 读取量; */
+extern uint16_T socd_pct_battSocEo;                      /*电池真实SOC 写入量; */
+extern uint16_T socd_pct_bcuSoc;                         /*电池显示SOC; */
+extern uint16_T socd_pct_bcuSocEi;                       /*电池显示SOC读取量; */
+extern uint16_T socd_pct_bcuSocEo;                       /*电池显示SOC写入量; */
+extern uint16_T socd_pct_bcuSoc_Delay;                   /*电池显示SOC延时; */
+extern uint16_T socv_pct_cellSoc[cmnc_num_cellUNumMax];
+extern uint16_T socd_pct_cellBattSoc;
+extern boolean_T socd_flg_cellSocDisable;
+
+extern uint16_T sohd_Q_chrgEi;                           /*充入容量读取量; */
+extern uint16_T sohd_Q_chrgEo;                           /*充入容量写入量; */
+extern boolean_T sohd_flg_chrgEndEi;                     /*充电结束标志位读取量; */
+extern boolean_T sohd_flg_chrgEndEo;                     /*充电结束标志位写入量; */
+extern uint16_T sohd_pct_bcuSoh;                         /*电池SOH; */
+extern uint16_T sohd_pct_bcuSoh_Delay;                   /*电池SOH延时; */
+extern uint16_T sohd_tm_chrgStartStatEi;                 /*充电前静置时间读取量; */
+extern uint16_T sohd_tm_chrgStartStatEo;                 /*充电前静置时间写入量; */
+extern uint16_T sohv_Q_cellCap[cmnc_num_cellUNumMax];                      /*单体容量 */
+extern uint16_T sohv_Q_cellCapArrEi[cmnc_num_cellUNumMax];                 /*单体容量(数组) 读取量 */
+extern uint16_T sohv_Q_cellCapArrEo[cmnc_num_cellUNumMax];                 /*单体容量(数组) 写入量 */
+extern uint16_T sohv_Q_packCapArrEi[10];                 /*10次整包容量(数组)读取量; */
+extern uint16_T sohv_Q_packCapArrEo[10];                 /*10次整包容量(数组)写入量; */
+extern uint16_T sohv_V_chrgStartStatEi[cmnc_num_cellUNumMax];              /*充电开始时刻的单体电压(数组)读取量; */
+extern uint16_T sohv_V_chrgStartStatEo[cmnc_num_cellUNumMax];              /*充电开始时刻的单体电压(数组)写入量; */
+
+extern boolean_T iscd_flg_flt;
+extern uint16_T iscv_Q_remainCpEi[cmnc_num_cellUNumMax];
+extern uint32_T iscd_tm_totalEi;
+extern uint16_T iscv_Q_remainCpEo[cmnc_num_cellUNumMax];
+extern uint32_T iscd_tm_totalEo;
+
+extern uint8_T tmsd_st_heatAct;                          /*热管理请求状态; */
+
+extern uint8_T cmd_st_chrgMod;                           /* 充电模式  */
+extern uint8_T cmd_st_chrgSt;                            /* 充电状态  */
+extern int16_T cmd_I_chrgCurrReq;                       /* 充电需求电流  */
+extern uint8_T cmd_idx_chrgEndReason;                    /* 充电结束原因  */
+
+extern uint16_T cand_Nr_cellNr;                          /*循环发送的单体编号; */
+extern uint16_T cand_Q_cellCap;                          /*循环发送的单体容量; */
+extern uint16_T cand_V_chrgStartStat;                    /*循环发送的充电前单体电压; */
+extern uint16_T cand_Q_reqCp;                            /*循环发送的单体需求均衡容量; */
+extern uint16_T cand_Q_totalCp;                          /*循环发送的单体累计均衡容量; */
+
+extern int16_T  cdmv_V_deltOCV[cmnc_num_cellUNumMax];
+extern int16_T  cdmv_ohm_deltR[cmnc_num_cellUNumMax];
+extern boolean_T cdmd_flg_deltOCVDisable;
+
+extern uint16_T test_efkSocMin;
+extern uint16_T test_efkSocMax;
+extern real_T test_UpMin;
+extern real_T test_UpMax;
+

+ 10 - 8
src/EmbeddedCoder_src/BCUCal.c

@@ -83,20 +83,22 @@ const uint16_T sfmc_flg_cellUDiffThrFlt2 = 300U; /* 压差过大2级故障诊断
 const uint16_T sfmc_flg_cellUDiffThrRec1 = 250U; /* 压差过大1级故障恢复阈值 */
 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_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 socc_pct_battSocLow = 0U;                     /* SOC下限值; */
 const uint16_T socc_pct_battSocUp = 1000U;                   /* SOC上限值; */
 const int16_T socm_I_chrgCor[3] = {50, 100, 150};            /* 充电CCV对应的电流数据; */
 const int16_T socm_I_disChrgCor[3] = {-300, -100, -60};      /* 放电CCV对应的电流数据; */
 const uint16_T socm_V_chrgCor[3] = {4160U, 4175U, 4188U};    /* 充电CCV对应的电压; */
-const uint16_T socm_V_disChrgCor[3] = {3303U, 3359U, 3368U}; /* 放电CCV对应的电压; */
-const uint16_T socc_pct_chrgCor = 980;                       /* 充电CCV对应的SOC; */   
-const uint16_T socc_pct_disChrgCor = 50;                     /* 放电CCV对应的SOC; */   
-const int16_T cmm_T_ChrgCurr[3] = {40,60,80};
-const int16_T cmm_V_ChrgCurr[6] = {3200,3201,3900,3901,4100,4101};
-const int16_T cmm_I_ChrgCurr[3][6] = {{0,100,100,100,100,50},{50,400,400,200,200,100},{40,300,300,150,150,80}};
+const uint16_T socm_V_disChrgCor[3] = {3310U, 3350U, 3368U}; /* 放电CCV对应的电压; */
+const uint16_T socc_pct_chrgCor = 980;                       /* 充电CCV对应的SOC; */
+const uint16_T socc_pct_disChrgCor = 50;                     /* 放电CCV对应的SOC; */
+const int16_T cmm_T_ChrgCurr[3] = {40, 60, 80};
+const int16_T cmm_V_ChrgCurr[6] = {3200, 3201, 3900, 3901, 4100, 4101};
+const int16_T cmm_I_ChrgCurr[3][6] = {{0, 100, 100, 100, 100, 50}, {50, 400, 400, 200, 200, 100}, {40, 300, 300, 150, 150, 80}};
 
 const uint16_T tmsc_T_openThr = 45U;     /* 热管理开启温度; */
 const uint16_T tmsc_T_closeMinThr = 50U; /* 热管理关闭温度(最低模组); */

+ 2 - 2
src/EmbeddedCoder_src/SFM.c

@@ -604,9 +604,9 @@ void SFM(void)
     sfmd_flg_cellULowFlt1 = DiagThrSystem2(0, !sfmd_flg_interComFlt, sfmd_V_cellUMin, sfmc_V_cellULowThrFlt1, sfmc_V_cellULowThrRec1, 2, 2, &DiagThr.fltNum84, &DiagThr.recNum84, &sfmd_flg_cellULowFlt1) && !sfmd_flg_cellULowFlt2;
 
     //85 压差过大2级
-    sfmd_flg_cellUDiffFlt2 = DiagThrSystem1(1, !sfmd_flg_interComFlt, sfmd_V_cellUMax - sfmd_V_cellUMin, sfmc_flg_cellUDiffThrFlt2, sfmc_flg_cellUDiffThrRec2, 2, 2, &DiagThr.fltNum85, &DiagThr.recNum85, &sfmd_flg_cellUDiffFlt2);
+    sfmd_flg_cellUDiffFlt2 = DiagThrSystem1(1, !sfmd_flg_interComFlt && socd_pct_battSoc > 200, sfmd_V_cellUMax - sfmd_V_cellUMin, sfmc_flg_cellUDiffThrFlt2, sfmc_flg_cellUDiffThrRec2, 2, 2, &DiagThr.fltNum85, &DiagThr.recNum85, &sfmd_flg_cellUDiffFlt2);
     //86 压差过大1级
-    sfmd_flg_cellUDiffFlt1 = DiagThrSystem1(0, !sfmd_flg_interComFlt, sfmd_V_cellUMax - sfmd_V_cellUMin, sfmc_flg_cellUDiffThrFlt1, sfmc_flg_cellUDiffThrRec1, 2, 2, &DiagThr.fltNum86, &DiagThr.recNum86, &sfmd_flg_cellUDiffFlt1) && !sfmd_flg_cellUDiffFlt2;
+    sfmd_flg_cellUDiffFlt1 = DiagThrSystem1(0, !sfmd_flg_interComFlt && socd_pct_battSoc > 200, sfmd_V_cellUMax - sfmd_V_cellUMin, sfmc_flg_cellUDiffThrFlt1, sfmc_flg_cellUDiffThrRec1, 2, 2, &DiagThr.fltNum86, &DiagThr.recNum86, &sfmd_flg_cellUDiffFlt1) && !sfmd_flg_cellUDiffFlt2;
 
     //87 总压过压2级
     sfmd_flg_battUOverFlt2 = DiagThrSystem1(1, !sfmd_flg_interComFlt, sfmd_V_battU, sfmc_V_battUOverThrFlt2, sfmc_V_battUOverThrRec2, 2, 2, &DiagThr.fltNum87, &DiagThr.recNum87, &sfmd_flg_battUOverFlt2);

+ 1 - 2
src/EmbeddedCoder_src/SOC.c

@@ -526,8 +526,7 @@ void SOC(void)
         overFlg = false;
         fulFlg = false;
         fulCntl = 0;
-		
-		socd_V_disChrgCCV = look1_iu16lu16n16tu16_binlcase(socc_pct_disChrgCor, (&(cmnm_pct_soc[0])), (&(cmnm_V_ocv[0])), 12U) + sfmd_I_curr * (look1_iu16lu16n16tu16_binlcase(socc_pct_chrgCor, (&(cmnm_pct_soc[0])), (&(cmnm_R_ohm[0])), 12U) + cdmv_ohm_deltR[sfmd_idx_cellUMin]) * 0.001 * 0.1;
+		socd_V_disChrgCCV = look1_is16lu16n16tu16_binlcase(sfmd_I_curr,&socm_I_disChrgCor[0],&socm_V_disChrgCor[0],2U) + sfmd_I_curr * (cdmv_ohm_deltR[sfmd_idx_cellUMin]) * 0.001 * 0.1;
         if (sfmd_V_cellUMin <= socd_V_disChrgCCV)
         {
             lowCntl = (lowCntl + 1) > 250 ? 250 : (lowCntl + 1);

+ 10 - 5
src/EmbeddedCoder_src/SOH.c

@@ -43,7 +43,7 @@ void SOH(void)
     int32_T  tmp_0; 
     static boolean_T sfmn_flg_currFlt_keep;
     static boolean_T sohn_flg_currFlt;
-    
+    boolean_T DisEn;
     
     if(FirstRun_SOH)
     {   
@@ -103,7 +103,7 @@ void SOH(void)
         {
             sohn_flg_countEn = false;
         }
-
+        
 		//=======================================================================================
         //------------------------SOH 计算-------------------------------------------------------
         //=======================================================================================
@@ -123,9 +123,12 @@ void SOH(void)
                     break;
                 }
             }
-
+            DisEn = (ArrMin((&(soc2[0])) , cmnc_num_cellUNum) > sohc_pct_low &&   ArrMin((&(soc2[0])) , cmnc_num_cellUNum) < sohc_pct_up) 
+                  ||(ArrMax((&(soc2[0])) , cmnc_num_cellUNum) > sohc_pct_low &&   ArrMax((&(soc2[0])) , cmnc_num_cellUNum) < sohc_pct_up)
+                  ||(ArrMin((&(soc1[0])) , cmnc_num_cellUNum) > sohc_pct_low &&   ArrMin((&(soc1[0])) , cmnc_num_cellUNum) < sohc_pct_up)
+                  ||(ArrMax((&(soc1[0])) , cmnc_num_cellUNum) > sohc_pct_low &&   ArrMax((&(soc1[0])) , cmnc_num_cellUNum) < sohc_pct_up);
 			//===================
-            if(sohn_flg_update)
+            if(sohn_flg_update && !DisEn)
             {   
 				for(i = 0;i < cmnc_num_cellUNum;i++)
  				{
@@ -153,7 +156,7 @@ void SOH(void)
              memcpy(sohv_Q_cellCapArrEo,sohn_Q_cellCapArrEE, sizeof(sohv_Q_cellCapArrEo));
          }
 		 memcpy(sohv_Q_cellCap,sohv_Q_cellCapArrEo, sizeof(sohv_Q_cellCapArrEo));
-
+        // printf("sohv_Q_cellCapArrEo[16]:%d,update:%d,En:%d\n",sohv_Q_cellCapArrEo[16],sohn_flg_update,sohn_flg_countEn);
  
          SumQ = 0;
          for(i = 0; i < 10;i++)
@@ -181,6 +184,8 @@ void SOH(void)
      {
         memcpy(sohv_V_chrgStartStatEo,sohn_V_chrgStartStat, sizeof(sohv_V_chrgStartStatEo));
      }
+
+	 
     //printf("sohv_V_chrgStartStatEo[16]:%d\n",sohv_V_chrgStartStatEo[16]);
     //=======================================================================================
     //----------------------充电中信息-------------------------------------------------------