Simulating an Instrumentation Amplifier

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21
Hey all,

After getting several helpful recommendation from the local community on using a free circuit simulator, I decided to install LTSpice.
Currently I am trying to figure out how to import the INA332, but it seems like it takes Pspice, and Tina-Ti spice models (offered by the TI product website).

What are all these different spices, and can I not somehow convert them into an LTSpice model? Will I just need to install another spice, or somehow redesign the INA332's functionality in LTspice?

Thank you for the help everyone!
 

crutschow

Joined Mar 14, 2008
34,459
There are many different versions of Spice and they generally can all use the same models, but some of them are proprietary and will only work on a specific version.
I think you usually can adapt the TI models to LTspice but it takes a little doing.
You need to import the .lib file and then modify a schematic symbol for that particular amp.

But I could find no info on a INA332.
I think you have a typo in the designation.
 

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21
What do you mean by 'designation', I apologize. Here is the link to the device:
http://www.ti.com/product/INA332/toolssoftware

I attempted to bring in the .lib file from TISpice to LTspice, and it brought in a significant amount of text. I'm guessing this is what requires modifying? It's odd because I'm used to bringing/dragging in models from the component list.
 

crutschow

Joined Mar 14, 2008
34,459
The typo was on my end. I typed in 1NA332 instead of INA332. :oops:

So since the adaptation is a little intimidating for a newbie, I modified the files, which should work for you (attached).
The .lib file is the unmodified Tina-TI Spice model file which goes in the LTspice lib directory.
.
The .asy file is modified from another inst amp symbol file I had. It goes in the lib/sym/Opamps directory.
Those are in the Windows/program files or windows/program files (x86) directories.

You might open up the symbol file in LTspice (just click on the file in its directory) to understand how the pins are labeled to correspond to the .lib nodes.

For example this upload_2018-1-19_23-59-16.png in the .lib file defines the output node numbers.
Those correspond to the designated pins defined for the symbol in the .asy file.
Thus below I right-clicked on the V+ pin in the symbol editor and it shows the netlist order is set to 7, corresponding to the node 7 number above for V+.

Just to confuse things, some .lib files do not have the pin numbers in consecutive sequence. But that's okay because it's the order that counts, not the sequence.
Thus the above number sequence could start 8 5 7 instead of 1 2 3, but the pin order for the symbol would still be 1 2 3 for RG VIN- and VIN+.

upload_2018-1-20_0-6-21.png
 

Attachments

kubeek

Joined Sep 20, 2005
5,795
Best way to import a model without too much hassle is to open the model text file in ltspice, then right click on the .subckt line that has the name of your part, and select create symbol. This will place the part with an ugly looking symbol into the Autogenerated folder of components and from there you simply place it into your schematic.
 

Bordodynov

Joined May 20, 2015
3,180
Unfortunately, when auto-generated, the pins of the chip are rearranged, and this often requires an additional correction of the element's symbol.
 

Alec_t

Joined Sep 17, 2013
14,329
The .lib file is the unmodified Tina-TI Spice model file which goes in the LTspice lib directory. The .asy file is modified from another inst amp symbol file I had. It goes in the lib/sym/Opamps directory.
If you are running the XVII version of LTspice, it expects to find those directories in the ....Users/User/Documents/LTspiceXVII path.
 

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21
@crutschow -
Thank you so much! I was able to import this, and it works! Thank you as well for the instructions on how to go about the process, that's great news because the other component I'm using also has the same issue, but once I follow you how to convert that as well I'll have every component I need to simulate my full device in the software :))) That's great.

@kubeek -
I will try that tonight as well as another technique, thanks.

@Bordodynov -
What you are referring to was the problem that crutschow mentioned regarding the pin renumbering correct?

@Alec_t-
I am using that version, thank you!
 

crutschow

Joined Mar 14, 2008
34,459
As an added note, the numbers may not even appear in the .lib file.
For example this upload_2018-1-20_18-55-44.pngfrom the LM324.lib file shows only the node labels.
You just count left to right to get the symbol pin numbers.
Thus in+ is pin 1 and OUT is pin 5
 

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21

Attachments

Last edited:

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21
Hmm,
Looks like I botched things up here. I'm getting an unknown sub circuit error when attempting to run transient. Is it because my .lib file shouldn't be set to the device?
After looking in the lib file it looks like it's using a .SUBCKT file, and I don't know if that is messing with what I'm doing.

I also looked into the Circuits provided for the model, and see that there is an AC, DC, and TRANS file. Should I be 'pointing' this model to those files somehow?

**EDIT-
Oh boy I'm confused, it worked when I ran it but in a different window...
 
Last edited:

eetech00

Joined Jun 8, 2013
3,956
Hmm,
Looks like I botched things up here. I'm getting an unknown sub circuit error when attempting to run transient. Is it because my .lib file shouldn't be set to the device?
After looking in the lib file it looks like it's using a .SUBCKT file, and I don't know if that is messing with what I'm doing.

I also looked into the Circuits provided for the model, and see that there is an AC, DC, and TRANS file. Should I be 'pointing' this model to those files somehow?

**EDIT-
Oh boy I'm confused, it worked when I ran it but in a different window...
You have the input pins backward.
Also, move the spice model file name from the SpiceModel field to the ModelFile field.

-OR-

1. Just place the model file in this folder:
...\Documents\LTspiceXVII\lib\sub\(my file goes here)

2. Then just use the ready made opamp2 symbol and change the value from "OPAMP2" to "OPA2374" w/o the quotes.

eT
 

eetech00

Joined Jun 8, 2013
3,956
Hmm,

I also looked into the Circuits provided for the model, and see that there is an AC, DC, and TRANS file. Should I be 'pointing' this model to those files somehow?

**EDIT-
Oh boy I'm confused, it worked when I ran it but in a different window...
In post #9 you commented "it works". How did you test it?
 

Thread Starter

quekwoambojish

Joined Jan 9, 2018
21
In post #9 you commented "it works". How did you test it?
That was referring to the INA332, I tested it by loading it into the software and simulating a signal I would 'expect' to go in for my application, then testing the output. I didn't check specifically whether it functioned according to expected numbers, but from just 'eyeballing' the values, it seemed to be doing what I was expecting.

Whereas the OPA2374 literally wouldn't work whenever I ran the program.
As I mentioned though, I closed that window, opened a new one, and now it is working...Which is very weird. I revised the input pins as well, thanks!
 
Top