Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    [BMI270] Is FOC slow for a specific reason?

    aloiseau
    Member

    [BMI270] Is FOC slow for a specific reason?

    I have a BMI160-based project switching to BMI270. This project relies on BoshSensortec libraries available on github(historically BMI160_driver, now BMI270-Sensor-API).

    As opposite to BMI160 (for which library delegate the FOC process to the chip itself), BMI270 library perform the FOC itself. Both libraries exposes a foc function so this is transparent from the library user point of view.

    But BMI270 fast offset compensation calls are very slow due to their current design:

    • perform_gyro_foc performs 128 loops with 50 ms delay each (delay chosen because ODR set by set_gyro_foc_config is 25Hz / 40 ms), which results in 6,4 seconds minimum duration
    • perform_accel_foc performs 128 loops with 20 ms delay each (delay chosen because ODR set by by set_accel_foc_config is 50 Hz / 20 ms), which results in 2,56 seconds minimum duration

    This result in roughly 10 seconds to perform FOC on those two sensors, which is insanely slow for a factory. And my need is to calibrate accelerometers on factory side since products does not have a known position afterward.

     

    My questions are:

    1. Why those "slow" ODR have been chosen for FOC actions?

    • Are low ODR wanted to operate a low-pass filter for a more accurate FOC?
    • Were they chosen for wide hardware compatibility, in order to not require high speed buses and processor for this function?

     

    2. What would be the issue to speed it up?

    • Ideally, enabling FIFO and a higher ODR may collect 128 samples much faster
    • Simply a higher ODR / smaller delays, without a FIFO which may be cumbersome to implement, may lead to faster FOCs

     

    3. (extra) What would be the issue to not perform FOC at all?

    • Well, if FOC must be as slow to be good, is there a known worst offset shift to expect after BMI270 chip is soldered?
    Tags (3)
    5 REPLIES 5
    BSTRobin
    Community Moderator

    Re: [BMI270] Is FOC slow for a specific reason?

    Hello aloiseau,

    Yes, the FOC of BMI 160 is processed internally, and its FOC completion time is fast.
    For BMI 270, what is the expected completion time of FOC?

    aloiseau
    Member

    Re: [BMI270] Is FOC slow for a specific reason?

    Of course, the faster the better, but factory ask me to reach a global FOC duration (accel+gyro+saving NVRAM) under 5 seconds max.

    I was thinking about modifying the BMI270 FOC loops (increasing ODR likely), but I was unclear about current algoritm choices. I don't want to mistakently break FOC accuracy by blindly speeding it up without understanding current algorithm choices.

    BSTRobin
    Community Moderator

    Re: [BMI270] Is FOC slow for a specific reason?

    Hello aloiseau,

    To reduce the completion time of FOC, you could increase accel, gyro ODR.

    Accel ODR: higher than 50 Hz

    Gyro ODR: higher than 25 Hz

    And modify delay time in sensor API.

    aloiseau
    Member

    Re: [BMI270] Is FOC slow for a specific reason?

    Thanks,

    Yes, this is the idea I had in mind, and I will likely implement it.

    I was trying to find why Bosh chosen to implement a "slow" FOC here, in case there were specific reasons I should be aware of before speeding it up.

    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