05-27-2020 01:33 AM - edited 05-27-2020 01:35 AM
Hello,
I read in the datasheet that BNO055 accelerometer is using 14 bit for data output. I also found in this forum that I need to refer to BMA280 datasheet to understand the sampling rate and the relationship with bandwith. I will use BNO055 in ACCGYRO mode so it is non fusion mode and connect it to raspberrypi as host.
I have several questions regarding that:
0. Does BMA280 used in BNO055?
1. From BNO055 datasheet, the register for the accelerometer output is 2 bytes, so it is 16 bit. From the C language driver in github, it is also apparent that the reading of the register use 2 bytes (left shifting MSB with 8 bit and add the LSB). When I read BMA280, the LSB register consist of new_data flag which is the first bit and the second bit of LSB is not used. So, from what I understand, the LSB register that needed to be read is from bit 2-7. The MSB part is no problem. So, to read this, the method should be the LSB shifted to to right for 2 bit to remove the unused and new flag bit and then MSB shifted to the left for 6 bit. Then add MSB and LSB. This reading method would produce different data output. Which one is correct?
2. From BMA280, when I use 2G range, the sensitivity for 1LSB is 0.244 mg or in m/s2 it is 0.00244 m/s2. In the BNO055 datasheet, 1LSB is 0.01 m/s2. In the driver, the reading is also divided by 100. Which one is correct and which one should I use? I believe if I use non-fusion mode and set it to 2G, I would be able to get sensitivity 1LSB = 0.00244 m/s2. I would want this because I need to measure slight acceleration.
3. For the bandwith, it is written that if I use 125Hz, the sampling rate is twice that which is 4ms. I use UART/serial protocol to connect to raspberry pi. Does it mean that in my C/C++ code, I would be able to read data every 4ms? For example I use loop that read data with 4ms sleep? Any suggestion on how to obtain this data in a consistent sampling rate? What happen if I read it without sleep (infinite loop)? Will it block until I get the new data or I will get old data?
Thank you very much.
Solved! Go to Solution.
05-27-2020 08:15 PM - edited 05-29-2020 12:36 AM
First of all, the BMA280 in packaged inside BNO055. but BNO055 have also MCU inside. so what you read from BNO055 register is not just a copy of the accleration sensor register, it is read by the MCU from internal accel register, then convert to MCU register map. This means you read from BNO055 register is already convert from internal accel register and removed the unused bits.
Based on this understanding, we can discuss your question in following aspect:
1. if sensor runs in fusion mode, then the sensor range is fixed as 4G requested by the internal fusion algorithm and output data rate is also fixed as 100hz. the data restored in data register is 16 bits after calculated by the fusion lib.
2. if sensor runs in non-fusion mode, you can set different range and output data rate.
3. if sensor runs in non-fusion mode, then you select 125Hz bandwidth for accel, then the ODR is 250Hz. you will get new accel data every 4ms. Sensor have shadow register, so during the burst read, the register content will be protected, new data will not flash into register to ensure you read always matched sensor data for LSB and MSB. but when your burst read is done, then data register will be reflesh with new data. i will not suggest you to read data register without any sleep. instead, i will suggest to read every 4ms for the sensor data to get always news data.
4. Since we have MCU code to read out accel data then convert to BNO register map. the output is directly either mg or m/s2 depending on the unit_SEL register (0x3B page 0). if it is 0 means directly output as mg, so you convert hex to dec. then it is already mg value. if it is set to 1 means output is m/s2, then you convert 16 bits hex to dec then devided by 100 to get directly m/s2 value.
05-28-2020 01:19 AM
Thank you very much for your excellent explanation. I want to ask further with regard to resolution unit.
If I use fusion mode, when I have read the value from the register, the driver divide it by 100 but you mentioned that because fusion mode use 4G resolution, the resolution is 4000 (mg) / 2^15 = 0.122 mg / LSB. Does it mean that I should multiply the value by 0.122 mg instead of dividing it by 100?
I also still unsure about this part : "the 0.01 m / s2 per LSB is unit for accel offset register only". Can you explain what is for accel offset register?
05-29-2020 12:38 AM
Sorry, i think i made a small mistake in previous answer and now i fix it.
BNO055 already convert the LSB to physical value by using UNIT_SEL bit defined in register map.
So if you choose m/s2 as unit, you need devided by 100. otherwise you use the register output directly.
04-27-2022 06:11 PM
Hi
About the Acceleration range (g-range) in BNO055, if I understood well the sensor is always on +-16g range and the raw data is always between this values right (-2^14 to 2^14-1) since the accelerometer has a resolution of 14bits)? If I change to +-2g, in fact I'm still using +-16g range and the LSB keeps the same right? Cause in your BNO055 API I can't find any line of code where the g-range is used to find the mg/LSB value in order to do the conversion in floats (for example using bno055_convert_float_accel_x_msq() function).
While in BMA280 datasheet we can read that sensitivity has following values:
-> +2g: 0.244mg/LSB
-> +4g: 0.488mg/LSB
-> +8g: 0.977mg/LSB
-> +16g: 1.953mg/LSB
In BNO055 datasheet we can read that the sensitivity has only one value regardless of the g-range configured:
->1LSB/mg (or 100LSB/(m/s^2))
Can anyone please make these questions clear?
Thanks.