2013年2月25日 星期一

LTspice: How to use underlying spice models?

     How to use underlying spice models?



Question)  What is recommended method of using the underlying spice models?  
    When I add e.g. a diode there is an option of "Pick new diode", and it's great with all these existing models. However, how do I use the underlying spice diode models? E.g. if I just want to set a single parameter as the only deviation from an ideal model.

 I'm aware of the ako option, and I'm convinced this is not the route to take.

 What I've done so far is to add a subckt model to a custom library, mylib.lib, however maybe there is a more elegant way to do this.

 If I just drop a diode and right click on the D to try to set it to another model, this doesn't seem to work.

 D1 NC_01 NC_02 mydiode
 Q1 NC_03 NC_04 NC_05 0 NPN
 .model D D

 Note that the line with ".model D D" stays unaffected by this, and stays in the SPICE netlist. I guess the netlist can include a not-used ".model D D" line and that I actually can add the model by adding a spice directive with:

 .model mydiode D(Ron=.1 Roff=1Meg Vfwd=0.4)

 But is there a more elegant method? or this the way you guys use LTspice?


Answer)  If you just want change one parameter of an existing model, you could use the SPICE-directive "ako". Let's assume you want a different current gain BF for the 2N3904.
1. Place an npn transistor in the schematic.
2. Change its name to 2N3904A instead of 2N3904 in the schematic.
3. Add the SPICE-directive below to into your schematic.
.model 2N3904A ako:2N3904 BF=100

You could make a new .model definition too, of course. Therefore you can copy the original model line with Ctrl-C and place it in your schematic or in a file. Then change the parameter(s).


 Change The Model Of Many Transistors With One Statement



沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。