Author Topic: OPA2388: peak-hold detector circuit affected by opamp input leakage current  (Read 5006 times)

0 Members and 1 Guest are viewing this topic.

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Hello,

I am struggling with a peak detector circuit based on the OPA2388, and it just does not want to work!

I have eventually reduced it to the schematic in the first attachment. The second attachment indicates what I get from it, when appropriately stimulated with a repeatable input signal.

I do not understand why the C331 capacitor is not holding the charge, and the only thing I can blame it on is on the input leakage current of the opamp input. The datasheet indicates am input bias current of less than 1nA, but it indicates this is with an Ri=100kOhm. I am not sure what this Ri is referring to, is it an additional series resistance that needs to be added to the input of the opapm? If I consider the leakage of both opamp inputs connected to the C331 (about 1nA each) and the maximum reverse current of the diode (30nA) I estimate the decay on the capacitor must not be greater than 35mV during the 1ms period (which is the repetition rate of the input signal).

I must mention that I am explicitly not probing the capacitor voltage directly with the oscilloscope, to prevent the probe impedance from discharging the cap. I am only able to look at the output of the second opamp (which is in buffer configuration.

So any ideas? Is it not the OPA2388 the right one for the job? I have replaced both the opamp IC and the diode, just in case I was dealing with a faulty one, but that was not it.

Best regads,

Cristian
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
The diode may not be the very best choice. Like other very fast diodes it has a significant leakage current. However the choice is not that easy. Low leakage diodes tend to be slow and fast diodes have quite some leakage. So its about finding a good compromise.  The choice depends on the application / speed and hold time needed. For the relatively fast cycle like show the diode may be OK.

The input bias current for the OPs is valid with the OP in linear mode - in this case the first OP would no longer be in linear operation and can have a much higher input current. The OPA388 does not look like it has the common protection diodes, but there can still be additional current.

The usual way would be to have the feedback for the 1 st OP from the output of the first OP. To make this work, one may have to use 2 different OPs, with the 2nd OP considerably faster than the 1st. For the 1 st OP one may have to look for good capacitive drive capability.
To speed up the reaction one may have to add an alternative feedback parth with a diode and resistor, so that the OP does not start from saturation, but something like 1 V below the peak.

It usually also needs some kind of reset circuit, if there is not that much drift downwards.  :-DD
 

Offline awallin

  • Frequent Contributor
  • **
  • Posts: 694
what capacitor are you using? Try a 'plastic' PP or PTFE low leakage capacitor?

electrometer op-amps have maybe 10s of fA input bias currents..
electrometer datasheet or app-notes probably have guard-ring ideas explained, to minimize leakage of the charge through the PCB material.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
For the capacitor 1 nF is already quite large for a fast peak detector, but it can be Ok. Anyway this effects the response to short pulses and not the hold time. On the scope pictures the rise looks quite fast - so maybe the capacitor is much smaller than planed ?

The observed discharge (some 400 mV  in 400 µs and thus some 1 µA) is way more than the usual board and diode leakage.

There is usually no need for PTFE caps. NP0 ceramic should be good enough: about as good as PP. With TDK brand ones I got a loss factor even about 5 times lower, not much different from what PTFE caps should be.

If fast reaction and a long hold time would be needed one can use 2 stages in series: a second slower one with a larger cap for a longer hold time.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Probably something to do with this, page 20.



www.ti.com/lit/ds/symlink/opa2388.pdf
.  That took much longer than I thought it would.
 

Offline duak

  • Super Contributor
  • ***
  • Posts: 1048
  • Country: ca
The 3rd paragraph of Kleinstein's reply should start with: "The usual way would be to have the feedback for the 1st OP from the output of the SECOND OP".   As StillTrying points out, as drawn, the iinput clamp diodes  of the first op-amp will try to drag the hold voltage up or down depending on the input voltage.

There is usually some sort of reset circuit, either a discharge resistor to ground or a switch to set the hold voltage to a low value.

I would also add a bounding clmap to prevent the first op-amp from going too far into saturation when the input is much lower than the hold voltage.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
My guess is that you've bought the parts from China, and that they're fake. Your circuit is fine as it is.

 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Thank you all for your replies.

I got parts from Mouser. Although soon Mouser will not be distributing TI parts anymore, I do not believe that what I have is fake, at the moment.

The capacitor is NP0/C0G dielectric.

Quote
he usual way would be to have the feedback for the 1 st OP from the output of the first OP. To make this work, one may have to use 2 different OPs, with the 2nd OP considerably faster than the 1st. For the 1 st OP one may have to look for good capacitive drive capability.
To speed up the reaction one may have to add an alternative feedback parth with a diode and resistor, so that the OP does not start from saturation, but something like 1 V below the peak."

Quote
There is usually some sort of reset circuit, either a discharge resistor to ground or a switch to set the hold voltage to a low value.

Initially this is what I had, indeed. I had a 20k resistor from the output of the 2nd OPAMP to the inverting input of the 1st opamp. In addition, I also had a diode from the inverting input of the 1s opamp to its own output. I also had a mosfet discharging the capacitor, between 2 input signal cycles, but it "did not work" and I wanted to simplify the circuit as much as possible. I will post tomorow more details about what "did not work" means, probably I will set up a different thread.

However, based on Fig42 mentioned above by StillTying, I realize this simplified variant of the circuit is conceptually wrong. The input diodes protection indeed affect the capacitor charge. Even if the difference between the the inputs of the 1st opamp becomes smaller than the internal protection diodes voltage drop, the output of the 1st opamp still works in saturation, as the existing diode in my circuit effectively breaks the feedback loop. Consequently, I cannot rely on the input bias current values indicated in the datasheet, as these are only valid for the linear region, as Kleinstein correctly pointed out.

In the circuit variant with the feedback of the 1st opamp being taken from the output of the 2nd opamp, there is no connection between the capacitor and the inverting input of the 1st opamp, hence the stored charge is not being affected.

Best regards,
Cristian
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
OK, so having understood why the schematic in the original post is not functioning correctly, I decided to revert to the original schematic, which was a bit more complicated, "not working" and which I wanted to simplify. As the simplification is obviously flawed, I am back to square one, and I attached the schematic of the original, unmodified circuit, to this reply (Schematic.pdf).

This one has indeed the feedback at the 1st opamp taken from the output of the second opamp, through a 20k resistor, and it also has the additional diode (D331) which helps the 1st opamp not to saturate.
It also has a MOSFET through which I reset the charge on the capacitor.

As can be seen in the attached screenshot, I get some weird behavior, with the output of the overall circuit peaking, but not always at the correct value (see Fig1.png). I am also a bit uneasy about the oscillations at the OPAMP_OUT node during the time the capacitor is held in RESET (uC_PEAK_RST is HIGH), but I suppose these are due to the limited output current capability of the opamp, which would like to be HIGH but cannot source that much current permanently through the 10Ohm resistor and through the RESET mosfet. So while not really liking these oscillations, I am not sure if it is actually related to the output not peaking at the right value when uC_PEAK_RST goes LOW, or if that is due to some other limitation of the opamp. I have also attached some more close-up screenshots of what is happening with the OPAMP_OUT node when uC_PEAK_RST goes LOW (Fig2.png, Fig3.png, Fig4.png).

As a side note, I must say I had an earlier version of this circuit, based on the ADA4891-2 opamp from Analog Devices, which was working. I was unhappy with the offset voltage rating of that opamp (10mV),  and I wanted to change to something better. I had originally selected the ADA4891-2 based on its extremely low input bias current to minimize storage capacitor voltage decay, but it seems it is difficult to find opamps with such low bias current and low offset rating. Anyway, I realized that it is most likely not the opamp input bias current which is the dominant leakage path, as it is a couple of order of magnitudes compared to the leakage current through the reset mosfet (I was using the 2N7002 as a reset MOSFET back then). So I changed the opamp to the current Texas Instruments OPA2388, which also has a reasonable low input bias current, but a much, much better offset voltage; I have also changed the reset mosfet to the smallest leakage one I could find (PMZB600UNELYL). Yet, it seems the change is working against me. I still have some samples of the ADA4891-2 around, but they are SOIC footprint and do not match the footprint on my current board (I have selected the OPA2388 in VSSOP footprint). However, I suppose I can order some ADA4891-2 in a VSSOP compatible footprint version and give it a go in the current circuit. But I am really put off by its large offset voltage, and I would really like to make somehow the current schematic work.

Of course, there is the possibility to change the opamp to an even third alternative, but unless I cannot pinpoint what is wrong with the current OPA2388, there are no guarantees I might not be running in the same issues with a new one.

There fore...help!

Best regards,
Cristian
« Last Edit: March 04, 2020, 09:47:44 am by brumbarchris »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
In the latest pdf the feedback resistor 20k seems high to me, I'd probably have gone for 2k2 as a first guess to keep the feedback delays as short as possible, but I don't know the answer. :)

https://youtu.be/5Pz7Mx0WRUk?t=138
From  www.eevblog.com/forum/projects/500khz-peak-detector/
.  That took much longer than I thought it would.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
The circuit with the 2nd OP inside the loop of the first OP ideally wants the 2 nd OP to by considerably faster than the 1 st OP.  One also has to be careful with the size of the capacitor, as this acts as capacitive load. The resistor as drawn does not help here as it is inside the loop.
To some degree it can help to have a transistor as emitter follower instead of the diode.
It helps if the 1 st OP is chosen for good capacitive drive capability.  The 2nd OP does not need a low offset. The 1 st OP would correct the offset of the 2nd OP, even if large.

The easy point to try would be reducing the capacitor to something like 100 pF. One may be lucky and get away without the oscillations.
With some OPs is may help to give the 1 st OP some additional current loading to stay on one side of the output stage.
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Thank you for your replies and simulations!

I'll try to play a bit with the 20k feedback resistor value, to see if I get some different results.

Quote
To some degree it can help to have a transistor as emitter follower instead of the diode.
I am aware of that scheme, but I need to try and make something out of the current PCB layout. Equally, this means I am stuck with using a dual-in-package opamp, so they will both have the same speed. Although, I would suppose the capacitive load of the 1st opamp artificially makes it slower anyway, right?

Quote
One also has to be careful with the size of the capacitor, as this acts as capacitive load. The resistor as drawn does not help here as it is inside the loop.
The easy point to try would be reducing the capacitor to something like 100 pF. One may be lucky and get away without the oscillations.

The oscillations are not there because of the capacitor. They are there while uC_PEAK_RST is HIGH, which means the reset MOSFET is active and shorts out the capacitor. I am pretty sure they appear because the limited output current capability of the 1st opamp, which must constantly source current through the 10 Ohm resistor and through the MOSFET.

Regards,
Cristian
 

Offline exe

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
soon Mouser will not be distributing TI parts anymore

Can you please share a link describing the situation?
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
The reset phase should not be much longer than needed. Especially there should be a little time between the reset phase and the peak to come. The OPA388 needs some time to recover from effective short at the output and thus recovery for the AZ part of the OP. There is a chance that the oscillations are not classical loop instability, but possibly some residual from the internal chopping. A non AZ OP may be better behaved in this respect.

A capacitor at the OPs output would not help - it would make things even worse, as there would be additional phase shift / delay. If at all it would be an extra capacitor in feedback.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
I got parts from Mouser. Although soon Mouser will not be distributing TI parts anymore, I do not believe that what I have is fake, at the moment.
Are you sure? AVNET/Farnell have been running stocks down for a year+, and I received this from TI earlier this week:

"As you may know, we (TI) are in the process of winding down our business relationships with certain distributors. We are writing today to help ensure you continue receiving the products you need, when you need them. Please see below, and forward this email to your procurement and purchasing colleagues as appropriate.

Actions our TI customers should take to ensure business continuity of TI products
If you currently purchase TI products through Avnet, Compel, Eastronics, MT, Telsys, WPI or WT, we encourage you and your supply-chain partners to immediately start transitioning your new and existing TI business to our long-term supply-chain options:
   •    Arrow Electronics, our authorized broadline distributor in all regions except Japan.
   •    TI.com.
   •    DigiKey or Mouser, our authorized catalog distributors.
   •    TED or Macnica, our authorized broadline distributors in Japan.
"
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Quote
A non AZ OP may be better behaved in this respect

What does AZ stand for?

Cristian
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
The AZ stands for auto zero.
For an alternative OP one would look for a good JFET OP with good capacitive drive capability.
Another point would be a really good phase reserve, like > 60 degrees, as there are 2 OPs in the loop.  So 45 deg. Phase reserve would already be too little.

If it would not be for the case the OPA1642 could be a possible candidate.

 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Quote
For an alternative OP one would look for a good JFET OP with good capacitive drive capability

As mentioned before, I had an earlier version of the circuit, using the ADA4891-2 opamp from Analog Devices; that one worked fine. I was unable, however, to find a JFET input opamp with a reasonable good offset voltage. That is why I eventualy selected the OP2388. However, it seems indeed that having this internal auto-calibration feature, while good for offset, is detrimental for a peak-detection circuit. I will have to select another one. I will check OP1642.

Regards,
Cristian
 

Offline Poe

  • Frequent Contributor
  • **
  • Posts: 250
1.  Linearly ramp the input signal down to 0V over 1mS.  If the output signal remains the same, the leakage isn't through the diode. 
2.  Add a DC offset to the input and see if the discharge rate changes.
3.  With the input grounded and the 'ground' pin of the capacitor disconnected from ground and instead attached to the positive rail, does the output trend up or stay low?  If it raises, it's the cap.
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Hi,
I have clarified the leakage is not through the diode. As I reverted back to the original schematic (see my third post in this thread) I disconnected the feedback of the 1st opamp from the storage capacitor. Now it can hold the charge, but the "jumpiness" in following the peak is what is not good at the moment.

Regards,
Cristian
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
During the reset phase the OP is seeing a near short. Maybe one could consider an additional signal from the reset gate drive to the OP, so that the OP does not have to fight the reset. This could be a diode + maybe series resistor from the gate to the inverting input of the 1st OP.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain




Or an LM292 is a comparator plus opamp, the only one with all the pins in the right order, :) but not very good specs. 2mV and 1MHz.

« Last Edit: March 06, 2020, 01:47:15 am by StillTrying »
.  That took much longer than I thought it would.
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
This is a good idea and I will consider implementing it. It will be beneficial for current consumption regardless of the OPAMP that I will eventually select.
I will also adjust the driving circuit so that the capacitor charge reset duration is limited and only applied briefly just shortly before the expected peak.
 

Offline brumbarchrisTopic starter

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
I believe I have found the parameter of the OPA2388 which is making it impractical for this circuit. My current guess is that it is its slew rate. It is relatively low, at only 5V/us.

The repetition rate of my signal is 1ms, so I always thought about it as of a 1kHz signal. But I've just measured the rise time of my signal and it is some 6us. That's the equivalent of a whooping 60kHz signal (considering the bandwidth * risetime = 0.35 formula). So then, it is not a trivial peak detector that I have to make (which is what I have always regarded it as), but a rather more advanced one.

I was watching this EEVBLOG video:
Dave never takes the precision variant of the circuit (demonstrated in the second part of the practical demonstration) above 1kHz, pure sinewave. That is how I can explain that a very low slew rate opamp, like the TS912 that he uses works. But here I need to look for something faster, I suppose. I guess that is why the ADA8491 opamp used to work in my older version of the circuit: it is rated as 170V/us. I can probably get away with something in-between.

Cristian
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
For the OPA2388 the limited slew rate is a a weak point. Between the operation through the 2 diodes there is a dead zone of around 1 V. So the detection is behind by something like the time it needs to slew 1 V.  However BW is also important: especially with FET input OPs the maximum slew rate is valid with a large signal at the input. So the OPA2388 with it's relatively high BW is not that bad compared to other OPs.  So the AD711 with 16 V/µs but only 3 MHz GBW would be even worse.

A fast peak detector is indeed not trivial and some 6 µs rise time is fast.

With less than 1 ms required hold time one can likely reduce the capacitor - the faster the OPs the less they like capacitive loading.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf