Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BMX160 read uncompensated magnetometer data

    timmbo
    New Poster

    BMX160 read uncompensated magnetometer data

    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

    6 REPLIES 6
    FAE_CA1
    Community Moderator

    Re: BMX160 read uncompensated magnetometer data

    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.

    timmbo
    New Poster

    Re: BMX160 read uncompensated magnetometer data

    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

    FAE_CA1
    Community Moderator

    Re: BMX160 read uncompensated magnetometer data

    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.

    timmbo
    New Poster

    Re: BMX160 read uncompensated magnetometer data

    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
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist