BatParam.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. import pandas as pd
  2. df_param=pd.DataFrame()
  3. df_param.index=[1, 2, 3, 4, 99, 100] #1:6040,2:4840,3:力信50Ah,4:CATL50Ah,99:6060,100:重卡换电
  4. df_param['CellVoltNums']=[17, 14, 20, 20, 20, 384]
  5. df_param['CellTempNums']=[3, 3, 3, 2, 3, 64]
  6. #定义电池参数
  7. class BatParam:
  8. def __init__(self,celltype):
  9. #公用参数................................................................................................................................................
  10. #热失控参数
  11. self.TrwTempHigh=60
  12. self.TrwTempRate=20
  13. self.TrwTempDiff=15
  14. self.TrwCellVoltDiff=2.5
  15. self.TrwCellVoltFall=1
  16. self.TrwCellVoltLow=1.5
  17. self.TrwPackVoltFall=1.5
  18. #故障诊断参数
  19. self.CellTempUpLmt=119
  20. self.CellTempLwLmt=-39
  21. self.CellTempRate=5
  22. self.temp_time=60
  23. self.volt_time=60
  24. self.SocJump=10
  25. self.SocClamp=0.1
  26. self.SocLow=3
  27. self.SocDiff=20
  28. self.SohLow=70
  29. self.SohDiff=15
  30. #mana-kendall趋势检验参数
  31. self.mk_p=0.001
  32. self.mk_z=-5
  33. self.mk_Tau=-0.7
  34. self.mk_slope=-0.1
  35. self.mk_s=-260
  36. self.mk_svar=1600
  37. self.OcvWeight_Temp=[-30,-20,-10,0,10,20,30,40,50]
  38. self.OcvWeight_StandingTime=[0,500,600,1200,1800,3600,7200,10800]
  39. self.OcvWeight =[[0,0, 0, 0, 0, 0.1,0.3, 1],
  40. [0,0, 0, 0, 0, 0.1,0.3, 1],
  41. [0,0, 0, 0, 0, 0.2,0.5, 1],
  42. [0,0, 0, 0, 0.2, 0.4,0.8, 1],
  43. [0,0, 0, 0.1, 0.3, 0.6,1, 1],
  44. [0,0, 0.1,0.2, 0.5, 0.8,1, 1],
  45. [0,0, 0.1,0.3, 0.6, 1, 1, 1],
  46. [0,0, 0.1,0.3, 0.7, 1, 1, 1],
  47. [0,0, 0.2,0.3, 0.8, 1, 1, 1]]
  48. #采样诊断参数
  49. self.CellMaxUSBTemp=55
  50. self.AllowChgMinTemp=0
  51. self.AllowDsChgTemp=-5
  52. self.AvgVolGap=1
  53. self.AvgCellTempGap=10
  54. self.PackOTlmt=65
  55. self.PackUTlmt=-20
  56. self.OtherOTlmt=91
  57. self.OtherUTlmt=-20
  58. self.FaultCount=100
  59. if celltype==1: #6040
  60. self.Capacity = 41
  61. self.PackFullChrgVolt=69.99
  62. self.CellFullChrgVolt=4.2
  63. self.CellFullChrgCrnt=-15
  64. self.CellVoltNums=17
  65. self.CellTempNums=3
  66. self.OtherTempNums=5
  67. self.FullChrgSoc=98
  68. self.PackCrntDec=1
  69. self.BalCurrent=0.015
  70. self.LookTab_SOC = [0, 3.5348, 8.3581, 13.181, 18.004, 22.827, 27.651, 32.474, 37.297, 42.120, 46.944, 51.767, 56.590, 61.413, 66.237, 71.060, 75.883, 80.707, 85.530, 90.353, 95.176, 100, 105]
  71. self.LookTab_OCV = [3.3159, 3.4384, 3.4774, 3.5156, 3.5478, 3.5748, 3.6058, 3.6238, 3.638, 3.6535, 3.6715, 3.6951, 3.7279, 3.7757, 3.8126, 3.8529, 3.8969, 3.9446, 3.9946, 4.0491, 4.109, 4.183, 4.263]
  72. self.CellOvLv1=4.2
  73. self.CellOvLv2=4.25
  74. self.CellUvLv1=2.8
  75. self.CellUvLv2=2.5
  76. self.CellVoltDiffLv1=0.3
  77. self.CellVoltDiffLv2=0.5
  78. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
  79. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
  80. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
  81. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
  82. self.PackChgOc=-40
  83. self.PackDisOc=200
  84. self.LeakCurrentLv1=-10
  85. self.LeakCurrentLv2=-15
  86. self.LeakCurrentLv3=-50
  87. self.CellTempHighLv1=45
  88. self.CellTempHighLv2=50
  89. self.CellTempLowLv1=-20
  90. self.CellTempLowLv2=-25
  91. self.CellTempDiffLv1=10
  92. self.CellTempDiffLv2=15
  93. # self.TrwVoltRate=-1
  94. self.DifVolGap = 3
  95. self.CellOVlmt=5
  96. self.CellUVlmt=2
  97. self.CantChrgVol=3
  98. self.AvgOtherTempGap=99
  99. elif celltype==2: #4840
  100. self.Capacity = 41
  101. self.PackFullChrgVolt=69.99
  102. self.CellFullChrgVolt=4.2
  103. self.CellFullChrgCrnt=-15
  104. self.CellVoltNums=14
  105. self.CellTempNums=3
  106. self.OtherTempNums=4
  107. self.FullChrgSoc=98
  108. self.PackCrntDec=1
  109. self.BalCurrent=0.015
  110. self.LookTab_SOC = [0, 3.5348, 8.3581, 13.181, 18.004, 22.827, 27.651, 32.474, 37.297, 42.120, 46.944, 51.767, 56.590, 61.413, 66.237, 71.060, 75.883, 80.707, 85.530, 90.353, 95.176, 100, 105]
  111. self.LookTab_OCV = [3.3159, 3.4384, 3.4774, 3.5156, 3.5478, 3.5748, 3.6058, 3.6238, 3.638, 3.6535, 3.6715, 3.6951, 3.7279, 3.7757, 3.8126, 3.8529, 3.8969, 3.9446, 3.9946, 4.0491, 4.109, 4.183, 4.263]
  112. self.CellOvLv1=4.2
  113. self.CellOvLv2=4.25
  114. self.CellUvLv1=2.8
  115. self.CellUvLv2=2.5
  116. self.CellVoltDiffLv1=0.3
  117. self.CellVoltDiffLv2=0.5
  118. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
  119. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
  120. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
  121. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
  122. self.PackChgOc=-40
  123. self.PackDisOc=200
  124. self.LeakCurrentLv1=-10
  125. self.LeakCurrentLv2=-15
  126. self.LeakCurrentLv3=-50
  127. self.CellTempHighLv1=45
  128. self.CellTempHighLv2=50
  129. self.CellTempLowLv1=-20
  130. self.CellTempLowLv2=-25
  131. self.CellTempDiffLv1=10
  132. self.CellTempDiffLv2=15
  133. # self.TrwVoltRate=-1
  134. self.DifVolGap = 3
  135. self.CellOVlmt=5
  136. self.CellUVlmt=2
  137. self.CantChrgVol=3
  138. self.AvgOtherTempGap=99
  139. elif celltype==3: #力信50ah三元电芯
  140. self.Capacity = 51
  141. self.PackFullChrgVolt=80
  142. self.CellFullChrgVolt=4.2
  143. self.CellFullChrgCrnt=-15
  144. self.CellVoltNums=20
  145. self.CellTempNums=3
  146. self.OtherTempNums=4
  147. self.FullChrgSoc=98
  148. self.PackCrntDec=1
  149. self.BalCurrent=0.015
  150. self.LookTab_SOC = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105]
  151. self.LookTab_OCV = [3.357, 3.455, 3.493, 3.540, 3.577, 3.605, 3.622, 3.638, 3.655, 3.677, 3.707, 3.757, 3.815, 3.866, 3.920, 3.976, 4.036, 4.099, 4.166, 4.237, 4.325, 4.415]
  152. self.CellOvLv1=4.2
  153. self.CellOvLv2=4.25
  154. self.CellUvLv1=2.8
  155. self.CellUvLv2=2.5
  156. self.CellVoltDiffLv1=0.3
  157. self.CellVoltDiffLv2=0.5
  158. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
  159. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
  160. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
  161. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
  162. self.PackChgOc=-40
  163. self.PackDisOc=200
  164. self.LeakCurrentLv1=-10
  165. self.LeakCurrentLv2=-15
  166. self.LeakCurrentLv3=-50
  167. self.CellTempHighLv1=45
  168. self.CellTempHighLv2=50
  169. self.CellTempLowLv1=-20
  170. self.CellTempLowLv2=-25
  171. self.CellTempDiffLv1=10
  172. self.CellTempDiffLv2=15
  173. # self.TrwVoltRate=-1
  174. self.DifVolGap = 3
  175. self.CellOVlmt=5
  176. self.CellUVlmt=2
  177. self.CantChrgVol=3
  178. self.AvgOtherTempGap=40
  179. elif celltype==4: #CATL 50ah三元电芯
  180. self.Capacity = 50
  181. self.PackFullChrgVolt=80
  182. self.CellFullChrgVolt=4.2
  183. self.CellFullChrgCrnt=-15
  184. self.CellVoltNums=20
  185. self.CellTempNums=2
  186. self.OtherTempNums=0
  187. self.FullChrgSoc=98
  188. self.PeakSoc=57
  189. self.PackCrntDec=-1
  190. self.BalCurrent=0.015
  191. self.LookTab_SOC = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110]
  192. self.LookTab_OCV = [3.152, 3.397, 3.438, 3.481, 3.523, 3.560, 3.586, 3.604, 3.620, 3.638, 3.661, 3.693, 3.748, 3.803, 3.853, 3.903, 3.953, 4.006, 4.063, 4.121, 4.183, 4.253, 4.50]
  193. self.CellOvLv1=4.2
  194. self.CellOvLv2=4.25
  195. self.CellUvLv1=2.8
  196. self.CellUvLv2=2.5
  197. self.CellVoltDiffLv1=0.3
  198. self.CellVoltDiffLv2=0.5
  199. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
  200. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
  201. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
  202. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
  203. self.PackChgOc=-40
  204. self.PackDisOc=200
  205. self.LeakCurrentLv1=-10
  206. self.LeakCurrentLv2=-15
  207. self.LeakCurrentLv3=-50
  208. self.CellTempHighLv1=45
  209. self.CellTempHighLv2=50
  210. self.CellTempLowLv1=-20
  211. self.CellTempLowLv2=-25
  212. self.CellTempDiffLv1=10
  213. self.CellTempDiffLv2=15
  214. # self.TrwVoltRate=-1
  215. self.DifVolGap = 3
  216. self.CellOVlmt=5
  217. self.CellUVlmt=2
  218. self.CantChrgVol=3
  219. self.AvgOtherTempGap=40
  220. elif celltype==99: #60ah磷酸铁锂电芯
  221. self.Capacity = 54
  222. self.PackFullChrgVolt=69.99
  223. self.CellFullChrgVolt=3.5
  224. self.CellFullChrgCrnt=-20
  225. self.OcvInflexionBelow=3.281
  226. self.OcvInflexion2=3.296
  227. self.OcvInflexion3=3.328
  228. self.OcvInflexionAbove=3.4
  229. self.SocInflexion1=30
  230. self.SocInflexion2=60
  231. self.SocInflexion3=70
  232. self.CellVoltNums=20
  233. self.CellTempNums=3
  234. self.OtherTempNums=5
  235. self.FullChrgSoc=98
  236. self.PeakSoc=59
  237. self.PeakVoltLowLmt=3.35
  238. self.PeakVoltUpLmt=3.4
  239. self.PeakCellVolt=[3.362,3.363,3.365,3.366,3.367]
  240. self.PackCrntDec=1
  241. self.BalCurrent=0.015
  242. self.LookTab_SOC = [0.00, 2.40, 6.38, 10.37, 14.35, 18.33, 22.32, 26.30, 30.28, 35.26, 40.24, 45.22, 50.20, 54.19, 58.17, 60.16, 65.14, 70.12, 75.10, 80.08, 84.06, 88.05, 92.03, 96.02, 100.00, 105]
  243. self.LookTab_OCV = [2.7151, 3.0298, 3.1935, 3.2009, 3.2167, 3.2393, 3.2561, 3.2703, 3.2843, 3.2871, 3.2874, 3.2868, 3.2896, 3.2917, 3.2967, 3.3128, 3.3283, 3.3286, 3.3287, 3.3288, 3.3289, 3.3296, 3.3302, 3.3314, 3.3429, 3.6]
  244. self.CellOvLv1=3.68
  245. self.CellOvLv2=3.7
  246. self.CellUvLv1=2.1
  247. self.CellUvLv2=2
  248. self.CellVoltDiffLv1=0.6
  249. self.CellVoltDiffLv2=1
  250. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
  251. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
  252. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
  253. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
  254. self.PackChgOc=-60
  255. self.PackDisOc=200
  256. self.LeakCurrentLv1=-20
  257. self.LeakCurrentLv2=-30
  258. self.LeakCurrentLv3=-100
  259. self.CellTempHighLv1=45
  260. self.CellTempHighLv2=50
  261. self.CellTempLowLv1=-20
  262. self.CellTempLowLv2=-25
  263. self.CellTempDiffLv1=10
  264. self.CellTempDiffLv2=15
  265. # self.TrwVoltRate=-8
  266. self.mk_slope=-0.8
  267. self.DifVolGap = 3
  268. self.CellOVlmt=4
  269. self.CellUVlmt=2
  270. self.CantChrgVol=2.6
  271. self.AvgOtherTempGap=99
  272. elif celltype==100:
  273. self.Capacity = 228*2
  274. self.PackFullChrgVolt=3.65*192
  275. self.CellFullChrgVolt=3.5
  276. self.OcvInflexionBelow=3.285
  277. self.OcvInflexion2=3.296
  278. self.OcvInflexion3=3.328
  279. self.OcvInflexionAbove=3.4
  280. self.CellVoltNums=384
  281. self.CellTempNums=64
  282. self.OtherTempNums=0
  283. self.FullChrgSoc=98
  284. self.PeakSoc=59
  285. self.PeakVoltLowLmt=3.35
  286. self.PeakVoltUpLmt=3.4
  287. self.PeakCellVolt=[3.362,3.363,3.365,3.366,3.367]
  288. self.PackCrntDec=1
  289. self.BalCurrent=0.015
  290. self.LookTab_SOC = [0.00, 2.40, 6.38, 10.37, 14.35, 18.33, 22.32, 26.30, 30.28, 35.26, 40.24, 45.22, 50.20, 54.19, 58.17, 60.16, 65.14, 70.12, 75.10, 80.08, 84.06, 88.05, 92.03, 96.02, 100.00]
  291. self.LookTab_OCV = [2.7151, 3.0298, 3.1935, 3.2009, 3.2167, 3.2393, 3.2561, 3.2703, 3.2843, 3.2871, 3.2874, 3.2868, 3.2896, 3.2917, 3.2967, 3.3128, 3.3283, 3.3286, 3.3287, 3.3288, 3.3289, 3.3296, 3.3302, 3.3314, 3.3429]
  292. self.CellOvLv1=3.75
  293. self.CellOvLv2=3.8
  294. self.CellUvLv1=2.3
  295. self.CellUvLv2=2.2
  296. self.CellVoltDiffLv1=0.6
  297. self.CellVoltDiffLv2=1
  298. self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums/2
  299. self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums/2
  300. self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums/2
  301. self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums/2
  302. self.PackChgOc=-800
  303. self.PackDisOc=800
  304. self.LeakCurrentLv1=-20
  305. self.LeakCurrentLv2=-50
  306. self.LeakCurrentLv3=-100
  307. self.CellTempHighLv1=65
  308. self.CellTempHighLv2=67
  309. self.CellTempLowLv1=-30
  310. self.CellTempLowLv2=-35
  311. self.CellTempDiffLv1=28
  312. self.CellTempDiffLv2=32
  313. # self.TrwVoltRate=-8
  314. self.mk_slope=-0.3
  315. self.DifVolGap = 3
  316. self.CellOVlmt=4
  317. self.CellUVlmt=2
  318. self.CantChrgVol=2.6
  319. self.AvgOtherTempGap=40
  320. else:
  321. print('未找到对应电池编号!!!')
  322. # sys.exit()