Post Go back to editing

Another "Unknown subcircuit called in" message

Thread Summary

The user encountered an 'Unknown subcircuit' error in LTspice when using the OPAMP model without a .subcircuit directive. The solution was to correct the parentheses in the netlist and use the UniversalOpAmp1, 2, or 3 models. The wiper parameter was also adjusted to avoid a 0 ohm resistor, which can cause simulation issues.
AI Generated Content
Category: Software
Product Number: LTSpice
Software Version: 17.2.4

Issue: When I run the simulator on my circuit, I get:

Unknown subcircuit called in:
xu1 n001 input n001 opamp aol=100k gbw=10meg

What's odd is that I've not specified any .subcircuit directives.  Here's the entire net list:

*
XU1 N001 INPUT N001 opamp Aol=100K GBW=10Meg
XU2 N002 0 OUTPUT opamp Aol=100K GBW=10Meg
R1 N002 N001 10K
R2 OUTPUT N002 10K
R3 N001 INPUT {RPot*wiper}
R4 INPUT OUTPUT {RPot*(1-wiper)}
V1 INPUT 0 1
.param RPot 10k
.param wiper 0.5
.step param wiper 0.1 0.9 0.1
.tran 4m
.backanno
.end

I"m pretty sure this is a simple error on my part.  Schematic and .asc file included. 4137.Draft3.asc

  • Hi !

    With LTspice 26.0.2 : First error :

    => Correct the "(".

    OPAMP model is used if you have .lib from manufacturer.
    So, I advise you tu used UniversalOpAmp1 or UniversalOpAmp2, or UniversalOpAmp3 according to complexity.

    Last thing : wiper can't be "0" because resistor will be null. I have changed it to 0.1.

    Corrected file : 4137.Draft3_ESA.asc

    Have a nice day.

  • I think the UniversalOpAmp1 would work.  Instead, I added a ".lib opamp.sub" along with the other changes you mentioned and the simulation works now.  (Side question: what's wrong with a 0 ohm resistor?  It would be handy if that were allowed...)

  • Hi rdpoor,

    You asked "(Side question: what's wrong with a 0 ohm resistor?  It would be handy if that were allowed...)"

    SPICE doesn't allow them, that's all.  Simulations involve several trials while converging on a result.  If it ever tried it with even a femtovolt across the resistor, the current would blow up.  So it is a restriction that they put into SPICE, some 50 years ago.

    .step param wiper 0.001 0.999 0.1

    Regards,

    Andy

  • Hi rdpoor,

    Sorry I forgot to mention this before:

    The "opamp" device you used is a very ideal, non-realistic op-amp model.  Notice that it has no supply voltages.  There is nothing to limit its output voltage, and some circuits could drive its output voltage towards infinity.  It is OK 99% of the time, but occasionally it does not produce the results that you wanted.

    Also, your circuit seems to be missing something.  I think you might not have drawn it the way you wanted.  It appears to have positive feedback around the first op-amp, except that the op-amp is also driven by an ideal voltage source, so the wiper of the potentiometer seems to have no real purpose.  Also note that it would make no sense either if wiper=0 (U1's output short-circuited to V1), or if wiper=1 (U2's output short-circuited to V1).  Both of those seem wrong.  Or maybe I misunderstood.

    Regards,

    Andy