Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMM150 calibrate

    BMM150 calibrate

    Migrant_worker
    New Poster

    hello.

    I use the X-axis and Y-axis data obtained from the BMM150 to do the following

    Compass = atan2f (mag_mx, mag_my);
    if (compass < 0)
    {
    compass+= 2 * PI;
    }
    if (compass > 2 * PI)
    {
    compass-= 2 * PI;
    }
    TCompass = compass * 180 / PI;

    When the X-axis points north, I get zero degrees, and I can rotate it to get an Angle from 0 to 360

    But as I move horizontally north, my Angle slowly increases. Is that normal?

    What causes it?

    What do I need to fix this?

    5 REPLIES 5

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    It is good that you can obtain BMM150 x/y/z raw data in the unit of uT. But you cannot directly run your atan2f function to get the heading, because every magnetometer needs to be calibrated first to remove the hard-iron and soft-iron distortions. For more details you may refer to online article at https://learn.adafruit.com/adafruit-sensorlab-magnetometer-calibration?view=all. After you calibrate BMM150 and get the normalized BMM150 x/y/z data in the unit of uT, you can use your atan2f function to get the heading.

    In addition, when you move BMM150 horizontally straight for example on a long table from point A to point B, the heading may change. This is because the environmental magnetic field at point A is different from the one at point B. This means that you need to calibrate BMM150 at both point A and point B in order to get accurate heading.

    Thanks.

    HI,

    Thank you very much for your reply
    Since this project is very urgent, I do not have more time to study the calibration of magnetometer. Could you please provide the example or procedure of BMM150 calibration?

    HI,

    In the online article you provided, the BMM150 is not one of the types of magnetometer that supports calibration

    Migrant_worker_0-1706842949361.png

     

    Hi,

    BMM150 calibration is integrated in BSX (Bosch sensor fusion) and BSX is embedded inside BHI360 smart sensor chip. This means that if you use BHI360 + BMM150, you will immediately get 9DoF sensor fusion results including heading/pitch/roll Euler angles. You don't need to develop your own calibration algorithm and heading calculation algorithm.

    In addition, BMM150 is end of life as shown in the attched PDN. You may switch to BMM350 TMR technology based magnetometer. This means that if you use BHI360 + BMM350, you will get everything right away. There are APP3.0 base board and BHI360 shuttle board available in Digikey, Mouser, etc. distributors for your quick evaluation.

    Thanks.

    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