#定义电池参数 class BatParam: def __init__(self,celltype): #公用参数................................................................................................................................................ #热失控参数 self.TrwTempHigh=60 self.TrwTempRate=3 self.TrwTempDiff=15 self.TrwCellVoltDiff=2.5 self.TrwCellVoltFall=0.5 self.TrwCellVoltLow=1.5 self.TrwPackVoltFall=1.5 #故障诊断参数 self.temp_time=10 self.volt_time=10 self.SocJump=10 self.SocClamp=0.1 self.SocLow=3 self.SocDiff=20 self.SohLow=65 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]] if celltype==1: #永联+康普顿21700 self.Capacity = 4*2 self.PackFullChrgVolt=69.99 self.CellFullChrgVolt=4.2 self.CellFullChrgCrnt=-4 self.CellVoltNums=120 self.CellTempNums=40 self.FullChrgSoc=90 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] self.LookTab_OCV = [2.8497, 3.0924, 3.2868, 3.4117, 3.4461, 3.5032, 3.5602, 3.6049, 3.6368, 3.6709, 3.7121, 3.7593, 3.8237, 3.8755, 3.9093, 3.9518, 4.0119, 4.0615, 4.077, 4.0969, 4.1821] 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.CellTempUpLmt=119 self.CellTempLwLmt=-39 self.CellTempHighLv1=45 self.CellTempHighLv2=50 self.CellTempLowLv1=0 self.CellTempLowLv2=-5 self.CellTempDiffLv1=10 self.CellTempDiffLv2=15 self.CellTempRate=5 self.PackChgOc=-40 self.PackDisOc=200 self.LeakCurrentLv1=-10 self.LeakCurrentLv2=-15 self.LeakCurrentLv3=-50 self.TrwVoltRate=-1 elif celltype==2: #中恒+华庭18650 self.Capacity = 2*9 self.CellVoltNums= 68 self.CellTempNums= 40 self.CellFullChrgVolt=4.2 self.CellFullChrgCrnt=-self.Capacity/2 self.FullChrgSoc=100 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] self.LookTab_OCV = [2.929, 3.2902, 3.3888, 3.425, 3.4846, 3.5382, 3.577, 3.6083, 3.638, 3.6786, 3.7127, 3.7596, 3.7853, 3.8371, 3.9081, 3.9127, 4.0097, 4.0314, 4.0463, 4.0969, 4.174] self.CellOvLv1=4.04 self.CellOvLv2=4.05 self.CellUvLv1=2.99 self.CellUvLv2=2.950 self.CellVoltDiffLv1=0.35 self.CellVoltDiffLv2=0.4 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.CellTempUpLmt=119 self.CellTempLwLmt=-39 self.CellTempHighLv1=45 self.CellTempHighLv2=50 self.CellTempLowLv1=0 self.CellTempLowLv2=-5 self.CellTempDiffLv1=10 self.CellTempDiffLv2=15 self.CellTempRate=5 self.PackChgOc=-45 self.PackDisOc=200 self.LeakCurrentLv1=-10 self.LeakCurrentLv2=-15 self.LeakCurrentLv3=-50 self.TrwVoltRate=-1 elif celltype==99: #永联+力神 self.Capacity = 40 self.CellVoltNums=72 self.CellTempNums=32 self.CellFullChrgVolt=3.55 self.CellFullChrgCrnt=-self.Capacity/2 self.OcvInflexionBelow=3.281 self.OcvInflexion2=3.303 self.OcvInflexion3=3.343 self.OcvInflexionAbove=3.36 self.SocInflexion1=30 self.SocInflexion2=60 self.SocInflexion3=70 self.FullChrgSoc=100 self.PeakSoc=62.5 self.PeakVoltLowLmt=3.35 self.PeakVoltUpLmt=3.42 self.PeakCellVolt=[3.384,3.385,3.386,3.387,3.388] self.PackCrntDec=1 self.BalCurrent=0.015 self.LookTab_SOC = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 75, 80, 85, 90, 95, 96, 97, 98, 99, 100] self.LookTab_OCV = [2.6748, 3.2020, 3.2170, 3.2430, 3.2600, 3.2770, 3.2880, 3.2890, 3.2900, 3.2910, 3.2911, 3.2970, 3.3030, 3.3080, 3.3200, 3.3270, 3.3290, 3.3300, 3.3301, 3.3310, 3.3311, 3.3312, 3.3313, 3.3314, 3.3315, 3.3316, 3.3320, 3.3330, 3.3340, 3.3350, 3.3360, 3.3580, 3.3640] self.LookTab_OCVChg=[2.6460, 3.1570, 3.2220, 3.2450,3.2760, 3.2970, 3.3060, 3.3070, 3.3080, 3.3090, 3.3110, 3.3140, 3.3220, 3.3270, 3.3330, 3.3380, 3.3420, 3.3421, 3.3422, 3.3423, 3.3424, 3.3431, 3.3432, 3.3433, 3.3434, 3.3441, 3.3442, 3.3443, 3.3444, 3.3445, 3.3446, 3.3447, 3.3640] self.CellOvLv1=3.65 self.CellOvLv2=3.7 self.CellUvLv1=2.7 self.CellUvLv2=2.6 self.CellVoltDiffLv1=0.6 self.CellVoltDiffLv2=1.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.CellTempUpLmt=119 self.CellTempLwLmt=-39 self.CellTempHighLv1=45 self.CellTempHighLv2=50 self.CellTempLowLv1=0 self.CellTempLowLv2=-5 self.CellTempDiffLv1=15 self.CellTempDiffLv2=20 self.CellTempRate=5 self.PackChgOc=-160 self.PackDisOc=180 self.LeakCurrentLv1=-20 self.LeakCurrentLv2=-30 self.LeakCurrentLv3=-100 self.TrwVoltRate=-8 self.mk_slope=-0.8 else: print('未找到对应电池编号!!!') # sys.exit()