problem with third party components LTSpice

Thread Starter

Rodrigo0595

Joined Sep 23, 2022
9
Hello guys, good afternoon.

I'm having problems with LTSpice. Yesteday I downloaded this software (never used it) and watched some videos about how to add third party devices.
For example, I want to simulate the INA240A1 from Texas Instruments

From this link
https://www.ti.com/product/INA240?keyMatch=INA240&tisearch=search-everything&usecase=GPN-ALT#all
I downloaded this model and downloaded a .zip folder sbombe4.zip
1682714825280.png


there is a file named ina240a1.lib. I put it inside this path.
1682716878548.png


Also, I created a symbol for this component and I put it in this path.
1682717057366.png

The symbol is this
1682720862487.png
1682721019511.png

I have this circuit
1682721207869.png

but when trying to simulate in dc sweep the output of the ina240 is always 2.47V
 

Attachments

Thread Starter

Rodrigo0595

Joined Sep 23, 2022
9
I can only Attach 10 files :(
The output is this
1682721894264.png
if I try to simulate this circuit is TINA-TI software the output is this
1682721945097.png
1682721971397.png
I tried to generate a symbol from the .lib but the result is the same
1682722096299.png

Would you be so kind as to tell me where I went wrong?
 

Papabravo

Joined Feb 24, 2006
21,227
I think the LTspice and the TINA Circuits are not the same. I'm puzzled as to why you might expect similar results. Here are my results after cleaning things up a bit. It looks reasonable to me.

1682725318127.png
 

Thread Starter

Rodrigo0595

Joined Sep 23, 2022
9
Hello papabravo, thank you for answering too!
Yes, LTSpice and TINA are not the same. But... if I have the same .lib file to simulate this component, why should I expect different results? If TINA makes the dc sweep and the ouput is linear why not on LTSpice?
Sorry, I'm not be able to understand that part. I have much to learn!

Now I have this circuit. the I2 source is a triangular wave. According to the datasheet, the INA240A1 have a gain of 20V/V, and with a Rsense = 10m the output would be Vout = Gain * Vdiff. With a Vdiff_max = 50mV then Vout = (20)(50mV) = 1V
1682731380759.png

Thank you very much guys for the help provided!!!
 

Papabravo

Joined Feb 24, 2006
21,227
Looks like we both get the same thing. Question: why did you hide the text for the current source I2? It helps to debug things if you make the critical pieces of text VISIBLE!
1682735315621.png
 

Thread Starter

Rodrigo0595

Joined Sep 23, 2022
9
Sorry for hide the value of I2!!
But is the same value that you have

*Note, I don't know if when I attach the .asc file, the .lib file of each component are include or I have to attach it separately? Because for the OpAmp I'm using the OPAx189 (attach the .lib). However the Opamps are not the main subject. I could include an ideal amplifier
 

Attachments

Papabravo

Joined Feb 24, 2006
21,227
Sorry for hide the value of I2!!
But is the same value that you have

*Note, I don't know if when I attach the .asc file, the .lib file of each component are include or I have to attach it separately? Because for the OpAmp I'm using the OPAx189 (attach the .lib). However the Opamps are not the main subject. I could include an ideal amplifier
There is a process for finding the things that are needed. In the case of your original schematic, the .asc and the .asy and the .lib file were all in the same folder. That is one of the places LTspice will look for things — in the same folder as the .asc file. The nex pace it will look ist in the library folder, typically %HOMEPATH%\Documents\LTspiceXVII\lib\sub, and then on any other paths you have entered in the control panel.

You can also include specific path information in the .lib or .inc SPICE directives. There is also the ability to use the "Modelfile" attribute in the symbol definition (.asy file).

The following is from the LTspice Help file:

.LIB -- Include a Library
Syntax: .lib <filename>
This directive includes the model and subcircuit definitions of the named file as if that file had been typed into the netlist instead of the .lib command. Circuit elements at global scope are ignored.
An absolute path name may be entered for the filename. Otherwise LTspice looks first in the directory %HOMEPATH%\Documents\LTspiceXVII\lib\cmp and then %HOMEPATH%\Documents\LTspiceXVII\lib\sub and then in the directory that contains the calling netlist.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,227
If you have and maintain custom libraries of components and subcircuits, you can add those libraries to the search path in the Control Panel in the following screen:

1682739596027.png
 

Thread Starter

Rodrigo0595

Joined Sep 23, 2022
9
Thanks for such valuable information. Actually I have one path to save my third party libraries.
LTSpice is a great tool, I'm very new to this, I need to learn more about it because it's a bit hard to learn.

1682740361815.png
once again thanks for your advice
 
Top