123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- import pandas as pd
- df_param=pd.DataFrame()
- df_param.index=[1, 2, 3, 4, 99, 100] #1:6040,2:4840,3:力信50Ah,4:CATL50Ah,99:6060,100:重卡换电
- df_param['CellVoltNums']=[17, 14, 20, 20, 20, 384]
- df_param['CellTempNums']=[3, 3, 3, 2, 3, 64]
- #定义电池参数
- class BatParam:
- def __init__(self,celltype):
- #公用参数................................................................................................................................................
- #热失控参数
- self.TrwTempHigh=60
- self.TrwTempRate=20
- self.TrwTempDiff=15
- self.TrwCellVoltDiff=2.5
- self.TrwCellVoltFall=1
- self.TrwCellVoltLow=1.5
- self.TrwPackVoltFall=1.5
-
- #故障诊断参数
- self.CellTempUpLmt=119
- self.CellTempLwLmt=-39
- self.CellTempRate=5
- self.temp_time=60
- self.volt_time=60
- self.SocJump=10
- self.SocClamp=0.1
- self.SocLow=3
- self.SocDiff=20
- self.SohLow=70
- self.SohDiff=15
- #mana-kendall趋势检验参数
- self.mk_p=0.001
- self.mk_z=-5
- self.mk_Tau=-0.7
- self.mk_slope=-0.1
- self.mk_s=-260
- self.mk_svar=1600
- self.OcvWeight_Temp=[-30,-20,-10,0,10,20,30,40,50]
- self.OcvWeight_StandingTime=[0,500,600,1200,1800,3600,7200,10800]
- self.OcvWeight =[[0,0, 0, 0, 0, 0.1,0.3, 1],
- [0,0, 0, 0, 0, 0.1,0.3, 1],
- [0,0, 0, 0, 0, 0.2,0.5, 1],
- [0,0, 0, 0, 0.2, 0.4,0.8, 1],
- [0,0, 0, 0.1, 0.3, 0.6,1, 1],
- [0,0, 0.1,0.2, 0.5, 0.8,1, 1],
- [0,0, 0.1,0.3, 0.6, 1, 1, 1],
- [0,0, 0.1,0.3, 0.7, 1, 1, 1],
- [0,0, 0.2,0.3, 0.8, 1, 1, 1]]
- #采样诊断参数
- self.CellMaxUSBTemp=55
- self.AllowChgMinTemp=0
- self.AllowDsChgTemp=-5
- self.AvgVolGap=1
- self.AvgCellTempGap=10
- self.PackOTlmt=65
- self.PackUTlmt=-20
- self.OtherOTlmt=91
- self.OtherUTlmt=-20
- self.FaultCount=100
-
- if celltype==1: #6040
- self.Capacity = 41
- self.PackFullChrgVolt=69.99
- self.CellFullChrgVolt=4.2
- self.CellFullChrgCrnt=-15
- self.CellVoltNums=17
- self.CellTempNums=3
- self.OtherTempNums=5
- self.FullChrgSoc=98
- self.PackCrntDec=1
- self.BalCurrent=0.015
- 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]
- 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]
- self.CellOvLv1=4.2
- self.CellOvLv2=4.25
- self.CellUvLv1=2.8
- self.CellUvLv2=2.5
- self.CellVoltDiffLv1=0.3
- self.CellVoltDiffLv2=0.5
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
- self.PackChgOc=-40
- self.PackDisOc=200
- self.LeakCurrentLv1=-10
- self.LeakCurrentLv2=-15
- self.LeakCurrentLv3=-50
- self.CellTempHighLv1=45
- self.CellTempHighLv2=50
- self.CellTempLowLv1=-20
- self.CellTempLowLv2=-25
- self.CellTempDiffLv1=10
- self.CellTempDiffLv2=15
- # self.TrwVoltRate=-1
-
- self.DifVolGap = 3
- self.CellOVlmt=5
- self.CellUVlmt=2
- self.CantChrgVol=3
- self.AvgOtherTempGap=99
- elif celltype==2: #4840
- self.Capacity = 41
- self.PackFullChrgVolt=69.99
- self.CellFullChrgVolt=4.2
- self.CellFullChrgCrnt=-15
- self.CellVoltNums=14
- self.CellTempNums=3
- self.OtherTempNums=4
- self.FullChrgSoc=98
- self.PackCrntDec=1
- self.BalCurrent=0.015
- 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]
- 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]
- self.CellOvLv1=4.2
- self.CellOvLv2=4.25
- self.CellUvLv1=2.8
- self.CellUvLv2=2.5
- self.CellVoltDiffLv1=0.3
- self.CellVoltDiffLv2=0.5
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
- self.PackChgOc=-40
- self.PackDisOc=200
- self.LeakCurrentLv1=-10
- self.LeakCurrentLv2=-15
- self.LeakCurrentLv3=-50
- self.CellTempHighLv1=45
- self.CellTempHighLv2=50
- self.CellTempLowLv1=-20
- self.CellTempLowLv2=-25
- self.CellTempDiffLv1=10
- self.CellTempDiffLv2=15
- # self.TrwVoltRate=-1
-
- self.DifVolGap = 3
- self.CellOVlmt=5
- self.CellUVlmt=2
- self.CantChrgVol=3
- self.AvgOtherTempGap=99
- elif celltype==3: #力信50ah三元电芯
- self.Capacity = 51
- self.PackFullChrgVolt=80
- self.CellFullChrgVolt=4.2
- self.CellFullChrgCrnt=-15
- self.CellVoltNums=20
- self.CellTempNums=3
- self.OtherTempNums=4
- self.FullChrgSoc=98
- self.PackCrntDec=1
- self.BalCurrent=0.015
- 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]
- 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]
- self.CellOvLv1=4.2
- self.CellOvLv2=4.25
- self.CellUvLv1=2.8
- self.CellUvLv2=2.5
- self.CellVoltDiffLv1=0.3
- self.CellVoltDiffLv2=0.5
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
- self.PackChgOc=-40
- self.PackDisOc=200
- self.LeakCurrentLv1=-10
- self.LeakCurrentLv2=-15
- self.LeakCurrentLv3=-50
- self.CellTempHighLv1=45
- self.CellTempHighLv2=50
- self.CellTempLowLv1=-20
- self.CellTempLowLv2=-25
- self.CellTempDiffLv1=10
- self.CellTempDiffLv2=15
- # self.TrwVoltRate=-1
-
- self.DifVolGap = 3
- self.CellOVlmt=5
- self.CellUVlmt=2
- self.CantChrgVol=3
- self.AvgOtherTempGap=40
- elif celltype==4: #CATL 50ah三元电芯
- self.Capacity = 50
- self.PackFullChrgVolt=80
- self.CellFullChrgVolt=4.2
- self.CellFullChrgCrnt=-15
- self.CellVoltNums=20
- self.CellTempNums=2
- self.OtherTempNums=0
- self.FullChrgSoc=98
- self.PeakSoc=57
- self.PackCrntDec=-1
- self.BalCurrent=0.015
- 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]
- 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]
- self.CellOvLv1=4.2
- self.CellOvLv2=4.25
- self.CellUvLv1=2.8
- self.CellUvLv2=2.5
- self.CellVoltDiffLv1=0.3
- self.CellVoltDiffLv2=0.5
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
- self.PackChgOc=-40
- self.PackDisOc=200
- self.LeakCurrentLv1=-10
- self.LeakCurrentLv2=-15
- self.LeakCurrentLv3=-50
- self.CellTempHighLv1=45
- self.CellTempHighLv2=50
- self.CellTempLowLv1=-20
- self.CellTempLowLv2=-25
- self.CellTempDiffLv1=10
- self.CellTempDiffLv2=15
- # self.TrwVoltRate=-1
-
- self.DifVolGap = 3
- self.CellOVlmt=5
- self.CellUVlmt=2
- self.CantChrgVol=3
- self.AvgOtherTempGap=40
- elif celltype==99: #60ah磷酸铁锂电芯
- self.Capacity = 54
- self.PackFullChrgVolt=69.99
- self.CellFullChrgVolt=3.5
- self.CellFullChrgCrnt=-20
- self.OcvInflexionBelow=3.281
- self.OcvInflexion2=3.296
- self.OcvInflexion3=3.328
- self.OcvInflexionAbove=3.4
- self.SocInflexion1=30
- self.SocInflexion2=60
- self.SocInflexion3=70
- self.CellVoltNums=20
- self.CellTempNums=3
- self.OtherTempNums=5
- self.FullChrgSoc=98
- self.PeakSoc=59
- self.PeakVoltLowLmt=3.35
- self.PeakVoltUpLmt=3.4
- self.PeakCellVolt=[3.362,3.363,3.365,3.366,3.367]
- self.PackCrntDec=1
- self.BalCurrent=0.015
- 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]
- 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]
- self.CellOvLv1=3.68
- self.CellOvLv2=3.7
- self.CellUvLv1=2.1
- self.CellUvLv2=2
- self.CellVoltDiffLv1=0.6
- self.CellVoltDiffLv2=1
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums
- self.PackChgOc=-60
- self.PackDisOc=200
- self.LeakCurrentLv1=-20
- self.LeakCurrentLv2=-30
- self.LeakCurrentLv3=-100
- self.CellTempHighLv1=45
- self.CellTempHighLv2=50
- self.CellTempLowLv1=-20
- self.CellTempLowLv2=-25
- self.CellTempDiffLv1=10
- self.CellTempDiffLv2=15
- # self.TrwVoltRate=-8
- self.mk_slope=-0.8
-
-
- self.DifVolGap = 3
- self.CellOVlmt=4
- self.CellUVlmt=2
- self.CantChrgVol=2.6
- self.AvgOtherTempGap=99
- elif celltype==100:
- self.Capacity = 228*2
- self.PackFullChrgVolt=3.65*192
- self.CellFullChrgVolt=3.5
- self.OcvInflexionBelow=3.285
- self.OcvInflexion2=3.296
- self.OcvInflexion3=3.328
- self.OcvInflexionAbove=3.4
- self.CellVoltNums=384
- self.CellTempNums=64
- self.OtherTempNums=0
- self.FullChrgSoc=98
- self.PeakSoc=59
- self.PeakVoltLowLmt=3.35
- self.PeakVoltUpLmt=3.4
- self.PeakCellVolt=[3.362,3.363,3.365,3.366,3.367]
- self.PackCrntDec=1
- self.BalCurrent=0.015
- 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]
- 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]
-
- self.CellOvLv1=3.75
- self.CellOvLv2=3.8
-
- self.CellUvLv1=2.3
- self.CellUvLv2=2.2
- self.CellVoltDiffLv1=0.6
- self.CellVoltDiffLv2=1
- self.PackVoltOvLv1=self.CellOvLv1*self.CellVoltNums/2
- self.PackVoltOvLv2=self.CellOvLv2*self.CellVoltNums/2
- self.PackVoltUvLv1=self.CellUvLv1*self.CellVoltNums/2
- self.PackVoltUvLv2=self.CellUvLv2*self.CellVoltNums/2
- self.PackChgOc=-800
- self.PackDisOc=800
- self.LeakCurrentLv1=-20
- self.LeakCurrentLv2=-50
- self.LeakCurrentLv3=-100
- self.CellTempHighLv1=65
- self.CellTempHighLv2=67
- self.CellTempLowLv1=-30
- self.CellTempLowLv2=-35
- self.CellTempDiffLv1=28
- self.CellTempDiffLv2=32
- # self.TrwVoltRate=-8
- self.mk_slope=-0.3
-
-
- self.DifVolGap = 3
- self.CellOVlmt=4
- self.CellUVlmt=2
- self.CantChrgVol=2.6
- self.AvgOtherTempGap=40
-
- else:
- print('未找到对应电池编号!!!')
- # sys.exit()
|