Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Analog Square Root Circuit/IC

Status
Not open for further replies.

dknguyen

Well-Known Member
Most Helpful Member
Is there a circuit whose output voltage is the square root of the input voltage? I think I might use with an analog summer and three AC pass filter caps on a 3-axis accelerometer to calculate the norm of the dynamic acceleration to calculate vibration, since the uC is going to be busy integrating other things.

EDIT: FOund an ugly 4-op amp one.
https://socrates.berkeley.edu/~phylabs/bsc/PSpice/OpAmps/OpAmps.html

Thinking about it some more, I probably could take more load off the processor by running the AC norm through the RMS converter on that webpage, since that is more useful for vibration measurement than the raw signal itself. Unless I'm mistaken, that would allow me to sample the signal more slowly than the raw signal istelf, and still get the peak vibration data needed since I need not capture the image the waveform...right? But...so ugly!
 
Last edited:
hi,

The National Semiconductor Application Note 31, has some interesting maths opa configurations.
 
You could use a logarithmic amplifier, a 6dB attenuator, and an anti-log amplifier. Would that work?
 
Papabravo said:
You could use a logarithmic amplifier, a 6dB attenuator, and an anti-log amplifier. Would that work?

Za? lol What would that do?
 
Take the square root of the input. Work it out. If you can put the three functions together that's the result.

Edit: OK, I'll do the math -- quick what is
Code:
exp [ 0.5 * ln(Vin) ]
Isn't -6 dB the same as a gain of one-half?
I've always believed that if one must be obscure - he should be obscure clearly!
 
Last edited:
Ah, crap I just realized I forgot I had to square every term before it goes into the summer. This is getting messy.
 
Papabravo said:
Take the square root of the input. Work it out. If you can put the three functions together that's the result.

Edit: OK, I'll do the math -- quick what is
Code:
exp [ 0.5 * ln(Vin) ]
Isn't -6 dB the same as a gain of one-half?
I've always believed that if one must be obscure - he should be obscure clearly!

I thought -3dB was one half? Maybe that was only for power, and for voltage and current it is double that.
 
Last edited:
Hi Dknguyen,

dknguyen said:
Ah, neat. What does the four quadrant mean exactly? I've heard that term used in TRIAC switching but don't understand how it applies here (if it means the same thing at all).

Four quadrant operation means that the input voltage to any X, any Y
and any Z input can be either positive or negative irrespective the
polarity of the signal(s) applied to the other input(s).
Suppose you've got a multiplier that has only two inputs, X and Y.
If the voltage applied at the X input can either be positive or
negative while the voltage applied at the Y input is only allowed to
be positive this would mean two quadrant operation.

on1aag.
 
dknguyen said:
I thought -3dB was one half? Maybe that was only for power, and for voltage and current it is double that.
Right
Code:
Power Gain(Loss) = 10 * log(Pout/Pin)
Voltage Gain(Loss) = 20 * log(Vout/Vin)
Have we beaten this poor little point into abject submission yet?

CVS - (Chuckling Very Softly)
 
Do you actually need the square root? Usually that doesn't even need to be calculated.

Say you want to know if the RMS value of 16 samples is greater than 25.

Square each sample and add to a sum. (25^2) * 16=10000, so if your sum is greater than 10000, then you know the RMS value is greater than 25 without ever having to perform a square root function or even a divide (although div by 16 is a quick bit-shift).

Take care that your summation register cannot overflow, at least not without getting flagged in the code.

dsPICs have some neat functions in this area. There's 2x 40-bit accumulators and a single instruction can take a register, square it, and add it to the accumulator. At 40-bits, it's hard to overflow, but there is even a "soft overflow" mode where instead of rolling over into negative numbers it will saturate and stay at its max value and set a flag when you add too much to it. Basically that would be like having an 8-bit singed int at 125, signed add a 15 to it, and the result would be 127 instead of an erroneous... what... -113 I think.
 
Have you thought about using a microcontroller?
 
I have one, but it would be very busy taking care of other more time sensitive tasks. This vibration polling is not time sensitive in the sense that it doesn't matter too much when I check it at while other tasks do so I wanted to see if I could offload it somehow. What Oznog said would work. It's just really checking the vibration threshold of the vehicle to help it know if it's going too fast for the terrain it is on.

It's pretty hard to overflow if you are just adding a maximum of 5000mV per addition, hehe.

It's more important that I get the norm right now though than the actual RMS value- that was just trying to make it so I would have to check the actual value less often. THe place where all the cycles are crunched up is the squaring and square rooting- though I suppose I don't actually need to take the square root.

I don't think your idea works for something like
N = (x^2 + y^2 + z^2)^1/2
 
Last edited:
Probably the easiest way to offload it and get arbitrary precision is to send the input data to another micro.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top