Skip to main content
Wie wil meedoen met de solarbike zelfbouw club?
Who wants to join the solarbike DIY club?

Battery management system (BMS) with internal resistance (IR) compensation

Published: 19 February 2022
Last updated: 09 March 2023

Why IR compensation is required

IR compensation is a well-known technique that is unfortunately not available for e-bike batteries. If you Google on "fast charging IR compensation" you will see many articles about it.

When charging batteries very fast, the BMS stops the charging process too early. Here I will explain why this happens.

Every Lithium battery pack contains a so called BMS (battery management system) that measures the battery voltage and stops the charging process when the voltage exceeds a certain safety limit. But the internal resistance of the battery throws a spanner in the works.

The charge current causes an error voltage, namely the voltage across the internal resistance of a battery. Due to this error voltage, the BMS doesn’t measure the real battery voltage:
U measured = battery open voltage + charge current * internal resistance

As a result, the charging process will be stopped too early. Unfortunately, there are no BMS boards for ebikes with IR compensation, so this is why we need to develop this ourself.
Normally, the lack of IR compensation is not even a big problem because ebike batteries are often charged with a modest charging current, by which the error voltage is small. But with fast-charging, IR compensation is absolutely necessary. We shall demonstrate this with an example.

Fast charging the Lithium Werks (A123) ANR26650 battery

Note that the following calculations are done for a single battery cell. It is not necessary to perform the calculations for an entire battery pack, that comes down to the same thing in the end.
I have measured the ANR26650 internal resistance myself; this is 18mΩ, see the article Ultra-fast charging batteries for e-bikes.
Suppose, we want to charge this battery in 20 minutes. The charge current per cell must be 3 * 2500mAh = 7.5A. The BMS voltage drop across the internal resistor is 7.5A * 18mΩ = 0.1V.

The ANR26650E is a LiFePO4 battery with a fairly flat voltage curve. A measurement error of 0.1V is inadmissible here and will cause the charging process to stop much too early:

Lithium Werks ANR26650 Discharge GraphLithium Werks ANR26650 Discharge Graph

During charging with 7.5A it seems that the battery is being charged to 4.3V instead of the official limit of 4.2V, but you have to subtract 0.1V because of the internal resistance.

Current Interrupt iR compensation

If the internal resistance and the charge current is known, the BMS can calculate the open battery voltage. However, the internal resistance increases over life time, so its change should also be measured. In principle, all this is possible, but it is a lot of hassle.
There is a very simple solution: once a minute we can interrupt the charge current for a few seconds which allow us to measure the open battery voltage. Because of the battery relaxation time we must wait some seconds, until the cell reaches its final open circuit voltage. Although IR compensation techniques are obvious, there are several patents based on it. See for example patent CA2585894A1, you can find a list of other patens there.
Who can develop the BMS IR compensation circuit?
Instead of building a whole new BMS board with IR compensation, we could just modify an existing BMS board. In the following circuit diagram, you can see how this can be done:

BMS with IR compensationBMS with IR compensation

Who can help me with this? I don't have time because I'm developing a new mid-drive motor and a few other things. I have made a topic about this at Endless Sphere.

BMS without IR compensationBMS without IR compensation

Adding IR compensation to the Xiaoxiang Smart Bluetooth BMS

Xiaoxiang Smart Bluetooth BMSXiaoxiang Smart Bluetooth BMS

This BMS can be programmed, it contains an ATmega328p and a BMS chip BQ769x0. Maybe IR compensation can be added by modifying the software. 
Third Party Software / API / Technical Information: https://wnsnty.xyz/entry/jbd-xiaoyang-s ... ion#wiring

Who can help me with this? I don't have time because I'm developing a new mid-drive motor and a few other things.

Other articles from Ebike electronics