## Generate Parameter Data for Equivalent Circuit Battery Block

Using MathWorks® tools, estimation techniques, and measured lithium-ion or lead acid battery data, you can generate parameters for the Equivalent Circuit Battery block. The Equivalent Circuit Battery block implements a resistor-capacitor (RC) circuit battery with open circuit voltage, series resistance, and 1 through N RC pairs. The number of RC pairs reflects the number of time constants that characterize the battery transients. Typically, the number of RC pairs ranges from 1 through 5.

To create parameter data for the Equivalent Circuit Battery block, follow these workflow steps. The steps use numerical optimization techniques to determine the number of recommended RC pairs, provide initial estimates for the battery model circuit parameters, and estimate parameters to fit a model to experimental pulse discharge data. The results provide the open circuit voltage, series resistance, and RC pair parameter data for the Equivalent Circuit Battery block.

The workflow steps use this example script and models for a lithium-ion polymer (LiPo) battery:

• Estimate battery discharge script `Example_DischargePulseEstimation`.

• Model `BatteryEstim3RC_PTBS`.

• Model `BatteryEstim3RC_PTBS_EQ`.

The example battery discharge script uses a battery class to control the parameter estimation workflow.

Step 1: Load and Preprocess Data

Load and preprocess time series battery discharge voltage and current data.

None
Step 2: Determine the Number of RC Pairs

Determine the number of necessary time constants (TC) for estimation.

Curve Fitting Toolbox™
Step 3: Estimate Parameters

For battery discharge data, estimate and optimize:

• Open-circuit voltage, Em

• Series resistance, R0

• RC pair(s) time constant(s), Tau

• RC pair(s) resistance(s), Rx

Use a model that exercises the Estimation Equivalent Circuit Battery block.

Curve Fitting Toolbox, Parallel Computing Toolbox™, Optimization Toolbox™, and Simulink® Design Optimization™
Step 4: Set Equivalent Circuit Battery Block Parameters

Set these block parameters:

• Open circuit voltage table data

• Series resistance table data

• State of charge breakpoints

• Temperature breakpoints

• Battery capacity table

• Network resistance table data

• Network capacitance table data

None

### Step 1: Load and Preprocess Data

#### Data Format and Requirements

The workflow supports pulse discharge sequences from 100% to 0% state-of-charge (SOC).

Data requirements include:

• Time series consisting of current and voltage from an experimental pulse discharge. For each experimental data set, the temperature is constant. The sample rate should be a minimum of 1 Hz, with an ideal rate at 10 Hz. This table summarizes the accuracy requirements.

MeasurementAccuracyIdeal
Voltage±5 mV±1 mV
Current±100 mA±10 mA
Temperature±1 °C±1 °C

• Change in SOC for each pulse should not be greater than 5%.

• Data collection at high or low SOC might need modification to ensure safety.

• Sufficient relaxation time after each pulse to ensure battery approaches steady-state voltage.

Load the battery time, voltage, and discharge data. Break up the data into `Battery.Pulse` objects. For example, load and preprocess the discharge data for a lithium-ion polymer (LiPo) battery using the `Step1: Load and Preprocess Data` commands in the `Example_DischargePulseEstimation` script.

Pulse Sequence Pulse Identification ### Step 2: Determine the Number of RC Pairs

Determine how many RC pairs to use in the model. You can investigate how many RC pairs to use by executing the ```Step 2: Determine the Number of RC Pairs``` commands in the `Example_DischargePulseEstimation` script. The example script uses the `BatteryEstim3RC_PTBS` model.

#### Compare Pulse Time Constants

Compare the time constants (TC) for each pulse. This example compares three pulses.

TC Comparison, Pulse 3 of 3 ### Step 3: Estimate Parameters

Estimate the parameters. You can investigate parameter estimation by executing the `Step 3: Estimate Parameters` commands in the `Example_DischargePulseEstimation` script.

#### Estimate Em and R0

Inspect the voltage immediately before and after the current is applied and removed at the start and end of each pulse. The estimation technique uses the voltage for a raw calculation to estimate the open-circuit voltage (Em) and the series resistance (R0).

Parameter Tables #### Estimate Tau

Use a curve-fitting technique on the pulse relaxation to estimate the RC time constant (Tau) at each SOC.

Relaxation Tau Fit #### Plot Estimates

Plot the parameter and pulse sequence data and simulation comparison.

Parameter Tables Pulse Sequence #### Identify Parameters and Set Initial Values

Identify parameters and set the initial values using a linear system approach, pulse-by-pulse.

Linear Fit #### Optimize Estimates

Optimize the Em, R0, Rx, and Tau estimates using Simulink Design Optimization.

Pulse Identification ### Step 4: Set Equivalent Circuit Battery Block Parameters

Set the Equivalent Circuit Battery block parameters to the values determined in step 3. To investigate setting the block parameters, execute the ```Step 4: Set Equivalent Circuit Battery Block Parameters``` commands in the `Example_DischargePulseEstimation` script. The experiment ran at two constant temperatures. There are three RC-pairs. The Equivalent Circuit Battery block parameter values are summarized in this table:

ParameterExample Value

Number of series RC pairs

`3`

Open circuit voltage table data, EM

`EmPrime = repmat(Em,2,1)';`

Series resistance table data, R0

`R0Prime = repmat(R0,2,1)';`

State of charge breakpoints, SOC_BP

`SOC_LUTPrime = SOC_LUT;`

Temperature breakpoints, Temperature_BP

`TempPrime = [303 315.15];`

Battery capacity table

`CapacityAhPrime = [CapacityAh CapacityAh];`

Network resistance table data, R1

`R1Prime = repmat(Rx(1,:),2,1)';`

Network capacitance table data, C1

`C1Prime = repmat(Tx(1,:)./Rx(1,:),2,1)';`

Network resistance table data, R2

`R2Prime = repmat(Rx(2,:),2,1)';`

Network capacitance table data, C2

`C2Prime = repmat(Tx(2,:)./Rx(2,:),2,1)';`

Network resistance table data, R3

`R3Prime = repmat(Rx(3,:),2,1)';`

Network capacitance table data, C3

`C3Prime = repmat(Tx(3,:)./Rx(3,:),2,1)';`

 Ahmed, R., J. Gazzarri, R. Jackey, S. Onori, S. Habibi, et al. "Model-Based Parameter Identification of Healthy and Aged Li-ion Batteries for Electric Vehicle Applications." SAE International Journal of Alternative Powertrains. doi:10.4271/2015-01-0252, 4(2):2015.

 Gazzarri, J., N. Shrivastava, R. Jackey, and C. Borghesani. "Battery Pack Modeling, Simulation, and Deployment on a Multicore Real Time Target." SAE International Journal of Aerospace. doi:10.4271/2014-01-2217, 7(2):2014.

 Huria, T., M. Ceraolo, J. Gazzarri, and R. Jackey. "High fidelity electrical model with thermal dependence for characterization and simulation of high power lithium battery cells." IEEE® International Electric Vehicle Conference. March 2012, pp. 1–8.

 Huria, T., M. Ceraolo, J. Gazzarri, and R. Jackey. "Simplified Extended Kalman Filter Observer for SOC Estimation of Commercial Power-Oriented LFP Lithium Battery Cells." SAE Technical Paper 2013-01-1544. doi:10.4271/2013-01-1544, 2013.

 Jackey, R. "A Simple, Effective Lead-Acid Battery Modeling Process for Electrical System Component Selection." SAE Technical Paper 2007-01-0778. doi:10.4271/2007-01-0778, 2007.

 Jackey, R., G. Plett, and M. Klein. "Parameterization of a Battery Simulation Model Using Numerical Optimization Methods." SAE Technical Paper 2009-01-1381. doi:10.4271/2009-01-1381, 2009.

 Jackey, R., M. Saginaw, T. Huria, M. Ceraolo, P. Sanghvi, and J. Gazzarri. "Battery Model Parameter Estimation Using a Layered Technique: An Example Using a Lithium Iron Phosphate Cell." SAE Technical Paper 2013-01-1547. Warrendale, PA: SAE International, 2013.