NCR18650B Lithium Cell Model

P. McGill
15Oct13

Import data from the load test.

data3p3=Import["/Users/mcgill/Documents/My\ Projects/Lithium\ Battery\ Safety/Test\ Data/NCR18650B/3300mA/NCR18650B_3300mA.xls"];

Vbat=Drop[data3p3[[1,All,3]],1];

Length[Vbat]

ListPlot[Vbat,PlotRange->{{0,12500},{2.5,4.5}},GridLines->{Range[0,12000,1000],Range[2.5,4.5,0.5]},Frame->True,FrameStyle->Directive[18],FrameLabel->{Style["Time (secs)",FontSize->18],Style["Cell Voltage (V)",FontSize->18]},PlotLabel->Style["NCR18650B Discharge\r6 min at 3.3 A, 15 min rest",FontSize->24],PlotStyle->Red]

Extract just the first pulse, keeping 100 sec before the load was applied and lasting a total of 1000 sec.

Vbatp1=Vbat[[800;;1799]];

ListPlot[Vbatp1,PlotRange->{{0,1000},{3.7,4.2}},GridLines->{Range[0,1300,200],Range[3.7,4.2,0.1]},Frame->True,FrameStyle->Directive[18],FrameLabel->{Style["Time (secs)",FontSize->18],Style["Cell Voltage (V)",FontSize->18]},PlotLabel->Style["NCR18650B Discharge\r6 min at 3.3 A, 15 min rest",FontSize->24],PlotStyle->Red]

Now model the cell internals that cause the voltage to drop under load. Use the following RC network according to Chen, M., and G.A. Rincon-Mora. “Accurate Electrical Battery Model Capable of Predicting Runtime and I–V Performance.” IEEE Transactions on Energy Conversion 21.2 (2006): 504-11.

Write the transfer function of the circuit that models the complex impedance of the cell.

tf=(Rser+(Rfast/((Rfast s Cfast)+1))+(Rslow/((Rslow s Cslow)+1)))

Convert the tf into a transfer function model.

tfm=TransferFunctionModel[{{tf}},s]

Convert the continuous-time transfer function model into discrete-time model.

dtm=ToDiscreteTimeModel[tfm,1,z]

Model the cell’s open-circuit voltage, using the first and last sample of the load test data.

Vocp1=Table[Piecewise[{{Vbatp1[[1]],t<100},{Vbatp1[[1]]-((Vbatp1[[1]]-Vbatp1[[1000]])/359) (t-100),100≤t≤458},{Vbatp1[[1000]],t>458}}],{t,0,999}];

ListPlot[Vocp1]

Model the current pulse applied to the cell.

Ibatp1=Table[Piecewise[{{0,t<100},{3.3,100≤t≤458},{0,t>458}}],{t,0,999}];

ListPlot[Ibatp1]

Generate the output of the impedance model, given some sample component values.

vals={Rser->0.05,Rfast->0.05,Cfast->500,Rslow->0.05,Cslow->8000}

Vsagp1=Flatten[OutputResponse[dtm/.vals,Ibatp1k]];

ListPlot[Vocp1-Vsagp1]

Make a plot with component values that we can manipulate interactively.

Manipulate[ListPlot[{If[Measured,Vbatp1],Vocp1-Flatten[OutputResponse[dtm/.{Rser->a,Rfast->b,Cfast->c,Rslow->d,Cslow->e},Ibatp1k]
]},PlotRange->{{0,1000},{3.7,4.2}},GridLines->Automatic
],{{a,0.05,"Rser"},0,0.1},{{b,0.05,"Rfast"},0,0.1},{{c,5000,"Cfast"},0,10000},{{d,0.05,"Rslow"},0,0.1},{{e,50000,"Cslow"},0,100000},{{Measured,False},{True,False}}]

No combination of component values produces the desired output, so modify the open-circuit voltage during and after the current pulse.

Vocp1s=Table[Piecewise[{{Vbatp1[[1]],t<100},{Vbatp1[[1]]-((Vbatp1[[1]]-Vbatp1[[1000]]-0.05)/359) (t-100),100≤t≤458},{Vbatp1[[1000]]-(0.033  (E^(-(((t-458)/150))))),t>458}}],{t,0,999}];

ListPlot[Vocp1s]

Manipulate[ListPlot[{If[Measured,Vbatp1],Vocp1s-Flatten[OutputResponse[dtm/.{Rser->a,Rfast->b,Cfast->c,Rslow->d,Cslow->e},Ibatp1k]
]},PlotRange->{{0,1000},{3.7,4.2}},GridLines->Automatic
],{{a,0.085,"Rser"},0,0.1},{{b,0.05,"Rfast"},0,0.1},{{c,2500,"Cfast"},0,5000},{{d,0.05,"Rslow"},0,0.1},{{e,5000,"Cslow"},0,10000},{{Measured,False},{True,False}}]

Write an objective function that measures the difference between the model output and the measured output.

objf[{Rse_?NumericQ,Rfa_?NumericQ,Cfa_?NumericQ,Rsl_?NumericQ,Csl_?NumericQ}]:=Module[{modResp,error},
modResp=Flatten[OutputResponse[dtm/.{Rser->Rse,Rfast->Rfa,Cfast->Cfa,Rslow->Rsl,Cslow->Csl},Ibatp1]];
error=ManhattanDistance[Vocp1s-modResp,Vbatp1]
];

sol=Timing[NMinimize[{objf[{Rser,Rfast,Cfast,Rslow,Cslow}],0.01<Rser<0.1,0.01<Rfast<0.1,0.01<Cfast<1000,0.01<Rslow<0.1,1000<Cslow<10000},{Rser,Rfast,Cfast,Rslow,Cslow},Method->"DifferentialEvolution"]]

ListPlot[{Vocp1s-Flatten[OutputResponse[dtm/.sol[[2,2]],Ibatp1k]],Vbatp1},PlotRange->{3.7,4.2},GridLines->Automatic]