Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    What is the method to calibrate Accelerometer and Gyro meter for BMX160?

    What is the method to calibrate Accelerometer and Gyro meter for BMX160?

    MKrishna
    Member

    Hi Team,

          Present, I am Working with BMX160 Sonsor . 

          What is the method to calibrate Accelerometer and Gyro meter for BMX160? i.e. Procedure of Calibrate for Accelerometer and Gyro meter on BMX160.  

          How we confirm that BMx160 of Accelerometer and Gyro meter are calibrated?

          Please provide required Info and reference documents.

     

    Thnak you,

    M Krishna.

        

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hello MKrishna,

    There was FOC in driver code, you could refer it.
    https://github.com/BoschSensortec/BMI160_driver/blob/master/bmi160.c

    Hi Team,

         Thank you for quick response.

          1. Pls let me know the procedure for Acc & Gyro calib done (tilt / rotate etc) as per code? I found below reputed links ()- Is Bosch different than these 2 links? (calibration-of-an-inertial-measurement-unit-imu, IMU calibration)

    2.  What is difference between calibration and FOC? Do we get some values from Calibration and use them for FOC? 

     

    Thank you,

    MKrishna.

     

    BSTRobin
    Community Moderator
    Community Moderator

    Hello MKrishna,

    You could get FOC description in BMX160 data sheet. https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmx160-ds0001.pdf
    FOC could conpensates offset errors of accelerometer and gyroscope.

    This is FOC exmaple code for BMX160.

    ## FOC and offset compensation
    > FOC shouldnot be used in Low-power mode
    #### Example for configuring FOC for accel and gyro

    /* An example for configuring FOC for accel and gyro data */
    int8_t start_foc(struct bmi160_dev *dev)
    {
    int8_t rslt = 0;
    /* FOC configuration structure */
    struct bmi160_foc_conf foc_conf;
    /* Structure to store the offsets */
    struct bmi160_offsets offsets;

    /* Enable FOC for accel with target values of z = 1g ; x,y as 0g */
    foc_conf.acc_off_en = BMI160_ENABLE;
    foc_conf.foc_acc_x = BMI160_FOC_ACCEL_0G;
    foc_conf.foc_acc_y = BMI160_FOC_ACCEL_0G;
    foc_conf.foc_acc_z = BMI160_FOC_ACCEL_POSITIVE_G;

    /* Enable FOC for gyro */
    foc_conf.foc_gyr_en = BMI160_ENABLE;
    foc_conf.gyro_off_en = BMI160_ENABLE;

    rslt = bmi160_start_foc(&foc_conf, &offsets, sen);

    if (rslt == BMI160_OK) {
    printf("\n FOC DONE SUCCESSFULLY ");
    printf("\n OFFSET VALUES AFTER FOC : ");
    printf("\n OFFSET VALUES ACCEL X : %d ",offsets.off_acc_x);
    printf("\n OFFSET VALUES ACCEL Y : %d ",offsets.off_acc_y);
    printf("\n OFFSET VALUES ACCEL Z : %d ",offsets.off_acc_z);
    printf("\n OFFSET VALUES GYRO X : %d ",offsets.off_gyro_x);
    printf("\n OFFSET VALUES GYRO Y : %d ",offsets.off_gyro_y);
    printf("\n OFFSET VALUES GYRO Z : %d ",offsets.off_gyro_z);
    }

    /* After start of FOC offsets will be updated automatically and
    * the data will be very much close to the target values of measurement */

    return rslt;
    }

    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