Electronic Circuits and Projects Forum



LM317 Spice Model?

  1. #1
    adamthole adamthole is offline

    LM317 Spice Model?

    I'm working on a power supply simulation and I can't find an LM317 spice model. I've searched and found the code for what I think is the spice model, but I couldn't get it to work correctly. I am using MultiSim 8, and SwitcherCad III. The model for either or both would be awesome or instructions on how to import the spice code into a component on either would be awesome.

    Thanks!

  2. #2
    Optikon Optikon is offline

    Re: LM317 Spice Model?

    Quote Originally Posted by adamthole
    I'm working on a power supply simulation and I can't find an LM317 spice model. I've searched and found the code for what I think is the spice model, but I couldn't get it to work correctly. I am using MultiSim 8, and SwitcherCad III. The model for either or both would be awesome or instructions on how to import the spice code into a component on either would be awesome.

    Thanks!
    Hopefully you can cut & paste. This is Texas Instruments' transistor level model. It is most accurate.

    .SUBCKT LM317/TI in adj out
    * PEI 08/98 p62
    J1 in out 4 JN
    Q2 5 5 6 QPL .1
    Q3 5 8 9 QNL .2
    Q4 8 5 7 QPL .1
    Q5 81 8 out QNL .2
    Q6 out 81 10 QPL .2
    Q7 12 81 13 QNL .2
    *Q8 10 5 11 QPL .2
    Q8 10A 5 11 QPL .2
    Q9 14 12 10 QPL .2
    Q10 16 5 17 QPL .2
    Q11 16 14 15 QNL .2 OFF
    Q12 out 20 16 QPL .2
    Q13 in 19 20 QNL .2
    Q14 19 5 18 QPL .2
    Q15 out 21 19 QPL .2
    Q16 21 22 16 QPL .2
    Q17 21 out 24 QNL .2
    Q18 22 22 16 QPL .2
    Q19 22 out 241 QNL .2
    Q20 out 25 16 QPL .2
    Q21 25 26 out QNL .2
    Q22A 35 35 in QPL .2
    Q22B 16 35 in QPL .2
    Q23 35 16 30 QNL .2
    Q24A 27 40 29 QNL .2
    Q24B 27 40 28 QNL .2
    Q25 in 31 41 QNL 5
    Q26 in 41 32 QNL 50
    D1 out 4 DZ
    D2 33 in DZ
    D3 29 34 DZ
    R1 in 6 310
    R2 in 7 310
    R3 in 11 190
    R4 in 17 82
    R5 in 18 5.6K
    R6 4 8 100K
    R7 8 81 130
    *R8 10 12 12.4K
    R8 10A 12 12.4K
    R9 9 out 180
    R10 13 out 4.1K
    R11 14 out 5.8K
    R12 15 out 72
    R13 20 out 5.1K
    R14 adj 24 12K
    R15 24 241 2.4K
    R16 16 25 6.7K
    R17 16 40 12K
    R18 30 41 130
    R19 16 31 370
    R20 26 27 13K
    R21 27 40 400
    R22 out 41 160
    R23 33 34 18K
    R24 28 29 160
    R25 28 32 3
    R26 32 out .1
    C1 21 out 30PF
    C2 21 adj 30PF
    C3 25 26 5PF
    CBS1 5 out 2PF
    CBS2 35 out 1PF
    CBS3 22 out 1PF
    .MODEL JN NJF (BETA=1E-4 VTO=-7)
    .MODEL DZ D(BV=6.3)
    .MODEL QNL NPN (EG=1.22 BF=80 RB=100 CCS=1.5PF TF=.3NS TR=6NS
    + CJE=2PF CJC=1PF VAF=100 IS=1E-22 NF=1.2)
    .MODEL QPL PNP (BF=40 RB=20 TF=.6NS TR=10NS CJE=1.5PF CJC=1PF VAF=50
    + IS=1E-22 NF=1.2)
    .ENDS LM317/TI
    +1

  3. #3
    Optikon Optikon is offline
    I have behavioral model as well if you need only basic functionality and faster sim time.
    0

  4. #4
    adamthole adamthole is offline
    Thanks for the model. I cut and pasted it into Multisim, and I got no errors when I ran the program...however my circuit didn't work correctly (no voltage at output). I probably assigned the pins to the wrong locations. Is their a good tutorial for importing spice code into multisim somewhere? I did some searches and just got ewb's site talking about how great multisim is.

    I would also like to understand the spice code itself, any good site you reccomend for a brief overview of that?

    Thanks!
    0

  5. #5
    audioguru audioguru is offline
    Maybe Spice knows that if an LM317 is trying to dissipate more heat than its heatsink can cool, then it shuts-down with zero volts on the output.
    0
    Uncle $crooge

  6. #6
    adamthole adamthole is offline
    I messed around with it a little more, and I got it working. Thanks!

    I'm having another problem with multisim though, if anyone has any ideas. Check it out:

    http://www.electro-tech-online.com/v...ic.php?t=18667

    Thanks
    0

  7. #7
    simon.harpham@ieee.org simon.harpham@ieee.org is offline

    simon.harpham@ieee.org

    You might like to try changing the saturation current for QNL and QNP models from IS=1E-22 to IS=6E-13. You will then get the correct reference voltage of 1.25V.

    Although this model is supposed to be for the LM317K (TO3 version) you will find that its limiting current is about 0.7 amps with the netlist given, rather than the 1.5A expected, therefore it is closer to the LM317H, E or MDT versions.

    You will also have to add a reversed biased 1N4001 across the Adj to output pins to get the correct hard limiting behaviour.
    0

  8. #8
    1JAMES 1JAMES is offline

    Lm317

    I was able to fine lm317 after a long search
    in ver. 11 click on (place alaog) then (select all families) scroll down
    hope this helps
    0

Tags
Electronic Circuits  |  Learning Electronics

Join our community with over 100,000 Members! It's free, easy and when you're logged in you have many more features! Click to register.
Page Time: 0.03888 seconds      Memory: 7,116 KB      Queries: 15      Templates: 0