To all the mathematicians out there...

Discussion in 'Technical' started by EvZ, Aug 17, 2011.

  1. EvZ

    EvZ 1BAD300

    To all the mathematicians out there. Is there a way of generating a function that could accurately give the value of y (vertical) if the value of x (horizontal) was known?

    [​IMG]

    The data set is included below and is the mapping from the temperature voltage at the ECU to the actual water temperature.

    temp volt
    205 0.16
    191 0.32
    150 0.48
    124 0.64
    110 0.8
    99 0.96
    91 1.12
    84 1.28
    78 1.44
    72 1.6
    68 1.76
    63 1.92
    59 2.08
    55 2.24
    51 2.4
    47 2.56
    43 2.72
    40 2.88
    36 3.04
    32 3.2
    28 3.36
    24 3.52
    20 3.68
    16 3.84
    11 4
    7 4.16
    1 4.32
    -5 4.48
    -12 4.64
    -23 4.8
    -42 4.96
    -50 5.12

    I've noticed that the differences in the voltages are always 0.16v. I think that's either because that is the resolution of the A/D in the ECU or that Nissan built a lookup table into the ECU. If the later is the case I'd like to have a higher resolution for a temp guage that I have almost completed for the Zed.

    Thanks,
    Evan.
     
  2. laam

    laam Member

    Generally electronic temperature measuring devices have non linear graphs overall, but the particular sensor is chosen based on the temperature range where it does exhibits linear behavior. I did a few experiments with these at uni and we took a few sensors down from 0 degrees down to -200 odd and plotted these graphs for a few different devices. (they looked very similar to one you have below) Those graphs showed the desirable range of operation for each sensor by where the graph is linear.

    It seems nissan has chosen a sensor that is linear in the region where water temp will generally lie, ie between 0 deg to 120deg which makes sense on there behalf, so if you want better resolution, I would get rid of the edges where the graph goes non linear and work on the "middle" ground
     
  3. EvZ

    EvZ 1BAD300


    Thanks for the reply. Is there a magic machine where I can type in the reduced data set and it will return something like y=2x^0.2+32? :)
     
  4. garethclarke

    garethclarke Member

    google it, bound to be some online curve generators. otherwise matlab or excel even, maple, mathmatica, ect ect...

    good luck!
     
  5. laam

    laam Member

    I think you will struggle to get a polynomial type equation to work for that shape as the linear portion just doesn't fit with those equations, but I'll have a play in excel when I get home.

    If anything it looks like a y = atanx + b type graph
     
  6. loud'n'proud

    loud'n'proud Challenge Accepted

  7. matszx

    matszx New Member

    i too know what they are talking about:rofl:
     
  8. Madcow

    Madcow Active Member

    Looks like the share market last week.
     
  9. laam

    laam Member

    Ok found a good match

    http://statpages.org/nonlin.html
    Great site for this stuff, remembered using it in my thesis

    Which gives this as your equation using least squares

    y=40.02776162392441*Tan(-0.5212881963372169*x+1.4733653367871384)+40.957884135368154

    i graphed it in excel and its a good match

    also i got rid of the first point and last point in your data set, as they go at odd angles to the rest

    [​IMG]
     
  10. EvZ

    EvZ 1BAD300

    Awesome, thanks.

    I just have to hope that the little processor in my graphics display can do Tan and handle floating point to that precision. Otherwise it's going to be one big ugly if/then/else statement.

    Thanks again,
    Evan.

     
  11. laam

    laam Member

    You don't need that many decimal places, 2-3 places would be plenty, I just copied the numbers from the site. But yeah, if it can't do tan I'm not sure of an equation
     
  12. mholt

    mholt Member

    mitch did you get all that right
     
  13. EvZ

    EvZ 1BAD300

    It does cos and sin. i't's been long time since I've had to do any serious math but is it true that tan x = sin x / cos x?

    Cheers,
    Evan.
     
  14. Mitch

    Mitch Has one gear: GO

  15. p5yk3r

    p5yk3r el8 haqur

    Yep that's right.
     
  16. mclean

    mclean New Member

    For what its worth, this is the 5th order poly:

    T= -1.446*V^5 + 20.36*V^4 - 110.4*V^3 + 286.8*V^2 - 381.7*V + 282.2

    It's within 3 degrees over the middle of the range, not so good at the ends (and ignoring the first and last points).
     
  17. EvZ

    EvZ 1BAD300

    Thanks to everyone for their input but I've just realised that the processor I am using doesn't do floating point.

    [​IMG]

    I'll just use a lookup table of some description instead.

    Cheers,
    Evan.
     

Share This Page