kriswiner / BNO055

Teensiduino sketch for 9-axis BNO055 motion sensor + MS5637 pressure sensor
55 stars 22 forks source link

Does it need to do mag calibration every time power is up? #3

Open howardmah opened 9 years ago

howardmah commented 9 years ago

Hello Kris,

I have been testing BNO055 and found that it's hardware fusion result is very good. The result, however, is good only with good mag calibration. When I am testing it, it will be no problem to move the sensor in a 8 figure. However, if it is attached to a big body, like a robot, moving the whole thing in an 8 figure every time it reboots would not be possible. Therefore, I tried to save mag offset values and wrote them into the registers directly without calibration. It seemed not working well. It's result was very far from the accuracy with a good calibration.

Is it possible to save mag calibration and reuse it without any new calibration? If so, could you explain how to do that?

Thanks,

Howard

kriswiner commented 9 years ago

Hi Howard,

There are two ways. You could simply calculate (measure) the mag biases and hard code them into your program. Or you could store them in non-volatile flash memory or EEPROM either on a separate I2C breakout board or on your microcontroller. Most microcontrollers (like the Teensy 3.x) have some spare (~2 Kbyte) flash available and you can write small amounts of data there and retrieve it on start up. Simply writing the values into your program is surely the easiest method. This is possible since most of the mag calibration is to compensate for board stresses and other changes to the magnetometer during assembly; they don't change very much. However, if your robot has a lot of iron and high-current wires, this might be a problem since the magnetic environment will be affected by these and you might have to perform at least one bias calibration with the magnetometer in its working position; on the robot!

Kris

-----Original Message----- From: howardmah [mailto:notifications@github.com] Sent: September 7, 2015 2:12 AM To: kriswiner/BNO-055 Subject: [BNO-055] Does it need to do mag calibration every time power is up? (#3)

Hello Kris,

I have been testing BNO055 and found that it's hardware fusion result is very good. The result, however, is good only with good mag calibration. When I am testing it, it will be no problem to move the sensor in a 8 figure. However, if it is attached to a big body, like a robot, moving the whole thing in an 8 figure every time it reboots would not be possible. Therefore, I tried to save mag offset values and wrote them into the registers directly without calibration. It seemed not working well. It's result was very far from the accuracy with a good calibration.

Is it possible to save mag calibration and reuse it without any new calibration? If so, could you explain how to do that?

Thanks,

Howard

Reply to this email directly or view it on GitHub https://github.com/kriswiner/BNO-055/issues/3 . https://github.com/notifications/beacon/AGY1qi5rOUCD_m04YZtqEI0Ee7ERiQXoks5 ovUxXgaJpZM4F415m.gif

chrisspen commented 7 years ago

I'm running into the same problem. I was able to store and reload the calibration offsets, the way you describe. Immediately after loading the offsets, the system flag shows full calibration.

However, the default setting seems to have it continuously recalibrating, because the system flag, and sometimes magnetometer flag, with sometimes revert back to uncalibrated or partial calibration status. This forces me to manually move the sensor around to recalibrate it, defeating the purpose of saving the offsets.

Is there any way to disable the auto-calibration function once you've loaded the correct calibration offsets, so it doesn't lose calibration?

kriswiner commented 7 years ago

Not that I know of, but check the data sheet (tehy've added more detail on the calibration) or ask Bosch.

On Sun, May 28, 2017 at 8:18 PM, Chris Spencer notifications@github.com wrote:

I'm running into the same problem. I was y able to store and reload the calibration offsets. Immediately after load, the system flag shows full calibration. However, it seems to be continuously recalibrating, because the system flag, and sometimes magnetometer flag, with sometimes revert back to uncalibrated or partial calibration status.

Is there any way to disable the auto-calibration once you've loaded the correct calibration offsets, so it doesn't effectively lose calibration?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/BNO055/issues/3#issuecomment-304564253, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qsYx72dLjVKuAhmndnY6c2gDC-RQks5r-jjugaJpZM4F415m .

rvincent25 commented 6 years ago

I have been running into the same issue anyone found out how to prevent the IMU to recalibrate?

chrisspen commented 6 years ago

I save the last known calibration settings, and then re-load it upon power-up.

rvincent25 commented 6 years ago

That's what I do but the calibration flags are still 0 (instead of 3) after reloading the values, so I'm doing something wrong here.