# 1/x function with op amps or multiplier or something else...

Started by April 15, 2016
```On Friday, April 15, 2016 at 11:08:23 AM UTC-7, Tim Wescott wrote:
> On Fri, 15 Apr 2016 00:47:44 -0700, whit3rd wrote:

> > For a multiplier, one possibility is a variable duty cycle chopper.

> Oooh oh!  You could make a voltage-to-period converter for input, then a
> frequency-to-voltage converter for output.

Well, a voltage doubler rectifier (one capacitor, two diodes) into ground
is a frequency-current converter, so it only takes that and a transimpedance amp for its load.

A ramp-up/reset-at-V  oscillator can be made to do the voltage-to-period part.
A comparator, one-shot,  current source, timing cap will do (can't use the '555
direct, it has the wrong thresholds).

Big problem is, with variable frequency, your lowpass filter has to deal with
the worst case... which limits the input range.  0,0 V_in wasn't ever gonna work, anyhow.
```
```On Thu, 14 Apr 2016 20:18:25 -0700 (PDT), Fibo <panfilero@gmail.com>
wrote:

>Hello,
>
>I'm trying to figure out the best way to go about making a -1/x function in hardware. From googling around I see 2 methods,
>
>1. Inverting log -> Anti-log
>2. OpAmp with multiplier in the feedback loop
>
>I have +/-5V rails available, and my input is from 0.4V to 2V (which should give me an output of (-2.5 to -0.5). All DC values.
>
>Can anyone point me in the right direction here, I'm trying to do this with as few parts (no microcontroller) and as painlessly as possible, it doesn't have to be very accurate (2-5% error it ok).
>
>Much Thanks!

See...

<http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>

I leave it as an exercise for the student to convert the output
current from C4 to the appropriate voltage needs of your system ;-)

Note that node IN is essentially a virtual ground, considering your
loose tolerance requirements... so you could drive your incoming
0.4-2.5V thru a resistor into this node.

Note also that there is no multiplier in a feedback loop issue/hang...
both OpAmps are used simply to force nodes C1 and C3 to be zero.

AND:  It's temperature compensated ;-)

...Jim Thompson
--
| James E.Thompson                                 |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

The touchstone of liberalism is intolerance
```
```On 04/16/2016 02:18 PM, Jim Thompson wrote:
> On Thu, 14 Apr 2016 20:18:25 -0700 (PDT), Fibo <panfilero@gmail.com>
> wrote:
>
>> Hello,
>>
>> I'm trying to figure out the best way to go about making a -1/x function in hardware. From googling around I see 2 methods,
>>
>> 1. Inverting log -> Anti-log
>> 2. OpAmp with multiplier in the feedback loop
>>
>> I have +/-5V rails available, and my input is from 0.4V to 2V (which should give me an output of (-2.5 to -0.5). All DC values.
>>
>> Can anyone point me in the right direction here, I'm trying to do this with as few parts (no microcontroller) and as painlessly as possible, it doesn't have to be very accurate (2-5% error it ok).
>>
>> Much Thanks!
>
> See...
>
> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>
> I leave it as an exercise for the student to convert the output
> current from C4 to the appropriate voltage needs of your system ;-)
>
> Note that node IN is essentially a virtual ground, considering your
> loose tolerance requirements... so you could drive your incoming
> 0.4-2.5V thru a resistor into this node.
>
> Note also that there is no multiplier in a feedback loop issue/hang...
> both OpAmps are used simply to force nodes C1 and C3 to be zero.
>
> AND:  It's temperature compensated ;-)
>
>                                          ...Jim Thompson
>

Cool circuit! MAT04AD? Hmm...I bet this shit is expeeeeensive...
```
```On Sat, 16 Apr 2016 14:35:13 -0400, bitrex

>On 04/16/2016 02:18 PM, Jim Thompson wrote:
>> On Thu, 14 Apr 2016 20:18:25 -0700 (PDT), Fibo <panfilero@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm trying to figure out the best way to go about making a -1/x function in hardware. From googling around I see 2 methods,
>>>
>>> 1. Inverting log -> Anti-log
>>> 2. OpAmp with multiplier in the feedback loop
>>>
>>> I have +/-5V rails available, and my input is from 0.4V to 2V (which should give me an output of (-2.5 to -0.5). All DC values.
>>>
>>> Can anyone point me in the right direction here, I'm trying to do this with as few parts (no microcontroller) and as painlessly as possible, it doesn't have to be very accurate (2-5% error it ok).
>>>
>>> Much Thanks!
>>
>> See...
>>
>> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>>
>> I leave it as an exercise for the student to convert the output
>> current from C4 to the appropriate voltage needs of your system ;-)
>>
>> Note that node IN is essentially a virtual ground, considering your
>> loose tolerance requirements... so you could drive your incoming
>> 0.4-2.5V thru a resistor into this node.
>>
>> Note also that there is no multiplier in a feedback loop issue/hang...
>> both OpAmps are used simply to force nodes C1 and C3 to be zero.
>>
>> AND:  It's temperature compensated ;-)
>>
>>                                          ...Jim Thompson
>>
>
>Cool circuit! MAT04AD? Hmm...I bet this shit is expeeeeensive...

I've never bought one, just designed them in many times.

Phil Hobbs would know the price... I don't think it's outrageous.

...Jim Thompson
--
| James E.Thompson                                 |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

The touchstone of liberalism is intolerance
```
```On Sat, 16 Apr 2016 11:43:56 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

>On Sat, 16 Apr 2016 14:35:13 -0400, bitrex
>
>>On 04/16/2016 02:18 PM, Jim Thompson wrote:
>>> On Thu, 14 Apr 2016 20:18:25 -0700 (PDT), Fibo <panfilero@gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm trying to figure out the best way to go about making a -1/x function in hardware. From googling around I see 2 methods,
>>>>
>>>> 1. Inverting log -> Anti-log
>>>> 2. OpAmp with multiplier in the feedback loop
>>>>
>>>> I have +/-5V rails available, and my input is from 0.4V to 2V (which should give me an output of (-2.5 to -0.5). All DC values.
>>>>
>>>> Can anyone point me in the right direction here, I'm trying to do this with as few parts (no microcontroller) and as painlessly as possible, it doesn't have to be very accurate (2-5% error it ok).
>>>>
>>>> Much Thanks!
>>>
>>> See...
>>>
>>> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>>>
>>> I leave it as an exercise for the student to convert the output
>>> current from C4 to the appropriate voltage needs of your system ;-)
>>>
>>> Note that node IN is essentially a virtual ground, considering your
>>> loose tolerance requirements... so you could drive your incoming
>>> 0.4-2.5V thru a resistor into this node.
>>>
>>> Note also that there is no multiplier in a feedback loop issue/hang...
>>> both OpAmps are used simply to force nodes C1 and C3 to be zero.
>>>
>>> AND:  It's temperature compensated ;-)
>>>
>>>                                          ...Jim Thompson
>>>
>>
>>Cool circuit! MAT04AD? Hmm...I bet this shit is expeeeeensive...
>
>I've never bought one, just designed them in many times.
>
>Phil Hobbs would know the price... I don't think it's outrageous.
>
>                                        ...Jim Thompson

You _could_ roll your own... the MAT-04 is just 4 matched
transistors... just sort thru your stockpile of 3904's.

...Jim Thompson
--
| James E.Thompson                                 |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

The touchstone of liberalism is intolerance
```
```Right, that's basically what I was talking about.

Except the 2N3904 idea....a 1K temperature error makes an 8% current error.

Cheers

Phil Hobbs
```
```On Sat, 16 Apr 2016 11:18:47 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

>On Thu, 14 Apr 2016 20:18:25 -0700 (PDT), Fibo <panfilero@gmail.com>
>wrote:
>
>>Hello,
>>
>>I'm trying to figure out the best way to go about making a -1/x function in hardware. From googling around I see 2 methods,
>>
>>1. Inverting log -> Anti-log
>>2. OpAmp with multiplier in the feedback loop
>>
>>I have +/-5V rails available, and my input is from 0.4V to 2V (which should give me an output of (-2.5 to -0.5). All DC values.
>>
>>Can anyone point me in the right direction here, I'm trying to do this with as few parts (no microcontroller) and as painlessly as possible, it doesn't have to be very accurate (2-5% error it ok).
>>
>>Much Thanks!
>
>See...
>
><http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>
>I leave it as an exercise for the student to convert the output
>current from C4 to the appropriate voltage needs of your system ;-)
>
>Note that node IN is essentially a virtual ground, considering your
>loose tolerance requirements... so you could drive your incoming
>0.4-2.5V thru a resistor into this node.
>
>Note also that there is no multiplier in a feedback loop issue/hang...
>both OpAmps are used simply to force nodes C1 and C3 to be zero.
>
>AND:  It's temperature compensated ;-)
>
>                                        ...Jim Thompson

Even better, force the left-side diode...

<http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-51-22.png>

...Jim Thompson
--
| James E.Thompson                                 |    mens     |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| San Tan Valley, AZ 85142   Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

The touchstone of liberalism is intolerance
```
```"Tim Wescott" <seemywebsite@myfooter.really> wrote in message
news:xdGdnTcxP7B7sYzKnZ2dnUU7-X-dnZ2d@giganews.com...
> My GOD!  Why didn't I think of that?!?!?!?!?!
>
> Maybe it's because an op-amp differentiation circuit takes the derivative
> IN TIME, and what you're suggesting something that needs the derivative
> taken OF THE VOLTAGE RESPONSE.  Which is a different thing.

So?  Convert voltage into time:

- Create a periodic log ramp.  Start with a sawtooth oscillator, make it
linear, and feed that ramp to a log amp.  Then take the derivative.
- Meanwhile, compare the input voltage to the ramp.  This generates a
delayed rising edge.
- Trigger a S&H by the edge.  You now have a sampled 1/x function, with
variable sampling proportional to the input.

Simply run it fast enough that you don't mind the steps from the S&H.

All told, this only needs a dual comparator, a quad op-amp, and a handful of
transistors (a CCS, something for the log, and maybe a sampling JFET or
analog switch), not too terrible.

:-)

Tim

--
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com

```
```Jim Thompson wrote...
> Jim Thompson wrote:
>> On 14 Apr 2016, Fibo wrote:
>>>
>>> I'm trying to figure out the best way to go about
>>> making a -1/x function in hardware.
>>
>> See...
>><http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>> I leave it as an exercise for the student to convert the output
>> current from C4 to the appropriate voltage needs of your system ;-)
>
> Even better, force the left-side diode...
> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-51-22.png>

The MAT04, of course, is long gone.  When it was
still available, it cost more than a multiplier IC.
Looking at AoE-III Table 8.1b, page 502, we see the

The Analog Devices AD633 "low-cost" multiplier IC
is \$9.15.  My favorite AD734 costs \$28.  But oops,
besides \$\$\$, neither part can run on +/-5 volts.

We're again forced to regret that Barrie Gilbert
and Analog Devices haven't chosen to update their
accurate, medium-speed analog multiplier designs.

--
Thanks,
- Win
```
```On 04/16/2016 05:45 PM, Winfield Hill wrote:
> Jim Thompson wrote...
>> Jim Thompson wrote:
>>> On 14 Apr 2016, Fibo wrote:
>>>>
>>>> I'm trying to figure out the best way to go about
>>>> making a -1/x function in hardware.
>>>
>>> See...
>>> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-10-50.png>
>>> I leave it as an exercise for the student to convert the output
>>> current from C4 to the appropriate voltage needs of your system ;-)
>>
>> Even better, force the left-side diode...
>> <http://www.analog-innovations.com/SED/OneOverV_2016-04-16_11-51-22.png>
>
>   The MAT04, of course, is long gone.  When it was
>   still available, it cost more than a multiplier IC.
>   Looking at AoE-III Table 8.1b, page 502, we see the
>
>   The Analog Devices AD633 "low-cost" multiplier IC
>   is \$9.15.  My favorite AD734 costs \$28.  But oops,
>   besides \$\$\$, neither part can run on +/-5 volts.
>
>   We're again forced to regret that Barrie Gilbert
>   and Analog Devices haven't chosen to update their
>   accurate, medium-speed analog multiplier designs.
>

Their HQ is right down the street from me, I can go over on Monday and
yell at 'em if you like...

```