BCUDisp.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #include "rtwtypes.h"
  2. #include "BCUCal.h"
  3. extern uint16_T appv_V_cellU[cmnc_num_cellUNumMax]; /* 静态电压 */
  4. extern uint8_T appd_st_preCyc;
  5. extern boolean_T spmd_flg_firstRun;
  6. extern boolean_T socd_flg_firstRun;
  7. extern boolean_T sohd_flg_firstRun;
  8. extern boolean_T blcd_flg_firstRun;
  9. extern boolean_T sord_flg_firstRun;
  10. extern boolean_T soed_flg_firstRun;
  11. extern boolean_T iscd_flg_firstRun;
  12. extern boolean_T pimd_flg_firstRun;
  13. extern boolean_T sfmd_flg_firstRun;
  14. extern boolean_T tmsd_flg_firstRun;
  15. extern boolean_T cdmd_flg_firstRun;
  16. extern boolean_T csmd_flg_firstRun;
  17. extern boolean_T sopd_flg_firstRun;
  18. extern uint16_T blcv_Q_reqCpEi[cmnc_num_cellUNumMax]; /*均衡需求容量 读取量(数组); */
  19. extern uint16_T blcv_Q_reqCpEo[cmnc_num_cellUNumMax]; /*均衡需求容量 写入量(数组); */
  20. extern uint32_T blcv_Q_totalCpEi[cmnc_num_cellUNumMax]; /*累计均衡容量 读取量(数组); */
  21. extern uint32_T blcv_Q_totalCpEo[cmnc_num_cellUNumMax]; /*累计均衡容量 写入量(数组); */
  22. extern boolean_T blcv_flg_excute[cmnc_num_cellUNumMax]; /*均衡执行请求标志位 (数组); */
  23. extern boolean_T ihd_flg_HVILFlt; /* 保护板上传的高压互锁故障 */
  24. extern boolean_T ihd_flg_DTCClear; /* 上位机发送的故障清楚指令;*/
  25. extern uint8_T ihd_st_authFaild; /* 底层诊断的认证失败故障;*/
  26. extern int16_T ihd_I_curr; /*电池包电流; */
  27. extern uint8_T ihd_st_chrgConnect; /*充电器连接状态; */
  28. extern uint16_T ihd_P_gas; /*气体浓度 */
  29. extern uint16_T ihd_T_ACPlugT; /*慢充插头温度 +40 */
  30. extern uint16_T ihd_T_DCPlugT; /*快充插头温度+40 */
  31. extern uint16_T ihd_T_bdtemp; /*板子温度 */
  32. extern uint16_T ihd_T_heatPanT1; /*加热板温度1+40 */
  33. extern uint16_T ihd_T_heatPanT2; /*加热板温度2 +40 */
  34. extern uint16_T ihd_T_mosT; /*Mos温度+40 */
  35. extern boolean_T ihd_flg_EESaveFlt; /*EE存储故障 */
  36. extern boolean_T ihd_flg_battULowFlt; /*保护板上传的总压欠压故障; */
  37. extern boolean_T ihd_flg_battUOverFlt; /*保护板上传的总压过压故障; */
  38. extern boolean_T ihd_flg_cellULowFlt; /*保护板上传的单体欠压故障; */
  39. extern boolean_T ihd_flg_cellUOverFlt; /*保护板上传的单体过压故障; */
  40. extern boolean_T ihd_flg_chrgCurrOverFlt; /*保护板上传的充电过流故障; */
  41. extern boolean_T ihd_flg_chrgModTLowFlt; /*保护板上传的充电模组温度过低故障; */
  42. extern boolean_T ihd_flg_chrgModTOverFlt; /*保护板上传的充电模组温度过高故障; */
  43. extern boolean_T ihd_flg_chrgMosClosFlt; /*充电Mos失效 */
  44. extern boolean_T ihd_flg_chrgMosTOverFlt; /*保护板上传的充电Mos温度过高故障; */
  45. extern boolean_T ihd_flg_currOpenFlt; /*保护板上传的电流开路故障 */
  46. extern boolean_T ihd_flg_disChrgCurrOverFlt; /*保护板上传的放电过流故障; */
  47. extern boolean_T ihd_flg_disChrgModTLowFlt; /*保护板上传的放电模组温度过低故障; */
  48. extern boolean_T ihd_flg_disChrgModTOverFlt; /*保护板上传的放电模组温度过高故障; */
  49. extern boolean_T ihd_flg_disChrgMosClosFlt; /*放电Mos失效 */
  50. extern boolean_T ihd_flg_disChrgMosTOverFlt; /*保护板上传的放电Mos温度过高故障; */
  51. extern boolean_T ihd_flg_urtRecFlt; /*内网通讯故障 */
  52. extern uint16_T ihd_pct_soc; /*保护板SOC */
  53. extern uint16_T ihd_pct_soh; /*保护板SOH */
  54. extern uint8_T ihd_st_workStat; /*电池工作状态 */
  55. extern uint16_T ihd_tm_parkTime; /*驻车时间; */
  56. extern uint16_T ihv_T_modT[cmnc_num_modTNumMax]; /*模组温度(数组)+40 */
  57. extern uint16_T ihv_V_cellU[cmnc_num_cellUNumMax]; /*电池单体电压(数组); */
  58. extern boolean_T ihd_st_chrgMosControl;
  59. extern boolean_T ihd_st_disChrgMosControl;
  60. extern boolean_T ihd_st_relayControl;
  61. extern uint8_T ihd_st_heatForceControl;
  62. extern uint8_T ihd_st_EOLState;
  63. extern boolean_T ihd_flg_urtRecFlg;
  64. extern uint8_T ihd_st_reSet;
  65. extern uint8_T ihd_st_heatStat;
  66. extern int16_T sfmd_I_curr; /*处理后整包电流 */
  67. extern uint16_T sfmd_T_modTMax; /*处理后模组温度最小 */
  68. extern uint16_T sfmd_T_modTMin; /*处理后模组温度最大 */
  69. extern uint16_T sfmd_idx_modTMax; /*处理后模组温度最小 */
  70. extern uint16_T sfmd_idx_modTMin; /*处理后模组温度最大 */
  71. extern uint16_T sfmd_V_cellUAvrg; /*处理后单体电压平均 */
  72. extern uint16_T sfmd_V_cellUMax; /*处理后单体电压最大 */
  73. extern uint16_T sfmd_V_cellUMin; /*处理后单体电压最小 */
  74. extern uint16_T sfmd_idx_cellUMin;
  75. extern uint16_T sfmd_idx_cellUMax;
  76. extern boolean_T sfmd_flg_cellUInval; /*单体电压有效标志位 ; 0为有效;1为无效 */
  77. extern boolean_T sfmd_flg_currInval; /*电流有效标志位 ; 0为有效;1为无效 */
  78. extern boolean_T sfmd_flg_modTInval; /*模组温度有效标志位 ; 0为有效;1为无效 */
  79. extern uint16_T sfmd_num_fltNum; /*故障数量 */
  80. extern uint8_T sfmd_st_fltAct; /*故障禁止指令 */
  81. extern uint8_T sfmd_st_fltLevel; /*故障等级 */
  82. extern uint16_T sfmv_T_modT[cmnc_num_modTNumMax]; /*处理后模组温度 */
  83. extern uint16_T sfmv_V_cellU[cmnc_num_cellUNumMax]; /*处理后单体电压 */
  84. extern uint16_T sfmv_idx_fltCode[20]; /*诊断故障码(数组) */
  85. extern uint16_T sfmd_V_battU; /* 处理过后的总电压 */
  86. extern boolean_T sfmd_flg_mainCirClosFltEi; /*主回路常闭故障读取量 */
  87. extern boolean_T sfmd_flg_mainCirClosFltEo; /*主回路常闭故障写入量 */
  88. extern boolean_T sfmd_flg_heatCirClosFltEi; /*加热回路常闭故障读取量 */
  89. extern boolean_T sfmd_flg_heatCirClosFltEo; /*加热回路常闭故障写入量 */
  90. extern boolean_T sfmd_flg_heatCirOpenFltEi; /*加热回路常开故障读取量 */
  91. extern boolean_T sfmd_flg_heatCirOpenFltEo; /*加热回路常开故障写入量 */
  92. extern boolean_T sfmd_flg_heatRunFltEi;
  93. extern boolean_T sfmd_flg_heatRunFltEo;
  94. extern boolean_T sfmd_flg_iscFltEi;
  95. extern boolean_T sfmd_flg_iscFltEo;
  96. extern uint16_T socd_pct_vcuSoc; /*vcuSOC; */
  97. extern uint16_T socd_pct_ahSoc; /*安时SOC; */
  98. extern uint16_T socd_pct_estSoc; /*估算SOC;*/
  99. extern uint16_T socd_flg_EEsave; /*实时存储标志位;*/
  100. extern uint16_T socd_pct_ekfSoc; /*EKFSOC;*/
  101. extern uint16_T socd_pct_battSoc; /*电池真实SOC; */
  102. extern uint16_T socd_pct_battSocEi; /*电池真实SOC 读取量; */
  103. extern uint16_T socd_pct_battSocEo; /*电池真实SOC 写入量; */
  104. extern uint16_T socd_pct_bcuSoc; /*电池显示SOC; */
  105. extern uint16_T socd_pct_bcuSocEi; /*电池显示SOC读取量; */
  106. extern uint16_T socd_pct_bcuSocEo; /*电池显示SOC写入量; */
  107. extern uint16_T socv_pct_cellSoc[cmnc_num_cellUNumMax];
  108. extern uint16_T socd_pct_cellBattSoc;
  109. extern boolean_T socd_flg_cellSocDisable;
  110. extern uint16_T sohd_Q_chrgEi; /*充入容量读取量; */
  111. extern uint16_T sohd_Q_chrgEo; /*充入容量写入量; */
  112. extern boolean_T sohd_flg_chrgEndEi; /*充电结束标志位读取量; */
  113. extern boolean_T sohd_flg_chrgEndEo; /*充电结束标志位写入量; */
  114. extern uint16_T sohd_pct_bcuSoh; /*电池SOH; */
  115. extern uint16_T sohd_tm_chrgStartStatEi; /*充电前静置时间读取量; */
  116. extern uint16_T sohd_tm_chrgStartStatEo; /*充电前静置时间写入量; */
  117. extern uint16_T sohv_Q_cellCap[cmnc_num_cellUNumMax]; /*单体容量 */
  118. extern uint16_T sohv_Q_cellCapArrEi[cmnc_num_cellUNumMax]; /*单体容量(数组) 读取量 */
  119. extern uint16_T sohv_Q_cellCapArrEo[cmnc_num_cellUNumMax]; /*单体容量(数组) 写入量 */
  120. extern uint16_T sohv_Q_packCapArrEi[10]; /*10次整包容量(数组)读取量; */
  121. extern uint16_T sohv_Q_packCapArrEo[10]; /*10次整包容量(数组)写入量; */
  122. extern uint16_T sohv_V_chrgStartStatEi[cmnc_num_cellUNumMax]; /*充电开始时刻的单体电压(数组)读取量; */
  123. extern uint16_T sohv_V_chrgStartStatEo[cmnc_num_cellUNumMax]; /*充电开始时刻的单体电压(数组)写入量; */
  124. extern uint16_T soed_E_nowEng;
  125. extern uint16_T soed_pct_nowStat;
  126. extern uint16_T soed_E_fullEng;
  127. extern uint16_T sopd_P_chrgPMax;
  128. extern uint16_T sopd_P_disChrgPMax;
  129. extern int16_T sopd_I_chrgCurrMax;
  130. extern int16_T sopd_I_disChrgCurrMax;
  131. extern uint16_T sorv_R_cellEi[cmnc_num_cellUNumMax];
  132. extern uint16_T sorv_R_cellEo[cmnc_num_cellUNumMax];
  133. extern uint16_T sorv_R_cell[cmnc_num_cellUNumMax];
  134. extern boolean_T iscd_flg_flt[3];
  135. extern uint16_T iscv_Q_remainCpEi[cmnc_num_cellUNumMax];
  136. extern uint32_T iscd_tm_totalEi;
  137. extern uint16_T iscv_Q_remainCpEo[cmnc_num_cellUNumMax];
  138. extern uint32_T iscd_tm_totalEo;
  139. extern uint8_T tmsd_st_heatAct; /*热管理请求状态; */
  140. extern uint8_T csmd_st_chrgMod; /* 充电模式 */
  141. extern uint8_T csmd_st_chrgSt; /* 充电状态 */
  142. extern int16_T csmd_I_chrgCurrReq; /* 充电需求电流 */
  143. extern uint8_T csmd_idx_chrgEndReason; /* 充电结束原因 */
  144. extern uint16_T cand_idx_cellNr; /*循环发送的单体编号; */
  145. extern uint16_T cand_Q_cellCap; /*循环发送的单体容量; */
  146. extern uint16_T cand_V_chrgStartStat; /*循环发送的充电前单体电压; */
  147. extern uint16_T cand_Q_blcReqCp; /*循环发送的单体需求均衡容量; */
  148. extern uint16_T cand_Q_blcTotalCp; /*循环发送的单体累计均衡容量; */
  149. extern int16_T cdmv_V_deltOCV[cmnc_num_cellUNumMax];
  150. extern int16_T cdmv_R_deltOhm[cmnc_num_cellUNumMax];
  151. extern boolean_T cdmv_flg_inval[cmnc_num_cellUNumMax];
  152. extern uint16_T pimd_V_ocv;
  153. extern uint16_T pimd_R_ohm;
  154. extern uint16_T pimd_R_polar;
  155. extern uint16_T pimd_F_polar;
  156. extern uint16_T pimv_V_cellOcv[cmnc_num_cellUNumMax];
  157. extern uint16_T pimv_R_cellOhm[cmnc_num_cellUNumMax];
  158. extern uint16_T pimd_pct_battSoc;
  159. extern uint16_T pimv_pct_cellSoc[cmnc_num_cellUNumMax];
  160. extern boolean_T pimv_flg_inval[cmnc_num_cellUNumMax];
  161. extern uint16_T test_cellCap[cmnc_num_cellUNumMax];
  162. extern real_T test_U1;
  163. extern real_T test_U[cmnc_num_cellUNumMax];