Show by Label

Friday, April 5, 2024

Build a DIY DC Dynamic Load Instrument

 



Building a DIY DC Dynamic Load

The conclusion of a very long time investigating the building of a combined AC-DC Dynamic Load (DL) led me to the realization that this is not really possible. At least not without making drastic compromises about accuracy and precision. The AC measurements do not need to be very precise and are, in my case, only occasionally needed, but DC measurements typically need to have the highest precision, stability and accuracy.

The attempts for this combined AC-DC DL are described in another Blog post. There is a lot of information there, so get some fresh Java and have a look. https://www.paulvdiyblogs.net/2022/08/dynamic-acdc-load-cc-cv-cw-batt.html

The above picture shows a stage in the development with the new DC DL prototype as the basis.

To help design this new version of the instrument, I asked for the help of my friend Bud. He is a real designer, and we've done a number of projects together, like the high current RPi UPS, the VBA Curve Tracer and the Differential Probe all described on this Blog.

Bud started a Blog post on Hackaday mostly for the hardware design aspects that can be found here: Dynamic Electronic Load | Hackaday.io I have added that same information here, so it's all together in one place.

At this moment, we have finished the design of the new version and the final board V5.1 has been produced by my sponsor PCBWay.

I'm still working very hard on the software side, because this instrument will do some things a bit different, compared to many other DIY designs.

I'll explain that later in more details but here are some pictures to hopefully wet your appetite from the previous prototype  V5:



The initial target specifications:

Input voltage: 1..100VDC.

Reverse polarity protection to -100V and a 10A fuse.

DUT is disconnect by a relays for reverse polarity protection.

Maximum current of 10A @ 40V (needs to be verified)

Maximum power 180W (tested & verified)

Volt Accuracy: 0.2% (needs to be verified)

Current Accuracy: 0.6% (needs to be verified)

Power input: 12VDC Wall-wart 0.5A with reverse polarity protection to -24V and PTC fuse

CC & CV modes with real-time operation, CP, CR and Battery Mode supported in software.

Pulse/transient mode supported by an external Function Generator.

Current transition monitoring with a DSO.

GUI: 128x128 OLED 1.5' color display and a rotary encoder with a dual button function.

Two temperature controlled fans


Testing the V4 prototype

This earlier version for the AC-DC attempt is still using the Arduino Nano as the processor. It also had provisions for an on-board transformer, but that got too hot so I took it off.


The Nano is not fast enough to process the CP and CR modes, which are regulated in software. At this time, I was planning on implementing the CV mode in software as well, but that did not work at all with this prototype. While looking for a faster processor, I eventually settled on the ESP32. It has all that we need, even though we won't be using the BLE and WiFi capabilities.

This was the first time I really started to work with the ESP32 so I started to experiment with it. This processor is not only much faster than the Arduino Nano, it has a dual core and it has a native RTOS. (real-time operating system) I was hoping that these major features would overcome the Nano limitations.


The next step was to test the ADC that we were planning to use, the 16-bit ADC1115 instead of the on-board 8-bit ADC from the Nano. The on-board ADC for the ESP32 has too many issues, so we can't use it with this application. The ADC1115 has double the resolution, the down side is that the communication with the chip to get the results through i2c is very slow.


In the above picture you can see that I had removed the Arduino Nano from its socket, and used flying leads to put the ESP32 in its place. I also wired-up the ADS1115 ADC. With this prototype, I still used the 16-bit PWM functionality, but we were already planning to use a hardware 16-bit DAC.

So after checking and verifying the changes, this culminated in a new prototype, that we called V5.


Testing the V5 prototype

Version 5 incorporated the ESP32, the 16-bit ADS1115 ADC, the REF5040 4.096 Voltage reference, the 16-bit DAC8571, test hardware for the CV mode and Bud's vastly improved circuitry to drive the MOSFET's.

Unfortunately, we discovered a few layout issues that we needed to fix by jumper wires and Manhattan style additions. We also found that the ADS1115 was happy with 3V3 i2c voltage levels, but the DAC, that we could not test earlier because of its tiny package, did not. That called for two bi-directional 3V3 to 5V level convertors, and I used a 4-channel circuit board connecting Manhattan style to implement that. To be able to increase the i2c clock speed, I changed the 10K pull-ups to 2K2.

We then figured out a slightly different circuit for the CV mode, eliminating an extra DAC that we were planning to use. Using that earlier method would actually be cumbersome to drive with the planned user interface so the new method uses two CMOS switches to automatically change the configuration to use the DAC for the CC mode and for the CV mode.



Unfortunately, we also found out that the heatsink I was planning to use, that would fit nicely in the enclosure I also wanted to us, could not handle the heat transfer. Not only did things got really hot, we were far away from the specifications! I measured the NFET package temperature at well over 160 degrees C, and the heatsink temperature rose to almost 100 degrees, and that at a mere 90W for only a few minutes. Bummer!

The obvious solution is to use a different heatsink with a significantly larger surface. 

Unfortunately, larger heatsinks are very hard to find, unless you go for the typical PC CPU coolers. The ones that are available literally tower above the NFET, and it's not easy to use them for two NFET's or find an enclosure for this construction. 

We found two that looked promising and I ordered both of them. Luckily, the most promising arrived early, so we could start to test with it. This is the one on the left. It has the largest amount of contact surface. 

The one on the right relies on a fan at the end (or even both ends) to blow the air through. Unfortunately, that calls for a small diameter fan and they have difficulty getting enough air displacement, unless they rotate faster, making a lot more of a whining noise. Which is another reason why it is not my favorite. 


The one on the bottom is the one I had been using. I purchased a number of them for other projects many years ago. I did an extensive search, but I could not find anybody offering them anymore. 

The different heatsink called for drastically different construction because the length of the leads to the NFET's and the critical components on the PCB are very critical. We did not want to split the NFET's and give them each their own heatsink, or their own heatsink side.

This is why we ended-up with the contraption below. It does not need many PCB changes, so was relatively easy to setup and test. The original fan is now moved from the top to the bottom, getting its air from underneath the enclosure. The fan is blowing directly to the fins of the heatsink. We will use a second fan to suck the hot air out of the enclosure, which has ventilation slots.

 

The first test already showed that we could now easily handle 90W for quite some time, which was not possible with the previous setup. The enclosure we selected later required us to rotate the heatsink 90 degrees horizontally, so a fan mounted on the back panel can suck the hot air out.



A longer-term test at 150W showed that we were on the right track. Everything stayed at manageable temperatures.


Let me explain what you see on the above OLED display.

On the top, you see the actual DUT (Device Under Test) voltage ibn blue and below it, the actual current value in green.

Below that it shows the mode (CC = Constant Current) the NFET's are driving the DUT (ON)  and the actually calculated DUT power in Watt. The display is in red because the power approaches the maximum value and is there to warn the user.

Underneath the horizontal line is the parameter you set with the rotary encoder. The mA suffix changes with every mode. The last line shows the actual 16-bit DAC value (while testing) and the heatsink temperature in degrees Celsius. The color is orange to warn the user that the temperature is above 60, it turns to red above 90.

The colors are used to warn the user for conditions like over temperature (90), over-power (150), negative DUT (wrong polarity) Voltage too high (>100V), voltage too low (<1V), over current (>10A), etc.

The discrepancies in the display values for set/actual current are caused by the fact that I don't use the sense inputs yet so the drop in resistance due to the high power and long leads is not accounted for. Yet.

The User Interface to drive the instrument is kept as simple as possible, and I let the software do most of the setup underneath the hood.

The rotary encoder that you see mounted on the PCB is there so I can more easily test the setup with this prototype. It will later be placed on the front panel. In the CC mode, as you see above, you set the current by turning the knob. The knob currently has two speeds. If you turn it fast, the resolution goes to 10x so you get to your destination rather quickly. Short pressing the rotary encode button switches the DUT output to on and off, by turning off the drive to the NFET's. A long press switches to the next mode. You simply cycle through the modes in a loop, so from CC to CV, to CP, to CR and from the BT mode back to CC. When you switch to another mode, the output is automatically disconnected, and the instrument is prepared for the next measurement. The mA suffix you see in the Set line, changes with the modes, so from mA, to V, to W, to R and in the BT mode back to mA. There is no separate transient or "pulse" mode, because this feature can be used in all modes. That may not be very practical in all modes but the pulse functionality is as versatile as your function generator supports. (amplitude, frequency, pulse form, pulse width, rise/fall times and offset)

On the front panel, in addition to the rotary encoder and the OLED display, there will be two toggle switches, one for selecting the sense input terminals, and one to select power. There are two BNC connectors, one for the transient/pulse input and one for the DSO output. There will be an USB-C connector to the ESP32 that is required in the Battery Mode and also allows for updating of the firmware. And finally, two 4mm connectors for the power connections and two 4mm connectors for the sense inputs. Simple and efficient. And no, there is no keypad. It is not needed and I dislike keypads.


A suitable enclosure

The heatsink has been tested and verified that we can now easily get to 150W, but that is still outside of the enclosure. Because of the height of the contraption, we also had to find another enclosure that would accommodate this construction. There are not many compact enclosures that answered our requirements.

We prefer a plastic enclosure, because the heatsink is connected to the DUT  through the non-isolated NFET's and that can get up to 100V DC.

We also need to modify the enclosure to get enough air in and out. And we want to be able to make a PCB-based front and back panel.

The height of at least 9cm dictates that you will get enclosures that are very wide, and not very deep. They are unsuitable for our requirements, but it's up to the other makers to select what they want.

The enclosure we selected is the TEKO AUS33.5. The top one in the picture below is the one I already have and was planning to use, but it is not deep and high enough. We settled on the bottom one. TEKO is a German manufacturer but with a little Google-action, you can find them all over the world, or there are suppliers that send them all over the place. I use www.tme.eu a lot for my purchases, and they carry these enclosures.

So with this version of the prototype, I have been very busy with the testing, implementing and again testing the changes we needed/wanted to make, and all the while further developing the software.


Final Version 5.1 PCB

Based on the now fully working V5 prototype, we have redesigned the board for the new heatsink and made several other changes and corrections. The PCB has been produced again by my sponsor PCBWAY. They financially sponsor this project by producing the boards and sending them to me for free.



The small TO220 heatsinks you see on top of the NFET's help to disperse their heat better, because they are not in the forced airflow. Instead of one 4-pin fan, we now have two connectors so the second fan that sucks the hot air out of the enclosure is also temperature speed regulated by the sensor on the heatsink.

We also switched to another OLED display source, because the one I purchased many years ago was no longer available. We selected a good quality and commonly available version but that has a different pin-out so we fixed that on the PCB as well.

Here is a quick sneak preview of the completed instrument . Note that I switched to larger TO220 heatsinks for the NFET's to get rid of even more heat now that these fins are in the airflow of the second fan.

Here is some detail about the construction. They are all iPhone pics, with a low resolution. Better ones will come later.







The unit has been stress tested with a 180W 15 minute test while using an IR-camera to keep an eye on the temperatures. I believe we can support 200W, but I don't have a large enough current source to test it out. Bud has some high capacity battery cells that he can use, but his stuff is all boxed-up for his house move so we have to wait.


Above is a picture of the completed instrument. The sheet metal front panel that came with the enclosure was used to experiment and try out the connections. It will eventually be replaced with a PCB that will have the silkscreen indicating the functions and connections.

Top left is the 12V DC power switch. The larger empty hole to the lower right of the power switch was a mistake. The power switch was in that position earlier, but it was too close to the ESP32 board so I had to moved it away.

The black oval next to it is the USB-C to USB-micro adapter providing access to the ESP32. The USB connection to a PC is required in the Battery Mode, and can also be used to debug the firmware or upload newer versions.

The four empty holes around the OLED display stem from an earlier attempt to fasten it to the front panel. At this moment, I use sticky tape to mount it. I have an idea that I will try when I design a PCB as the front panel that will not show holes or screws.

To the right is the rotary encoder switch that controls the setup and the measurements.

Lower left is the pulse/transient input BNC connector. It can connect to a Function Generator. The input voltage is 5V for a DUT current of 10A.

Below it are the two 4mm sense input connectors.

To the right is the sense toggle switch, switching the voltage measurement to the sense inputs or the main inputs. 

To the right are the main 4mm DUT power connections.

Slightly above that is the DUT current monitor BNC connector. The output is 1V for 10A of the DUT current.

The back panel has the 90mm fan mounted and also the 12V DC input connector.


Here is an example of the Battery Test mode. This is a Lithium 3.7V 14500 cell. The cell is several years old and had not been used. The specification is 650mAh and I tested it with a discharge current of 2500mA. The cut-off voltage was set to 3V.

These values are entered into the Battery Test PC program below on the bottom left hand side.
The test is started from this program, and it sends the parameters to the Dynamic Load and starts the measurement. 

During the measurement, the display is refreshed with the parameters coming from the Dynamic Load, such as the voltage, the current, the time and the calculated mAh value, shown on the bottom right. The graph is dynamically updated during the measurement.




As soon as the Dynamic Load measures that the cell voltage has dropped below the cutoff voltage of 3V, the measurement stops and removes the load. 

Just above the green Test Ended message, the Controller Message shows a Serial Time-out, instead of the Cutoff Voltage, because it was waiting for another measurement that took too long to send the data. The DL terminates the waiting loop and restarts the reception of the setup parameters or a mode change automatically.

This is a test of an EFEST 14500 IMR cell of 650mAh. These IMR cells can deliver up to 9.75A for short periods, or up to 6.5A continuous. Bud and I used these cells in the Raspberry Pi 3 UPS, to supply enough voltage to let the RPi ride out a power glitch or let it power down safely. I had not used these cells for many years and just charged them again for a few times to run this test. 

With just over 550mAh, the test shows that the cell is no longer meeting the specifications of 650mAh, but is still usable.  

In order to test at higher currents, you really need to use the sense inputs, which I did. I also used a metal battery holder, plastic ones would melt.
 
Note that I faked the Rated Capacity of the cell in mAh from 650mAh to to 2000, to overcome the calculated  time limitation in the software (rated mAh/current), which would terminate the measurement prematurely. You can save the details including the graph, and when you do, you can enter more information about the cell and also add the weight, which is a good give-away indication for poorly "specified" or plane fake cells.

When the measurement is terminated or ended, you can restart the measurement in the PC software and test another cell. Long-pressing the rotary switch on the DL brings you back to the CC mode. The original hardware that was intended for this PC program would also re-start the Arduino Nano controller. We don't need to do that, the DL load automatically takes care of all that.