Week 7 State of charge estimation
Q1. Simulate the 3 test cases from harness dashboard and write a detailed report on the results.
After downloading the zip file, we first have to extract the zip file to a folder and then I choose again Battery_System_R2020a to extract to a folder.
Then to get access to the Close Loop BMS harness dashboard we have to check for the following model Test>System>BMS_ClosedLoop_Harness_Dashboard model file.
After opening this file MATLAB will ask the following question: -

We have to select Open Project and Model. And after that the whole project will be loaded in the MATLAB in current folder and workspace.


After this the BMS_ClosedLoop_Harness_Dashboard model file is open as: -

Block of Model: -
Test sequence Variant (it has 3 different test condition)
Manual Variant (selection)
BMS_StateRequest subsystem to provide the state request commands.
Indicating lamps are there to show any fault state, High Temp, Overvoltage, Charger, Voltage Sensor, Overcurrent, Low temp, Under Voltage, Inverter state of a battery. Green light tells us that all states are Ok and battery is good to charge and discharge and red indication will indicate the fault state.
Rotating switch for manual variant to change the position during simulation run time
BMS_Closed Loop: - this subsystem contains BMS ECU and Plant as two main subsystem and let’s see this block in details: -

BMS ECU: - The BMS ECU get have two input which are BMS_Input which is feedback from the Plant model and the state Request is coming from the state machine. This is generating output as BMS Output and Info which have current power limit calculation in State Machine, SOC estimation and Cell balancing logic as shown below: -

Plant: - This subsystem contains Battery pack, Precharge circuit and charger / loads.
In the battery pack there are two configuration which are 1 module (6 cells) and 16 module (96 cells).
Here we have selected 1 module for simple calculations and less simulation time.
In the scope SOC of module, Cell voltages, Pack Current, Cell Temperature, BMS state and cell balancing command are seen as output.
- A) To run three test cases from harness dashboard of closed loop BMS control.
We have to test three cases for this model by selecting test sequence variant and select the cases one by one as fallows,
Test Case 1:
Select 1 from test sequence variant dialog box and click apply as shown below.

This selection consists of selection changes in masked BMS_State request subsystem as,
This test case consists of the fallowing sequence operations as,

Here from the above test sequence editor figure, it was set as,
- Driving for first 3000 secs.
- After 3000sec starts balancing operations occur for next 1000 Secs.
- Then charging and balancing occurs for next 5000 secs.
- After that sequences post charge balancing operation occurs till end of the simulation period.
Results:
Run the simulation and results are shown as

The lamp indications are showing green for overall simulation period showing that there are no faults occurs during the sequences.

From the results we can understand that,
Cell Voltages and Pack Current
For first 3000secs all 6 cells are in drive mode where discharging occurs majorly and in standby mode for lesser duration at approximately 1000 to 2000 secs.
The voltages vary from 3.1V(min) to 3.9V(max) in this range.
From 3000 secs to 4000secs cell balancing occurs and in this stage the module in standby mode and voltage is constant at nearly 3.7V.
After 4000secs charging occurs, voltage raised from 3.7V to 4V. At 4V to 4.2V at constant current as nearly 30 A and after 4.2 V as constant voltage, current reduces from 30A to 2.6A at end of the charging and cell balancing occurs up to 9000Secs.
After 9000 secs post charge cell balancing starts. All cell voltages are balancing to a voltage with respect to cell 1 to 4.1 V as shown, in this stage the pack is in standby mode.
Cell temperatures:
Initially for 3000Secs the temperature range of cells increases gradually from ambient temperature 288K to 302K.
The temperature of cell 1 is lesser and cell 6 has higher temperature for all stages.
After 3000secs upto 4000secs the cell temperatures are reduced slightly as no current flows through cell in standby mode.
After 4000Secs temperature starts increases exponentially up to constant current region and start reduces as current flow reduces in constant voltage and cell balancing region up to 9000secs.
Cell 1 max temperature raised upto 302K and cell 6 temperature raised upto 317K.
After 9000secs the temperatures still reduces and remains stable at reaching ambient temperature.
BMS State:
For 3000 secs the battery module in drive mode(discharging).
From 3000 secs to 4000secs the battery module in balancing standby mode as shown from result plot.
After 4000 secs upto 9000secs the battery module in charging and balancing mode.
After 9000secs only post charge balancing mode operates upto end of simulation.
SOC:
Initially the state of charge of battery module is in 80%.
Here the yellow plot represents SOC estimation done by coulomb counting technique.
Blue plot represents SOC estimation using Unscented Kalman filter technique.
Red plot represents SOC estimation using Extended Kalman filter technique. Among three UKF and EKF techniques estimate accurately than coulomb counting technique.
Initially for 3000 secs SOC decreases to nearly 45% during drive mode.
After 3000secs upto 4000 secs the SOC is constant at 45% as cell balancing occurs in standby mode.
From 4000 secs to 9000secs module in charging mode. (4000 to 7000=CC mode,7000 to 9000=CV mode).
After 9000 secs the SOC becomes constant approximately 94% as seen from above plots.
Test case 2:
Now select test case 2 and click apply in test sequence variant dialog box as shown below,


This test case consists of drive mode for 10000secs and after that charging occurs till end of simulation.

Results:
The dashboard results are shown as without any faults occurred.

The scope result plotted as,

these plots only driving mode of battery module is plotted.
Cell Voltages and Pack Current-
The cell voltages vary from maximum 3.9V and reduces to 3.05V as cut-off voltage upto 9000 secs. Entire capacity drained at 9000 secs.
The pack current discharges upto maximum 70A and slight charging occurs during the overall drive. Some standby mode conditions are in between the drive modes.
Cell temperature:
Here cell 1 having lesser temperature variations from 288K to approximately 302.5K.
Cell 6 is having higher temperature variation from 288K to approximately 322.5K.
The cell temperatures are slightly reducing in between the drive modes as these durations are in stand by modes.
Battery module state:
Entire sequence is performing in drive mode as shown from the above plot.
Small duration of standby modes is not plotted in this plot as simulation upto 10000secs command is given as drive mode.
But in actual practical situation standby modes are not present as battery current drains by other small auxiliaries of EV's.
SOC of module:
Here the SOC reduces from 80% to 0% (as current drained for longer duration) in entire drive mode as shown in above plot. At stand by modes in between them the SOC remains constant as shown.
Balancing:
Here balancing of cells are not performed as shown as balance states are in 0 for entire drive mode.
Test case 3:
Now select test case 3 and click apply in test sequence variant dialog box as shown below,
The test case sequence is altered to third as shown below,

This test case consists of charging for entire duration of time.

Result:
The dashboard lamps indications are shown as,

All indications are in green indicates no fault conditions are occurred.

The plots are shown as,

Cell voltages and pack current:
Initially cell 2, voltages rise from 3.9V(approx.) to maximum 4.2V and stabilised to 4.15V. Cell 1 raises from 3.85V to 4.1V and stabilised to 4.08V.
The battery pack current raising from 0A to 30A and starts to reduce to 2.5 A gradually at end of full charging upto 2000 secs. At 2000secs the pack is fully charged to 100%.
After full charge current flow will be cut-off as shown in result plot.
Cell temperatures:
The cell temperatures continue to increase heat upto full charge and after that the temperatures get started to reduces to ambient temperature.
As shown from result plot the temperatures start decreases after full charge (at 2000 secs).
BMS state:
Entire battery pack sequence is operating in charging mode as shown above.
SOC:
The pack SOC gets fully charged at 2000secs and remains at full charge for rest of the sequence as shown above. The actual state of charge is around 93% shown as full charge shown by UKF and EKF techniques.
Cell Balancing:
Here from 0sec the cell 6 and 2 starts to balance with respect to cell 1 and all cells are tried to balancing at end of simulation.
Q2. What is coulomb counting? Refer to the above model and explain how BMS implements coulomb counting for SOC estimation?
Coulomb counting:
SOC (State of Charge) is defined as the rate of available capacity to its maximum capacity when a battery is fully charged and describes the remaining percentage of the battery capacity. To find this SOC % we are using coulomb counting method.
The coulomb counting method measures the discharging current of the battery and integrates the discharging current over time in order to estimate SOC.
Which can be estimated from discharging current[I(t)],
previously estimated SOC value [SOC(t-1)].
The relation can be given as,
SOC(t) = SOC(t-1) + [ I(t)/Qn ]*∆t
SOC estimation in BMS model:
To see the model of coulomb counting technique in BMS model click the subsystem of SOC_Estimation and click Coulomb counting.



the discharge current from battery given to gain with value as 1/3600 to convert current to Ahr.
The value is divided by capacity due to temperature change. Then integrated with a gain value of 1 with sample time -1 as we are using discrete integrator.
The saturation limits are from 0 to 1.
We will get the SOC values from 0 to 1 multiplied with 100 to get in percentage of SOC.