Author Topic: Peak detector problem  (Read 1949 times)

0 Members and 1 Guest are viewing this topic.

Offline elkiTopic starter

  • Regular Contributor
  • *
  • Posts: 128
  • Country: be
Peak detector problem
« on: May 09, 2023, 08:25:14 pm »
Hello,

I am trying to simulate a basic peak detector circuit (please see below). Naively, I would expect it to look for positive voltages, while it happens that it mainly hunts for the negative ones .. Would appreciate any ideas of why it could happen!

Thanks in advance!
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17805
  • Country: fr
Re: Peak detector problem
« Reply #1 on: May 09, 2023, 09:02:59 pm »
I don't see anything fundamentally wrong with your schematic. Please check that the Spice model for the opamp is valid and that you have set up valid power supplies for V+ and V- (which we don't see on your schematic).

Other than that, it should work albeit with a voltage drop due to the diode. I would place the feedback loop after the diode rather than before. In practice, you'll also probably need a way of resetting the peak detector - can be done with a NMOS in parallel with the output cap. for instance.

 
The following users thanked this post: elki

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Peak detector problem
« Reply #2 on: May 09, 2023, 09:27:05 pm »
Check the pin numbering in the D1 Spice model.
Spice expects anode=1, cathode=2. Standard pinout for most diodes is the opposite.
Use the "Alternate pin sequence" in KiCAD to correct this.
Tip: always check the "Show pin numbers" box for ALL symbols on your schematic. It helps no end when troubleshooting.
 
The following users thanked this post: elki

Offline elkiTopic starter

  • Regular Contributor
  • *
  • Posts: 128
  • Country: be
Re: Peak detector problem
« Reply #3 on: May 10, 2023, 04:20:24 am »
Thanks a lot for the quick feedback
 

Offline inse

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: de
Re: Peak detector problem
« Reply #4 on: May 10, 2023, 05:16:50 am »
What’s puzzling me is that you have two scales on your diagram while both of your signals are labeled as voltages - is that assigned correctly?
As already stated before: put a discharge resistor parallel to the storage capacitor otherwise you will only detect the highest peak of all times.
What kind of signal peak do you want to detect?
I just noticed the OPAMP is a current feedback type, are you familiar on how they work ( I‘m not so)
« Last Edit: May 10, 2023, 05:31:14 am by inse »
 
The following users thanked this post: elki

Offline elkiTopic starter

  • Regular Contributor
  • *
  • Posts: 128
  • Country: be
Re: Peak detector problem
« Reply #5 on: May 10, 2023, 06:14:05 am »
Thanks again for all the replies.

A few observations:

1) As Benta pointed out, the alternate pin sequence has to be used for diode in KiCAD.

2) SiliconWizard, yes, an additional resistor to the ground on the output part was planned to be added :)

3) inse, while the main issue was the diode polarity, there is indeed something to be understood concerning the operation mode of the current-feedback op amps. The main idea is to find the peak voltage of relatively short pulses (1us or so) of positive polarity with these op amps (which also have rather high slew rate).

The corrected schematics works as expected now, thanks. The evil was the diode pin assignment. Nevertheless, I see some cases of the input pulses, when I have to add one more diode right at the output of op amp in reverse direction, otherwise it does not seem to be be operational and saturates the whole thing to supply voltage right at the first pulse. I believe it has something to do with the op amp being of a current-feedback type. Please see the working example below (part of the schematics is shown with input and output oscillograms, since the whole thing is rather big). The non-working case is shown in the last two screenshots.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 17256
  • Country: de
Re: Peak detector problem
« Reply #6 on: May 10, 2023, 06:24:32 am »
The circuit with the extra diode is a btd strange. It depends on the OP-amps bias current to work or fail. The simple circuit shown is just a voltage follower and than a simple diode and capacitor peak detector. It works, but is not very precise, as the diode drop reduces the output voltage and this drop is temperature dependent and with short pulses and the relative large capacitor the current through the diode also effects the drop. With similar pulses to look at this may still be OK.   The more standard, more precise circuit used 2 OP-amps. An additional OPamp buffers the storage capacitor and the feedback is from the buffer. It is however a bit tricky at high speed.
 
The following users thanked this post: elki


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->