Quote:
Originally Posted by Greg Fordyce
Really it's just down to processor time vs. accuracy. Unlike a desktop pc, most micro-controllers are limited in their math functions, this one is signed 16 bit integer maths. The look-up table approach will sacrifice some accuracy for speed and also ease of coding. I did have a play with the equation y = 0.0000007 * x^3 - 0.00081698 * x^2 + 0.40709038 * x - 41.63772692 in openoffice and got a graph that looked just like yours! so I can use that to create a look-up table for temperature conversion. One question, what is the equation R^2 = 0.99705769 for?
|
ah, ok - i forget what micro you're using (if you mentioned). i put together a charger with an atmega16. I used the above equation and had all of the control software interrupt based. thus, whenever the main program got to the temp calculation, it was kinda like it was doing that in the background. not sure if something like that will work for what you're doing, but maybe it's an option. I just thought it was easier than coding in a lookup table, but it's definitely not faster.
The R^2 thing is a correlation factor (or something like that). the closer to 1.0 it is, the closer the curve fit is to the individual data points.