Cell Hysteresis — how we tamed the hysteria

Suraj Pawar
Ather Engineering
Published in
9 min readApr 10, 2024

Suraj Pawar, Sarthak Manocha, Bincy Abraham, Yash Goyal

Introduction

In a previous blog post, we had motivated the need for an algorithmic framework for the Battery Management System (BMS). As a recap, the main benefits of such a framework that were highlighted in that post were :

  1. Prevention of algorithm fragmentation : With new revisions of the scooter and charger hardware, a framework (and in particular a closed loop algorithmic framework) can adapt it’s algorithms without major changes to the structure of the algorithm.
  2. Optimal and robust usage of the battery pack : In the presence of a variety of charging hardware, scooter variants, having an optimal and robust estimator for State of Charge (SoC) can ensure the maximum performance and range out of your battery pack.

With the algorithmic architecture in place for the BMS, the overall vehicle application architecture looks like shown in Figure 1.

FIGURE 1 : Battery Charge & Discharge Vehicle Application Architecture

In case you missed that post, we encourage you to read it for a detailed discussion on the underlying mathematics and architecture.

In this post, we want to talk about an interesting electrochemical behaviour that Lithium Ion cells exhibit : hysteresis and why we should care about it when trying to accurately estimate the SoC of the battery. By the end of the post, we will highlight how our algorithmic framework allowed us to adapt our battery state observer (highlighted with the red box in Figure 1) to incorporate effects of hysteresis in order to maintain the accuracy of our SoC estimate

What is Hysteresis ?

A few Lithium Ion cells in the 21700 form factor

The Open Circuit Voltage (OCV) of a Lithium Ion cell is generally a function of it’s SoC. This should ideally mean that if we charge or discharge the cell to a certain SoC, and leave it to rest there for a significant amount of time, it’s voltage should relax to the OCV at that SoC. The Equivalent Circuit Model (ECM) that was introduced in a previous blog post, modelled the terminal voltage of the cell through Equation 1.

Where V₁, V₂ are states of the ECM model and R₀ is the DC resistance of the cell’s internal dynamics. As the equation suggests, once the current i(t) is removed, states V₁ and V₂ will gradually settle down to zero, and the cell’s terminal voltage Vt would equal the OCV.

However, we realise that this might not be true for all cell electrochemistries. In reality, for some electrochemistries, when we charge the cell to a certain SoC, it’s terminal voltage after ample rest is slightly higher than the OCV value. Similarly, after discharging the cell to a certain SoC, it’s terminal voltage after ample rest is slightly lower than the OCV value. This behaviour has been discussed in literature extensively. Figure 2, taken from Prof Gregory Plett’s course notes, shows how this symptom can manifest itself in the cell’s voltage values. Since the additional voltage on the cell shows dependence on the history of how the cell had been charged and discharged, some models try to explain it using “hysteresis”.

Hysteresis is a phenomena that is observed in magnetic materials as well, and it results in the magnetic moment of the material having a dependence on how the magnetic field changed in the past. What makes hysteresis an interesting challenge is the fact that the cell’s voltage after sufficient rest could be anywhere in between the charge and discharge curves (as depicted by the blue lines) !

FIGURE 2 : Hysteresis as shown in Prof Plett’s course notes

The Need to Account for Hysteresis

Now that we have seen that certain cell electrochemistries can display hysteresis in their voltage values, we must discuss why it is important to try and characterise it. Consider a cell that has OCV curves as shown in Figure 3 (the axes have been normalized). Note that the actual OCV curve is the black line and is an average of the charge and discharge side curves. We only use the terms “OCV Charge” and “OCV Discharge” loosely to denote the voltage of the cell after a charge / discharge and after it achieves equilibrium without any load across it at every SOC point. Assume that the cell has been resting for a sufficient amount of time, and we would now want to perform a lookup on the OCV curve to determine it’s SoC. The presence of hysteresis makes it very difficult to uniquely determine this. You could be on the charge curve, discharge curve, or anywhere in between ! In this particular example, the SoC variation between the charge and discharge curves is around 30% ! For some Lithium cell chemistries, the OCV vs SoC curves are steep enough for the SoC variation to be small. However, for other chemistries with more flat OCV characteristics (example Lithium Iron Phosphate), the SoC variation becomes significant enough to cause huge errors in SoC estimates.

FIGURE 3 : Impact of hysteresis on SOC estimation

It is worthwhile to pause here and ask ourselves why the OCV curve is so important when we are using a closed loop estimator such as an Extended Kalman Filter (EKF) for estimating SoC ? After all, the EKF is expected to reject most plant uncertainties while maintaining SoC estimation accuracy. Indeed, this is a worthy question but a closer look at the linearized model that is used in the EKF (refer to this blog post) reveals the answer. As seen in that post, the output equation contains the OCV voltage as a function of SoC. We use Taylor series first order linearisation to express this using the following Equation (2).

We then keep only the linear part (second term appearing on the right hand side of the equation) in our state space formulation, and treat all other quantities as knowns. We can find the value of these quantities using lookup tables. This includes Vocv(SoC₀), and therefore an incorrect OCV curve is not under the purview of the EKF.

So far, we had been using an ECM model (a double RC pair) for the cell for our EKF algorithm, but it was clear that this model would be unable to account for cell hysteresis. At this point, we had either of two options :

  1. Use three versions of the OCV table as lookup tables in for the ECM model : a charge OCV, discharge OCV and the actual OCV curve (that is the average of charge and discharge curves)
  2. Pivot to performing traditional coulomb counting with opportunistic corrections on the OCV curve
  3. Use a dynamic equation that would reasonably model hysteresis effects and augment the ECM model used for the EKF

Since hysteresis is a continuous, and not a discrete phenomena, option 1 would not work because the cell could be on neither of the three curves. Option 2 would expose us to the risks of SoC drifts due to current sensor errors and pack degradation. Moreover, looking up on the OCV curve opportunistically would entail the same risks as option 1. This left us with option 3.

Improved Cell Model With Hysteresis

The output equation for the terminal voltage of the cell was revised to also incorporate effects of hysteresis (equation taken from Prof Plett’s notes).

Here, the term “h” represents dynamic hysteresis in units of Volts, and “M₀s” captures it’s instantaneous value. The term “s” determines the direction of current (charge / discharge) and can either be +1 or -1. The differential equation that governs the dynamics of the hysteresis state are given by the following equation.

In this equation, η and γ are parameters that need to be characterised and M can be simplified to the following equation

Where sign() is the signum function. All the parameters that appear above can be found using cell characterisation techniques that employ convex optimisation. We have spoken of these techniques in an earlier blog post here. With these equations in place, we perform a piecewise linearisation of our nonlinear system to obtain the following discrete time state space form.

The terms in “d” come from Equation 2. The matrices are denoted with the traditional state space convention of A,B,C and D. We can now use the EKF framework with this model to estimate the states, which now includes a state for hysteresis. Before we proceed however, we must add a note about system observability. Any state observer (such as the EKF) would be able to uniquely determine the states of a linear system only if the system is “observable”. Observability can be determined by finding the rank of the observability matrix (denoted with the symbol 𝒪), which for our 4th order system is given by the following equation.

For a linear system to by fully observable, the rank of the matrix 𝒪 must equal the number of states, in our case 4. As it turns out, when there is no current being driven through the battery pack, i.e i = 0, rank(𝒪)= 3 and therefore the hysteresis state h is not observable. We know this because the 3rd order system (without the hysteresis state) is fully observable. To ensure that the EKF estimates of other states remain stable during this period of observability, we turn off the EKF correction for the hysteresis state when the battery pack is resting.

Putting all this together, we now have a new EKF algorithm that can maintain SoC estimation accuracy even for cells that show hysteresis behaviour ! Figure 4 shows results from a simulation where the EKF is being able to estimate both the hysteresis and SoC states. In this simulation, additive white Gaussian noise was added to the voltage and current values generated from a simulated cell model. Additionally, some error was added to initial guesses for SoC and hysteresis (as seen in the zoomed in circles to the left of the plot). These signals and values were then given to the EKF based on the model presented in Equation set 6. All values are normalised. As can be observed, the EKF is successfully converging to the correct SoC and hysteresis values over the course of a regular charge / discharge drive cycle.

FIGURE 4 : Simulation results with the EKF for SOC and hysteresis estimation

Benefits of our Algorithmic Architecture

Thanks to the algorithmic architecture we had set in place for the BMS, we were able to develop, test and deploy the new hysteresis model based EKF on cells having this nonlinear effect, as well as on cells without this effect using a common code base.

Going back to Figure 1, the architecture was setup so that the “battery state observer” is decoupled from the charging and discharging controllers. Therefore, we did not need to touch those controllers at all since they would now use the state estimates of V₁, V₂ and SoC from the new EKF.

This only worked because the charge and discharge controllers were also state-space based controllers. If we would have been working with traditional multi step CC, or CC-CV based charging algorithms, we could have ended up under charging the battery pack. This is because the battery pack would reach a higher voltage even though it’s SoC was not 100% (owing to hysteresis). On similar lines, a voltage based discharge deration algorithm could have resulted in premature cutoff of scooter ride, i.e, ride stops even when dashboard SoC is not 0% !

--

--