Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 raw to real data conversion

    BMI270 raw to real data conversion

    mycall
    New Poster

    Please please please ... I need just a little help. I have searched the web, and these forums. I have also looked at the Bosch API code on GitHub but I still don't understand. I have worked with many IMUs in the past with no issues but this part is different and the data sheet seems to be incomplete.

    I need to convert raw accelerometer data to "Gs" and raw gyro data of d/sec. This seems like it should be straight forward and should just require multiplying raw data by a conversion constant -- but I can't find a crisp answer.

    For accelerometer data I have imperially discovered (I think) to simply multiply the raw data by 0.000244140625 no matter what the sensitivity setting is. This is a magic number but closely agrees with two data sheet statements about threshold (0xAA = 93mg and 0x90 = 70mg). Both closely agree with the magic number above.

    Also max G value / 2**16 = 16/65535 = 0.000244140625. Same magic number. I hate to use such fuzzy numbers in real code though. Is accelerometer data conversion that simple?

    Just as a sanity check -- the raw Z data register (which should convert to 1G when the sensor is flat) always has approximately the same value (around 4100) no mater the sensitivity setting. Is this expected behaviour?


    As for gyro data I am at a loss.


    As I said I have looked at the API code but it is pretty dense and it appears that the range setting is needed to do the conversion -- yet my experiments seem to say otherwise.


    I am not looking for anyone to write my code -- I just need some help  finding a simple explanation of how to convert.


    Thanks in advance

    1 REPLY 1

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry and sorry for the confusion about BMI270 data conversion.

    In BMI270 datasheet at https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi270-ds000.pdf, page 12 defines the accel sensitivity of 16384LSB/g (or 0.061mg/LSB) at +/-2g full scale range and page 14 defines gyro sensitivity of 16.384LSB/dps (or 0.061dps/LSB) at +/-2000dps full scale range. Once you get signed integers from accel data registers from 0x0C to 0x11 and signed integers from gyro data registers from 0x12 to 0x17, you can simply multiply the signed integers by the sensitivity to get the meaningful values for accel and gyro.

    For example, BMI270 eval. board is being rotated randomly in 3D space. The data registers' values are captured at random time point as shown below.

    FAE_CA1_0-1663352607912.png

    Below is an example how to convert BMI270 accel and gyro raw data to meaningful values in the unit of g and dps.

    Ax = [(0x0D << 😎 | 0x0C] = 0x1655 = 5717LSB = 5717 * 0.061mg/LSB = 348.7mg = 0.3487g

    Ay = [(0x0F << 😎 | 0x0E] = 0xFF48 = -0x00B8 = -184LSB = -184 * 0.061mg/LSB = -11.2mg = -0.0112g

    Az = [(0x011 << 😎 | 0x10] = 0x429F = 17055LSB = 170557 * 0.061mg/LSB = 1040.4mg = 1.0404g

    Gx = [(0x13 << 😎 | 0x12] = 0x0148 = 328LSB = 328 * 0.061dps/LSB = 20.008dps

    Gy = [(0x15 << 😎 | 0x14] = 0xFD08 = -0x02F8 = -760LSB = -760 * 0.061dps/LSB = -46.36dps

    Gx = [(0x17 << 😎 | 0x16] = 0x05E7 = 1511LSB = 1511 * 0.061dps/LSB = 92.171dps

    On page 93 of BMI273 datasheet, you see the following,

    FAE_CA1_1-1663353410473.png

    Since no-motion interrupt threshold is represented by 11 bits which is from bit 0 to bit 10, this gives total 2048LSBs to cross the range from 0g to 1g. Then the sensitivity of no-motion threshold = 1000mg / 2048LSB = 0.488mg/LSB. So the default value of 0x90 = 144LSB * 0.488mg/LSB = 70.3mg. That is the reason why "Default value is 0x90 = 70mg." as shown above.

    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