Maker Pro
Maker Pro

Graph/Error correcting - maths formula NOT homework

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Hi,

I hope this is in the right part of the forum. I'm working on a problem at the moment where I am measuring an angle across 180 degrees using an inclinometer, however for my application I consider this -90 to 0 to +90.

From working out the mechanical position of my inclinometer, I am going to get an error between my sensor and the true angle reading. However, what i'm struggling with is mathematically finding a sensible way to correct for this error.

See my data below. The "True" column is my known angle, my "Inclinometer" column is the output I am going to get when it is mounted.

I've tried using Excel to plot various equations but cannot get them to work. I'm assuming plotting polynomials etc. are not the right approach for this application.

Can anybody offer suggestions on what to look at? Please note, this isn't homework, thanks!

Thanks,

Angles.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
If the polynomial approximation isn't good enough for your purposes, use linear interpolation between known pairs of true angle and measured angle.
To my eyes the polynomial approximation looks quite good. What is the max. deviation of the dotted line from the line marked "series 2"? Is this deviation truly too much for your purposes? If the deviation is on the order of the accuracy of the sensor (inclinometer), there's probably no good in trying to improve the approximation.
 

ratstar

Aug 20, 2018
485
Joined
Aug 20, 2018
Messages
485
looks like adding a sine wave at some amplitude would fix it.
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Thanks - when I try and use the polynomial, the graph looks good but when I try and calculate off of the equation I get a very strange output. Would I be correct, that the element of the equation for the 5th degree is:

If my input value (x) was 10 for example, it would be (0.00092245...) x (10^2) = 92.25

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
How do you arrive at a second order polynomial only? Excel tells you the polynomial it tried to fit is:
upload_2021-1-18_17-29-48.png
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Sorry, I meant ^5 not ^2. Typo! :mad:

So looking at the 5th degree:

If my input value (x) was 10 for example, it would be (0.00092245...) x (10^5) = 92.25

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
Why do you omit the other terms in the equation?
 

cps13

Feb 25, 2013
54
Joined
Feb 25, 2013
Messages
54
Why do you omit the other terms in the equation?

I only did this to check my method for the first section. Reason being is that my answers come out widely inaccurate. For example:

When X is 20:
5th degree = 2951.85...
4th degree = 7298.71...
3rd degree = 5895.31...
2nd degree = 1604.61...
1st degree = 258.14...
+ 99.97...

Brings my Y out to 2908.81 degrees.

I know from observation of the data values that X= 10 is not equal to Y=2908.81. It should be ~12.5.

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
Error 1:
For X=20 the equation in the image of post #1 results to 102. You haven't observed the signs. Some terms are positive, some terms are negative.

Error 2:
It seems that the polynomial approximation was not done using the X-values from the inclinometer but their index in the series of measurements as indicazed by the x-axis in post #1 ranging from 1...19 instead of -90...+90
Therefore using an x value from the inclinometer as input to the equation makes no sense. For X=10 the equation results in y=0.039. That's what your image shows for the poly(series 2):
upload_2021-1-21_6-5-51.png
 
Top