Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Trying to get LM311 comparator into LTspice

24vtingle

Advanced Member level 6
Advanced Member level 6
Joined
Jun 13, 2021
Messages
3,468
Helped
66
Reputation
134
Reaction score
158
Trophy points
63
Activity points
17,553
Hi,
I have made the symbol, with correct numbering as per subckt file.
I then pasted the subckt file into the LTspice schem.
I then right clicked the symbol and made "prefix" be "x" and "value" be "LM311".

However, it still doesnt work , as attached.

I got the subckt file from ti.com
 

Attachments

  • LM311.zip
    3.8 KB · Views: 32
Thanks, the output is not right....i have 2.5V into (-), and am hitting (+) with a 0v,5v square wave and i am just getting weird spikes on the output with a 2.5V.
level.
...Aaah...maybe i have gone outside the common mode range for inputs...just tried square wave 2v to 3v and its working. Sorry.

Even so, wow, i didnt realise LM311 was that useless as not to be able to accept a 0v,5v square wave input?
 

Attachments

  • LM311.zip
    381 bytes · Views: 40
Last edited:
The waveforms produced by post #1 simulation circuit are completely implausible and are unlikely representing LM311 real behaviour. In earlier years, TI published a different macromodel which generates different behaviour.

It's no true transistor level model, therefore it can't prove that LM311 is free of phase reversal, but I'm rather sure that it is.

Code:
* http://focus.ti.com/docs/prod/folders/print/lm311.html
* LM311 VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 08:15
* REV (N/A)
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OPEN COLLECTOR OUTPUT
*                | | | | | OUTPUT GROUND
*                | | | | | |
.SUBCKT LM311    1 2 3 4 5 6
*
  F1    9  3 V1 1
  IEE   3  7 DC 100.0E-6
  VI1  21  1 DC .45
  VI2  22  2 DC .45
  Q1    9 21  7 QIN
  Q2    8 22  7 QIN
  Q3    9  8  4 QMO
  Q4    8  8  4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=500)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=102.5E-9)
  E1   10  6  9  4  1
  V1   10 11 DC 0
  Q5    5 11  6 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=103.5E3 CJC=1E-15 TF=11.60E-12 TR=48.19E-9)
  DP    4  3 DX
  RP    3  4 6.667E3
.MODEL DX  D(IS=800.0E-18)
*
.ENDS
 
LM311 Datasheet on phase reversal :

1745925343630.png

Last bullet inferring phase reversal could occur ? Or at very least undefined results.

Some additional info attached.
 

Attachments

  • Input Application Note snoaa91.pdf
    517.9 KB · Views: 37
  • Oscillations snoa695.pdf
    111.5 KB · Views: 39
Last bullet inferring phase reversal could occur ? Or at very least undefined results.
Thanks, thus reading the datasheet supersedes the whole thread. It clarifies that post #1 circuit (inv. input biased to Vcc/2) works as expected and Ltspice simulation with new model is wrong. Probably it's not suited for Ltspice.
 
Increasingly seems to me models are not well implemented nor do we know
how to make that judgment, other than throw the dice, and see if there is
loose confirmation with benchwork.

As a profession we should demand better, after all the designers have those
tools now to accurately predict performance based on process parameters
and architecture and layout and....

Love to see a modeling expert write a paper to help train us to spot deficiencies
and model completeness, sigh.....
 
Problem would be a nonproblem if true design
netlists were released, But the vendor is IP-jealous
and feels the need to abstract the model into a
behavioral and then neglect much actual behavior
in the name of expedience.

That op amp probably has less than 50 transistors
and solving it in full detail is not that painful on
modern CPUs. So fat that you could measure
geometries on an optical microscope and get
reasonable device values.

But that is never the plan going in - just shop the
catalog and take your fake version. With all the
usual warranty (i.e. hahahahaha).
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top