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: 497
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: 14
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: 497
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: 99
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 349 times

nashdb
 
Posts: 14
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: 99
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: 14
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: 99
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: 99
Joined: Thu Jun 02, 2016 6:34 pm

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Wed Oct 16, 2019 1:55 pm

It appears we've gone through a similar search through the available gyros. I had high hopes for the Bosch BNO055 because it did the integration of the rotation rate and the filtering with a devoted processor on the chip. Although I found it very stable, it wasn't sensitive to low rotation rates which is my situation. A design that does the calculations "on board" seems the way to go IMHO. Maybe NXP will follow that approach or perhaps Bosch will do an upgrade. I suggested to Adafruit that they look into offering an board with an optical gyro (form-letter thank you email but nothing further).

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

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Wed Oct 16, 2019 5:01 pm

Unfortunately the BNO055 is not fit for purpose, the BNO08X seems to be the best on the market at the moment.
I have 2 NXP's which l'm happy to use, but l haven't left them running to see if these ones mag stop working.
The MPU9255 at <$5 delivered running RTIMULib is as good as the BNO08X but uses a lot of computer power on a Mega, leaving little to run other devices (example,RF).
If you don't require anything else to run, IMHO you can't go pass the MPU9255 for $ Versus performance, even against the BNO08X its so close it doesn't matter.

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

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Sat Oct 19, 2019 12:35 pm

Yup, I guess the NXP is going to have do... maybe it's the best possible for a MEMS gyro given that it's measuring angular velocity rather than absolute heading. Perhaps the sort of accuracy and performance I'm looking for isn't available in such an inexpensive sensor; it'd be nice to know the cost of an Adafruit board based on a ring laser would be... a lot I reckon! I still think that, given that absolute (i.e., integrated) values are not being measured, and that if filtering and integration is done "off chip" by the driving MCU (which appears to be sensitive to the reading rate and other program settings), a chip with a dedicated on-chip (or at least on-board) MCU such as Bosch has done with the BNO055 and BNO08X is the way to go.

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

Re: NXP Precision 9 DOF Huge Drifting Issue

by duckman01 on Sat Oct 19, 2019 5:12 pm

l will leave it with you, happy projecting.

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

Re: NXP Precision 9 DOF Huge Drifting Issue

by nashdb on Sat Oct 19, 2019 5:39 pm

Thank you for your help!

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

Re: NXP Precision 9 DOF Huge Drifting Issue

by DRKrobotmaker on Fri Nov 08, 2019 10:44 am

This message is for nashdb and duckman01.. I'm a novice using gyroscopes and such.

My first application is a slow moving multileg robot walking on a flat surface, near flat. I accomplished this goal March 2019. I implemented the MPU6050 using MITs libraries. Initially all that was needed is the yaw axis, Z, heading. I had hoped for measuring distance traveled based on acceleration data. Solved issues were motor noise interfering with the IC2 MPU6050 interface, cleaning up the top level MIT code so it would not waste processing power. The Z drift is tremendous. Tried calibrating it over long periods of time without significant improvement. Since this robot's motion is in short time intervals the Z reading is frozen when not moving so not to accumulate more error. The robot works as intended over short distances. Good enough for my first robot.

After taking a different approach I'm back to looking for the best affordable gyroscope solution. Affordable, something under $50 USA as long as it actually works over long periods of time for a slow moving robot. I'd triple the amount if convinced it really worked.

nashdb, it seems you too are working on a slow moving device and would like it to not drift so drastically. We may share similar goals. I'm in this for the long haul, meaning I'm building upon previous work such as motor controllers, long life battery power, etc. These areas seems to be solid now. No longer frying motors and running low on power. Now it is time to work on a guidance system and with any luck find a mems device solution that works.

Questions.. for nashdb and duckman01.... or anyone else who has actually succeeded to some degree in this area

To recap - looking for a gyroscope solution for a slow moving robot. Eventually looking to determine xy location based on a starting point, not sure this is even possible given posts read.

What are your conclusions as to drift and accuracy for the device you settled on? Why was it chosen? What libraries were used? What did you conclude regarding Kalman filters?

Any idea why ADAFruit claims the Precision NXP 9-DOF Breakout Board - FXOS8700 + FXAS21002 is the best device on the market? I'm concerned motors generate magnetic fields and one would assume it will mess with this device and therefore reliability.

DRKrobotmaker
 
Posts: 11
Joined: Fri Nov 08, 2019 9:43 am

Please be positive and constructive with your questions and comments.