Battery Tester / Evaluator

Does anyone know of a quick way to test the quality of a robot battery? Like how well it holds a charge.

I’ve got about 50 batteries from fairly new, to 3 years old. Some barely used, some over-used. Looking for a quick way to determine which ones can be reused again this year.

I was mulling over the same problem last week.

I have a battery beak that we use with the FRC and EDR batteries, but I’m not sure how I’d connect it to an IQ battery (bare leads maybe? sounds questionable), or if it would work if I did. I honestly don’t know much about battery technology, so my first concern is creating a safety hazard, followed by ruining batteries, and then not knowing if the test results are accurate.

Well you could just write a simple program to run a motor on and off (so it doesn’t overheat) for like five minutes or something and see how much it drains each battery.

Good suggestion Bez. I’m working on something similar to that. A 4 motor drivetrain is setup as a test harness. Modkit is able to return the battery voltage (I don’t see a way of getting the voltage in Robot C or Blockly/Python). The Modkit program reports the initial voltage before starting the motors, the voltage 3 seconds after the motors start, and then how long it takes for the voltage to drop below 7 volts.

There is a clear difference between a new battery and a really old one, but I still need to tweak the numbers. It may not be necessary to run the battery down to 7v. So far the 3 second mark has been a good indicator.

I’ll post the program once I’m more confident in the results.

We haven’t exposed the function in Blockly yet, but you can read battery voltage in Python. Here is a link to a public Python project showing how to write the code:

Let us know if we can help.

It’s a tricky one with NiMH batteries. You can tell pretty easily if the battery has a dead cell in it by looking at the voltage and the quickest way to do this is in the info page in the settings screen of the Brain. This should tell you if it has a dead cell because the voltage will be lower than 7.2v at the start. Typically, a fully charged battery shows around 8.0v intially.

NiMH batteries have a fairly flat discharge curve so the voltage stays fairly constant and then suddenly drops off quickly at the end. Because of this, you really need to test batteries under load and over a period of time to see how good they are.
The way I would do it is something like build a test rig that has a motor driving a flywheel at a highish gear ratio and then write a program that runs the motor at full speed. The program should start a timer and measure the speed of the motor. When the motor drops below a certain speed (determined by a known good battery speed less say 10%) the timer and motor are stopped and the elapsed time shown on the screen.

It’ll take a good 20 minutes to run batteries down this way though, we did similar tests on flywheel robots for last year’s game, some info here under the battery life bit. You can see how linear the flywheel speed remained for 20 minutes or so before a major drop off.

Lots of new info…

Keep in mind that the whole reason for this test was to weed out batteries that were not up to par. All of the batteries that I have can get a full charge and show 100% charged in System Info. However, they are not all equal. Although they are all fine for practice and small robots that don’t require a lot of power; later in the season, when the robots get bigger, and the auton routines get longer, you are going to want to make sure that you are using a ‘good’ battery.

The 4 motor drivetrain was a good test harness for stressing batteries, but it wasn’t something that could be easily repeated by anyone else, or even myself at a later date. So I setup a flywheel tester. The initial version had 4 motors each with two big tires spinning on a 3:1 gear ratio. That didn’t stress the battery as much as the 4 motor drivetrain, so I went to 8 motors, which was better, but still not draining the battery as fast as the drivetrain. More on setting up a good test later…

The test checked the battery voltage before starting the motors, and then at 3, 5, 10, and 30 seconds. All batteries were charged overnight before being tested. Looking at the test results it is easy to predict which batteries are going to hold a better charge within the first 10 seconds. In some of the earlier tests I kept it going for a couple minutes, but that extra time doesn’t really provide any meaningful data. Testing that the motors are maintaining a consistent speed (as suggested by calvc01) is worth considering; not wise to assume it is proportional to the battery voltage.

Here are the results for the 40+ batteries that I tested.…it?usp=sharing

Note that the voltage always takes an initial drop and then bounces around for a couple seconds before stabilizing. One other thing worth noting is that the voltage bounces back once you take the load off. So if you look at System Info after the test, almost all of the batteries that I tested would say 100%.

These results are good enough for me to decide which batteries shouldn’t be assign to teams this year. I’ve decided to draw the line at 8.05 volts after 30 seconds. Any sub-par batteries will be marked and kept as spares.


Teams that are just starting out and are not ultra competitive don’t need to worry about this. Just check the battery voltage in System Info. If the battery says 100% after being charged, then you have a good battery.

For competitive teams the simple solution is to buy new batteries before an important event. They will also want to know how fast they are draining their batteries, and which components of their robot are using the most power. They may even decide to change the their strategy if they discover their designs or drive patterns are stressing the battery too much.

What’s a good battery test? Real robots work the motors much harder than my flywheel test. Motors draw the most current when they are about to stall out. The best test is to monitor battery voltage on your real robot while the robot is running. Remember that if you check the voltage after a match, it may say 100%, even though it got down to 75% in the middle of a match.

Teams that are using Modkit can use an LED as a low battery indicator like in this code snippet. However, more sophisticated teams, the ones that would want to monitor voltage, are less likely to be using Modkit. If they are using Python, then they can output their battery voltage to a debug log every half second or so. Does anyone know if Robot C as any unpublished functions to get battery voltage?




Does anyone know if Robot C as any unpublished functions to get battery voltage?

You can get the current voltage with nImmediateBatteryLevel.

Forgot to mention, we added a “SAVE” button to the debug window so that you can easily copy the contents of the window to a file for further analysis. This works in both Blockly and Python.

Interesting stuff. What would be an interesting follow up test is to try a known good and bad battery in a repeatable “real life” autonomous routine and see where the real world differences are and how much of this is ironed out by the built in PID that IQ has (i.e. when commanded to 100% power in the program, does the motor still has plenty of headroom in terms of battery power to achieve this regardless?)

On a less-quantitative note, the VRC program I help with buys new batteries for state and world championships. These become next-season’s competition batteries, and anything older than that is used for testing and development. It’s an 8-10 team program, and we regularly buy 20 new batteries a year.