I got a used 250VA power transformer that was removed from equipment a couple of weeks ago. The transformer has a dual 10V AC output and a few auxiliary voltage outputs. The 10V winding is rated at 10A, I thought it would be perfect for a high current power supply project.

For this particular build, I used the reference design for LM338 5A adjustable linear regulator as the base. Rather than designing digitally controlled voltage adjustment circuitry (e.g. via DAC), I decided to just use the simple resistor-potentiometer voltage control mechanism and add the digital voltage/current monitoring portion. Here are some of my thoughts behind this reasoning:

  • By adding the digital voltage adjustment functionality via the three terminal regulator’s Adj pin, we would have increased the complexity of the control loop. In a power supply, the reliability of the control loop is essential to the stability of the output voltage. If the Adj pin somehow becomes floated due to circuit malfunction, the result could be disastrous as the input voltage would be applied directly to the load.
  • Also the stability and the accuracy of the external reference affect the accuracy and the ripple rejection of the power supply as well. This must be taken in to consideration when using a DAC or PWM circuitry to drive the linear regulator’s Adj pin.
  • Last but not least, since the output voltage of the linear voltage regulator would essentially be controlled by the MCU, adequate filtering and monitoring (e.g. via watchdog timer) as well as careful designing of the board layout are usually needed for the MCU circuitry to work reliably.

Given the above thoughts, I decided to keep the core circuitry as simple as possible using the reference design and using the MCU only for current and voltage measurements. That said, if you intend to build a digitally controlled power supply, you can hop over to Dave’s site. He has series of videos on how to design and build a digitally controlled power supply.

Now, I’ll discuss some of my design considerations.

The very first thing comes to my mind is the power consumption of the LM338. The TO-3 version of LM338 can dissipate around 50W heat with the proper heat sink. The TO-220 version can handle roughly half of that due to the increased thermal resistance. In either case, a single LM338 would not be able to provide 5A of continuous output current at voltages lower than 10V if the input voltage is pegged at 20 volts. In order to obtain the desired 5A current over the input voltage range and stay within the thermal envelop of LM338, the input voltage needs to be adjusted accordingly when the output voltage changes. A simple method to achieve this is to use a comparator with hysteresis to drive a relay so that the input voltage to the regulator can be switched between the two windings of the power transformer (in this case, the input voltage is switched between 10V and 20V depending on the output voltage). More switch points are also possible, but the design would be more complicated and multi-tap transformers are harder to find.

The following schematic shows the voltage selector portion of the circuit using LM339 comparator:

Input Voltage Selector
Input Voltage Selector

Using the parameters given above, the switching point is at around 7 volts with a hysteresis of 1V. When output voltage is below 7V, the 10V output from the transformer is selected and when the voltage is above 7V the 20V output from the transformer is selected. By adjusting the input voltage according to the current output voltage, the maximum power dissipation of the LM338 is significantly reduced. You can use this tool to calculate your desired trip point.

To keep the heat sink small, I employed forced-air cooling. The cooling fan is controlled by another comparator (see circuit below) and by adjusting the potentiometer, you can achieve the desired fan on/off temperature. The hysteresis is necessary so that the fan does not turn on and off constantly when the temperature is near the tripping point.

Fan Controller
Fan Controller

As mentioned earlier, the actual LM338 circuit I used is almost identical to the reference design. Some slight differences are shown in the schematic below:

LM338 Power Supply
LM338 Power Supply

To monitor the current flowing through the regulator, a shunt resistor is placed right before the LM338. By placing the shunt before the LM338, the current measured would be a few milliamps higher than actual current value flowing through the load as there is some current flowing through the voltage divider and the Adj pin. This offset can be easily removed in code though. Alternatively, a voltage follower can be used so that larger resistor values can be used in the voltage divider. But even with the use of voltage follower, there will still be some small constant current through the Adj pin.

I used MAX4375 with a gain of 50 as the current sensing amplifier. Since the maximum ADC input is limited to the 2.5V reference voltage, the maximum voltage drop across the current sensing resistor is limited to 50mV when the load current is 5A. So the value of the sensing resistor needs to be around 10 milli-Ohm. In my design, a 7 milli-Ohm shunt resistor is used so it will give enough range in an over-current situation. MAX4375 has two build in comparators which could easily be used for over-current detection. I may add such functionality later, but for now these comparators are not used.

The voltage measurement is taken via a simple resistor voltage divider, the value of the resistors are chosen so that the maximum output voltage does not exceed the voltage reference of the analog-digital converter (in this case the voltage reference of the ADC is 2.5V).

The ADC I used is an AD7706 which can be used in either buffered or unbuffered mode. In my implementation, unbuffered mode is used. One thing we need to remember is that in unbuffered mode the ADC input impedance is significantly lower than in buffered mode. This means that the the resistors used in the voltage divider need to be small enough so that the ADC input impedance does not affect the reading accuracy. As mentioned earlier, we could add a voltage follower to the resistor divider to solve the impedance matching issue. Alternatively, we could also implement the ADC in buffered mode, although the common mode input range would be more restricted.

AD7706 ADC
AD7706 ADC

AD7706 offers 16 bits of resolution and a voltage resolution of well under 1 mV and a current resolution of under 1 mA can be achieved. The accuracy depends partially on the precision of the voltage reference used. The voltage reference TL431 I used is hand-picked with a reference voltage of 2.500V. The code included later uses the AD770X library. You can see my previous blog post for more details.

The transformer I used has a 14V auxiliary winding, which is perfect for the 12V and 5V Vcc needed for the MCU, ADC and the comparator circuits. The following schematic shows the simple auxiliary 5V and 12V power supply using 7805 and 7812.

Power Transformer and Auxiliary Power Supply
Power Transformer and Auxiliary Power Supply

[adsense]

Finally, the ADC values from AD7706 is fed to an ATmega328P MCU via SPI and the information is then displayed on a 2×16 LCD.

MCU (ATmega328P)
MCU (ATmega328P)

The picture below shows the circuit board of the finished power supply. Everything except the power transformer fits on a perfboard easily. Since the transformer itself is quite large, I mounted it separately in an old ATX power supply case.

Power Supply 1
Power Supply 1

The power from the transformer is brought in using 12 AWG wires and are connected to the main board via disconnects. A thinner cable brings in the rectified and filtered auxiliary power. The following picture shows the power transformer enclosure and the power supply project box side by side.

Power Supply 2
Power Supply 2

Here is a picture of the finished power supply. At 1.26V, 1A, the power dissipation of the LM338 is roughly 7W. The heat sink by itself can handle the power dissipation without any issue and the fan does not come on even after prolonged use.

Power Supply 3
Power Supply 3

LM338 is actually capable of output current in excessive of 5A. The following picture shows the power supply operating at 10.4V 5.9A. In this situation (the worst case scenario) the power dissipation of LM338 is quite high, at around 60W. While this is higher than the maximum recommended power dissipation, the current output remains stable for prolonged use and I suspect the forced air cooling is able to remove much of the generated heat at a reasonable rate to prevent the regulator from thermal shutdown. But the heat sink does get pretty warm.

Power Supply 4
Power Supply 4

Finally, the code used in this project is included below for reference.

Download Source Code:

PowerSupply.tar.gz
AD770X1.1.tar.gz

Be Sociable, Share!