Thread: Yaw Sensor
View Single Post
  #26   Spotlight this post!  
Unread 29-02-2004, 18:02
WizardOfAz's Avatar
WizardOfAz WizardOfAz is offline
Lead Mentor
AKA: Bill Bennett
FRC #1011 (CRUSH)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Tucson, AZ
Posts: 101
WizardOfAz will become famous soon enough
Send a message via AIM to WizardOfAz
dynamic zero point determination

Quote:
Originally Posted by KenWittlief
[plan on adjusting your zero point too. Our reads 141 when its not turning, instead of 127 after a gyro>>2.

or you could have your bot read the zero value at some point when you know the bot is not running, like when its disabled by the comp port at the start of the match.
Thanks. I have code that automatically computes the zero point. It skips the first 100 4ms samples after power up then sums the next 100 4ms samples (summing (sample - 512)). This assumes that the robot is still at power up, which we try to ensure. This number is then divided by 4 to get a 100ms correction. I apply correction/25 to every 4ms sample, then correction%25 every 100ms.

Since you mentioned it, I wonder how stable you other guys are finding the zero point to be. The 100ms correction computed as above varies by about +/- 10% (100 to 120). I haven't tried to determine if this is because of routing the cable near noise sources or is just the nature of the gyro. Would like to know others' experiences.

In your case Ken, since you're immediately dividing by 4, a +/- 10% variation would only be +/- 1 or 2 I guess.

Bill