State of charge estimation
Aim
To analyse ‘Design and Test Lithium Ion Battery Management Algorithms’ mat lab file
Objectives
- To simulate 3 test cases from harness dashboard and write a detailed report on the result.
- To define coulomb counting and explain how BMS implements coulomb counting for SOC estimation on selected file.
Explanation
Here we have to study the mat lab file which is given and we must prepare a report for it analysis. The citation for the file is given as follows.
Chirag (2021). Design and Test Lithium Ion Battery Management Algorithms (https://www.mathworks.com/matlabcentral/fileexchange/72865-design-and-test-lithium-ion-battery-management-algorithms), MATLAB Central File Exchange. Retrieved May 2, 2021.
This example project can be used as a reference design to get started with designing Lithium Ion Battery Management System (BMS) with MATLAB and Simulink.
Project includes Simulink models for BMS Algorithms such as:
State of Charge estimation using Extended Kalman Filter, Unscented Kalman Filter
Passive Battery Cell Balancing
State Machine for Pre-charging and Contactor Management
Fault Management - Over/Under Voltage, Over Current, Over Temperature etc.
Charge and Discharge Current Limit Calculations
To design and test these algorithms, project also includes files for
Li-ion Battery Cell Parameter Estimation
Battery Pack with 6 cells in series and 96 cells in series
Simulink Test files with test cases to test State Machine Logic
Linking requirements to Models
Now, our first objective is to simulate 3 test cases from harness dashboard. For that, select the harness dashboard from project file which we downloaded. The battery model harness dash board is represented below.

This model contains three test cases and some indicators as in representation to notify errors. We can select the first test condition from test sequence variant block as given below.

After setting test condition we can check the properties of the condition from state request block. First test case properties are given below.

From test one case properties, we can see that it has three conditions. Driving, charging and stand by. When simulation will start, the model will be in driving condition. After 3000 seconds it will be in standby mode and after 1000 seconds it will be in charging mode. When we run the simulation, the indicators in the model will show errors if there is any.

Here, all the indicators are green. So there is no errors and we check the plot for this model and it is represented below.

From the plot we can say that, the vehicle is initially in driving state and charging was done till 90%. After charging it went to standby mode. It can be seen in BMS state plot. Battery voltage was increased to 4.2V while charging. Battery temperature increases in driving and charging. It remains constant in standby mode. Current plot shows the value of current supplied to vehicle while driving. SOC decreased up to 50% in driving condition and it was increased while charging. Now lets change the test sequence varient into case two. The properties of second case can be obtained from BMS state request block and it is represented below.

It consist of two phases. Driving and charging. Charging will get started after 10000 seconds of driving. This case is simulated and the result is shown below.

From the plot we can conclude that, a fault condition occured in second case. So even after charging was started, the soc didnt increase. It continued to decrease. So we can select the third case from test varient and the properties of the case is given below.

This condition has only one phase and that is charging. So we can simulate this condition and can analyse the plot for charging phase.

Here we can see that the soc reached 100% in charging and remained in stand by mode. Cell temperature also decrased when stsndby mode was acheived. Every value reached its ideal value and remained constant.
So we can conclude that, if there is no faulty condition, the system work perfectly with ideal conditions in standby mode.
Coulomb counting
It is a method used for estimating the state of charge (SOC) of a battery. The coulomb counting method is expedient for state-of-charge (SOC) estimation of lithium-ion batteries with high charging and discharging efficiencies. The charging and discharging characteristics are investigated and reveal that the coulomb counting method is convenient and accurate for estimating the SOC of lithium-ion batteries. The Coulomb counting method measures the discharging current of a battery and integrates the discharging current over time in order to estimate SOC. Coulomb counting method is done to estimate the soc (t), which is estimated from the discharging current, I(t) , and previously estimated SOC values, SOC(t-1). SOC is calculated by the following equation:

But there are several factors that affect the accuracy of Coulomb counting method including temperature, battery history, discharge current, and cycle life. To improve the Coulomb counting method, a new technique called modified Coulomb counting method is proposed. The modified Coulomb counting method uses the corrected current to improve the accuracy of estimation.
The corrected current is the function of discharging current. There is a quadratic relationship between the corrected current and discharging current of battery. By practice of experimental data, corrected current is calculated by the following form:

Where, and are constant values obtained from the practice experimental data. In modified Coulomb counting method, SOC is calculated by the following equation:

The experimental results show that the accuracy of the modified Coulomb counting method is superior to the conventional Coulomb counting method.
For example we can look into the project file we downloaded. A BMS system in the file is represented below.

Now select the BMS ECU unit and the representation is given below.

Select the SOC estimation sub sytem from the model and it is given below.

This system does the estimation by coulomb counting equation mentioned above. Temperature and current from the battery is given as inputs. Current signal is given to a gain block and temperature is given to capacity since it varies according to temperature. These inputs are given for integration where current will be integrated with respect to time. This outout is given to another block where it is divided by capacity. This result in soc estimation.