Go to Post I've come to believe that the current alliance selection system is just like democracy. It's the worst system possible, aside from all the other ones. - DampRobot [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 24-01-2008, 19:31
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Gyro inconsistencies...

After two days of testing, I'm pretty sure our gyro gives slightly different output, depending on which direction it's turning. For instance...

Counter-Clockwise
-----------------
1771
1777
1773
1771
1775
-----------------
Clockwise
---------
1802
1796
1800
1806
1800
---------

These are outputs given after resetting the angle to zero and slowly turning the gyro exactly 180 degrees. As you can see, the clockwise direction is quite near perfect, but the other direction is always off. You can also see that both directions are very consistent. If I re-calibrate based on the counter-clockwise direction, then the clockwise direction is consistently off.

I'm not really that worried about 3 degrees, but what I've found is that because of this, when the gyro turns far from zero, it doesn't go back to zero at the same position, and I can easily see that error compounding very quickly, particularly since the gyro seems to be less consistent the faster I turn it, and I doubt the robot will want to turn as slowly and carefully as I am.

Is this really all that strange? Should I just reset the heading to zero whenever I actually need to use it? Should we perhaps invest in a better quality gyro?

Settings and such...
-------------------
ADC Sample Rate of 1600Hz
32 ADC Samples per Update
Deadband set to 16 (Deadband and Bias double when resolution goes from 2048 to 4096)
Using ADXRS150
__________________
Code:
void function(void)
 {
  function();
 }

Last edited by Jake M : 24-01-2008 at 19:37.
  #2   Spotlight this post!  
Unread 24-01-2008, 19:53
7-11number1 7-11number1 is offline
ROAR.
FRC #1711 (RAPTORS)
 
Join Date: Sep 2007
Rookie Year: 2006
Location: Traverse City, Michigan
Posts: 46
7-11number1 will become famous soon enough
Re: Gyro inconsistencies...

Quote:
Originally Posted by Jake M View Post
After two days of testing, I'm pretty sure our gyro gives slightly different output, depending on which direction it's turning. For instance...

Is this really all that strange? Should I just reset the heading to zero whenever I actually need to use it? Should we perhaps invest in a better quality gyro?

Settings and such...
-------------------
ADC Sample Rate of 1600Hz
32 ADC Samples per Update
Deadband set to 16 (Deadband and Bias double when resolution goes from 2048 to 4096)
Using ADXRS150

Jake,

We are just now getting to the GYRO. I am not sure if you've seen this link from the Killer Bees Team but this is where we are starting for our Gyro primer.

After this weekend I should be able to let you know more once we get the gyro up and running. Also, the GYRO from last years KOP had a faster response in terms of measuring DPS (Degrees Per Second). Could measurement lag be causing your measurement anomaly?

Please let us know how it works out, and if you wouldn't mind sharing your Gyro code we would like to see it.

-Michael
  #3   Spotlight this post!  
Unread 24-01-2008, 21:06
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Gyro inconsistencies...

Remember that this is a Yaw Rate Gyro, key word being Rate. This gives an output in degrees per second, so in other words it measures how FAST the sensor is being turned - NOT how much it has turned.

If you multiply the rate times time, then you get amount of turn. But, how you do that multiplication can introduce errors if the rate is not exactly constant. That could be the source of your error, perhaps.

Try to eliminate that source of error by turning at as constant a rate as possible, and not very slowly - about 90 degrees per second is probably a good rate.

EDIT: Make sure you're turning the gyro about it's real axis, which is not the axis of the PC Board!

Don
__________________

I am N2IRZ - What's your callsign?

Last edited by DonRotolo : 24-01-2008 at 21:08. Reason: More info
  #4   Spotlight this post!  
Unread 24-01-2008, 22:46
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

Perhaps I should have mentioned that I'm using Kevin Watson's background gyro code (gyro.c and gyro.h) as well as Kevin's ADC code.

And although the gyro is turning slowly and not at a constant rate, that shouldn't make much difference, since I'm the one turning it both times and I've been taking care to be consistent in that respect. Plus, since the individual sets of numbers (clockwise and counter-clockwise) are so consistent, that suggests that the error is internal, not external.

I just thought someone with more experience working with the gyros might have come across this before.
__________________
Code:
void function(void)
 {
  function();
 }
  #5   Spotlight this post!  
Unread 25-01-2008, 10:39
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Gyro inconsistencies...

A couple of things to keep in mind about gyros -

1) you could be experiencing an error due to nonlinearity (although the 1.5% difference between your CW and CCW results is a bit higher than the spec for the gyro)

2) you may still have some residual offset error in the gyro (most likely in my opinion)

3) your gyro may be "leaning" when turning CW instead of CCW (or vice versa) and causing an effective gain change (but again 1.5% is a bit high since the "lean" would have to be about 10 deg of tilt (cos(10) = 0.985))


I'd recommend running the same tests that you've been doing (specifically duration of time) but without any physical rotation. I'm guessing that you'll observe a non-zero heading at the end of the time interval (probably 1.5 degrees).

Russ
  #6   Spotlight this post!  
Unread 25-01-2008, 12:17
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

No, the time span is only just a few seconds, and it takes a couple minutes for the heading to change when immobile.

I'll dig out another gyro or two from our sensor box tomorrow and see what kind of results I get.
__________________
Code:
void function(void)
 {
  function();
 }
  #7   Spotlight this post!  
Unread 25-01-2008, 12:42
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Gyro inconsistencies...

I don't know the details of Kevin's code but I wouldn't be surprised if the code "ignores" small non-zero readings. That is a very simple but technically insufficient way to keep from "runaway" due to integration of a small non-zero output.

The proper way to dedrift a gyro is to use an absolute reference (eg compass and inclinometer). Since an absolute reference is typically too expensive for applications like ours, a SW solution with a band clamp is often used (as in Kevin's code?).

I'll bet that there's still a non-zero offset in the readings but it's being masked by a nonlinear bit of SW.

There is another possible culprit - ADC resolution. This could be affecting either the null cancellation or the value that's reported when it's actually spinning. Depending on the rate at which the gyro is rotating and a number of other factors, ADC resolution could come into play. I'd be very surprised, however, since there is almost certainly more "noise" in the gyro output than ADC resolution and the effective resolution is usually fine.

Russ
  #8   Spotlight this post!  
Unread 25-01-2008, 13:57
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Gyro inconsistencies...

Quote:
Originally Posted by Russ Beavis View Post
I don't know the details of Kevin's code but I wouldn't be surprised if the code "ignores" small non-zero readings. That is a very simple but technically insufficient way to keep from "runaway" due to integration of a small non-zero output.
This is exactly what my code does, although Jake's deadband setting of sixteen DN seems excessive. I strongly suspect there is something wrong with Jake's gyro because the code works really well with the gyros I have on hand (several ADXRS150s, two ADXRS300s, one Systron Donner from the 2005 KOP, and several Silicon Sensing Systems' CRS03s). As I mentioned here, I have a CRS03 that ran for nearly two hours with less than two degrees of drift using the default ADC settings. One of my ADXRS150s will do nearly as well as that CRS03. Jake, if you can, try a different gyro because what you're seeing isn't typical behavior.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #9   Spotlight this post!  
Unread 25-01-2008, 15:32
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Gyro inconsistencies...

Jake,
What is your rotation rate? How fast are you turning 180 degrees?

Maybe you're getting close to saturation. Aren't the gyros set for 90 deg/sec max rate this year or are they really set for 150 deg/sec?

Russ
  #10   Spotlight this post!  
Unread 25-01-2008, 16:54
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

This year's gyro is actually set to 80 deg/sec, but I was using one of the older years, at 150 deg/sec.

The 16 for deadband is actually the defualt of 8 that you provided, since I raised the ADC resolution from 2048 to 4096. The gyro bias doubled in the same way when I raised the resolution.

I'll probably end up putting the ADC back to default, because raising the update rate and resolution doesn't seem to have made any difference.

I know we have some other ADXRS150's from past years somewhere, I just need to go find them tomorrow. We had to call of building for today.

Thanks for the input, everyone. In the end, I think the bulk of what I'll use the gyro for is to back up the basic driving output (our frame tends to pull slightly to the right) for which I'll only need to use the rate. As a programmer, little problems like this just tend to bug me if I can't explain them.
__________________
Code:
void function(void)
 {
  function();
 }
  #11   Spotlight this post!  
Unread 26-01-2008, 10:56
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

I plugged in this year's brand new gyro and it's the same story. Clockwise and Counter-clockwise measurements are consistently about 2.5 degrees apart from each other. It must have something to do with how I'm mounting and testing it. I'm just going to calibrate it for counter-clockwise, which will be the main turning direction this year, and leave it at that.

Thanks for all the help, everyone.
__________________
Code:
void function(void)
 {
  function();
 }
  #12   Spotlight this post!  
Unread 26-01-2008, 11:39
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Gyro inconsistencies...

keep in mind that those readings are in 10ths of a degree, so you have to knock off the last digit. both directions are pretty near 180 degrees (179,180)
__________________


  #13   Spotlight this post!  
Unread 26-01-2008, 12:24
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

Which is another reason why I'm not going to worry about it.
__________________
Code:
void function(void)
 {
  function();
 }
  #14   Spotlight this post!  
Unread 26-01-2008, 13:20
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Gyro inconsistencies...

If you get two gyros with the same specs, what if you mounted one with its axis of rotation opposite the other (i.e. upside down)? That way, while one was rotating CCW around its axis, the other would be rotating CW. You could probably implement some software error elimination by averaging the two ouputs or only taking the reading from the one that is currently rotating in the 'correct' direction.
  #15   Spotlight this post!  
Unread 26-01-2008, 13:45
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Gyro inconsistencies...

If I cared that much, I would just implement two GYRO_CAL_FACTOR's, one for each direction.
__________________
Code:
void function(void)
 {
  function();
 }
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gyro Calibration ImmortalAres Programming 1 07-06-2005 13:29
Gyro magical hands Programming 2 14-01-2005 20:57
gyro odin892 Programming 0 08-04-2003 09:59
Gyro archiver 2001 2 23-06-2002 23:11
Regional Inconsistencies Andy Baker Rules/Strategy 15 10-04-2002 12:32


All times are GMT -5. The time now is 18:34.

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