# Orcad Capture 9.2 LM317 simulation

1. Jun 6, 2010

### krispots

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?

File size:
23.8 KB
Views:
495
2. Jun 6, 2010

### uart

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.

3. Jun 9, 2010

### krispots

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.

4. Jun 9, 2010

### 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.

5. Jun 9, 2010

### 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.

6. Jun 14, 2010

### 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?

7. Jun 14, 2010

### krispots

Thanks for pointing it out

8. Jun 14, 2010

### vk6kro

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.

9. Jun 21, 2010

### krispots

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?

10. Jun 22, 2010

### vk6kro

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.

11. Jun 22, 2010

### krispots

That wraps things up for my problem. Thanks a lot!

12. Jun 1, 2012

### invertedP

How did you get a LM317? Which library did you get it from?

13. Jun 1, 2012

### vk6kro

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.

14. Jun 1, 2012

### yungman

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.

15. Jun 1, 2012

### Kholdstare

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.

16. Jun 1, 2012

### Kholdstare

@invertedP - It is much easier to define SPICE models than to find OrCAD libraries. However, you can be lucky and still find them. I have some extra part libraries, which I had downloaded from an OrCAD site. It contains most parts from various manufacturers.

It seems that if you buy the full version, you get a large collection of libraries.

EDIT: Here, i've found the link for those libraries.
copy the .olb files under "C:\Program Files\OrcadLite\Capture\Library\PSpice" and they will appear when you click add library button in Capture.

Last edited: Jun 1, 2012
17. Jun 1, 2012

### yungman

I have been doing OrCad Layout and Schematic for a long time, enough to draw a big schematic, create symbol and parts footprints, import to layout, layout, padstacks and create Gerber to send out. Just never get to the Spice part. Does the spice program has anything in common to the capture and layout? Would that help in the OrCad Spice?

So far, I got what I want out of LTSpice. I use Microwave Office a lot instead.

18. Jun 1, 2012

### Kholdstare

@yungman - The program has internal design data file to communicate between Capture and Layout (nothing to do with SPICE). However, PSpice is all about SPICE and does not understand anything else. So there is SPICE line for each Capture parts and additional SPICE stuffs in simulation settings, which are used by Capture to write SPICE code and send it to Pspice for simulation. That's how they do it.

LTspice is alright for small analog and power design. It ok as it does not need to be better in simulating all kind of circuits as its primary customers work in those specific areas. But definitely its not the best simulator. What annoys me is that it does not even show error when it cannot simulate something. All other simulator does that.