Maker Pro
Maker Pro

Making a non-linear resistance look linear

P

Pete Verdon

Jan 1, 1970
0
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel actually
remaining. More unfortunately, it's actually "the wrong way round", so
that when the gauge reads half-full there will actually be significantly
less than half a tank of fuel left - perhaps a quarter or less.

I've wired up a couple of PICs and so on in my time, but have very
little experience with basic analogue electronics. Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to the
amount of fuel remaining rather than the height of the sender float?

Some sketches of the tank here: http://verdonet.org.uk/stuff/tank.png
Note that the lame attempt at isometric projection actually makes the
tank seem squarer than it is - the slope is in fact very pronounced
indeed, it's basically wedge-shaped in all three dimensions, plus a
sneaky little change of gradient in one side.

This shape means the perfect correction is probably quite complex - but
all I really want to do is pin 3/4, 1/2, 1/4 in their right places. I
can pour water through the tank before installing it, to measure the
"observed" resistance at those points.

Note the "orientation" of the sender is indeed 0 ohms when empty - I
believe the other way round is normal in the US but I haven't made a
mistake! I could special-order the American sender if required, but it
would then make my gauge read backwards unless flipped again as part of
the circuit.

Thanks for any help or suggestions,

Pete
 
M

Martin Riddle

Jan 1, 1970
0
Pete Verdon said:
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is
empty with, presumably, a linear resistance in between. There is a
gauge that connects to this - presumably an ammeter and a means of
passing current through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel
actually remaining. More unfortunately, it's actually "the wrong way
round", so that when the gauge reads half-full there will actually be
significantly less than half a tank of fuel left - perhaps a quarter
or less.

I've wired up a couple of PICs and so on in my time, but have very
little experience with basic analogue electronics. Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to
the amount of fuel remaining rather than the height of the sender
float?

Some sketches of the tank here: http://verdonet.org.uk/stuff/tank.png
Note that the lame attempt at isometric projection actually makes the
tank seem squarer than it is - the slope is in fact very pronounced
indeed, it's basically wedge-shaped in all three dimensions, plus a
sneaky little change of gradient in one side.

This shape means the perfect correction is probably quite complex -
but all I really want to do is pin 3/4, 1/2, 1/4 in their right
places. I can pour water through the tank before installing it, to
measure the "observed" resistance at those points.

Note the "orientation" of the sender is indeed 0 ohms when empty - I
believe the other way round is normal in the US but I haven't made a
mistake! I could special-order the American sender if required, but it
would then make my gauge read backwards unless flipped again as part
of the circuit.

Thanks for any help or suggestions,

Pete

You need to do a little curve fitting, maybe X^2 or something similar.
Calculate the volume of the tank at 4 or 5 levels and plot the volume on
a graph (Excel).
Then plot the output of the sensor, etc...
You may not need a pic, but it does make a lookuptable easy. A log amp
comes to mind, as does Temperature stability.

Cheers
 
P

Pete Verdon

Jan 1, 1970
0
Jim said:
Calculate? Naaaah! Use alcohol as a test fluid and add a quart at a
time, plotting the sensor output.

Yes, I plan to do this once I've had the tank manufactured, hopefully in
the next couple of weeks. Using water though - I don't have access to 40
or 50 litres of alcohol! (The tank will have an inspection hatch, so I
can dry it out afterwards and avoid contaminating my diesel.)
Then curve fit, mostly likely
easily done piece-wise-linear. Analog piece-wise-linear can easily be
done with NO TC effects.

I don't quite understand this, but do you mean that a simple analogue
circuit is feasible for this problem? If so, that's good news!

Pete
 
P

Pete Verdon

Jan 1, 1970
0
Jan said:
sender -> [PIC, ADC in, lookup table, PWM DAC out] -> analog meter.

Thanks, but I'm hoping to avoid using a PIC. It would be possible, but I
don't own a programmer, and it's a very long time indeed since I did any
C or Assembler. Having a processor running continually just to make the
fuel gauge work also seems like overkill to me.

Pete
 
P

Pete Verdon

Jan 1, 1970
0
John said:
If you can generate a graph of resistance versus liquid volume, some
sort of circuit could likely be created.

Thanks - I guess I'll do a test when the tank arrives, and report back
with some numbers to work from.
What sort of meter will be used to display the contents?

I don't really know - I plan to reuse the gauge from the old (square)
tank. I presume it's an ammeter, and measures the current that's flowing
through the sender resistance at a known (or more likely, assumed with
varying accuracy) voltage.

Pete
 
P

Pete Verdon

Jan 1, 1970
0
John said:
Old meters probably are already nonlinear to compensate for the old
tank and sender. You'll have to characterize the meter, too!

I doubt it - the gauge is a standard part not meant for any particular
tank. The old tank was custom-made (but a rectangular shape, so without
the linearity issue) and the gauge would have been bought off the shelf.

I think most people using these just tolerate any minor non-linearity,
but the shape of my new tank means the effect would be pretty extreme.

Pete
 
T

Tim Williams

Jan 1, 1970
0
Pete Verdon said:
I don't quite understand this, but do you mean that a simple analogue
circuit is feasible for this problem? If so, that's good news!

Other constraints may come in. How big can it be? How much power? An
op-amp running constant is going to burn more than a few mA. CMOS amp less
(use big resistors in the feedback circuit!). PIC will consume somewhere
inbetween. The analog solution will use at least an op-amp and a big mess
of diodes and resistors -- complexity-wise, it's simpler, but it sure ends
up taking a lot of board space. On the other hand, you can drop in a PIC
and use basically no support hardware.

Tim
 
D

Don Lancaster

Jan 1, 1970
0
Pete said:
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel actually
remaining. More unfortunately, it's actually "the wrong way round", so
that when the gauge reads half-full there will actually be significantly
less than half a tank of fuel left - perhaps a quarter or less.

I've wired up a couple of PICs and so on in my time, but have very
little experience with basic analogue electronics. Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to the
amount of fuel remaining rather than the height of the sender float?

Some sketches of the tank here: http://verdonet.org.uk/stuff/tank.png
Note that the lame attempt at isometric projection actually makes the
tank seem squarer than it is - the slope is in fact very pronounced
indeed, it's basically wedge-shaped in all three dimensions, plus a
sneaky little change of gradient in one side.

This shape means the perfect correction is probably quite complex - but
all I really want to do is pin 3/4, 1/2, 1/4 in their right places. I
can pour water through the tank before installing it, to measure the
"observed" resistance at those points.

Note the "orientation" of the sender is indeed 0 ohms when empty - I
believe the other way round is normal in the US but I haven't made a
mistake! I could special-order the American sender if required, but it
would then make my gauge read backwards unless flipped again as part of
the circuit.

Thanks for any help or suggestions,

Pete


Table lookup on the digital side, of course.

Zero cost and accuracy beyond analog.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: [email protected]

Please visit my GURU's LAIR web site at http://www.tinaja.com
 
E

ehsjr

Jan 1, 1970
0
Pete said:
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel actually
remaining. More unfortunately, it's actually "the wrong way round", so
that when the gauge reads half-full there will actually be significantly
less than half a tank of fuel left - perhaps a quarter or less.

I've wired up a couple of PICs and so on in my time, but have very
little experience with basic analogue electronics. Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to the
amount of fuel remaining rather than the height of the sender float?

Some sketches of the tank here: http://verdonet.org.uk/stuff/tank.png
Note that the lame attempt at isometric projection actually makes the
tank seem squarer than it is - the slope is in fact very pronounced
indeed, it's basically wedge-shaped in all three dimensions, plus a
sneaky little change of gradient in one side.

This shape means the perfect correction is probably quite complex - but
all I really want to do is pin 3/4, 1/2, 1/4 in their right places. I
can pour water through the tank before installing it, to measure the
"observed" resistance at those points.

Note the "orientation" of the sender is indeed 0 ohms when empty - I
believe the other way round is normal in the US but I haven't made a
mistake! I could special-order the American sender if required, but it
would then make my gauge read backwards unless flipped again as part of
the circuit.

Thanks for any help or suggestions,

Pete

Is it practical for you to re-scale the meter face?

Aside from that, if the tank makes the sensor resistance
severely non-linear, you might want to use comparators to
switch in/out resistors, depending on the tank content level.

Ed
 
B

Ban

Jan 1, 1970
0
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel actually
remaining. More unfortunately, it's actually "the wrong way round", so
that when the gauge reads half-full there will actually be significantly
less than half a tank of fuel left - perhaps a quarter or less.

A cut trick is to use an LM324 or other op-amp that doesn't mind being
crammed against the rails and having a large input voltage. I will
use
a simple case as an example:


Input ----+--------------------------/\/\---------
! !
----!+\ !
! >---+-------------------/\/\----+----
---!-/ !
! !
2V--/\/\----+---/\/\---

All resistors 10K

From 0 to 1V the gain of the system is 1/2.
Above 1V the gain increases to 1.5

If you use a rail to rail op-amp, you can have the gain decrease
again at some higher voltage. The result can be a nice straight
line estimate of the curve you need.


This is indeed a very cute circuit, because no diodes need to be used, but
it puts a sharp knee, which would be more appropriate for a step in
diameter, not the continuous function he describes.
Anyway, maybe the meter itself is already non linear for the original tank,
and together it can be twiddled to a satisfying fit, doesn't need to be too
accrate.
Ciao Ban
Apricale, Italy.
 
A

Adrian Tuddenham

Jan 1, 1970
0
Pete Verdon said:
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

What about a non-electric gauge, such as a pneumatic system with a 'U'
tube?

In case you have not come across the system, I have drawn a diagram at:

http://www.poppyrecords.co.uk/other/images/Gauge.gif

A hand-operted air pump is used to fill the tubing with air until it
bubbles out from the dip tube in the tank. If the fluid in the
manometer is the same density as that in the tank, the height 'h2' will
be equal to the height 'h1'. If the two fluids have different
densities, 'h2' and 'h1' will be related by the density ratio.

When you fill the tank for the first time, calibrate the manometer as
you go. The calibration will hold good for all time and the system will
work with no need for batteries until the pump washer needs replacing
(about once every 25 years and cheaper than a battery).
 
P

Pete Verdon

Jan 1, 1970
0
Jan said:
PIC programmers can be made with about 3 $ in parts, I use one like that.
A small PIC uses less then 1.5 mA for an application like this.
Any analog solution will cost more parts then the programmer + PIC together.

Hmm. Looking at some of the hair-raising suggestions being proposed for
an analogue solution, you might have a point :)

Pete
 
M

mike

Jan 1, 1970
0
Pete said:
Hi,

I'm planning to fit a fuel tank with a contents gauge. The sender that
the tank manufacturer will put in is essentially a variable resistor,
which reads 180 ohms when the tank is full, and 0 ohms when it is empty
with, presumably, a linear resistance in between. There is a gauge that
connects to this - presumably an ammeter and a means of passing current
through the sender?

My problem is that the tank is not square, and so the height of the
sender float is not directly proportional to the amount of fuel actually
remaining. More unfortunately, it's actually "the wrong way round", so
that when the gauge reads half-full there will actually be significantly
less than half a tank of fuel left - perhaps a quarter or less.

I've wired up a couple of PICs and so on in my time, but have very
little experience with basic analogue electronics. Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to the
amount of fuel remaining rather than the height of the sender float?

Some sketches of the tank here: http://verdonet.org.uk/stuff/tank.png
Note that the lame attempt at isometric projection actually makes the
tank seem squarer than it is - the slope is in fact very pronounced
indeed, it's basically wedge-shaped in all three dimensions, plus a
sneaky little change of gradient in one side.

This shape means the perfect correction is probably quite complex - but
all I really want to do is pin 3/4, 1/2, 1/4 in their right places. I
can pour water through the tank before installing it, to measure the
"observed" resistance at those points.

Note the "orientation" of the sender is indeed 0 ohms when empty - I
believe the other way round is normal in the US but I haven't made a
mistake! I could special-order the American sender if required, but it
would then make my gauge read backwards unless flipped again as part of
the circuit.

Thanks for any help or suggestions,

Pete

Sometimes high technology ain't the best solution.
Plot a non-linear meter scale and paste it on the meter face.
 
Y

YD

Jan 1, 1970
0
Late at night, by candle light, Pete Verdon
Yes, I plan to do this once I've had the tank manufactured, hopefully in
the next couple of weeks. Using water though - I don't have access to 40
or 50 litres of alcohol! (The tank will have an inspection hatch, so I
can dry it out afterwards and avoid contaminating my diesel.)


I don't quite understand this, but do you mean that a simple analogue
circuit is feasible for this problem? If so, that's good news!

Pete

I missed the OP, so I may be off target here. Most fuel gauges I've
seen don't worry too much about absolute linearity. The actual
readings seem to be "full", "empty" and "time to think about filling
up". In-between you just give it the occasional glance to see if it's
still OK.

- YD.
 
P

Pete Verdon

Jan 1, 1970
0
YD said:
I missed the OP, so I may be off target here. Most fuel gauges I've
seen don't worry too much about absolute linearity. The actual
readings seem to be "full", "empty" and "time to think about filling
up".

That's all I need, but the shape of the tank (wedge shaped in two
dimensions) is such that the non-linearity is rather extreme.

Pete
 
D

Don Lancaster

Jan 1, 1970
0
Pete said:
That's all I need, but the shape of the tank (wedge shaped in two
dimensions) is such that the non-linearity is rather extreme.

Pete

The more extreme, the better table lookup is.



--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: [email protected]

Please visit my GURU's LAIR web site at http://www.tinaja.com
 
P

Pete Verdon

Jan 1, 1970
0
Pete said:
Is it possible to
build a passive circuit (perhaps a network of resistors?) that will
"convert" the resistance of the sender so that it's proportional to the
amount of fuel remaining rather than the height of the sender float?

Thanks for all the suggestions, but it looks like the actual solution
will be simpler still. Apparently it only costs the tank manufacturers
about £10 extra to get a custom sender made by their supplier, whose
resistance at each point is calibrated to match the shape of the tank.
Clearly that's the way to go - it hadn't occurred to me that it would
even be possible.

Pete
 
Top