Page 1 of 1
Why the value of "MAG_GAUSS_PER_LSB" is 666.7
Posted: Tue Apr 16, 2019 11:02 am
by maksyuki
Code: Select all
#define SENSORS_ENABLE_MAG_AK8963
#define MAG_GAUSS_PER_LSB 666.7f
#define SENSORS_GYRO_FS_CFG MPU6500_GYRO_FS_2000
sensorData.mag.x = (float)headingx / MAG_GAUSS_PER_LSB;
sensorData.mag.y = (float)headingy / MAG_GAUSS_PER_LSB;
sensorData.mag.z = (float)headingz / MAG_GAUSS_PER_LSB;
I search the datasheet of the AK8963 and find the 16bit ADC sensitivity is 0.15μT/LSB. I think the output equal
"ADC value * sensitivity" which equal
"headingx / (1/0.15) = headingx / 6.667".
Thanks.
Re: Why the value of "MAG_GAUSS_PER_LSB" is 666.7
Posted: Wed Apr 24, 2019 8:09 am
by tobias
You might be on to something. I think this code originally comes from somewhere else so can't really answer why it is 666.7. I guess it hasn't caused a problem as it normally is the heading that is interesting.