by krispots
Tags: pspice lm317
 P: 14 hello i'm new to using orcad capture 9.2 so i'm having problems with the simulation. i'm trying to simulate this regulator circuit using transient analysis. then when i clicked run, the green circle appeared. I'm wondering maybe you need to tweak something first on the parameters of the LM317 before it starts working properly, or before the program recognizes that the LM317 is present. Voltage readings indicate that there is really something wrong. anyone can help me? Attached Thumbnails
 Sci Advisor P: 2,728 Hi kris. I'm not sure of the actual error you're getting but I would like to point out that the resistor ratio you're using is a little high for that circuit. As it is the desired output voltage set-point is about 5240/240 * 1.25 which is about 27.3 volts. Too high to achieve with a 28 volt supply.
 P: 14 hello uart, i based this simulation on this schematic found on the first page of the datasheet of LM317 http://www.futurlec.com/Linear/LM317T.shtml i don't know if the schematic there is probable, but i'm just testing for the simulation. thanks for your reply, i managed to solve the problem by using another library that contains LM317 in pspice.
P: 3,956

Real life regulators need some voltage across the regulator. So, you can't get any more than 27 volts out if the supply is 30 volts, for example.

That is what was happening before, because of the 5K resistor. Your first simulator was being honest and telling you what would really happen.

If you make R2 = 240 ohms, the output should be 1.25 times (1 + 240/240) + 0.0001 * 240.

As you make R2 bigger, the output voltage will increase. Make it 1000 ohms and the output should rise to 6.5 volts or so. Just use Fig 1 in your data sheet, and the formula above it.
P: 2,728
 Quote by krispots hello uart, i based this simulation on this schematic found on the first page of the datasheet of LM317
Except you missed one important detail. The 5k resistor in the datasheet circuit is a variable resistor which should be set to some value less than 5k. About 4.6k is the actual maximum value that will let the regulator circuit work properly.
P: 14
 Quote by vk6kro Real life regulators need some voltage across the regulator. So, you can't get any more than 27 volts out if the supply is 30 volts, for example. That is what was happening before, because of the 5K resistor. Your first simulator was being honest and telling you what would really happen. If you make R2 = 240 ohms, the output should be 1.25 times (1 + 240/240) + 0.0001 * 240. This is about 2.5 volts As you make R2 bigger, the output voltage will increase. Make it 1000 ohms and the output should rise to 6.5 volts or so. Just use Fig 1 in your data sheet, and the formula above it.
Thanks for your help! the formulas and the schematic are starting to make sense now!

one question though, how can you compute for the Iadj? you replaced it by 0.0001? how did you come up with the value?
P: 14
 Quote by uart Except you missed one important detail. The 5k resistor in the datasheet circuit is a variable resistor which should be set to some value less than 5k. About 4.6k is the actual maximum value that will let the regulator circuit work properly.
Thanks for pointing it out
P: 3,956
 Quote by krispots Thanks for your help! the formulas and the schematic are starting to make sense now! one question though, how can you compute for the Iadj? you replaced it by 0.0001? how did you come up with the value?
The 100 uA figure came from the application notes for the LM317, above. See page 5 just under fig 1.

Here are some calculated values for voltage out of a LM317 using standard values for the resistors:
R1..... R2..... Vout

220... 0....... 1.25
220... 47..... 1.52
220... 56..... 1.57
220... 68..... 1.64
220... 82..... 1.72
220... 100.... 1.83
220... 120.... 1.94
220... 150.... 2.12
220... 180.... 2.29
220... 220.... 2.52
220... 270.... 2.81
220... 330.... 3.16
220... 390.... 3.50
220... 470.... 3.97
220... 560.... 4.49
220... 680.... 5.18
220... 820.... 5.99
220... 1000.. 7.03
220... 1200.. 8.19
220... 1500.. 9.92
220... 1800.. 11.66
220... 2200.. 13.97
220... 2700.. 16.86
220... 3300.. 20.33
220... 3900.. 23.80
220... 4700.. 28.42
As always, the voltage supplied to the regulator must be about 3 volts more than the output voltage.
 P: 14 so there is no real relationship between the input voltage and the output voltage other than the 3V difference? or is there some formula that relates the input voltage, output voltage, R1 and R2?
 Sci Advisor P: 3,956 No. One aim of a regulator is to isolate the output voltage from any input voltage variations. So, you want the output to remain at whatever voltage you set it to, hopefully independent of load or input voltage, within limits. The main effect the input voltage has is that it limits the maximum output voltage you can get from the regulator. There is another effect. If you set the regulator output to 5 volts and have an input of 35 volts, the regulator will run hotter than if you supplied it with 15 volts, say, for the same output current. This is because the dissipation in the regulator is greater with 30 volts drop than with 10 volts drop.
 P: 14 That wraps things up for my problem. Thanks a lot!
 P: 1 How did you get a LM317? Which library did you get it from?
 Sci Advisor P: 3,956 You don't need a library. There are simple formulas given in the data sheet which you can use directly with a calculator or you can enter them into Excel. Welcome to Physics Forums.
 P: 3,799 On a related subject, how is OrCad simulation compare to LTSpice? I have the Orcad also, but I happened to learn the LTSpice THANKS TO ALL THE HELP FROM vk6kro.
 P: 390 IMO, OrCAD is very sophisticated and powerful design system. It has generally three programs: Capture for Schematic (Capture CIS has vendor part sync), PSpice for simulation (PSpice A/D for mixed mode simulation) and Layout for PCB design. However, to realize what OrCAD can do and to fully utilize it one must go through the reference manual very thoroughly. It is one of the reason its difficult to get used to. But once you have got it, you'd feel it is very convenient. I had tried LTspice only once and immediately disliked it. I had actually tested two circuits which had convergence issues. I first ran them on ngspice and I got time-step error. I changed simulator timestep using .option but it did not work. I ran them on OrCAD, but it is Lite version and does not support over 60 MOSFETs. I could have done some trickery, but it would be time-consuming. So I ran them on Synopsys HSPICE and I got correct(expected) output at the first try without any problem. It has internal algorithms to manage convergence. HSPICE is one of the BEST simulator in the industry. Then I downloaded and installed LTspice and ran them. Those did run without errors to my surprise and delivered plain WRONG results.