Square root circuit

Jul 01, 2015 192 Replies

You avoid temperature dependency if you use one op-amp per diode. Op-amps are pennies each. LM324's and 1N4148s are fine for this kind of thing. I suppose the breakpoints will be sharp if that kind of mathematical precision bothers you- vacuum tubes might be better for that 'tube' linearization sound.

Let's see if I still remember how to do ascii art..

Given the shape of sqrt(x), the diodes will be oriented as shown.

Vbi are the breakpoints (in terms of *output* voltage)

Slope will be 1.0 for the first segment, then Rin/(Rin +R1) for the second segment etc.

Breakpoints voltages would come from a voltage divider, so n resistors for n segments, and n more resistors for the slopes (including Rin), so 2n + n-1 + (n-1)/4 = 13n/4 -1.25 parts not counting a non-inverting output amplifier/buffer (2.25 parts), so total: 13n/4 +1 parts (where n is the number of segments) Using one quad op-amp will give you 4 segments with 14 parts.

+------ -|--+- -|___|---+--------- Vbi -------|+/ | |/| | ___ +----|___|- | Vin | Rin ............

------- -|---- -|___|---+ Vb2 -------|+/ | |/| | | | +------ -|--+- -|___|---+ Vb1 -------|+/ |/|

Best regards, Spehro Pefhany Amazon link for AoE 3rd Edition: http://tinyurl.com/ntrpwu8 Microchip link for 2015 Masters in Phoenix: http://tinyurl.com/l7g2k48

Compensating for stability will be kind of a microcosm of your control system without the power linearizer, but at least you'll have the luxury of being able to overcompensate it.

Best regards, Spehro Pefhany Amazon link for AoE 3rd Edition: http://tinyurl.com/ntrpwu8 Microchip link for 2015 Masters in Phoenix: http://tinyurl.com/l7g2k48

A very cute breakpoint amp that avoids the temperature problem was published by Bob Widlar in National AN4, long long ago. It puts a bunch of emitter followers on the summing junction, with their emitters connected by resistors to the amp's output. As long as they aren't saturated, their high beta prevents them from disturbing the SJ much. They also have collector resistors, though, and when the drop across its collector resistance puts a transistor into saturation, all of a sudden the SJ has to drive the emitter resistance, which thus magically becomes part of the feedback resistance. Very pretty.

formatting link
(See Figure 8.)

TI nuked a lot of that stuff. Some of us were ahead of the curve, and mirrorred the National site. (Not as far ahead as Widlar, though!)

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

A log might be a good enough approx to a square root. The cheapest sorta-log is a resistor and a diode.

Series R, shunt diode+R, something like that should be good enough.

Dunno about simple, but... a '555 at 12V, plus a current source, makes a 4V 100 kHz sawtooth A comparator Vloop attenuated and 4V offset generates pulses 0 us wide at Vloop = 0, and 8 us wide at Vloop = 4, so there's your pulse width modulation. So, chop the Vloop (ground it intermittently) with the comparator logic output, and average and amplify the chopped signal to make average-of(Vloop squared). Now, you need an op amp, input X and the average, and the output drives Vloop, and is also the square root of X.

...which can be subtracted out with a second MOSFET set via a reference constant current.

If your MOSFETs are well enough matched. Random BJTs are a lot closer than random FETs IME.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

Awesome, Thanks Spehro. (I wasn't seeing anything like that.)

George H.

Yeah I drew it like that the second time... (The first time I had more diodes... each "step" of the ladder got a whole new chain.)

Yup Spehro drew a nice picture for me... (A picture always helps.)

George H.

Hi Spehro, I was mucking about with the above circuit. (I understand the intent.. diodes are switches that turn on at different voltages.) I could not make it work as drawn. I was thinking I need to sum the input and reference (Vbi) voltages... Well something like down the bottom of this page.

formatting link
(I don't think I need so many diodes, and can get rid of the second opamp variable gain stage.) Perhaps there is something simpler that I'm missing?

George H.

I think the idea is that Vb1, Vb2 through Vbi are just the input through different voltage divider taps. So the opamp outputs will be Vb scaled differently before the diode drop is added.

I'm not clear on how this circuit is supposed to work really. Seems to me that the inverting input will be dealing with the interaction of the diode current with the input bias current of the opamp rather than anything well controlled. But I'm likely missing something.

Rick

Well, making a super-accurate breakpoint amp would certainly qualify for th e Porcine Cosmetic Award. ;)

Cheers

Phil Hobbs

There must be some theory to, given a curve, find the optimum location for N breakpoints, for minimum peak or RMS error.

I usually guess.

Rob just found a way to take all the standard thermocouple tables and crunch each into a short list for a simple spline fit. The biggest was

18 points. That will save us many, many kilobytes of linear-interpolation tables, or trying to eval a mess of 20th order polynomials.
John Larkin Highland Technology, Inc picosecond timing laser drivers and controllers jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
o

the Porcine Cosmetic Award. ;)

I was going to tell you to get out your lipstick... I stuck an analog multiplier in the feedback loop. Figure 6. here. (I'm not sure what the diode on the output is for.)

formatting link

Damn output (of multiplier) would just stayed high no matter what I did.

But the "new" data sheet looks different.

formatting link
f figure 15

Grumble... OK I'm going to try futzing with the offset voltage of the multi plier... that's always an issue. (Either that or I have to turn in my 'scope :^)

George H.

to

the Porcine Cosmetic Award. ;)

Well one thing about a breakpoint amp is I at least understand how it works . The multiplier has me bamboozled.

George H.

to

e

r the Porcine Cosmetic Award. ;)

pdf

tiplier...

OMG almost an entire day wasted on the analog multiplier. I got the thing to work, but it's worthless. I had to put in some big offset's so it wouldn't go wacky near zero volts. And thought I might be able to figure it out, the whole thing hangs on powe r on.

To the dust bin it goes. (nice in theory, terrible in practice.)

George H.

In my current electronically-scanned confocal microscope project, I'm using DAC-controlled VCOs with counters. I measure 20 data points across the 16-bit code space, and fit a cubic spline for the code (y) in terms of the frequency (x) (i.e. inverse interpolation). I cheat a bit and put the three lowest-frequency points a bit closer together in code space, because of the higher curvature there.

A natural cubic spline gets me within 0.025%, which is down at the level of the drift.

Splines are great--one tridiagonal solution and you're done.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

to

the Porcine Cosmetic Award. ;)

You'd presumably want to minimise the sum of the squares of the deviations between the desired curve and the linear segments.

A non-linear multi-parameter least square minimisation routine could find t he optimum location of all the breakpoints. I used Fletcher-Powell when I d id it - it was better than Marquand for my task. There have been a few othe r schemes since then.

No surprise there.

A simple spline fit does rely on a polynomial though not 20th order. Get Ro b to explain it to you in more detail. You don't lose anything new by being stupid here, but you wouldn't want to do it in front of a customer.

Bill Sloman, Sydney

Spehro, just so you don't waste time on more ascii art. I found (and protoed) a nice breakpoint amp, figure 21 here.

formatting link

George H.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required