Author Topic: Temperature compensate diode voltage drop in a peak detector  (Read 9343 times)

0 Members and 1 Guest are viewing this topic.

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Hello

I 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 voltage

However I need to remove the temperature coefficient of the diode, when I calibrate this circuit the change in the voltage drop ruins my measurement

How 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
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #1 on: June 29, 2014, 02:26:29 pm »
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/
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #2 on: June 29, 2014, 02:28:48 pm »
Quote
I need to remove the temperature coefficient of the diode,

If 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #3 on: June 29, 2014, 02:32:20 pm »
It doesnt matter what the voltage drop of the diode is as long as its the same at all temperatures

I 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
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #4 on: June 29, 2014, 02:34:29 pm »
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/
How 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
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #5 on: June 29, 2014, 03:08:54 pm »
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/
I 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 waveform

Its worth noting that in LTSPICE ( my simulation) I dont think I have temperature relationships in the diode

 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1780
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #6 on: June 29, 2014, 04:23:37 pm »
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/
I 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 waveform

Its worth noting that in LTSPICE ( my simulation) I dont think I have temperature relationships in the diode

The peak detector diode D2 is still not inside a feedback loop in the schematic you show.
Here's my video on the topic. 

YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #7 on: June 29, 2014, 04:29:34 pm »
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.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #8 on: June 29, 2014, 05:12:25 pm »
I have thought of your 2nd suggestion

That 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.
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #9 on: June 29, 2014, 05:21:25 pm »
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/
I 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 waveform

Its worth noting that in LTSPICE ( my simulation) I dont think I have temperature relationships in the diode

The peak detector diode D2 is still not inside a feedback loop in the schematic you show.
Here's my video on the topic. 

I have copied it from here

https://www.eevblog.com/forum/blog/eevblog-490-peak-detector-circuit/msg254280/#msg254280

My 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
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #10 on: June 29, 2014, 05:26:22 pm »
I think just in general the heat generated if the opamp is driven into saturation means it isnt viable
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #11 on: June 29, 2014, 05:55:14 pm »
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.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #12 on: June 29, 2014, 06:08:55 pm »
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.
I 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
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #13 on: June 29, 2014, 06:23:42 pm »
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.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #14 on: June 29, 2014, 08:22:25 pm »
Alternatively I could just buy a diode that is as fast as 1n4148 but with minimal temperature dependence, if one exists....?
 

Offline KJDS

  • Super Contributor
  • ***
  • Posts: 2442
  • Country: gb
    • my website holding page
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #15 on: June 29, 2014, 10:00:08 pm »
Alternatively I could just buy a diode that is as fast as 1n4148 but with minimal temperature dependence, if one exists....?

The fundamental diode equation has T as an exponential term. You just need two diodes, one in the feedback path.

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #16 on: June 30, 2014, 06:08:39 pm »
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.
This circuit appears to work much better

I think its basically the same as you suggested but I put a 2p capacitor in parallel with the feedback resistor

I 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 circuit

I 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.
 

Offline AQUAMANTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: gb
Re: Temperature compensate diode voltage drop in a peak detector
« Reply #17 on: June 30, 2014, 06:12:36 pm »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf