PSPICE - Simulating LM311 Comparator Voltage-transfer characteristic

Status
Not open for further replies.

palikari

Junior Member level 2
Joined
Dec 17, 2012
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
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?


*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.
 


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
    71 KB · Views: 176

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: 166

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:


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
 
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

Cookies are required to use this site. You must accept them to continue using the site. Learn more…