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? 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.
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
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?
google it, bound to be some online curve generators. otherwise matlab or excel even, maple, mathmatica, ect ect... good luck!
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
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
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.
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
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.
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).
Thanks to everyone for their input but I've just realised that the processor I am using doesn't do floating point. I'll just use a lookup table of some description instead. Cheers, Evan.