12-21-2020 04:37 PM
Hi all,
I have a very short but important question:
Ineed to read uncompensated magnetometer values from the BMX160 (no api compensation) in uT. Unfortunately I do not know the LSB to uT conversion factor on XY and on Z for the raw data. Is it just LSB * 0.3 for both? The result seems very inaccurate (compared to the temperature compensated values).
According to datasheet:
Range XY: +/- 1300uT, 13 bit signed integer -> I assumed -1300 / -4096 = 0.31738 as conversion factor (which seems to be quite correct when comparing it to compensated values)
Range Z: +/- 2500uT, 15 bit signed integer -> I assumed -2500 / -16384 = 0.15258 as conversion factor (values cannot be correct)
Can you please help about the conversion factor LSB to uT for raw data?
Thanks in advance,
Timm
Solved! Go to Solution.
12-21-2020 06:14 PM
Hi,
Thanks for your inquiry.
It is not linear to convert BMX160 magnetometer (also called BMM150) raw data LSBs to uT. Instead, there is a formula to use factory trimmed parameters in each BMM150 and BMM150 raw data to get the final uT values. You cannot simply assume the BMM150 sensitivity based on the full scale ranges and resolution bits.
Please see the attached two PDF files about how to convert BMM150 magnetometer (inside BMX160) raw data LSBs to uT.
Thanks.
12-21-2020 06:54 PM
Dear FAE_CA1,
thanks a lot for your quick answer and the documents. Good to know that there is no linear translation from raw data to uncompensated values in uT. I saw that wrongly implemented in a lot of open source libraries.
I know the formulas for the compensation, this is already implemented and works fine. For this special project though we would need uT values without temperature compensation. Is there any way to not compensate temperature effects? For example by just passing a constant r_hall (let's say r_hall for 25°) value to the algorithm?
Thanks & Greetings,
Timm
12-21-2020 07:07 PM
Hi,
Yes, if you pass constant r_hall value to the formula, then BMM150 z axis data is no longer temperature compensated. BMM150 x and y axes data are not related to temperature compensation.
Thanks.
12-21-2020 07:18 PM
Hi FAE_CA1,
if X and Y axes are not temperature compensated, why is the r_hall value passed to the compensate_x and compensate_y functions?
Looking into the function for y compensation:
if(data_rhall != 0) {
/* Availability of valid data */
process_comp_y0 = data_rhall;
}
else if(trimData->dig_xyz1 != 0) {
process_comp_y0 = trimData->dig_xyz1;
}
else {
process_comp_y0 = 0;
}