Shop OBEX P1 Docs P2 Docs Learn Events
linearizing data — Parallax Forums

linearizing data

ArchiverArchiver Posts: 46,084
edited 2003-03-02 14:32 in General Discussion
Hi all,

I am planning a project where I am going to read a non-linear transducer
via an A/D and then output a linearized value in engineering
units...perhaps to an LCD. After I hook up the transducer and record
10-20 data points, what is the best way to linearize the the input from my
A/D? Lookup table?

I am also looking for a 12 bit A/D that's easy to interface to a stamp. I
need something that I can use an external reference of 10 volts on. Any
suggestions?

So, my A/D counts will range from 0 to 4095 and my engineering units will
range from 0-200.0 (only 1 decimal place needed).

Thanks,
Aaron

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-03-01 16:15
    The answer to that question is "it depends". What is the transfer function
    that describes the output of the transducer vs its input? You may be able
    to do a table lookup, then interpolation. It all depends on the shape of
    the curve. What I do in cases like this is build an Excel spreadsheet and
    examine the data to see if table lookup will work.

    If not, then life gets messier. You need to use the transfer function of
    the transducer, or, if that is to difficult to handle on a Stamp, a
    polynomial approximation, which may also be too difficult to handle.

    For example, if the transfer function of the transducer is y=a+bx^2, where
    a and b are constants, and x is the transducer output, that's easy to handle.

    However, if the function is y=a*x^1.236, that's a bit harder ( a LOT
    harder!) - table lookup with interpolation or a polynomial approximation is
    needed. Your accuracy requirements will determine what you can get away
    with. If 10% is OK, then life is sweet. If 0.1% is needed, you are in trouble.

    Tracy Allen's web site has a lot of useful Stamp math stuff, in particular,
    the use of the ** operator to work with fractions.

    Also, Al Williams site has a floating point "co-processor" for use with the
    Stamp. Using it, processing the transfer function should be easy.

    Now, your A/D converter - there are, at a conservative estimate, 10^6 A/D
    converters on the market. You need one that has a serial interface - there
    are piles of them. Check the Maxim, Linear Technology, Analog Devices and
    National Semiconductor web sites and start searching for devices that will
    meet your requirements. The 10v external reference may be difficult to
    handle. The A/D's I've used typically are designed for 5 volts, and either
    have a built-in reference or let you supply your own, up to 5 volts. But
    search the web sites - you may find something.

    But why do you need a 10 v reference? Can you not scale down the output of
    your transducer into the range of 0 to 4 or 5 volts? Then there are a LOT
    of A/D converters available.

    Larry

    At 09:22 PM 2/27/2003 -0500, you wrote:
    >Hi all,
    >
    >I am planning a project where I am going to read a non-linear transducer
    >via an A/D and then output a linearized value in engineering
    >units...perhaps to an LCD. After I hook up the transducer and record
    >10-20 data points, what is the best way to linearize the the input from my
    >A/D? Lookup table?
    >
    >I am also looking for a 12 bit A/D that's easy to interface to a stamp. I
    >need something that I can use an external reference of 10 volts on. Any
    >suggestions?
    >
    >So, my A/D counts will range from 0 to 4095 and my engineering units will
    >range from 0-200.0 (only 1 decimal place needed).
    >
    >Thanks,
    >Aaron
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    Larry Bradley
    Orleans (Ottawa), Ontario, CANADA
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-02 14:32
    if it's from a logarithmic transducer you can use Tracy Allen's log
    routine -- it's acurate to at least 0.0X places and can be found at
    www.emesys.com I use a variation in a densitometer.

    if the data require manipulation, higher math, statistical analysis,
    consider using StampDAQ which Martin Hebel wrote for Parallax -- it's
    a free download -- takes your values and puts them right into an Excel
    spreadsheet.

    and you might want to just surrender and use the BX24 from Netmedia --
    same 24 pin DIP as a stamp, same pinouts -- has a wealth of fixed and
    floating math functions. The language is akin to VB so it's not
    difficult to learn.



    --- In basicstamps@yahoogroups.com, Larry Bradley <lhbradley@i...> wrote:
    > The answer to that question is "it depends". What is the transfer
    function
    > that describes the output of the transducer vs its input? You may be
    able
    > to do a table lookup, then interpolation. It all depends on the
    shape of
    > the curve. What I do in cases like this is build an Excel
    spreadsheet and
    > examine the data to see if table lookup will work.
    >
    > If not, then life gets messier. You need to use the transfer
    function of
    > the transducer, or, if that is to difficult to handle on a Stamp, a
    > polynomial approximation, which may also be too difficult to handle.
    >
    > For example, if the transfer function of the transducer is y=a+bx^2,
    where
    > a and b are constants, and x is the transducer output, that's easy
    to handle.
    >
    > However, if the function is y=a*x^1.236, that's a bit harder ( a LOT
    > harder!) - table lookup with interpolation or a polynomial
    approximation is
    > needed. Your accuracy requirements will determine what you can get away
    > with. If 10% is OK, then life is sweet. If 0.1% is needed, you are
    in trouble.
    >
    > Tracy Allen's web site has a lot of useful Stamp math stuff, in
    particular,
    > the use of the ** operator to work with fractions.
    >
    > Also, Al Williams site has a floating point "co-processor" for use
    with the
    > Stamp. Using it, processing the transfer function should be easy.
    >
    > Now, your A/D converter - there are, at a conservative estimate,
    10^6 A/D
    > converters on the market. You need one that has a serial interface -
    there
    > are piles of them. Check the Maxim, Linear Technology, Analog
    Devices and
    > National Semiconductor web sites and start searching for devices
    that will
    > meet your requirements. The 10v external reference may be difficult to
    > handle. The A/D's I've used typically are designed for 5 volts, and
    either
    > have a built-in reference or let you supply your own, up to 5 volts.
    But
    > search the web sites - you may find something.
    >
    > But why do you need a 10 v reference? Can you not scale down the
    output of
    > your transducer into the range of 0 to 4 or 5 volts? Then there are
    a LOT
    > of A/D converters available.
    >
    > Larry
    >
    > At 09:22 PM 2/27/2003 -0500, you wrote:
    > >Hi all,
    > >
    > >I am planning a project where I am going to read a non-linear
    transducer
    > >via an A/D and then output a linearized value in engineering
    > >units...perhaps to an LCD. After I hook up the transducer and record
    > >10-20 data points, what is the best way to linearize the the input
    from my
    > >A/D? Lookup table?
    > >
    > >I am also looking for a 12 bit A/D that's easy to interface to a
    stamp. I
    > >need something that I can use an external reference of 10 volts on.
    Any
    > >suggestions?
    > >
    > >So, my A/D counts will range from 0 to 4095 and my engineering
    units will
    > >range from 0-200.0 (only 1 decimal place needed).
    > >
    > >Thanks,
    > >Aaron
    > >
    > >
    > >To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > >from the same email address that you subscribed. Text in the
    Subject and
    > >Body of the message will be ignored.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    > Larry Bradley
    > Orleans (Ottawa), Ontario, CANADA
Sign In or Register to comment.