OPA891 / OPA2891 Model Needed


 

TI is publishing the OPA891 model only for their TINA program. I understand there is a procedure to extract the TINA model information and make a LTSpice-compatible model.
I also understand that the TINA model uses non-standard pin order to assign nodes to its opamp symbol so that needs to be fixed.
I struggle to install a new spice model into my installation, mainly because I do it very seldom and forget how to do it when I need to do it again.  Has someone already come up with a working LTSpice model of the 0PA891 that I can install in my system?
Thanks!


 

On Fri, Dec 20, 2024 at 09:18 AM, <info@...> wrote:
TI is publishing the OPA891 model only for their TINA program.
It is a SPICE model.
 
TINA-TI can use either generic SPICE models, or models using their own format which only work in their program.  Fortunately, this one is a SPICE model.   In that respect, there should be nothing to convert.
 
I also understand that the TINA model uses non-standard pin order to assign nodes to its opamp symbol so that needs to be fixed.
That is true - to the extent that the pin-order is really a "standard".  There is a customary pin-order that most op-amp SPICE models use, but not all.  This is one of the exceptions.
 
There are multiple ways to "fix" that.  The easiest, is to open the OPA891 SPICE  model in a text editor (LTspice has a pretty good text editor built-in), and change this line:
    .subckt OPA891 IN+ IN- OUT V+ V-
to this:
    .subckt OPA891 IN+ IN- V+ V- OUT
While you are at it, also delete the very last line in the file:
    .END
because it has no place being in a SPICE model.  Then save the file.
 
Andy
 


 

Let us know if you encounter any problems with that model.  I did not try it yet.
 
Andy
 
 


 

Just in case it was not obvious already -
 
Use LTspice's "opamp2" symbol with this model, after making the change to the model file.
 
Change the name next to the symbol from "opamp2" to "OPA891".
 
Also add this line:
    .lib OPA891_Movel_V1p1.lib
to your schematic.  Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path folders.
 
Andy
 


 

Very good advice. You can also, with advantage, do both; save in both locations, so that in 2027 you won't need to recall which  schematic directory the model is in.

On 2024-12-20 14:45, Andy I via groups.io wrote:
Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path folders.
-- 
OOO - Own Opinions Only
Best Wishes
John Woodgate
Keep trying

Virus-free.www.avg.com


 

Since Version 24 came it appears that I am supposed to keep my user defined models in a different place than the factory models, However I have not yet made the switch from the file structure I had previously.  I keep my models in subdirectories in the factory lib and sym folders.

I edited the Pin locations in the TI supplied OPA891_Model_V1p1.lib and renamed the edited version to OPA891_Model_V1p1SAH.lib.  I presume that I must copy that entire file to a directory where the symbol can call it.

I have made 2 symbols: OPA891 and OPA2891 which should both call the same Model.

I edited the Attributes as follows:

Prefix X

SpiceModel   TSS/OPA891.sub  (my customized models are in a TSS subdirectory)

Value     OPA891 

Remaining attributes are blank

It seems that the SpiceModel attribute should be OPA891_Model_V1p1SAH.lib  rather than .sub. along with directions for the symbol to find it.

There is a whole lot of other stuff in that file other than the opamp model itself.  Should the symbol call the whole .lib file and it will figure out which part to use?

Sorry for the newbee questions, but figuring out the directory structure in version 24 isn't easy for me.

I'm still smarting from when an attempted install of version 24 erased my entire Win 7 LTSpice installation without warning.

 

Many thanks,

Steve

On 2024-12-20 09:45, Andy I via groups.io wrote:

Just in case it was not obvious already -
 
Use LTspice's "opamp2" symbol with this model, after making the change to the model file.
 
Change the name next to the symbol from "opamp2" to "OPA891".
 
Also add this line:
    .lib OPA891_Movel_V1p1.lib
to your schematic.  Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path folders.
 
Andy
 


 

It's unwise to store your stuff in the LTspice 'working copies' of the native folders, that also  should never be touched. This is because your 'LTspice' becomes different from those of everyone else, and that complicates sharing and advising. There are two safe places to store, and I recommend using both - the folder that holds your .ASC file and your personal library, set up in User-defined Lib. Search Path folders.

On 2024-12-20 20:38, info@... wrote:

Since Version 24 came it appears that I am supposed to keep my user defined models in a different place than the factory models, However I have not yet made the switch from the file structure I had previously.  I keep my models in subdirectories in the factory lib and sym folders.

I edited the Pin locations in the TI supplied OPA891_Model_V1p1.lib and renamed the edited version to OPA891_Model_V1p1SAH.lib.  I presume that I must copy that entire file to a directory where the symbol can call it.

I have made 2 symbols: OPA891 and OPA2891 which should both call the same Model.

I edited the Attributes as follows:

Prefix X

SpiceModel   TSS/OPA891.sub  (my customized models are in a TSS subdirectory)

Value     OPA891 

Remaining attributes are blank

It seems that the SpiceModel attribute should be OPA891_Model_V1p1SAH.lib  rather than .sub. along with directions for the symbol to find it.

There is a whole lot of other stuff in that file other than the opamp model itself.  Should the symbol call the whole .lib file and it will figure out which part to use?

Sorry for the newbee questions, but figuring out the directory structure in version 24 isn't easy for me.

I'm still smarting from when an attempted install of version 24 erased my entire Win 7 LTSpice installation without warning.

 

Many thanks,

Steve

On 2024-12-20 09:45, Andy I via groups.io wrote:

Just in case it was not obvious already -
 
Use LTspice's "opamp2" symbol with this model, after making the change to the model file.
 
Change the name next to the symbol from "opamp2" to "OPA891".
 
Also add this line:
    .lib OPA891_Movel_V1p1.lib
to your schematic.  Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path folders.
 
Andy
 
-- 
OOO - Own Opinions Only
Best Wishes
John Woodgate
Keep trying

Virus-free.www.avg.com


 

On 20/12/2024 21:38, info@... wrote:

Since Version 24 came it appears that I am supposed to keep my user defined models in a different place than the factory models, However I have not yet made the switch from the file structure I had previously.  I keep my models in subdirectories in the factory lib and sym folders.

That has been the advice from here for many years prior to V24.

I edited the Pin locations in the TI supplied OPA891_Model_V1p1.lib and renamed the edited version to OPA891_Model_V1p1SAH.lib.  I presume that I must copy that entire file to a directory where the symbol can call it.

I have made 2 symbols: OPA891 and OPA2891 which should both call the same Model.

I edited the Attributes as follows:

Prefix X

SpiceModel   TSS/OPA891.sub  (my customized models are in a TSS subdirectory)

Value     OPA891 

Remaining attributes are blank

It seems that the SpiceModel attribute should be OPA891_Model_V1p1SAH.lib  rather than .sub. along with directions for the symbol to find it.

The SpiceModel attribute is optional. But if you assign a value to it, that should be exactly the name the of the model file. Whether this has a "sub", "lib", or any other suffix makes no difference. If you leave it blank, you need to inform LTspice of the name of the model file some other way. I prefer adding:

.lib ModelFileName

..as a SPICE directive. This is visible on the schematic and unambiguous. It is also easy to view this file file by Right-clicking on the directive > Open.

There is a whole lot of other stuff in that file other than the opamp model itself.  Should the symbol call the whole .lib file and it will figure out which part to use?

That is exactly what the .lib directive does.

Sorry for the newbee questions, but figuring out the directory structure in version 24 isn't easy for me.

I'm still smarting from when an attempted install of version 24 erased my entire Win 7 LTSpice installation without warning

That's strange, as I'm not sure V24 will run on Win7, according to the ADI website.

You would be wise to back up critical files before making any major changes to your system. I would imagine you have heard that advice before. I recommend you have a regular backup regime in place, preferably an automatic schedule. You never know when disaster will strike - don't make it any worse by not having backups.

--
Regards,
Tony


 

On Fri, Dec 20, 2024 at 03:38 PM, <info@...> wrote:

Since Version 24 came it appears that I am supposed to keep my user defined models in a different place than the factory models,

That is not new to Version 24.  I think it has been such ever since LTspice IV.  People who ignored the advice and tried adding their models in the wrong place, sometimes found that it did not work.  It was a risky thing to add your models to the program's own library area (which I assume is what you meant by "the factory models").

Creating user-defined Sym. and Lib. Search Paths has been part of LTspice XVII for some years now.  If you wish having central locations for your model files, that is probably the best way to do it, and has been for some time now.
 

I edited the Pin locations in the TI supplied OPA891_Model_V1p1.lib and renamed the edited version to OPA891_Model_V1p1SAH.lib.  I presume that I must copy that entire file to a directory where the symbol can call it.

Yes, that entire file is the SPICE model for the OPA891.  If you did not have the model file where LTspice can find it, then LTspice would not find it and the simulation would be in trouble.  That is true.
 

SpiceModel   TSS/OPA891.sub  (my customized models are in a TSS subdirectory)

I might be mistaken, but I believe the ModelFile attribute is the better one to have used.  There are certain "exceptions" that one gets into when using the SpiceModel attribute so I would avoid that one if I were you.
 
"TSS/OPA891.sub" would be correct only if that is the filespec of your model file.  But you said that the model file's filename is "OPA891_Model_V1p1SAH.lib" so that is a problem.  It makes no sense to call a file using a different filename than it actually has.  AI aside, computers don't like guessing what you were thinking.
 

It seems that the SpiceModel attribute should be OPA891_Model_V1p1SAH.lib  rather than .sub  ...

Of course!  See above.  The filename you used must match the actual filename.  Because you are telling it the filename of the file to load, that filename must be the actual filename.
 

There is a whole lot of other stuff in that file other than the opamp model itself.  ...

No, there is no other stuff.  Everything in that file is part of the model.
 
It is not unusual for a model to use more than one subcircuit, all of which are part of the model.  If you eliminated the rest, it wouldn't work.
 
The structure T.I. used here is not one that I like, where they put all the secondary subcircuits separate from the main one, instead of inside it.  I would have done it differently..  There is a small possibility of having conflicts between those secondary subcircuits and another model in the same simulation.  The likelihood of that is very small, but could happen if you use another T.I. model in the same simulation.  Oh well.
 

Should the symbol call the whole .lib file and it will figure out which part to use?

It will use all of it.  It will do the right thing.  That is how SPICE works.
 
Andy
 


 

It appears that the symbol is able to call the OPA891 spice model without problem.

I edited the model to make the pins agree with the conventional symbols, but it won't run

I used the TI model unedited and I changed the symbol pin net numbers to match, but it won't run.

It gives the same error every time:

" Unknown subcircuit called in:
xu1 0 n002 n003 v+ v- tss/opa891_model_v1p1.lib opa891"

I believe that someone has this model running, but I don't understand the inner workings of LTspice well enough to troubleshoot this error.

Thanks for all your help.

Steve




 


On 2024-12-21 00:09, Andy I via groups.io wrote:

On Fri, Dec 20, 2024 at 03:38 PM, <info@...> wrote:

Since Version 24 came it appears that I am supposed to keep my user defined models in a different place than the factory models,

That is not new to Version 24.  I think it has been such ever since LTspice IV.  People who ignored the advice and tried adding their models in the wrong place, sometimes found that it did not work.  It was a risky thing to add your models to the program's own library area (which I assume is what you meant by "the factory models").

Creating user-defined Sym. and Lib. Search Paths has been part of LTspice XVII for some years now.  If you wish having central locations for your model files, that is probably the best way to do it, and has been for some time now.
 

I edited the Pin locations in the TI supplied OPA891_Model_V1p1.lib and renamed the edited version to OPA891_Model_V1p1SAH.lib.  I presume that I must copy that entire file to a directory where the symbol can call it.

Yes, that entire file is the SPICE model for the OPA891.  If you did not have the model file where LTspice can find it, then LTspice would not find it and the simulation would be in trouble.  That is true.
 

SpiceModel   TSS/OPA891.sub  (my customized models are in a TSS subdirectory)

I might be mistaken, but I believe the ModelFile attribute is the better one to have used.  There are certain "exceptions" that one gets into when using the SpiceModel attribute so I would avoid that one if I were you.
 
"TSS/OPA891.sub" would be correct only if that is the filespec of your model file.  But you said that the model file's filename is "OPA891_Model_V1p1SAH.lib" so that is a problem.  It makes no sense to call a file using a different filename than it actually has.  AI aside, computers don't like guessing what you were thinking.
 

It seems that the SpiceModel attribute should be OPA891_Model_V1p1SAH.lib  rather than .sub  ...

Of course!  See above.  The filename you used must match the actual filename.  Because you are telling it the filename of the file to load, that filename must be the actual filename.
 

There is a whole lot of other stuff in that file other than the opamp model itself.  ...

No, there is no other stuff.  Everything in that file is part of the model.
 
It is not unusual for a model to use more than one subcircuit, all of which are part of the model.  If you eliminated the rest, it wouldn't work.
 
The structure T.I. used here is not one that I like, where they put all the secondary subcircuits separate from the main one, instead of inside it.  I would have done it differently..  There is a small possibility of having conflicts between those secondary subcircuits and another model in the same simulation.  The likelihood of that is very small, but could happen if you use another T.I. model in the same simulation.  Oh well.
 

Should the symbol call the whole .lib file and it will figure out which part to use?

It will use all of it.  It will do the right thing.  That is how SPICE works.
 
Andy
 


 

On Sat, Dec 21, 2024 at 12:49 AM, <info@...> wrote:

It gives the same error every time:

" Unknown subcircuit called in:
xu1 0 n002 n003 v+ v- tss/opa891_model_v1p1.lib opa891"

There are multiple problems with that line, pointing to a few mistakes.
 
The pin-order is all messed up.  It seems to have connected the input pins to net N002 and ground, the power pins to nets N003 and V+, and the output goes to net V-.  That can't be right.  Did you alter the pin-order of the symbol?  Don't do that.  Did you mistakenly use package pin numbers, thinking that the ORDER of pins is the same as the package pin number?  Don't do that either.  SPICE/LTspice does not want to know what the package pin numbers are.
 
The name "tss/opa891_model_v1p1.lib" is stuck in there where it does not belong.  That might cause LTspice to try to find a subcircuit by that name.  Of course it does not exist.  Furthermore, I believe that the model file itself was never being loaded at all.  That would surely cause problems because LTspice would be totally unaware of that subcircuit, so it would indeed be "unknown".
 
I strongly suggest deleting the SpiceModel attribute, and use the ModelFile attribute instead.  The SpiceModel attribute does not necessarily refer to a filename that you want to be loaded.  It does in the unique case where both the Value and Value2 attributes are defined, but I think not otherwise.  You probably did not use it that way with both Value and Value2.
 
People can get themselves in trouble by trying to use LTspice in ways it was not supposed to be used.  And then they waste time trying to fix problems that they made for themselves.
 
Andy
 


 

On 21/12/2024 06:49, info@... wrote:

It appears that the symbol is able to call the OPA891 spice model without problem.

I edited the model to make the pins agree with the conventional symbols, but it won't run

I used the TI model unedited and I changed the symbol pin net numbers to match, but it won't run.

It gives the same error every time:

" Unknown subcircuit called in:
xu1 0 n002 n003 v+ v- tss/opa891_model_v1p1.lib opa891"

I believe that someone has this model running, but I don't understand the inner workings of LTspice well enough to troubleshoot this error.

Thanks for all your help.

Steve

To save you the frustration of more wasted time, I have uploaded an OPA891 demo schematic, including a model suitably modified according to the exact advice given by Andy, previously

--
Regards,
Tony


 

Tony and Andy,

Thanks for the demo schematic which proves that the model itself is OK and that changing the line that defines the functions to match opamp2 works perfectly when the model is in the same directory as the .asc file and the .lib command defines the model.

It is a pain to copy the model to every directory with an .asc in it and add the .lib directive to every simulation.  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.

This means that the "Andy" modified model should be able to live in my directory and the symbol should be able to call it, but I am not calling it correctly in the attributes of the symbol.

BTW I did not confuse the netlist numbers on the symbol with IC package pins.  I agree that the symbol is not pointing to the Model due to an error in my attribute editing.

Does renaming the Model Suffix from .lib to .sub matter?


 


On 2024-12-21 04:18, Tony Casey wrote:

On 21/12/2024 06:49, info@... wrote:

It appears that the symbol is able to call the OPA891 spice model without problem.

I edited the model to make the pins agree with the conventional symbols, but it won't run

I used the TI model unedited and I changed the symbol pin net numbers to match, but it won't run.

It gives the same error every time:

" Unknown subcircuit called in:
xu1 0 n002 n003 v+ v- tss/opa891_model_v1p1.lib opa891"

I believe that someone has this model running, but I don't understand the inner workings of LTspice well enough to troubleshoot this error.

Thanks for all your help.

Steve

To save you the frustration of more wasted time, I have uploaded an OPA891 demo schematic, including a model suitably modified according to the exact advice given by Andy, previously

--
Regards,
Tony


 

It will nearly do that if you create your own libraries for symbols and models. See 'Settings > Search paths' in the Help. You do have to select the folder from a drop-down list.

On 2024-12-21 15:56, info@... wrote:
  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.
-- 
OOO - Own Opinions Only
Best Wishes
John Woodgate
Keep trying

Virus-free.www.avg.com


 

On Sat, Dec 21, 2024 at 10:56 AM, <info@...> wrote:

It is a pain to copy the model to every directory with an .asc in it and add the .lib directive to every simulation.  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.

That is why I wrote this, in # 156924:
....  Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path
I don't know how you missed it.  Put the symbol in a folder in your User-defined Symbol Search Path, and put the model in a folder in your User-defined Library Search Path.  Those User-defined Lib. and Sym. Search Paths are in the LTspce Control Panel.  Symbols and models that are there in those user-defined locations, can be "seen" by LTspice schematics anywhere on your computer.  They are the user's equivalent of LTspice's own libraries.
 
User-defined Lib. and Sym. Search Paths have been a part of LTspice for many versions and many years.  I think they were added in LTspice XVII, which dates them to eight years ago in 2016.
 

This means that the "Andy" modified model should be able to live in my directory and the symbol should be able to call it, but I am not calling it correctly in the attributes of the symbol.

The model - whether it was "my" model or any other model - is totally, completely, 100% unrelated to where it lives!  If Windows finds the file, then LTspice finds the file and it does not care whose file it was.  If you make your own model file, great.  Go for it.   If you leave the model file unmodified from T.I., great.  Go for it.  No matter whether it is modified or the original unmodified file from T.I., it makes no difference to whether Windows and LTspice can find it.  The contents of the file and the location of the file are two completely independent things.
 

Does renaming the Model Suffix from .lib to .sub matter?

I thought we made this clear already.  THE FILENAME DOES NOT MATTER, as long as you refer to it by its actual filename.  You can save or rename the model file with the filename FOOBAR.ARRGH if you want to.  As long as you call it by its actual filename, LTspice doesn't care whether the name ends in .lib or .sub or .mod or .txt or .doc or .xyzzy or even no extension.  All you need to do is make sure that you refer to it by its ACTUAL filename.  The filename extension is part of the filename. Don't let Microsoft Windows trick you into thinking that the filename's extension carries some sort of magic.  It doesn't.
 
Andy
 


 

Problem solved:

I added "OPA891" to Value 2 in both my OPA891 and OPA2891 symbols and now my sims all work using my user defined locations.

Thanks to all who helped me figure this out. You spent precious time helping me and I deeply grateful.

Steve



 

On 2024-12-21 11:46, Andy I via groups.io wrote:

On Sat, Dec 21, 2024 at 10:56 AM, <info@...> wrote:

It is a pain to copy the model to every directory with an .asc in it and add the .lib directive to every simulation.  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.

That is why I wrote this, in # 156924:
....  Keep that model file in the same directory with your schematic - or move it to one of your User-defined Lib. Search Path
I don't know how you missed it.  Put the symbol in a folder in your User-defined Symbol Search Path, and put the model in a folder in your User-defined Library Search Path.  Those User-defined Lib. and Sym. Search Paths are in the LTspce Control Panel.  Symbols and models that are there in those user-defined locations, can be "seen" by LTspice schematics anywhere on your computer.  They are the user's equivalent of LTspice's own libraries.
 
User-defined Lib. and Sym. Search Paths have been a part of LTspice for many versions and many years.  I think they were added in LTspice XVII, which dates them to eight years ago in 2016.
 

This means that the "Andy" modified model should be able to live in my directory and the symbol should be able to call it, but I am not calling it correctly in the attributes of the symbol.

The model - whether it was "my" model or any other model - is totally, completely, 100% unrelated to where it lives!  If Windows finds the file, then LTspice finds the file and it does not care whose file it was.  If you make your own model file, great.  Go for it.   If you leave the model file unmodified from T.I., great.  Go for it.  No matter whether it is modified or the original unmodified file from T.I., it makes no difference to whether Windows and LTspice can find it.  The contents of the file and the location of the file are two completely independent things.
 

Does renaming the Model Suffix from .lib to .sub matter?

I thought we made this clear already.  THE FILENAME DOES NOT MATTER, as long as you refer to it by its actual filename.  You can save or rename the model file with the filename FOOBAR.ARRGH if you want to.  As long as you call it by its actual filename, LTspice doesn't care whether the name ends in .lib or .sub or .mod or .txt or .doc or .xyzzy or even no extension.  All you need to do is make sure that you refer to it by its ACTUAL filename.  The filename extension is part of the filename. Don't let Microsoft Windows trick you into thinking that the filename's extension carries some sort of magic.  It doesn't.
 
Andy
 


 

On Sat, Dec 21, 2024 at 12:20 PM, <info@...> wrote:

I added "OPA891" to Value 2 in both my OPA891 and OPA2891 symbols and now my sims all work using my user defined locations.

Just to be clear -
 
Adding "OPA891" as the Value2 attribute has nothing to do with putting your symbols and models in your user-defined locations.
 
Andy
 


 

On Sat, Dec 21, 2024 at 04:56 PM, <info@...> wrote:
It is a pain to copy the model to every directory with an .asc in it and add the .lib directive to every simulation.  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.
I understand that and it's easily feasible, by creting your own directories. I used to do that but you run the risk of making your project not portable if you forget to join all the necessary files (models and symbols) needed to run it.
I have long ago decided to put them in the same directory as the .asc, at the cost of having to copy numerous files.
Just my $0.02...


 

Do both; put them in the .ASC folder AND in your library. Terabytes are ten a penny now.

On 2024-12-23 22:26, Jerry Lee Marcel via groups.io wrote:
On Sat, Dec 21, 2024 at 04:56 PM, <info@...> wrote:
It is a pain to copy the model to every directory with an .asc in it and add the .lib directive to every simulation.  I really want to be able to add the symbol to the schematic and have LTspice find the proper model by itself.
I understand that and it's easily feasible, by creting your own directories. I used to do that but you run the risk of making your project not portable if you forget to join all the necessary files (models and symbols) needed to run it.
I have long ago decided to put them in the same directory as the .asc, at the cost of having to copy numerous files.
Just my $0.02...
-- 
OOO - Own Opinions Only
Best Wishes
John Woodgate
Keep trying

Virus-free.www.avg.com