Designing linear power supply with regulated current and voltage

Hugh Riddle

Joined Jun 12, 2020
78
The heatsinking will be hefty (170W+ at 5A on max AC mains). Also worth noting that commercial linear lab power supplies use a different basic arrangement with the main NPN power transistor operating in grounded emitter mode and have separate (isolated) low-power supply(s) provided for the voltage and current control circuitry (for DIY, can use an extra small transformer), to allow fully regulated operation down to 0V (often important) and for control stability rely on the ESR (series resistance) of an aluminium electrolytic capacitor across the output.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
What load did you connect to check the current mode?
It needs to draw a current above the limit at the output voltage.
You could try a simple short circuit.

[Edit] In your drawing you have the bottom of R11 and C10 connected to Vout. That connection will prevent the current limit working.
The parent circuit is shown as remains as per the original post, therefore the load is set to 5 ohms.

Good catch on the stray connection to Vout! That handled the problem and the current limiting now works however the output voltage maxes out at about 19 volts where it should be able to go from ~1.2V to ~33V, any ideas on why that may be?
Here is the revised circuit:

1606220571677.png

I assume the original idea with LED1 was to light up when the current limiting kicks in, however it does not light up when the current limit is close to the actual drawn current - I am guessing it has to do with the LED's voltage drop. Perhaps I should remove the LED altogether?

Simple solution. Disconnect the top of R4 from the output of the lm317. The negative output of your regulator now becomes the top of r4. Make d7 a short circuit. Base of Q2 to top of r4. The current passes through the resistor to the real ground. Select r4 to drop about 0.6 v at the current limit.
You can make it adjustable by selecting a larger value of r4 and putting a pot across it. The wiper of the pot goes to base q2.
This type of current limit depends on the base emitter voltage of Q2. The cutoff is very soft. Also if you make the variable limit as I described, the power dissipation in r4 is very high st high currents.
Thank you for your suggestions! I assume you are referring to the original circuit which I attempted to use.
I did my best to try and follow your instructions, however simulating this circuit constantly causes the simulations to crash after a few seconds. It also appears to increase the output voltage very slowly. On the other hand, current limiting does appear to work, although I find this particular circuit sort of hacky and prone to failure.

1606220496063.png

Here is an inexpensive rectifier filter board I bought. It has 4 50V rubycon 4700uF ecaps it uses a center tap transformer
the output is dual polarity. You can regulate it the way you want. Don't compromise the quality for anything less than this.
The 50V filter and good diodes and good bypass caps and good board it can function in different ways. Configuration is snap.
...
Thank you for the recommendation sparky, however I am decisive in designing and building my own circuit (with plenty of help) for multiple reasons. Otherwise, there are plenty of affordable lab power supplies which would have fulfilled my needs.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
The heatsinking will be hefty (170W+ at 5A on max AC mains). Also worth noting that commercial linear lab power supplies use a different basic arrangement with the main NPN power transistor operating in grounded emitter mode and have separate (isolated) low-power supply(s) provided for the voltage and current control circuitry (for DIY, can use an extra small transformer), to allow fully regulated operation down to 0V (often important) and for control stability rely on the ESR (series resistance) of an aluminium electrolytic capacitor across the output.
Yes, a large heatsink and perhaps active cooling is to be expected with linear supplies of such power. Parallel power transistors are also planned however excluded from the schematics for now for the sake of simplicity.
Currently I am figuring out the best general idea on the current+voltage regulation, after that we will be discussing improvements on thermal compensation, load regulation, line regulation, precision etc. Of course, within the capabilities of common components and simple extensions.

I like your suggestion on a separate power supply and I believe it will certainly be needed - perhaps in par with some LM78xx and LM79xx regulators for the OpAmp, cooling fans and maybe the VA meters on the front panel.
 

AlbertHall

Joined Jun 4, 2014
12,347
OK, with both voltage and current pots set for maximum and load disconnected, what voltages do you get on:
Output of op-amp
both inputs of op-amp
All three pins of the LM317
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
OK, with both voltage and current pots set for maximum and load disconnected, what voltages do you get on:
Output of op-amp
both inputs of op-amp
All three pins of the LM317
I ran the simulation as per your instructions, the following is a screenshot of the result (the values are stable over time).

1606242076786.png
Screenshot from the regulation circuit simulation with a disconnected load, as per comment #26
 

AlbertHall

Joined Jun 4, 2014
12,347
I ran the simulation as per your instructions, the following is a screenshot of the result (the values are stable over time).

View attachment 223273
Screenshot from the regulation circuit simulation with a disconnected load, as per comment #26
The problem is with the op-amp power supplies. I haven't fully thought this through, but try connecting the ground connections of V3 and V4 to Vout instead.
 

dl324

Joined Mar 30, 2015
16,943
Here's a very simple current limiter:
clipimage.jpg
As mentioned in the notes, you need to consider the common mode input range of the comparator. I used a logic level MOSFET, so I also needed to consider Vgs max.

With a 2.4V zener and a 0.2 ohm current sense resistor, current limit will be 0-12A. In my prototype I used a 3.3V zener because I was using the voltage on the anode as V- for the comparator. I put a resistor in series with the pot to limit maximum current to something that wouldn't damage my breadboard.

You can't observe this circuit in operation with a DVM because the comparator will be toggling unless you're at either extreme.

I haven't seen this limiter circuit used anywhere, hence my obtrusive copyright notice.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
The problem is with the op-amp power supplies. I haven't fully thought this through, but try connecting the ground connections of V3 and V4 to Vout instead.
That only causes the simulation to crash once the load is connected. I also tried to connect the grounds of V3 and V4 to the ground connection under R9 and while it works, it remains the same as before.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
What output voltage did you get without the load?
As I mentioned, as per your instructions the circuit simply causes a simulation error in less than a second - I don't see how that should work anyway. As per my attempt, no change in either loaded/unloaded.

It still may be a problem with the power supplies, however I don't know what else to try short of drawing an entire circuit for that too (the DC sources should be adequate anyway).

As per the documentation:
1606247193135.png

Maybe I should try another OpAmp?
 

AlbertHall

Joined Jun 4, 2014
12,347
With V3 and V4 connected to ground the positive supply to the op-amp is +18V and so this is the maximum op-amp output voltage. This output connects via the LED and a diode to the LM317 adjust pin which will 1.2V below the supply output voltage so there is no way the supply can get anywhere near 33V - the op-amp output will pull down the adjust pin voltage.

I have no idea why the circuit would crash the simulator. Maybe you need a better simulator.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
Here's a very simple current limiter:
View attachment 223286
As mentioned in the notes, you need to consider the common mode input range of the comparator. I used a logic level MOSFET, so I also needed to consider Vgs max.
...
I am not sure how to integrate this into the existing circuit. I am assuming R4 is the current sense resistor which should be placed on the positive end of the load? Is the idea behind this to switch the voltage at the LM317 ADJ pin on and off? How would it integrate with the voltage control pot?

With V3 and V4 connected to ground the positive supply to the op-amp is +18V and so this is the maximum op-amp output voltage. This output connects via the LED and a diode to the LM317 adjust pin which will 1.2V below the supply output voltage so there is no way the supply can get anywhere near 33V - the op-amp output will pull down the adjust pin voltage.

I have no idea why the circuit would crash the simulator. Maybe you need a better simulator.
It may indeed be a problem with the simulation, but I don't see an alternative short of building the circuit, which would take some time and potentially be a waste. I will attempt this same circuit with a different OpAmp and let you know how it goes.
 

dl324

Joined Mar 30, 2015
16,943
I am not sure how to integrate this into the existing circuit. I am assuming R4 is the current sense resistor which should be placed on the positive end of the load? Is the idea behind this to switch the voltage at the LM317 ADJ pin on and off? How would it integrate with the voltage control pot?
Current limit and voltage adjust are still separate:
clipimage.jpg
EDIT: corrected orientation of R6. Note that current limit for this circuit is 0-4.125A.

I'll try the limiter with a regulator on the output to make sure switching it's input doesn't cause problems.
 
Last edited:

dl324

Joined Mar 30, 2015
16,943
I added an LM317 to my prototype and it worked fine.

I tested the current limit circuit with a regulated power supply. When I added the LM317, I didn't add any filter caps and it didn't have any problems having the input voltage switched at 500kHz.
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
Writing just to let you all know that this topic and project hasn't gone stale, I am merely preoccupied with other daily duties.

I added an LM317 to my prototype and it worked fine.

I tested the current limit circuit with a regulated power supply. When I added the LM317, I didn't add any filter caps and it didn't have any problems having the input voltage switched at 500kHz.
I replicated this circuit and initially it seems to work fine however I have not had enough time to test it. My main concern is weather or not the 500kHz switching would introduce any noise to the final output, as it does in SMPS power supplies?
 

dl324

Joined Mar 30, 2015
16,943
My main concern is weather or not the 500kHz switching would introduce any noise to the final output, as it does in SMPS power supplies?
If you have adequate filtering on the regulator output, it shouldn't cause problems. I'll do some tests using it as a constant current source to see if I can see any ripple.

What comparator are you using? Did you make sure power supply voltage is high enough to give you the necessary common mode input voltage range?
 

Thread Starter

kgrozdanovski

Joined Nov 22, 2020
27
Sadly I do not have the necessary equipment at home yet and the simulated oscilloscopes are not exactly a good reference for testing output ripple.

What comparator are you using? Did you make sure power supply voltage is high enough to give you the necessary common mode input voltage range?
So far I have been using LM393 in the simulations however I intend to switch to LT1115 for the final design.
The input voltage after the rectifier and filter stages is approximately 42V, I believe that is enough. There was already enough headroom since the goal is to have up to 30V of output, anything above that i extra.

I was thinking, is it possible to use this switching circuit on the ADJ pin of the LM317? That way we wouldn't need the MOSFET to dissipate all that power and I believe any noise to the output will be less noticable.
 

dl324

Joined Mar 30, 2015
16,943
Sadly I do not have the necessary equipment at home yet and the simulated oscilloscopes are not exactly a good reference for testing output ripple.
I did a test and there is ripple on the output voltage. I need to think about how current limiting is supposed to work and do some research. In constant current mode, you're more interested in current than the actual voltage so why would you care if it varied? The whole point is to maintain a constant current. You can't have constant current and constant voltage at the same time; so I think my circuit is performing correctly.

What is your application?
So far I have been using LM393 in the simulations however I intend to switch to LT1115 for the final design.
In your simulations, what was the input voltage range to the comparator, what was the output swing, and what MOSFET were you using? You need to make sure that the gate goes low enough to turn the MOSFET on hard enough that on resistance doesn't cause unnecessary power dissipation, but it can't bee too large of a voltage difference.

In my prototype, I used low threshold voltage MOSFETs and needed to limit the maximum gate voltage to avoid damaging them. I ended up with a voltage swing of about 5V. To do that, you're going to need to generate the supply voltages. Whether that's feasible for the positive supply depends on how much headroom you have for voltage regulation. In my case, I took 2V for the comparator.
I was thinking, is it possible to use this switching circuit on the ADJ pin of the LM317? That way we wouldn't need the MOSFET to dissipate all that power and I believe any noise to the output will be less noticable.
If you do that, you're limited to a minimum output voltage of 1.25V. Varying the adjust voltage will have the effect of making voltage vary. Again, what is your application for constant current.

My design will have the effect of lowering regulator output voltage to limit current. Changing the output voltage is going to look like ripple to whatever your load is. I didn't consider that to be a limitation.
 
Last edited:
Top