LTSpice opamp models (LM324)

Thread Starter

DavidInOz

Joined Nov 8, 2022
8
My very first post, so please be gentle!

I am doing an analog design where I want to use an LM324 single supply opamp. So I decided to have crack at LTSPice. I realise LTSpice does not come with a model for that, so I must find and add in my own. Even that process seems onerous, on top of the learning curve for LTSpice itself.

I wanted to model this design specifically because it will be pushing the limits on the LM324, especially output voltage swing. So my question is this:

If I go through a long learning curve and get an LM324 model installed, will it reasonably accurately reproduce the non-linear imperfections? I'd hate to spend hours learning how to use it only to discover it won't do it.

Yes, I realise there are multiple LM324 models out there, so maybe the question should be whether there is a model that does simulate such characteristics.

TIA
 

Audioguru again

Joined Oct 21, 2019
5,416
All opamps including the lousy old LM324 have a range of specs. Some have high current, some have typical lower current and some have low current. Some are sensitive and some are not sensitive.
BUT a simulator model is usually an opamp with 'typical" specs then a low one and a high one will simulate differently.
 

WBahn

Joined Mar 31, 2012
27,880
My very first post, so please be gentle!

I am doing an analog design where I want to use an LM324 single supply opamp. So I decided to have crack at LTSPice. I realise LTSpice does not come with a model for that, so I must find and add in my own. Even that process seems onerous, on top of the learning curve for LTSpice itself.

I wanted to model this design specifically because it will be pushing the limits on the LM324, especially output voltage swing. So my question is this:

If I go through a long learning curve and get an LM324 model installed, will it reasonably accurately reproduce the non-linear imperfections? I'd hate to spend hours learning how to use it only to discover it won't do it.

Yes, I realise there are multiple LM324 models out there, so maybe the question should be whether there is a model that does simulate such characteristics.

TIA
Your last statement can be particularly relevant. I've used opamp models (from TI, no less) that I wanted to use to determine expected power supply draw and discovered that the model made zero effort to make the current draw on the supply pins even remotely reasonable (as in the simulation had it consuming thousands of amps). At the same time, the models did a pretty good job of modeling some of the pretty fine behavior of the I/O, including bias currents and frequency response. This was back in the late 90s and most of these IC models are a lot better now.

So you DO have to be careful about whether the models will have good fidelity regarding the behavior that you are most interested in. You will likely need to vet them yourself, at least enough to convince yourself that they seem to be reasonable.
 

Thread Starter

DavidInOz

Joined Nov 8, 2022
8
So you DO have to be careful about whether the models will have good fidelity regarding the behavior that you are most interested in. You will likely need to vet them yourself, at least enough to convince yourself that they seem to be reasonable.
Thank for that.

I have actually moved right on and used the old fashioned modelling method.;)

1669354970113.jpg

I have to say that computer modelling of circuits must have limited applicability if you can't trust it on boundary conditions. I could see it being useful for things like filters. Maybe for Monte Carlo simulation.

I remember that back in the 90s we got hold of a copy of P-Spice. We tried it out on a transformer/bridge/capacitor input filter power supply . It failed spectacularly. So for the next 20 years we used a spreadsheet I made myself and always got good results, until it became silly for us to make our own power supplies and not just buy one.
 

WBahn

Joined Mar 31, 2012
27,880
I have to say that computer modelling of circuits must have limited applicability if you can't trust it on boundary conditions. I could see it being useful for things like filters. Maybe for Monte Carlo simulation.
It is definitely true that simulations can only be as good as the models upon which they are based. Furthermore, good models cost money to develop -- the better you want the model the more it's going to cost. So companies are only going to spend the money developing models that they believe are justified given what those models are being used for. They are going to focus on making them good for those purposes and not put much effort into much else.

When designing integrated circuits, the models for those devices tend to be VERY good because IC designers have to rely on simulations. Since a mask set to actually make a modern IC is measured in the millions of dollars (and even multi-project wafer runs can easily hit over a hundred grand) fab houses spend a LOT of money developing their models. But even then, they develop them to be very good for the things that are normally designed targeting that process. If you have a logic process, the process isn't even going to be well-characterized for parameters that are relevant for analog or imaging designs, and since the models are based on characterization data....

The good news is that as more and more (non-IC) designs become more and more dependent on simulation-based design and optimization, device models overall tend to be getting better and better. Furthermore, the development of models is getting cheaper as techniques are developed to automate a lot of the process. However, very little of that effort is going to go into improving the models of old parts such as the LM384; those parts are seen as being one-step-removed from obsolete and there is little value seen by the manufacturers for improving models for parts that are pretty much rightly seen as only suitable for designs where high-quality models aren't that important. So if you want good models, your best bet would be to use a fairly recent part that is extremely active in current designs.
 

BobTPH

Joined Jun 5, 2013
6,078
I wanted to model this design specifically because it will be pushing the limits on the LM324, especially output voltage swing. So my question is this:
Why push the limits when you could use a more modern design that might better satisfy your needs? Rail-to-rail opamps are common these days.
 

Thread Starter

DavidInOz

Joined Nov 8, 2022
8
Just to underscore my point: I am retired, and a hobbyist. Right now I am designing a black box for my club. I plan to have PCBs fabricated and SMD loaded by JLCPCB, in order to have the SMD experience and opening a box with pre-stuffed boards.

So JLC offer parts supply. "Basic parts" are the ones they stock and have permanently loaded in the machines, so there's no incremental setup fee. Here's the list of Basic OpAmps and comparators sorted by current stock quantity, with their prices in AU$. LM324 is way out ahead. I'll be checking out OP07 if I need something more accurate and have +/- supplies.

1669387052835.png
 

Audioguru again

Joined Oct 21, 2019
5,416
Sure, design a circuit looking at simulation results and the simulation works perfectly.
But make it and it Does Not Work because the simulation model uses "typical specs" and the one you made has minimum or maximum specs.
The datasheet shows the wide range of specs from minimum to maximum then use it to design a circuit that works with specs that are from minimum to maximum.
 

WBahn

Joined Mar 31, 2012
27,880
Sure, design a circuit looking at simulation results and the simulation works perfectly.
But make it and it Does Not Work because the simulation model uses "typical specs" and the one you made has minimum or maximum specs.
The datasheet shows the wide range of specs from minimum to maximum then use it to design a circuit that works with specs that are from minimum to maximum.
That's where Corner and Monte Carlo simulations come in.
 

Thread Starter

DavidInOz

Joined Nov 8, 2022
8
Does Not Work because the simulation model uses "typical specs"
Takes me back to my student days, when I was also working part time in a real job involving design. I probably learned more useful stuff from data sheets than in lectures. Lecture: "Ideal OpAmp". Real world: "Input offset Voltage", "Bandwidth", "Input bias current". Resistor colour code: Gold band = 5%.

I reasoned those things were there for a reason, took careful notice, and worked out for myself what they meant. And what mattered - when you are aiming for 1% analog accuracy with a uA709 and 5% carbon resistors, it matters!

I have also worked with qualified engineers who would read "Max dissipation 500mW" but not read note 2: "At 25'C case temperature, derate ..."
 
Top