From: Richard Rasker on 24 Nov 2009 16:19 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 -- http://www.linetec.nl
From: Tim Wescott on 24 Nov 2009 16:30 On Tue, 24 Nov 2009 22:19:26 +0100, 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 .-----. .----. .-----. | | | | | | problem o---->| ADC |----->| uP |----->| DAC |-----> answer | | | | | | '-----' '----' '-----' -- www.wescottdesign.com
From: Tim Wescott on 24 Nov 2009 16:31 On Tue, 24 Nov 2009 22:19:26 +0100, 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 Or a piece-wise linear circuit using lots of diodes and op-amps -- but a microprocessor-based solution is smaller and probably more accurate. -- www.wescottdesign.com
From: Joerg on 24 Nov 2009 16:37 Tim Wescott wrote: > On Tue, 24 Nov 2009 22:19:26 +0100, 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 > > .-----. .----. .-----. > | | | | | | > problem o---->| ADC |----->| uP |----->| DAC |-----> answer > | | | | | | > '-----' '----' '-----' > I'll second that. Being an analog guy this was hard to write but we've got to know when to fold'em. The MSP430F2003 has the ADC part built in. Somehow DVM tells me it's slow so you could get by with the el-cheapo MSP430F2001 or an even cheaper PIC. The MSP can work sans crystal. Program it to do dual slope conversion for the ADC and PWM the output, then RC filter that. The math goes in between where the code is :-) Piecewise linear can be ok but with diodes it's temperature-sensitive and with comparators it's expensive. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
From: Michael on 24 Nov 2009 16:39
On Nov 24, 1:19 pm, Richard Rasker <spamt...(a)linetec.nl> wrote: > Hi all, > > I'm currently working with a mass air flow sensor (a Honeywell AWM3100V, seehttp://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 > --http://www.linetec.nl A few side questions: how do those voltages look when performed at different ambient temperatures, and at different elevations (air pressures)? You might have a few more equations to play with in those cases... Michael |