BNO085 calibration and performance

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gammaburst
 
Posts: 1015
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO085 calibration and performance

Post by gammaburst »

Yes, gradually diminish the AC magnetic field before turning it off. An abrupt turn-off leaves the object randomly magnetized.

An old CRT color television has a degaussing coil wrapped around the perimeter of the screen to demagnetize the shadow mask. (A magnetized shadow mask deflects the three electron beams into the wrong red/green/blue phosphors.) Each time you turn on the TV, a circuit roughly equivalent to the variac method applies a gradually decreasing AC current to the degaussing coil.

Large degaussing coils: https://military-history.fandom.com/wiki/Deperming

There's no need to demagnetize soft iron because soft iron can't be permanently magnetized:
https://en.wikipedia.org/wiki/Magnetic_core#Soft_iron

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

Here are some results of my experiments and learning.

I played with a nail and a screwdriver to magnetize them and test them on non magnetized nails.
I could observe some effects when magnetizing or demagnetizing/degaussing the screwdriver or the nail, but non very reproducible and sometimes it was degaussing when I was magnetizing the object.

However I quickly tested the degausser on a BN0, but it had no effect with still false but not crazy x and y (uT) measures and a weird z measure still at -328.5 uT, which seems to be the min value of the range (see screen):
BNO085_mag_measurement_1.jpg
BNO085_mag_measurement_1.jpg (456.11 KiB) Viewed 280 times
So I came back to learning magnetizing/demagnetizing a screwdriver and a nail with the goal to get a reproducible behavior.
I used a tool magnetizer/demagnetizer to be able to compare with the coil:
magnetizer-demagnetizer.jpg
magnetizer-demagnetizer.jpg (390.66 KiB) Viewed 280 times
This tool as:
- a "+" on the magnetizing zone which attracts the North side of the needle of a compass -> it's a south pole
- a "-" on the demagnetizing zone which attracts the South side of the needle of a compass -> it's a north pole

This is based on the good to remember knowledge that the Earth has some kind of big magnet inside with its south pole (or "+" side) pointing towards the geomagnetic North Pole (counter intuitive because we always ear that "geomagnetic North Pole is in the North not far from geographic North Pole"
See https://en.wikipedia.org/wiki/Earth's_m ... roximation

Comment: I hope I'm right with -/+ and south/north. Pls. correct that if necessary.


I'll detail later on the experiments that finally brought me to a reproducible procedure for magnetizing and demagnetizing a screwdriver or an iron nail. It was subtle to catch it.

=
Here is an experiment that may bring some light on the magnetic problem with this BNO.
Let's consider the xyz frame of the right left BNO that is also indicated on the breakout board.

Photo shows the two edge to edge BNOs on a plastic case setup for 3D movement measures comparison:
BNOs.jpg
BNOs.jpg (590.96 KiB) Viewed 280 times
I approached the "+" (or south side) of the tool magnetizer/demagnetizer towards the origin/theBNO along each axis and in both directions
Ox axis negative x, growing : measure -90 uT at -150 mm -> -328.5 uT (min of range) at -45 mm from the BNO (and under 45 mm)
Ox axis positve x, growing : +328.5 uT (max of range) at 45 mm and under from the BNO, 0 uT at 80 mm, -90 uT at 150 mm and above

Oy axis negative y, growing : measure -50 uT at -150 mm -> // sames values than Ox
Oy axis positive y, growing : measure -50 uT at 150 mm -> // same values than Ox

Oz axis negative z, growing : measure -328.5 uT -> stays at -328.5 uT (min of range)
Oz axis positive z, growing : measure -328.5 uT under 25 mm -> jump to 328.5 uT at 25 mm -> 0 uT at 60 mm -> +328.5 uT at 90 mm (max of range) and stick to it.


I never used tare or calibration function on this BNO and I got it from a shop (Adafruit distributor).

I don't know the root causes (soft or hard iron or whatever) but it looks like there is a big magnetic trouble with this BNO.

I'm very curious to read you about these observations.


TODO : report about the experiments that finally brought me to a reproducible procedure for magnetizing and demagnetizing a screwdriver or an iron nail.

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

Report about the experiments that finally brought me to a reproducible procedure for magnetizing and demagnetizing a screwdriver or an iron nail.

1/ For magnetizing
- Start with the object in quasi contact with the core of the "gausser"
- Power on the coil
- Increase the distance at a speed of about 10 cm/s until the distance is 50 cm then come back until
- Power off the coil

2/ For demagnetizing/degaussing/deperming
idem but start at a distance of 50 cm then let's put in quasi contact the object with the core then come back to distance of 50 cm

Tests:
- with a thin 0.05 mm insulant (adhesive tape) over the core
- with a thick 2 mm insulant
- without any insulant
For magnetizing, this has no importance
For demagnetizing, I still have to check if touching the core without any insulation cancels the demagnetization.

The above procedure was not sufficient to get reproducibility.
Sometimes it worked and sometimes no in a surprising way.
In parallel, the trials with the red tool magnetizer/demagnetizer was always working and with a greater magnitude (more powerful magnetization).

Especially for magnetizing, the trick was to power off the coil just when, say the nail, was attracted by the core. Then it was magnetized and able to attract a non magnetized nail.
If I waited just a little bit more (maybe 100-200 ms) letting the nail touching the core, it got not magnetized. Even with thin or thick insulant, or naked core.

With repetition I was able to feel when rattling was coming the right moment for powering off the coil. This gave me reproducibility.

I don't know how to explain that. Can you explain that?

I could also play with magnetizing a nail or screwdriver with the red tool magnetizer then demagnetize/degauss it with the blue coil. Or the opposite, magnetizing with the coil then degaussing with the red tool demagnetizer.

User avatar
jps2000
 
Posts: 811
Joined: Fri Jun 02, 2017 4:12 pm

Re: BNO085 calibration and performance

Post by jps2000 »

A degausser is not intended to magnetize.
It only magnetizes when the coil is switched off when the sinus has its peaks. At zero crossing there is no effect. So it gives random results as you do not know where the sinus is

Again
To degauss switch on the coil >50cm apart.
Then approach the coil to the object.
Then move away >50cm WHILE THE COIL IS STILL ON!!!!!!!!!!!!!!!!!!
Then switch off when > 50cm away

Do NOT use the red magnetizer you get weird results if not a cylindrical object.
Keep such stuff away from the sensors!!!!.

Take all magnets away from the bno´s Degauss the boards as describen and then go outside and look what the sensor is reporting.
Do you wear a magnetic belt buckle, watch, car key?

When the xyz reading is constant even when moving the board then the magnetic source is on the board .
It is quite difficult to follow the plenty infos you give

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

Ok. I refocus on degaussing.
No red tool magnetizer/demagnetizer. No magnet.

"Constant z value for magnetic field is caused by a problem on the board." yes !

You explained the random magnetization of objects with the blue degausser. I may read somewhere how to magnetize with a coil…

For degaussing, here is my expression of the degaussing procedure :
- Start with the object 50 cm away (at least) from the degausser
- Power on the coil
- Reduce the distance at a speed of about 10 cm/s until close to the degausser WITHOUT touching it
- Come back to the initial position
- Power off the degausser

To be 100% sure, is it correct and complete?

User avatar
gammaburst
 
Posts: 1015
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO085 calibration and performance

Post by gammaburst »

That red tool demagnetizer contains permanent magnets and probably won't do a good job degaussing a BNO085. Here's how it works:
https://www.youtube.com/watch?v=RazORgAqEUc

Here's a short video showing degaussing a breadboard with a handheld mag tape eraser. Notice the eraser's on/off light. The eraser's AC electromagnet is located at the center of its bottom surface and is pretty strong - it can lift a pipe wrench, a framing hammer, etc.
MVI_2659.zip
Video - degaussing a breadboard with a tape eraser
(942.94 KiB) Downloaded 9 times
A frame from that video:
MVI_2659.jpg
MVI_2659.jpg (99.53 KiB) Viewed 246 times

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

Thanks for the video Mystery of the Demagnetizer | What's inside? How does it work? about the (red) tool magnetizer&demagnetizer. There are many boring or simplistic videos about that mysterious device.
The guy uses a hall probe/teslameter then breaks the device and the mystery.
Now I understand and know how to reproducibly magnetize/demagnetize a metallic object with just one simple magnet.
Thanks.


Let's get to the point.
Good news!
With my (blue) degausser I exactly reproduced the way you move and power on&off your venerable tape eraser on your boards: it has an immediate effect on the magnetometer measurements WITHOUT these weird min or max of range values.
02_BN0_1_01_mag_measurement_after_degaussing.jpg
02_BN0_1_01_mag_measurement_after_degaussing.jpg (87.45 KiB) Viewed 235 times
Yeah! Thanks.

The KEY POINT is that you wipe the board on BOTH faces while I was just doing it on one side (remember the 4 steps procedure).
You should also remember that the two BNOs were fixed to a plastic case with a double face adhesive tape. So I tried to degauss the glued face from inside the case but it had no noticeable effect.
Hence I took off each BNO from the plastic case and took between two fingers or in a small plastic bag to ease handling when degaussing.
An adhesive tape on the head of the degausser's core prevented any ohmic contact with it (as I understood it may cancel degaussing - to be confirmed).
I'm not sure but I had the perception of a repulsion when I approached the degausser from the bottom of the most magnetized BNO. I had not the same perception when degaussing again the same board. This is very subjective.
Thats all, folks! :-D

Afterwards, there were some small difficulties after powering off and on again the MCU and BNO with again a value of -328.5 uT displayed for z mag field measure (and also too high value for x mag field).
02_BN0_1_mag_measurement_02_after_degaussing_after_on&off.jpg
02_BN0_1_mag_measurement_02_after_degaussing_after_on&off.jpg (95.45 KiB) Viewed 235 times
But after a few seconds (4-9 s) and maybe some movements, the "Calibration Accuracy" or so-called status ("Accuracy" on the screen) went from 0 to 2 or directly to 3 and the displayed measures were sound again:
02_BN0_1_mag_measurement_03_after_degaussing_after_on&off_and_pause.jpg
02_BN0_1_mag_measurement_03_after_degaussing_after_on&off_and_pause.jpg (84.37 KiB) Viewed 235 times
Then after a few seconds the measures were close to those of the first photo, i.e. close to NOAA tables, and close to the ST magnetometer sound measures I recently got as a comparison.

Switching off and on again gave the same result:
- 8-15 s moving the BNO to get a status of 3 and sound measures (good but too long)
- not moving the BNO keeps it with its weird z measure (min or max of range or not far).

Thanks for your support to get this result.

NEXT
Do you think I should degauss the BNO breakout boards again several times ?

And/or do you think there is something to do on the SW side such as manually save the calibration values? (but I understand that the BNO is supposed to do it automatically)

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

PS : I just tested the program with quaternions and their conversion to Euler angles.

Setup : the two BNOs breakout boards are placed edge to edge glued on a plane plastic case (with the same orientation of the body frame of each sensor)
BNOs.jpg
BNOs.jpg (590.96 KiB) Viewed 231 times
With reportType = SH2_GYRO_INTEGRATED_RV (last value I tried):
- roll bias: 0.1 to temporarily 1.0° (bias is defined as the difference between the measure of each BNO)
- pitch bias: +0.2 to -0.5°
- yaw bias: -0.8 to +0.9°
Status (cal accuracy) = (0, 0)
Ccl : measures are excellent. Status is surprinsingly 0 with this reportType

With reportType = SH2_ROTATION_VECTOR :
- roll bias: idem
- pitch bias: idem
- yaw bias: -3° to +3°, sometimes 5 to 7° (up to 11°) then coming down sometimes to a measure under 1°
Status (cal accuracy) = (3, 3)
Ccl : measure of yaw bias is less accurate than with SH2_GYRO_INTEGRATED_RV.


With reportType = SH2_ARVR_STABILIZED_RV :
roll bias is under 1° temporarily under 2°
pitch bias is near 0°
yaw bias is between 2 and 7° when moving.
Ccl : measures of yaw bias is less accurate and not enough for a demanding application

With reportType = SH2_GAME_ROTATION_VECTOR :
roll bias is about 1°
pitch bias is near 0°
yaw bias is approx 0.05° and always under 1° when moving.
Status (cal accuracy) = (3, 3)
Ccl : Great.

Compared to magnetic measures that require some time and movement, the 9D sensor gives immediately sound measures (except the important yaw bias for RV and ARVR_RV that need to be fixed). Certainly because of the sensor fusion (acc+gyro+mag) helping each other.

Really great!
Thanks.

How do you think we can use RV/Rotation Vector with a better yaw bias?
What is your best measure for yaw bias?

User avatar
jps2000
 
Posts: 811
Joined: Fri Jun 02, 2017 4:12 pm

Re: BNO085 calibration and performance

Post by jps2000 »

Hi
good to read about a progress.
I do not think that Rotation Vector is worse than others. It could be just a random effect. Important is to hold the BNO on a stable ( = constant) temperature. The on/off / on is not so good. There is a not disclosed code inside to compensate for gyro drift mainly caused by temperature changes. I considered once a thermostat controlled housing like known from crystals but I never realized that. I think wrapping in styropor. no external heat sources and cal after 3 min will do.
I found it also useful to safe periodically the cal data to compensate drift. The BNO is doing this for you automatically in case you put this command in the setup
/* The calibration data in RAM is always updated in background. 'Save DCD' push the RAM record into the FLASH for reload @ next boot.
The algorithm will only update the calibration data when it feels the current accuracy is good. You don't need to care about the status or heading error.
Save before power off or whenever you would like to do. (Hillcrest information)
*/
I have no idea how it is done in the SH2 software as I use always my own. But sure you can find that out.

By the way
I tried to estimate the field strenght in the center of a single wire loop having 1 cm diameter and 10mA current.
It is the law of Biot Savart
B= u*I/2*R in Tesla
R =5 *10^-3; I =1*10^-2; u =4*PI*10^-7
Hence B is 1.26 uT
So my conclusion is that the high z values you measured could not come from current loops on the PCB

PS; ohmic contact does not cancel degaussing. But you should come close to the the components (< 1-2 mm) for a good effect.
After degaussing do no come too close with strong magnets to the boards

User avatar
gammaburst
 
Posts: 1015
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO085 calibration and performance

Post by gammaburst »

Hi lumex. I am happy to hear your progress.

It is possible that your project was much more strongly magnetized than my projects, and those extreme conditions may have caused malfunctions that I've never experienced. I'm not certain, but I think the BNO085 tries to compensate for magnetic bias by estimating the magnetic error and then storing correction factors in its non-volatile memory. So after degaussing, you may need to help it recover, perhaps by repeatedly rebooting then spin it around, then reboot again. I don't know, try different things. The product's documentation isn't very helpful. jps2000 probably has more experience about those things than I do.

Don't try to exactly follow my degaussing video. That was a casual imprecise operation, like spray painting graffiti. My tape eraser is pretty strong, so almost any similar wiping motions will have good results. I'm guessing your degausser is less powerful, so you may want to move it differently. Or perhaps your procedure was fine, because you are beginning to see results similar to the NOAA prediciton.

I have not observed any temperature sensitivity, however my BNO devices all live in a temperature controlled office. My BNOs are all reasonably stable and repeatable. Each BNO device dissipates very little power, so I would expect only minimal self-heating effects, although jps2000 probably has more experience here.

jps2000, when using your magnetic valve/bolt/nails degausser, what is its largest induced voltage into a nearby loop of wire? (Try various diameters.) My tape eraser induces about 60mV RMS (excluding the turn-on turn-off glitches) into a 4 cm diameter loop, so it will probably never forward-bias a semiconductor with damaging current.

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

I'm happy too. Thanks.

Since Monday, with reportType = SH2_ROTATION_VECTOR, roll bias and pitch bias (between 2 BNOs) still appear very good (< 0.5 or 0.15°). Yaw bias stays around 4-6°. Status (calibration accuracy) goes to 3 for each BNO within 1-3 s as soon as the sensors are slightly moved.

As I more need synchronized heading between two BNOs, I think I will go with SH2_GAME_ROTATION_VECTOR.
I don't yet know how to get better yaw bias with SH2_ROTATION_VECTOR or other reportType.

I'm currently doing various tests on other BNOs (degaussing, reportType, initial orientations - because it won't always be working in a horizontal orientation).


There are two magnetic things I would also like to do:

1/ make a coil to get a comparison with the "blue degausser" and try to get a perhaps equivalent or better degausser that the radio shack bulk tape eraser ("1 mn on/20 off").

I would like to use the following formula:
B = N * μ0 * I * (sin α)^3 /2R
α: half top angle between the considered point P on the axis of the coil and the coil (hence maximum mag field in the center of the coil)
mains/AC is used.
What would be the specification for such a coil and degausser? And security requirements?

2/ measure the magnetic field generated by a coil, using a loop/coil
The LSM303AGR ST magnetometer has a ±5 mT magnetic dynamic range. Let's assume that a bulk tape eraser generates more that 5 mT.
jps2000 computes a mag field induced by a 10mA current in a 1 cm diameter loop (law of Biot-Savart).
gammaburst says: 'My tape eraser induces about 60mV RMS (excluding the turn-on turn-off glitches) into a 4 cm diameter loop" -> What are the position and distance of that loop related to the tape eraser?
What would be the minimal setup for such a magnetic field measurement with a coil?

User avatar
jps2000
 
Posts: 811
Joined: Fri Jun 02, 2017 4:12 pm

Re: BNO085 calibration and performance

Post by jps2000 »

Hi,
I think there is no better degausser. The principle is to apply a magnetic field strength higher then the remanent magnetic field. so when you have about 500 uT according your reading so it is possible to degauss with fields > 2x500uT = 1mT because you have to apply opposite field. Then you need to diminish the applied AC field to zero to bring the remanence close to zero.
A stronger degausser can mainly degauss bigger parts at once. The field strength reduces with the power of 3 ( if I remember correctly) of the distance. So there is much higher influence than with the current or number of turns . (directly proportional)

double turns, double current = double field strength. Half distance = 8 times field strength

User avatar
gammaburst
 
Posts: 1015
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO085 calibration and performance

Post by gammaburst »

Hi lumex,
Some of your new goals seem to conflict with the BNO085 datasheet.
Datasheet quotes:
- "The rotation vector is the most accurate orientation estimate available."
- "In practice the rotation vector is typically accurate to 5 degrees ..."
- "The game rotation vector does not use the magnetometer to correct the gyroscopes drift in yaw."
- "The game rotation vector ... is produced by fusing the outputs of the accelerometer and the gyroscope (i.e. no magnetometer)."

Regarding the degausser:

Build yourself a simple wire loop probe (maybe a few different sizes), connect it to an oscilloscope, move and tilt the probe around your degausser, and observe the induced AC voltage. The voltage is proportional to (the derivative of) the AC magnetic flux passing through the loop.
4 cm and 1 cm magnetic probes with BNC cable for oscilloscope
4 cm and 1 cm magnetic probes with BNC cable for oscilloscope
IMG_2660a.jpg (208.09 KiB) Viewed 189 times
I observed the highest voltage with a 4 cm diameter loop placed flat against the bottom center of my tape eraser. A too-small loop doesn't capture all the emitted flux. A too-large loop captures some of the returning (opposite direction) flux, which subtracts instead of adds.
Tape eraser with 4 cm magnetic probe
Tape eraser with 4 cm magnetic probe
IMG_2664a.jpg (152.49 KiB) Viewed 189 times
UPDATE

I have since discovered that a 4 cm square loop captures a little more flux (about 80mV RMS) than a round loop (about 60mV RMS). That suggests the tape eraser's internal electromagnet has a square or rectangular shape. I confirmed that by using a piece of "magnetic view film" (Adafruit sells one but it's rather small). If I were to break open the tape eraser, I think I would find an ordinary (low cost) AC power transformer (sometimes constructed from separate E-core and I-core sections) with the I-core section removed, and the now-open E-core aimed out the bottom of the tape eraser. Also perhaps 1500 turns of wire (120V / 80mV). Maybe like this:
Tape eraser showing possible electromagnet
Tape eraser showing possible electromagnet
IMG_2664b.jpg (238.55 KiB) Viewed 189 times

User avatar
lumex
 
Posts: 52
Joined: Tue Aug 24, 2021 5:40 am

Re: BNO085 calibration and performance

Post by lumex »

Hi jps2000, Hi gammaburst,

Thanks for this interesting information. I'm about doing some experiments with a loop and an oscilloscope.

Regarding game rotation vector or rotation vector or other report types, I think I should do some mechanical measurements of the board/case to be able to compare and evaluate the accuracy of the BNO with various report types. Have you ever experimented such setup?

Regarding magnitude of the magnetic field and its measurement
I understand that it's 1/r within the coil and 1/r^3 far away from the coil.
See that discussion : https://www.physicsforums.com/threads/m ... ce.522223/
It would be nice to have an idea of the transition from 1/r to 1/r^3 range, in consideration of our range (0.0-0.5 m). With a measurement loop...

What do you think about using a Hall sensor to locally measure the remanent magnetic field around the board? Or to measure the variation of magnitude related to distance from coil?

Logistics
I need additional BNO085 but they are out of stock for a long time with unknown availability.
Do you have some experience with these IMUs (that are i, stock) and that could require minimum adaptation of the BNO085 setup?
BNO055 (2472)
Adafruit LSM6DSOX + LIS3MDL - Precision 9 DoF IMU (4517)
Adafruit LSM6DS3TR-C + LIS3MDL - Precision 9 DoF IMU (5443) ?

User avatar
jps2000
 
Posts: 811
Joined: Fri Jun 02, 2017 4:12 pm

Re: BNO085 calibration and performance

Post by jps2000 »

Many IMU seem to be out of stock. Probably The BNO will be discontinued. They are not produced at the moment but sometimes sold in aliexpress for 10 times the old price. They are used for drones in the war...... :-(
I have only poor experience with external fusion software. I could never reach the BNO080 performance.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”