Category Archives: Electronics

Electronics

The 0 to 40 GHz SDR: Micro-Tel 1295+R820T USB RTL SDR

Having repaired two Micro-Tel 1295 microwave receivers recently, I noticed a IF (intermediate frequency) test port – this as a sample of the 30 MHz IF signal, from fundamental mixing of the input with the LO, for 0-18 GHz. Using 2nd and 3rd harmonics, and external mixers, the full range up to 40 GHz can be covered.

micro-tel 1295 if port

The 1295, despite its sensitivity, is actually not build for reception of real-world signal – it is an IF subsititution attentuation measurement receiver. However, this doesn’t mean it can’t be use to receive GHz signals… Recently I have been working on a 2-20 GHz digitally controlled preselector, and adding this to the 1295 will already help to get pretty much excellent selectivity.

0-40 GHz rtl-sdr using a Micro-Tel 1295

Now, a quick test: the IF test port, which is normally terminated in 50 Ohms, needs to be connected to the RTL USB SDR. To avoid overload of the RTL SDR by mirror signals, a little Micro-Circuit PBP-30+ filter was added, the silvery can, on the ESD foam, on top of the receiver.

pbp-30+ elliptical bandpass filter

This filter has a 6 MHz passband, 10 MHz 3 dB bandwidth – plenty for the USB SDR. Using a test signal at 11.02 GHz, with neither the receiver nor the source phase-locked, this is the result:

sdr at 11.02 GHz

Divisions are 100 kHz, so there is a bit of drift. But keep in mind: 0.1 MHz for 10000 MHz, that’s just about 10 ppm! – and a PLL will be added to the 1295 anyway.

After all, maybe a good idea to build a little 2-20 GHz downconverter, using a YIG pre-selector (currenty being developed anyway), a mixer and a LO (possibly using harmonic mixing). Stay tuned!

A quick look at the HP 5086-7259 YIG Oscillator: 2.0-4.5 GHz, 15-18 dBm

For a project involving an harmonic mixer, a strong and quiet – low phase noise – local oscillator is required. Looking around, I found a 5086-7259 in one of my boxes, a popular part, used in some high-quality HP test equipment.
Unfortunately, no data around, and this might also be the reason why these often go for about 50 USD on xbay.

hp 5086-7259 YIG oscillator

After some study of the circuit, here a rough schematic. It is essentially a set of Zener diodes and filter caps, plus some high-quality resistors.
The thing needs a +20 Volt, and -10 Volt supply. Not a problem – typically, this would be provided by dedicated low noise regulators, from the 24/28 V and -15 V rails common in test equipment.

hp 5086-7259 schematic (5061-5426 board)

Some measurement of the tuning current – it needs about 42 mA at 1.8 GHz (seems to work below the specified 2 GHz), and about 110 mA at 4.6 GHz – therefore, sensitivity as about 43 MHz per 1 mA.

Doing a quick calculation – setting the frequency to 1 MHz will required a DAC of about 12.5 bits resolution. Using a 16 bit DAC for the coarse tune current will be perfect, about 70 kHz per LSB; with phase lock on the FM coil.

The output power is quite substantial, about 15-18 dBm. Here, operated at the low end of the range, about 16 dBm:

5086-7259 output

Figuring out the details of the Avantek S082-0959 YIG filter

For a small job, I need to design a digitally-controlled YIG preselector (a high-performance bandpass filter), for the 12.4 to 18 GHz range. The application is related to a test rig, and only 4 units are needed – at low cost, and controllable by USB. The control will be easy enough, just a programmable current source and some parameters, but first, finding a suitable YIG is quite a challenge – either only single pieces are available surplus, or they are new, and prohibitively expensive.

Remembering some earlier work, I had a look at the S082-0959 – these were made by Avantek, and are available, scavenged from old spectrum analyzers, for about 200-300 USD each, and still have one spare around here. The S082-0959 is also known as YF85-0107, or HP 0960-0473 (pinout may vary).

To get started, first the basics need to be figured out. Tuning sensitivity, bandwidth roll-off (need at least 12 dB/octave; and >50 dB spurious).
The thing has two pairs of connections: heater (2 wires) and coil (2 wires, this sets the magentic field – the tuning, via current – not voltage – control).

Looking at some spectrum analyzer schematics – the heater needs about 28 V. And, in fact, it works well and heats up quickly, drawing about 80 mA at 28 V, less with strong coil current applied (more during heating-up).

YIG filter Avantek S082-0959

The test setup – two power supplies, a counter EIP 545A, a microwave source EIP 928, and a microwave receiver Micro-Tel 1295. Signal level was 0 dBm.
The coil supply has a 4.7 Ohm current sense resistor, I’m measuring the voltage drop to calculate the current.

For 10 GHz, the tuning current was found to be about 132 mA, about 75.8 MHz/mA sensitivity.

Measurement result of insertion loss vs. frequency –
s082-0959 yig insertion loss vs frequency at 132 mA
– note that the passband is not well captured, but 3 dB bandwidth has been measured, by manual tuning, about 25-30 MHz. Recordering accurate values is a bit troublesome, would need to phase-lock the microwave source and receiver.
There is a spurious signal, about 350 MHz above the center frequency. This I will need to investigagte further. Note that the measuement points are not arbitrarily selected, but the YIG was actually tuned for the minimum loss, and the maximum response of the spurious.

Calculating the roll-off (25 MHz assumed 3 dB bandwidth):
s082-0959 yig roll-off at 10 ghz

As you can see, when doubling the bandwidth (e.g., from 2x to 4x – don’t look to close to the center frequency), the signal is about 20 dB down. That’s close to 18 dB per octave.
Without going into theory, which can be found elsewhere, a one-stage YIG filter will give (ideally) about 6 dB per octave. So the S082-0595 is most likely a 3 stage (3 sphere) filter. Well, limited accuaracy – the YIG will be fully characterized, once things are more advanced.

The best solution, most likely: let the nonlinearities (INL) cancel out

After putting a bit more thought into this, let’s have a look again at the kind of nonlinearity observed for the ADS1211. We only know three points where there will be no error due to non-linearity: the zero point (because that will be covered by the zero point calibration), and the plus (and minus) voltage, at which the gain calibration is carrier out. The gain will be calibrated both for the positive and negative direction, simply by reversing the same calibration voltage, most likely, about 7.x volts, supplied by a LTZ1000.

Again, from the datasheet:
nonlinearity ADS1211

Now, what if we measure not just with one ADC, but with two, of the same kind, and hopefully, with the same non-linearity, but, with the polarity reversed. I.e., because of the fully differential nature, we can measure, simultaneously, the same voltage, both in the positive and negative direction. Doing this adequately should cancel out most of the (integral) nonlinearity. Furthermore, if use two independent references, for the two ADC we will also gain noise margin – because some of the noise in non-correlated and will cancel out – also, we will acquire the same signal independently, and do the averaging digitally! For non-correlated noise, this means about 3 dB gain, about half a bit!

inversion averaging ADC scheme

It only means that finally, we will need to put in 8 ADCs to measure two voltages, but, well, who cares – the given application can handle this, specialized equipment, and no relation to the total cost. And, with some luck, it will result in linearity errors of better than 1 ppm, and 7 digits resolution, with pretty fast data rates.

inversion averaging ADC nonlinearity cancellation
The solid line: non-linearity of ADC1, the dashed line – non-linearity of ADC2, both ADC are running fully synchronized, same control codes to both ADCs. Two digital outputs – and, one output will be fully inversed, directly in the ADC controller (an ATmega32L), to yield the average of the ADC1 reading, and the complementary of ADC2. Sure the difference to 0 V can also be analyzed, to check how far off the individual values are.
The ATmega32L will also do some decimation, from 60 Hz, to maybe 5 Hz or 1 Hz (independent of the mains frequency), and sent the data to the main controlled, via an optoelectronic isolator (the full ADC section design with fully floating digital and analog grounds). 1200 or 2400 baud will be plenty to get the data out. 60 Hz 6 bytes would be 360 bytes per second, about 3600 baud (need to count start and stop bit), but with decimation, we don’t need any fast couplers, etc.

Sure, this is currently an idea, and will need a closer look, but I assume, it will do the trick, at reasonable cost.
If it works out, maybe we go one step back in the final implementation – the ADS1211 has a 4 to 1 MUX, and rather than sampling simultaneously – we might just give up the noise advantage, and sample consecutively, once with positive polarity, and then, via another channel, in inverse polarity. But hey, Texas Instruments will be happy to sell a few more ADCs.

Finally, not sure if it is better to run both ADC from the same 10 MHz clock, or from separate clocks – some of the jitter induced noise might average out only, if the jitter sources are independent. So many, option, but quite easy to find out!

ADS1211 evaluation: a bit of shielding goes a long way…

Following-up on earlier analysis, the ADC performance observed at small decimation (like 1 s averages, with 60 Hz data rate – 60x decimation) left something to be desired – quite a few bits lost due to mains (and/or other) sinusoidal noise.

Look at 1 hour worth of data (60x decimated; each sample: 1 s worth of data), at higher magnification than before – ticks every 15 minutes:
ads1211 zero dec=60 noise

Obiously, there are some bursts. And these are almost certainly not related to the ADC or anything internal to the circuit. Maybe the power supply, but added quite a few decoupling capacitors…

So, if the noise source is external, a bit of shielding might help – great to have a little metal box (even a steel box) at hand!

ads1211 in shielded box

Note the 2 BNC cables – rather than one – feeding the test signals from a fully-differential source, to avoid ground loops.

ads1211 zero shielded noise

Well, not much to add! Amazing what a little metal box can do!

Studying the local characteristics of the ADS1211: ADC differential nonlinearity, missing codes

To qualify the ADS1211 for the given application, or at least, to gain some confidence in it, a test – not the for overall non-linearity (i.e., non-linearity over the full range, aka integral nonlinearity INL), but for the more detailled view at the ADC’s precision.

Local deviation of an ADC from linearity are called differential linearity, and this can be some slight deviation, or can go so far that there are even “missing codes”. A missing code is caused by a local non-linearity that is larger than 1 LSB, to the ADC will jump 2 steps, even if the voltage is only increased by 1 LSB equivalent.

First, the test setup: still the ADS1211, running at 4 MHz, 16 turbo mode, 60 Hz data rate. Connected by fully-differential coax to a (floating) source, an HPAK 8904A signal generator. This is programmed for a 5 DV output, with 20 mVpp (intentional) sine ripple, 13 Hz. The selection of the frequency is rather critical, don’t let it be anywhere close to a subharmonic or harmonic of the data rate!
The HPAK 8904A is actually really great for this purpose, you can add and mix any signals, up to 4 channels, and modulations, as desired, into one channel!

Alternatively, you could feed DC-biased noise, but these noise signals can be troublesome, and you never now what to expected in terms of amplitude, flatness, etc, unless you have really specialized gear.

Having everything set up, several hours of data were collected. Virtually no drift, so the DC component-the average ADC code (nearest integer) was subtracted from the data, and the results analyzed.

Full data, +-2000 counts is more or less +-10 mV (20 mVpp), as expected. 1 LSB is about 4 µV. There is dot for every count, even if no sample was recorded, at the given count (then, the dot is at 0 samples…).

histogr 13 hz 10 mv full

The probability density function (PDF) corresponds to that of a sine function. That’s a good start.
Some key observations – there seem to be 3 “populations” of sample counts – codes that are “0”, i.e., missing codes; codes that have counts that are somewhat in-between (the majority), and double-counting codes. This needs some more investigation.

Taking all these data, and the know PDF of sine (of the form, 1/(x*(1-x), “bathtub curve”), the PDF was fit to the data, using least squares.
histogr 13 hz 10 mv pdf fit

Green line shows the fit-this makes sense, and the residuals were calculated.

histogr 13 hz 10 mv missing counts residuals full

We are only interested in the center part, where the errors due to drift are minimal. A close up:
histogr 13 hz 10 mv pdf fit residuals closeup
histogr 13 hz 10 mv missing codes

We can cleary see a pattern: DxMMxxMMxxMMxxMMDxMMxxMMxxMMxxMMD…
D – double code, M – missing, x – intermediate.

What seems dramatic, it’s acutally not. There aren’t any deviations more than +-1 LSB, and there will be noise and averaging anyway, to get beyond even 22 bit resolution.

Noise: external and internal

A quick – 9 hour test – of the ADS1211: at 60 Hz data rate, 16x turbo mode. About 2 million samples.

According to the datasheet, every sample will yield about 22 bits noise free data, according to the datasheet (red circle shows setting used):
ads1211 effective resolution

That’s what has been obtained.
ads1211 zero code distribution

Clearly visible, higher density of codes at the left and right end. Really suspicious – almost certainly, nothing else than a bit of mains feed-through, about 175 µVrms. Seems we get >20 bits, more or less, otherwise we would not be able to see the distribution (note that some counts have a positive deviation – due to non-linearity!).
But all this, with some 60 Hz noise on top…
Assuming that this noise is constant, it can be eliminated either by futher digital filtering, or by averaging/further decimation of the data, which will be done anyway. As a rule of thumb, decimation by half will give an extra 0.5 bit of data, for random noise – and a bit more for constant 60 Hz.

Here, a quick look at the decimated data (note that the sample axis ticks correspond to 2 hours time intervals):
ads1211 zero test decimated

In these diagrams, “full scale” corresponds to 20 V – the current configuration can hande up to 60 V differential signal, at 1 LSB equal 4 µV. So there is still room for improvement of resolution, like 1 LSB equal 2 µV – but this only provides useful data, if we can get noise down well below 2 µV, which will be tough anyway.

Also, quick statistical analysis, of the 10 s average – 600 sample average data:
ads1211 dev 10 s histo

Standard deviation, 0.71 LSB equals 0.71 LSB RMS noise, equals 3 µV. Quite reasonable!
Still visible are the two maxima of the distribution, due to the mains noise.

NFB vs decimation

Comparing to a random-noise based decimation-improved resolution (noise free bits), it seems that the converter is yielding about 20 noise free bits, at 60 Hz data rate. Not quite the 22 bits mentioned in the datasheet. This is not surprising, the last 2 bits, at the fast rate, we will only be able to get this with a better, ultra low noise reference, a low-noise bias supply, and low noise analog power supply (currently using the build-in reference, and build-in bias supply, and 5 V supply from USB bus…). But fair enough, about 24 noise free bits (7.5 digits!), at 10 s averaging, and 9 hours zero point drift of less than 0.4 ppm, this might already be good enough.

Ultralinear ADC – some mathematical review

Working a bit deeper in the topic of ADC calibration, and doing some math some preliminary conclusions reached so far:

(1) Analyzing the ADC noise, requirements to suppress mains noise, and the effective number of bits available from the ADS1211, I figure that running the ADC at 60 Hz data rate would be the best choice (50 Hz in Europe, will be factory-settable in the final apparatus), and a data volume that can be managed easily. To get the best ENOB per reading, the ADS1211 is run in 16x turbo mode, 2083 decimation, 4 MHz clock (will be 16 MHz:2 later, running on one clock with the controller, just lacking a 8 or 10 MHz crystal atm).
59.98 Hz resulting frequency, close enough. For 50 Hz, we will run at 2499 decimation, and get exactly 50 Hz data rate.
With a 4 MHz clock, about 22 bits effective resolution, with 10 MHz, even 23. Not bad, but I’m sure the test setup will be a bit worse (better reference, shielding, improved power supply needed, for the analog supply -low noise, will be based on LM723 – which is actually still a very well performing circuit, and much lower noise than the common 78xx regulators).

(2) Calibrating an ADC, to, say, 21 bit effective resolution, which two million noise-free counts, 128 dB SNR, with a sine wave by generating a histogram: it will take a long time. A very long time. 60 Hz means 5 million samples a day, would need to collect readings for several day – doesn’t seem practical.

Next steps:

(1) Noise characterization, shorted, and with a somewhat noise signal – this will tell us a bit about the nature of the local non-linarities, by comparing the noise histogram, with Gaussian noise. Will also show missing codes, if any.

(2) Do an in-depth characterization of linearity for one exemplary ADS1211, might need above-mentioned improments to reduce noise effects in the test setup, and also needs low jitter clock source (current crystal should be low jitter, but might want to change to 8 MHz before going to a lot of trouble with characterization. Key question is, for the ppm-level linearity – is this locally worse at certain codes-in certain small code regions, or evenly spread over all codes, just needing a few “pin points” for a correction algorithm, to get the linearity down to 1-2 ppm level.
After review of the literature, a method of fitting sine-wave data (similar to histogram method, but rather than just counting the bins, fitting the data – voltage vs time – to an ideal sine wave, with a 4 parameter fit, and using the residuals for non-linearity estimation; fit might be done piece-wise, for big datasets, to allow for some small frequency drift of the sine source; might also cut-off the uppermost and lowermost bins, minimum and maximum voltages).

(3) Decide, based on the data of item (2) how many measurements/level will need to be measured to continuously monitor the performance and adjust correction constant. In the final system, a 16-bit ultrahigh precision DAC/programmable voltage source. Such kind of circuit can be build from discrete low-drift low-tempco resistors like Alpha Electronics MA series, and a precision low noise/low drift reference like the LTZ1000 or LM399, and a few opams, like LTC1051.
It would be fairly easy to sample these 16 voltags with the proposed 4-ADC scheme, and calculate corrections coefficients, at the 16 points, to compensate the the major part of the non-linearity.

Probability density function – calibrating the ADC: test run with the ADS1211

To further advance the ultra-linear ADC project, a little test setup has been deviced. Naturally, the final setup will require strict low noise construction, with only the best low-drift parts in the analog chain, and so on. At the moment, I just need to get to code running and tested to some kind of precision, therefore, a makeshift assembly will be good enough.

For the ADC, an Texas Instruments ADS1211 24-bit sigma-delta ADC, with a 4-channel MUX has been selected, simply because I have it around, and it has a good accuaracy to start with, about 15 ppm non-linearity, and no missing codes up to 22 bits.

A diagram from the datasheet, the non-linearity looks fairly well behaved – my confidence in hitting the 1 ppm mark is growing!
nonlinearity ADS1211

The ADS1211 is really a great part, for what it is, and for the price (about USD 25 each), and I have been using it a for a major projects in the past, 3 or 4 years ago.

The build in 2.5 V reference is not the most stable and quiet, but will do for now.
Input is configured for +-10 V bipolar, using 3.9 k-1 k Ubias resistors.
Clock frequency is 4 MHz, a sub-harmonic of the 16 MHz of the ATmega32L controlling it (again, the famouse JY-MCU board).

ads1211 test board

A simple trick for soldering SOIC parts to a 0.1″ pitch prototype board: just place the part on the table, upside down, and bend down, with a screwdriver, every second pin. It will be working just great, and no issue at all with soldering it, even if you don’t have good tools at hand.
No need at all for any special SMD boards, etc., just a waste of time, from my point of view.

Now, for a quick test, connected a sinewave (10 Hz), and sampled at a few Hz.
More cables than actual parts.
ads1211 atmega32l usb interface

With the sinewave at the input, and constantly sampled, the ADC output should resemble the sine function – however, we don’t want to analyze each measurement individually, but will collect massive amounts of data, and put them into bins – looking at the sine function, not all output values have the same probability – the values at the extremes will be more frequent, because there, the sine function is more flat than close to zero. No need to give the exact maths here, just a little diagram:
sine pdf diagram

In the final application, we will cut-off the outer parts, and just use the middle section. For today, that’s the result of a quick test:
ads1211 sine signal histogram result
Well, quite satisfactory for a start – next step will be to figure out the details (sampling rates, data transfer protocols to avoid lost samples, fast code to sort large number of samples; also, need to find out how the local varation of nonlinearity related to the larger-scale variation – by sampling for several hours…). Will all be done, step by step.
Another idea is to measure the frequency/period of the sine test signal, and using the zero-crossing as a sync pulse, to time-stamp/calculate the acutal voltage at a given time, and correlate by a least-square of similar algorithm with the ADC digital output.

Low distortion sine generator: the source of very pure waves, digitally tunable

For the ultra-linear ADC endeavour: Generating low distortion sine waves is actually, down to about -80 dB, not really a challenge. Wien-bridge oscillators will to the job. There is a related, very popular scheme – the state variable oscillator, chiefly, SVO. It is more or less just a chain of 2 integrators, an adder, and some regulation circuitry, to keep the gain at exactly 1 and the amplitude stable. It will deliver 2 signals, at 90 degrees phase shift.

For general instruction, just have a look at the schematics of the Tektronix SG5010 Low Distortion Audio Oscillator, or the marvelous HPAKeysight 8903A Distortion Analyzer. There is also a very comprehensive article in one of the HP Journals, just have a look around the web, plenty of details out there.

For the design, I selected a UAF42AP for the integrator opamps, because this part is quite handy, and an MPY634KP analog multiplier to get the gain stable. The signal level is sensed with a simple opamp rectifier, and a damped low-pass is used for the gain stabilizer (leveler). The gain stabilizer by rectification, I just put it in as a temporary fix, lacking some analog switches (DG201) that will be used in a sample-and-hold circuit.
Also the UAF42 will be replaced later, most likely with some LME49710, which are currently resting back in Germany.

The integrator time constant of both integrator are controlled by 2 multiplying 12 bit DACs, AD7543JN. This will allow (1) tunable frequency, and (2) reduction of harmonic distortion by adjusting the tracking of the two integrators, with some inevitable differences of capacitor values, and so on. The frequency tracking will be step-wise, no change of any settings during the ADC sampling period.

A little draft (let me know if you need help reading – proper schematic to come, once design is more mature), just to help you understand:
state variable low distortion oscillator draft
You can see the integrators, the resistive network of the multiplying DAC, and the output. Leveler and multiplier not shown. Both signals (0 and 90 degrees) are fed to the leveler circuit, to reduce ripple a bit. Very long time constants are needed, to avoid impact of ripple on distortion – will need to analyze, and replace with a better leveler circuit (digitally controlled sample and hold, on both the 0 and 90 degree signals). The leveler circuit will also generate useful SYNC signals for the ADCs – most likely, I will link the sampling to a multiple of the calibration signal or use the SYNC signals to discard measurements over certain portions of the sine waveform.

That’s how far things have advanced. It’s running with +-15 Volts, and 5 V digital supply, and controlled by an ATmega32L via USB. Later, I might keep the ATmega, and use this as a slave controller, via a serial bus.
state variable low distortion oscillator MPY634KP UAF42AP AD7543JN

Measurements to come. Stay tuned.