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.

PSPICE - Simulating LM311 Comparator Voltage-transfer characteristic

Status
Not open for further replies.

palikari

Junior Member level 2
Junior Member level 2
Joined
Dec 17, 2012
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,486
I am having trouble getting the expected voltage transfer characteristic in PSPICE. I am using the LM311 model out of the opamp.olb library that is on Orcad's site.

Basically I am fixing one input at 6V and sweeping the other input from 0 to 12V. I expect to see the output go from 0 to 12V or vice-versa. My result is that it is 12V for the entire sweep. I also get a message that there are warnings in the session log.

Here is the "Simulation Output File". I have also attached the schematic (I am using Capture), as well as the plot I obtained.
Anyone have an idea what is wrong?
I have also tried the built-in LM111 in the EVAL library, but there I get an error that references a node that isn't anywhere else in the netlist. But first things first, can someone help with the LM311?
lm311_plot.JPGlm311.JPG

*Libraries:
* Local Libraries :
* From [PSPICE NETLIST] section of pspiceev.ini file:
.lib "nom.lib"

*Analysis directives:
.DC LIN PARAM X 0 12 .01
.PROBE
.INC "lm311-SCHEMATIC1.net"


**** INCLUDING lm311-SCHEMATIC1.net ****
* source LM311
V_V1 12V 0 12Vdc
V_V3 N02302 0 {X}
V_V2 N02351 0 6V
R_R1 0 VOUT 1G
R_R2 VOUT 12V 1k
.PARAM X=2

**** RESUMING lm311-schematic1-myprof.sim.cir ****
.INC "lm311-SCHEMATIC1.als"



**** INCLUDING lm311-SCHEMATIC1.als ****
.ALIASES
V_V1 V1(+=12V -=0 )
V_V3 V3(+=N02302 -=0 )
V_V2 V2(+=N02351 -=0 )
R_R1 R1(1=0 2=VOUT )
R_R2 R2(1=VOUT 2=12V )
_ _(Vout=VOUT)
_ _(12V=12V)
_ _(12V=12V)
.ENDALIASES

**** RESUMING lm311-schematic1-myprof.sim.cir ****
.END


JOB CONCLUDED

TOTAL JOB TIME .11
 

It could be a model problem. My LM311 model (TI) lists the normal 5 pins plus "output ground" for the 6th pin - it is not the strobe pin. It needs to be grounded to work which isn't the same as the strobe pin!

Maybe post your model and I will have a look.

Keith.
 

The problem is rather trivial, I think. LM311/TO is from the regular schematic design lib, not pspice/opamp.olb. Do you see an option to edit the assigned Pspice model? It's only present in the Pspice component libraries.
 

It could be a model problem. My LM311 model (TI) lists the normal 5 pins plus "output ground" for the 6th pin - it is not the strobe pin. It needs to be grounded to work which isn't the same as the strobe pin!

Maybe post your model and I will have a look.

Keith.

the model is shown in the image i attached in my original post. Is that what you mean?

in that model I have 8 pins, and pin 1 is the emitter-out pin that I think you speak of, and yes I have attached it to ground.

- - - Updated - - -

The problem is rather trivial, I think. LM311/TO is from the regular schematic design lib, not pspice/opamp.olb. Do you see an option to edit the assigned Pspice model? It's only present in the Pspice component libraries.

i double-checked, and yes I got it from the opamp.olb library

in the built-in library is only LM111, which gave me a different problem altogether when I tried it.
 

i double-checked, and yes I got it from the opamp.olb library
You can open the Spice model of a component from the correct libary with attached Spice model. Does double-checking include this?

There are two opamp.olb, I think. A component that draws zero supply current like your LM311 is unlikely to contain any Spice functionality.
 

You can open the Spice model of a component from the correct libary with attached Spice model. Does double-checking include this?

no it doesn't...what do u mean exactly? how do i do this?

I also noticed it was odd that it drew zero supply current. Thanks.
 

I was referring to the component's properties menu, there should be an active entry "edit PSPICE model".

Or simply select a component from a library in the pspice subfolder.
 

ok, i thought that the LM311 model out of DK_OPAMPS.OLB would need no editing. Meaning it's not like a breakout model where u have to specify all the parameters. I would think whatever parameters (and values) are already built-in, and no editing is needed. No?

But from what u tell me, I have to edit the properties. So what properties do I add for this comparator, and what values do I give? I have attached a screenshot of the properties window that comes up when I right-click>Edit Properties
 

Attachments

  • lm311_props.JPG
    lm311_props.JPG
    71 KB · Views: 172

Keith,

OK, I may have misread what u asked earlier. I have attached the actual .olb file that I get the LM311 from. And this model I got from this website, from the link "Download Digikey Libraries":

**broken link removed**

Could you take a look? Thanks.
 

Attachments

  • DK_OPAMP.zip
    51.7 KB · Views: 164

OK, I have installed Pspice so I can look at this problem properly.

As far as I can see, the Digikey library you are using doesn't have any Pspice model associated with it (as FvM said earlier).

Firstly, you have to have created a project using "Analog or mixed A/D" not "Schematic".

Then, when you place the part and right click on it you should see "Edit Pspice model" as one of the options - it isn't there.

If you use the LM311 part out of one of the Pspice libraries then you will find the "Edit Pspice model" is there and will see:

*-----------------------------------------------------------------------------
* 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=124.2E-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=206.9E3 Cjc=1E-15 Tf=7.855E-12 Tr=83.83E-9)
dp 4 3 dx
rp 3 4 7.087E3
.model dx D(Is=800.0E-18)
*
.ends

The Pspice libraries in the default installation are in c:\Program files\orcad\capture\library\PSpice\ In there is an "opamp" library which has the LM311 in it.

I have only used older versions on Pspice but as far as I can see the libraries consist of 2 parts - the .olb which is the standard Orcad Capture library which contains the symbol information and the .lib which has the actual models. The "association" links the two so Pspice knows which model to use with which symbol.

I hope this helps. If not, let me know - now I have installed it I should be able to help a little better.

Keith
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Reviewing previous edaboard post, you see that similar problems (using components without simulation models or ground symbols without ground connection) are a popular beginners error with Orcad schematic entry for PSPICE. Orcad is primarly an ECAD schematic entry, it's usage for PSPICE is only one of several tool purposes.

Using a SPICE variant with dedicated schematic entry, e.g LTSpice, or the old PSpice schematic editor is much more intuitive and less error prone, I think.

Reading and hearing is the other thing, because the problem has been clearly stated from the start.
 

Keith,

I understand what ur saying now. From where did u install PSPICE? I have Orcad Capture 9.1 from 2000, which I now see is probably outdated.

-I did select "Analog or mixed A/D" when I created the project - CHECK
-I have no "opamp" library in c:\Program files\orcad\capture\library\PSpice\
-None of my parts (including BJT's resistors, etc.) have "Edit Pspice model" option; all there is is "Edit Properties" and "Edit Part", where "Edit Part" is where you modify what the symbol looks like only
-No, I don't have any .lib files for the Orcad .olb files that I mentioned

OK so I see what the problem is....apparently I have garbage version of PSPICE. so where did you download yours from? Thanks.

- - - Updated - - -

Reading and hearing is the other thing, because the problem has been clearly stated from the start.

agreed...so hard to pinpoint stuff on message board exchanges sometimes
 

Maybe the demo version only includes some limited libraries. Unless you particularly need to use Orcad/Pspice it might be worth looking at LTspice. It is free and doesn't have arbitrary limitations.

Keith
 

you have a link to download LTSpice?

and I take it your version of PSPICE was not available for free download?
 

LTSpice can be downloaded from www.linear.com But it doesn't come with libraries of commonly used ICs, you have to import the LM311 model or get libraries from the internet.

I have been previously working with PSpice 9. It has all necessary libraries, the names and pathes may be partly different to recent versions.
 

Palikari,

I have downloaded the Pspice Student you linked to earlier (**broken link removed**) and it does have some PSpice parts but not many. There is the LM111 in there (called LM111/EVAL), LM324 and a few other parts.

It does seem to operate differently to the full version 9.2, even though the version is similar (9.1). The Pspice properties are only shown in the part properties rather than right clicking to get "Edit Pspice model". However, it then doesn't actually show a model.

The limitations are shown here: https://www.iee.et.tu-dresden.de/~muellerj/simulation/soft/pspice/pspsvrl.htm

I would suggest you look at LTspice. While you will need to add parts/models, at least when you do so you will have a program/circuit with no limits. Even if you manage to add parts to the student version of Pspice the effort will be wasted if you then hit one of the other limitations.

Keith.
 

i downloaded LTSpice

right off the bat I didn't see a model for LM311 in there...is the Linear LT1011A a comparable one to it?
 

That should be a reasonable substitute. Obviously LTspice will only include Linear Technology parts but you can add any from other manufacturers.

Keith
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top