From: Bill Sloman on
On Nov 25, 9:44 am, Robert Baer <robertb...(a)localnet.com> wrote:
> Richard Rasker wrote:
> > Hi all,
>
> > I'm currently working with a mass air flow sensor (a Honeywell AWM3100V, see
> >http://datasheet.octopart.com/AWM3100V-Honeywell-datasheet-57019.pdf), and
> > I would like to convert the rather non-linear response curve of this device
> > into a voltage which bears a linear relationship to the actual air flow..
> > Ideally, I would like to see the air flow converted in millivolts, so that
> > it can be fed into a 3.5 digit voltmeter directly.
>
> > These are the values (F=flow):
> > F (ccm)    Vout (V)
> > 0          1.00
> > 25         1.90
> > 50         2.67
> > 75         3.27
> > 100        3.75
> > 125        4.17
> > 150        4.50
> > 175        4.80
> > 200        5.00
>
> > The first problem was simple: finding a suitable mathematical function which
> > fits the curve; I looked at something along the lines of
> > Vout=c1*(1-e^(-F/c2))+1, and it turns out that c1=5 and c2=125 provides a
> > near-perfect fit. The second problem was to find an inverse function -- no
> > problem there either: F=-c2*ln(1-(Vout-1)/c1) -- leading to the third and
> > rather trickier problem, which of course is to implement that inverse
> > function in an actual circuit.
>
> > I've been doing some trial-and-error experimenting with a simple circuit,
> > based on a simple Si-diode with some bypass and series resistors in several
> > configurations, but that doesn't produce satisfactory results -- the best
> > curve I get is easily 10% off at the extremes, and that's even without
> > temperature instability. All this is of course no surprise, as the
> > exponential function of a forward-biased diode is something different than
> > a logarithmic function, and a simple PN junction has a temperature
> > coefficient of approximately 2 mV per degree Celsius.
>
> > Does anyone know of designs which provide a better fit for this type of
> > logarithmic function, and preferably a better temperature stability?
>
> > Thanks in advance, best regards,
>
> > Richard Rasker
>
>    But..but..but..
>    Transistors have been used for ages (>40 years i think) to generate
> log (and anti-log functions).
>    For temp tracking, use a superpair (by National) and use one for
> reference (emulating log(k) where k is some non-zero constant) and subtract,

One project I was involved in used a transistor charging a capacitor
to generate a pretty accurate hyperbolic function, though compensating
of the internal emitter and base resistances of the transistor was a
bit tricky.

In a related circuit I used a thick film platinum resistance sensor to
compensate for the change in the therma voltage - kT/h which is
proportional to absolute temperature and about 26mV at 300C (room
temperature).

--
Bill Sloman, Nijmegen
From: Spehro Pefhany on
On Wed, 25 Nov 2009 01:34:39 -0800 (PST), the renowned Bill Sloman
<bill.sloman(a)ieee.org> wrote:

>On Nov 25, 9:44�am, Robert Baer <robertb...(a)localnet.com> wrote:
>> Richard Rasker wrote:
>> > Hi all,
>>
>> > I'm currently working with a mass air flow sensor (a Honeywell AWM3100V, see
>> >http://datasheet.octopart.com/AWM3100V-Honeywell-datasheet-57019.pdf), and
>> > I would like to convert the rather non-linear response curve of this device
>> > into a voltage which bears a linear relationship to the actual air flow.
>> > Ideally, I would like to see the air flow converted in millivolts, so that
>> > it can be fed into a 3.5 digit voltmeter directly.
>>
>> > These are the values (F=flow):
>> > F (ccm) � �Vout (V)
>> > 0 � � � � �1.00
>> > 25 � � � � 1.90
>> > 50 � � � � 2.67
>> > 75 � � � � 3.27
>> > 100 � � � �3.75
>> > 125 � � � �4.17
>> > 150 � � � �4.50
>> > 175 � � � �4.80
>> > 200 � � � �5.00
>>
>> > The first problem was simple: finding a suitable mathematical function which
>> > fits the curve; I looked at something along the lines of
>> > Vout=c1*(1-e^(-F/c2))+1, and it turns out that c1=5 and c2=125 provides a
>> > near-perfect fit. The second problem was to find an inverse function -- no
>> > problem there either: F=-c2*ln(1-(Vout-1)/c1) -- leading to the third and
>> > rather trickier problem, which of course is to implement that inverse
>> > function in an actual circuit.
>>
>> > I've been doing some trial-and-error experimenting with a simple circuit,
>> > based on a simple Si-diode with some bypass and series resistors in several
>> > configurations, but that doesn't produce satisfactory results -- the best
>> > curve I get is easily 10% off at the extremes, and that's even without
>> > temperature instability. All this is of course no surprise, as the
>> > exponential function of a forward-biased diode is something different than
>> > a logarithmic function, and a simple PN junction has a temperature
>> > coefficient of approximately 2 mV per degree Celsius.
>>
>> > Does anyone know of designs which provide a better fit for this type of
>> > logarithmic function, and preferably a better temperature stability?
>>
>> > Thanks in advance, best regards,
>>
>> > Richard Rasker
>>
>> � �But..but..but..
>> � �Transistors have been used for ages (>40 years i think) to generate
>> log (and anti-log functions).
>> � �For temp tracking, use a superpair (by National) and use one for
>> reference (emulating log(k) where k is some non-zero constant) and subtract,

First Google hit is this PDF, which has all the equations needed.

http://www.electronics.dit.ie/staff/ypanarin/Lecture%20Notes/DT021-4/6LogAntiLogAmplifiers.pdf

see around page 9 (simplified schematic). Matched transistors are used
to compensate for offset change with temperature, and to compensate
for gain error with temperature R4 is made to be a temperature
dependent resistor. Probably good enough for your application, but not
as good as the dedicated chips were.

Unfortunately, the IC dedicated analog blocks they talk of, and even
many of the matched transistors, have been becoming more and more
availability-challenged. The market has spoken.

>One project I was involved in used a transistor charging a capacitor
>to generate a pretty accurate hyperbolic function, though compensating
>of the internal emitter and base resistances of the transistor was a
>bit tricky.
>
>In a related circuit I used a thick film platinum resistance sensor to
>compensate for the change in the therma voltage - kT/h which is
>proportional to absolute temperature and about 26mV at 300C (room
>temperature).

That does seem a tad on the warm side, Bill. At 22-23�C+ some folks
start to complain, IME.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff(a)interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
From: Richard Rasker on
Spehro Pefhany wrote:

>>> > Does anyone know of designs which provide a better fit for this type
>>> > of logarithmic function, and preferably a better temperature
>>> > stability?
>>>
>>> > Thanks in advance, best regards,
>>>
>>> > Richard Rasker
>>>
>>> But..but..but..
>>> Transistors have been used for ages (>40 years i think) to generate
>>> log (and anti-log functions).
>>> For temp tracking, use a superpair (by National) and use one for
>>> reference (emulating log(k) where k is some non-zero constant) and
>>> subtract,
>
> First Google hit is this PDF, which has all the equations needed.

>
http://www.electronics.dit.ie/staff/ypanarin/Lecture%20Notes/DT021-4/6LogAntiLogAmplifiers.pdf
>
> see around page 9 (simplified schematic). Matched transistors are used
> to compensate for offset change with temperature, and to compensate
> for gain error with temperature R4 is made to be a temperature
> dependent resistor. Probably good enough for your application, but not
> as good as the dedicated chips were.

Ah, yes, of course -- I searched for "non-linear amplifiers", and got lost
in all sorts of interesting but (for my application) useless information.
And I still have a few SSM2210's around somewhere, so a matched transistor
pair is no problem.

> Unfortunately, the IC dedicated analog blocks they talk of, and even
> many of the matched transistors, have been becoming more and more
> availability-challenged. The market has spoken.

I know, and I guess I'll eventually switch to using controllers for these
applications as well -- but somehow, having a digital chip perform
complicated calculations feels like making things needlessly difficult,
when there are one-step analog processes to do the same. It's like asking
someone across the room if they want another cup of coffee by sending then
a text message.

Also, I don't have the need for any digital stuff at this point -- I have a
simple (digital) voltmeter module which takes analog input, monitoring
several different parameters selected by a switch, and some simple analog
circuitry surrounding it, all running on a single 12 volt supply.

I'm also pondering the idea of charging a capacitor via a resistor, and have
a linear rising voltage (integrator) starting at the same time; when the
capacitor voltage has reached the sensor output voltage, a simple
sample-and-hold of the linear voltage should provide a relatively accurate
value for the flow rate. The only critical component here would be the
capacitor, which must have a low temperature drift.

>>One project I was involved in used a transistor charging a capacitor
>>to generate a pretty accurate hyperbolic function, though compensating
>>of the internal emitter and base resistances of the transistor was a
>>bit tricky.
>>
>>In a related circuit I used a thick film platinum resistance sensor to
>>compensate for the change in the therma voltage - kT/h which is
>>proportional to absolute temperature and about 26mV at 300C (room
>>temperature).
>
> That does seem a tad on the warm side, Bill. At 22-23°C+ some folks
> start to complain, IME.

:-)

Anyway, thanks to everyone for their contributions. It's quite interesting
to see how ever more electronic design questions are answered by the single
adage "use a controller!".

Thanks again, best regards,

Richard Rasker
--
http://www.linetec.nl
From: Fred Bartoli on
Richard Rasker a �crit :
> Jon Kirwan wrote:
>
>> On Tue, 24 Nov 2009 22:19:26 +0100, Richard Rasker wrote:
>>
>>> I'm currently working with a mass air flow sensor (a Honeywell AWM3100V,
>>> see http://datasheet.octopart.com/AWM3100V-Honeywell-datasheet-57019.pdf),
>>> and I would like to convert the rather non-linear response curve of this
>>> device into a voltage which bears a linear relationship to the actual air
>>> flow. Ideally, I would like to see the air flow converted in millivolts,
>>> so that it can be fed into a 3.5 digit voltmeter directly.
>>>
>>> These are the values (F=flow):
>>> F (ccm) Vout (V)
>>> 0 1.00
>>> 25 1.90
>>> 50 2.67
>>> 75 3.27
>>> 100 3.75
>>> 125 4.17
>>> 150 4.50
>>> 175 4.80
>>> 200 5.00
>>>
>>> The first problem was simple: finding a suitable mathematical function
>>> which fits the curve; I looked at something along the lines of
>>> Vout=c1*(1-e^(-F/c2))+1, and it turns out that c1=5 and c2=125 provides a
>>> near-perfect fit. The second problem was to find an inverse function -- no
>>> problem there either: F=-c2*ln(1-(Vout-1)/c1) -- leading to the third and
>>> rather trickier problem, which of course is to implement that inverse
>>> function in an actual circuit.
>>>
....
<snip>
....
>
>> Third was to consider recommending a micro, which is a rather common
>> approach to conditioning sensors these days.
>
> I know. But I'm one of those old school die-hards who prefers hooking up a
> dozen or so components to a meter in an hour or so instead of spending a
> multiple of that time programming a controller to do the same.
>

OK, then instead of using your log approach, one could notice the
extreme similarity between your sensor response Vout=c1*(1-e^(-F/c2))+1
and an RC step response Vout=Vo*(1-e^(-t/tau)) which only differs from
your sensor response by a 1 constant. You can easily put this to work,
without having to bother with the inherent log amp thermal problems, and
use feedback to recover the flow value...


R C RC = C2
___ ||
-1 >----. C1 >--|___|--+--||---.
| | || |
.---. | ===
Vout >--| + |---. .--------+ GND
'---' | | |
.-----. |
\+ -/ +-||
comparator \ / ->||
V +-||---.
| | |
| === |
.--o--. GND |
GND -|D S Q|-------------'
| |
Clk >---|> -| ___
| R Q|---|___|--+-----> Flow
'--o--' |
---
---
|
===
GND


Note that this will be a sampled system, so you have to adapt the clock
frequency to your wanted frequency bandwidth.

--
Thanks,
Fred.
From: Richard Rasker on
Fred Bartoli <" "> wrote:

> Richard Rasker a écrit :
>> Jon Kirwan wrote:
>>
>>> On Tue, 24 Nov 2009 22:19:26 +0100, Richard Rasker wrote:
>>>
>>>> I'm currently working with a mass air flow sensor (a Honeywell
>>>> AWM3100V, see
>>>> http://datasheet.octopart.com/AWM3100V-Honeywell-datasheet-57019.pdf),
>>>> and I would like to convert the rather non-linear response curve of
>>>> this device into a voltage which bears a linear relationship to the
>>>> actual air flow. Ideally, I would like to see the air flow converted in
>>>> millivolts, so that it can be fed into a 3.5 digit voltmeter directly.
>>>>
>>>> These are the values (F=flow):
>>>> F (ccm) Vout (V)
>>>> 0 1.00
>>>> 25 1.90
>>>> 50 2.67
>>>> 75 3.27
>>>> 100 3.75
>>>> 125 4.17
>>>> 150 4.50
>>>> 175 4.80
>>>> 200 5.00
>>>>
>>>> The first problem was simple: finding a suitable mathematical function
>>>> which fits the curve; I looked at something along the lines of
>>>> Vout=c1*(1-e^(-F/c2))+1, and it turns out that c1=5 and c2=125 provides
>>>> a near-perfect fit. The second problem was to find an inverse function
>>>> -- no problem there either: F=-c2*ln(1-(Vout-1)/c1) -- leading to the
>>>> third and rather trickier problem, which of course is to implement that
>>>> inverse function in an actual circuit.
>>>>
> ...
> <snip>
> ...
>>
>>> Third was to consider recommending a micro, which is a rather common
>>> approach to conditioning sensors these days.
>>
>> I know. But I'm one of those old school die-hards who prefers hooking up
>> a dozen or so components to a meter in an hour or so instead of spending
>> a multiple of that time programming a controller to do the same.
>>
>
> OK, then instead of using your log approach, one could notice the
> extreme similarity between your sensor response Vout=c1*(1-e^(-F/c2))+1
> and an RC step response Vout=Vo*(1-e^(-t/tau)) which only differs from
> your sensor response by a 1 constant. You can easily put this to work,
> without having to bother with the inherent log amp thermal problems, and
> use feedback to recover the flow value...
>
>
> R C RC = C2
> ___ ||
> -1 >----. C1 >--|___|--+--||---.
> | | || |
> .---. | ===
> Vout >--| + |---. .--------+ GND
> '---' | | |
> .-----. |
> \+ -/ +-||
> comparator \ / ->||
> V +-||---.
> | | |
> | === |
> .--o--. GND |
> GND -|D S Q|-------------'
> | |
> Clk >---|> -| ___
> | R Q|---|___|--+-----> Flow
> '--o--' |
> ---
> ---
> |
> ===
> GND
>
>
> Note that this will be a sampled system, so you have to adapt the clock
> frequency to your wanted frequency bandwidth.

Yes, I just figured out something along the same lines, and I was just about
to design a schematic -- but yours is quite a bit simpler and more elegant
than what I had in mind :-)
And as your schematic bears a great resemblance to the innards of the humble
555, it wouldn't surprise me if I could use that device for this particular
purpose.

Thanks for this very neat suggestion!

Richard Rasker
--
http://www.linetec.nl