[unfolds] #00 - Diode's square-law region - Page 1
Forum section: electronics / rf-microwave

author: RoGeorge
author_rank: Super Contributor
timestamp: January 01, 2024, 04:27:04 pm
content: Sometimes, a quick lookup for an unknown term happens to unfold a story more interesting than the main reading. Such was when I've looked up for the term 'diode square law'.The diode's square-law tells that the DC voltage at the output of a detection diode will be directly proportional with the input RF power.Typical diode detector and square-law responsePicture fromhttps://www.researchgate.net/publication/267742363_Micro-Fabricated_DC_Comparison_Calorimeter_for_RF_Power_Measurementlicense CC BY 3.0, not mineThe linearity will be very good, the square-law region spreads over many ranges of magnitude: from the noise floor up to about -20dBm, but not higher.That seemed intriguing at first, because:where did the < -20dBm limit comes from?how that a diode, that typically opens at 0.3V for Ge, or 0.6V for Si, works at all at an RF amplitude of 30mV (that is how much -20dBm on 50\$\Omega\$ is)?and how comes that the diode detector, which is a peak-voltage detector, shows a DC voltage directly proportional with the RF input power? The power is proportional with the square of the voltage (P=U2/R), not to say a diode's I/V characteristic is an exponential curve, not a power of 2.Turned out the answer is (in words, no math):the the square-law in diodes holds only at very small levels, and the errors from the ideal square-law become too large at more than -20dBm, so the -20dBm is not an absolute number, it depends of how much errors we can tolerateat less than 0.7 or 0.3V, a diode will still let some current to pass. The rectification effect (in general) comes from the asymmetry in the response curve of a device. For a diode (in particular), its exponential I/V curve is asymmetric.for the last one, how comes that a square-law response arises from the diode's exponential curve, this is only a coincidence that holds true only at very small values (and such the need for -20dBm or smaller).How small is "very small" will need a little math. The shape of a quadratic x2and an exponential excan be made to overlap pretty well in the first quadrant, when the proper offset and scaling is applied between the two functions, but only for very small values of x. An exponential curve can be written as a Taylor series. This video happens to show between minute 1:50 - 3:00 exactly that, a nice visualization of an exponential curve as a Taylor series:It's Actually Kind of a Miracle Taylor Series Work | Smooth vs. Analytic FunctionsMorphocularWhen considering only the DC output, the odd-power terms will give +/-DC values that will cancel themselves, so only the even-power terms will contribute to the DC output, x*x is always positive so the even-power terms will always add up as a DC value, no matter the sign of x.Now, for very small x values (as in x < 1), the higher the power of x, the smaller the output. Therefore, x2will be the main contributor, and the other terms of higher even powers (x4, x6, x8, ...) will have an insignificant contribution to the total DC. The sum of all even powers higher than 2 is, in fact, the error which starts to pile up when the RF input power is > -20dBm. These terms constitute the deviation from an ideal square-law response we would need in order to achieve a perfectly linear indicator where Vdc out = k * RF input power.I wanted to see that with my own eyes, so here's the measurement setup for a Ge diode:A constant 1MHz RF from a DG4202 generator was fed to the input of the Ge diode detector.The RF power was swept between -56dBm and +3dBm (in steps of 1dBm), and the DC output after the diode was measured with an mtx3283 DMM at each power level (with a Python script - DG4202 uses SCPI over LXI, mtx3283 uses MODBUS over RS232).Code:#!/usr/bin/env python3import numpy as npimport matplotlib.pyplot as pltimport minimalmodbus as mmimport vxi11import timeimport datetimeimport os# change the IP address to match the generator's IP# SCPI commands list in DG4000_ProgrammingGuide_EN.chmAWG = vxi11.Instrument('TCPIP0::192.168.1.5::INSTR')AWG_ID = AWG.ask('*IDN?')print('Found AWG model', AWG_ID.split(','))# change the COM name and speed to match the DMM setup# modbus registers list in MTX328x_NP_X03001A00_FR.pdfDMM = mm.Instrument('/dev/ttyS0', 1) # port name, slave address (in decimal)DMM.serial.baudrate = 38400DMM.serial.timeout = 1DMM.mode = mm.MODE_ASCIIMTX_type = DMM.read_register(2)print(f'Found DMM model MTX{MTX_type}')################################################### DUT specific and test specific data collecting################################################### set DMM to Vdc, manual ramge 1uV resolution, DC, 10Mohm impedancedef presetDMM():# mainNR = DMM.read_float(40960)# mainNR = DMM.read_float(0xA000) # python recognizes 0x hex integers# Sens_Func Adresse: 0x7002, 0 for VoltmeterDMM.write_register(0x7002, 0)# Inp_Coupling Adresse: 0x6000, 0: AC, 1: DC, 2: AC+DCDMM.write_register(0x6000, 1)# Sens_Rang Adresse: 0x7007, 4: 000.00 Vfs, 3: 00.000 V, 2: 0.0000 V,# 1: 000.00 mV, 0: 00.000 mV, 65535: AUTO 000.00 mVDMM.write_register(0x7007, 0)# set AWG to arbitrary waveform, 1MHz, 50ohm, -56dBm, CH2def presetAWG(f):AWG.write(':OUTPut2 OFF')AWG.write(':OUTPut2:LOAD 50')AWG.write(':OUTPut2:SYNC OFF')# AWG.write(':TRACE:DATA VOLATILE, 0')AWG.write(f':SOURce2:APPLy:SINusoid {f}')AWG.write(':SOURce2:VOLTage:OFFSet 0')AWG.write(':SOURce2:VOLTage:UNIT dBm')AWG.write(':SOURce2:VOLTage:AMPLitude MINimum')AWG.write(':OUTPut2 ON')print()# ask for measurement setup infoprint('Please type the test settings')# diode modeldiode = input("Diode type? (text): ")# test frequencyf = input("Test frequency? (Hz): ")# dBm test rangedBmin = input("Start testing from? (-56..+3dBm): ")dBmax = input("Stop testing at? (-56..+3dBm): ")# commentscomment1 = input("Notes about this measurement? (text): ")# diode ID and storage placecomment2 = input("Notes about the diode, location or ID? (text): ")presetAWG(f)presetDMM()allVdc = []alldBm = []# put DMM on manual 00.000 mV rangeDMM_range = 0DMM.write_register(0x7007, DMM_range)# the test loopfor dBm in range(int(dBmin), 1+int(dBmax)):# set AWG levelAWG.write(f':SOURce2:VOLTage:AMPLitude {dBm}')# wait for the DC out and for the DMM to settletime.sleep(3)# read the DC indicated by the DMMVdc = DMM.read_float(0xA000)print(f'{dBm:3} dBm sinusoid, detected V={1000*Vdc:6.3f} mV')if DMM_range == 0 and Vdc > 80e-3:DMM_range = 65535DMM.write_register(0x7007, DMM_range)# store the measurementallVdc.append(Vdc)alldBm.append(dBm)# timestamptoday = datetime.date.today()timestamp = today.strftime('%Y-%m-%d_%H:%m')# save to disknp.savetxt(f'{timestamp}_Vx_out.csv', [p for p inzip(range(0, len(alldBm)),alldBm, allVdc)],fmt='%3d, %f, %f', delimiter=', ', comments='', header='#, dBm, Vdc')np.savetxt(f'{timestamp}_dBm_in.csv', [p for p inzip(range(0, len(alldBm)), alldBm)],fmt='%3d, %f', delimiter=', ')os.system(f'cp {timestamp}_dBm_in.csv dBm_in.csv')np.savetxt(f'{timestamp}_Vx_out.csv', [p for p inzip(range(0, len(allVdc)), allVdc)],fmt='%3d, %f', delimiter=', ')os.system(f'cp {timestamp}_Vx_out.csv Vx_out.csv')with open(f'{timestamp}_d_info.txt', 'a') as note:note.write(f'{diode} type diode\n')note.write(f'Test frequency: {f}\n')note.write(f'Test level range: {dBmin}..{dBmax}\n')note.write(f'Additional notes: {comment1}\n')note.write(f'Diode identifier: {comment2}\n')# turn offAWG.write(':OUTPut2 OFF')DMM.serial.close()AWG.close()# plotplt.plot(alldBm, allVdc)plt.yscale('log')plt.show()And these are the measured values (CSV data files and Python code to plot themattached in the zip file):The logarithmic Y axis shows the linearity of the Vdc vs RF power in (the red plot) is pretty good up to about -15dBm input. When the RF becomes higher than about -15dBm, the slope starts to change visibly.To observe the slope better, another blue trace was plotted as the derivative of the red plot. Apparently the blue trace is very jumpy at less than -40dBm, but that is because of all the measuring errors and noises. The diode detector was shielded inside a metal can, but still, -50dBm means less than 1uVRMSon 50\$\Omega\$.Some commercial RF power probes (based on the diode's square law region) might take the extra step, and apply calibration corrections to the output DC value, in order to extend the linearity at higher RF powers, and for a wider temperature range.

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: January 01, 2024, 05:21:28 pm
content: Nice write-up! To add a couple of points:The 50 ohm resistor is misapplied - you need a DC path to ground for the diode so you would use a choke/inductor instead.The detector presents a poor match to the signal source, so if you want better sensitivity, you'd include a matching network.Practical detector implementations that work at VHF and above use schottky barrier diodes rather than junction diodes, since they respond a lot faster than junction diodes due to lack of minority carrier recombination.SkyworksandKeysighthave some good app notes on RF detector diodes.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 01, 2024, 06:27:53 pm
content: I like that center-less ZIF socket idea.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 02, 2024, 08:57:12 am
content: Quote from: radar_macgyver on January 01, 2024, 05:21:28 pmThe writing was just beginner's enthusiasm, but thank you. Thanks for the AN links, too, read them yesterday.About the input resistor, I'm not sure what is wrong there, so I will lay down what was my reasoning when I've added it, in the hope to find out.The 50\$\Omega\$, between 'in' and GND in the test setup, was added to match the impedance of the generator and the cable (there is a 1.5m - about 5 feet - 50\$\Omega\$ BNC cable between the generator and the shielding can, so I've added 2 of 100\$\Omega\$ in parallel on the BNC in connector, inside the can).Side note, sorry for the messy/sloppy wiring inside the can, I was dying to see how well the square-law holds for ordinary diodes.My thought about the input resistor was, that If I don't match the cable's impedance, then the diode will see peaks and troughs in the RF amplitude (from the reflection caused by any standing waves that might appear in an unterminated cable - I was assuming the diode's Z >> 50). Since the diode is a peak detector, the DC indication will be higher than the power-out from the generator. It will indicate the peaks of the standing wave instead of the RF power.Then, I've assumed the same 50\$\Omega\$ input resistor can also play the role of a DC path to ground, for the diode. I was expecting the impedance of the diode + measuring DMM to be much higher than the 50\$\Omega\$, though I didn't measure or estimate that in advance.Isn't the 50\$\Omega\$ small enough as a DC path to ground, or is it something else?

author: joeqsmith
author_rank: Super Contributor
timestamp: January 02, 2024, 02:25:17 pm
content: I was guessing they did not consider the DC path of the measuring device for the peak detector. The original paper appears correct.I posted something similar a few years back in response to someone asking about using a DMM to measure RF. Played a bit with a few diodes and did not terminate the detector.https://www.eevblog.com/forum/rf-microwave/measuring-frequency/

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: January 04, 2024, 07:03:31 am
content: Quote from: RoGeorge on January 02, 2024, 08:57:12 amI hope I didn't say something to dampen the enthusiasm - I seem to have a knack for that.Anyway, the 50 ohm resistor will match the cable and generator, but only if the diode is an open circuit with infinite impedance. In reality, the diode will have an impedance that changes somewhat with the voltage across it (and ultimately, due to the incident RF power). This can be calculated but it makes more sense to measure it, and then design a suitable matching network for the frequencies of interest. You could also use a transformer for a broadband match. Or just live with the mismatch if you want high bandwidth. In all three conditions, you'll need a DC return path for currents flowing through the diode, a choke/inductor will do this without affecting the RF matching.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 04, 2024, 09:01:34 am
content: Indeed, there was no attempt to match the diode, so the 50\$\Omega\$ at the end of the cable was used both as a cable terminator and as a return DC path for diode. I've assumed the diode's impedance is big enough, so it won't alter the voltage on the terminator.I was looking at the diode detector as a device sensitive to the voltage present on the terminator. After all, the diode detector doesn't really tell the power in the terminator, it tells the V2. I mean, the detector's Vdc out is proportional with the V2alone, and has no clue about the current through the terminator or about the power dissipated in the terminator.The Vdc out can be marked in units of power only because the terminator is assumed to be a well known value, and constant. But if the generator + terminator network were to be changed with, for example a 600\$\Omega\$ instead of 50, then the diode wouldn't know, and the Vdc out would still tell the V2in only, not the Pin.Now I'm curious how much better would have worked with a matching network for the diode, thanks for pointing that. Though, I have virtually no RF equipment, other than an AWG and an oscilloscope. Will have to improvise and count on the beginner's luck.

author: iMo
author_rank: Super Contributor
timestamp: January 04, 2024, 09:15:29 am
content: I've messed with the detector in past (before I got the AD8307 in hands) and recently with the 100W power meter (there is a thread about it)1. 50 ohm at the input is ok2. the best diode I found in my junkbox is the 1N5711 (I have tons of germanium ones as well, but the 1N5711 works till 70cm fine)3. the capacitor at the diode's output should be a smallest pF value applicable4. the meter should be with at least 10Meg input5. sometimes people use to use a small forward bias current (like 1-10uA) to increase the sensitivity at lowest input dBs

author: RoV
author_rank: Regular Contributor
timestamp: January 04, 2024, 05:23:22 pm
content: These are two schottky-diode detectors that I built more than 20 years ago, both with the same schematic as the OP, but using small SMD components to reduce parasitics:The 1st is based on a zero-bias Schottky diode, an hp HSMS-2851 (the 50R resistor is not visible under the diode)The 2nd is based on a mixer Schottky diode, a pill ~1x1 mm (diode is vertical and there are 2x100R resistors in parallel)The HSMS-2851 is for lower frequency, less than 2 GHz, but is much more sensitive than the other diode.Today I have tested the 1st with my Marconi 2019A @ 500 MHz and the multimeter in mV DC scale. Results are:You can see that the square law is followed acceptably well from -50 to -14 dBm. Actually, I got slightly less than 10x voltage with 10x power, or 10 dB increment. The red-dotted is a straight line interpolated from the measurements up to -14 dBm.Follows a manual fit with exact square law line, assuming some measurement error on the low-voltage side. The previous one looks better to me.

author: switchabl
author_rank: Frequent Contributor
timestamp: January 04, 2024, 06:09:01 pm
content: Quote from: radar_macgyver on January 04, 2024, 07:03:31 amIn this configuration (zero-bias) the low frequency resistance of the diode is in the kOhm range (potentially tens of kOhms), along with a junction capacitance of maybe 1pF (point-contact diode?). Looking at the construction, I don't think this is intended to be used at frequencies where the mismatch from the diode is an issue. DC current flows through the multimeter, you generally want to load this kind of detector as little as possible.To be fair, when I originally saw this circuit (probably in a HP app note), I think my first reaction was "wait, this looks all wrong". But this isn't supposed to be a normal diode detector. A normal diode detector isn't biased for square-law.

author: iMo
author_rank: Super Contributor
timestamp: January 04, 2024, 07:35:49 pm
content: On the DC bias..

author: G0HZU
author_rank: Super Contributor
timestamp: January 04, 2024, 08:58:57 pm
content: A classic diode detector for this stuff is the old HP 8473C low barrier Schottky diode detector. There are a few datasheets and app notes online about this detector and these describe its operation down in the square law region.The HP 8473C works up to about 25GHz with a very flat frequency response. The input VSWR is very low as well across a huge bandwidth. I've got one here and use it fairly often for RF levelling checks of my test gear and power meter heads.I had several goes at making a cheapo version a few years ago and had reasonable success up to about 1GHz. I used two 100R SMD resistors at the input and there was no bias choke involved. I think the HP 8473C uses a 50R input as well.The response of my homebrew LBSD detector was quite flat to 1GHz and the return loss was about 30dB to 1GHz. It had a very similar detector response as the HP 8473C down to -50dBm. However, it can't come close to the performance of the HP 8473C up in the microwave bands. My homebrew detector still 'works' up to about 6GHz but the frequency response is not flat anymore.

author: G0HZU
author_rank: Super Contributor
timestamp: January 04, 2024, 09:38:29 pm
content: My homebrew detector has about the same detector performance as the HSMS-2851 diode used by RoV. I get 257mV at 0dBm and 20uV at -50dBm from my detector. It works quite well when measuring the average power of noise and modulated signals as long as I keep well below -20dBm.The square law performance is fairly good over the range of -25dBm to -45dBm. The HP 8473C is slightly better in this respect. I can't remember what diode I used for my detector, but it was a LBSD. These are very easy to damage with overload.I've still got my Avago designer's sample kit for RF diodes (see sample book below) and there are quite a few detector diodes in the kit. I keep meaning to have a play with some of them.