0

I am using the BNO055 IMU and the Adafruit Library. I want to store the calibration data and load them after the microcontroller is powered off and repowered on. The Adafruit Library provides an example for storing and restoring but, in actual facts, it does not work. It is always required to recalibrate the magnetometers, but even doing so, the library reperform the whole calibration including the accelerometers.

I would like to simply restore all the calibration data (including the magnetometers) so that no calibration needs to be performed when the IMU starts.

I have read a massive amount of posts on the argument, but I really could not figure out how to reliably load all the calibration data at boot and avoid recalibrating them.

Is there anyone who succeeded and can please share the code?

asked Dec 4, 2019 at 9:35
7
  • Possible duplicate of After restoring the BNO055 offsets to the sensor the calibration values are all 0 Commented Dec 4, 2019 at 10:14
  • Actually no, it is not a duplicate at all. Indeed I am using a Teensy and Arduino. Also, that post does not show code. Commented Dec 4, 2019 at 10:32
  • read the answer in the duplicate, not the question. there is no way to avoid automatic calibration. the stored calibration is only used while the automatic calibration finishes. don't waste your time on it. Commented Dec 4, 2019 at 10:39
  • Thanks. Then what I am supposed to do? The last comment says "I would ignore the calibration. The sensor handles it. After power-up make same movements and the sensor calibrates itself. " So should I avoid any calibration in the end? And should I avoid storing the calibration in the EEPROM at all? Commented Dec 4, 2019 at 13:08
  • 1
    github.com/adafruit/Adafruit_BNO055/tree/master/examples/… Commented Dec 4, 2019 at 18:54

1 Answer 1

1

I found the solution. It is enough to add a function that when reperfoming the calibration of the magnetometer, checks ONLY if the magnetometer is calibrated (while the calibration for the accelerometer and gyroscope is reloaded from the EEPROM).

void performMagCal(void) {
 uint8_t system, gyro, accel, mag;
 system = gyro = accel = mag = 0;
 while (mag != 3) {
 bno.getCalibration(&system, &gyro, &accel, &mag);
 displayCalStatus();
 Serial.println("");
 }
 Serial.println("\nMagnetometer calibrated!");
} 
answered Dec 5, 2019 at 12:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.