1
\$\begingroup\$

I downloaded the Spice TL494 model and included it in the following circuit, but it gives the following error: enter image description here enter image description here

and by changing the tl494 library to the name of the UniversalOpAmp2.lib library (which is present in the ltspice library), it gives a level.2 error. enter image description here

Also, by changing level.2 to level2 in the tl494 library, this error still exists.

* TL494.asc
*              1    2   3   4  5  6   7  8  9  10 11 12  13  14  15   16
.subckt tl494 1IN+ 1IN- FB DTC CT RT GND C1 E1 E2 C2 VCC OC REF 2IN- 2IN+
XEA1 1IN+ 1IN- VCC 0 N015 level.2 Avol=1e5 GBW=1Meg Slew=10k ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=1Meg
XEA2 2IN+ 2IN- VCC 0 N016 level.2 Avol=1e5 GBW=1Meg Slew=10k ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=1Meg
V§DT N007 DTC 0.12
V2 N014 CT 0.7
A1 0 N005 0 N011 0 0 N009 0 OR vhigh=4.8 td=50n
A2 0 N006 0 N009 0 N002 0 0 OR vhigh=4.8 td=50n
A3 0 N010 0 N009 0 N012 0 0 OR vhigh=4.8 td=50n
A4 0 OC` 0 N008 0 0 N006 0 AND vhigh=4.8 td=50n
A5 0 N004 0 OC` 0 0 N010 0 AND vhigh=4.8 td=50n
E1 OC` 0 OC 0 1
A6 N004 0 N009 N001 0 N004 N008 0 DFLOP vhigh=4.8 vlow=0.2 td=50n
I2 FB 0 0.7m
R1 N003 N002 470
R2 N013 N012 470
R4 N003 E1 2k7
R5 N013 E2 2k7
Q3 RT RT Ref 0 PNP
Q4 CT RT Ref 0 PNP
S1 0 CT ctl 0 SW off
A10 CT 0 0 0 0 0 ctl 0 SCHMITT vhigh=1 vlow=-1 vt=1.5 vh=1.495 td=10n tripdt=1n
R3 VCC Ref 270
R6 N001 0 470
C1 N001 VCC 1n
XU1 N007 CT VCC 0 N005 level.2 Avol=1G GBW=1G Slew=1G ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=500Meg
XU2 FB N014 VCC 0 N011 level.2 Avol=1G GBW=1G Slew=1G ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=500Meg
Q1 C1 N003 E1 0 NPN
Q2 C2 N013 E2 0 NPN
D3 0 Ref DZ
D1 N016 FB D
D2 N015 FB D
D4 N001 VCC D
D5 0 N001 D
.model D D
.model NPN NPN
.model PNP PNP
.model sw sw(ron=1)
.lib ltc.lib
.model dz d(vrev=5)
.lib UniversalOpamps2.sub
.ends tl494

The UniversalOpAmp2.lib library is also as follows:

.subckt level2 1 2 3 4 5 S1 5 3 X 5 Q S2 4 5 5 X Q A1 2 1 0 0 0 0 X 0 OTA G={Avol/Rout} ref={Vos} Iout={slewCout} Cout={Cout} en={en} enk={enk} in={in} ink={ink} incm={incm} incmk={incmk} Vhigh=1e308 Vlow=-1e308 C3 5 4 1p C4 3 5 1p R2 X 4 {2Rout} noiseless R1 3 X {2Rout} noiseless R3 3 1 {2Rin} noiseless R4 3 2 {2Rin} noiseless R5 2 4 {2Rin} noiseless R6 1 4 {2Rin} noiseless B1 X 0 I=if(V(x,3)<0,0,({2slewCout}V(x,3))**2) B2 0 X I=if(V(x,4)>0,0,({2slewCout}*V(4,x))**2) D1 5 3 X D2 4 5 X .param Rout=100Meg .param Cout={Avol/GBW/2/pi/Rout} .model Q SW(Ron=10 Roff=10Meg Vt=0 Vh=-.1 Vser={Rail} ilimit={Ilimit} noiseless level=2 epsilon={Rail/10}) .param Avol=1Meg GBW=10Meg Slew=10Meg ilimit=25m rail=0 Vos=0 .param en=0 enk=0 in=0 ink=0 incm=0 incmk=0 Rin=1G .model X D(Ron=1 epsilon=10 noiseless) .ends level2

\$\endgroup\$
4
  • 1
    \$\begingroup\$ What is contained in the referenced file UniversalOpamps2.sub? The error seems to be that that file contains either no SPICE netlist or a malformed SPICE netlist. \$\endgroup\$
    – Hearth
    Commented Oct 2, 2022 at 13:58
  • \$\begingroup\$ See this bordodynov.ltwiki.org robertugo directory \$\endgroup\$
    – Antonio51
    Commented Oct 2, 2022 at 19:15
  • 1
    \$\begingroup\$ Meysam, I just checked my LTspice installation directories and found both .LIB files mentioned in your spice model text near the bottom. That suggests to me that they should be found, unless you modified the installation's search folder list to block access to them. (But I do need to check its contents.) Also, where did you get your symbol for it? (The .ASY) Hmm. I now think I see the problem. The spice model references "level.2" and not "level2" which is what is found in the referenced .LIB. You may need to edit the spice model you have. \$\endgroup\$
    – jonk
    Commented Oct 2, 2022 at 20:34
  • \$\begingroup\$ What if you open the file inside LTspice, right click on the .subckt and autogenerate a symbol from it? \$\endgroup\$
    – winny
    Commented Oct 3, 2022 at 10:35

1 Answer 1

4
\$\begingroup\$

Here's the text of the UniversalOpamp2.LIB file (found in .\lib\sub):

* Copyright (c) 1998-2021 Analog Devices, Inc.  All rights reserved.
*
.subckt level2 1 2 3 4 5
S1 5 3 X 5 Q
S2 4 5 5 X Q
A1 2 1 0 0 0 0 X 0 OTA G={Avol/Rout} ref={Vos} Iout={slew*Cout} Cout={Cout} en={en} enk={enk} in={in} ink={ink} incm={incm} incmk={incmk} Vhigh=1e308 Vlow=-1e308
C3 5 4 1p
C4 3 5 1p
R2 X 4 {2*Rout} noiseless
R1 3 X {2*Rout} noiseless
R3 3 1 {2*Rin} noiseless
R4 3 2 {2*Rin} noiseless
R5 2 4 {2*Rin} noiseless
R6 1 4 {2*Rin} noiseless
B1 X 0 I=if(V(x,3)<0,0,({2*slew*Cout}*V(x,3))**2)
B2 0 X I=if(V(x,4)>0,0,({2*slew*Cout}*V(4,x))**2)
D1 5 3 X
D2 4 5 X
.param Rout=100Meg
.param Cout={Avol/GBW/2/pi/Rout}
.model Q SW(Ron=10 Roff=10Meg Vt=0 Vh=-.1 Vser={Rail} ilimit={Ilimit} noiseless level=2 epsilon={Rail/10})
.param Avol=1Meg GBW=10Meg Slew=10Meg ilimit=25m rail=0 Vos=0
.param en=0 enk=0 in=0 ink=0 incm=0 incmk=0 Rin=1G
.model X D(Ron=1 epsilon=10 noiseless)
.ends level2

Note in particular this line: .subckt level2 1 2 3 4 5

The sub-circuit name is level2 and it has 5 pins. Now, referring to your own listing of your spice model there are these two lines:

XU1 N007 CT VCC 0 N005 level.2 Avol=1G GBW=1G Slew=1G ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=500Meg
XU2 FB N014 VCC 0 N011 level.2 Avol=1G GBW=1G Slew=1G ilimit=25m rail=0 Vos=0 phimargin=45 en=0 enk=0 in=0 ink=0 Rin=500Meg

After the \$XU_i\$ command of both, the next 5 items connect up the 5 pins. But the 6th item names the sub-circuit to use and they specify level.2 (which isn't in the .LIB file) instead of level2 (which is in the .LIB file.)

I think that's an error that needs to be corrected in the model you have.

\$\endgroup\$
6
  • 3
    \$\begingroup\$ A little extra history for this issue. LTspice used to ship with a single UniversalOpamp2 symbol and it referenced the lone UniversalOpamps2.sub. You would use a drop-down box in the symbol to select which level [level.x]. Then in December 2021, they ditched that old scheme they've been using for years and instead made separate symbols and .lib files for each level of opamp. This breaks any 3rd party subcircuit which was authored using the old scheme, unless the end-user has the old .sub file (i.e. earlier installation). More info here: electronics.stackexchange.com/a/529541 \$\endgroup\$
    – Ste Kulov
    Commented Oct 3, 2022 at 17:00
  • 1
    \$\begingroup\$ @SteKulov Interesting history. I could only see what I see today. But you've explained why this occurred! \$\endgroup\$
    – jonk
    Commented Oct 3, 2022 at 21:09
  • \$\begingroup\$ Does anyone have a newer spice model for the tl494? There are no models on the Texas Instruments website!!!! \$\endgroup\$
    – Meysam
    Commented Oct 4, 2022 at 8:55
  • \$\begingroup\$ @Meysam Yes. I do. What do you want me to do? \$\endgroup\$
    – jonk
    Commented Oct 4, 2022 at 9:02
  • 1
    \$\begingroup\$ @Meysam There are several at the LTspice group. You may need to sign up there, though. It's free. I'd rather not spend a lot of my time testing them. But some there do come in ZIP files that include test circuits. \$\endgroup\$
    – jonk
    Commented Oct 4, 2022 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.