Distributed attenuators

Hi, All.

So I have this gig building a cathodoluminescence system for use in electron microscopes. It needs a programmable-gain amp with about 0.2 dB steps, low noise, and a bandwidth of > 40 MHz.

A previous voltage-controlled amp board for a biomed customer used a

256-step dpot and a power-of-two PGA made from a 74HC4051 MUX and a resistor string. Except at the very lower limit, the dpot's attenuation is never more than 6 dB, which helps the noise a lot.

A little Cortex M0+ (LPC804) measures the control voltage and sets the dpot and PGA. It has a calibration loop that executes in a second or so at boot-up, so everything is kept relatively copacetic and accurate.

Thing is, its BW is limited to less than 1 MHz by the dpot, and depends on the dpot setting, so there's no straightforward way of compensating. Thus there's no way it's ever getting to 40 MHz. For this one, I wanted to use a distributed attenuator--an RC ladder network with switches in the shunt legs, like this:

In 0-*--Rser1---*---...---*--RserN---* ---------*---0 Out | | | | | *--Cpar1---* *--CparN---* Cload | | | *-----* *-----* GND | | | | Rsh1 Csh1 RshN CshN | | | | | | | | *-----* *-----* | | | | SWITCH Csw SWITCH Csw | | | | Rsw | Rsw | | | | | *-----* *-----* | | GND GND

The math for this is fairly ugly, so I coded up a smallish C++ program to optimize it, using the Nelder-Mead downhill simplex method (amoeba in Numerical Recipes, 2nd Ed.).

The penalty function for the optimizer is a linear combination of the accuracy of the steps (mean error over frequency) and the rolloff, with an adjustable constant setting the balance.

Turns out that with fairly garden-variety CMOS bus switches (5 ohms, 3.5 pF Coff) I can do a 4-bit distributed 0-6 dB attenuator with RMS error of a couple of tenths of a percent over the whole range. (There are better ones, but few I know of work above 3.6 V.)

I made some effort to include realistic strays in the analysis, so I expect it to work pretty well.

Fun.

Cheers

Phil Hobbs

(If anybody has a similar problem, I'll happily share the code.)

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs
Loading thread data ...

That's interesting Phil, Can I ask how you figure out what capacitor values to put in parallel with each resistor?

George H.

Reply to
George Herold

Hi,

Is this circuit replacing the PGA itself? Seems a bit like a DAC, but instead of a +5V rail powering it, you are feeding it a signal maybe, and thus need to compensate for non linear output. I guess only 2 of 4 switches are shown.

cheers, Jamie

Reply to
Jamie M

It starts with some given guess, generates random guesses with a standard deviation of 20% or so, and runs the optimizer. Nelder-Mead is an unconstrained optimizer, so to prevent it converging on unphysical values, I use a mirroring technique.

If C < Cmin, I replace it with Cmin + |C-Cmin|.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

The program will work for any number of sections. There's a dot dot dot in the middle of the ASCII art. ;)

It's a programmable attenuator rather than a DAC--the signal input is at left. The switches have no significant nonlinearity.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

Lots of people make logic-programmed RF step attenuator chips. Can you work at 50 ohms?

You could also maybe use an analog multiplier and a DAC. AD835 is nice. We're using that in our simulator of an eddy-current blade tip sensor.

CMOS bus switches are great analog multiplexers, but priced about 1/20 of an official analog mux. FSA3157 costs 6 cents.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Not easily. Also none of those I know of go in such small steps--6 dB/16 = 0.375 dB. The idea is to make a tolerable mimic of a continuous control, without trashing the noise performance. A 6-section attenuator would be down below 0.1 dB/step. It would be a lot easier to do with relays, but that would take a lot of power, space, and cost. This gizmo will come in way below $1 BOM cost, counting just the attenuator and switches.

Transconductance-based devices are super noisy at low gains. Your average analog multiplier is 60 dB noisier than a good op amp. The AD835 superficially appears better (1-Hz noise of 50 nV vs. 1-2 uV for a MPY634), but its noise is only specified at zero gain in both arms! (Vx= Vy = 0)

Right, that's a similar part to the one I'm thinking of using. 5 ohms,

3.5 pF. (I found it in AoE.)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

The easy multiplier for 40 Mhz is probably a Gilbert cell; all you need is a controllable current source for the emitters. That's easy for signal bandwidth, but slightly harder for attenuator-level bandwidth, but you can get free gain and differential outputs.

Reply to
whit3rd

And horrible, horrible noise at low gains.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

Huh, OK, so getting the C's right is the hard part. I'm sure you know the nice RF attenuator strips, blue with funky knobs on the toggle switches... at least that's mine, great on the output of my sig gen.

So how do you make your initial guess? Equal time constants every where?

George H.

Reply to
George Herold

I started with a 1-section, 0.4 dB switchable attenuator, then made four identical sections in a row for one guess, and just randomized the other vectors in the simplex. Something like

Csh[i] = Csh[0]*(1.+0.2*(rand()/double(RND_MAX) - 0.5)); // it was a bit more intelligent than that, but that's the gist.

The capacitors on the series legs turned out to be right near the minimum of 0.05 pF that I put in manually (that's approximately the parallel capacitance of an 0603 or 0805 resistor). The shunt legs wanted something up around 1.5 pF.

My initial idea was to allow the attenuation values to be all over the place in the code space. That is, changing from -3.0 to -3.4 dB wouldn't necessarily involve toggling the LSB. That was implemented by computing all the gain values and then sorting them before applying the penalty function. Turned out that the small gain wasn't worth the agita.

I'll let everybody know how it works.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

Fun, thanks for sharing! And do let us know how it works. You'll probably learn more about stray capacitance. :^)

George H.

Reply to
George Herold

I'm curious: if you can tell me, what is the signal source, i.e. is it a current or voltage, what sort of source impedance, amplitude? And what is the load? Do you only need 6dB range?

I did a few PGAs for cellphone transmitters, both at baseband and at RF and also a thing that pretended to be an analogue VGA but really used a

1dB stepped attenuator and a VGA stage to fill in between these steps, with some hysteresis on the stepped attenuator.

One of my preferred techniques for a baseband PGA was to convert the input signal to a current and feed it into a digitally-chosen tap on a resistive ladder - you can use R:2R for ~6dB steps and R:75R (or R/5:15R) gives 1dB steps. With the input signal being a current, the resistance and nonlinearity of the switches didn't matter much so they could be small. I forget how I did the 1/32dB steps, maybe just a linear scaling of the gm of the stage that fed the signal current to the ladder, as linear is a reasonable approximation over 1dB range. Those things are fun on a chip, with well matched resistors being very cheap.

You could also add 0.2dB steps by making the terminating resistor at one end of the ladder have some taps, and select one of those taps to your output, but then switch resistance for those taps would matter.

If you are filling in between 1dB steps using a VGA, that can be done in a reasonably low-noise way because you can have two signal paths, one path that is always there with a gain of 1, and a path that goes through a VGA, with a gain of between 0 and 0.122 - since you can always attenuate the signal that has been through the VGA part, its noise voltage should also get attenuated, making it not terrible anymore.

Reply to
Chris Jones

It's coming from the front end, and will probably be a CFA.

The following stage is a noninverting amp built from an HC4051 and a string of resistors, wrapped round something like an OPA695, with gains from 1 to 32. There's a micro on the board, so we use that to get rid of the offsets.

Right, that's the idea. The problem with transconductance devices is that you have to divide the signal down to something the transconductor can cope with, e.g. +- 60 mV, and that trashes the SNR. They're great at high gain.

The application here is photomultiplier replacement, and one of the things people like about PMTs is that you can vary the gain continuously.

As long as you only care about the ratios, of course. ;)

Interesting idea, thanks.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

You can't do it with just resistors and switches? 40 MHz isn't very scary.

We sometimes use a trimpot to calibrate the gain of o/e converters. Some of the smaller pots are good to about 2 GHz.

Some people and organizations are adamantly opposed to trimpots. Sometimes they are just what you want. They don't need a lot of code support.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

Trying to keep the bandwidth constant is one of the goals, as well as maintaining a reasonable input impedance. I could use pHEMTs or relays to do the switching, which would be about a factor of 10 easier, but as you say, those bus switches are pretty attractive.

And besides, my ideal project is building a computer from sand. ;)

Like any time you want to go faster than a few hundred kilohertz. :(

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

Hi,

To build a computer from sand: first idea: melt some sand into an hourglass and fill it with sand, then that is the system clock.

More serious idea:

use nuclear reactor type doping of pure silicon crystals (from sand of course). However to avoid lithography, use a nuclear decay source which can precisely dope the silicon crystal in 3D. So this way the doping can be done to form internal transistors/fets within the 3D crystal by using a precision decay source. Perhaps one of the sunken Russian nuclear subs could be used however since they are sunk in peacetime they probably don't have very precise anything.

cheers, Jamie

Reply to
Jamie M

No, really, some are usable to 2 GHz.

Some have weird convoluted internal structures, lots of distributed L and C.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

I agree that screwdriver pots can work at UHF--it's the digital ones that crap out early. MDACs are about as bad.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

Thanks. Is the CFA stage in turn taking its input from a TIA with photodiode? (only if you are comfortable discussing this)

If so, do you do some gain control by changing the feedback resistor? (I imagine that this would give the lowest noise but I can't think of a way to do it without the parasitic capacitaince being annoying.)

Thanks.

Yes fair enough.

The one transmitter IF stage that I did with an analog VGA stage used two MOSFETs as the input devices. Two, because like most circuits on chips it was differential. The MOSFETs were operating in the triode region so that the AC input signal on the gates could be fairly large. The sources of those MOSFETs were grounded directly, and the drains were each cascoded with an NPN bipolar transistor. We did the gain control by adjusting the base voltage of the bipolar devices, which adjusted the D-S voltage of the MOSFETs. It was only practical because we could make a bias circuit using devices that matched to the ones in the signal path, but for discrete devices that would be hard, and small enough MOSFETs to get a low enough gm are not readily available as discretes. It wasn't especially low-noise, but probably a bit better than the usual multiplier circuits, above the 1/f region.

Yes, it was important to use the same resistor material in the gm stage that drove the attenuator. I generally used unit resistors where I needed matching. I didn't have a good feel for what would happen to the matching if I didn't, and it was a nice challenge, and an excuse to write some scripts to figure out the best configurations of unit resistors.

I now remember that to make the fine steps over a

Reply to
Chris Jones

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.