-
Is this opamp impedance thing?
Posted by
sw_guy
on 14 Dec, 2023 19:53
-
hello all,
May I ask probably a beginner question about opamps.
The diagram illustrates a circuit I have. V2 is 8kHz square wave and U4/U7 is MCP6024. ADC0/ADC1 is AD converter input. The diagram is slightly simplified version, but I think all the key components in terms of my question exist.
I am trying to measure peak voltage. Can't remember which video this was introduced by Dave, but the circuit if from one of the vblogs years ago. When R1 and R2 are <10k everything is fine. When R1/R2 are >50K, then ADC0 starts to fluctuate. Not much, but 10-20 bits using 15 bits AD converter. When R1/R2 are say 1k, the ADC reading is rock solid.
ADC reading fluctuate can caused by several reasons, but in this common issues like case supply voltage or ADC reference voltage seem not be issue. Fluctuating increases when R1/R2 are increased. Looking input impdedance 6024, it is very high. Should not be affected by 100k resistor the way connected on the circuit.
sw gyu
-
#1 Reply
Posted by
sw_guy
on 16 Dec, 2023 06:02
-
It was diode thing. I used MBR0520 and after a few attempts I tried 1N5819 and it works much better. Wondering if there is even better choice than 1N5819....
sw guy
-
#2 Reply
Posted by
liaifat85
on 16 Dec, 2023 07:26
-
If you're looking for a better choice, you can try with some other SCHOTTKY BARRIER RECTIFIERs.
-
-
Vcm for this opamp is 3.5V. The voltage at the top of R1 is 4.9V and U4 would have to swing its output to 4.9+Vf to operate correctly.
Even with an input of 3.3V to one of the opamps you're sailing pretty close to the wind.
I imagine that exceeding Vcm could cause excess current to flow into the opamp inputs.
I dont think Vcm is modeled
The input impedance will affect the magnitude the offset caused by a fault current.
This could appear as an offset with unknown drift.
Try potting down the inputs to get the amp in its Vcm comfort zone.
Its a good idea to use a leakage cancelation scheme. MOSFET resets are leaky.
Seen here on Daveview
https://www.youtube.com/watch?app=desktop&v=jllsqRWhjGM
-
#4 Reply
Posted by
Neilm
on 16 Dec, 2023 17:16
-
There is the possibility you are looking at the wrong thing. I have seen the input circuit of an ADC generate current pulses (due to the characteristics of the sample and hold circuit). The capacitor on the input to the ADC supplied this current pulse and lead to very weird oscillations in the reading
-
#5 Reply
Posted by
sw_guy
on 16 Dec, 2023 17:42
-
Terry:
Thank you for the detailed answer. But isn't it 3V3 on top of the R1 (referenced to ground). 1.65V (referenced to ground) between resistors is virtual ground.
Neilm:
This was my first subject to investigate but couldn't find anything related. Fluctuation is smooth variation and I was now able to identify that it was coming occasional spikes seen on cathode side of the diode. Those spikes are much smaller now when I changed the diode.
At first I tried different combinations of resistor and capacitor in front of the ADC, but it didn't make any difference.
Thank you both for answers!
sw gyu
-
#6 Reply
Posted by
sw_guy
on 28 Jan, 2024 13:56
-
Surprisingly difficult to find a good diode. I have a few 1N5158 that work well. Unfortunately details and source unknown.
I bought/tried:
1N5819HW1-7-F (super barrier)
Fluctuates (so, not exactly the same version as the ones I already have)
SMD110PLQ-TP (schottky barrier)
Fluctuates.
MBR0520L-TP
Fluctuates.
Before I start brute-force method (=buying a punch of diodes and keep on trying until I find a good one), I appreciate to receive good known options to start with.
A
-
#7 Reply
Posted by
Gyro
on 03 Feb, 2024 12:17
-
There's no need to use a Schottky diode - it doesn't look as if you need low Vf for headroom. Try an ordinary Silicon diode, eg 1N4148. It will have much lower reverse leakage current.
-
#8 Reply
Posted by
ArdWar
on 03 Feb, 2024 12:35
-
Is your circuit even stable? Certain opamps really hate direct-driving capacitors, especially large one. Try adding some small resistance (10-100R or something) to isolate the cap.
That one specific diode may have just the right V-I curve to stabilize the circuit, but I won't bet on it being consistent across devices, temperatures or other operating conditions.
-
#9 Reply
Posted by
sw_guy
on 03 Feb, 2024 12:54
-
>There's no need to use a Schottky diode - it doesn't look as if you need low Vf for headroom
This is what I've started to suspect as well. I thought that speed is a factor - and maybe it is - but not the way I assumed.
>Is your circuit even stable? Certain opamps really hate direct-driving capacitors, especially large one. Try adding some small resistance (10-100R it something) to isolate the cap.
I am, in fact, currently modifying the PCB to add resistors.
Thank you both!
-
#10 Reply
Posted by
ArdWar
on 03 Feb, 2024 13:56
-
I somehow glossed over the fact that this is a nonlinear circuit for the lower half of the signal.
Yeah like said by others the most common problem for this kind of circuit is diode reverse current leakage. Your opamp is driven hard to the ground for any input that isn't the peak, making the leakage a bigger concern. For these reason you need to use lower leakage diode and maybe avoid using Schottky. Capacitor leakage and opamp input bias current is another thing to consider.
However I still can't quite figure out what kind of possible problem you actually have here, or any problem that would manifest from altering the other end of the input in general. This opamp don't even have the antiparallel input protection diode.
-
#11 Reply
Posted by
Zero999
on 03 Feb, 2024 15:40
-
-
#12 Reply
Posted by
sw_guy
on 03 Feb, 2024 16:25
-
Great, great.. thanks. And the MBR0520L-TP has 170pF and it is the worse I tried. This clearly reflects the results.
Since 1N4148 has capacitance of 4pF can I even find a better candidate than that :-)
I changed C1 and C2 to 100nF MLCC ceramic and they worked better than 1uF ceramic. I also tried film capacitor (Panasonic
ECP-U1C104MA5) it did not work well.
Will try 1N4148 next.
sw guy
-
#13 Reply
Posted by
Zero999
on 03 Feb, 2024 19:47
-
Have you bench tested the circuit, or is it just simulation?
How about using a transistor for the diode? Try both the emitter-base and collector junctions, to see which is better.
-
#14 Reply
Posted by
sw_guy
on 03 Feb, 2024 19:52
-
>Have you bench tested the circuit, or is it just simulation?
The circuit is in use and it works fairly well.
>Try both the emitter-base and collector junctions, to see which is better.
Really :-) I have never seen this... I guess any small signal transistor like BC547/2N2222 etc. will do the job(?)
sw guy
-
#15 Reply
Posted by
Eraldo
on 04 Feb, 2024 10:15
-
If you're going to buy diodes then just buy a couple Bav199 which are low leakage fast switching dual diodes used in multimeter input protection.
It has very low capacitance (2pF from one datasheet) and has max reverse voltage of 70V
Make sure you have a good capacitor too if you want a good peak detector.
-
#16 Reply
Posted by
MarkT
on 04 Feb, 2024 18:16
-
The BAV199 is slow, and has very large reverse recovery (max 3µs @10mA). Its described as "medium speed switching", which I think just means average. 1N4148 style signal diode is what you want for fast switching (max 4ns). There are better circuits for precision rectification / peak detection that clamp the opamp output to stop it saturating (thus avoiding the large delay coming out of saturation).
There normally has to be a way to reset the peak detector too!
-
#17 Reply
Posted by
Vovk_Z
on 04 Feb, 2024 22:17
-
If you're looking for a better choice, you can try with some other SCHOTTKY BARRIER RECTIFIERs.
If he works with signals but is not designing a power rectifier then he needs small signal Schottky diodes?
-
#18 Reply
Posted by
sw_guy
on 05 Feb, 2024 16:52
-
Experiments:
I tried 1N4148. After connecting R2, output is not stable for a few seconds. After stabilized, small fluctuating exists. I added 25R resistors in front of capacitors, the circuit became stable. Fluctuating was not bad, but still worse than with unspecified 1N5819.
I tried MMBT3904 transistor (B-E) but it did not work at all. Probably it should, but I did not spend much time on this.
RC (=R3+C1 / R4+C2) of 5R+100nF stabilizes the circuit pretty well, but still the best
known diode is not yet found. (25R+100nF works as well what comes to fluctuating, but takes much longer to find peaks naturally). I also tried 50R+10nF that should limit op amp current preserving behavior, but for some reason 5R+100nF is more stable than 50R+10nF.
In the end, with unknown 1N5819 + RC circuit added, ADC readings are rock solid. I know now what diodes I will buy and try to find as good candidate as orderable version.
sw guy
-
#19 Reply
Posted by
Zero999
on 05 Feb, 2024 18:01
-
The fact it works better with the resistor is unsurprising. Adding series resistance is a well-known remedy for op-amp instability, whilst driving a capacitive load.
If the 1N5819 is working better than the 1N4148, it might be the leakage current which is increasing the stability, rather than reducing it. You could try the 1N4148 with a resistor in parallel with it, say 1M.
-
-
I have had a very hard time finding diodes with low leakage. Even FETs used as diodes with low leakage. Many FETs have lower leakage across the junction than diodes but not low enough for my purpose.
I am currently evaluating 2N4118 FETs for use as a low leakage diode. Just tie the source and drain together.
Also notice this is s symmetrical FET, the Source and Drain are interchangeable.
https://www.interfet.com/jfet-datasheets/jfet-2n4117-2n4118-2n4119a-interfet.pdf Please note that I am not stating this is your primary problem in the circuit. Adding resistances to the inputs of OP Amps is a good idea.
-
#21 Reply
Posted by
sw_guy
on 07 Feb, 2024 15:16
-
So that was the case: adding a resistor in parallel made the circuit work with 1N5819HW1-7-F (also with 1N4148, but not as good). I tried 1M and 680k resistors and 680k is rock solid.
Presumable the old stock of 5819s have leakage current closer to 1mA while the 1N5819HW1-7-F has 500uA.
Thank you everyone!
sw guy