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
jps2000
 
Posts: 811
Joined: Fri Jun 02, 2017 4:12 pm

Re: BNO085 calibration and performance

Post by jps2000 »

you should degauss also the controller when you are that close.
Also usb connectors and cable connectors are magnetic or represent at least soft iron
Note to compensate soft iron effects you need to do the calibration movements having all those pieces in a constant position to the BNO.
Best is to bolt the controller / display and the BNO´s all on a wooden or plastic board (!! with brass screws or plastic standoffs !!!).
Then do calibration and tests.
Also batteries have are critical. They must not wobble around relatively to the boards

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

Re: BNO085 calibration and performance

Post by lumex »

@jps2000: thanks for your explanation about Q point.
And also for recommending to also degauss the controler and all the stuff. Let's go for that!
With all the stuff in a fixed position on a wooden/plastic .board

Now it seems a good thing to test your unbloated library.
I just tried Arduino_BNO080_2.ino
q1, q2, q3 have the expected behavior, Status is 3 but E (Estimated heading : H_est ; (see Arduino_BNO080_2.ino#L261 ) is supposed to be in degrees and in the range [0; 360°[ . But a small measure was displayed...

After a few tests, it appeared that it requires a lot of time to reach the estimated heading (yaw).
Example : turning the BNO from North to east
It took 5mn starting from 0° for reaching 45°.
18:54:30.282 -> S 3; E 3.5; q0 0.8854; q1 0.125; q2 0.097; q3 -0.437
...
18:59:39.314 -> S 2; E 45.0; q0 0.7571; q1 0.141; q2 0.065; q3 -0.634
...
19:07:40.843 -> S 1; E 75.0; q0 0.7618; q1 0.141; q2 0.066; q3 -0.629
...
19:14:36.565 -> S 1; E 90.0; q0 0.7529; q1 0.142; q2 0.064; q3 -0.639
...
19:21:37.275 -> S 0; E 103.0; q0 0.7571; q1 0.142; q2 0.065; q3 -0.634

E is going far after 90°/E but Status/accuracy is 0 because there is no more movement.

Moving the BNO makes Status 3 but E is starting again from 6.5° :
19:24:01.837 -> S 3; E 6.5; q0 0.8674; q1 0.306; q2 -0.360; q3 -0.156


Can you observe that behavior?

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

Re: BNO085 calibration and performance

Post by jps2000 »

Seems correct. You need to move it around until E is about 2 degrees or so E should finally be very small!!! because it is an estimated error. ofcourse S=3 then
so E is NOT yaw!!!!!!!!!
in the utilities you find how to convert quaternions to Euler angles

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

Re: BNO085 calibration and performance

Post by lumex »

Yes, E si for Estimation of heading accuracy estimation (H_est) !! :-D
Moving around the BNO (and battery+ controler on a board) gives not E approx. 2°.

Here is a sample:

22:48:19.448 -> S 3; E 4.0; q0 0.9549; q1 0.029; q2 0.153; q3 0.254
22:48:20.450 -> S 3; E 4.0; q0 0.9548; q1 0.029; q2 0.153; q3 0.254
22:48:21.453 -> S 3; E 3.8; q0 0.9549; q1 0.029; q2 0.153; q3 0.254
22:48:22.456 -> S 3; E 3.5; q0 0.9551; q1 0.029; q2 0.153; q3 0.253
22:48:23.458 -> S 3; E 3.7; q0 0.9555; q1 0.029; q2 0.153; q3 0.252
22:48:24.461 -> S 3; E 3.7; q0 0.9560; q1 0.030; q2 0.153; q3 0.250
22:48:25.464 -> S 3; E 4.1; q0 0.9562; q1 0.030; q2 0.153; q3 0.249
22:48:26.466 -> S 3; E 4.0; q0 0.9383; q1 0.074; q2 0.125; q3 0.315
22:48:27.469 -> S 3; E 6.8; q0 0.9695; q1 -0.002; q2 -0.072; q3 0.235
22:48:28.468 -> S 3; E 8.6; q0 0.9252; q1 0.177; q2 0.269; q3 0.203
22:48:29.452 -> S 3; E 6.6; q0 0.9599; q1 -0.244; q2 -0.025; q3 0.135
22:48:30.454 -> S 3; E 7.6; q0 0.9010; q1 0.318; q2 0.278; q3 0.102
22:48:31.457 -> S 3; E 7.9; q0 0.9670; q1 -0.225; q2 0.103; q3 0.061
22:48:32.413 -> S 3; E 8.1; q0 0.9711; q1 0.187; q2 -0.052; q3 0.140
22:48:33.416 -> S 3; E 6.1; q0 0.8891; q1 0.399; q2 0.219; q3 -0.049
22:48:34.415 -> S 3; E 14.4; q0 0.9252; q1 -0.215; q2 0.238; q3 -0.202
22:48:35.422 -> S 2; E 18.5; q0 0.9543; q1 0.235; q2 -0.110; q3 -0.148
22:48:36.425 -> S 2; E 16.8; q0 0.8144; q1 -0.051; q2 0.322; q3 -0.480
22:48:37.427 -> S 2; E 23.7; q0 0.5145; q1 0.454; q2 -0.415; q3 -0.597
22:48:38.430 -> S 2; E 14.3; q0 0.0469; q1 -0.037; q2 0.292; q3 -0.954
22:48:39.433 -> S 2; E 14.2; q0 0.7449; q1 -0.283; q2 0.189; q3 0.575
22:48:40.392 -> S 2; E 13.1; q0 0.5932; q1 0.553; q2 0.464; q3 0.359
22:48:41.395 -> S 3; E 7.4; q0 0.0597; q1 0.004; q2 0.538; q3 -0.841
22:48:42.398 -> S 3; E 10.7; q0 0.5896; q1 0.147; q2 0.083; q3 -0.789
22:48:43.401 -> S 3; E 9.1; q0 0.3635; q1 0.700; q2 -0.122; q3 -0.603
22:48:44.403 -> S 2; E 8.1; q0 0.5876; q1 -0.059; q2 0.392; q3 -0.705
22:48:45.406 -> S 3; E 8.2; q0 0.3177; q1 0.234; q2 0.050; q3 -0.917
22:48:46.409 -> S 3; E 8.2; q0 0.0835; q1 0.337; q2 -0.156; q3 -0.924
22:48:47.411 -> S 3; E 5.7; q0 0.5702; q1 0.011; q2 0.254; q3 -0.781
22:48:48.367 -> S 3; E 10.6; q0 0.2833; q1 0.331; q2 -0.178; q3 -0.882
22:48:49.370 -> S 2; E 14.4; q0 0.6658; q1 0.003; q2 0.241; q3 -0.706
22:48:50.373 -> S 3; E 7.0; q0 0.7132; q1 0.136; q2 0.088; q3 -0.682
22:48:51.375 -> S 3; E 4.5; q0 0.7360; q1 0.145; q2 0.093; q3 -0.654
22:48:52.378 -> S 3; E 3.9; q0 0.7634; q1 0.141; q2 0.087; q3 -0.624
22:48:53.381 -> S 3; E 7.2; q0 0.6205; q1 0.200; q2 0.212; q3 -0.728
22:48:54.383 -> S 3; E 8.1; q0 0.8728; q1 -0.102; q2 0.097; q3 -0.467
22:48:55.386 -> S 3; E 8.3; q0 0.6847; q1 0.399; q2 0.144; q3 -0.593
22:48:56.389 -> S 3; E 5.6; q0 0.7045; q1 0.223; q2 0.331; q3 -0.587
22:48:57.352 -> S 3; E 4.6; q0 0.7507; q1 0.224; q2 0.291; q3 -0.549
22:48:58.354 -> S 3; E 6.4; q0 0.9115; q1 0.119; q2 0.143; q3 -0.367
22:48:59.357 -> S 3; E 4.8; q0 0.9722; q1 0.091; q2 0.133; q3 -0.170
22:49:00.371 -> S 3; E 4.6; q0 0.9834; q1 0.080; q2 0.135; q3 -0.092

Those measures of E make me think to my usual yaw bias (between 2 BNOs).

Here is another sample with E approx. 20 30 and even 40°:

2:44:02.246 -> S 3; E 5.4; q0 0.0539; q1 0.144; q2 -0.058; q3 -0.986
22:44:03.233 -> S 3; E 5.5; q0 0.0541; q1 0.143; q2 -0.055; q3 -0.986
22:44:04.246 -> S 3; E 7.2; q0 0.0694; q1 -0.185; q2 -0.030; q3 0.980
22:44:05.219 -> S 3; E 13.4; q0 0.6315; q1 -0.234; q2 -0.068; q3 0.737
22:44:06.235 -> S 3; E 14.9; q0 0.4460; q1 -0.118; q2 -0.018; q3 0.887
22:44:07.225 -> S 2; E 9.8; q0 0.8974; q1 -0.203; q2 0.171; q3 0.353
22:44:08.228 -> S 3; E 8.7; q0 0.9203; q1 0.131; q2 0.193; q3 0.315
22:44:09.207 -> S 3; E 9.0; q0 0.9527; q1 0.101; q2 0.087; q3 0.275
22:44:10.194 -> S 2; E 16.1; q0 0.6632; q1 0.638; q2 0.365; q3 0.144
22:44:11.207 -> S 2; E 14.5; q0 0.8451; q1 -0.262; q2 -0.117; q3 0.451
22:44:12.200 -> S 3; E 10.5; q0 0.3103; q1 -0.040; q2 -0.041; q3 0.949
22:44:13.203 -> S 2; E 19.8; q0 0.8589; q1 -0.096; q2 -0.135; q3 0.485
22:44:14.221 -> S 2; E 32.1; q0 0.7439; q1 0.224; q2 0.195; q3 0.600
22:44:15.191 -> S 2; E 10.2; q0 0.3823; q1 0.123; q2 0.273; q3 -0.874
22:44:16.174 -> S 3; E 5.4; q0 0.8812; q1 -0.035; q2 0.172; q3 -0.439
22:44:17.196 -> S 3; E 4.2; q0 0.9318; q1 0.035; q2 0.142; q3 -0.332
22:44:18.200 -> S 2; E 22.6; q0 0.9676; q1 -0.023; q2 0.187; q3 -0.168
22:44:19.202 -> S 2; E 24.8; q0 0.9402; q1 -0.181; q2 0.272; q3 0.097
22:44:20.158 -> S 2; E 42.2; q0 0.9703; q1 0.108; q2 0.217; q3 0.011
22:44:21.161 -> S 2; E 11.0; q0 0.9508; q1 0.058; q2 -0.247; q3 -0.177
22:44:22.164 -> S 2; E 22.2; q0 0.9468; q1 0.206; q2 0.108; q3 -0.223
22:44:23.177 -> S 2; E 12.7; q0 0.8946; q1 0.290; q2 0.276; q3 -0.200
22:44:24.180 -> S 2; E 11.3; q0 0.8690; q1 0.258; q2 0.331; q3 -0.263
22:44:25.193 -> S 2; E 11.8; q0 0.9581; q1 -0.108; q2 -0.192; q3 -0.182
22:44:26.143 -> S 2; E 17.2; q0 0.7495; q1 0.547; q2 0.179; q3 -0.328
22:44:27.146 -> S 2; E 20.6; q0 0.9805; q1 -0.092; q2 0.118; q3 -0.127
22:44:28.139 -> S 3; E 7.2; q0 0.9831; q1 -0.074; q2 0.077; q3 -0.148
22:44:29.141 -> S 3; E 4.6; q0 0.9884; q1 -0.094; q2 0.075; q3 -0.092

I observe yaw deviation to North with a compass while you extract heading accuracy from reports (computation). Which confidence can we get from these reports, theoretically? from your experience?

You said "You need however to find a timepoint with a known angle and set an offset as zero."
If it's not possible to calibrate each BNO during operations, before sending them in nature, at least is it enough feasible to degauss all the boards and cables and to calibrate each BNO so it knows where is down and where is North?...

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

Re: BNO085 calibration and performance

Post by gammaburst »

No jumps when using only one BNO? That's an important discovery! Recall we discussed that around Aug 1 or 2.

I'm looking again at your first two LCD images in message viewtopic.php?p=937228#p937228. I still don't understand what those two images are trying to say (before and after a jump?), but anyway, each image shows two quaternions, one for each BNO, eight values total. If I rotate one of the images 180 degrees, those eight values now match very closely. Is that a weird coincidence, or a clue?

When I rotate my BNO breadboard in 90 degree steps around the Z axis, the magnetometer readings "rotate" very well, within 2 uT. By the way, I'm reading report SH2_MAGNETIC_FIELD_CALIBRATED:

Code: Select all

  X   Y   Z
 -7  21 -24
-21  -9 -23
  9 -22 -23
 21   9 -24
Each time that you degauss your project, repeat the calibration dance. I rotate the project 360 degrees around each of its three axes. I'm not sure if that's a proper dance, but it seems to work.

My tape eraser's on/off trigger switch broke today. I disassembled the enclosure (pry away the right-side label to reveal two screws) and then repaired the (designed to fail) plastic backstop for the trigger. Here's an image of the innards. Notice the predicted EI-core power transformer with its I-core section removed:
Tape eraser innards
Tape eraser innards
IMG_2680a.jpg (300.12 KiB) Viewed 480 times

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

Re: BNO085 calibration and performance

Post by jps2000 »

Great that everything is on a stable breadboard now.
What you facing now is a problem of drift and reaction of internal calibration activity.
When using my software activate also the cal button and output yaw , pitch roll, S, and E.
Then ( ideally outdoors by avoiding sun radiation, strong winds on the sensors) redo full calibration
1) warmup 2-3 min
2) Imagine the sensor is in the middle of a cube. Place the sensor on ALL 6 surfaces. ( Stable position about 2 seconds each. This cals acc and gyro.
3) Instead some figure of eight acrobatic slowly rotate the sensor around ALL axes ( about 1 turn per second) CLOCKWISE AND COUNTERCLOCKWISE.
Then you should achieve E close to 2deg
4)Press the cal button.
My software does this then automatically every 5 min as activated in the setup
At power on cal data is re- loaded automatically.

The BNO and works best when movement and still phases are coming alternating as during natural movement.
Absolute orientation is tilt compensated. Hence yaw should point north / south despite the sensor is not level. Consequently all 9 sensors need to be calibrated and having no drift. Otherwise also the simple magnetometer function show a drift although the sensor is not drifting.
Gyro drift is most critical and the BNO gyro does not seem to be the best in town. But they do their best to continuously compensate this with their software.
A particular problem is for example on a boat when the waves do not pause. Then it is best - like a neeedle compass to mount the sensor on a gyro platform getting a better yaw.

Individual sensor drift is best monitored by looking at the raw sensor data.
Note that degaussing problems introduce a constant deviation. It can not cause drift.
Hence the instabilities you reported above have nothing to do with poor degaussing once magnetometer shows normal values.

Remember you started with > 300uT Then degaussing is well justified

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

Re: BNO085 calibration and performance

Post by lumex »

Hi,

@gammaburst: congratulations for your design prediction about the Bulk tape eraser!
This is really a simple coil+core+switch+light.
btw, as a "side-side question" (classified in a topic "Coils&Co : Helmholtz coil, Rogowski coil, etc." !): would you be able to make one with soft iron sheets and enameled copper? How much time do you think necessary to make one (with a wooden manual machine to make the coil)? However there may be a regulation/certification problem: are we allowed to use a home made 110/220VAC device?
So the more simple/safe/legal solution would be buying the right coil+core and packaging it...

About the 3 images of the (OLED) display:
There is no particular story. It's just a set of three photos taken within 1-2 mn with the specific quaternion displaying program.

About jumps of measures: Since yesterday, with the Euler angles program, I could not observe one jump. I can't tell the context to make that jump.

Your 4x90° test on your BNO is good. However 9 is 7 +29% and 22 is 21 +4.8%. And 24 is 23 + 4.3% for Bz while Bz should be constant.
Did you check if your plane was horizontal?
It would be interesting to make several measurements to see if this 7 is reproducible.

@{gammaburst, jps2000}: From your experience, with a degaussed and calibrated BNO (and controller and cables.connectors, etc), which minimum bias for (Bx, By, Bz) in percentage can we expect while rotating 4x90°?

AC measurement of the coil: 64 mA (220 V AC)
Blued_degausser_AC_current_measurent_red.jpg
Blued_degausser_AC_current_measurent_red.jpg (65.21 KiB) Viewed 461 times
What conclusion can we make from that measure?

@jps2000
Thanks for your very detailed calibration instructions.
I understand that your library can be full replacement for the Adafruit library. Is it correct ?...

Regarding a multi BNO application, with I2C, we still need a mux with Adafruit library or yours. Is it correct ?
If yes, how much effort would be required to make your library natively multi BNO? (pls. consider that suppressing a component as the mux is naturally attractive but you may answer me that a mux is not reducing reliability and is a simpler solution)

Important question: if a system (controller+BNOs+mux+battery+ connectors) is degaussed and calibrated as you describe, then will it be immediately (i.e. 1-10 s) available for operations to someone with no skill or no interest for "calibrating a device", without forcing the user to do this "boring and so weird" calibration procedure?

--
BNO nbr 1 sticks to status=2 and refuses to go to 3 despite eight figure loops or rotation clockwise and counter clockwise around each of 3 axis.
Ongoing tests with your library and manual calibration...

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

Re: BNO085 calibration and performance

Post by lumex »

About I2C reliability
@jps2000:
As you recommended, I put a 2.2kΩ pullup resistor on SDA pin. I still have very rare interruptions when manipulating the boards or cables or probably touching some pins of the screen or boards. I read in many places to add a pullup resistor on both SDA and SCL.
Do you think adding a pullup resistor on SCL will be useful.
7. Pullup resistors (R1 and R2) are needed on the I2C communication lines – Pin 19 (HOST_SCL) and Pin 20
(HOST_SDA). These values may vary depending on the board design and bus capacitance, but typical
values are between 2KΩ and 4KΩ.
Ref: 1.2.2 I2C interface (BNO080/85/86 Datasheet 1000-3927 v.1.11)

On the Adafruit BNO085 board I can see that there are 10k pullup resistors on SDA and SCA (See schematic).

So can you explain why adding 2-4k (additional) pullup resistors on the I2C bus?


Generally speaking, once an I2C bus apparently works, how do you analyze the reliability/stability of an I2C bus? MSO oscilloscope? simple/dedicated network analyzer? speed test?

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

Re: BNO085 calibration and performance

Post by gammaburst »

You have a new DVM - Yay!

You measured 64mA AC. That seems reasonable, and it's pretty close to the 80mA prediction when using datasheet values 11 W, 19 VA, 240 VAC, and an unknown solenoid core.

Yes, you could buy some E-shaped transformer laminations, a plastic bobbin, some magnet wire, a few other bits, and assemble your own tape eraser, but it's easier to visit eBay, click-click-click, and in a week there's one on your doorstep. Even easier, use the degausser that you've already built, it seems to work, yes? If you want to wipe a VHS tape, then, yeah, that's a bigger job, you'll need the tape eraser.

9 is 7 +29% ??? Yes, but no. How many percent would you say if the readings were 2 and 0?

The datasheet says magnetometer accuracy is 1.4 uT, so 9 and 7 could be within spec if the true value was 8 uT. Also, my BNO085 is soldered to a circuit board that's plugged into a flimsy plastic breadboard that's sitting on my slightly warped wooden desk. So the BNO could easily be tilted a couple degrees and not rotating exactly around the Z axis. I think 9 and 7 uT were unexpectedly good results.

If I pick up my BNO breadboard, wave it around, and put to back on the table at the same location, I see almost identical magnetometer values.

I consider the BNO a cheap sensor, almost a toy. It works great for the price. Don't expect more than the datasheet specs.

The BNO085 (and BNO055) have a design error in their I2C controller that causes an SDA-rise-to-SCL-rise setup time violation during some clock-stretching cycles. That puts the I2C bus on the verge of failure when using the generally recommended equal-value pullup resistors on SDA and SCL. To see the failure, attach a short bare wire to SDA, run a project that outputs a steady stream of data values, grab the bare wire with two fingers, and watch the project fail. Now add one extra pullup resistor to SDA (about 2K to 3K ohms), and try again. The extra resistor speeds-up SDA's risetime thereby improving the bad setup time. The project now runs fine even when touching the wire.

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

Re: BNO085 calibration and performance

Post by jps2000 »

Adding a pullup to the SDA line is a gammaburst invention. Not me. Honor where credit is due. The it total lower pullup assures that SDA has reached H level when SCL reach its H level. (L level is not a problem as the voltage is pulled down via a transistor). Capacities of wiring work a a low pass filter. Long cables and connecting a probe it make it worse. Taking the isolated wire between fingers do the same. It adds capacity to ground.
Indeed for the money ( before the chip crisis it was 10-15§) it is a great device. Now they ask 10-20 times the money and it is likely that the device BNO085 will be discontinued. Lets see what CEVA is doing but it is a small company.
As you can see on the bosch sensortec page
https://www.bosch-sensortec.com/product ... sors/imus/
They go for 6DOF only now. Main applications are drones and they do not need heading as they use GPS.
Indoor applications can not use heading reliably.
So 9DOF sensors have left the scene???

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

Re: BNO085 calibration and performance

Post by gammaburst »

Hi lumex,
Adding the 2K-3K resistor to SDA causes it to rise faster than SCL, and helps avoid the BNO timing bug. It's a band-aid workaround, not a cure. Don't add a similar resistor to SCL because that would nullify the band-aid.

Most Adafruit sensor boards and peripheral boards include 10K pullups on their I2C pins. That's strong enough to allow the bus to operate up to maybe 400 kHz (depending on your project's bus capacitance), and it's weak enough to allow connecting several boards without exceeding the I2C driver's maximum pull-down current. Here's the I2C spec: https://www.nxp.com/docs/en/user-guide/UM10204.pdf

Testing for stability is fraught with peril. Test every way you can think of, but you can still miss the one obscure factor that triggers the fault. It's better to catch failure modes during design.

Troubleshooting instability isn't fun. Try to find clues, factors that influence the rate of failure: power supply voltage, data rate, code version, temperature, vibration, clock speed, cable length, signal capacitance (touching a signal with your fingers adds capacitance), susceptibility to RF or mains power glitches, whatever you can think of. If your project contains someone else's code, that's a big suspect. Examine critical signals with an oscilloscope. Study the code, schematics, component datasheets, industry standards (such as I2C), etc, with the goal of finding design mistakes.

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

Return to “General Project help”