Bosch Sensortec Community

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

    Magnetometer resets to 0 independant of angle

    Magnetometer resets to 0 independant of angle

    RonBreukers
    Member

    I am using the BMF055 on a custom board. I derived the software from the BSXLite example. My modificaqtions are minor.  I just use Euler angles instead of quaternions. Also I use Sercom1 for the sensor SPI and Sercom 3 for the uart.

    When powering on, I get after a few seconds a level 3 on the gyroscope, but in no way I can get anything else than 0 for the magnetometer or the accelerometer.

    At power on all 3 sensors are set at zero. So for instance if I have the board at 45 degrees at power on, it will show 0 degrees. When I put the board flat it shows a pitch of -45 degrees. I could possibly live with that, as the sensor will always be horizontal when powering up.

    Worse is that the heading is always set at zero, independant of the angle to the north.

    I am struggling with this already for almost a week, and I hope someone can point me to the my possible mistake. I appreciate any ideas and if some more detailed info is needed, I can go in depth.

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hello RonBreukers,

    For "When powering on, I get after a few seconds a level 3 on the gyroscope, but in no way I can get anything else than 0 for the magnetometer or the accelerometer.", could we know your SW development environment? Did you use BMF055 sensor API driver or other SW environment?

    I use the identical drivers of the example. "bmf055_sensors_initialize", "bsx_lite_initialize", "bsx_lite_raw_feed" are all identical to the BSXLite example.

    The differences are: I use "bsx_get_orientdata_euler_rad" instead of "bsx_get_orientdata_quat". I initialize the SPI for the sensors as SERCOM1 - of coarse with the same pins, and the UART uses SERCOM3. I use SERCOM5 for another UART in my application.

    Today I replaced the BMF055. The results are somewhat modified, but I am not out of the woods yet. The accelerometer / gyroscope does no longer reset to zero and indicates the correct angle after power on. Unfortunately that is not the case with the heading. It still resets to zero. Also I can not get calibration for the magnetometer and accelerometer.

    I finally figured out what happened. I started with the original demo program, and step by step introduced my changes.

    The root cause is that I do not need and use a data rate of 100 Hz. I use -for EMC reasons- a baud rate of 19200 baud and a data rate of 5 Hz. The calibration is coupled to that data rate, and thus you had to take with for instance the accelerometer calibration 20 seconds stable at each position insteafd of 1 second. Obviously that was not the way I tested the calibration. After I reset the baud rate to 115200 baud and a data rate of 100 Hz it all worked as it should.

    Maybe someone can learn from my mistake.

    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