EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: pelud on September 29, 2014, 06:37:18 pm

Title: LM317 Based CV/CC Lab Supply
Post by: pelud on September 29, 2014, 06:37:18 pm
Hi all,

I have been thinking about a simple LM317 based power supply, and I was hoping that I could get some feedback on it.  It uses some diodes to provide the >1.25V offset of the 317 so no negative voltages are required (although I might change this so it's not so wasteful) and has difference amplifiers connected to current mirrors for controlling the CV/CC loops.  It seems to work well in the Falstad circuit simulator (http://www.falstad.com/circuit/), so I hope it will work well when breadboarded.

Some notes about the circuit:

The 317 is loosely modelled with the group of parts between the IN, ADJ, and OUT labels.

The 220 ohm resistor between the OUT and ADJ pins conveniently provides an approximately 5mA current source from the ADJ pin.

The +/- on the op-amps are reversed due to the inversion from the current mirrors.

There seems to be a slight offset with the voltage and current settings.  I think this is due to the open loop gain of the op-amps (the simulator hard codes this to 100,000).  Lowering the 470 ohm resistor on the current mirrors makes this offset lower, but it can't be made too low as the current mirror along with the 220 ohm resistor will discharge any output capacitance, and can be easily overloaded.  Question: will real op-amps have better open loop gain?
Title: Re: LM317 Based CV/CC Lab Supply
Post by: pelud on October 21, 2014, 09:01:22 pm
I learned that the matching of resistors makes a huge difference to the results of a differential amp, so I figured that I would try using a switched capacitor instead.

I've attached an updated copy of the simulation for falstad circuit simulator, and I have also started creating a version of this circuit using a cypress PSOC 42XX mini kit. 

So far I have only done the voltage part, as I when I tried to add the second part for the current limit I quickly ran out of analog resources on the PSOC.  The analog routing is very limited, so I guess I need to get a bit more "creative" with the MUX.

It seems a bit unstable, although it's much better if I set the op-amp to low power mode.

Be aware that if the micro is not running or just starting up, the output voltage will be the full amount so some sort of output relay may be needed.  I also make a slight change in that the output capacitor is going to the real ground instead of the virtual ground, as it is otherwise easy to make the voltage go negative.  I will see if I can find something non-polarized instead.

If anybody else is interested in this project, I can post some more updated pictures and scope captures later tonight.

Title: Re: LM317 Based CV/CC Lab Supply
Post by: microbug on October 21, 2014, 09:17:09 pm
Quote
So far I have only done the voltage part, as I when I tried to add the second part for the current limit I quickly ran out of analog resources on the PSOC.  The analog routing is very limited, so I guess I need to get a bit more "creative" with the MUX.
IDK exactly what you are planning, but the analog mix in a PSoC 4 is basically a standard 4000 series mux - they are cheap and you could easily add a few if needed.

Analog devices does some nice muxes with much lower on-resistance if you need that. (e.g., ADG714/5)
Title: Re: LM317 Based CV/CC Lab Supply
Post by: miguelvp on October 22, 2014, 04:09:24 am
You might find this interesting:

http://www.element14.com/community/thread/27064/l/idac-conversion-to-vdac-enabling-two-idacs (http://www.element14.com/community/thread/27064/l/idac-conversion-to-vdac-enabling-two-idacs)

There is a sample constant current "IDAC8_PSoC4_Example" under File->Example Project
Although that one uses a 2x16 LCD display but you should be able to get rid of that part.

Here are my results from that sample code.
https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg508725/#msg508725 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg508725/#msg508725)

Combine that constant current with the link above to get constant voltage out of the constant current.

Not sure if that will satisfy your needs because I don't exactly get what you are trying to do, but I thought it might help. There are also other posts on Page 5 and 6 of that thread that you might like, but unrelated to your project.