# LM317 dual rail power supply



## steven2992

I'm designing a +18v -18v power supply with two lm317. I have made a schematic with eagle. It's my first project so any tips are welcome. It will be used to power an unbalanced to balanced converter based on the THAT1646, it will draw about 100 mA per channel. For now im going for 2 channels but it might be extended to 8 or 12 in the near future. Have I made any big errors, or are there things that are better done differently?







 Thanks for your help

 Steven


----------



## cobaltmute

Why not used fixed regulators?

 And you may want to check maximum supply voltages for the THAT1646


----------



## steven2992

Quote:


  Originally Posted by *cobaltmute* /img/forum/go_quote.gif 
_Why not used fixed regulators?_

 

LM317 are easily available and it makes it a more modular kind of power supply.


  Quote:


  Originally Posted by *cobaltmute* /img/forum/go_quote.gif 
_And you may want to check maximum supply voltages for the THAT1646_

 

My bad, It should have been +18 and -18. I will edit it on the first post.


----------



## cobaltmute

This is from the datasheet for the LT1033. It shows a way of dual tracking two adjustable regs from one pot. 






 I learned about this from a thread at diyAudio where someone had done the same with LM337/LM317. I've sim'med it with the LM317/337 regs and it works in sim, but I've never built it. 

 May be of use to you.


----------



## steven2992

Very interesting, but it seems to be more for a benchtop supply. It is ajustable with just one pot while mine is adjustable with the 2 trimmers. like a variable voltage vs a set-once-and-then-just-use-it-like-that supply.


----------



## cobaltmute

And Tangent's TREAD would work for you as well


----------



## peranders

Quote:


  Originally Posted by *steven2992* /img/forum/go_quote.gif 
_I'm designing a +18v -18v power supply with two lm317. I have made a schematic with eagle. It's my first project so any tips are welcome. It will be used to power an unbalanced to balanced converter based on the THAT1646, it will draw about 100 mA per channel. For now im going for 2 channels but it might be extended to 8 or 12 in the near future. Have I made any big errors, or are there things that are better done differently?






 Thanks for your help

 Steven_

 

It looks good but you should add some caps across the pot's. Please consult the datasheet for LM317/337.


----------



## steven2992

http://www.national.com/ds/LM/LM117.pdf

 The spec sheet says the caps across the pots should be 10 uF. It also says that in some cases protection diodes are needed. The protection diodes are in case the input is shorted and to prevent the caps discharging across the lm317. Are they absolutely necesary or can I leave the out? page 9-10 drawing 906307 on the datasheet.


----------



## steven2992

I've updated the schematic with the extra caps and optional protection diodes. The diodes are 1N4002 or equivalent.


----------



## jcx

if you're really planning to trim the V to closer than the tolerance of the reg internal ref then you should use 2 fixed 1% metal film resistors for the divider and arrange the pot in parallel with R ratio or series R to trim ~5%, always use potentiometer mode when possible to minimize wiper contact influence on setpoint stability

 Bob Pease recommends single turn pots as being more settable/stable than multiturns - the screw drive reduction mechanism in multiturns always has backlash


----------



## devast

I have something like this:





 Bought it off fleabay for $24. I think it's an ok implementation.


----------



## steven2992

I've updated the schematic with some of your advise and some stuff from the schematic posted by devast. I'm going for "comercial" quality and not for "audiophile", so trimming to within the regs tolerance isn't necessary.


----------



## Pars

The fixed resistors across the trimpost is 2 resistors and would easily fit your board layout with little to no modification.

 I would also suggest the use of a top ground plane, with the rest of the traces on the bottom. This would make your routing easier, and is still doable for home etching, if that was your goal.


----------



## jcx

Quote:


  Originally Posted by *steven2992* /img/forum/go_quote.gif 
_... I'm going for "comercial" quality and not for "audiophile", so trimming to within the regs tolerance isn't necessary._

 

then leave the pots out altogether - just use 15 cent 1% metal film reisitors in a fixed divider


----------



## steven2992

I've put in the extra resistor and i've replaced the multi turn with a single turn and i've redone the board layout











 I've just noticed that c10 is the wrong way round, I have already fixed it.


----------



## tangent

Beware that if you use the LM317 that way, you need to use a dual-secondary transformer or two independent transformers. I point this out only because it's not shown, and thus might not be obvious.

 Regarding your layout, some comments:

 1. Your bottom-side traces are fairly thin. This is a _power_ supply, remember. Stiffen those up where you can.

 2. The whole-top ground plane is probably a mistake, electrically. You'd have to build it and measure to be sure, but that's my sense from just looking at it. It's providing a coupling path between what you should be thinking of as three separate circuits: AC, unregulated DC, and regulated DC. It might be better to split the plane into those three separate parts, put a good 100 mils or more of space between them, and join them by short trace jumps.

 EDIT: I say three circuits, but you only need two planes, unreg and reg DC. Get the plane entirely away from the purely AC side of things. This probably means rotating the bridges, and maybe running a short trace from the one grounded pin into the larger plane.

 3. It looks like you're using the official EAGLE mounting hole parts in the corners, so you don't actually need to make those notches in the plane. EAGLE will flood the plane tightly around them, going no nearer than is safe, since it knows the size of typical mounting bolt heads for the shaft diameter you've selected. If you want more space, play with the DRC settings. You have been running DRC, right?

 4. R5 and 6 might need to go to 1/2 W. Do the math.

 5. The big C7/8 probably isn't very helpful. This is especially true if you're going to have a longish DC cable on the output of this thing, wiping out the low ESR you're buying with that part. Big caps here are only helpful if the downstream circuit doesn't have its own big power rail cap(s). I'd go with the lower values recommended in the LM317 datasheet. If you do, C11/12 go away, too, since lowering the ESR of this cap is again pointless. We're just optimizing local regulator performance here. The downstream circuit has to fend for itself unless you're using very short wire jumps to it so that the output ESR of the regulator actually matters.

 6. Speaking of hookup wires, you're only allowing for about 22 ga here. If you can move to the 156 mil pitch Molex KK variant, you can use up to 18 ga, better for low impedance.

 EDIT 7. Consider snubbing all of the diodes in your bridges, rather than just across the +/- pads as you're doing now. 10pF ceramics are cheap and may give a measurable improvement in noise.


----------



## devast

Quote:


  Originally Posted by *tangent* /img/forum/go_quote.gif 
_5. The big C7/8 probably isn't very helpful. This is especially true if you're going to have a longish DC cable on the output of this thing, wiping out the low ESR you're buying with that part. Big caps here are only helpful if the downstream circuit doesn't have its own big power rail cap(s). I'd go with the lower values recommended in the LM317 datasheet. If you do, C11/12 go away, too, since lowering the ESR of this cap is again pointless. We're just optimizing local regulator performance here. The downstream circuit has to fend for itself unless you're using very short wire jumps to it so that the output ESR of the regulator actually matters._

 

Kinda agree. I did not build that myself, just bought it. It's a general design i guess, and it's good if you build both boards into the same chassis, then you don't need big caps on the other board.


----------



## steven2992

Thanks for all the info. I will change the design accordingly tomorrow. 

 It will be used in the same chassis so the boards will be quite close together so I think c7/8 will be very usefull especially since i'm not planning on having big supply caps on those boards. 

 regarding 7, do you mean putting 4 ceramics across B1. one for each diode and the same for B2.

 I also just noticed that C2 and C8 are switched. 
	

	
	
		
		

		
			





 and as far as hookup wires are concerned bigger is always better


----------



## tangent

Quote:


  Originally Posted by *steven2992* /img/forum/go_quote.gif 
_do you mean putting 4 ceramics across B1._

 

Yes. See the TREAD schematic.


----------



## joe_cool

OK, this is just my opinion, and based on first-hand experience. I don't think the large output caps C7 and C8 are necessary for audio. I prefer a smaller (~100 uF) high-grade cap like an Elna Silmic II or a Nichicon FG.

 Also I don't think the heatsinks are large enough for more than 100 ma.

 Otherwise an excellent design.


----------



## tangent

Quote:


  Originally Posted by *joe_cool* /img/forum/go_quote.gif 
_Also I don't think the heatsinks are large enough for more than 100 ma._

 

While he could reserve more space on the board for bigger heat sinks, he can fix it more easily by moving the regulators right to the board edge. This lets you use much larger heat sinks.

 With the current design, where the regulators are slightly in-board, you can still do that to some extent, but you'll run into trouble if the required mounting for the heat sinks means they extend below the board level. You could "form" the leads a bit to fix that, though.


----------



## steven2992

I've made the traces bigger, increased the space for R5/R6, added the caps C11-C18, put screw screw terminals instead of molex, moved the lm317 to the board edge and fixed the ground plane.

 R5/6 only have to be 0.5W when the output voltage from a single rail is more than 28V. and they actually burn 0.5W when the output voltage is 40V(again, just one rail), and that is the regulator limit so more than 0.5W should never be necessary. 

 when a temperature rise of 95 C (203 F) is allowed, the maximum current with a 7v voltage difference between input and output is 200mA per rail *without a heatsink*. 
 The max package temp is 125 C and with an ambient temp of 30 C the max current is around 240mA per rail so 200mA would be a safe margin. 


 So even with the small onboard heatsinks a a few hundred mA can be drawn without extreme temperatures


----------



## tangent

Quote:


  Originally Posted by *steven2992* /img/forum/go_quote.gif 
_The max package temp is 125 C and with an ambient temp of 30 C the max current is around 240mA per rail so 200mA would be a safe margin._

 

Not unless you're using forced-air cooling or leaving these things uncased. If you rely on passive cooling inside an enclosure, the power supply will heat up the air inside the case, probably past 30C. That's only about 5C above room temp.

 Besides which, going right to the regulator's max recommended temp still shortens its life. A rule of thumb I heard once, and try to stick to, is to never go past 85C for semiconductors. If we assume the temp inside the case get to 45C before it stabilizes through radiation from the enclosure itself, that puts the max current you can safely get without a heat sink at 114 mA. I'd say Joe nailed it. 

 Getting back to the layout:

 - I'd increase the trace-to-plane spacing in the DRC. It'll get rid of those filaments at the bottom edge where the unreg DC trace invades the top-side plane. It's a little tight around other components, too.

 - The bridge snubber caps have no feng shui. 
	

	
	
		
		

		
		
	


	




 I'd try to distribute them evenly around the bridge, maybe put them on 45s like on the TREAD. The traces to these caps can be pretty thin, since they aren't passing power.

 - The AC traces to the bridges seem to be taking more circuitous paths than is necessary. Have you tried all possible 90 degree rotations? Maybe even 45?

 - I'd move the right edge of the unreg DC plane back even with the thermals on C1.


----------



## steven2992

The power output without heatsinks was just an example to show how much one could theoreticaly draw without heatsinks. I don't think anyone would run power supplys like this without heatsinks, especially not us DIY folkes. Since we tend to go more for overkill than enything else. 

 I've rotated B1 and B2 and went all feng shui on the snubbers 
	

	
	
		
		

		
		
	


	




.


----------



## Beefy

It is getting to the point where you have almost exactly recreated the LCBPS from Twisted Pear. Don't get me wrong, I'm all for DIY, but there's a point where recreating the wheel seems like more effort than it is worth


----------



## joe_cool

Quote:


  Originally Posted by *Beefy* /img/forum/go_quote.gif 
_It is getting to the point where you have almost exactly recreated the LCBPS from Twisted Pear. Don't get me wrong, I'm all for DIY, but there's a point where recreating the wheel seems like more effort than it is worth 
	

	
	
		
		

		
		
	


	


_

 

Twisted Pear is always out of stock, and this is more like LCDPS since it uses two LM317 regulators. I think the dual 317s sound better especially compared to 78xx regulators.

 devast: I bought one of those also, and the sound was unexpectedly crappy. All the aluminum caps were Rubycon except the main filter caps (ICICC 4700 @ 50VDC). I changed those to Nichicon FX (FW) 2200 @ 63VDC and the sound improved immediately. Then I replaced the output caps 1000 @ 35VDC with Nichicon FG 220 @ 50VDC and now it sounds MUCH better. 
	

	
	
		
		

		
		
	


	




 PS: I'm powering a Dynalo (Gilmore Dynamic) for comparison purposes.


----------



## devast

Quote:


  Originally Posted by *joe_cool* /img/forum/go_quote.gif 
_devast: I bought one of those also, and the sound was unexpectedly crappy. All the aluminum caps were Rubycon except the main filter caps (ICICC 4700 @ 50VDC). I changed those to Nichicon FX (FW) 2200 @ 63VDC and the sound improved immediately. Then I replaced the output caps 1000 @ 35VDC with Nichicon FG 220 @ 50VDC and now it sounds MUCH better. 
	

	
	
		
		

		
		
	


	


_

 

A little offtopic, but maybe that's why i feel that my amp is lacking at the lowend spectrum, and feels a bit bright. I'll try replacing those caps, in the near future.


----------



## joe_cool

Quote:


  Originally Posted by *devast* /img/forum/go_quote.gif 
_A little offtopic, but maybe that's why i feel that my amp is lacking at the lowend spectrum, and feels a bit bright. I'll try replacing those caps, in the near future._

 

Sorry, my point is that circuit topology is very important but even after the PCB is fabricated there may be opportunities to improve the sound quality by subjective parts selection.


----------



## steven2992

Quote:


  Originally Posted by *Beefy* /img/forum/go_quote.gif 
_It is getting to the point where you have almost exactly recreated the LCBPS from Twisted Pear. Don't get me wrong, I'm all for DIY, but there's a point where recreating the wheel seems like more effort than it is worth 
	

	
	
		
		

		
		
	


	


_

 

I know there are a lot of power supply designs and with the lm317 you can't really do anything else than this. 

 Another main aspect of diy is learning. And that's exactly what this was for. I could have just bought a power supply. But by doing it myself, and with your help, I noticed details I had never noticed before and I learned from them. It also provides a way to get into design without doing something outragously expensive or exotic that no one can help with. This isn't the only thing I'm planning to make, and every mistake I made here I won't make in those projects. 

 And it's cool to have your name on a circuit board.


----------



## fortney

Will you be selling circuit boards? It would be kind of cool to have your product out there...add it to you CV, etc.

 F


----------



## steven2992

Quote:


  Originally Posted by *fortney* /img/forum/go_quote.gif 
_Will you be selling circuit boards?_

 

Board runs are usually done in multiples of ten, and any boards I don't need myself will be available.


----------



## TzeYang

With a circuit this symmetric, consider using thicker traces and a star ground.


----------



## steven2992

Quote:


  Originally Posted by *TzeYang* /img/forum/go_quote.gif
_ With a circuit this symmetric, consider using thicker traces and a star ground._

 

  The traces already are fairly wide, making them even wider would create a lot of clearance errors. and the ground plane as it is now was recomended by tangent. So i'm quite confident that it'll work the way it is now.


----------

