Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

High speed (>1MHz) rectifier circuit needed

449 views
Skip to first unread message

Brandon Dewberry

unread,
Sep 4, 1998, 3:00:00 AM9/4/98
to
Hi,
I've breadboarded a standard rectification circuit which uses a 20MHz
GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
peak begins to attenuate badly above 500kHz - it makes a good low pass
filter. Problem is, I need to pass everything up to 1MHz with unity
gain. I've tried a number of diodes, the bandwidth of these doesn't
seem to help this problem.

Does anyone have a fast (>1MHz) rectification circuit I can try?

Thanks,

Brandon


Mike McCarty

unread,
Sep 4, 1998, 3:00:00 AM9/4/98
to
In article <35F0293B...@msfc.nasa.gov>,
Brandon Dewberry <Brandon....@msfc.nasa.gov> wrote:
)Hi,
)I've breadboarded a standard rectification circuit which uses a 20MHz
)GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
)peak begins to attenuate badly above 500kHz - it makes a good low pass
)filter. Problem is, I need to pass everything up to 1MHz with unity
)gain. I've tried a number of diodes, the bandwidth of these doesn't
)seem to help this problem.

What happens with many of these circuits is that the op-amp runs unity
gain when the "diode" is conducting, but runs open loop when
non-conducting. What is the bandwidth of your op-amp when the simulated
diode is non-conducting and it is open loop?

Also, there is the issue of the (real) diode. It has about 2pF. The
op-amp has to discharge this from about +15 volts to ground. What is the
output current capability, and the impedance of the op-amp when run open
loop?

)Does anyone have a fast (>1MHz) rectification circuit I can try?
)
)Thanks,
)
)Brandon

You might write to Bob Pease over at National. I bet *he* has some ideas.

Mike

--
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I don't speak for DSC. <- They make me say that.

Tom Bruhns

unread,
Sep 4, 1998, 3:00:00 AM9/4/98
to
Brandon Dewberry (Brandon....@msfc.nasa.gov) wrote:
: Hi,
: I've breadboarded a standard rectification circuit which uses a 20MHz
: GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
: peak begins to attenuate badly above 500kHz - it makes a good low pass
: filter. Problem is, I need to pass everything up to 1MHz with unity
: gain. I've tried a number of diodes, the bandwidth of these doesn't
: seem to help this problem.

It might not be the circuit topology, but what you are expecting the op
amp to do, that is the problem. In the typical precision rectifier
op amp circuit, the (input stage) op amp output must slew two
diode drops as quickly as possible. If your op amp has a 5V/usec
slew rate, it can slew two diode drops in around 250 nanoseconds,
and that's a very significant fraction of a half-cycle of 1MHz. To
do a good general-purpose precision rectifier, you need a very fast
slewing amplifier. Also, if you can keep things at fairly low
impedance (if your input signal doesn't mind a relatively low
impedance load, like a few hundred ohms), that helps swamp out stray
capacitance, and also makes it easy to use a Schottky diode instead
of standard silicon, which drops the voltage that the op amp output
must slew. -- I trust that your breadboard has very short leads
and was built so the stray capacitances and inductances would be low...

On the other hand, under special circumstances there may be a better
circuit to do the job. (I used to work on something that needed to
have a rectifier for a 1MHz signal that would be accurate to a few
parts per million over a 100:1 range of amplitudes; but the frequency
was fixed by a crystal oscillator, and the voltage was high.)

--
Cheers,
Tom
tom_b...@hp.com

Spirit

unread,
Sep 4, 1998, 3:00:00 AM9/4/98
to

Brandon Dewberry wrote in message <35F0293B...@msfc.nasa.gov>...

>
>Does anyone have a fast (>1MHz) rectification circuit I can try?
>
Try the Analog Devices (www.analog.com) AD8036 or AD8037. The data
sheet is on their website and it provides a nifty application on the
data sheet which allows nice full wave rectification at frequencies
well up in the megaHertz. The op-amps are good for hundreds of MHz
and the rectification is clean up to over 20MHz.

Gerrit Barrere

unread,
Sep 4, 1998, 3:00:00 AM9/4/98
to
I've done some SPICE simulation of a similar circuit (a 1 MHz peak
detector), and it is indeed difficult. As some other posts have indicated,
the slew rate of the opamp and the capacitance of the diode are the main
problems. There also seem to be turn-on and turn-off characteristics in the
diode which make for sloppy transitions.

I ended up using a fast Schottky signal diode (BAS70) into a capacitor, and
then buffering the cap. No active components in the peak detection portion.
Even this was not as clean as I wanted, but my voltages were high enough and
the accuracy requirement lax enough that it was okay. But this architecture
doesn't help you much! You may want to take the approach of keeping active
devices out of the rectification path if possible, like maybe running your
signal through a Schottky bridge or passive clamp.
--
Gerrit Barrere
Consulting Engineer, Counterpoint Systems, Inc.
ctrpX...@halZcyon.com
(please remove X, Y, and Z from return email address)

Brandon Dewberry wrote in message <35F0293B...@msfc.nasa.gov>...

>Hi,
>I've breadboarded a standard rectification circuit which uses a 20MHz
>GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
>peak begins to attenuate badly above 500kHz - it makes a good low pass
>filter. Problem is, I need to pass everything up to 1MHz with unity
>gain. I've tried a number of diodes, the bandwidth of these doesn't
>seem to help this problem.
>

>Does anyone have a fast (>1MHz) rectification circuit I can try?
>

>Thanks,
>
>Brandon
>

Mike

unread,
Sep 5, 1998, 3:00:00 AM9/5/98
to

My apologies to Gerrit for sending the email - I hit the wrong button in
Netscape.

For peak detection with wide bandwidth and excellent dynamic range, I
discovered a novel method that eliminates the problems with the fast
rectifier and slew rate. If you're interested, a complete description is
available at

United States Patent 4,603,299: Constant duty cycle peak detector

http://www.csolve.net/~add/patents/4603299.htm

Best Regards,

Mike

Duncan Barclay

unread,
Sep 5, 1998, 3:00:00 AM9/5/98
to
In article <35F0293B...@msfc.nasa.gov>,

Brandon Dewberry <Brandon....@msfc.nasa.gov> writes:
> Hi,
> I've breadboarded a standard rectification circuit which uses a 20MHz
> GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
> peak begins to attenuate badly above 500kHz - it makes a good low pass
> filter. Problem is, I need to pass everything up to 1MHz with unity
> gain. I've tried a number of diodes, the bandwidth of these doesn't
> seem to help this problem.
>
> Does anyone have a fast (>1MHz) rectification circuit I can try?
>
> Thanks,
>
> Brandon
>

How about avoid all the op-amp and diode problems and use a long tailed
pair. For large (ie. >5*kT/q, 125mV) signals the connection of the
emitters is full wave rectified. Use a transistor array with a couple of
matched devices on, bias for maximum fT and it should work. From my
youth Nat. Semi had the LM338 (super matched pair) and people like PMI
had arrays with a few devices in which could be used to realise good
LTPs.

I have seen this circuits used for GHz frequencies (frequency doublers
in RFICs).

Duncan

--
________________________________________________________________________
Duncan Barclay | God smiles upon the little children,
dm...@ragnet.demon.co.uk | the alcoholics, and the permanently stoned.
________________________________________________________________________

Mike

unread,
Sep 6, 1998, 3:00:00 AM9/6/98
to
Duncan Barclay wrote:
>
> In article <35F0293B...@msfc.nasa.gov>,
> Brandon Dewberry <Brandon....@msfc.nasa.gov> writes:
> > Hi,
> > I've breadboarded a standard rectification circuit which uses a 20MHz
> > GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
> > peak begins to attenuate badly above 500kHz - it makes a good low pass
> > filter. Problem is, I need to pass everything up to 1MHz with unity
> > gain. I've tried a number of diodes, the bandwidth of these doesn't
> > seem to help this problem.
> >
> > Does anyone have a fast (>1MHz) rectification circuit I can try?
> >
> > Thanks,
> >
> > Brandon
> >
>
> How about avoid all the op-amp and diode problems and use a long tailed
> pair. For large (ie. >5*kT/q, 125mV) signals the connection of the
> emitters is full wave rectified. Use a transistor array with a couple of
> matched devices on, bias for maximum fT and it should work. From my
> youth Nat. Semi had the LM338 (super matched pair) and people like PMI
> had arrays with a few devices in which could be used to realise good
> LTPs.
>
> I have seen this circuits used for GHz frequencies (frequency doublers
> in RFICs).
>
> Duncan

Neat - does this measure true peak, or average?

For pure sinusoids, it doesn't matter. But for triangular or sawtooth
waveforms (hard to get at GHz), there may be some error. It depends on
the application whether this is important or not.

It should handle modulated and noisy waveforms very well. You can have
identical slew in both directions with a suitable choice of series
resistor into a cap.

Temperature offset is still a problem. Vbe changes about 2mv/degree.

Best Regards,

Mike

Duncan Barclay

unread,
Sep 6, 1998, 3:00:00 AM9/6/98
to
In article <35F223...@urlfor.addr>,

Mike <ch...@urlfor.addr> writes:
> Duncan Barclay wrote:
>>
>> In article <35F0293B...@msfc.nasa.gov>,
>> Brandon Dewberry <Brandon....@msfc.nasa.gov> writes:

[snip]

>> >
>> > Does anyone have a fast (>1MHz) rectification circuit I can try?
>> >
>> > Thanks,
>> >
>> > Brandon
>> >
>> How about avoid all the op-amp and diode problems and use a long tailed
>> pair. For large (ie. >5*kT/q, 125mV) signals the connection of the
>> emitters is full wave rectified. Use a transistor array with a couple of
>> matched devices on, bias for maximum fT and it should work. From my
>> youth Nat. Semi had the LM338 (super matched pair) and people like PMI
>> had arrays with a few devices in which could be used to realise good
>> LTPs.
>>
>> I have seen this circuits used for GHz frequencies (frequency doublers
>> in RFICs).
>>
>> Duncan

I forgot to mention that this should be used with differential signals.

> Neat - does this measure true peak, or average?

It doesn't measure anything, it just rectifies, or takes the absolute
value of the input signal.

> It should handle modulated and noisy waveforms very well. You can have
> identical slew in both directions with a suitable choice of series
> resistor into a cap.

> Temperature offset is still a problem. Vbe changes about 2mv/degree.

If you use it differntially then this is not true.

But there is a narrow region +-125mV around zero where the circuit has a
linear reponse and the output voltage is the average of the inputs. This
is temperature dependent, 5*kT/q.

> Best Regards,

> Mike

John Woodgate

unread,
Sep 6, 1998, 3:00:00 AM9/6/98
to
In article <6ssbd0$fp9$2...@computer.my.domain>, Duncan Barclay
<dm...@ragnet.demon.co.uk> writes

>How about avoid all the op-amp and diode problems and use a long tailed
>pair. For large (ie. >5*kT/q, 125mV) signals the connection of the
>emitters is full wave rectified. Use a transistor array with a couple of
>matched devices on, bias for maximum fT and it should work. From my
>youth Nat. Semi had the LM338 (super matched pair) and people like PMI
>had arrays with a few devices in which could be used to realise good
>LTPs.

Be careful of the LM394 (not LM338, which is a 5 A regulator). It has
very high Cbc (10 pF IIRC), which is not good news for r.f.
applications.
--
Regards, John Woodgate, Phone +44 (0)1268 747839 Fax +44 (0)1268 777124.
OOO - Own Opinions Only. You can fool all of the people some of the time, but
you can't please some of the people any of the time.

Bill Sloman

unread,
Sep 7, 1998, 3:00:00 AM9/7/98
to Brandon Dewberry

Brandon Dewberry wrote:

> Hi,
> I've breadboarded a standard rectification circuit which uses a 20MHz
> GBP opamp with a couple of fast (1N4148) diodes. A sinusoid with 1V
> peak begins to attenuate badly above 500kHz - it makes a good low pass
> filter. Problem is, I need to pass everything up to 1MHz with unity
> gain. I've tried a number of diodes, the bandwidth of these doesn't
> seem to help this problem.
>

> Does anyone have a fast (>1MHz) rectification circuit I can try?

One alternative is to use a 4-quadrant multiplier to square the waveform -

the Analog Devices AD834 is good to about 500MHz in this sort of
application, and the AD734 to 10MHz - low pass filter the output, and
use a slower part (AD534?) to extract the square root, which is the rms
amplitude. Analog has integrated circuits specifically for extracting
the rms amplitude of a waveform. The AD536A is listed as going to 2.3MHz
and the AD637 to 8.0MHz.

If you really want rectification, you might think about a fast comparator
- Linear Technology LT1016, LT1394 or something even faster from Maxim -

driving a switching demodulator based on a fast CMOS switch from Maxim
or Siliconix. I recently saw an ad for a T-switch which was good to
300MHz.

The old-fashioned way of doing this - invented by Barker and Hart, if
memory
serves, since the reference is buried in my Ph.D. thesis at home - was to

superimpose your AC signal onto a slightly larger DC signal, convert it to

a unipolar current at the emitter of a cascode, and feed the output of the

cascode into the common emitter of a long-tailed pair, which was switched
by the AC-signal (possibly squared off by a comparator).

The rectified signal is then just the difference between the collector
currents;
you low-pass filter the separate collector currents with a capacitor on
each
side, then use an op-amp subractor to get the rectified output.

It is fast (with fast transistors), but not all that accurate, unless you
are
very careful. Quite a few variants got published and patented.

Hope this helps
Bill Sloman, Nijmegen


bill....@ieee.org

unread,
Sep 8, 1998, 3:00:00 AM9/8/98
to
In article <35F3C277...@sci.kun.nl>,
bill....@ieee.org wrote:

> The old-fashioned way of doing this - invented by Barker and Hart, if
> memory serves, since the reference is buried in my Ph.D. thesis at home

Memory served very badly. The paper I was thinking of was published by
E.A.Faulkner and D.W.Harding in the "Journal of Scientific Instruments",
volume 43, page 97 (1966). This is the British equivalent of the American
Review of Scientific instruments, still published by the British Institute of
Physics as "Measurement Science and Technology".

E.A.Faulkner and J.B.Grimbley published an "improved" design - basically a
fully complementary version - in "Electronic Engineering" volume 39, page
565 (1967), back in the days when Electronic Engineering was a respectable
refereed journal. It metamorphosed into its present condition as moderately
respectable trade journal - a sort of low budget "Electronic Design" sometime
around 1970.

> - was to superimpose your AC signal onto a slightly larger DC signal,
> convert it to a unipolar current at the emitter of a cascode, and feed the
> output of the cascode into the common emitter of a long-tailed pair, which
> was switched by the AC-signal (possibly squared off by a comparator).
>
> The rectified signal is then just the difference between the collector
> currents; you low-pass filter the separate collector currents with a
> capacitor on each side, then use an op-amp subractor to get the rectified
> output.
>
> It is fast (with fast transistors), but not all that accurate, unless you
> are very careful. Quite a few variants got published and patented.

I've got a feeling that Faulkner set up Brookdeal Instruments to exploit the
phases sensitive detector, and other stuff he'd thought up. Danby (?) of
Brookdeal published a balanced all npn version in Electronic Engineering at
around the late 1960's. Brookdeal is now merged with Princeton Applied
Research, who sold the same sort of product developed by physicists (claimed
maximum speed 5MHz, actual 2.3MHz, the only time I got stuck with one of
their hugely expensive gadgets) as EG&G Signal Recovery, but apparently there
is still development in the U.K.


Bill Sloman, Nijmegen


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Roy McCammon

unread,
Sep 8, 1998, 3:00:00 AM9/8/98
to Mike
Mike wrote:
>
> Gerrit Barrere sent me an interesting circuit from a HP5335. It
> uses two separate diode detector paths arranged so the diode
> offsets and temperature drifts cancel.

Are the inputs of the lower opamp reversed?

Opinions expressed herein are my own and may not represent those of my employer.


Jim_Thompson

unread,
Sep 8, 1998, 3:00:00 AM9/8/98
to
On Tue, 08 Sep 1998 01:52:00 GMT, Mike <ch...@urlfor.addr> wrote:

|Gerrit Barrere sent me an interesting circuit from a HP5335. It
| uses two separate diode detector paths arranged so the diode
| offsets and temperature drifts cancel.
|

[snip]

| I'd appreciate knowing how the images work in your browser.
|
|Regards, Mike

The images are great! What software did you use to create the gif's?
Somewhere in my archives I have a similar two-op-amp circuit that uses
only two diodes. I used it as a high frequency rectifier for that
lightning location project I've mentioned before. That was
"pre-computer" so I'll have to dig through my files.

(If replying by E-mail please observe method of anti-spam.)

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(602)460-2350 | |
| Jim-T@analog_innovations.com Fax:(602)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

For proper E-mail replys SWAP "-" and "_".

Mike

unread,
Sep 9, 1998, 3:00:00 AM9/9/98
to
Jim_Thompson wrote:
>
> On Tue, 08 Sep 1998 01:52:00 GMT, Mike <ch...@urlfor.addr> wrote:

[...]

> | I'd appreciate knowing how the images work in your browser.
> |
> |Regards, Mike
>
> The images are great! What software did you use to create the gif's?
> Somewhere in my archives I have a similar two-op-amp circuit that uses
> only two diodes. I used it as a high frequency rectifier for that
> lightning location project I've mentioned before. That was
> "pre-computer" so I'll have to dig through my files.
>
> (If replying by E-mail please observe method of anti-spam.)
>
> ...Jim Thompson

Thanks Jim - let's see your version!

Here's the answer to your question.

---------------------------------------------------------------
IMAGES FOR NEWGROUPS

Capturing images turns out to be simple, once you find the
secrets.

I use Win 3.11 - the software needed is difficult to find but
is still available. The following url's refer to the Win 3.x
version, but WIN95 versions are available at most of these
sites.

IMAGE SIZE

While making graphs, you have to consider that some people use
640 X 480 display resolution, most people use 800 X 600, and a
few use 1024 X 768 or even 1280 X 1024.

This presents a dilemma. You want to make the graph so it is
readable for all users.

If you make the size so it is comfortable in a 1280 X 1024
display, everyone else will have to scroll to see the entire
display. You want to make the image smaller for other users.

But if you make it too small, the text becomes hard to read.

You need to find a good compromise. Depending on the content in
the graph, I recommend a horizontal size between 400 and 600
pixels.

FILE SIZE

The file size is determined more by the image content than
display size, so making the image smaller has little effect on
the download time.

Most newsgroups that allow posting of binary files seem to have
a threshold of pain around 30 kbytes. If your total download is
much less, you should be OK. If you approach this limit, it
might be a good idea to add "ATTACHMENTS" to the subject line
to warn those with expensive or time-restricted connections.

Many very smart people have these constraints, If you need
their help and advice, you need to make life easy for them.

If you do not abuse the size limit, people will get to know and
trust you, and they will read your post if they are interested.

CREATING THE IMAGE

The first problem is getting a good graph. MicroCap V seems to
have the best graph display, and you can resize the window to
get the best combination of graph size and readable text. I
really don't like the schematic editor, but I have tried all
the other SPICE programs and MicroCap is best for making images
for distribution.

MicroCap V allows quick access to the analysis parameters, so
you can easily change the number of cycles in the graph to make
the clearest display. You also can double-click on the graph to
change any of the colors to make the graph more readable.

Use the fewest number of colors, and pick ones that are
pleasing and show good contrast without jarring the user. For
example, a yellow trace is hard to see on a white background,
and some deep blue colors seem to shimmer on a black
background.

Using the fewest number of colors also helps to reduce the file
size. You can also make the text the same color as one of the
traces. This saves download time without affecting quality.

To resize the display, run the desired analysis and click on
the resize icon in the upper right corner of the display window
(not the one in the extreme top right corner.) The graph
shrinks to a smaller size, and you can pick up the borders to
adjust the size.

CAPTURING TO THE CLIPBOARD

Once you have the graph in the size and colors you want, the
next problem is to get it into the Windows clipboard. I have
tried but have been unable to save the screen to the clipboard
using any of the standard methods - the images come out
garbled.

I use Screen Thief - the best of all I found. Unfortunately,
they have stopped development on the Win 3.x version, but you
can get it at Nildram Software's site

http://www.nildram.co.uk/services/software/sthief.htm

or download it directly at

ftp://ftp.nildram.co.uk/pub/shareware/screenthief/stwin101.zip

To activate Screen Thief, load it and return to your MicroCap
graph.

Press Shift-Ctrl-U, and Screen Thief will pop up. Move the
cursor to the top left of the desired graph area and click on
the left mouse button.

The next step is important. Move to the right side of your
graph and go all the way to the bottom of the screen.

Release the left mouse button. This puts you in Screen Thief
with your selection displayed on screen. Copy the image to the
clipboard using "Edit: Copy", or just Ctrl-C.

The unregistered version leaves a message at the bottom right
corner of the selected area. If you stop at the bottom of your
graph, the message will cover part of it. If you go all the way
to the bottom of the screen, you can crop it out later.

Load your favorite image editor that can save in GIF format. Do
not use JPG for waveforms - this will sprinkle random dots in
areas of solid color.

Open a New file and paste the image into the file. Crop and
annotate as needed, then save to the desired filename.

A good image editor to use is Paint Shop Pro. You can get it at

http://www.jasc.com

TESTING THE PROCESS

It is a good idea to try this before posting images to a
newsgroup or emailing to a friend. Be sure to load the GIF into
a browser to check the colors.

Some image processing software can show what appears to be a
perfectly good image when it is displayed in their program, but
the background color turns out to be the same as one of the
traces when you display it in your browser.

WINDOWS HOTKEYS

One problem is to activate all the different programs you need
to capture and crop the image, and add any annotations.

I found HotKey, by Douglas Boling of PC Mag, to be very
helpful. It allows you to assign a hotkey combination to load
any Windows program.

The hotkeys using "Shift-Ctrl" plus a letter seem to work best
since they do not conflict with existing programs. You can
download HotKey plus the C source at the PcMag Utilities
section, or at

ftp://ftp.fh-worms.de/pub-barbar/systems/WIN3/manager/hk10.zip

Screen Thief uses the hotkeys Shift-Ctrl plus "D", "W", "A",
and "U". These will be unavailable for use in HotKey.
---------------------------------------------------------------

Now that you know how, let's see more of your good work in pictures!

(Of course, Winfield would be the Cecil B. Demile)

Best Regards,

Mike

Mike

unread,
Sep 9, 1998, 3:00:00 AM9/9/98
to
Roy McCammon wrote:

>
> Mike wrote:
> >
> > Gerrit Barrere sent me an interesting circuit from a HP5335. It
> > uses two separate diode detector paths arranged so the diode
> > offsets and temperature drifts cancel.
>
> Are the inputs of the lower opamp reversed?

Tricky, isn't it?

I tried with pencil and paper, but for some reason I could not understand
how this circuit worked.

SPICE to the rescue - the polarities are correct!

Best Regards,

Mike

Mike

unread,
Sep 9, 1998, 3:00:00 AM9/9/98
to
Update.

I just discovered you do not need Screen Thief to copy the image to the
clipboard.

MicroCap V will save your resized graph directly to the clipboard. Just
use "Edit", and save the visible portion to the clipboard. It works
perfectly, and doesn't garble the image.

Regards,

Mike

Roy McCammon

unread,
Sep 9, 1998, 3:00:00 AM9/9/98
to Mike

I'm still dubious.

In the schematic, as posted, if the inputs of
the bottom opamp were reversed, you would have a
circuit that made sense. The upper path has
a gain of -1 and two diodes. The lower path would
have a gain of two with one diode. The
diode drops would cancel.

As drawn, I see positive feedback around the lower
opamp. It ought to be driven to one of the rails.

Mike

unread,
Sep 10, 1998, 3:00:00 AM9/10/98
to

Roy, you are absolutely right, and you have uncovered a major
bug in MicroCap V SPICE.

The inputs to the lower op amp need to be swapped exactly as
you recommend.

This bug takes 5 GIF's to demonstrate. At 39 kbytes, it is a
bit too big to post here, so I uploaded it to my web site.

You can view it at

http://www.csolve.net/~add/rfdetc/pkdetc.htm

Thanks for your persistence! You were right all along.

Best Regards,

Mike

Roy McCammon

unread,
Sep 14, 1998, 3:00:00 AM9/14/98
to Mike
Mike wrote:

> Roy, you are absolutely right, and you have uncovered a major
> bug in MicroCap V SPICE.
>
> The inputs to the lower op amp need to be swapped exactly as
> you recommend.


One of the ways spice can get you when you use simple models
is that it will use absolutely identical and perfect devices.
Same gain, same impedance. Infinite cmrr, psrr. Zero offsets,
drifts, and noise. Under these conditions, you can achieve
apparent stability, perfect cancellation, etc. In particular,
you can have lots of positive feedback and as long as nothing
disturbs it, the amp will sit there at zero.

I don't think that is your problem in this case. Actually,
its hard to imagine a bug that would give the same results
with reversed inputs and that the results would be correct
for correctly attached inputs.

Mike

unread,
Sep 15, 1998, 3:00:00 AM9/15/98
to

Hi Roy,

One more trap for the unwary!

I emailed Spectrum Software about this problem, and received an immediate
reply. You can see it, and the results of further analysis at

http://www.csolve.net/~add/rfdetc/opamp.htm

The answer seems to be it's supposed to do that - PSpice does the same
thing!

Best Regards,

Mike

Mike

unread,
Sep 15, 1998, 3:00:00 AM9/15/98
to
Roy McCammon wrote:

[...]

> One of the ways spice can get you when you use simple models
> is that it will use absolutely identical and perfect devices.
> Same gain, same impedance. Infinite cmrr, psrr. Zero offsets,
> drifts, and noise. Under these conditions, you can achieve
> apparent stability, perfect cancellation, etc. In particular,
> you can have lots of positive feedback and as long as nothing
> disturbs it, the amp will sit there at zero.

[...]

There is one place this behavior is extremely valuable - to check
the start logic of phase-locked loops.

For various reasons, it is sometimes desirable to start the VCO in
phase with the reference clock, as in data recovery circuits for
hard disk drives.

It is extremely difficult to get a SPICE VCO to run at the same
frequency and phase as a SPICE waveform generator.

Instead, make another VCO with exactly the same components and use
it as the clock generator.

When your VCO starts, it will be at the correct frequency. Then, you
can observe the start logic as it gets the VCO to the correct phase.

You can also modulate the reference clock control voltage and watch
the loop response as it settles to the new frequency.

I've seen others use this trick with phase-locked loops, so it's not
new.

Best Regards,

Mike

Roy McCammon

unread,
Sep 15, 1998, 3:00:00 AM9/15/98
to
Mike wrote:
>
> Roy McCammon wrote:
> >
> > Mike wrote:
> >
> > > Roy, you are absolutely right, and you have uncovered a major
> > > bug in MicroCap V SPICE.
> > >
> > > The inputs to the lower op amp need to be swapped exactly as
> > > you recommend.
> >
> > One of the ways spice can get you when you use simple models
> > is that it will use absolutely identical and perfect devices.
> > Same gain, same impedance. Infinite cmrr, psrr. Zero offsets,
> > drifts, and noise. Under these conditions, you can achieve
> > apparent stability, perfect cancellation, etc. In particular,
> > you can have lots of positive feedback and as long as nothing
> > disturbs it, the amp will sit there at zero.
> >
> > I don't think that is your problem in this case. Actually,
> > its hard to imagine a bug that would give the same results
> > with reversed inputs and that the results would be correct
> > for correctly attached inputs.
>
> Hi Roy,
>
> One more trap for the unwary!
>
> I emailed Spectrum Software about this problem, and received an immediate
> reply. You can see it, and the results of further analysis at
>
> http://www.csolve.net/~add/rfdetc/opamp.htm
>
> The answer seems to be it's supposed to do that - PSpice does the same
> thing!

I believe it.

Roy McCammon

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to

Turns out that my first course on feed back taught this result.
Proffesor Dr. Bostick worked the first example using positive feedback
and infinite bandwidth and got a reasonable DC result. He then did
a transient analysis and showed how any bit of rolloff or delay
inevitably caused right half plane poles and how changing the the
feedback to negative changes the resulting poles to left half plane
poles. He said we should all see the derivation once. Took one lecture.
Of course, I only remembered the lesson: use negative feedback.

So, its not a bug, its a flaw.

The level one amp assumes a gain of 1000 and an infinite bandwidth.


Vp .-----------R2---------.
| 9K |
1K | | \ |
gnd ---R1---+------|+ \ |
| >---------+--- Vout
Vin--|- / 1V
99mV | /

This is a correct DC analisys.
Vp = 100 mV.
Vp-Vin = 1mV
Vout = 1000*(Vp-Vin) = 1V.

Since this is a linear model, this is the one and only solution.

But But But, if you add any delay anywhere or finite bandwidth,
you have to do a transient analysis which inevitably gives you
right half plane poles.

Mike

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to
Roy McCammon wrote:
>
> Roy McCammon wrote:

[... snip nice analysis]

Acutally, what we need is a simple way to take the difference between two
voltages and multiply it by some constant. No need for poles and zeros.

We just want pure speed. Most SPICE programs have a way to do this.

I'm just in the process of converting over from IntuSoft and I'm trying
different SPICE programs.

I find not only do you have to abandon all the work file you have done in
the previous program, it's a good idea to forget everything you knew and
start over from scratch. Otherwise you may assume something in the new
program works the same as the old one.

The is a tremendous obstacle for new companies trying to get someone to
switch. Don't do it unless you really have to, and you can afford the
unlearning curve.

Best Regards,

Mike

Roy McCammon

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to Mike
Mike wrote:

> Acutally, what we need is a simple way to take the difference between two
> voltages and multiply it by some constant. No need for poles and zeros.

Unless you are working with infinite bandwidth, zero phase
shift, you get poles and zeroes whether you want them or
not. This might be ok for a small signal analysis, but
it is suspect on a transient analysis.

Mike

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to
Roy McCammon wrote:

> Unless you are working with infinite bandwidth, zero phase
> shift, you get poles and zeroes whether you want them or
> not. This might be ok for a small signal analysis, but
> it is suspect on a transient analysis.

Thank you for your previous post. You have saved me much wasted
effort!

I think you are correct. With infinite bandwidth and zero delay, it
seems the example in your previous post would give a stable result,
even for varying signals.

As you point out, it would happen even with a simple math model that
took the difference between two voltages and multiplied by a
user-defined constant.

This is why the VCVS and the Level 1 op amp produced the same
result. Both have zero delay and infinite bandwidth.

Good thing the original circuit was smudged - not many people get a
chance to examine this.

I don't know how I'm going to break the news to Gerrit. Our quest
for a faster way to model op amps seems doomed to failure.

On the other hand, MicroCap allows you to set the gain to anything
you want for the VCVS and the different op amps.

Using the VCVS and Level 1, and by changing the gain, I can get
MicroCap to give a divide-by-zero error, ramp the output to the rail
as expected, or show normal operation. This is with the inputs
reversed.

One of these is a bug - take your pick.

Best Regards,

Mike

Roy McCammon

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to Mike
Mike wrote:

> This is why the VCVS and the Level 1 op amp produced the same
> result. Both have zero delay and infinite bandwidth.

I think that if you hang some capacitance on the output of the
level one op-amp and take a small enough time step,
you will get something more realistic.

Mike

unread,
Sep 16, 1998, 3:00:00 AM9/16/98
to
Roy McCammon wrote:
>
> Mike wrote:
>
> > This is why the VCVS and the Level 1 op amp produced the same
> > result. Both have zero delay and infinite bandwidth.
>
> I think that if you hang some capacitance on the output of the
> level one op-amp and take a small enough time step,
> you will get something more realistic.

Probably, but the idea was to get a model that ran very fast, and still
offered protection against going into pcb layout with reversed inputs
somewhere.

Going to a small enough time step could make it very slow.

Perhaps the best approach is to use the Level 2 initially to check for
problems, then switch to Level 1 for in-depth work if the circuit allows.

I did a small benchmark on all the models. There is not that much
difference between VCVS, Level 1, and Level 2. Level 3 is very slow.

Best Regards,

Mike

0 new messages