Circuit Peer Review: High Current LM317 CV Power-Supply - Page 1
Forum section: electronics / projects

author: Stephen Hill
author_rank: Regular Contributor
timestamp: April 19, 2012, 04:11:26 pm
content: Afternoon,I'm still learning electronics and in order to improve my designs it's about time I got some feedback from the community.Today I've whipped up a design for a high current LM317 power supply and I would very much appreciate constructive comments, criticisms and suggestions.It's essentially a very basic circuit: transformer, bridge rectifier, filter caps, LM317, power NPN's. The voltage range will be 0V to 24V and I don't expect to use any more than 4A. A micro and LCD could probably be added to measure voltage and current. Here is the schematic:The notes in the schematic say:» D6 Discharges C4» R1 Discharges Filter Caps» R2 Limits Inrush Current into LM317» R3 500ohms 22 Turn Trimmer» R4 5K Potentiometer» R5 Minimum Load, 1mA at 24.576V, 24K + 576ohms in Series» R6 Current ShuntI look forward to reading your repliesMany ThanksStephen

author: Kremmen
author_rank: Super Contributor
timestamp: April 19, 2012, 08:28:28 pm
content: My 2c.Basically the circuit looks more or less OK. Regarding the voltage setting resistors of the 317 I would check the literature, so that you don't end up bending the rules out of shape. Also you might want to think some kind of range limiter resistors in series wiuth the pot. I am not sure if the regulator likes a short in the divider. But then again it may - can't remember offhand. Its been a while since i played with 317s.Please throw the 2N3055s out and put in something invented during this millennium. The days of those dinosaurs is truly past. Something starting "MJ..." would be the thing to specify in my opinion. Or why not just use a Darlington in the first place.Finally, you seem to have a really exact spec for the ballast load resistor. Do you really need it to be that precise? If you need a milliamp, OK but surely 1,2 mA or whatever you would get from one E12 series component would do as well.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 19, 2012, 09:00:26 pm
content: probably... and most likely... your LM317 is sensing its output... not the "true" output. so if something whacky going on to the darlington, lm317 will not aware of it. and blimey, if the darling going whacky, its not pretty, esp when you have precious gem on the "true" output. my bet is put the R3, R4 et al at the "true" output.

author: TerminalJack505
author_rank: Super Contributor
timestamp: April 20, 2012, 04:16:44 am
content: D2 and D4 aren't rated high enough. They need to be rated the same as D1 and D3. All of the current that goes to your circuit's ground is going to go through either D2 or D4.With the current circuit configuration, D5 and D6 don't need to be nearly as beefy. Perhaps you swapped them with D2 and D4? Right now the only current they will see is what gets discharged from C3 or C4.Finally, like Mechatrommer pointed out, the LM317 isn't in the overall feedback loop so it isn't truly regulating the output. The LM317 is really just serving as a voltage reference for the base of the Darlington pair in this configuration. You might consider basing your circuit on one of the 'high current' regulator circuits that can be found in the LM317 datasheet.

author: Kremmen
author_rank: Super Contributor
timestamp: April 20, 2012, 05:03:13 am
content: Oops missed the diodes. Never crossed my mind to check that - why would they be different since they see the same current...The comment about the feedback loop sounds right. Reason why i said nothing is that i seem to recall a paper that recommended doing it like this instead of directly from the output. There was some other reason except accuracy of regulation but i cannot remember what it was and can't locate the paper to check.

author: Harvs
author_rank: Super Contributor
timestamp: April 20, 2012, 06:32:30 am
content: Unless there's a particular reason why you've done it, a darlington pair in this type of application would normally consist of a medium power, medium gain transistor followed by your high power, low gain model.In this case I don't really even see the need for the darlington pair if you're using the 1.5A variant of the LM317.If you did need to use a darlington pair, perhaps consider something like a BD139. Being a lower power transistor, it has a higher Hfe, smaller footprint and it's cheaper.You don't say what you're input voltage is, but assuming it's a couple of volts high than your max output, say 28V. When you pulling 4A @ 1V from the output, you're dissipating 100 watts or more in the output transistor. That's just too much for one transistor, it can dissipate 115W if you keep the transistor case temp down at 25 degrees C, which is totally impractical. I would spread it across a few of them.

author: TerminalJack505
author_rank: Super Contributor
timestamp: April 20, 2012, 10:21:10 pm
content: Quote from: Kremmen on April 20, 2012, 05:03:13 amNow that I think about it, you're right. It's probably because of the 1.25V reference between OUT and ADJ. The part would need a separate sense pin to work the way I suggested.It should work as-is but, like you say, be a bit inaccurate.

author: Stephen Hill
author_rank: Regular Contributor
timestamp: April 21, 2012, 08:34:04 am
content: Hi All,Just want to say Thank You for taking time to review my circuit and give me your feedback. When I get some spare time over this weekend, I'm going to look over the circuit and make some improvement/changes based on some of your feedback.So I'm still here and I'll get back to youMany ThanksStephen

author: free_electron
author_rank: Super Contributor
timestamp: April 21, 2012, 12:13:44 pm
content: Why on earth do you want to use shottkys for a line rectifier ?Like mechatrommer said you are not regulating the output. This is not a power supply at all. It is a simple voltage follower.Why does everyone want to make power supplies with that fleabag of an lm317.Make a nice clean supply with two opamps and a power stage. One opamp does voltage, the other current.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 21, 2012, 04:50:26 pm
content: Quotenot even a follower if the darling goes whacky. dont be too harsh electron, save your juice! you are going to need that in near future. think like "kindergarden school teacher"(i dont mean anything to OP, this is just for electron)

author: free_electron
author_rank: Super Contributor
timestamp: April 21, 2012, 05:30:56 pm
content: The problem is that the 'hobby' electronics world has watered down to 'lm317' and 'arduino'Need to do this ? Take a hard-whino and slap some other tidbits on. No need to know or understand anything. Just slap some crummy code together.Forums are full of topics like. 'How can i do something while in a delay routine' (eye roll mode... Who throws delays and idle for next loops in code ... Sigh end eye-roll mode)If its analog . Take an lm317 and a 741. And then theres the 555 in all its souped up glory...Beyond that... Ot gets very hairy....Like driving a 2n3055 using ... A 2n3055 ... Makes as much sense as a screen door on a submarine.A bc547 has more gain than this 'homebrew darlington'. A 2n3055 has a gain of what .. 20 ? If you're lucky...Yeach i'm bitching and moaning. I blame the internet that is full of hobby sites with 500 flavors of the Lm317 supply... Watered down clones of watered down clones.Want to make a nice adjustable power supply using an lm317 ?. Open the datasheet ( that big scary document woth all the numbers and curves and application notes in it. Ooooh spooky stuff )There are nice apps notes how to boost current, input voltage, creat current regulation and regulating down to zero. By addin an external opamp you can make a nice circuit.But why not try to make something really nice and learn something along the way. Make a supply with a real darlington like a TIP142. Use an opamp to sense the output voltage feedback , and a reference diode and potmeter complete that . Perfectly fine voltage regulation. 3 resistors , an opamp and a transistor is all you need.The add a sense resistor in the return line, put an opamp across that, compare the current with a preset voltage and decide when it is time to start turning the darlington off. And voila ! An adjustable current limit. You can even tie an led to the current limiter output that tells you you are in limit.Now we have a real nice little lab supply. An not a fleabag lm317 that has its regulation messed up by a homebrew darlington without gain...

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 21, 2012, 06:16:22 pm
content: sure you have a lot of juice. hope it'll last long enough to serve my, err... our purposei'm, ehmm... we are going to need a person like youQuoteyou see, thats the problem with us hobbiest. we are not as luxurious as pro engineers are. we just slap together whatever junks we can find. but well, i hope that will pass to OP smoothly.

author: free_electron
author_rank: Super Contributor
timestamp: April 21, 2012, 06:19:31 pm
content: never mind my bitter and sarcastic comments above. Since you indicated you are still earning electronics : here we go. Real electronics ( an not the 'found it on google' type.QuoteDo you know why ? What is the purpose of this ?What is the purpose of C4 ?Quotereally ? i don't see any 'filter' caps. al i see is a bulk capacitor of 1000uf.Quotenow why would we want that. if you check the application notes in the datasheet the lm317 doesn't need inrush protection...Quotewhy ? do you understand how the lm317 regulates ?why a multuturn ?Quoteif anything should be multiturn its this one !Quotewhy 1 milliampere ? what would happen if i omit the 576 ohms.. would it curl up and die if it find a bit over 1 milliampere as minimum current ?what if i put 10k as minimum load ?and things you have not answered :why d7 ?why d5 ?Right. here goes the electronics lesson.What is an lm317 and how does it work.---------------------------------------------------an lm317 is an adjustable regulator. it takes an input voltage and creates a lower output voltage. internally there is a transistor between IN and OUT. the ADJ pin is a feedback that tells the lm317 if it has reached the desired output voltage.The lm317 does its regulating work by measuring the voltage between ADJ and OUT. It is only happy if it sees 1.25 volts there. ( the 1.25 volts is because they use a bandgap reference inside. sidenot , chip tehnology, not required to design with the lm317 . 'general knowledge')So. Let's see what we have. The lm317 decides it has reached the correct output if the voltage between ADJ and OUT is 1.25 volts.Let's say i put a 250 ohm resistor there. 1.25 volts over 250 ohms is 5 milliamperes.So, if i run 5 milliamperes through R3 the LM317 will be happy.Now, let's connect a resistor between ADJ and ground ( in your case R4)We know that current in a series network is the same. ( basic electronics. ) The ADJ pin is very high impedant and no current flows in an out of that pin. the current flows between OUT and GND.we have 5 milliampere ( the lm317 will not let it go above that, since at 5 milliampere it sesse 1.25 volts and will start turning off its internal transistor. that is what it is made to do )whatever resistance we put between ADJ and ground multiplied with our 5 milliampere will set the output voltage. ( remeber the 5mA is only valid for the 250 ohms resisotr. change the value and the current changes. i picked 5mA and 250 ohms because you can easily do the maths in your head)The output voltage is the voltage across R4 ( Value of R4 x 5mA ) + the voltage across R2 ( always 1.25 volts ).From the above : it makes sense to1) make R4 a multiturn potmeter since we are going to use that one to adjust the output voltage.2) select an apprpriate value for this potmeter. we want a maximum of 24 volts output.24 volts - 1.25 = 22.75 volts.22.75 volts / 5 milliampere = 4550 ohm. So we can take a 5K ptmeter. it does no goed to put a 10 K potmeter there since you will only use 5k of it...If the voltage before the LM317 is not higher than 28 volts your top 5K is wasted sinc, at 5K you already have 24 volts out, and the LM317 needs a voltage across IN and OUt to work ( typically about 3 volts )Now, we have determined R3 and R4 for our design.Let's take a look at C4when you turn on the powerupply there is no voltage on the OUT pin. this means there is no voltage on the ADJ pin either. But, we know the lm317 is only 'happy' if it sees 1.25 volts there. So it will respond by turning on its transsistor really hard. control loops have a response time. and there is a possibility it 'overshoots'. the risk exists that, you have set the dial on R4 for 12 volts, you throw the mains switch and you get a short spik oof 20 volts before the lm317 regulation kicks in and goes to 12 volts. th risk is that you destroy whatever is connected to the supplies output ! that spike is deadly for a lot of electronics.What can we do to mitigate this. We know that th LM317 will 'throttle back' when it sees the 1.25 volts. or in other words , when 5 milliampere is running through R4.. so ,by adding a capacitor from ADJ to ground we pull more current ( since the cap is discharged at power on ) during startup. this gives a 'false' reading to the lm and it will slowly let tis output rise. gone is the 'spike.but, adding that capacitor gives three unexpected problems.problem 1: we have started up , the capacitor is charged. i quickly power off and back on... the capacitor has not had time to discharge. it can only discarge through R4... so our 'protection' fails....Problem 2 : the LM317 does not like it when , powered of, someone applies a voltage to the ADJ pin. you can destry internal circuitry.Problem 3 : when dialing down from 12 to 55 lts , the capacitor has temporarily a higher voltage than the output voltage. it needs to discharge through R3.. this is similar to problem 2. but lm317 will lose regulation ! this is dangerous.Problem solution : we add a diode between ADJ and OUT. this will make sure that the ADJ pin can never rise more than 0.6 volts above OUT. so we solve problem 3 and 2. furthermore , it will also very quickly allow C2 to discharge into the output load so our 'slow start' will work correctly every time.-snip- looks like the wireless keyboard needs new batteries, it's missing keystrokes ...Right , where were we ... Ah yes We covered Statement 1.Let's look at statement 2. Filter caps.The LM317 does not really need 'filter' caps like an LM78xx does ( those guys require 100nf close to their pins ). The LM317 is happy with a 10uF cap on its output. Actually those 'filter' caps are ued to control the bandwidth of the regulation loop. the LMxx has a tendency to oscillate. since a capacitor has an impedance that is frequency dependent ( higher frequency is lower impedance ) you can use this to 'tame' a regulator.if it start ocillating the capacitor will draw more current and this will force the regulator to slow down..the LM317 does not need this. ( why is a long story. it suffices to say that this is becasue it measures between out and ADJ. theLMxx measure between OUT and GND ... different architecture of regulation loop )So R1 discharges the bulk capacitor. The 'bulk' capacitor is the large fat capacitro that sits after the rectifier in the power supply. it is there to provide us with energy dusinrg the dips in the rectified ac power. as the sinewave Ac rises, the cap is being charged , as it drops back to zero ( and it does this 100 times or 120 times a second, depending on your line frequency for a full wave rectifier ) the capacitor gives back the energy.so think of it as a 'battery' that gets charged and discharged 100 times a second.Now, for a 1000 uf cap at 24 volts this kind of resistor ( more commonly called a 'bleed' resistor ) this is not necessary. if you have a supply with 50 volts and 10000uF by all means put it there ! the resistor is there to discharge the cap safely. Not for the user of the powersupply, but for the people that have to repair it ! the charge in such large capacitors is potentially dangerous.Statement 3.No it doesn't. this resistor is a trick... you picked up this schematic and modifeid it (wrongly ). this resistor sits there to scale the output current.what they do with that is the following : as yu draw more current from the LM317 the voltage across this R2 will increase. once you hit 0.7 volts your power transistor ( you connected them wrong for this to work .. ) will start conducting. so you create a balanced system. the LM317 delivers part of the current and the transistors deliver part of the current. if the current through the LM317 drops , the vltage across the R2 drops and the power transistor comes out of conduction.the original schematic has a PNP power transistor with its Emitter connected to the bulk capacitor, the base connected between the R2 in IN and the collector connected to the output pin. you (or whoever cloned it wrong because he didn't understand it either) modded it and the functionality is lost. R2 does nothing and is not required.statement 4 : see my expanation of 1. this is to be a fixed value resistor. in the 200 to 400 ohms range. you can;t have too much there becasue you make the impedance too high between ADJ and Out and this makes the system snesitive for noise. Below 200 ohm the currents become large and you are burning energy unneccesarily in the divider chain. the only reason you want this to be an adjustable is so you can set the full scale of the potentiometer. and you don't need a multiturn.Statement 5 :this is a multiturn because we will use it to adjust the desired output voltage.Statement 6 : minimum loadthis is a leftover from the trickery around the 18 ohm resistor before the LM317. but snce the 'clone' is wrong , this does zilch ...Now, on to my other questions.Why D7 ?you want to protct the utput of a lab power supply against morons that hook them up to higher voltages. this would potntially kill the output ranssitor and whatever electronics in the supply. let's say you have a circuit with some caps charged at 12 volts. you have adjeusted your supply to 5 volts and make the connection. the capacitors would discharge into the power supply.Here is the problem with D7: all output current needs to flow THROUGH d7. this causes voltage drop. your regulator is blind. set the regulator to 5 volts and you have 4.3 at the output or anythin between 4 and 5 depending on load current ( diodes are not linear and the voltage drop is not '0.7 or 0.3 for a sohttky' as the textbook lead you to believe ...) so problem. you have acurrent dependent output voltage. not good. ! we wanted to make a stabilized supply !D7 should be connected : Anode to output, Cathode to te bulk capacitor.if some moron connectes an external supply the energy will be transferred to C1. thus protecting our supplies guts.This alone is not suffiecient. what if some bozo connects a charged cap with 100 volts to the output. you will still fry the supllies systems since you get 100 volt across c1 and the lm317 cannot handle that...so we need to put big fat zener diode from output to ground ( where you have R5) a zener diode set to a couple of volts above the maximum voltage we can make. in this case our supply is designed for 24 volts : stick a 27 volts zener, 5 watt across. let the 100 volts come. th zener will very quickly react and kill the charge before we can fry anything in the supply.the Why of D5 : similar to the abve aplantion : the LM317 does not like it to have a higher voltage on OUT than IN. shoud a lrage output capacitor be present ( potentially in a circuit attached to our lab supply , and we poer off, there is a chance that c1 is dischargig faster than the output. this creates reverse voltage over the LM317 ( between In and OUT) by putting a diode there we limit the maximum voltage there to 0.6 volts. no harm can be done ( the lm317 is only damaged at 2 volts or more.. )Thus ends lesson 1

author: free_electron
author_rank: Super Contributor
timestamp: April 21, 2012, 06:56:17 pm
content: Quote from: Mechatrommer on April 21, 2012, 06:16:22 pmhas nothing to do with papers ith golden stars. it has to do with UNDERSTANDING what you are trying to do.I also don't have a paper with golden star (left school at 18), nevertheless i am passionate about what i do and eager to learn. That's why it hurts me to see hobby electronics watered down to 'arduino' and lm317 'lab' supplies. All the more when i read the OP's idea ' lab supply with crummy lm317 , wrongly implemented current multiplier BUT with cpu and display ! ooohh look at the pretty lights. never mind the thing craps out at the first fly that lands on it. we spend 1 dollar on the essentials and 10 dollars on a cpu and display.wanna see and get a feel for a real lab supply : go download the service manual from an e3610 power supply of HP. this is their cheapest , analog lab supply. 4 opamps , two power transitors. no CPU !. their service manual explains step by step why they do the things they do. Read and learn. you will be amazed what you discover!

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 21, 2012, 08:36:49 pm
content: Quoteand both can be bought with two things... time and experiencehow long have you been in ee? me? pretty much yesterday.edit: nice detailed explanation there, i'm having a hard time digesting all. 5 stars to you!

author: free_electron
author_rank: Super Contributor
timestamp: April 21, 2012, 09:31:27 pm
content: Since a burnt my finger on a hot transistor at age 6 ... 36 years ago.. And im still wondering why it was so hot...

author: IanB
author_rank: Super Contributor
timestamp: April 21, 2012, 09:35:05 pm
content: Quote from: free_electron on April 21, 2012, 09:31:27 pm...because it had a metal can, which is good for heat conduction...

author: westfw
author_rank: Super Contributor
timestamp: April 22, 2012, 12:29:16 am
content: Free_electron: You'll love my idea. I want a "lab" power supply with LOTS of LM317s in it!317 in the switching pre-regulator.Multiple parallel 317s in the output stage for increased current.317 in the current source/sink that allows for voltages down to zero.You get the idea... :-) (I blame it on that box of 317s I bought from eBay.)

author: free_electron
author_rank: Super Contributor
timestamp: April 22, 2012, 01:46:29 am
content: Quote from: westfw on April 22, 2012, 12:29:16 amyou sir, are a certified lunatic

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 22, 2012, 05:13:03 am
content: Quote from: free_electron on April 21, 2012, 09:31:27 pmso with 36yrs of (that can be called a lifetime) experience... you still dont understand how it works?and then what it is with me/us/OP? to understand allt those things.

author: Stephen Hill
author_rank: Regular Contributor
timestamp: April 23, 2012, 01:19:14 pm
content: Hi Free_Electron,Thanks for you feedback and tuition. I've read everything you've said and have taken it on board. I'm going to make changes to the circuit based out your and others feedback and will present it in this thread when I'm happy it's much better. With work and family life being quite busy at the moment, I'm unsure when I'll get round to posting Revision B.However, I just wanted to point a few issues or queries on my design that have been raise:Bridge DiodesD2 and D4 being a smaller diode was mistake and they should all be the same values. Although I'll probably use a heatsink mountable diode bridge package in the physical circuit.VoltagesYour right that I didn't show the input voltage which is just over 33V P-P (from a 2x12V Toroidal). I can't see that I'll ever pull over an Amp at 1V.R3 and R4 (Adjustment Voltage Divider)I chose to put in a trimmer for R3 so that while I'm building the circuit I can find tune the maximum voltage when R4 is at it's highest value. R4 will indeed be a 10-Turn. I neglected it from the notes because I thought it was obvious.2N3055I understand this transistor is quite old, but for now I think I'll stick with it. Locally they seems the cheapest transistor per watt. Although I will remove the Darlington configuration.Component ChoicesA lot of the component choices are just using what is in LT Spice. Some may change to what is available locally to me via Farnell.A understand your frustration with what looks like watered down hobby electronics. For a living I am a web developer and I too sometimes get frustrated in forums when I see the same beginner questions again and again. However, we all need to start somewhere and for me, building a LM317 power supply connected to a PIC and an I2C LCD is just enough for me right now.I like to try and design my own circuits with the current knowledge I have with the purpose of failing until I eventually succeed and learn something. I don't think I would learn as much if I simply looked at a circuit in a datasheet and built it. I do read the datasheets though and enjoy reading them, I'm just not experienced enough to take it all in and to spot those important values. If that makes any sense.Once I've posted Revision B on this LM317 design, I will take you up on your challenge and design/build a power supply using op amps and discrete components, which I will post in a separate thread.Thank you all again and I will post an update later this week.Many ThanksStephen

author: T4P
author_rank: Super Contributor
timestamp: April 23, 2012, 03:54:49 pm
content: Not having to deal with all linear troubles i decided to go switching route ... byebye linear , you have served me well .

author: free_electron
author_rank: Super Contributor
timestamp: April 23, 2012, 04:01:11 pm
content: Quote from: Dave.S on April 23, 2012, 03:54:49 pmif switching is the solution i want the problem back...that's an even bigger can of worms !it is not easy to make a wide range adjustable switching regulator. and then there is the output filtering , and the magnetic , and making the magnetics ...

author: T4P
author_rank: Super Contributor
timestamp: April 24, 2012, 04:57:18 pm
content: Quote from: free_electron on April 23, 2012, 04:01:11 pmI just go and grab a suitable inductor (after hours of calculations and countless simulations) of required specs from element14 ... really .

author: krivx
author_rank: Frequent Contributor
timestamp: April 25, 2012, 01:09:39 am
content: I have to say this has been a nice exchange (and an education). Fair play to the OP for taking everything on board and moving forward without being discouraged. I think I also want to build a nice adjustable supply now

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 25, 2012, 05:27:22 am
content: Quote from: Dave.S on April 23, 2012, 03:54:49 pmhas smps improved over linear psu? in term of noise, transient, durability, stability etc? esp noise?i have a sense of people going smps+linear nowadays and thats what i'm going to do next if time permits, it has both benefit from both world. so why bye bye linear?edit: and i read smps is terrible too. there's mystic on how to get the magnetic field balanced.

author: BravoV
author_rank: Super Contributor
timestamp: April 25, 2012, 05:30:41 am
content: Quote from: Mechatrommer on April 25, 2012, 05:27:22 amThis dude is well known around here to post garbage and doesn't know crap what he is talking about.

author: T4P
author_rank: Super Contributor
timestamp: April 25, 2012, 10:51:24 am
content: Quote from: BravoV on April 25, 2012, 05:30:41 amYou still ain't on good terms with me man . You think i know nothing about switching regulators ?

author: Stephen Hill
author_rank: Regular Contributor
timestamp: April 25, 2012, 10:54:38 am
content: Could I please kindly ask that you take your bickering elsewhere...Thank you