Week 7 State of charge estimation
Answer-1
Open Matlab software and open the simulink model file of 'Closed loop BMS harness dashboard in Tests-->System-- >BMS_Closedloop_Harness_Dashboard model file.
Then give open project and model in pop-up dialog box to install all the model related library files into the current folders and workspace.

Blocks in model:
1)Dash board
• Test Sequence Varient(Selector).
• Manual Varient(Selector).
• BMS_Testsequence state request (Subsystem) to provide state request commands.
• Lamps to indicate Fault state,High temperature,Over voltage,Over current,charging ,voltage sensor operation,inverter operation,low temperature,Under voltage.lf any fualt in these red indication will intimate us and all in good conditions indicated by green indication.
• Rotating switch for manual Varient changes while running simulation.
• In scope results the SOC of module,Module current,Individual cell voltages,Individual cell temperature,Battery state,Cell balancing states are seen as outputs.
2) BMS Closed loop In this main block consist of two subsystems,BMS ECU and PLANT units. The plant output from plant unit given as input to BMS ECU as BMS_input feedback loop.The state request is given to BMS ECU unit.
The BMS Output commands given as input to plant unit as *From_BMS..Alsp the state request is given to Plant unit. The final outputs from closed loop model are BMS_input,BMS_Output,BMs_info.

In BMS ECU unit,the current power limit calculations are done used in State machine block,Soc Estimations,Cell balancing logics as shown below,

In Plant unitthe battery pack unit,Pre charge unitcharger/load units are created. In battery packs there are two types of configurations as I module(6 cells) and 16 modules(96 cells).
Here we are chossing I module for lesser simulation running time.

Discussions:
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 varient and select the cases one by one as follows,
Test case 1:
select 1 from test sequence varient dialog box and click apply as shown below.

This selection consist of selection changes in masked BMS_State request subsystem as

This test case consist of the following 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 occure 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 indication are showing green for overall simulation period showing that there are no faults occur 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 varies from 3.IV(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 upto 9000Secs.
After 9000 secs post charge cell balancing starts. All cell voltages are balancing to a voltage with respect to cell Ito 4.1 V as shown below,in this stage the pack is in stand by 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 temberature 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 upto constant current region and start reduces as current flow reduces in constant voltage and cell balancing region upto 9000secs.
Cell I 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:
select 2 from test sequence varient dialog box and click apply as shown below.

Scope result plotted

Here in these plots only driving mode of battery module is plotted.
Cell Voltages and Pack
Current-The cell voltages varies from maximum 3.9V and reduces to 3.05V as cutoff 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 stand by mode conditions are in between the drive modes.
Cell temperature: Here cell I 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 are not plotted in this plot as simulation upto10000secs command is given as drive mode. But in actual practical situation standby modes are not present present as battery current drains by other small auxilaries of EV's.
SOC of module:

Test case 3:
select 3 from test sequence varient dialog box and click apply as shown below.

This test consist of charging of entire duration of time
PLOT:

Cell voltages and pack current
Initially cell 2 , voltages rises from 3.9V(approx) to maximum 4.2V and stabilised to 4.15V.
Cell 1 reises from 3.85V to 4.1V and stabilised to 4.08V.
The battery pack current raising from OA 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 cutoff as shown in result plot.

Cell Temperatures:

The cell temperatures continue to increase heat upto full charge and after that the temperatures 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:

_____________________________________________________________________________________________________________________________________________________________________________________________________________________________
Answer-2
The ‘coulomb counting’ or CoulCount method was developed by Schmitt et al as a heuristic method, although the underlying theory is reasonably accessible.19 It depends on the recording of the current noise only. The signal is filtered with a high-pass filter with a cut-off frequency of 0.01 Hz. The filter may be either analogue (although the implementation of a good-quality 0.01 Hz analogue filter is difficult) or digital. The absolute value of the measured current samples is then summed over time. A steep slope is taken as an indication of rapid corrosion, although it is not possible to calibrate this in terms of an estimated corrosion rate.
Coulomb counting
To determine available capacity, coulomb counting relies on the integration of the current drawn from and supplied to a battery over time, τ∈t0t, as given by
where I is the current and η is the efficiency during charge and discharge operations . Coulomb counting is advantageous in terms of a simple structure and its ease of implementation. However, some problems make it difficult to accurately estimate battery SOC by coulomb counting. Because battery capacity and efficiency are significantly influenced by operating temperature and current direction, these factors should be considered to correct for battery SOC. Sensor accuracy is also important because accumulated errors can lead to a drift in the estimated battery SOC. Furthermore, one of the main problems in coulomb counting is that it is necessary to calibrate the initial battery SOC. In several applications, the initialization involves rest and the initial SOC is estimated based on the voltage inversion method described next.
State of charge of battery bank
In general the SOC of the battery is the ratio of its present capacity (µ(t)) to the nominal capacity (µn) of the battery . The SOC can be defined as
The Coulomb counting method measures the charging/discharging current of a battery and integrates it over time in order to estimate SOC. The SOC can be calculated as
where ψ(t) and ψ(t−1) are the SOC of the battery at time instant t and t−1, i(t) is the battery current at time instant t, and Δt is the time interval (considered 1 minute).
BMS implements coulomb counting for SOC estimation

Here 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 I 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 I multiplied with 100 to get in percentage of SOC.