Bosch Sensortec Community

cancel
Showing results for
Did you mean:
SOLVED

New Poster

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)

Timm

6 REPLIES 6
Community Moderator

Hi,

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.

New Poster

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

Community Moderator

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.

New Poster

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;
}``````

Is dig_xyz1 a "default value" in case r_hall is not available? Then I would just need to pass data_rhall = 0 to the function to disable the compensation?

I just checked one example value for dig_xyz1 which is 6417 and very similar to what I normally measure for r_hall.

Best, Timm