Post Go back to editing

LTspice stepping build-In Opamp models


I want to do a simulation with a .step command where I can exchange the simulated opamp. I want to do a parametric noise calculation. So I found on the web that there is a ako command to map models to numbers and then stepping the numbers. But in my case I've the problem that it comes with unknown subcurcuit call. 

Is there a way to do this job in LTSpice? Which symbols do I have to use on .asc file? 

  • Hello,

    The name-change with "ako" only works with ".model", but not with subcircuits. Opamps are modeled with subcircuits.

    You can make a workaround with a little bit effort. Below is the procedure.

    All opamp-models of interest have the same number of pins in the LTspice-symbol. Most of the opamp symbols have 5 pins.
    All opamp-models of interest have the same netlist order. The widely used netlist order is +input, -input +supply, -supply, output.

    You have a good chance that these requirements are fulfilled. If not, you could wrap a subcircuit around the models to adjust the pins.

    1. Find the files which need to be modified
    Place all the opamps you intend to use in the schematic to find out in which library file they are defined.
    When placed, then view the netlist.
    View -> SPICE Netlist
    Notice all the lines with .lib filename
    Many opamps are in ADI.lib, LTC.lib, ADI1.lib, LTC1.lib, ....
    Now delete the opamps from the schematic.

    2. Modifiy the model names, because .step only works with numbers.
    Copy these lib-files to the folder of your schematic and rename these lib-files.
    Now open the lib-file with a text editor and remove any text character from the subcircuit's name which you intend to use.
    Example AD712 -> change to 712, ADI795 change to 795
    Save the file in your design folder.

    3. Place the symbol "opamp2" in your circuit.
    Change the value opamp2 to {ADX}

    4. Include the modified files.
    .lib ADI1.lib
    .lib LTC.lib

    5. Add the spice directive to .step the models.

    .step param ADX list 712, 795, ......

    That's it.  Below is a screenshot of a simple example with the AD712 and AD795. You can have more items in the list of .step param of course .



  • Thank you very much for the information. This helped a lot. Anyway the simulation setup needs some work to be done, but the big thing is I can now do the simulations within LT-Spice and won't need to automated ist with an extra tool. 

    Thanks a lot,


Reply Children
No Data