Author Topic: Op-amp peak detector doesn't match the peak input  (Read 588 times)

0 Members and 1 Guest are viewing this topic.

Offline icecatsTopic starter

  • Contributor
  • Posts: 19
  • Country: us
Op-amp peak detector doesn't match the peak input
« on: April 18, 2024, 11:58:11 am »
Hi,
I am experimenting with an op-amp peak detector used to sample and hold the peak voltage from the output of a voltage divider circuit. This is part of my attempt to rebuild the AMP+ circuit in this electric fence monitoring project.
I have measured my input pulse using an oscilloscope to be a few microseconds with a peak at 0.7 volts.
I have tried a couple different op-amps. I used the TLV9062 (what my reference circuit uses), and found that the reported peak voltage is higher than the input voltage: the alleged peak is 1.5 volts. I also tried using an OPA2374 and measured a peak of about 0.6 volts.
The OPA2374 had an output that was much closer to what I would expect. What should I be looking for in the op-amp datasheets to distinguish between these op-amps and predict this output behavior?
I have watched through this video on peak detector circuits but didn't get any hints as to what my issue might be.

« Last Edit: April 18, 2024, 12:01:24 pm by icecats »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9959
  • Country: nz
Re: Op-amp peak detector doesn't match the peak input
« Reply #1 on: April 18, 2024, 12:21:18 pm »
Maybe test the circuit with an input from a battery (known voltage source).

Just to confirm the issue still exists.  That will rule out the possibility that there's actually more voltage on your input signal than you can see on the scope. Like maybe it's too short for the scope to see but not the opamp, or maybe the scope is loading the signal and you never see it with scope connected etc..  a battery is a known DC voltage, so you can rule out stuff higher voltages you cant see.
« Last Edit: April 18, 2024, 12:23:16 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline icecatsTopic starter

  • Contributor
  • Posts: 19
  • Country: us
Re: Op-amp peak detector doesn't match the peak input
« Reply #2 on: April 18, 2024, 01:20:36 pm »
Maybe test the circuit with an input from a battery (known voltage source).

Just to confirm the issue still exists.  That will rule out the possibility that there's actually more voltage on your input signal than you can see on the scope. Like maybe it's too short for the scope to see but not the opamp, or maybe the scope is loading the signal and you never see it with scope connected etc..  a battery is a known DC voltage, so you can rule out stuff higher voltages you cant see.

Good suggestion! I put together a voltage divider to output 2v (so as to be well below the V+ supply) and connected it to the op-amp input. Indeed, the op-amp output reads 2v as expected.
 

Offline icecatsTopic starter

  • Contributor
  • Posts: 19
  • Country: us
Re: Op-amp peak detector doesn't match the peak input
« Reply #3 on: April 18, 2024, 04:12:26 pm »
Comparing the TLV9062 datasheet to the OPA2374 datasheet, I don't see any significant differences. I assume input impedance could induce different effects on the circuit but both Differential and Common-mode capacitances are within 2 pF of each other which seems insignificant.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14226
  • Country: de
Re: Op-amp peak detector doesn't match the peak input
« Reply #4 on: April 18, 2024, 04:36:43 pm »
The storage capacitor is quite some capacitive load to the op-amp and this can lead to quite some overload, especially with rather fast OP-amps. One may have to add a little resistance (e.g. 10s to maybe 100 ohm) in series to the storage capacitor to reduce overshoot / peaking in the response. Also a rather small (e.g. 100 pF range) capacitor can help.

p.s.: A lack of proper decoupling also makes ringing often worse. It is a good idea to directly solder a decoupling capacitor to the adapter PCBs used with a breadboard.
« Last Edit: April 18, 2024, 04:43:47 pm by Kleinstein »
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1434
  • Country: ca
Re: Op-amp peak detector doesn't match the peak input
« Reply #5 on: April 19, 2024, 12:25:55 am »
Whats the output offset voltage of the op-amp ? I remember when I've done calculations for op-amps, and have the simulator do something different with real op-amps, and not know why.

What's the circuit ?
 

Offline icecatsTopic starter

  • Contributor
  • Posts: 19
  • Country: us
Re: Op-amp peak detector doesn't match the peak input
« Reply #6 on: April 19, 2024, 11:15:24 am »
The storage capacitor is quite some capacitive load to the op-amp and this can lead to quite some overload, especially with rather fast OP-amps. One may have to add a little resistance (e.g. 10s to maybe 100 ohm) in series to the storage capacitor to reduce overshoot / peaking in the response. Also a rather small (e.g. 100 pF range) capacitor can help.

p.s.: A lack of proper decoupling also makes ringing often worse. It is a good idea to directly solder a decoupling capacitor to the adapter PCBs used with a breadboard.

Thanks for the reply. I've tried putting various resistors in series with the storage capacitor and the response certainly changes depending on the resistance. I then completely removed the storage capacitor to isolate out its effect on the circuit. I still have a pretty big disparity between the op-amp input and output.

I am now thinking that my issue is related to scope loading on the circuit. My scope probes have a capacitance of ~20 pF vs. the op-amps which are 3-6 pF. I connected one probe to the input of the op-amp (blue, channel 1) and another (red, channel 2) to the output (with storage cap removed) and the attenuation is clear. Does this imply scope probe loading? My only confusion here is why the output is not also attenuated WHEN a probe is simultaneously connected to the circuit.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14226
  • Country: de
Re: Op-amp peak detector doesn't match the peak input
« Reply #7 on: April 19, 2024, 12:11:24 pm »
One would normally not probe the sensitive pin at the storage capacitor. The output signal is from the buffer OP-amp. Here the proble capacitance and loading (10 M) would not have much effect.

On the photo it looks like there is no GND connection to the µC board on the left.  One also needs something to reset the peak value (e.g. a bleader resistos or a reset circuit).
 

Offline xvr

  • Regular Contributor
  • *
  • Posts: 167
  • Country: ie
    • LinkedIn
Re: Op-amp peak detector doesn't match the peak input
« Reply #8 on: April 19, 2024, 02:06:19 pm »
My scope probes have a capacitance of ~20 pF vs.
Use 1:10 probe
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf