Guide or a how to .... for adding a new OPAMP in SPice

Hi,
has anybody a guide how to add new parts, models in LT-SPice ?
I tried some guides from Web, but no works.

If anybody has a simple guide or sample for a how to add a new Part
, here a OPAmp NE5532 then I was lucky.

kind regards
Micha
 
For general guidance, there is a long "sticky thread" in this forum on how to use LTspice. Here is post that deals with using models (and subcircuits):

https://www.diyaudio.com/community/...from-beginner-to-advanced.260627/post-4047521

Most op amp models use the same pin order so the LTspice opamp2.asy symbol can be used without having to create a specific symbol for each op amp. Then you just need to include the op amp model on the schematic. I prefer to maintain a single library file for all op amps that share the same pin order. That way, I can try simulating the circuit with different op amps by simply changing the op amp instance name on the schematic.

Maybe an example would help. Attached is a ZIP file with a basic op amp gain block. The schematic opamp_example.asc file includes a library (.lib) directive that loads the opamp.lib library file. This library file contains only a few models just to keep things simple, but adding new subcircuit models to the library is a simple copy-and-paste operation.

You can also include just a single model file instead of a library file if you like. I have also included a subcircuit model file for the NE5532 in the ZIP file, and have shown how to include this file in the schematic with the ".inc NE5532.sub" directive. That directive is a comment on the schematic, so to use it instead of the library file just change the .lib directive to a comment, and "un-comment" the .inc directive.

Your model and library files need to be stored where LTspice can find them. LTspice will look in the folder .lib\sub by default, so that is a good place to start. You can also put them in the same folder as your schematic file.

A member here on diyAudio has developed models for a number of other op amps which might be useful for building your own library. Here is the link.

https://www.diyaudio.com/community/threads/accurate-spice-macromodels-for-some-op-amps.337687/

I hope this helps.
 

Attachments

  • Like
Reactions: jan.didden
For general guidance, there is a long "sticky thread" in this forum on how to use LTspice. Here is post that deals with using models (and subcircuits):

https://www.diyaudio.com/community/...from-beginner-to-advanced.260627/post-4047521

Most op amp models use the same pin order so the LTspice opamp2.asy symbol can be used without having to create a specific symbol for each op amp. Then you just need to include the op amp model on the schematic. I prefer to maintain a single library file for all op amps that share the same pin order. That way, I can try simulating the circuit with different op amps by simply changing the op amp instance name on the schematic.

Maybe an example would help. Attached is a ZIP file with a basic op amp gain block. The schematic opamp_example.asc file includes a library (.lib) directive that loads the opamp.lib library file. This library file contains only a few models just to keep things simple, but adding new subcircuit models to the library is a simple copy-and-paste operation.

You can also include just a single model file instead of a library file if you like. I have also included a subcircuit model file for the NE5532 in the ZIP file, and have shown how to include this file in the schematic with the ".inc NE5532.sub" directive. That directive is a comment on the schematic, so to use it instead of the library file just change the .lib directive to a comment, and "un-comment" the .inc directive.

Your model and library files need to be stored where LTspice can find them. LTspice will look in the folder .lib\sub by default, so that is a good place to start. You can also put them in the same folder as your schematic file.

A member here on diyAudio has developed models for a number of other op amps which might be useful for building your own library. Here is the link.

https://www.diyaudio.com/community/threads/accurate-spice-macromodels-for-some-op-amps.337687/

I hope this helps.
Hi, sorry for the late reply.
Many Thanks fo helping me.
kind regards
Micha