Post Go back to editing

LTspice stepping build-In Opamp models

Hello, 

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.

    Requirements:
    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 .

    Helmut

     

  • 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,

    Ubu

  • Dear,

    another solution without need of changing libraries is to create a copy of the original model with only numbers in the name.

    Example:

    .model 712 ako AD712

    .model 795 ako ADI795

    .step param ADX list 712 795

    Best regards,

  • Hello JGillis,

    Have you tried your suggested solution? 

    I just tried it and it failed.


    Please upload an example.

    .

    My settings:

    .model 712 ako AD712
    .model 795 ako AD795
    .lib ADI1.lib
    .step param ADX list 712 795

    Helmut

  • Hello Helmut,

    not yet for this schematic, I used this solution for NMOS model. Can you provide me with the library? Then I can try my solution.

    Best Regard

  • Hello JGillis,

    "ako" only works with devices which have a ".model" definition.

    .model NMOS1 nmos (....)

    Opamps are modelled with subcircuits.

    .subckt name pins ...

    Helmut