Bosch Sensortec Community

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

    BHI260AP & BMM150 Measurement Performance

    BHI260AP & BMM150 Measurement Performance

    hfozturk
    Member

    Hello,

    What I Did

    I am using BHI260AP & BMM150 together with nRF52840. I upload Bosch_APP30_SHUTTLE_BHI_aux_BMM150.fw.h and the am using the API on GitHub (SHA 5b26dc4802f500f75e1086c2a156e3ecf800560c → Last Commit Before v1.4.1).

    1) After I upload the firmware I register the fifo callbacks:

    hfozturk_0-1676872187450.png

    2) Then set the virtual sensor configuration:

    hfozturk_2-1676872427236.png

    For the values:

    •  sample_rate              = 20 Hz

    •  report_latency_ms = 0

    3) To get the measurements and activate callbacks, I call the bhy2_get_and_process_fifo function with a uint8_t array of size 2048 as argument. This call occurs with a frequency of 20Hz.

    My Problem

    I do not experience a problem on obtaining the correct data at lower rotational speeds or sending it over BLE, but I have 2 problems on the performance of these measurements:

    1-When I rotate the sensor around its yaw axis, I observed that ~3 degrees of drift occurs with every full rotation. Measurements do not drift when the module is stationary.

    2-I take the measurement at a specific position, then take the module and rotate it arbitrarily. When I place the module again at the same specific position, illogically distant measurements are coming from it.

    Therefore, my question is that how can I improve the consistency of my measurements. I tried using higher frequencies for both reading the fifo and sensor sample rate. I also tried using "Geo-magnetic rotation vector wake up" sensor, since geo-referenced rotation data would be better for me. However, these do not seem to be working and I could not manage to obtain consistent measurements.

    Thank you for your time.

    7 REPLIES 7

    BSTRobin
    Community Moderator
    Community Moderator

    Hi hfozturk,

    Before you do the test, sensor calibration status need to reach 3.
    I upload example code on STM32 for your reference, enable the following code to view acc, gyro, mag calibration status(*accuracy).
    PDEBUG(",ACC,x,%d,y,%d,z,%d,accuracy,%u\r\n",
    data.x,
    data.y,
    data.z,
    *accuracy);

    Hello and thank you for your reply,

    Benefiting from the example code you have shared, I have printed the accuracy for the virtual sensors. I have observed that calibration status of sensors reach 3 as I rotate the module. At this step I wonder the following:

    •Is there a special calibration process, i.e. a predefined series of movements to calibrate sensors?

    •Which virtual sensor is best for my application, where I try to get orientation in terms of quaternions?

    •There is an adaptive calibration algorithm running inside. Is there a way to make this calibration more responsive, i.e. converge to a calibration state faster?

    After trying all rotation vector types (RV, GAMERV and GEORV), I have observed that problem is caused by magnetometer measurements. I plotted the 3D measurements of magnetometer coming from different virtual sensors and was expecting a sphere centered at the origin, but this was not the case. Following are the plots of magnetometer measurements after rotating the module around its axes:

    mag_corrected.pngVirtual Sensor: Magnetometer corrected

    mag_corrected_wu.pngVirtual Sensor: Magnetometer corrected wake-up

    mag_raw.pngVirtual Sensor: Magnetometer uncalibrated

    mag_raw_wu.pngVirtual Sensor: Magnetometer uncalibrated wake-up

    mag_pass.pngVirtual Sensor: Magnetometer passthrough

    In every case, I tried to rotate the module the same as far as I could. As you can see, correction does not seem to work at all and that is why when I use those Virtual Sensors, rotation exhibits illogical behaviour. I would be very happy if you could:

    1) Show me what can I do to fix "corrected" measurements

    2) Tell me if there is a way and how to make the algorithm use magnetometer data supplied by the user while generating quaternions.

    Thank you.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi hfozturk,

    Calibration method for accel, gyro, mag sensor, you could refer the video https://www.youtube.com/watch?v=Bw0WuAyGsnY&t=11s

    BHY2_SENSOR_ID_ORI_WU is the right sensor ID for your application.

    The calibration algorithm runs in the background, the ODR is higher and the calibration speed is faster.

    I suppose you have already done axis mapping, and the following sections of the data sheet.

    BHI260 Axis remapping.png

    Due to the use of geomagnetic sensors, it is necessary to consider these points to improve the accuracy after fusion: 1. Structurally avoid generating large magnetic interference, such as using magnetic attraction with large magnetic interference; Generally, it is necessary to perform a magnetic field test on the entire machine, generate a soft magnetic compensation matrix, and write it into the sensor.

    In addition to the above, before using fusion data, it is necessary to ensure that the calibration accuracy of acc, gyro, and mag has reached 3.

    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