I am trying to reverse engineer the data sent from an old CAN bus data logger. It sends a single ID which is selectable from a dip switch.
The only bit of data I am struggling with is the RPM
I plan to feed this data into a STM32F Discovery, in the past most of this type of data is linear and easy to work with, for example RPM=CANbus data x 0.32 but looking at my data below it is not linear and I cannot find a simple way of interpreting it:
RPM CAN Bus Decimal Data
1000 = 0312
1250 = 0389
1500 = 0464
1750 = 0541
2000 = 0613
2250 = 0688
2500 = 0762
2750 = 0828
3000 = 0903
3250 = 0979
3500 = 1058
3750 = 1140
4000 = 1226
4250 = 1313
4500 = 1401
4750 = 1485
5000 = 1568
5250 = 1653
5500 = 1736
5750 = 1821
6000 = 1900
6250 = 1984
6500 = 2063
6750 = 2144
7000 = 2224
7250 = 2301
7500 = 2377
So I need to come up with an equation so I can put it in my code to calculate the RPM.
RPM = Data x 0.3 + 12 is very close but not close enough
I have plotted the above on a graph and the line of best fit is: y=0.00000357058x^2+0.29145x+11.9358 but this seems very complicated to try to replicate in code and I also cant see why the designer would have made the data so complicated.
So my question is how can I take the above data and come up with an equation or code so my device can interpret the RPM from the CAN bus data?