Go to Post the bang for the buck is unparalled. Where else can $6000 change an entire group of student's lives forever? - Cory [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2015, 20:19
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
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?
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
  #2   Spotlight this post!  
Unread 29-01-2015, 21:09
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Drift on ADXRS453 Gyro

Quote:
Originally Posted by alopex_rex View Post
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).
  #3   Spotlight this post!  
Unread 29-01-2015, 21:17
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
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?
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
  #4   Spotlight this post!  
Unread 07-02-2015, 12:05
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
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
__________________
Fast, cheap or working - pick any two!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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