Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI160 timing error?

    BMI160 timing error?

    JayBird
    Occasional Visitor

    Hi there,

    We are experiencing a constant yet hardware-variable error on the timing of our watermark interrupt. We have set the ODR to 50Hz and would expect an interrupt every 1.28s for a constant readout of 64 frames.

    • We have checked this on multiple PCBA's. On one board the interrupt comes constantly at 1.26s, on another board at 1.29s with exactly the same firmware build. This instead of the expected 1.28s. This was measured with a logic analyzer.
    • We have checked the available samples in the FIFO, and this is constant for each hardware implementation at 64 frames.
    • We are using the Bosch reference code.
    • We are using the protocol as described in https://community.bosch-sensortec.com/t5/Knowledge-base/BMI160-FIFO-Advanced-Usage/ta-p/8957

    We currently think it might be related to the clock calibration of the IMU. Yet, at 50Hz this error of ±2% seems quite high. We can not find how the clock on the IMU is calibrated, and hence don't know if this an inherent issue on the IMU's themselves or a synchronization error on e.g. the I2C clock coming from the MCU?

    Below you can see the hardware with a 1.29s WM interrupt cycle.

    WM_int_1290ms.png

    Below you can see the hardware with a 1.26s WM interrupt cycle.

    JayBird_5-1688647005688.png

     

    We have also performed "tap testing" on a regular interval (1min) and we can clearly see a constant offset error for each device, yet different for each device.

    device1.txt
    -----------
    Time between taps in seconds: [60.6  60.24 60.44 60.36]
    Total time in seconds: 241.64
    Total error in seconds: 1.64
     
    JayBird_0-1688646960391.png

     

     
    device2.txt
    -----------
    Time between taps in seconds: [59.2  58.86 59.06 58.98]
    Total time in seconds: 236.1
    Total error in seconds: -3.9
     
    JayBird_1-1688646960395.png

     

     
    device3.txt
    -----------
    Time between taps in seconds: [59.46 59.1  59.3  59.22]
    Total time in seconds: 237.08
    Total error in seconds: -2.92
     
    JayBird_2-1688646960397.png

     

     
    device4.txt
    -----------
    Time between taps in seconds: [59.5  59.14 59.36 59.26]
    Total time in seconds: 237.26
    Total error in seconds: -2.74
     
    JayBird_3-1688646960398.png

     

     
    device5.txt
    -----------
    Time between taps in seconds: [60.   59.6  59.84 59.74]
    Total time in seconds: 239.18
    Total error in seconds: -0.82
     
    JayBird_4-1688646960399.png

     

    Is there a way to recalibrate the clock on the IMU? Or is the variation we are seeing across boards (yet constant within every board, independent of e.g. battery voltage) related to something else?

    Many thanks, @BSTRobin for any help you can provide.

    J

    1 REPLY 1

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    BMI160 is not available for new design according to our website. Please switch to the latest IMU BMI323 which is pin-ro-pin compatible with BMI160 for your evaluation.

    BMI160 has typical ODR tolerance of +/-1% (1-sigma). So 3-sigma will be +/-3%. For example when you set BMI160 accel and gyro to 50Hz, then the real ODR from part to part will be typically in the range of 49.5Hz and 50.5Hz. Considering 3-sigma for 64 frames in FIFO at 50Hz ODR, the timing will be in the range of 1.28s +/- 0.04s which is from 1.24s to 1.32s. What you observed from different PCBs is from BMI160's ODR tolerance.

    BMI160 has 3-byte sensortime registers 0x18, 0x19 and 0x1A. It is a free running clock after BMI160 is powered on. You may search online for an algorithm about how to synchronize your MCU clock and BMI160 sensortime clock so that your every device will work the same way.

    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