Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice problem

Status
Not open for further replies.
if you know the OPA2134's GBW and Aol, you can approximate one..... however, the fudged model will not behave like a real-world component. a model for a real component actually has SPICE netlists for inputs and outputs that allow the model to behave like a real device. the fudged model you made from opamp2 won't misbehave when you drive a capacitive load, nor will it current limit the output or distort into a low impedance load. it won't misbehave if you exceed the OPA's common mode voltage range. it doesn't have crossover notch distortion like some op amps have. these are usually things you need to know when building a circuit, and an ideal opamp model just doesn't do these things. the opamp2 model consists of a voltage sensing element, current source, resistor and capacitor.
it would be best to use an actual OPA2134 model.

* OPA134 operational amplifier "macromodel" subcircuit
* This model can also be used for OPA2134 (dual op amp)
* created using Parts release 6.2i on 02/23/96 at 08:48
* Parts is a MicroSim product.
* REV. A SB 7/20/96
* adapted from OPA132 model 9/24/96 BCT
* ------------------------------------------------------------------------
* | NOTICE: THE INFORMATION PROVIDED HEREIN IS BELIEVED TO BE RELIABLE; |
* | HOWEVER; BURR-BROWN ASSUMES NO RESPONSIBILITY FOR INACCURACIES OR |
* | OMISSIONS. BURR-BROWN ASSUMES NO RESPONSIBILITY FOR THE USE OF THIS |
* | INFORMATION, AND ALL USE OF SUCH INFORMATION SHALL BE ENTIRELY AT |
* | THE USER'S OWN RISK. NO PATENT RIGHTS OR LICENSES TO ANY OF THE |
* | CIRCUITS DESCRIBED HEREIN ARE IMPLIED OR GRANTED TO ANY THIRD PARTY. |
* | BURR-BROWN DOES NOT AUTHORIZE OR WARRANT ANY BURR-BROWN PRODUCT FOR |
* | USE IN LIFE-SUPPORT DEVICES AND/OR SYSTEMS. |
* ------------------------------------------------------------------------
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
.SUBCKT OPA134 1 2 3 4 5
*
C1 11 12 3.240E-12
C2 6 7 8.000E-12
CSS 10 99 1.000E-30
DC 5 53 DX
DE 54 5 DX
DLP 90 91 DX
DLN 92 90 DX
DP 4 3 DX
EGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5
FB 7 99 POLY(5) VB VC VE VLP VLN 0 248.0E6 -250E6 250E6 250E6 -250E6
GA 6 0 11 12 402.0E-6
GCM 0 6 10 99 4.020E-9
ISS 3 10 DC 160.0E-6
HLIM 90 0 VLIM 1E3
J1 11 2 10 JX
J2 12 1 10 JX
R2 6 9 100.0E3
RD1 4 11 2.490E3
RD2 4 12 2.490E3
RO1 8 5 20
RO2 7 99 20
RP 3 4 7.500E3
RSS 10 99 1.250E6
VB 9 0 DC 0
VC 3 53 DC 1.200
VE 54 4 DC .9
VLIM 7 8 DC 0
VLP 91 0 DC 40
VLN 0 92 DC 40
.MODEL DX D(IS=800.0E-18)
.MODEL JX PJF(IS=2.500E-15 BETA=1.010E-3 VTO=-1)
.ENDS
 
Last edited:
Thank you for your reply Unclejed.

I assumed that when i editted the attributes of the 'opamp2' component and added 'OPA134.MOD' to the spice model line of the 'opamp2' I had told LTspice what model to use.
The OPA134.MOD file is the same model as the model you've attached.

Are you saying that no matter what i type in the edit attribute box the component 'opamp2' will never be capable of following the OPA134.MOD commands but instead will be limited to GBW and Aol?

If this is the case then what if i edited an existing Linear technology op amps attributes to match the OPA134.MOD?

Could you please show a circuit that should cause an OPA2134 to misbehave so i can see if the models i have misbehave
 
you need to have the OPA2134.MOD file in the \lib\sub folder, and rename it as OPA2134.SUB then go to the \lib\sym folder and open up opamp2.asy with a text editor, do a Save As OPA2134.ASY. then go down to the line that says SYMATTR Value opamp2 and change it to SYMATTR Value OPA1324 and remove the lines with GBW and AOL parameters and save the file.

here's one i did for a TI op amp TL072:

Version 4
SymbolType CELL
LINE Normal -32 32 32 64
LINE Normal -32 96 32 64
LINE Normal -32 32 -32 96
LINE Normal -28 48 -20 48
LINE Normal -28 80 -20 80
LINE Normal -24 84 -24 76
LINE Normal 0 32 0 48
LINE Normal 0 96 0 80
LINE Normal 4 44 12 44
LINE Normal 8 40 8 48
LINE Normal 4 84 12 84
WINDOW 0 16 32 Left 0
WINDOW 3 16 96 Left 0
SYMATTR Value tl072
SYMATTR Prefix X
SYMATTR Description Basic Operational Amplifier symbol for use with subcircuits in the file ./lib/sub/LTC.lib. You must give the value a name and include this file.
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN -32 48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5




if you want you can copy/paste this one and change TL072 to OPA2134.
 
Hi unclejed thanks for replying again.

I followed your steps exactly but this new model won't run.

When i editted the opamp2.asy file the text was exactly as you have posted accept for the name tl072 which i replaced with opa134.
There were no lines with GBW and AOL values.
(This can be altered in edit attributes in LTspice without using the text editor as i showed in screenprint 15 on one of my previous posts)

When i go to run the new model i get the message:

Unknown subcircuit called in:
xu1 nc_01 nc_02 nc_03 nc_04 nc_05 opa134

I assume this means it is not relating the opa134.asy symbol with the opa134.sub model.

I assume that the method you've described relies upon adding an include directive when making a schematic?
i don't wish to have an include directive and the only way i have found to tell LTspice to use the OPA134.mod or OPA134.sub (if you dont want to have to write an include directive each time you place this component) is to either add the row SYMATTR SpiceModel OPA134.SUB if using a text editor to the file OPA134.asy or you can just add OPA134.SUB in the edit attributes in LTspice like i did in screenprint 15 in the post before. It seems you must add value2 to be OPA134 as well.

I have noticed that if I set my component to use a sub model like this I cannot edit the component when I place it in a schematic, but i don't see this as an issue.

I'm sure you know all this anyway i've just explained it for the benefit of others reading.

All i need now is a circuit which i can test my model in to see if it exhibits the limitations of an OPA2134
 
on your schematic you need a spice directive that says " .include opa2134.sub"

notice there's a dot (.) at the beginning. using the drop down menu Edit>Spice directive will give you a text box to enter the .include command. after entering the command, putting the mouse over the schematic will show you an outline of the text box, just move it to a convenient place and click once to place it there. do a right click to exit the placement mode
 
Last edited:
I followed the directions above but I get an error message, "Could not open include file OPA2134.sub". Earlier, I placed the model code in the lib\sub directory, saving it as "OPA2134.sub". I am new to working with LTSpice, but let me add that I noticed that other .sub files are binary so should it be that I would save OPA2134.sub as a text file? That seems odd to me. I welcome all assistance.
 
I placed the model code in the lib\sub directory
Which sub directory? If you are using LTspiceXV11 it installs things in two paths, but only reads data from the sub and asy directories on the ...User\Documents\LTspiceXV11 .... path.
 
Thanks for your helpful info, but I'm not there yet. I renamed things to OPA134 (the OPA2134 is just a dual version of the OPA134), and I put the .sub in the User\Documents\LTspiceXVII\...\sub, and I put .asy in ....\LTspiceXVII\...\asy. In my simulation onscreen, I put ".include OPA134", but when I run the simulation containing an OPA134, I still get "Could not open include file OPA134" .... UPDATE: I fixed it. I had to write the include statement as ".include OPA134.sub". Now it's working.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top