I have made an Arduino based dashboard for my car, and it is working pretty good. I've just had the new dial made up with the speed and rev markings on, and this is working well for the tachometer and the rpm reading is correctly displayed with a stepper motor being driven by TeensyStep.
When I try to calibrate the speedo though, I'm finding a non-linear error of between 0 and 3mph through the speed range of 0-200. I've plotted roughly what the error is in excel and made a best fit curve that fits it very well, though it is a rather complicated 6th order polynomial. I will go through and check the stepper config to see if anything else might be causing this error, but should I need to test an adjustment scaling factor, how would I program this equation??
"y = -8E-12x6 + 4E-09x5 - 9E-07x4 + 7E-05x3 - 0.0019x2 - 0.0235x + 1.3417"