Unexpected PEAK DETECTOR behaviour

Discussion in 'General Electronics Chat' started by Rogare, Apr 5, 2012.

Mar 9, 2012
78
0
Hello! I'm using the peak detector circuit found here along with an LM358N op amp, a 10 uF capacitor, and an 1N4148 diode. It works absolutely fine for one of the two inputs I need it to:

4 V -----------------------------------
-------------|--------|-----------------
0 V ------------------------------------

It's a positive rectangular pulse, a couple hundred microseconds long. No problem. It takes a few hits of the input for the output to reach the peak (4 V), but that's fine.

However, when I try it with a bipolar input (see below) of about the same length, the output just climbs and climbsfar higher than the peak value.

2 V -----------------------------------
-------------|-\-------------------------
0 V -------------\--------------------
-------------|----\-|-----------------
-2 V ----------------------------------

Any ideas why this second input might drive the output so high? (Again, it's just fine if it takes a few of these short inputs to get the output up to the peak valuein this case 2V.) Thanks for reading!

2. ssnyde New Member

Apr 4, 2012
19
5
Hi Rogare,

What are you using to power the op-amp? What's the voltage on Vcc and Vee?

Steve

Mar 9, 2012
78
0
Hi Steve, I'm using +/- 8V to power the op-amp.

4. ssnyde New Member

Apr 4, 2012
19
5
Hmm wierd. How high does it go? Does it hit the rail and sit there? Can you try a bipolar square wave instead of that triangle, and watch the output on a scope along with the input and see what the output does with respect to the input.

I just want to make sure I'm clear on how it is wired. A schematic would help but I'll describe how I envision it and correct me if I'm wrong. You have the circuit you linked to, Vcc on +8V, Vee on -8V and the capacitor to a ground that comes from the same supply which provides +/-8V. Then you have a function generator, whose negative terminal is also tied to this common ground, and it's other terminal going to the non-inverting op-amp terminal.

5. Audioguru New Member

Dec 20, 2007
9,411
896
I think the lousy old LM358 is far too slow to be used in a peak detector circuit.

6. Brownout Well-Known Member

Jan 10, 2012
2,375
998
You may need to address stability in your design. The capacitor in the feedback circuit could possibly cause ringing. If you can scope the output of the amp, that would tell you alot, or if you can simulate the circuit with a good LM358 model. 10Uf is a big capacitor, and most likely an electrolytic, hence not the best for peak detection. I'd try a smaller poly cap, and find out about the ringing.

7. Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
I ran a sim on your circuit. It didn't overshoot at all. In fact, the crappy slew rate caused the output peak to be missed, and the peak voltage was reached when the input was already on the way down.

Mar 9, 2012
78
0
Hi ssnyde, thanks for the reply. When the bipolar input is sent to the peak detection circuit, the output rises to 8Vroughly half of my supply voltage (~16V). The schematic I used was the same as the wikipedia article, but with the additional details:
- V+ connected to Vcc of supply (16 V)
- Ground connected to GND of supply (0 V)
- The input signal uses the same GND as the supply

[ I originally said a +/- 8 V supply because it's essentially a 9 V through an 8 V rectifier, then sent to an ICL7660 to yield a +/- 8V supply. That said, I'm really just using it as a 16 V supply with a ground. ]

Mar 9, 2012
78
0
Hi Brownout! I tried a smaller ceramic cap (47 nF) and though it definitely had some advantages over the electrolytice.g., the output jumps to the peak value after just a single short input pulse instead of requiring a fewthe output still shot up to much higher then the peak value when I tried the biphasic input.

Mar 9, 2012
78
0
When I take the capacitor out altogether, it's pretty clear that the problem is the negative part of the wave. You can see in the attached image that the response to the positive part of the wave looks OK (note the different scales), but the negative is the problem.

It may be that the current in my circuit exceeds the rated current for my diode...

NOTE: In the attached image, the blue wave is the input to the peak detection circuit and the red wave is the output. (The two waves are set to different scales as shown.)

File size:
16.8 KB
Views:
24
11. Audioguru New Member

Dec 20, 2007
9,411
896
You said the input uses the same 0V as the single positive supply for the LM358 opamp.
Then your biphasic signal is exceeding the -0.3V maximum negative input voltage!

Rogare likes this.
12. Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Yeah, you really do need positive and negative power supplies.

13. Brownout Well-Known Member

Jan 10, 2012
2,375
998
Would'a been much better to tell us this in the first place!

Mar 9, 2012
78
0
Yup, I think that's it. When I reduced the amplitude of the biphasic down below +/- 0.3V, the problem went away. Thanks, Audioguru.

Without making any changes to the power supply situation (V+ is 16 V, supply and input signal share the same ground), is there simply another (cheap) op-amp that doesn't have the -0.3 V limitation?

15. Audioguru New Member

Dec 20, 2007
9,411
896
Most opamps have inputs that are damaged when the input signal is more negative than the negative supply voltage that is 0V in your circuit.
Some circuits use a dual polarity power supply. Why don't you connect yours as a dual polarity supply?
Other circuits use a series resistor from the signal source then a Schottky clamp diode at the input pin of the opamp.

16. Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
What are you going to do with the output of your peak detector? Can you tolerate AC coupling? If so, you could bias the input signal at ≈8V, but this could open a can of worms.

Mar 9, 2012
78
0
OK, I'll take another look at my supply and referencing setup.

Thanks for the help, much appreciated!

18. Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
What is the risetime of your input signal (from 0V to peak)?

Mar 9, 2012
78
0
Hi Ron, the rise-time wouldn't be more than a few microseconds. (I posted an image of the input signal on the first page of this topic.)

20. Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
The fastest expected risetime, and peak amplitude, are critical parameters to consider when choosing an op amp with adequate slew rate. "A few microseconds" is not really enough information.

EDIT: If we say the risetime>1usec, and the amplitude=1V, then we do have enough info.

Last edited: Apr 13, 2012