How to turn off the magnetometer on BNO055 (IMU)

Discussion in 'Test & Measurement Forum' started by anziboy, May 20, 2019.

  1. anziboy

    Thread Starter New Member

    Mar 25, 2019
    3
    0
    Hi, So I'm working on a project where my main goal is to measure the absolute knee angle using two BNO055 sensors using arduino, which I managed to figure out. I first normalized quaternions and then used this formula to get the angle between two sensors: a=2*acos(abs(w1*w2+x1*x2+y1*y2+z1*z2)).

    I get pretty good values but not so accurate (an error of 5-15 degrees).

    I was reading on the internet that the magnetometer might be causing the inaccurate values (I did calibrate it, but still getting wrong values). My question is if someone can help me how to turn off the magnetometer from my sensors, I read that turning it off will give you more accurate values. I tried to search on the internet without success. I found a datasheet from Bosch which showed the configurations, table 3-10 on page 29. https://cdn-shop.adafruit.com/datasheets/BST_BNO055_DS000_12.pdf

    However I did not fully understand how to edit the magnetometer configuration. Is there anyone who knows how I can suspend or put the magnetometer to sleep ? Would really appreciate help or guidance. I am very new in this field someone can help me with that.

    Thank you
     
  2. Wolframore

    Well-Known Member

    Jan 21, 2019
    1,075
    329
    Tthe answer appear to be on page 20 -22 of the datasheet. It's the mode setting... for your sitatuation to turn off MAG and keep GYRO and Accelerometer seems you need write to the OPR_MODE register: [OPR_MODE] xxxx0101b.

    Does this unit support quarternion? Do you like it? I've been playing with a few other units (IvenSense)... quaternion is a must to avoid gimbal lock and some units support it on board. I've found that using Kalman filtering helps a lot with IMU's.
     
  3. anziboy

    Thread Starter New Member

    Mar 25, 2019
    3
    0
    Thank you for your reply,

    I'm not sure as how to write to the OPR_MODE register, I could not find any examples online either, do you have any tips?

    I found quaternions great for measuring the angle. I did not use any filter, yet it gave me good results. I looked on kalman filter online but it seemed too complicated for me hehe.
     
  4. Wolframore

    Well-Known Member

    Jan 21, 2019
    1,075
    329
    Are you using a library for your IMU? You my have to dig into the documentation to figure out how to do this...

    Try the Kalman filtering... you may not have to turn the mag off... Once it's filtered and calibrated it should give you good readings but I'm not familiar with that unit...
     
  5. anziboy

    Thread Starter New Member

    Mar 25, 2019
    3
    0

    Thanks for the tips,
    I looked at my Adafruit library and found this:
    BNO055_OPR_MODE_ADDR = 0X3D,

    Now i changed this to 0000x1000b (Which is the fusion mode for IMU, IMU has magnetometer suspended which is why i can just use this), however, after changing my OPR_MODE, the sensors stop working and I get no values any longer. In the datasheet i found this: The alternative address 0101000b (0x28),

    I tried to write BNO055_OPR_MODE_ADDR = 0X28, but I still get NAN values.


    Any ideas what I'm doing wrong?
     
  6. Wolframore

    Well-Known Member

    Jan 21, 2019
    1,075
    329
    This is a more detailed datasheet:
    https://cdn-shop.adafruit.com/datasheets/BST_BNO055_DS000_12.pdf

    I believe all three may need to be addressed...

    Here is the area in the code that needs to be addressed:
    Code (Text):
    1. */
    2. BNO MANUAL (p70) 4.3.61 OPR_MODE 0x3D
    3. Current selected operation mode. See section 3.3 for details
    4. BNO MANUAL (p21 & p23) 3.3.3.5 NDOF: xxxx1100b
    5. This is a fusion mode with 9 degrees of freedom where the fused
    6. absolute orientation data is calculated from accelerometer, gyroscope and
    7. the magnetometer. The advantages of combining all three sensors are
    8. a fast calculation, resulting in high output data rate, and high robustness
    9. */
    10. OPR_MODE = 0x3D, // Select the involved sub-sensors
    11. CONFIGMODE = 0x00, // [OPR_MODE]: xxxx0000b
    12. NDOF = 0x0C, // Nine Degree of Freedom with fusion
    13.  
    Check all three setting...
     
  7. 1SalmanAB

    New Member

    Nov 17, 2015
    2
    0
    Hi Wolframore,

    I am fairly new to using the BNO055 IMU sensor, kindly can you direct me to an easy to understand article on how this IMU sensor works. And how should I use it to get the acceleration and angles in Euler?

    Secondly above you have mentioned using a Kalman filter, does this sensor requires a filter like that if I use it for a simple application to acquire acceleration and angles.

    I am using the BNO055 by adafruit with an Arduino board.

    Thank you for your time.
     
  8. Wolframore

    Well-Known Member

    Jan 21, 2019
    1,075
    329
    Did you read through that datasheet. You need 0000x0101b which is ACCGYRO mode, again not familiar with that unit not sure what you have to do to be able to select it. It may be as simple as writing that to the OPR-MODE register.
     
  9. 1SalmanAB

    New Member

    Nov 17, 2015
    2
    0
    Thank you for your prompt reply.

    I got it sorted =)
     
  10. Wolframore

    Well-Known Member

    Jan 21, 2019
    1,075
    329
    Please share your solution (lab results), it may help another in the future.
     
Loading...