Better LTSpice TL072 model? - Page 1
Forum section: electronics / projects

author: Zero999
author_rank: Super Contributor
timestamp: August 06, 2016, 07:26:57 pm
content: I know the TL072's output doesn't include the positive rail, so I decided to add a current source to help pull up to +V. I wondered why this didn't work in the simulation but going by the internal TL072 schematic it should.I decided to laboriously draw the entire TL072 schematic into LTSpice (I had to guess some of the resistor values) and used it with the pull-up current source and it worked fine. The output can reach the +V rail by nearly 30mV, which should be near enough for my application.The TL072 model. The output still can only get to to +V-1.5VUsing the internal schematic, the output can get to +V-31mVIf there isn't a better model out there, is it possible to create one from the internal schematic?

author: dannyf
author_rank: Super Contributor
timestamp: August 06, 2016, 10:46:05 pm
content: QuoteBetter in what sense?

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 06, 2016, 10:53:40 pm
content: Hi,The TL072 is a Texas Instruments chip, where did the LTspice model come from? It is not supplied with LTspice.Have you tried this in TINA-TI?Regards,Jay_Diddy_B

author: Zero999
author_rank: Super Contributor
timestamp: August 07, 2016, 05:51:47 pm
content: Quote from: dannyf on August 06, 2016, 10:46:05 pmMore accurate.Quote from: Jay_Diddy_B on August 06, 2016, 10:53:40 pmHere:http://ltwiki.org/?title=Components_Library_and_Circuits#OpampsQuoteNo, I don't have TINA but would have thought it's the model which matters.Is there an easy way to create a model from the circuit I posted?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 07, 2016, 08:39:27 pm
content: Often, a comparator or op-amp model has the output clamped to a reasonable range. And, yes, I've seen models for e.g. LM339 where the output is active driven the whole way, as if a decomp LM358.Manufacturers don't like using complete transistor-level models for a few reasons:1. Hiding IP.2. It runs faster (maybe, unless convergence errors screw it up worse).3. If we can make one, and adjust the parameters to fit most of our product line, we don't have to waste time dicking around with more models. (Hence, comparators sometimes lacking faithful open-collector outputs..)Even in the olden days, when they provided equivalent circuits, they didn't say what kind of transistors were used, nor how large. There are a couple tricks in monolithic design that can't be reproduced easily in SPICE, nor expressed easily on a schematic (which is part of the reason you see confusing things like transistors having multiple emitters or collectors: it doesn't make sense from working with discretes, but it makes a lot of sense on the monolithic level).MOS capacitors are notable, because unlike metallic capacitors, the capacitance varies with voltage (it's a MOSFET gate, sans FET). These are commonly used for compensation, so expect the fT and gain to vary with supply voltage and temperature. Canceling out these effects is a tricky part of design, and may be easily missed in a transistor-level model; even being able to measure the effects, and adjust the parameters to match results to poorly-documented datasheet parameters (like gain and fT vs. VCC and TEMP, if they provide any of these at all), is tricky.Obviously(?), such fine detail is normally missed, or just approximated, in a behavioral model. But it's up to the model designer to determine if that's good enough or not.And so, you often have the case where the output voltage is a fixed Thevenin source (often with a current limiting circuit as well), and so doesn't behave like a real device where the output can be pulled closer to a rail using a resistor or CCS.This goes for most digital sims of TTL logic too, I think.Tim

author: dannyf
author_rank: Super Contributor
timestamp: August 07, 2016, 08:42:17 pm
content: Quotethe simulation is very accurate until you get to the extremes.If you want your simulation to follow the actual circuit at the extremes, you don't understand the purpose of simulation.

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 07, 2016, 09:03:22 pm
content: this is the TINA's model for TL072. i'm no spice expert, just thinking it might help, fwiw...Code:* TL072 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT* CREATED USING PARTS RELEASE 4.01 ON 06/16/89 AT 13:08* (REV N/A) SUPPLY VOLTAGE: +/-15V* ------------------------------------------------------------------------*|(C) Copyright Texas Instruments Incorporated 2007. All rights reserved. |*| |*|This Model is designed as an aid for customers of Texas Instruments. |*|No warranties, either expressed or implied, with respect to this Model |*|or its fitness for a particular purpose is claimed by Texas Instruments |*|or the author. The Model is licensed solely on an "as is" basis. The |*|entire risk as to its quality and performance is with the customer. |* ------------------------------------------------------------------------* CONNECTIONS: NON-INVERTING INPUT* | INVERTING INPUT* | | POSITIVE POWER SUPPLY* | | | NEGATIVE POWER SUPPLY* | | | | OUTPUT* | | | | |.SUBCKT TL072 1 2 3 4 5*C1 11 12 3.498E-12C2 6 7 15.00E-12DC 5 53 DXDE 54 5 DXDLP 90 91 DXDLN 92 90 DXDP 4 3 DXEGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5FB 7 99 POLY(5) VB VC VE VLP VLN 0 4.715E6 -5E6 5E6 5E6 -5E6GA 6 0 11 12 282.8E-6GCM 0 6 10 99 8.942E-9ISS 3 10 DC 195.0E-6HLIM 90 0 VLIM 1KJ1 11 2 10 JXJ2 12 1 10 JXR2 6 9 100.0E3RD1 4 11 3.536E3RD2 4 12 3.536E3RO1 8 5 150RO2 7 99 150RP 3 4 2.143E3RSS 10 99 1.026E6VB 9 0 DC 0VC 3 53 DC 2.200VE 54 4 DC 2.200VLIM 7 8 DC 0VLP 91 0 DC 25VLN 0 92 DC 25.MODEL DX D(IS=800.0E-18).MODEL JX PJF(IS=15.00E-12 BETA=270.1E-6 VTO=-1).ENDS

author: Zero999
author_rank: Super Contributor
timestamp: August 07, 2016, 09:43:19 pm
content: Quote from: dannyf on August 07, 2016, 08:42:17 pmI'm not getting into any extremes. I'm using the op-amp well within its intended operating parameters so it should give a reasonably accurate result.Quote from: Mechatrommer on August 07, 2016, 09:03:22 pmYes, it's the same.

author: dannyf
author_rank: Super Contributor
timestamp: August 08, 2016, 12:44:31 am
content: Quoteif I read you right, you seem to be complaining about the simulation of the equivalent circuit swing too close to the rail vs. the real thing. To me, that's not an area of practical value for a simulator.QuoteI guess it depends on your definition of "reasonably accurate", or "intended operating parameters". In my book, anyone pushing an opamp so close to its clipping point is a little bit nuts.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 08, 2016, 01:32:18 am
content: Hi group,I have constructed a LTspice model from the supplied model. This lets you probe the internal circuitry. You can see that the model supplied by TI has been simplified a lot. Only the input stage is modelled at the transistor level.This level of simplification is bound to lead to some error in modeling outside of normal operation.The positive clipping is done with the voltage source VC and the diode DC. The negative clipping is done with VE and DE.With this arrangement a pullup or pulldown is also limited.The positive output is limited to V+ minus VC plus 1 diode drop.Here is the model:And the test results:I have attached the model for those playing along at home.Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 08, 2016, 10:01:55 am
content: Hi,I have done a little research into this op-amp model.The model is described in TI application note: sboa027Link:http://www.ti.com/lit/an/sboa027/sboa027.pdfThis model was described by G. R. Boyle, D. O. Pederson, B. M. Cohn and J. E. Solomon in 'Macromodeling of Integrated Circuit Operational Amplifiers' published in IEEE Journal of Solid-State Circuits, Vol. SC-9, # 6, December 1974.The full version of this paper can be found here:http://my.ece.msstate.edu/faculty/winton/classes/ece3434/supplements/OpampMacroModels.pdfMost of the macromodels used are based on this approach.Linear Technology AN48, 'Using the LTC Op Amp Macromodels' by Walt Jung, gives more information (than you would ever want to know) into op-amp modeling.Link:http://cds.linear.com/docs/en/application-note/an48.pdfThe Boyle model of the 741:includes the same method for clamping the output voltage.So it seems the use of this simple method for limiting the output voltage is wide spread, and not just limited to the TL072 model from TI.It seems that the original poster has already created a better model, by making a transistor level model of the TL072.By taking the model apart, it is easy to see why the standard macromodel did give the correct results in the OPs, application, trying to pull the output positive with a current source.It worth pointing out that the supply currents on these macromodels is not accurate.Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 08, 2016, 10:27:15 am
content: Hi ,Here is a test that will show some information about the op-amp model.If I take the LT1013, supplied with LTspice and put in this simple test circuit:And I look at the load current and the supply currents they are correct:If I do the same simulation with the TI TL072 model:I get the wrong answer:This is one of the limitations of the Boyle macromodel.Regards,Jay_Diddy_B

author: Zero999
author_rank: Super Contributor
timestamp: August 08, 2016, 09:27:56 pm
content: Thanks for explaining to me the limitations of op-amp SPICE models. I didn't realize the output stage was simplified like that.To those who don't think what I'm doing is a good idea: the LM358 does exactly the same thing to make the output stage go near the negative rail.http://www.ti.com/lit/ds/symlink/lm158-n.pdfUnfortunately there isn't a common, cheap op-amp which can run of 30V and work up to the positive rail, otherwise this wouldn't be necessary.

author: dannyf
author_rank: Super Contributor
timestamp: August 08, 2016, 10:12:07 pm
content: If you worry about going to the positive rail - something the tl0xx family can NOT do - put a npn on the output.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 08, 2016, 10:28:29 pm
content: Hi,Here is a little analysis on the current source proposed by Hero999.LTspice Schematic:Actually I have three almost identical circuits. The difference is the junction temperature of the output transistor.Modelling ResultsThe modelling shows that the current value is dependent on the junction temperature of the transistors. This probably fine for this application, but it will not win any prizes for accuracy.The current source has the ability to work very close to the rail, which is great here.Regards,Jay_Diddy_B

author: Zero999
author_rank: Super Contributor
timestamp: August 09, 2016, 08:05:02 am
content: Quote from: dannyf on August 08, 2016, 10:12:07 pmHow would that help? Putting an NPN transistor on the output will only make it worse!Quote from: Jay_Diddy_B on August 08, 2016, 10:28:29 pmYes, I'm aware of the shortcomings of the current source I used and yes, being able to work close to the positive rail is the most important thing. The usual solutions such as emitter degradation resistors and adding a cascode will improve the stability but compromise on being able to work up to +V.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2016, 10:41:02 pm
content: Quote from: Jay_Diddy_B on August 08, 2016, 10:01:55 amThe model I created may be fine at DC but it's not suitable for AC analysis. Here's the bode plot. I set Rin to 1R and Rf to 1Meg, to get the open loop response of the op-amp. The gain is much lower than that given on the data sheet, 49db vs 100dB and the roll-off and GBWP are wrong too.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 13, 2016, 12:42:25 am
content: Hero999,Can you post your model on the Forum?The forum allows .asc files to be attached to the messages.I will have a look to see if I can tell why the gain is low.Regards,Jay_Diddy_B

author: Audioguru
author_rank: Super Contributor
timestamp: August 13, 2016, 02:55:48 am
content: Can your simulation of the TL07x and TL08x opamps show its input problem called "opamp phase inversion" where the output suddenly goes high if an input voltage gets within 3V or 4V from its negative supply voltage?

author: Zero999
author_rank: Super Contributor
timestamp: August 13, 2016, 01:18:00 pm
content: Yes. the standard TL072 model does simulate phase inversion. I haven't tested my model though.Another problem with going too near the negative rail is the bias currents increase dramatically, as the JFET gates become forward biased and many of people are unaware of this.Quote from: Jay_Diddy_B on August 13, 2016, 12:42:25 amSee attached.

author: Zero999
author_rank: Super Contributor
timestamp: August 13, 2016, 05:13:23 pm
content: Oh, I've realised where I went wrong. I used ideal transistor models, rather than more realistic ones and there was no negative feedback at DC, so the op-amp amplified its own input offset and the output became saturated.I've changed it to a non-inverting configuration, which is open loop at AC but unity gain at DC, due to the ridiculously high value of C2.It's much closer to the values on the datasheet now.