Opamp peak detector misses pulses?! - Page 1
Forum section: electronics / projects

author: xyzzy
author_rank: Contributor
timestamp: May 20, 2020, 03:15:44 am
content: I am attempting to debug a peak detector circuit. I'm feeding it with 20 us pulses at 480 Hz. Above a certain voltage, the circuit starts "missing" pulses. Rather than charging the output capacitor every cycle, it charges it every few cycles. This increases the ripple voltage rather dramatically.This is the basic circuit I'm using. In my case, R1 is shorted, R2 is 1k (I'm not entirely sure what affect this has), diodes are 1N4148s, U2 is a TL071, and I've tried everything from a TL071 to a LT1226 for U1. The circuit is powered from +/- 12V.Here's what one of the pulses looks like up close. Yellow trace is input, blue trace is output. The difference in vertical scale is because the input is terminated into 50 ohms (thus cutting the amplitude in half), and an output stage downstream of the above schematic has a gain of 2. The signals on the scope screen are scaled to compensate.Here's what the output is supposed to look like, and what is does look like when the output voltage is below around 2V (the max voltage for good behavior seems to vary a bit).Here's what the output looks like when there's a problem.Any insight as to what's causing this would be much appreciated! I usually do mostly digital work, but I figured "how hard can a simple peak detector be....".

author: moffy
author_rank: Super Contributor
timestamp: May 20, 2020, 05:46:35 am
content: What is the size of the cap? If the voltage on the cap (negative input of U1) goes even fractionally above the peak on the +ve input, or doesn't have enough voltage difference to drive the op amp those last millivolts then no charging. You might have tiny glitches in the drive signal. Remember it is a peak detector, with quite a long hold time and that is what it appears to be doing.

author: StillTrying
author_rank: Super Contributor
timestamp: May 20, 2020, 11:43:39 am
content: Have you had a close look at the output of U1, perhaps it's not coming out of saturation fast enough and when it does it overshoots at the 2.6V level. Just a guess.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 20, 2020, 12:06:45 pm
content: Hi,The circuit is working as it should.There is no discharge path for C1 (except U2 input).If the voltage on C1 is already higher than the input pulse, no action is taken. So there will be a missing pulse.The circuit is a peak detector, there is no reset mechanism, if the output voltage is already bigger than the input no action is taken.If you put a resistor in parallel with C1 with a long time constant, say 50ms, it will work if the amplitude of the input is declining.Regards,Jay_Diddy_B

author: xyzzy
author_rank: Contributor
timestamp: May 20, 2020, 12:58:43 pm
content: Sorry, I tried to add some more details a few minutes after posting, but I kept getting "502 Bad Gateway" errors on the forum.C1 is 100 nF. There is a 5 Mohm resistor in parallel with C1, giving a time constant of 0.5 seconds.The part that mystifies me is that the circuit behaves perfectly at lower pulse voltages (less than ~2V), but begins missing pulses at slightly higher voltages (but still nowhere close to the rails). Sometimes it only charges the cap every 2nd or 3rd pulse; other times, it may take 10 or more pulses before it charges again.When using a TL071 for U1, the op amp can't react fast enough to charge the cap to the peak voltage during such a brief pulse. The LT1226 (1 Ghz BW) has no problem keeping up, but it does tend to oscillate when I turn the pulses off resulting in an output of ~225mV when it should be zero.Thanks to those who have replied so far, and please let me know if the above shines any additional light on the situation.

author: StillTrying
author_rank: Super Contributor
timestamp: May 20, 2020, 02:27:43 pm
content: All I can think of is that U1 has to sink more current through D1 and R2 at 2.6V, but it's still only 2mA.There's a version with U1 swapped for a comparator, which overcomes the saturation and speed problems - in theory.https://youtu.be/5Pz7Mx0WRUk?t=134

author: duak
author_rank: Super Contributor
timestamp: May 20, 2020, 05:36:44 pm
content: I think U1 is winding up and sticking longer in the maximum Vout state as the input pulse height increases. StillTrying asked about U1's output - please show us its waveform.Most opamps have trouble driving capacitive loads without some series resistance. If R1is 0R, maybe something weird is happening. I'd try a value of 100R and see what happens.