Today I started analyzing the device to first observe how it functions, and then see if any improvements are possible. I looked at several things-the power supply, the current control, and the integrator.
Before trying any modifications I first tested the device discharging a few cells. My primary complaints are that the current bounces around the set point by several mA (with occasional excursions which are somewhat larger), and it apparently calculates the mAh by multiplying how long it's been running by the current setting. I came to the latter conclusion by noting that if I set it for 1.00 amps, it reached 1000 mAh exactly when the elapsed time reached 1:00:00, 2000 mAh at 2:00:00, etc. In short, it appears to assume the actual current averages out to the set current, instead of simply calculating mAh by measuring actual current, multiplying by the time since the last measurement, and adding that to the total. That said, it still seems reasonably accurate once calibrated. For example, I got 4607 mAh from a cell which had tested between 4609 and 4621 on several of my testers. I made two capacity testers a while back using the MCP3421 ADC and an OLED display. The firmware I wrote let me calibrate them to within 0.01%. I used 0.1% sense resistors and a Fluke 189 DMM to measure the sense resistor voltage. I also used a 32768 Hz crystal for the time base. Therefore, my testers should be accurate to 0.1% or better. Apparently with calibration it's possible to get the DL24/DL24P just as accurate. It all depends upon the accuracy of the equipment you're using to calibrate. 0.1% is good enough since testing the same cell often gives variations larger than that, even using the same tester.
Now on to my findings....
POWER SUPPLY
Some here have mentioned that the included power supply is junk. From my observations it seems to be adequate. I tried a few other, better 12
V supplies but still ended up with the current bouncing around the set point. I also tried putting filter caps on the board up to 3300 uF. They made no difference. The reason for looking at the power supply first is in my experience often when there are issues with a circuit the root cause can be a noisy power supply. I did measure ripple of around 15mV on the 3.3V line. I tried a 1000uF cap on the 3.3V line. It succeeded in reducing the ripple to about 3mV but the current fluctuations remained the same. Apparently then any issues aren't caused by the power supply.
CURRENT CONTROL
I first took measures of the current control voltage and Vgs of the MOSFET at various current settings. Here were the results:
Amps Control Voltage MOSFET Vgs
1 7.50mV 3.82V
2 12.26mV 3.97V
3 17.03mV 4.08V
4 21.77mV 4.16V
5 26.52mV 4.23V
6 31.28mV 4.30V
7 36.03mV 4.36V
8 40.79mV 4.41V
9 45.55mV 4.46V
10 50.32mV 4.51V
15 74.14mV 4.73V
20 97.96mV 4.97V
The control voltage readings nicely fit a linear plot with the value 4.76mV/A and an offset of 2.74mV. I noted that the control voltage sometimes fluctuated by 0.1mV or more. This accounts for the actual current bouncing around a bit.
Prior to using the device I installed back-to-back 5.1V Zener diodes between the MOSFET gate and source. This should clamp the voltage to 5.8 or 5.9 volts. Apparently that's high enough for the MOSFET to still pass the maximum current of 20 amps.
I also looked at the current control voltage with my scope. There are small oscillations roughly every 13.5 milliseconds.
I tried a few things to attempt to get a more stable control voltage. I paralleled caps up to 470uF with C4 (0.1uF). C4 is the last filter cap for the current control. While large caps reduce some of the oscillations, the current reading still fluctuates. I also tried putting a cap in parallel with the shunt resistor. I've seen voltage regulators which do this. I tried 100uF, and later 3300uF, but no improvements.
INTEGRATOR
I tried increasing the time constant of the integrator by putting caps as high as 100uF in parallel with the integrator capacitor C1 (0.1uF). Most values made things worse. I removed C5. It apparently makes no difference if C5 is there or not. I left it out because it creates a pole which could result in instability.
OTHER OBSERVATIONS
Nothing I did improved the current stability. The integrator circuit is almost identical to ones I've used, so I'm 100% sure it's not the root cause of the problem. The fact the current control voltage fluctuates point more to that as the source of problems.
EDIT: I just tried applying voltage to the current control input of the integrator with a resistor divider and stable power supply. The current reading was rock solid stable, basically confirming that there's nothing wrong with the integrator part of the circuit.
The solution of increasing the shunt resistor and recalibrating to get more stable currents might be viable if you don't need currents over 6A. So far I haven't found any other solution but I think the root cause of the problem is using the timer PWM to set the current control voltage. The fluctuations might be artifacts of the PWM changing duty cycle or frequency. A better design would have used a discrete 16-bit or better DAC to set the current control voltage. However, this would have added to the cost.
Also mentioned earlier was the fact the microcontroller can't read shunt voltages over about 120mV. Looking at the data sheet for the RN8209C ADC the maximum differential input for each of the 3 ADC channels is ±1000mV. However, there is a PGA in front of the ADC for the current channel which can be programmed to 1, 2, 8, or 16. It appears to be set to 8, which limits the inputs to ±125mV.
OTHER THOUGHTS
The device as is isn't horrible with a few minor improvements. I highly recommend installing back-to-back Zener diodes, and possibly enhancing the current paths so the device can reliably handle 20 amps. I also recommend calibrating it if you have access to very accurate voltage and current sources.
I suspect it might be possible to do something about the current fluctuations in the firmware but this is something only the manufacturer can do. Again, I think the problem is an artifact of using PWM for the control voltage.
I also don't think it's entirely necessary to upgrade the device for higher power, even if you need to test well in excess of 150W. Here's my reasoning. If your use case is mostly testing single cells, then at most you'll be dissipating ~80W even at 20A. If you're testing batteries, then you can insert an external resistance in between the load and the device to absorb most of the voltage. For example, it's possible to test a 50V, 20A power supply by putting a 2.25 ohm, 900W+ resistor in series with it. The resistor will absorb 45 of the 50 volts, leaving the tester to only dissipate 100 watts. You can even make your own resistors with resistance wire. They might get hot enough to glow red while testing, but no need to buy expensive resistors, or use giant heat sinks. This is likely what I'll do should I need to test well over 150W.
Some people here mentioned using MOSFETs designed for linear operation. Reading up on the subject a bit more if you derate the power by a factor of 3 or so, you can safely use standard MOSFETs. I've used standard MOSFETs for the electronic loads I've designed. Then again, I've never come anywhere near their rated power in operation. If you're aiming for 150 watts on the DL24 with a standard MOSFET, then buy one rated for at least 450 watts. The primary advantage of using standard MOSFETs is they're much less expensive. Since I had a parts order from Mouser for another project, I also bought a pair of IRFP90N20DPBF. Power rating is 580W. I can probably safely run these up to maybe 200W. A comparable linear MOSFET ( IXTH60N20L2 ) costs about 3 times as much, although I would be able to safely go to its full power rating of 540W.
I might buy a few of the DIY devices to test/modify. They're certainly cheap enough. The parts alone would cost me more than the ~$20 they sell for.