Pspice Filter Analysis

This post contains two related questions.

A few months back, I implemented a prototype ADC (analog) interace circuit and used a 2 pole sallen-key filter using a Burr Brown opa237 opamp. Based on my ADC sample freq relative to the cutoff freq a 2 pole filter is more than sufficient attenuation. The input to filter circuit was driven by an analog mux, which could be inhibited. I noticed that with the mux inhibited, the output of the opamp would slowly rise up to the rail. I believe this is the result of falling into the trap of neglecting to create a dc bias path to ground for the offset currents (this is an example of why I protoyped it).

My first question is, where in the circuit would you put the resistors to ground in this type of circuit. Wouldn't the resistors affect the filter response as they would be in parallel with the input resistance and also in parallel with one of the capacitors. Or is it a case of where these resistors are so much larger than the input resistors (>

10x) that they wouldn't have an effect?

In an attempt to answer this question myself, I generated a pspice simulation of the circuit using the opamp spice model that I downloaded from Ti. The spice output plot shows something that is extremely unexepcted. It shows that the fitler behaves as expected (unity gain until a 100Hz cutoff freq) which continues downward until about 1.1Khz where it turns about and starts to climb until about 100Khz where it stabilizes at about -13db.

As I have a working prototype of this filter, I hooked the circuit back up with a function generator and ran various frequencies into the filter and watched the output. The real circuit does NOT show this type of behavior. The amplitude values are as pspice predicts upto about 800 Hz where the signal gets lost in the noise on my scope and stays lost in the noise as far up as my generator can go (20Mhz).

My second question is, has anybody had this experience with pspice that understands what is going on with it? I have triple checked the circuit file and I don't see where things are going wrong. I also substituted a ua741 for the opa237 in pspice and the result didn't change. The result appears to be dominated by analysis equations that pspice is working with. Any suggestions?

Reply to
Noway2
Loading thread data ...

Post your schematic here as ASCII or as a graphics file on alt.binaries.schematics.electronic

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
        Global Warming is God\'s gift to the Blue States ;-)
Reply to
Jim Thompson

The ideal place to carry the bias current might be through a separate MUX switch that grounds the input, when all other MUX inputs are off, so there is no bump or change in the bias resistance when the first MUX comes on. But, since the bias current is very small, a resistor to ground at the filter input would have the least effect on the filter response, and would only slightly lower the input impedance the MUX must drive.

All low pass filters based on negative feedback have a sneak path around the opamp through the feedback network. So when the frequency is high enough that the opamp gain is low and the output impedance is high, the response may rise because of the signal through this path. But 1.1kHz is way to low for this to be the explanation. I suspect there is an error in your simulation.

I suspect that pspice is less likely to be the cause of the error than you are. Nothing personal, but it has been much more thoroughly tested than you have.

Reply to
John Popelish

I will try to post the schematic this evening after I get home. My access to usenet is extremely limited at work, for so called security purposes.

The concept of the output rising beyond a certain point occured to me but I agree 1.1KHz is way to low for this to be occuring. I suspect that there is some form of error in the way pspice is handling the loops with capacitors or the feedaback due to a lack of some required 'phantom' component. For example, In the Sallen-Key, one of the feedback loops is from the output to the non-inverting terminal. Of course pspice won't let you model this a a short, so you need to play the game of using a very small resistance instead.

Your suggestion of using a mux to drive the input to the filter to ground while there are no other driving signals present is very similar to what I did in the prototype circuit. Since I used a CPLD to decode the commands from the main controller to switch different signals in on each channel, I simply configured the logic to enable the mux and select he input that I had grounded.

I see what you are saying about putting a large resistor to ground at the input (I was thinking along the same lines but thinking about putting the resistor at the opamp input terminals) and how this would have a neglible effect on the mux output.

Reply to
Noway2

How much open loop gain does the sim assume for the op amp.

Try using a simple Exxx (voltage vontrolled voltage source) for the amp in simulation and see what happens. You can select the open loop gain with this model.

Mark

Reply to
Mark

Noway2 wrote: (snip)

Something is not adding up. Such direct connectionsshouldbe no problem forspice, if they work in the real world. But in the Sallen-Key configuation (gain one low pass) the direct connection is between the output and the inverting input. The feedback to the noninverting input is through a series R and a shunt to ground C.

(snip)

If you put the resistor at the noninverting opamp input, it adds a zero to the filter's response. At the mux end, it just adds a little attenuation.

Reply to
jpopelish

Mark,

I think you suspect something that I am about to confirm. I looked at the .subckt for the opamp model, which appears to consist of 3 transistors, various capacitors, resistors and voltage and current sources for the parasitics. I didn't see any terms specifically spelling out the open loop gain of the device.

Next I did two things. First, I remembered that I could use the output node number as the same node as the inverting input to simulate them being shorted. This didn't have any effect on the output. Next, I replaced the opamp with a VCVS where the control voltage is what would be the non inverting input and the inverting input / output node. Since I didn't have any figures for gain from the opamp model, I picked

10,000 out of the air. The resulting bode plot of the output magnitude was perfect. It had a -3db frequency exactly where I expected it (100hz) and dropped off at about 39.99 db per decade as 2 pole filter should. As I make the gain smaller, the output drops from 0db and the cutoff frequency shifts lower, but the -40db per decade slope remains.

Would you please elaborate on what prompted you to steer me in this direction? Were you suspecting an error in the opamp model or something? Clearly there is something being modeled by the opamps (both the opa237 and ua741 sub circuits) that doesn't match an ideal condition (VCVS) or the physical circuit.

Reply to
Noway2

[snip]

Since you are using PSpice, go to my website and download "Op-Amp-Config.zip" from the Subcircuits & Symbols page of my website.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
        Global Warming is God\'s gift to the Blue States ;-)
Reply to
Jim Thompson

Thank you for the suggestion. I will check it out.

Reply to
Noway2

My appologies, I mis-typed there and meant to say inverting (almost put non inverting again - lol). If I didn't know that it was Tuesday, I would say that today is Monday.

Reply to
Noway2

At this risk of asking some stupid questions...

I downloaded the op-amp-config file from your website and I am having some trouble figuring out how to import it into pspice.

I don't have a $$ professional copy of pspice. Unforunately, I am limited to either the earlier DOS based Microsim edition or the version that Orcad has managed to bastardize. If I go through the proces of attempting to create a library part for the Orcad capture edition, I seem to run into problems with either the symbol file and or mapping it to the sub circuit.

I found some instruction on adding and creating model parts, which directed me to use the pspice model editor to translate a .lib file into a .olb file. This tool recognizes the OP-AMP-CONFIG.SUB file as a subcircuit and attempts to add this to a part library. Then in capture this part is recognized and is placed as a square box with a positive and negative input and one output. I am able then to connect other parts to it and attempt to run a pspice simulation. However, I always receive an error message stating that there are less than 2 connections at node X. Obviously something hasn't been designed right.

You text file says to import the symbol file. I have tried just about every import function in the tool and can't find one that matches.

I am honestly beginning to wonder if I am using the correct tool.

Do you have any suggestions that might help me to understand what I am doing wrong?

Thank You in Advance.

Reply to
Noway2

First off, you should download the free LTspice simulator also called=20 SWCADIII from:

formatting link
Then join the Yahoo discussion group dedicated to the use of this=20 simulator: LTspice =B7 LTspice/SwitcherCAD III It is a superior spice implementation and the users group is very helpful= =2E

Reply to
John Popelish

I have that too. From what little I have used it (so far) I agree that it does seem vastly superior.

I don't even like to use Orcad for PCB design. I have heard rumors that it, at least used to, screw up the net lists from capture to layout. PCB design is far too expensive and time consuming to be messing around with that kind of crap.

Reply to
Noway2

[snip]

Want to get a Windows version that's as good as the old DOS version?

Uninstall OrCAD PSpice AND Capture.

Reinstall, but choose CUSTOM installation.

DO NOT CHOOSE Capture, but select PSpice Schematics instead.

Voila! A fine tool!

If you can't do that, just add the subcircuit text to your library files. Then pick a symbol to suit yourself.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
        Global Warming is God\'s gift to the Blue States ;-)
Reply to
Jim Thompson

To answer your previous questions.. The symptom you describes (results depart from ideal at higher frequencies) sounded like inadequate open loop gain.

I think there is a problem with your subcircuit if it uses just 3 transistors. An op amp should have a very large gain (like 10,000) and should need more than 3 transistors..

I usually just use a VCVS for this kind of filter sim... just be aware that the actual op amp you use should have at least 20 dB of loop gain at the highest frequency of intrest or the results will deviate from the sim...

If you want more accurate results, you need a real subckt for the op amp, and that should require much more than 3 transistors...

have fun... Mark

Reply to
Mark

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.