0

NXP Precision 9 DOF Huge Drifting Issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: NXP Precision 9 DOF Huge Drifting Issue

by jps2000 on Sun Sep 29, 2019 3:38 am

quote:>>there was suddenly a massive amount of drift in the values.<<
This triggers me to suggest degaussing of the sensor board to remove hard iron effects.
https://github.com/jps2000/BNO080/issues/8

You can also look which of the sensors raw data ( acc, gyro, mag) show the same drift.

jps2000
 
Posts: 456
Joined: Fri Jun 02, 2017 4:12 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Tue Oct 01, 2019 2:02 pm

Thank you for the response. Hmmm... what MCU are you using? I wouldn't have thought it would make a difference but I see in the provided AHRS_fusion_usb code example it states:

// Filter expects 70 samples per second
// Based on a Bluefruit M0 Feather ... rate should be adjuted for other MCUs


I've tried using an Arduino Nano and an Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0 and both show a similar drift. I just bought a new NXP Precision 9 DOF - FXOS8700 & FXAS21002 but the drift persists regardless of calibration, sample rate, or the filter. I have updated Arduino IDE to the latest library for the NXP so I assume that has the latest filter codes.

nashdb
 
Posts: 7
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by jps2000 on Wed Oct 02, 2019 1:07 am

Have you checked the data rate?. I think this has to do with duration of the loop. Note that also serial print slows down the loop depending on speed.
You can measure the loop frequency by toggling a pin and look with a scope or you plot the time.

jps2000
 
Posts: 456
Joined: Fri Jun 02, 2017 4:12 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Wed Oct 02, 2019 2:55 am

As said, l'm using a Mega, l do all my testing with the IMU taped on a piece of timber, so l have nothing magnetic near the IMU and all my tests are without any magnetic parts near my test area.
Try reading the mag, accel and gyro raw data when stationary and they should all be relatively stable, if the yaw is moving with stable raw data, it would point to the fusion.

duckman01
 
Posts: 97
Joined: Thu Jun 02, 2016 6:34 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Wed Oct 09, 2019 9:58 am

Well, as per your suggestion, I've dumped the magnetometer and accelerometer readings along with the filtered gyroscope readings (deflection is the angular difference between the initial and current heading). I moved the sensor slowly through a small arc and found that the drifting appears to have stopped despite the use of the same filter (Madgwick), filter sampling rate (10), and loop delay (2). Perhaps the additional delay added by the significantly longer output string increased the effective looping time or the problem intermittent.

I'll investigate further.

table.jpg
Interesting!
table.jpg (654.83 KiB) Viewed 90 times

nashdb
 
Posts: 7
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Wed Oct 09, 2019 5:40 pm

You may find that the filter rate + delay is just that, very slow updating and may not see any gyro drift. So does the accel have much jitter when stationary, < 20 m/s2 is acceptable (my scale factor maybe out, you will see it easy enough, the scale you are displaying is a Adafruit thing, not the true raw l believe (going on memory)).
Gyro, shouldn't have any real jitter when stationary, really only drift (make sure you are in degrees/sec not rad as rad are approx 57 degree/sec, so won't show much).
You need to leave IMU stationary over 10 min say, then look at the data to see how much the gyro has drifted does it match data sheet), the fusion is what corrects the gyro drift, hence keeps the YAW stable +-0.75 degrees jitter l think mine was. The mag just gives it a North reference point for the YAW, the gyro does most of the work, the accel (sees if there is any real/true acceleration which would indicate some rotation) is used to correct the gyro (rotation) drift.

duckman01
 
Posts: 97
Joined: Thu Jun 02, 2016 6:34 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Thu Oct 10, 2019 9:07 am

Thank you, that's helpful!

nashdb
 
Posts: 7
Joined: Wed Nov 14, 2018 10:03 am

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Thu Oct 10, 2019 9:38 pm

Just to clarify, the <20 figure is for the ADC raw values. As the m/s2 is like the RAD's for the Gyro, a very high base figure.

duckman01
 
Posts: 97
Joined: Thu Jun 02, 2016 6:34 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Sat Oct 12, 2019 7:44 pm

In looking back at other issues, l came across my own post re the same drift prob and how l fixed it. You have to love my good memory
viewtopic.php?f=19&p=588107

duckman01
 
Posts: 97
Joined: Thu Jun 02, 2016 6:34 pm

Please be positive and constructive with your questions and comments.