I am trying to import a TL331B op-amp from Ti but I cannot get it to work. I have tried importing the whole file as well as parts of it but no luck. Has anyone had any luck? It uses several .subckt definitions.
I’m greatful for any help on this.
I am trying to import a TL331B op-amp from Ti but I cannot get it to work. I have tried importing the whole file as well as parts of it but no luck. Has anyone had any luck? It uses several .subckt definitions.
I’m greatful for any help on this.
If you download this model from TI website, its subcircuit library can be found in TL331 PSpice Model (Rev. E), where filename is tl331.lib. However, this file call a model name LM2903B, possibly they are equivalent model.
Import this model, replicate the PSpice simulation circuit and can get same simulation result. Just a remind that when you paste the .subckt into Qspice to autogenerate the model, ensure to select “Include Entire Library”.
Parent.TL331.qsch (13.1 KB)
Thank you for the help. My problem was that I added text in the symbol when i changed it to look like an op-amp. That added faulty definitions.
The model did not work well to simulate longer times though, like 1-2 seconds it is very slow. I found another model instead:
* WARNING : please consider following remarks before usage
*
* 1) All models are a tradeoff between accuracy and complexity (ie. simulation
* time).
* 2) Macromodels are not a substitute to breadboarding, they rather confirm the
* validity of a design approach and help to select surrounding component values.
*
* 3) A macromodel emulates the NOMINAL performance of a TYPICAL device within
* SPECIFIED OPERATING CONDITIONS (ie. temperature, supply voltage, etc.).
* Thus the macromodel is often not as exhaustive as the datasheet, its goal
* is to illustrate the main parameters of the product.
*
* 4) Data issued from macromodels used outside of its specified conditions
* (Vcc, Temperature, etc) or even worse: outside of the device operating
* conditions (Vcc, Vicm, etc) are not reliable in any way.
*-----------------------------------------------------------------------------------------
* LM2901/LM2903/LM2901H/LM2903H spice macromodel
* CONNECTIONS : (corrected feb/17)
* 2 NON-INVERTING INPUT
* 1 INVERTING INPUT
* 44 POSITIVE POWER SUPPLY
* 55 NEGATIVE POWER SUPPLY
* 30 OUTPUT
**********************************************************
.SUBCKT LM290x 2 1 44 55 30
EVCCP 4 0 44 0 1.0
EVCCN 5 0 55 0 1.0
VREADIO 3 30 DC 0
G_ICCSAT 44 55 VALUE={2.1E-4+3E-6*V(44,55)}
G_IOUT_SINKED 55 0 VALUE={IF (V(1)<V(2), 0, I(VreadIo))}
.MODEL MDTH D IS=1E-11 KF=1.050321E-32 CJO=10F
* INPUT STAGE
CIP 2 5 1.000000E-12
CIN 1 5 1.000000E-12
EIP 102 0 2 0 1
VIO 10 102 438.3U
EIN 16 0 1 0 1
RIP 10 11 6.500000E+01
RIN 15 16 6.500000E+01
RIS 11 15 1.939046E+02
DIP 11 12 MDTH 400E-12
DIN 15 14 MDTH 400E-12
VOFP 12 13 DC 0.000000E+00
VOFN 13 14 DC 0
IPOL 13 0 100E-06
CPS 11 15 5.5E-09
DINN 17 13 MDTH 400E-12
VIN 17 5 0.000000e+00
DINR 15 18 MDTH 400E-12
VIP 4 18 1.500000E+00
FCP 4 5 VOFP 0.175
FCN 5 4 VOFN 0.175
FIBP 2 0 VOFN 4.000000E-04
FIBN 0 1 VOFP 4.000000E-04
* AMPLIFYING STAGE
RG1 5 19 2.85E+05
RG2 4 19 2.85E+05
DOP 19 25 MDTH 400E-12
VOP 4 25 1.097
DON 24 19 MDTH 400E-12
VON 24 5 1.097
FIP 0 19 VOFP -104
FIN 0 19 VOFN -104
EOUT 26 5 19 5 1
.MODEL NMOD NPN(IS=0.1E-09 BF=4000)
RBOUT 27 26 800K
QOUT 103 27 28 28 NMOD
REOUT 28 5 20
RSOUT 3 0 1E+12
VNUL 3 103 0
DSTOP 32 103 MDTH 400E-12
HSTOP 32 33 VNUL 135
VSTOP 33 5 0.5
.ENDS
Many Spice programs use the model:
*SRC=TL331T;TL331T;Comparators;Texas Inst.;
*SYM=TICOMP1
| INVERTING INPUT
| | POSITIVE POWER SUPPLY
| | | NEGATIVE POWER SUPPLY
| | | | OPEN COLLECTOR OUTPUT
| | | | |
.SUBCKT TL331T 1 2 3 4 5
*
F1 9 3 V1 1
IEE 3 7 DC 100.0E-6
VI1 21 1 DC .75
VI2 22 2 DC .75
Q1 9 21 7 QIN
Q2 8 22 7 QIN
Q3 9 8 4 QMO
Q4 8 8 4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
E1 10 4 9 4 1
V1 10 11 DC 0
Q5 5 11 4 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=6.765E3 CJC=1E-15 TF=937.6E-12 TR=543.8E-9)
DP 4 3 DX
RP 3 4 12.50E3
.MODEL DX D(IS=800.0E-18)
*
.ENDS
TL331B is improved drop-in replacement for TL331
Nice, thanks! I could’nt find that model online.
Could you please edit you’re answer and put the model code inside Preformatted text section? It would look better and be easier to copy without having to edit the * that become bulletpoints.
There is no loss in character for this spice model when copied and pasted without using preformatted text. I simply copied it into a text editor and added some * back. Model can always be upload with a .txt file, and this .txt can be directly read by Qspice with .lib like this example.
Parent.TL331T.qsch (6.9 KB)
TL331T-bordodynov.txt (845 Bytes)
Yeah sorry I meant that for bordodynov.