Electronics > Projects, Designs, and Technical Stuff

Digitally selected power supply, or, I'm not quite as clever as I thought I was.

(1/2) > >>

poodyp:
I thought I'd try to add simple digital selection to a simple LM317 power supply I made using a PIC. I started by making a DAC using PWM and a two stage RC low pass filter, then feeding that into an op-amp to scale the 0-5v from the PIC to 0-12v, then fed that into adj pin on the LM317.

The problem I discovered is that the output won't go below ~3v. My guess at what's happening is that when the output from the op-amp is too low, the output of the 317 is feeding itself because there's no path to ground. Is there some way I can fix this? Or is my design flawed?

Thanks.

Bored@Work:
You need to drive the ADJ pin of a 317 to -1.25V (yes, that is a minus) to get 0V output. This requires that your op-amp has a negative supply, and the op-amp biased that it generates -1.25V output when the input from the PWM DAC is 0V. Do you have a negative supply? Do you have the op-amp biased?

If not, the best you can get with a single-supply is +1.25V output. This requires that the single-supply op-amp can go down to close to 0V. And that requires a rail-to-rail op-amp. Do you use a rail-to-rail op-amp?

If you get +3 V output it means your op-amp is driving the ADJ pin down to +1.75 V only. Measure that. Especially without the 317 connected. Further, do some math. The current the op-amp needs to sink is dictated by the resistor you selected for the OUT - ADJ resistor of the 317. The typical values for this resistor result in 5 mA or 10 mA current the op-amp has to sink. Check in the datasheet of your op-amp if yours can sink so much current. If not, you can increase the resistor to around 1200 Ohm, but then need to make sure that you connect a load that ensures the 317's required minimum load is met.

poodyp:
So I did some more testing. I wasn't thinking and didn't realize the op-amp had to sink the current, not source it. I'm using an LM324 and while it can source 20-30ma, it can only sink 8ma. I was using a 120ohm resistor so I swapped it out for a 1k and put the 120 between Vout and gnd, Vout dropped to 1.2v.

I only used the LM324 because that's the only op-amp I have on hand. What are some good generic op-amps I can keep around just to have on hand?

Thanks for the help.

NiHaoMike:
Replace the LM317 with a MOSFET and change the circuit accordingly. Or use a charge pump (run from one side of the transformer secondary) to get a negative voltage for the opamp.

Zero999:
If the LM317 is replaced with a MOSFET, you'd loose the overcurrent and thermal protedtion and you'll need the gate voltage to be 5V above the output voltage (assuming it's a logic level device).

It's possible to use the LM324, if it has a negative supply. Increasing the R1 may cause the output voltage to rise at no load.