Spice simulation

Hi Bob,

I'm using this model, but I haven't gone through to verify the parameters. Removing level=2 is fine for LTspice. LTspice only understands level=4 and level=9, which tell it to use VBIC instead of Gummel-Poon. QCO, RCO and VO are quasi-sat parameters and should be valid for LTspice. All I did was comment out IBC and delete level=2.

One reason for DC convergence problems can be a very high DC output impedance of the VAS. The Early voltage of this device model is very large, so this could be a contributor. Try increasing the iteration limit with:

.options itl1=1000
.options itl6=1000

Sometimes decreasing gmin can help. I am using a VAS with MOSFETs, and I can't get convergence with normal means and have to resort to extreme measures. Hopefully you won't have to do that. Another thing to look at is trying the alternate solver, and making sure you have the latest LTspice. A few months back they added a new source-stepping algorithm to improve convergence.
 
andy_c said:
Hi Bob,

I'm using this model, but I haven't gone through to verify the parameters. Removing level=2 is fine for LTspice. LTspice only understands level=4 and level=9, which tell it to use VBIC instead of Gummel-Poon. QCO, RCO and VO are quasi-sat parameters and should be valid for LTspice. All I did was comment out IBC and delete level=2.

One reason for DC convergence problems can be a very high DC output impedance of the VAS. The Early voltage of this device model is very large, so this could be a contributor. Try increasing the iteration limit with:

.options itl1=1000
.options itl6=1000

Sometimes decreasing gmin can help. I am using a VAS with MOSFETs, and I can't get convergence with normal means and have to resort to extreme measures. Hopefully you won't have to do that. Another thing to look at is trying the alternate solver, and making sure you have the latest LTspice. A few months back they added a new source-stepping algorithm to improve convergence.


Hi Andy,

Thanks! I'll give these suggestions a try. Your point is well-taken about the high output impedance of a VAS made with this device (one off the nice things about this device, of course).

Best,
Bob
 
Hi Bob

One trick which is used in at least one professional software simulator is to add a 1 Tohm resistor to all nodes. Especially for MOSFETS this can help to avoid "open capacitor" problems.

In simpler simulators we may have to add a suitable high but acceptable resistor to do this manually...

cheers
John
 
john_ellis said:
Hi Bob

One trick which is used in at least one professional software simulator is to add a 1 Tohm resistor to all nodes. Especially for MOSFETS this can help to avoid "open capacitor" problems.

In simpler simulators we may have to add a suitable high but acceptable resistor to do this manually...

cheers
John


Thanks, John. This sounds like a good idea. I actually remember the days in the 1970's when we often had to give the simulator a set of DC node voltage guesses to get it to converge. Things have progressed remarkably since then.

Cheers,
Bob
 
Re: Re: Fairchild KSC3503/2SC3503 Model

Jeffin90620 said:


Bob,

There is a Yahoo group dedicated to LTSpice and they have been very helpful with modeling problems.

Look for them here:

LTSpice User's Group


Regards,

Jeff


Thanks, Jeff. I'll give it a shot. I was aware of the group, but to be honest, probably have not looked at enough of their discussions.

Cheers,
Bob
 
OPA2134 and OPA134 spice models

I have added one spice model to my library today.
See below.

OPA134 .. and of course can be used for OPA2134 as well

1. Would you say this is a good model ?

2. If not, what model should I use for OPA134 ?

Thanks
Lineup
================================================

* OPA134 operational amplifier "macromodel" subcircuit
* This model can also be used for OPA2134 (dual op amp)
* adapted from OPA132 model 9/24/96 BCT
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
*
.SUBCKT OPA134 1 2 3 4 5
C1 11 12 3.240E-12
C2 6 7 8.000E-12
CSS 10 99 1.000E-30
DC 5 53 DX
DE 54 5 DX
DLP 90 91 DX
DLN 92 90 DX
DP 4 3 DX
EGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5
FB 7 99 POLY(5) VB VC VE VLP VLN 0 248.0E6 -250E6 250E6 250E6 -250E6
GA 6 0 11 12 402.0E-6
GCM 0 6 10 99 4.020E-9
ISS 3 10 DC 160.0E-6
HLIM 90 0 VLIM 1E3
J1 11 2 10 JX
J2 12 1 10 JX
R2 6 9 100.0E3
RD1 4 11 2.490E3
RD2 4 12 2.490E3
RO1 8 5 20
RO2 7 99 20
RP 3 4 7.500E3
RSS 10 99 1.250E6
VB 9 0 DC 0
VC 3 53 DC 1.200
VE 54 4 DC .9
VLIM 7 8 DC 0
VLP 91 0 DC 40
VLN 0 92 DC 40
.MODEL DX D(IS=800.0E-18)
.MODEL JX PJF(IS=2.500E-15 BETA=1.010E-3 VTO=-1)
.ENDS
 
Lineup, I think it is probably very difficult to judge an op amp model by looking at it (except if your name is Scott Wurcer perhaps? :)). It also depends on what parameters and things you are interested in. A model may be very good for predicting some behaviours and not model others at all. Try simulations to see how it behaves compared to the datasheet for the things you are interested in. Things like frequency response and phase are usually well modelled, other things may vary a lot. Some models take supply voltage inte account, others assume a certain voltage.

I did a really interesting test a couple of years ago, after reading an AD app note about various decoupling schemes depending on internal topology. The AD825 model did have different behaviour depending on how I decoupled it and corresponded to the theory (although I don't know how correct it was in quantitative terms) while some other AD op amp (don't remember which one) obviously didn't model such effects at all.
 
From what I have looked at opamp models, I'd say the majority of models is pretty flawed in most aspects important for audio, above all distortion (which is *never* modelled) but also power supply effects (close to never modelled in a realistic way) etc. The twelve(!) year old model for the 134 is pretty coarse, probably not any good for detailed analysis of all but the most basic behaviour (AC stuff).

There are better models for newer opamps, anf for how close they are to the real thing they usually tell us precisly what is modelled and how deep.

The recent OPA211 is a good example, look how big it is and what they state in the header.
* Copyright 2007 by Texas Instruments Corporation
* BEGIN MODEL OPA211
* MODEL FEATURES INCLUDE OUTPUT SWING, OUTPUT CURRENT THROUGH
* THE SUPPLY RAILS, RAIL-TO-RAIL OUTPUT STAGE, OUTPUT CURRENT
* LIMIT, OPEN LOOP GAIN AND PHASE WITH RL AND CL EFFECTS,
* SLEW RATE WITH TEMPERATURE EFFECTS, SETTLING TIME TO 0.01 %,
* OVERLOAD RECOVERY TIME, COMMON MODE REJECTION WITH FREQUENCY
* EFFECTS, OUTPUT IMPEDANCE, POWER SUPPLY REJECTION WITH
* FREQUENCY EFFECTS, INPUT VOLTAGE NOISE WITH 1/F AND FEATURE
* AT 20 MEGAHERTZ, INPUT CURRENT NOISE WITH 1/F, INPUT BIAS
* CURRENT, INPUT IMPEDANCE, INPUT COMMON MODE RANGE, INPUT
* OFFSET VOLTAGE WITH TEMPERATURE EFFECTS, AND QUIESCENT
* CURRENT VS VOLTAGE AND TEMPERATURE. MODEL INCLUDES INPUT
* PROTECTION DIODES.
* MODEL DOES NOT INCLUDE SHUTDOWN.
* PINOUT ORDER +IN -IN +V -V OUT
* PINOUT ORDER 3 2 7 4 6
.SUBCKT OPA211 3 2 7 4 6
D17 9 0 DIN
D18 10 0 DIN
I14 0 9 0.1E-3
I15 0 10 0.1E-3
D19 11 0 DVN
D20 12 0 DVN
I16 0 11 0.1E-3
I17 0 12 0.1E-3
E15 13 14 11 12 4.23E-2
G5 15 13 9 10 1.1E-4
E16 16 0 17 0 1
E17 18 0 19 0 1
E18 20 0 21 0 1
R56 16 22 1E6
R57 18 23 1E6
R58 20 24 1E4
R59 0 22 10
R60 0 23 10
R61 0 24 7
E19 25 26 27 0 0.1
R62 28 21 1E3
R63 21 29 1E3
C15 16 22 1E-12
C16 18 23 1E-12
C17 20 24 1E-9
E20 30 25 23 0 -1E-3
E21 31 30 22 0 1E-3
R64 0 32 1E12
G12 15 13 33 0 1.45E-14
R136 0 33 10E3
R137 0 33 10E3
R138 26 25 1E9
R139 25 30 1E9
R140 30 31 1E9
E74 29 0 15 0 1
E75 28 0 13 0 1
C23 15 13 0.05E-12
E77 26 3 34 0 1.98E-4
R146 26 3 1E9
R147 0 32 1E12
Q41 35 36 19 QLN
R148 36 37 1E3
R149 38 39 1E3
R150 40 17 5
R151 19 41 5
R153 42 43 850
R154 44 17 5
R155 19 45 5
D22 46 7 DD
D23 4 46 DD
E58 19 0 4 0 1
E79 17 0 7 0 1
R156 4 7 1.1E9
E60 47 19 17 19 0.5
D24 48 17 DD
D25 19 49 DD
R157 50 51 100
R158 52 53 100
G14 42 47 54 47 0.1E-3
R159 47 42 5.3E6
C24 43 55 5P
C25 46 0 0.5E-12
D26 53 35 DD
D27 56 51 DD
Q42 56 39 17 QLP
R160 46 57 1
R161 58 46 1
E71 59 47 60 61 1
R162 59 54 1E4
C26 54 47 0.02P
G15 62 47 42 47 -1E-3
G16 47 63 42 47 1E-3
G17 47 64 65 19 1E-3
G18 66 47 17 67 1E-3
D28 66 62 DD
D29 63 64 DD
R163 62 66 100E6
R164 64 63 100E6
R165 66 17 1E3
R166 19 64 1E3
R167 63 47 1E6
R168 64 47 1E6
R169 47 66 1E6
R170 47 62 1E6
G19 7 4 68 0 3.5E-3
R171 47 54 1E9
R172 50 17 1E9
R173 19 52 1E9
G20 67 65 32 0 1E-3
L2 46 6 0.4E-9
R175 46 6 400
R176 67 17 1E8
R177 19 65 1E8
R178 41 53 1E8
R179 40 51 1E8
R180 0 32 1E9
E84 17 38 17 40 5
E85 37 19 41 19 3
E24 55 0 46 0 1
R219 42 55 1.8E9
I30 0 69 1E-3
D46 69 0 DD
R278 0 69 10E6
V27 69 34 0.65
R279 0 34 10E6
Q52 57 51 40 QOP
Q53 58 53 41 QON
Q54 65 65 45 QON
Q55 67 67 44 QOP
E144 17 50 17 66 1
E145 52 19 64 19 1
Q56 70 15 71 QIN
Q57 72 13 73 QIN
Q58 61 74 70 QIN
Q59 60 75 72 QIN
Q60 74 74 76 QIP
Q61 15 74 76 QIP
Q62 75 75 76 QIP
Q63 13 75 76 QIP
R280 61 77 1200
R281 60 77 1200
R282 78 71 4
R283 78 73 4
Q64 78 79 80 QTN
C108 61 81 1E-15
R284 81 55 600
I33 0 82 1E-3
D49 82 0 DD
R287 0 82 10E6
V30 82 83 1.2301
R288 0 83 10E6
E50 84 0 83 0 -1.75
R289 0 84 10E6
R290 85 84 10E6
M3 85 86 0 0 NEN L=2U W=1000U
G22 80 79 85 0 12E-6
V32 87 0 1
R291 87 86 1E6
M4 86 32 0 0 NEN L=2U W=100U
C109 61 60 4.75E-12
V34 77 76 1
E51 42 49 47 19 0.7
E52 48 42 17 47 0.7
G23 7 0 57 46 1
G24 4 0 46 58 -1
V35 17 8 1
M45 88 89 90 90 NEN L=3U W=3000U
R293 90 91 1E4
R294 88 17 1E6
V36 17 90 1
C110 17 8 1E-12
E53 32 0 92 90 1
V37 88 92 1.111E-6
R295 90 92 1E12
R296 8 17 1E6
C111 91 90 3E-15
C112 17 88 3E-15
M50 93 94 90 90 NEN L=3U W=300U
M51 89 93 90 90 NEN L=3U W=300U
R297 93 17 1E4
R298 89 17 1E4
C113 17 93 55E-12
C114 17 89 150E-12
E54 95 42 32 0 30
E55 96 47 32 0 -30
V38 97 96 15
V39 98 95 -15
R300 95 0 1E12
R301 96 0 1E12
M52 47 98 42 99 PSW L=1.5U W=150U
M53 42 97 47 100 NSW L=1.5U W=150U
R302 99 0 1E12
R303 100 0 1E12
M54 91 8 17 17 PEN L=6U W=60U
E56 101 90 91 90 -1
R304 90 101 10E6
R305 90 101 10E6
V40 94 101 1
R306 90 94 10E6
E57 102 0 24 0 1
R307 102 27 1E4
R308 0 27 7
C115 102 27 1E-9
M55 103 104 4 4 NEN L=2U W=1000U
R309 103 7 160E3
E78 104 4 32 0 3
V41 80 19 1.23
V42 17 76 0.48
R310 105 13 100
M56 68 106 0 0 NEN L=2U W=10M
R311 68 84 850E3
E70 107 0 32 0 -1
R312 0 107 10E6
R313 0 107 10E6
V43 106 107 1
R314 0 106 10E6
G25 7 4 32 0 -0.85E-3
G26 7 4 108 0 -4E-5
E61 109 0 7 4 1
M57 108 106 0 0 NEN L=2U W=10M
R315 108 109 75E3
E62 2 14 110 0 0.93
R317 0 110 1E3
C116 110 0 2.4E-12
L5 0 110 40E-6
R318 14 2 1E9
C117 0 15 6E-12
C118 13 0 6E-12
V44 31 15 -29E-6
J2 105 15 105 JC
J3 15 105 15 JC
.MODEL JC NJF IS=1E-18
.MODEL QON NPN RC=5
.MODEL QOP PNP RC=5
.MODEL DD D
.MODEL QIN NPN BF=235
.MODEL QIP PNP BF=235
.MODEL QTN NPN
.MODEL DVN D KF=2.5E-15
.MODEL DIN D KF=1E-15
.MODEL QLN NPN
.MODEL QLP PNP
.MODEL NEN NMOS KP=200U VTO=0.5 IS=1E-18
.MODEL PEN PMOS KP=200U VTO=-0.7 IS=1E-18
.MODEL PSW PMOS KP=200U VTO=-7.5 IS=1E-18
.MODEL NSW NMOS KP=200U VTO=7.5 IS=1E-18
.ENDS
* END MODEL OPA211

- Klaus
 
KSTR said:
From what I have looked at opamp models, I'd say the majority of models is pretty flawed in most aspects important for audio, above all distortion (which is *never* modelled) but also power supply effects (close to never modelled in a realistic way) etc. The twelve(!) year old model for the 134 is pretty coarse, probably not any good for detailed analysis of all but the most basic behaviour (AC stuff).

There are better models for newer opamps, anf for how close they are to the real thing they usually tell us precisly what is modelled and how deep.

The recent OPA211 is a good example, look how big it is and what they state in the header.
- Klaus

I know what you mean: 'pretty flawed'
And now we are speaking OP-amp models. And not transistors.

For example the default model of AD797 in my library is totally useless.
It shows nothing but ideal performance :D

I did run some tests of Open Loop with this OPA134 model.
It does not seems to be too bad:
- Open Loop gain: ~10.000
- Open Loop Unity gain BWidth: Like 8-10 MHz
- Current output where start to distort: ~35 mA peak


I would say it is more of an honest model.
At least many times better than my discusting AD797 spice model


Regars, Lineup
 
Er, AD797.... this one?
* AD797 SPICE Macro-model 10/92, Rev. A
* AAG / PMI
*
* Copyright 1992 by Analog Devices, Inc.
*
* Refer to "README.DOC" file for License Statement. Use of this model
* indicates your acceptance with the terms and provisions in the License
* Statement.
*
* Node assignments
* non-inverting input
* | inverting input
* | | positive supply
* | | | negative supply
* | | | | output
* | | | | | decompensation
* | | | | | |
.SUBCKT AD797 1 2 99 50 38 14
*
* INPUT STAGE & POLE AT 500 MHz
*
IOS 1 2 DC 50E-9
CIND 1 2 20E-12
CINC1 1 98 5E-12
GRCM1 1 98 POLY(2) 1 31 2 31 (0,5E-9,5E-9)
GN1 0 1 44 0 1E-3
CINC2 2 98 5E-12
GRCM2 2 98 POLY(2) 1 31 2 31 (0,5E-9,5E-9)
GN2 0 2 47 0 1E-3
EOS 9 3 POLY(1) 22 31 25E-6 1
EN 3 1 41 0 0.1
D1 2 9 DX
D2 9 2 DX
Q1 5 2 4 QX
Q2 6 9 4 QX
R3 97 5 0.5172
R4 97 6 0.5172
C2 5 6 3.0772E-10
I1 4 51 100E-3
EPOS 97 0 99 0 1
ENEG 51 0 50 0 1
*
* INPUT VOLTAGE NOISE GENERATOR
*
VN1 40 0 DC 2
DN1 40 41 DEN
DN2 41 42 DEN
VN2 0 42 DC 2
*
* +INPUT CURRENT NOISE GENERATOR
*
VN3 43 0 DC 2
DN3 43 44 DIN
DN4 44 45 DIN
VN4 0 45 DC 2
*
* -INPUT CURRENT NOISE GENERATOR
*
VN5 46 0 DC 2
DN5 46 47 DIN
DN6 47 48 DIN
VN6 0 48 DC 2
*
* GAIN STAGE & DOMINANT POLE AT 7.33 Hz
*
EREF 98 0 31 0 1
G1 98 10 5 6 10
R7 10 98 10
E1 99 11 POLY(1) 99 31 -2.294 1
D3 10 11 DX
E2 12 50 POLY(1) 31 50 -2.294 1
D4 12 10 DX
G2 98 13 10 31 1E-3
R8 13 98 10
G3 99 14 98 13 34.558E-3
G4 99 16 98 98 34.558E-3
G5 14 15 15 14 20E-3
G6 16 17 17 14 20E-3
R9 15 18 400
R10 17 18 400
E3 18 98 16 98 1
R11 16 98 4.3406E8
C5 16 98 50E-12
V1 99 19 DC 2.2542
D5 16 19 DX
V2 20 50 DC 2.2542
D6 20 16 DX
RDC 14 98 1E15
*
* COMMON-MODE GAIN NETWORK WITH ZERO AT 1.35 kHz
*
ECM 21 98 POLY(2) 1 31 2 31 (0,158.11E-3,158.11E-3)
RCM1 21 22 1
CCM 21 22 1.1789E-4
RCM2 22 98 1E-6
*
* POLE-ZERO PAIR AT 3.9 MHz/10 MHz
*
GPZ 98 23 16 98 1
RPZ1 23 98 1
RPZ2 23 24 0.63934
CPZ 24 98 24.893E-9
*
* NEGATIVE ZERO AT -300 MHz
*
ENZ 25 98 23 31 1E6
RNZ1 25 26 1
CNZ 25 26 -5.3052E-10
RNZ2 26 98 1E-6
*
* POLE AT 300 MHz
*
GP2 98 27 26 31 1
RP2 27 98 1
CP2 27 98 5.3052E-10
*
* POLE AT 500 MHz
*
GP3 98 28 27 31 1
RP3 28 98 1
CP3 28 98 3.1831E-10
*
* POLE AT 500 MHz
*
GP4 98 29 28 31 1
RP4 29 98 1
CP4 29 98 3.1831E-10
*
* OUTPUT STAGE
*
VW 29 30 DC 0
RDC1 99 31 23.25E3
CDC 31 0 1E-6
RDC2 31 50 23.25E3
GO1 98 32 37 30 25E-3
DO1 32 33 DX
VO1 33 98 DC 0
DO2 34 32 DX
VO2 98 34 DC 0
FDC 99 50 POLY(2) VO1 VO2 7.56E-3 1 1
VSC1 35 37 0.945
DSC1 30 35 DX
VSC2 37 36 0.745
DSC2 36 30 DX
FSC1 37 0 VSC1 1
FSC2 0 37 VSC2 1
GO3 37 99 99 30 25E-3
GO4 50 37 30 50 25E-3
RO1 99 37 40
RO2 37 50 40
LO 37 38 10E-9
*
* MODELS USED
*
.MODEL QX NPN(BF=2E5)
.MODEL DX D(IS=1E-15)
.MODEL DEN D(IS=1E-12 RS=6.3708E3 AF=1 KF=1.59E-15)
.MODEL DIN D(IS=1E-12 RS=474 AF=1 KF=7.816E-15)
.ENDS AD797
 
john curl said:
I thought that today's SPICE models were 'perfect'. :geezer:


Are all real components perfect, just because some of them are very good? ;)

It is difficult to make a really good model, and for complex things like op amps there is also the trade off between goodness and simulation speed. And let's not forget that the manufacturers also don't want to give us too many details about what's actually inside them. It would be interesting to know how good the in house simulators of AD, TI and others are. I understand they usually use better simulators than Spice also.
 
john curl said:
I thought that today's SPICE models were 'perfect'. :geezer:


John.
Some models are excellent.
It has been verified that they can predict real circuits very well.

But some models submitted, probably by manufacturers of products,
are far from reality.
To use them and get some valid results, would be a big mistake.

Just like any other model of reality - there are good and bad.

Take maps.
There are many different maps:
- road maps
- nature topology maps
- different resolutions

And maps can also be more or less precise.
With todays satellite based maps, we can get a very precise model / picture
of the real location.
Sometimes downto to less than 10 meter resolution.


talking of using virtual tools:
John, I am not actually conversating you.
This post is just a virtual conversation/communication I have with you and others.
Using a model of real speech.

Should not be confused with the real thing
... when you can do a listening test of my voice
... and see my facial expressions, while speaking with you
.

Sure :) there is a difference.
Isn't it?
 
Gee, fellas, I was just joking! I KNOW that most models are not perfect, and that is why when Bob Cordell demanded a SPICE model of my JC-1 power amp, (long ago) I just about fell over laughing.
I know a little something about models, as I used to have to make the transistors models myself with a curve tracer back in 1966, a long time ago. We had problems then, Dr Pederson (the father of SPICE) had problems in 1973, when I was taking his class, and we still have problems (some) now. I don't expect perfection, but I do not rely on imperfection to optimize my circuits in virtual space, either. It is just easier for ME just to try the circuit in real space.
 
john curl said:
Gee, fellas, I was just joking!

Thanks for clearing that up, John. For a minute there, I thought Grey might have broken into your account :clown:.

But seriously, most SPICE op-amp macro models are really awful. They do not model distortion at all, though they do exhibit some distortion because the input stage is usually modeled with discrete devices. We discussed that in the Blowtorch thread.

The discrete device models, at least for BJTs, are not so bad, and as Scott has mentioned, can be quite good when professional care is taken to extract the parameters. JFET models are pretty primitive, as there is currently no economic incentive for the development of better ones as there is with MOS devices. If you're interested in learning more about the equations that modern SPICE simulators use for BJTs, I highly recommend Massobrio and Antognetti. It's a great book. In fact, given that you're a "bookworm" kind of guy, I'm surprised that you haven't dug in and pointed out the errors that are often made. It's another world with many new horizons to discover.
 
We, old geezers, don't need to know about spice models to that extent, but thanks for the tip. I'm sure PMA will be interested, and several others. Since I design almost exclusively with Japanese Jfets, mosfets, and only sometimes use transistors, modeling transistors with Spice is not my first interest. Getting microcap to work easily, for me, is my best priority, and I will leave the models up to you engineers.
 
Convergence

Hello andy_c

Just out of curiosity have you ever tried different simulators which have claims of better convergence and compared them too Ltspice using same circuit and models , other packages which I refer to are Spectre (cadence) and Simetrix. Dont get me wrong as freeware LTspice is very hard to beat its serious software.

Regards
Arthur