-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accelerometer calibration #16
Comments
It's more complicated than this. According to the Invensense application note on calibration, the bias is stored at 4096/LSB sensitivity IIRC. But I found that if I used this I got the wrong bias correction. So I used 2048/LSB which produced better results. This might have to do with the way I am treating the temperature bit, which I need to correct. So the point is, the scale at which the bias registers store the data has nothing to do with the scale used to collect the data. And I ended up usually just applying the bias in the main loop anyway and not using the accel bias registers. I do use the gyro bias registers though. |
It seems that I misinterpreted your code ^^'. In fact you store the bias as if it begins from bit 0 instead of bit 1. So dividing by 8 instead of 16 is correct. For the temperature bit, maybe using 0xFE mask for LSB will help : |
Yes, this is the fix. |
Hi,
for calibration of the accelerometer, you divide the bias by 8 :
accel_bias_reg[0] -= (accel_bias[0]/8); // Subtract calculated averaged accelerometer bias scaled to 2048 LSB/g (16 g full scale)
accel_bias_reg[1] -= (accel_bias[1]/8);
accel_bias_reg[2] -= (accel_bias[2]/8);
But for accelerometer, offset is for all Full Scale Range with 1024 LSB/g sensitivity, and since measurement are made in 16384 LSB/g, bias has to be divided by 16.
The text was updated successfully, but these errors were encountered: