# LM317 power supply simulation problems

Thread Starter

#### exscape

Joined Jan 19, 2012
28
Hey everyone!
I'm designing a DC power supply as a project. Not from scratch, though I'm expanding on the original design(s) quite a bit.

Here's the original design: http://www.qsl.net/yo5ofh/projects/vps/vps.htm

Mine will be a bit more complex due to the homemade voltmeter/ammeter on the output, though that's not really related to my question.
Rather, my problem is at an earlier stage. I'm simulating the supply in LTSpice, but I'm not happy with the results. Even though the LM317 should be capable of ~1.5 amps, I'm only getting a maximum of 0.8 A. If I try to use up more (by lowering the load resistor), the output voltage simply drops so that it stays around 800 mA... though more ripple is added.

AFAIK my simulated transformer should be able to handle this easily, the diodes in the full-wave rectifier are rated for 3 A, and after that I find only the LM317 that could possibly limit anything further...? The schematic is in the pictures below.

The voltage (between the upper and lower nodes towards the right) is at 13 V with a 100 ohm resistor for the load.
Here's a picture with a slighly larger, but still OK load at 25 ohm (+ 1 ohm) = ~0.5 A: link
... and here's one with a larger load that is far from OK, 10.5 ohm (+ 1 ohm) = ~1.1 A (in theory): link - note that the output voltage dropped from ~13 to ~8 volts.
R5 is the load, and R2 is a way-too-big shunt resistor for the ammeter (which is really aa ugly, but cheap, design). R2 doesn't cause any problems though as I've tried without it.

Due to the LM317 component not being part of the LTSpice project, I'll only upload it if asked for (you'd need to install the component as well, unless I learn how to include it "inline").

Any advice on what I should check? According to the LM317 data sheet, as far as I understand it anyhow, this shouldn't happen.
Now, of course, the simulated model isn't identical to the real thing, but I'd sooner blame myself than the simulation at this point, as I'm still a beginner.

#### Wendy

Joined Mar 24, 2008
21,906
Look at the input voltages to the LM317 when it is doing this.

Simulations are good, but they are not a substitute for real troubleshooting. You need to get real measurements and work with them, the reality. I regularly design from scratch, and have never used a simulator.

You can't always assume components meet the specs you think they do either. I suspect the transformer doesn't have the omph you need.

Is the LM317 getting hot? If it is you maybe running into a thermal shutdown scenario.

What are the rectifier diode part numbers?

There are some other problems I see with the base design. A LM317T needs 10ma to regulate, so R2 should be 120Ω, and P1 adjusted to match. There should be another cap parallel to C3, around 0.1µF or so, to prevent high frequency oscillation.

Basic Bench Top Power Supplies

Thread Starter

#### exscape

Joined Jan 19, 2012
28
Look at the input voltages to the LM317 when it is doing this.
LM317 input voltage is ~17 V (+/- ripple) regardless of load, at least at the output voltage I've had it at for a while now (~13 V). It might drop 0.2 volts or such but nothing major.

Simulations are good, but they are not a substitute for real troubleshooting. You need to get real measurements and work with them, the reality. I regularly design from scratch, and have never used a simulator.

You can't always assume components meet the specs you think they do either. I suspect the transformer doesn't have the omph you need.

Is the LM317 getting hot? If it is you maybe running into a thermal shutdown scenario.
Right, I understand this, of course... but I'm still at the design stage. I want to know that things CAN work before I commit to buying $100+ of stuff (all parts required plus PCB etching tools, the PCB itself, plus the extra stuff I plan on adding for the fun of it like an output ammeter). Thus I can't test it IRL - yet. Also, because of that, I would assume the transformer in the simulation is near-ideal? I set the voltage source to 50 mOhm series resistance, but that clearly isn't limiting me here. The transformer is two ideal inductors with (ideal) mutual inductance. There are some other problems I see with the base design. A LM317T needs 10ma to regulate, so R2 should be 120Ω, and P1 adjusted to match. There should be another cap parallel to C3, around 0.1µF or so, to prevent high frequency oscillation. Basic Bench Top Power Supplies Thanks. I switched the adjustment resistor to a 120 ohm (though that only matters when the load is <10mA, right?), and added the extra filter cap. No change in the dropout though. I'll throw together a simulation of your schematic there, starting at an ideal DC source rather than AC, and see if the problem persists even then... in that case, I guess the simulation is to blame. Thread Starter #### exscape Joined Jan 19, 2012 28 Yep, this circuit has the same problem. All components are ideal (except the LM317 model, I assume). The voltage source is 17V DC, not RMS AC (so the caps really do nothing). #### Wendy Joined Mar 24, 2008 21,906 Actually caps are critical. I have started an article I'm stalled on for power supplies. Submission: Power Supply Circuits The bigger the caps the purer your DC voltage is. One thing is established though, if you are getting 18VDC into the LM317 the most you will get out is 16VDC or so, so look at your transformer/diodes and capacitor circuit. It will set the max voltage you can reach. It also sets the current levels too. If your front end can reach 30VDC this doesn't mean it can handle 1.5A. This needs to be established too. There are other issues involved, but for now I'll take it in small steps. For what it's worth I have a supply build almost exactly to these specs. Had it since college. Last edited: Thread Starter #### exscape Joined Jan 19, 2012 28 Actually caps are critical. I have started an article I'm stalled on for power supplies. Submission: Power Supply Circuits The bigger the caps the purer your DC voltage is. One thing is established though, if you are getting 18VDC into the LM317 the most you will get out is 16VDC or so, so look at your transformer/diodes and capacitor circuit. It will set the max voltage you can reach. But the input voltage is 100% pure 17V DC. Surely capacitors won't do anything in that case? Of course, I'm talking about the simulation ONLY here, and only the second one. In a real supply, smoothing caps are obviously crucial. I also realize there will be some voltage drop due to the LM317, since it couldn't work any other way, but the voltage drops down to ~0.7 V (from 13) if you load it enough, and yet it only pumps out a max of 800-810 mA no matter what. The current increases with reduced load resistance until it reaches roughly 800 mA, at which point the output voltage is simply reduced to keep the current around 800 mA... So if the load is 9 ohm, the voltage should be around 0.8*9 = 7.2 volts according to Ohm's law, and that's roughly what the simulation gives me (7.65 V; the current is at 850 mA then, of course). Needless to say, my goal is for the current to be 13/9 = 1.444... A in this example, rather than having the output voltage dip. I'll read the thread/book chapter linked, but I do believe I have a decent understanding of all things involved in this supply. I'll admit that I don't know what causes this voltage drop, though, if not the simulation itself! #### Wendy Joined Mar 24, 2008 21,906 When you have hit the 800ma the odds are the input is dropping proportionate to the output. In other words, your front end (transformer/diodes) have maxed out on current. So max out your circuit, and measure what the output voltage is compared to the input voltage, then get back with us. Thread Starter #### exscape Joined Jan 19, 2012 28 When you have hit the 800ma the odds are the input is dropping proportionate to the output. In other words, your front end (transformer/diodes) have maxed out on current. So max out your circuit, and measure what the output voltage is compared to the input voltage, then get back with us. 100 ohm load: In 21V, out 16V (160 mA over the load) 50 ohm load: In 21V, out 16V (320 mA over the load) 25 ohm load: In 21V*, out 15.8V (630 mA over the load) 15 ohm load: In 21V*, out 12.2V (860 mA over the load) 10 ohm load: In 21V*, out 8V (850 mA over the load) ... and just for the heck of it 5 ohm load: In 21V*, out 4V (850 mA over the load) * Slightly more input voltage ripple, about 0.6 V peak-to-peak. Ripple didn't increase beyond that for heavier loads, though. Of course, wherever the above contradicts ohm's law, it's due to lazy measurements. (I got them from the over-time graph, by eye.) #### Wendy Joined Mar 24, 2008 21,906 I still suspect temperature is the culprit. Have you tried putting your finder on it (softly, lest flesh sizzle). Thread Starter #### exscape Joined Jan 19, 2012 28 I went ahead and pulled the data sheet. They are your friend, always. http://www.ti.com/lit/ds/symlink/lm117.pdf Hm, are you referring to the current limit in the H/E packaging? I did read the data sheet (as I mentioned) but didn't find the answer. Of course, it might still be in there, but... yeah. I did try. Also, again, this whole thread is about the simulation, so I can't check the temperature! I'm just trying to ensure that the fault is in the simulation, and won't carry over to the real world. If it does, I'll need a better design. Under "Load regulation", the spec is a dropout of ~0.4% at 150 C(!). Current limit at this voltage differential should be high (about 1.8-2 A?) unless the model simulates the H package. #### Wendy Joined Mar 24, 2008 21,906 Like I said, simulators only go so far. I'm not against using them, but do not take their results as Gospel either. They are frequently wrong. TO3 packages also work better then TO220. Thread Starter #### exscape Joined Jan 19, 2012 28 Like I said, simulators only go so far. I'm not against using them, but do not take their results as Gospel either. They are frequently wrong. Yes, it sure looks like it. The circuits shown should be able to handle it, right? If you say so, I'd certainly trust your experience over the simulation. #### Wendy Joined Mar 24, 2008 21,906 It is easy to build. You can build a test circuit without building the whole project. The antithesis of simulation. Thread Starter #### exscape Joined Jan 19, 2012 28 It is easy to build. You can build a test circuit without building the whole project. The antithesis of simulation. Yeah, but I still need to pay the shipping costs, even if the LM317 is the only thing I buy. Ah well, I'll try to get something. Thanks for the help. #### Wendy Joined Mar 24, 2008 21,906 Local stores around here the 317 is around$3, but I can get them much cheaper. Mouser carries them for 50¢.

You will note in post #2 I recommended wall warts in my link. They are cheap, and are predictable.

#### Ron H

Joined Apr 14, 2005
7,014
Hm, are you referring to the current limit in the H/E packaging?
I did read the data sheet (as I mentioned) but didn't find the answer. Of course, it might still be in there, but... yeah. I did try.

Also, again, this whole thread is about the simulation, so I can't check the temperature!
I'm just trying to ensure that the fault is in the simulation, and won't carry over to the real world. If it does, I'll need a better design.

Under "Load regulation", the spec is a dropout of ~0.4% at 150 C(!). Current limit at this voltage differential should be high (about 1.8-2 A?) unless the model simulates the H package.
Your model may not specify the package. Open LM317.sub with Notepad if you want to check. I ran a sim on the model that I have. It says that it is for the TO-3 package, but it still limits at about 800mA. Go figure.

Similar threads