Erratic results from magnetometer
I have an application using a LSM9DS1 with the purpose of accurately measuring the rotational speed of a platter spinning at about 33 rpm.
I measure the speed by taking readings from the gyroscope every 10ms. I did an initial calibration for offset and slope before that, but I would like to increase the accuracy by correlating the initial calibration with data from the magnetometer also.
So I added an initial calibration step by reading the X,Y measures from the magnetometer every 30ms, calculating a heading using atan2(Y, X)*180/PI +180 , and measuring the time it takes to go from heading 50º back to heading 50º again.
However, when I look at a log from the headings obtained, I see a not completely linear sequence of values, sometimes going back for 1,2 steps, before going forward again. Something like: 34, 36, 38, 33, 39, 40, 50, 45, 55, 60.....
Any idea of what may be causing this ? Maybe I'm trying to take readings too fast ?
I've set ODR at 80Hz
