Posted on

Battery Testing with Standard Lab Equipment

Standard Lab Test Equipment: PSU, Eload, and DMM

Testing batteries is important in many different contexts and in different levels of complexity.

People re-using lithium batteries from laptops, power tools, and other sources may want to do a quick internal resistance and capacity test to verify the state of health, but likely don’t care about in-depth characterization or incremental capacity analysis. This group will probably not bat an eye about a 5% measurement error from their equipment.

On another hand, anyone looking to analyze effects of various charge or discharge protocols on battery degradation, or creating an equivalent circuit model of a cell to calculate heat generation or verify performance of a product will want as much data as they can get about the cell. This group could include student design teams at universities with a relatively low budget, looking to get the best efficiency from their Solar Car battery pack, or the highest power from a Formula-E pack. Companies looking to develop a product need to understand the performance their battery can provide to their device, or developing a state of charge or health model will want the best data they can get without breaking the bank.

At the extreme end of the spectrum, battery researchers will pay $100,000+ to get the best test equipment possible to ensure their breakthrough materials are better than the state-of-the-art, and not merely a figment of tester inaccuracy.

Battery Test Setup with RIGOL DP832A Power Supply and DL3021A Eload
Battery Test Setup with RIGOL DP832A Power Supply and DL3021A Eload
Battery Test Setup with Rigol DM3068 DMM, Siglent SPD1168X Power Supply, and BK Precision 8601 Eload
Battery Test Setup with Rigol DM3068 DMM, Siglent SPD1168X Power Supply, and BK Precision 8601 Eload

Battery Test Program

Over the past few years, I have been developing a program targeted towards that middle group – people looking to get accurate battery data for a purpose other than battery material validation. The program, with setup instructions, is available on Github: https://github.com/mbA2D/Test_Equipment_Control

Battery Testing Program by A2D Electronics, set up for 4 battery channels
Battery Testing Program by A2D Electronics, set up for 4 battery channels

The goal is to control standard electrical test equipment (power supplies, electronic loads, data acquisition, custom boards, etc) to charge and discharge battery cells with various test protocols to get anything from a simple capacity test to a comprehensive battery characterization. This is meant to be a widely applicable general-purpose structure for performing battery tests. Below are just a few examples of what can be done with it. All graphs and data used below are generated from my own results using this program.

1: Cycling Capacity

This is probably the most asked-about characteristic of batteries by the general public – how long does it last? Not only for a single charge, but also about the retained capacity after a few years of cycling. By cycling a cell repeatedly and calculating capacity for each cycle, this is relatively easy to plot, though it takes a long time to run the tests.

The graph below was generated by cycling an LG 21700 cell. There is a general downwards trend in capacity, as expected when a cell is cycled. Various constant discharge currents were applied throughout the cycling, which gives the jumps and discontinuities in the graph, as large discharge currents generally lead to increased internal losses and thus less discharged capacity.

LG M50LT Cycle Life Testing
LG M50LT Cycle Life Testing

2: OCV vs SoC (Open Circuit Voltage vs State of Charge)

By setting the charge and discharge current to very low values (e.g. C/25: a full charge in 25 hours), it is possible to accurately measure the voltage during charge and discharge. The OCV-SoC curve is then taken as the average of the charge and discharge voltage for every SoC point. This curve is the basis for many battery characteristics, as it represents the chemicals inside the cell being in equilibrium. It is important to note that in reality, the chemical reactions inside the cell do produce different voltage characteristics when charging compared to discharging, so this approximated curve is not perfect.

LG M50LT Open Circuit Voltage vs State of Charge Characterization
LG M50LT Open Circuit Voltage vs State of Charge Characterization

3: Measuring DC IR (Internal Resistance)

An internal resistance test can be conducted via a 2-pulse current method, where 2 different currents are applied to the cell and the voltages are measured. The difference in voltage and current between the 2 pulses are used to calculate the DC internal resistance. If there are enough data points in the voltage measurements, they can be extrapolated to the start of the current pulse. This is done because the current pulse discharges the cell, which changes the OCV, so the measurement includes voltage changes from 2 sources – the change and the current flowing over the internal resistance. Extrapolating the voltage measurement back to the start of the pulse removes OCV portion of the voltage change for a more accurate measurement. Note also that a good 4-point (remote sense) test setup is required to obtain a good internal resistance measurement.

Extrapolating voltage measurement back to start of current pulse in DC Internal Resistance measurement
Extrapolating voltage measurement back to start of current pulse in DC Internal Resistance measurement

4: IR vs SoC (Internal Resistance vs State of Charge)

The internal resistance test can be used as a single spot test of internal resistance but does not give the full picture of a cell’s performance. It is commonly known that the internal resistance of a cell changes with SoC, as well as temperature. As a cell is being discharged, different current pulses can be applied and the internal resistance measured at each step in current, across the whole state of charge range. The measurement matches the datasheet specification for the LG M50LT, 23±6mOhm DC internal resistance at 50% SoC.

LG M50LT Interval Resistance vs State of Charge Characterization
LG M50LT Interval Resistance vs State of Charge Characterization

5: ICA (Incremental Capacity Analysis)

Incremental capacity analysis (ICA), otherwise known as differential capacity analysis (dca or dq/dv), is commonly used to assess state of health as well as identifying degradation methods. It looks at how much stored capacity is available for each small increment of voltage. Using the work done by DiffCapAnalyzer in The Journal of Open Source Software, incremental capacity analysis can be added to the suite of tools relatively easily.

LG M50LT Incremental Capacity Analysis during OCV-SoC Characterization Test
LG M50LT Incremental Capacity Analysis during OCV-SoC Characterization Test

Equipment Recommendations

Getting started with testing batteries can be quite an investment if going for high accuracy and powerful equipment, but to do the basics you don’t need much. A cell holder is required to connect to the cell, and a power supply and electronic load are required to charge and discharge the cell. Expect to pay around $800 to $3,000 per battery channel you want to test if purchasing everything new. This is a large investment, though there will be some custom hardware coming (see below) that aims to drop this cost significantly. Here are a few non-exhaustive recommendations. For each list, cheap options at the top and the features get better and more expensive as you go down the list.

When choosing equipment, it is important to note that for accurate test results, equipment with remote sense is required. Without remote sense, the measured voltage will include the voltage induced in the cables between the equipment and the battery. Remote sense allows the equipment to measure the voltage with an extra pair of wires directly at the battery terminals instead of at the equipment terminals. A higher current will create a greater voltage drop in the wires from the equipment to the battery, so remote sense is especially important for high current tests. Generally, cheaper equipment does not have remote sense. Often, the remote sense terminals are on the rear of equipment, though occasionally easily accessed from the front. Equipment with no remote sense is marked with ‘No RS’.

All equipment is listed cheapest first.

Cell Holder

  1. A plastic clamp (non-conductive) and some wires – you might already have this around the workshop
  2. A2D Electronics 4-wire cell holder (link) (RECOMMENDED – though I am biased since I made it)
  3. Dedicated cyclindrical cell holder (link)
  4. Metal cylindrical cell holder (link), or higher power version (link)
  5. Gamry, Arbin, Biologic, or Neware (or other test equipment company) cell holders

Electronic Load

  1. Korad KEL102/3
  2. Rigol DL3000 Series (link), Siglent SDL1000X-E Series
  3. BK Precision 8600 Series

Power Supply

  1. Korad KA3005P (No RS)
  2. Rigol DP700 Series (link) (No RS), Siglent SPD1000X Series, Korad KWR102/3
  3. Rigol DP800 Series (link), Bk Precision 9103/4
  4. BK Precision 9200B Series

What’s Next?

Temperature Control and Thermal Chambers

Everything varies with temperature. So far, the program does not control the temperature but only measures it. Given that pretty much all battery characteristics including internal resistance and OCV vary with temperate as well as other factors, being able to control the temperature is extremely important for accurate battery testing.

Custom Hardware

Test equipment and cell holders are expensive, especially for high quality equipment. Testing multiple batteries at the same time is often required to speed up testing and stay on track of timelines, which requires considerable investment in a large number of individual power supplies and eloads, or prohibitively expensive lab-grade multi-channel equipment from companies like Maccor, Arbin, Biologic, Neware, etc. Some custom electronics and other hardware are in the works that aim to remove this cost barrier to getting actionable data on real cells for teams and individuals that don’t have huge budgets. A few things I’m working on are below.

  1. Cell holders that cost less than $15 each but still provide all the required features for adjustability and remote sense are one of the first things that I’ll get started with. Purchase the cell holders here when in stock!
  2. A board that will allow automated sharing of test equipment between batteries. This will allow a power supply to be connected to 1 battery to charge and an electronic load to another battery to discharge. Once the charge and discharge are complete, it will automatically switch the batteries to the opposite piece of equipment to complete the next stage in the cycle. This system will reduce the cost of test equipment for multiple battery channels by half (plus the cost of these boards).

    A2D Electronics Relay Board Prototype
    A2D Electronics Relay Board Prototype
  3. A system of boards to replace the dedicated test equipment. This will include ADCs and precision amplifiers for voltage, current, and temperature measurement, a precision reference, as well as power electronics and control strategy to manage current flow to and from a central DC power bus. This test system will also greatly reduce the physical space that is needed to run a battery test system with many channels compared to dedicated test equipment for each channel, as well as being significantly cheaper than existing solutions. Isolated voltage monitors will be available as well, to evaluate performance of a BMS or to evaluate cells within a pack without disassembling the pack and testing cells individually.
Posted on

Battery Cycle Testing with Python, and E-Load, and Power Supply

Update May 16, 2023 – see here for a newer post with a better overview and details.

 

A  lot of electronic loads (my Rigol DL3021A included) have a built-in ‘Battery Test’ function, either on the front panel or able to set up through the load’s accompanying software (See here for an overview of my lab hardware). This works fairly well if you’re just trying to run one cycle, but when trying to run multiple cycles you need to control the charging cycle as well. Keysight has the BenchVue software which allows coordination of multiple instruments together in drag-and-drop scratch-like scripts, but to get the full control over the cycles and parameters, you’ll want to control your instruments over SCPI with Python.

I’ve been wanting to test out some LG MJ1 cells for upgrading an old NiCD drill battery, and figured I’d take the opportunity to write a basic battery cell cycling program that I’ll be able to expand on in the future.

Before we dive into specifics though, I will preface with mentioning that I am not a firmware of software programmer by trade or by schooling, only out of necessity and interest – I can write code that works, but is not optimal. I know there’s a lot that could be done better and/or cleaned up in the code. If you want to contribute, send me a message and have a look at what I’ve got on Github!

Program Features

Basic GUI

While I am fairly familiar with command line tools, its always nice to have a GUI. Python makes that super simple with TKinter and EasyGui. A simple, linear flow of operations through popup windows is easy to implement, but in the future, having a full-featured program would be nice. A few images of the GUI screens are shown at the bottom of this post, but are not all that impressive – just the basic options provided.

Storing Test Settings to JSON Files

The settings for each charge and discharge cycle can be stored to a JSON file for easy recall for future tests.

Choosing Test Equipment

When setting up a test, it is good to be able to choose whatever equipment is available to you. The program has been set up to select whichever instrument series and visa resource is available to you.

While SCPI commands are supposed to be standard between equipment, there are a fair number of differences across different models for the more obscure features such as remote sense, front panel lock, and other such features. They often use different SCPI commands to activate these features, so I created a python class for each instrument will all the command specific to that instrument.

Multiple Test Choices

There have often been times where running different cycle types have been useful. There are multiple options for different types of cycles built in:

  • Run a single cycle at a set voltage, current
  • Run multiple cycles with the same settings for a set number of times
  • Run multiple cycles with 2 different settings for a set number for each cycle type and test cycles (e.g. discharge at 5A, charge at 2.5A for 1 cycle, then discharge at 10A, charge at 5A for 9 cycles, then repeat 5 times for a total of 50 cycles). This can be helpful for degradation testing and measuring capacity with a standard cycle at fixed intervals.

Storage Charge Option

Every test setup will ask if you want to charge the cell to a storage level as well. Leaving cells discharged after a capacity test can accelerate the degradation of the cells, and can lead to increased dendrite growth causing latent failures in the cells. Charging back up to a storage voltage (around 3.7V for li-ion cells) is always a good idea.

Data logging and Discharge End Detection

The discharge is finished when the cells reach a defined voltage in the test settings. The monitoring of this end condition can be improved quite a bit from the current implementation.

The data (voltage at current) is measured from the eload and power supply at the interval defined in the test settings. It compares these measured values to the end points, as well as logs them to a csv file. With this method of logging at a fixed interval and comparing to setpoints, we will over-discharge the cell at the end of the cycle if the actual voltage of the cell reaches the setpoint at the middle of an interval. I hope to improve the algorithm to attempt to match the curve of the cell during discharge, and predict the time that the cell will pass the threshold. Then turn off of the electronic load at the calculated time instead of waiting until the next measurement interval.

 

Data

Now for the interesting stuff. This has allowed me to do some long term cycle and degradation test for the Solar Car battery modules for the University of Waterloo. Eventually I’ll get around to making a proper summary of that data, but for now here’s a few cycles that I’ve done on some of the Samsung 25R cells I’m using to replenish an old NiCd power tool battery pack. They look pretty similar except for different state of charge at the start of the tests due to some other testing I was doing. These graphs are all spit out of another python program which also summarizes results such as capacity in Ah and Wh, final charge voltage, actual minimum discharge voltage, and max cell temperature if there was a thermistor also attached.

It is interesting to note that all the cells seem to still drop in voltage during the rest period after the discharge. I expect there may be some leakage current in the power supply or eload that is drawing them down – a problem for another day. For now, I’ll make sure not to leave them sitting overnight.

Posted on

New Lab Setup – Rigol and Electro-Meters

A few months ago, I started to be on the lookout for some better test equipment – an oscilloscope, multimeter, electronic load, and power supply. These would allow me to create a few projects that I’ve been thinking of doing for a while and didn’t have the right tools to get started. I had grown tired of borrowing equipment from various places and wanted a set for myself that I could use whenever I want.

Before we move on, a huge thanks to Electro-Meters for helping out with the equipment upgrade! I reached out to Electro-Meters, the local distributor for Rigol equipment, and they were willing to provide a discount in exchange for mention on these project logs and images of the products being used in my projects over the next little bit. They were great to deal with during the whole process! Check out their selection of equipment here.

What equipment to buy:

I do quite a bit of work with batteries, so having a power supply and electronic load to charge and discharge the batteries is a must. These are also super helpful for testing power distribution circuits and DC-DC converters. A multi-channel power supply (or 2 power supplies) was a requirement as I often find myself wanting to charge a battery and do something else at the same time.

A good DMM was also on the list as I need one that I can trust. I was getting tired of using the cheap handheld ones and trying to guess at what the voltage or current actually is. A few reasons for the upgrade from handheld to bench meters are below:

  1. For batteries, even a few tens of millivolts difference can make the difference between them being fine to connect in parallel or if they need to be balanced first.
  2. Keep other instruments in calibration. A 5.5 digit meter would have been good enough for typical battery or hardware debugging, but a 6.5 digit is even better for keeping power supplies in calibration.
  3. Fast measurement speed – when you’re testing voltage on 100 batteries, the fast measurement speed (Ability to change the NPLC count) of a bench meter makes everything a lot faster.
  4. Automating testing with a Python over SCPI. This enables automatic testing such as generating the efficiency curve of a DC-DC converter under different loads through a single python script. Remote sense inputs on the PSU/e-Load or extra DMMs are required to eliminate cable loss from the measurement.

Last but not least, an entry-level 4-channel oscilloscope can help debug the majority of bugs that may be encountered during bringup of a new board.

What brand to go with:

I wanted to go for some reliable equipment that wouldn’t break the bank but would also last a while and be fairly capable entry-level equipment.

I didn’t have much confidence in any of the cheap Aliexpress-style brands as I had seen way too many teardowns of them and don’t trust the quality. While it is often stuff that can be fixed pretty easily (noisy fans, cables too small, not enough mains isolation), I didn’t want to have to deal with it and wanted this equipment to be a tool and not a project.

Here in North America, Keysight equipment is generally regarded as some of the best test equipment, but it gets pretty expensive. A 6.5 digit multimeter would set you back about $1500.

I’ve used several BK Precision electronic loads and switching power supplies in the past, and have no complaints about them. They are solid pieces of hardware, and work great, but still a bit too expensive for me.

Rigol and Siglent are generally regarded as entry level test equipment, and they make a great product for the price, but on my student budget it was still a bit expensive.

The other reason I was swayed towards Rigol equipment was the reports of it being easily hackable through the activation codes to unlock extra accuracy and bandwidth capabilities. A few guides linked for the Oscilloscope here and the e-Load and power supply here. As most of the guides online mention, it was pretty straightforward to make these upgrades.

Models:

I purchased the following equipment at a discount from Electro-Meters:

  1. Rigol DS1054Z 4-channel Oscilloscope (Upgraded with protocol decoding and 100MHz bandwidth)
  2. Rigol DL3021 Electronic Load(Upgraded to DL3021A)
  3. Rigol DP832 3-channel Power Supply (Upgraded to DP832A). Remote sense is not available on this model, but having the DMM handy makes accurate measurements easy.
  4. Rigol DM3068 6.5-digit Multimeter

After upgrading the Electronic load and power supply, the characteristic color screens (as opposed to the single color displays on the non-A versions) were shown after a reboot. When you consider the added accuracy, they are a pretty good deal.

I’ve been spending some time setting up the SCPI commands to interface with these a get a full battery cycle test going, and will make a post for that soon.