Battery Performance Tester

Stuff I am working on
Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Sun 06 Sep 06 2009 8:42 pm

The second test is done - the unit is is working but there is some weirdness. I thought that this was due to a lack of resolution in the first test but now I have the same problem in higher resolution.
Second-Test.jpg
Second-Test.jpg (47.06 KiB) Viewed 3025 times
Observe how it looks like some kind of regular oscillation that affects all channels. The cyclic rate of the anomaly is not totally constant, ranging from about 545-seconds to 511-seconds. Not only that, it appears that channel-2 trails channel-1 by a variable amount, ranging from around 15-seconds to 22-seconds or so.

Notwithstanding that - it appears that both the units ended pretty closely, attesting to the good calibration work. Now, I just need to figure out where this strangeness is coming from. The calculated capacity of the (almost) fully-charged batteries is 720mAh and 724mAh respectively, for BATT1 and BATT2. Being that these were originally rated at 1600mAh, this looks like a believable figure given that these batteries are in pretty bad shape. I think I need to automate the capacity measurements. More testing needs to be done with known good batteries to ascertain if capacity calculations are correct.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Sun 06 Sep 06 2009 10:19 pm

Hmm... okay, now I have a theory. This has to do with the sampling rate vs. the PWM frequency. The PWM is operating at a frequency of 1kHz whereas the ADC sampling is taking place at 10kHz. However, the way we calculated this sampling rate is from Fcy/SAMPRATE for the period, which isn't exactly accurate. It really should be Fcy/SAMPRATE-1. So, instead of a 10kHz sampling rate, we are actually getting 9997.500625Hz instead. What this does, I think, is that you end up with a beat frequency against the PWM frequency that may correspond to the roughly 0.00183Hz (or 0.0009Hz).

The effect of this difference in frequency is that the ADC will sample across different sections of the PWM pulse over time, and thereby giving slowly varying readings. So, the thing to try now is to correct the sampling rate to exactly 10kHz which is a fixed multiple of the PWM frequency so that we get the same sampling window for all samples.

The implication of this (now that the DMM capture is in progress) is that this variation is false. We would now expect the DMM log to show no such voltage variation in actuality and that it is purely an artefact of the flawed sampling arrangement. We will know this shortly.

*update: Preliminary tests shows what we already know to be true, that I'm a genius, haha! This really fixed the problem - we now have over 1600secs of reading without the crazy fluctuations. Now to sort out the way to get more accurate RMS readings.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Sun 06 Sep 06 2009 11:32 pm

Proof of genius-hood follows:-
Third-test.jpg
Third-test.jpg (42.94 KiB) Viewed 3025 times
The little quirk at the beginning is probably the result of me fidding with the battery connections. What we need to do now is to calibrate the voltage under non DC conditions.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 12:14 am

I attached the scope to the test point to look at the discharge profile and it is looking like maybe my own ADC is yielding a more accurate average voltage than the Fluke, possibly due to the customized nature of my MA filters. I think I will just leave things as they are at the moment.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 2:02 am

The first proper and complete discharge test is done, on the Sanyo 2500mAh Ni-MH (HR-3U). The reported capacity was 2764mAh but we're not really sure about the capacity calculations at this point. The capacity should be pretty high though. This battery has only been through one full-cycle before this test.
Sanyo-2700.jpg
Sanyo-2700.jpg (55.61 KiB) Viewed 3024 times
Our on-board capacity integrator seems to be off though, and needs some more work.

*update: Turns out the capacity computation was correct afterall, and the results agree with the Excel sums. It looks like there might be something else at work here - possibly our resistive coefficients.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 9:15 am

Further tests show the system to be working correctly now. The issue we keep coming back to is calibration and accuracy. Due to the integrative/cumulative nature of the capacity measurements, any error in the load calibration will be exaggerated in the results. Take the following chart, for example:-
AB-test.jpg
AB-test.jpg (54.88 KiB) Viewed 3023 times
Both these batteries came off a charger so they should be reasonably matched. At the start, you can see that channel-2 has a lower terminal voltage. We do not know for sure, at this time, if this was due to the battery differences, or to the load calibration differences. In either case, the load difference should be less than 1%. Measuring the terminal voltages show a difference of only 0.0058V (graph has been zoomed in), representing only about 0.6% variation - which, given my tools, represents a pretty darn good achievement.

Here's the thing, though - even with such a small variation, the discharge time varied by about 205.3-seconds, representing a variation of about 3.37%. So, any error, even a very small one, is going to be magnified in proportion to the time it takes for the test to complete. We can reduce the cumulative error by shortening the time it takes to complete the test. This would entail running a higher discharge current. Ideally we should also have current measurement capabilities but that would involve considerably more hardware - a bigger MCU (we're out of pins, remember), current sensing hardware (which will have calibration issues of its' own), to name two.

Or, we could develop even more precise calibration schemes, although I think it's going to be quite hard to beat 0.6% at this current rate. Even if we did, there would still be some error and this would be non-linear, given our quadratic interpolation used to generation the PWM dutycycles. It might be better to just build in a hard (or maybe soft) correction constant if we can get solid comparative data on the capacities from a calibrated instrument (such as one of my other chargers). This might be the easiest way to go. Alternatively, I could take the same battery and run it through various channels and comparing the graphs. Although not terribly reliable, it might work if we assume that it is charged to the same level each time, and that the charge capacity remains essentially the same. Basically, we need to calibrate against known values.

Another issue I need to look into is the constancy of the Rds across different Vds levels, assuming a fully driven condition. I suspect that Rds is non-linear, especially with low Vds but I can't be sure about this - so, some homework needs to be done here.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 11:03 am

Did another set of tests with GP1600 batteries that are very old. We can't say a whole lot about these just yet since they are not properly rated or conditioned.
GP-1600-1234ABCD.jpg
GP-1600-1234ABCD.jpg (71.13 KiB) Viewed 3022 times
Seems like there are some connection issues on channel-4. Also, by chance or systemic flaw - the voltage on channel-1 is higher than on channel-2 and so on. Also interesting is the cell on channel-1 ran at a higher voltage but crashed out a bit earlier.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 6:33 pm

Hmm, I am now measuring the drawn current during a discharge, and during the initial phase I am seeing that the current draw does not correspond to the resistance reported by the DMM. To start with, I have (recorded to 3-decimal places but computed using 4-decimal places):-

0.978V and 0.893A giving 1.0952ohms
0.951V and 0.868A giving 1.0950ohms
0.948V and 0.865A giving 1.0954ohms
...
0.941V and 0.849A giving 1.0962ohms
0.928V and 0.847A giving 1.0967ohms
...
0.922V and 0.840A giving 1.0978ohms
0.922V and 0.840A giving 1.0980ohms
...
0.890V and 0.812A giving 1.0966ohms
0.888V and 0.810A giving 1.0966ohms

This corresponds very closely to the actual load resistance, with possibly a very small Rds. If this is true, then the dutycycle is way off in terms of computing it from the quadratic extrapolation. The key throw-off is coming from the resistive measurements from the meter which, I am suspecting, isn't working on a non-linear and, in particular, a switched load. If this is true, then we may have to just go with a more duty-cycle specific computation based on actual measured resistance and ditch the DMM measurements altogether. This could actually work very well since we can get pretty accurate duty-cycles. The issue here, though, is that we can only get resistive measurements up to 0.01ohms precision from our meter so this will mean that the best accuracy you can attain is 0.1%. This is something that we are going to have to investigate.

The second problem, which might be more problematic, is the Rds linearity. I'm hoping that this will represent a negligible variation if there is any so that we can ignore it for the most part. There appears to be an increasing load resistance as measured by the current reading. This is also assuming that our voltage measurements are more accurate than that of the DMM's.

I think the easy way out of this quandry is to use more precise load resistors. Power-resistors, however, seldom come with very high precision and even when you get high-precision ones, we're talking about +-1% error, giving up to 2% variations. The other way would be to use a DMM and hand-select them. This way you can get up to the 0.01ohms precision of the DMM but that would entail going to the shop and hoping that they will allow you to bin the parts. I may just have to do this.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 8:32 pm

The next test shows that CH1 is indeed miscalibrated or at least calibrated high since it consistently applies a lower load than it should.
GP-1600-1234ABCD-2.jpg
GP-1600-1234ABCD-2.jpg (79.59 KiB) Viewed 3019 times
CH4 is especially low, possibly because of the ammeter that's in series with the positive terminal. What is interesting, though, is that all the tests terminated within 230-seconds (3.8mins) of each other.

Note the current chart logged from CH4 as follows:-
Current-CH4.jpg
Current-CH4.jpg (54.13 KiB) Viewed 3019 times
This was yielding a resistance value mean of about 1.096ohms or so, based on the current and voltage readings. Ironically, the most accurate measurements of the load resistor values are 0.98ohm, 0.99ohm, 0.98ohm, 0.98ohm, 0.97ohm for CH1 to CH5 respectively. This means that they are all within 1% of each other with the worst case being CH2 (high) and CH5 (low). By this measure, the voltage on CH1 should at least match the voltages on CH3 and CH4, with CH2 being high. That said, the terminal voltages were different from the start with the highest terminal voltage on CH2, CH1 and then CH3 and CH4. It is possible that the Rds from the MOSFET has some variations and if so, swapping out the CH1 MOSFET might work. Initial tests show, however, that CH1 and CH3 does match.

We are also observing some oddities in the way the voltage drops during the initial 20seconds of the test. This could be indicative of a PWM algorithm failure.

Daniel

Daniel Wee
Site Admin
Posts: 2084
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Battery Performance Tester

Post by Daniel Wee » Mon 07 Sep 07 2009 9:05 pm

The basis for our quadratic extrapolations in the PWM-resistance relationship comes from actual measurements using the DMM, taken at the battery holder terminals. The idea was to get the actual readings, taking into consideration all of the connector and wiring resistances. It was also assumed that the DMM would at least be consistent, if not accurate, over the PWM range involved, and that the MOSFET Rds would be comparable and negligible. These last two assumptions I am not so sure now. The data we used is as follows - plotted against the inverse duty-cycle:-
Inverse-PWM-resistance.jpg
Inverse-PWM-resistance.jpg (55.94 KiB) Viewed 3019 times
It would appear, going from the chart above, that CH4 is the one that has a higher resistance at any given duty-cycle setting. The curve fit was supposed to even out these variations. We do not, however, see any reason for CH2 to be exhibiting particularly lower resistance (and hence lower terminal voltage) than CH1. The other oddity, is how CH1, in spite of showing higher terminal voltage than all the other channels, and thus implying a lower resistive load, ends up with the steeper "knee" and earlier charge termination. These anomalies need exploring and explanations.

The real problem I am having with the chart is that it doesn't make sense from a physics point of view. If you have a load drawing current I and having a terminal voltage V, then the resistance will be V/I. Now, if we half the duty-cycle of the load, you will end up with a pulsed current that is turning on half of the time - effectively giving you half the current drawn - and therefore at 50% PWM on the load, and a square wave current - we should theoretically be getting R/2 as the effective resistance. The DMM, however, doesn't agree with this and is giving us a 2.06ohms reading at 96% duty-cycle, which is nowhere near the 50% duty-cycle that we are calculating. At this point, I am guessing that the DMM is being confused by the non-linear load characteristics - which means that we need to find another way of verifying our effectiveness. We might be able to use the PSU for this although the PSU is itself a switcher - what we need is a linear regulated 1V source that's capable of at least 1.5A for this job.

Daniel

Post Reply