Temperature compensate diode voltage drop in a peak detector - Page 1
Forum section: electronics / projects

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 02:14:47 pm
content: HelloI have a peak detector that detects the peak voltage drop over an external gate resistor. The circuit works right now. Its just an opamp and a diode+ capacitor as you can see, and the capacitor is discharged using the control of the actual gate voltageHowever I need to remove the temperature coefficient of the diode, when I calibrate this circuit the change in the voltage drop ruins my measurementHow can I do this? I read that most peak detector circuits that remove the diode voltage drop mean the opamp goes into saturation and is therefore always slow. I can't have this as I'm detecting peaks that occur about 200nS into a window that only lasts about 800nS.You can see in the pics I attach

author: lewis
author_rank: Frequent Contributor
timestamp: June 29, 2014, 02:26:29 pm
content: The short answer is to include the diode in the op-amp feedback loop.See my post (2nd post down) here:https://www.eevblog.com/forum/blog/eevblog-490-peak-detector-circuit/

author: dannyf
author_rank: Super Contributor
timestamp: June 29, 2014, 02:28:48 pm
content: QuoteIf your measurement is so sensitive to Vfwd variation, maybe you want to take a different approach: such a system is surely ruined by diode-to-diode deviations.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 02:32:20 pm
content: It doesnt matter what the voltage drop of the diode is as long as its the same at all temperaturesI am not concerned with the absolute value of the peak but how the peak varying, so as long as the diode behaviour is stable under all conditions it doesnt matter if its 0.6v or 0.7v etc

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 02:34:29 pm
content: Quote from: lewis on June 29, 2014, 02:26:29 pmHow would I apply this to my differential amplifier in my circuit?It would help a lot if I didnt have to include another op-amp stage

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 03:08:54 pm
content: Quote from: lewis on June 29, 2014, 02:26:29 pmI have tried the circuit you suggested but im not sure I like it. It looks like it removes the diode voltage drop but Im not sure I like the waveformIts worth noting that in LTSPICE ( my simulation) I dont think I have temperature relationships in the diode

author: w2aew
author_rank: Super Contributor
timestamp: June 29, 2014, 04:23:37 pm
content: Quote from: AQUAMAN on June 29, 2014, 03:08:54 pmThe peak detector diode D2 is still not inside a feedback loop in the schematic you show.Here's my video on the topic.

author: lewis
author_rank: Frequent Contributor
timestamp: June 29, 2014, 04:29:34 pm
content: Yeah, that waveform is a bit spiky, try adding a low value resistor in series with D2, in the range 1-10R. Try building the circuit in real life too, the spikiness might not actually be a problem. The detection is faster than the previous circuit.Or, use another diode and another ADC channel as a temperature monitor and subtract the offset from the main reading. If you need it super accurate, get a matched transistor pair (or a dual transistor array so the dies are in very good thermal contact) and make two diode-connected transistors. Substitute for your rectifier diode and the temperature sense diode.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 05:12:25 pm
content: I have thought of your 2nd suggestionThat I would somehow have another 1n4148 diode and use it to add back in the diode voltage drop. Then during calibration this should temperature compensate the peak detector diode somewhat as they will have a similar relationship with temperature.In your first circuit however is 1K an OK value for the added resistor? If I set it too high I dont get to see the variance in the peak which is what I am interested in.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 05:21:25 pm
content: Quote from: w2aew on June 29, 2014, 04:23:37 pmI have copied it from herehttps://www.eevblog.com/forum/blog/eevblog-490-peak-detector-circuit/msg254280/#msg254280My problem with the circuit in your video is that it puts the opamp in saturation and I dont think I want that. It might be fine, as I completely discharge the capacitor before I take a new measurement but I only have 200nS until the peak occurs

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 05:26:22 pm
content: I think just in general the heat generated if the opamp is driven into saturation means it isnt viable

author: lewis
author_rank: Frequent Contributor
timestamp: June 29, 2014, 05:55:14 pm
content: 1K might be a bit too high, I haven't bothered to work out the maths, but instinct tells me it might slow down the circuit's response too much. You might not catch the peaks in the time frame you're looking for. Try it!A smaller value resistor should isolate the driving op-amp from the 300p capacitive load. It's only 300 puffs though, so that should not cause instability in the real world.Driving an op-amp into saturation should not increase its heat generation.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 06:08:55 pm
content: Quote from: lewis on June 29, 2014, 05:55:14 pmI was told this but I remember building some prototypes that had an error in the PCB which caused the opamps to go into saturation and the heat generated from the opamps was too much to touch. Although it might have been just the error int he PCB.After simulating much I dont think the circuit suggestion works very well, unfortunately. Obviously it has shifted the output of my opamps but Im not sure its good for my objective which is to measure the variation in the peak rather than any absolute value

author: lewis
author_rank: Frequent Contributor
timestamp: June 29, 2014, 06:23:42 pm
content: There might be another solution which will work better for you, have a google for 'precision peak detector'. The most elegant way to do temperature compensation would be to do it in the analogue domain around the peak detector op-amp, but adding an additional ADC channel and thermal diode might be easier.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 29, 2014, 08:22:25 pm
content: Alternatively I could just buy a diode that is as fast as 1n4148 but with minimal temperature dependence, if one exists....?

author: KJDS
author_rank: Super Contributor
timestamp: June 29, 2014, 10:00:08 pm
content: Quote from: AQUAMAN on June 29, 2014, 08:22:25 pmThe fundamental diode equation has T as an exponential term. You just need two diodes, one in the feedback path.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 30, 2014, 06:08:39 pm
content: Quote from: lewis on June 29, 2014, 04:29:34 pmThis circuit appears to work much betterI think its basically the same as you suggested but I put a 2p capacitor in parallel with the feedback resistorI realised that the reason I wasnt getting the *exact* peak value from the circuit is because obviously the follower opamp doesnt follow precisely (due to its inherent offset and propogation delay etc) and so it introduces some error. THis was one of the things that was throwing me off originally with that circuitI looked around at real life examples of these circuits and this additional capacitor seems to help a LOT. I bet the resistor I would use in real life anyway would have a parasitic capacitance of 2p or something. Seems like the errors are cancelled out now in this chain. In fact before this 2pf capacitor I was getting outputs to the 'ADC' that were wildly off and the variation was also wildly off, as you can see in the previous post where I first tried this type of circuit.although I have some knowledge of op amp circuits I have almost no knowledge on all the capacitors and resistors you can put in to make them stable and smooth in real life.

author: AQUAMAN
author_rank: Regular Contributor
timestamp: June 30, 2014, 06:12:36 pm
content: However it seems that changing the value of this cap or the resistor, so the RC, can make the circuit go wildly out...I bet it is going to be a struggle to debug this in real life