State of charge estimation of battery using Coulombs counting Method
What is coulomb counting? How BMS implements coulomb counting for SOC estimation?
Ans:-
SOC(State of charge):-
The SOC is defined as the available capacity expressed as a percentage of some reference, sometimes its rated capacity but more likely its current (i.e. at the latest charge-discharge cycle) capacity but this ambiguity can lead to confusion and errors. It is not usually an absolute measure in Coulombs, kWh or Ah of the energy left in the battery which would be less confusing.
State of charge (SoC) is the level of charge of an electric battery relative to its capacity. The units of SoC are percentage points (0% = empty; 100% = full). An alternative form of the same measure is the depth of discharge (DoD), the inverse of SoC (100% = empty; 0% = full). SoC is normally used when discussing the current state of a battery in use, while DoD is most often seen when discussing the lifetime of the battery after repeated use.
Determining SoC:-
Usually, SoC cannot be measured directly but it can be estimated from direct measurement variables in two ways: offline and online. In offline techniques, the battery desires to be charged and discharged in constant rate such as Coulomb-counting. In general there are five methods to determine SoC indirectly
- chemical
- voltage
- current integration
- Kalman filtering
- pressure
In this particular assignment we are looking forward for current integration method.
Current integration method (Coulomb Counting):-
This method, also known as "coulomb counting", calculates the SoC by measuring the battery current and integrating it in time. Since no measurement can be perfect, this method suffers from long-term drift and lack of a reference point: therefore, the SoC must be re-calibrated on a regular basis, such as by resetting the SoC to 100% when a charger determines that the battery is fully charged (using one of the other methods described here).
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:

Makers of advanced BMS claim high accuracies but real life often shows otherwise. Much of the make-believe is hidden behind a fancy readout. Smartphones may show a 100 percent charge when the battery is only 90 percent charged. Design engineers say that the SoC readings on new EV batteries can be off by 15 percent. There are reported cases where EV drivers ran out of charge with a 25 percent SoC reading still on the fuel gauge.
Implementation of Coulomb Counting In BMS:-
Battery state of charge knowledge is so critical that an uncontrolled charge could lead to the destruction of the battery, that’s why power management in embedded systems is so crucial.
Assuming that the initial value SOC is known, instantaneous SOC is generally evaluated by integrating the battery current over time, as shown in equation

SOCܥ :State Of Charge
Ibat : battery current value
Qrated: rated capacity (nominal capacity)
The coulomb counting method consists on exploiting the relation (1) by quantifying the charge delivered by the battery through sensing its input and output current [8, 14]. However there are some inefficiencies when using this method; first of all, the access to the initial SOC which is not guaranteed, secondly self-discharge may distort the real SOC value after a long storage period and finally the reference capacity ܳ௧ௗ which must be updated in terms of aging battery degradation. Enhanced coulomb counting method takes into account self-discharge losses and requires a recalibration at fully and empty stages in order to determine initial SOC and update the reference capacity to have a 100% maximal SOC value.
The flowchart given in Fig. explains the algorithm used to manage the battery monitoring by switching from a battery operating mode to another in accordance with the transition’s conditions.

Initial SOC determination:- Several studies have been conducted to remedy to the problem of accurate estimation of the initial SOC . The most common technique is to use a bijective OCV-SOC function that relates the open circuit voltage to its corresponding SOC value. This curve is actually determined experimentally by the OCV test by applying a pulse load on the Li-ion battery, then the battery reach an equilibrium where the voltage is extracted in every 5% of Depth Of Discharge (DOD)
Charge Mode:-
The typical charge procedure of a Li-ion battery consists of constant-current constant voltage (CC-CV) process

Thus, the variation of the state of charge gained in this same operating period is

By accumulating the previous state of charge indication and the obtained one, we can have the instantaneous value of SOC

the value of DOD is updated in every charging operation in order to get it back in every switching to discharging mode

Discharge Mode:-
When the current bat I is negative, then the battery is in the discharging mode. In this mode, the Coulomb counter is presented by Qlost , which represents the amount of charges losses in the operating period τ

The value of DOD is calculated according to

Self Discharge Mode:-
At the battery storage periods, considering that Li-ion batteries reach 5% rate of self-discharge per month , the amount of charge losses per hour is calculated; this amount is designed by the constant, Q/H . Then, the quantity of charge dissipated in this phase Qoc is calculated , representing the cumulative losses during the storage hours.

where h is the hour of storage.
Implementation in BMS:-
The adopted coulomb counting algorithm for SOC estimation was implemented on hardware platform. Monitoring functions include the measurement of the battery voltage
Battery parameters detection is one of the most important issues in control and management of a battery management system . It includes cell voltage measurement, current detection and temperature detection. Estimation of SOC and other battery states imposes high requirements on cell voltage precision . In order to measure the voltage and the current with which the battery is charged or discharged, a resistor is placed in series with the battery. The voltage value is obtained by a measure of the voltage across the battery, and a difference between the voltages at the two terminals of the resistor will derive the current value, knowing the value of the resistance.
This resistance, which allows the current sensing in the battery gauge, should not be too high in order to avoid power dissipation during the charging at a constant current of 1A, but it should be still enough so that the analog/digital converter in the microcontroller can detect a voltage variation across it, which corresponds eventually to a 10 mA current, in order to detect the end of charging. In our case, a 10-bit converter is used to detect a voltage variation of 1mV. A 0.1 Ohms resistance would detect a current of 10mA (U = 1mV) and does not dissipate too much power while charging the maximum current value (P = 100mW).

The following figure shows the calligraph of the implemented coulomb counting algorithm

- Skander Soyahplease can you help me and tell me how can I put this algorithm in Arduino ?