Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Drift on ADXRS453 Gyro (http://www.chiefdelphi.com/forums/showthread.php?t=133681)

alopex_rex 29-01-2015 20:19

Drift on ADXRS453 Gyro
 
Our team has been trying to use the ADXRS453 gyro (datasheet), with this board (http://www.digikey.com/product-detai...53Z-ND/2700448.

We got SPI communication working pretty well, we think. We're getting data from the gyro, in the format we expect. But while at rest, the sensor returns apparently random values between ~0.3 and ~0.8, averaging around 0.6. We tried using a calibration routine, which samples the rate while at rest to find an average drift, but the amount of the drift seems to vary depending on how fast the gyro is rotating, with the result that even with the calibration the gyro results are not usable.

We're displaying the raw 1's and 0's from the gyro on the SmartDashboard, and they show the drift, so we can be pretty certain the issue doesn't have to do with how we process the data. The status bits always indicate "valid sensor data." Our code on github (relevant files ADXRS450Gyro.h and ADXRS450Gyro.cpp) if you want to look at that.

Does anyone have any idea how either to fix this, or to compensate for it? As it is we can't really use the gyro for anything. The ADXRS453 is supposed to be a fairly precise gyro, so I assume that there's a way to get useful data from it. Any ideas?

Tom Line 29-01-2015 21:09

Re: Drift on ADXRS453 Gyro
 
Quote:

Originally Posted by alopex_rex (Post 1435858)
Our team has been trying to use the ADXRS453 gyro (datasheet), with this board (http://www.digikey.com/product-detai...53Z-ND/2700448.

We got SPI communication working pretty well, we think. We're getting data from the gyro, in the format we expect. But while at rest, the sensor returns apparently random values between ~0.3 and ~0.8, averaging around 0.6. We tried using a calibration routine, which samples the rate while at rest to find an average drift, but the amount of the drift seems to vary depending on how fast the gyro is rotating, with the result that even with the calibration the gyro results are not usable.

We're displaying the raw 1's and 0's from the gyro on the SmartDashboard, and they show the drift, so we can be pretty certain the issue doesn't have to do with how we process the data. The status bits always indicate "valid sensor data." Our code on github (relevant files ADXRS450Gyro.h and ADXRS450Gyro.cpp) if you want to look at that.

Does anyone have any idea how either to fix this, or to compensate for it? As it is we can't really use the gyro for anything. The ADXRS453 is supposed to be a fairly precise gyro, so I assume that there's a way to get useful data from it. Any ideas?

We are using the same gyro. We use periodic tasks and run a fast loop to sample it 600 times and average the samples. I believe we're running it at 500 microsecond loop times.

You then need to take that and subtract the value you get from every reading that the gyro supplies - we currently drift at around 1 degree per minute (or so).

alopex_rex 29-01-2015 21:17

Re: Drift on ADXRS453 Gyro
 
Thanks for the suggestion--I'd like to give that a try. How do you get it to loop so quickly? Do you start another thread? We tried to do that early on, using WPILib's Task class, but gave it up when we were having trouble. (The Task runs a function that cannot be a member function of an object, which makes it really hard to integrate into our program.) Is that a worthwhile path to pursue? Or is there a better way of doing it?

wireties 07-02-2015 12:05

Re: Drift on ADXRS453 Gyro
 
I took a function posted by the RatPack and improved it a bit. The drift is more than acceptable.

https://github.com/FRC1296/RHSRobot2.../ADXRS453Z.cpp

Enjoy


All times are GMT -5. The time now is 14:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi