Log/antilog amplifiers to multiply two voltages from single supply. - Page 1
Forum section: electronics / beginners

author: s3c
author_rank: Contributor
timestamp: July 14, 2011, 01:26:20 pm
content: I'm trying to multiply two voltages together using log/antilog amplifiers. The idea is to log the two voltages, add them together and then antilog them, I have it working with ideal op amps but can't seem to get the single supply version working. Here's a screenshot of the ideal:I was hoping I could just replace all the grounds with a virtual ground for the single supply version but this doesn't work, the antilog stage fails if I do this and I don't really know why:I've attached the ltspice files in a zip, I'd appreciate if someone with a little more experience and insight could take a look.

author: scrat
author_rank: Frequent Contributor
timestamp: July 14, 2011, 01:32:30 pm
content: At a first look, it seems the diode is off, since adding a positive voltage you're polarizing it backwards.If it's for a real application, some time ago Dave posted about a limitation opamp (or a similar name) from AD, which could be easily used to make a "linear" multiplier. Is this an option?

author: s3c
author_rank: Contributor
timestamp: July 14, 2011, 01:42:22 pm
content: I was hoping to use it as a power monitor where I got a proportional output signal by multiplying two voltages representing current and voltage. Alternative sollutions are fine but on the other hand I'd like to know why it doesn't work as well. I've measured the voltages over the diodes for both cases and they're fairly identical.

author: Floyo
author_rank: Regular Contributor
timestamp: July 14, 2011, 02:16:35 pm
content: If you don't want to build the whole thing yourself you could have a look at the AD633, it's an analog multiplier with fully differential inputs so measuring from different grounds isn't a problem. I've used it in a prototype spectrum analyser for a school project, and it works just fine, much better then RF multipliers (NE612). The problem with diy log amps is that they need to be temperature compensated and the diodes need to be properly matched otherwise they become inaccurate, there's a paragraph on that in the art of electronics somewhere.

author: scrat
author_rank: Frequent Contributor
timestamp: July 14, 2011, 02:22:22 pm
content: Quote from: s3c on July 14, 2011, 01:42:22 pmDo you mean the antilog diode is forward biased? It doesn't seem so, since current should flow on the reverse direction, to have a positive output on the opamp.

author: s3c
author_rank: Contributor
timestamp: July 14, 2011, 02:55:56 pm
content: @FloyoI did consider using a premade sollution but they're a lot more expensive and not as easy to get your hands on as normal op amps are. As for being inaccurate, I suspected as much but it doesn't really matter, I'm not doing anything that needs high precision and would prefer a cheap sollution.@scratIn both circuits the antilog diode is forward biased and the voltages are pretty much identical, Here's a screen of the ideal:And of the single supply implementation:Could you give a link to the "limitation opamp" you mentioned?

author: s3c
author_rank: Contributor
timestamp: July 14, 2011, 04:31:59 pm
content: Just figured out that part of the problem was that the antilog stage was clipping because the input to the stage was too big, I'm having some problems with linearity of the output atm but with some luck I can fix this by tweaking the resistors of the log/antilog stages.Has anyone here ever tried building a voltage multiplier that wasn't premade?

author: Unknown
author_rank: Unknown
timestamp: July 14, 2011, 04:55:02 pm
content: A better approach is to use an IC that employs a 'Gilbert cell'.I have designed a log amp, but no antilog or multipliers based on that.I would first look into optimising (or maybe even making them work) the log and antilog circuits before doing any signal processing in between. For example, silicon diodes give very poor log conformity i.e. everything else perfect the output is not the log of the input. Transistors in the transdiode configuration or diode-connected are much better. And there will be severe output drift due to temperature variation. In a real circuit you would be looking for diodes with matched saturation currents. These circuits are also working with current, not voltage. You can use a resistor an treat the other terminal as ground, but you must consider offset voltages and bias currents (BJT opamp), especially with such large resistors.I would suggest you hit the library and revisit log amps and, possibly, op-amps. A good book is:A J Peyton and V Walsh. Analog Electronics with Op amps: A Guide to Circuit Design. Cambridge University Press:1993.And if you have a question for the author I can go next doors and ask him for you!There is also an old book from Analog Devices back from the days of analogue computers.

author: s3c
author_rank: Contributor
timestamp: July 14, 2011, 05:48:55 pm
content: @AlexThanks for the tips Alex, I'll go read up a bit (esp transdiode & diode-connected). I kinda got the circuit working but the performance for small input voltages is pretty bad:I'm hoping this will still be viable, It could work if I avoid low voltage inputs but I'll have to test it a bit. All the premaid chips are 20X more expensive, on the other hand I guess you get what you pay for.

author: Unknown
author_rank: Unknown
timestamp: July 14, 2011, 06:01:42 pm
content: Do consider the AD633, it is very economical.

author: johnmx
author_rank: Frequent Contributor
timestamp: July 14, 2011, 07:21:11 pm
content: I’ve done that in my project:Constant Current Dummy Load.The analog multiplier is pretty easy to implement. Read the circuit description.The circuit can be powered by single supply. Just limit the signals (input and output) in the linear range. Off course you need to raise the voltage level of all non-invert inputs and the base of all transistors.I can send you that circuit for LTspice IV, just PM me.https://www.eevblog.com/forum/index.php?topic=2487.msg33809#msg33809

author: Unknown
author_rank: Unknown
timestamp: July 14, 2011, 08:44:25 pm
content: Here are some scans from the AD handbook I mentioned, title is nonlinear circuits handbook - designing with analog function modules and IC's. Not sure if you can find it online or a newer revision, this one is from 1976. The scanned pages give a derivation of the ideal output of the circuit shown. Multipliers have two chapters across 80 pages or so in this book alone.

author: Zero999
author_rank: Super Contributor
timestamp: July 14, 2011, 09:14:00 pm
content: How fast does this need to be?What about doing it digitally?If you're using a microcontroller anyway and it doesn't need to be fast, it's probably the most sensible solution.

author: s3c
author_rank: Contributor
timestamp: July 15, 2011, 08:47:37 am
content: So my output isn't perfectly linear, the output is the product of the two inputs multiplied with a nonlinear term, If you look at the plots you can see that small signals are much larger than they should be and larger ones are smaller. Is this a real world limitation?@johnmxThanks for the link, it's a great project and the same idea I'm trying at. Can't say I understand how the signals are added by transistors though, the scans Alex posted uses a similar techniques. Do you get the same nonlinear behaviour in this circuit?@AlexI'm trying to get my hands on a book like this, found some on google books that explain it fairly well but I miss a page every now and then, do you have any other book suggestions by chance?@Hero999I ultimately want to limit signals based on the output so it needs to be fairly fast, much faster than what the low end micro can give and not worth using a big one for.

author: scrat
author_rank: Frequent Contributor
timestamp: July 15, 2011, 10:11:16 am
content: QuoteYes, I was really lost... The last opamp is inverting. Sorry for me repeating the wrong thing twice.After some research both here and around the web and the AD site, I was not able to find that chip I mentioned.However, I think it was more properly used for quite high frequency applications, but was really interesting. It was mentioned by Dave, don't remember in which contest. It has two inputs which are the "upper" and "lower" limits, and it moves linearly in the range between those limits. The limitation has a high BW, comparable or equal to the one GBWP of the opamp itself. Moreover, the limits can be "inverted" (i.e. "upper" < "bottom") to invert the output. Thus it's easy to use it as a multiplier.

author: qno
author_rank: Frequent Contributor
timestamp: July 15, 2011, 03:57:09 pm
content: Does your circuit work when you use a + and - powersupply?

author: s3c
author_rank: Contributor
timestamp: July 15, 2011, 11:45:00 pm
content: Well it works from both now with a little tweaking but I don't get a nice linear output.

author: johnmx
author_rank: Frequent Contributor
timestamp: July 16, 2011, 10:53:38 pm
content: Quote from: s3c on July 15, 2011, 08:47:37 amI get a perfect response like expected.If you want to learn how the circuit works watch the following classes:

author: ciccio
author_rank: Frequent Contributor
timestamp: July 22, 2011, 05:00:37 pm
content: Nice job.I've used, years ago, a dedicated IC for a similar application, and got some problems with temperature coefficients, but at the end it worked over a wide range.Designing it with discrete op-amps was too complicated (I did not had access to simulation software).I don't have anymore access the detail of that projects, but I remember using an Analog Devices IC.They are still manufacturing Analog Multipliers:http://www.analog.com/en/special-linear-functions/analog-multipliersdividers/products/index.html

author: Unknown
author_rank: Unknown
timestamp: July 27, 2011, 04:24:17 pm
content: I have two spare Analog Devices MLT04 4quadrant, 4 channel analogue multipliers if you, or anyone, is interested.