View Single Post
  #2   Spotlight this post!  
Unread 12-02-2005, 02:12
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: Accelerometer Bias

Quote:
Originally Posted by miketwalker
I've made our own gyro/accelerometer code because I wanted to do some various things other than what Kevin Watson's code (which is excellently made) did. The gyro code works fine now, however because of the accelerometers' extreme sensitivity, I was wondering how you can make a code to remove the accelerometer bias. My code gets it between 511-512... but since it's an int it goes one way or the other... and by having it at 511... it is enough to quickly make the robot velocity appear as though it is getting negative.

Has anyone else made their own accelerometer code and found a way to fix this? Thanks!
This is one of the reasons I oversample the gyro and accelerometer outputs. If you look at my gyro code you'll notice that I sum GYRO_SAMPLES_PER_UPDATE samples and treat that value as though it was a single sample. It's a simple way to get a little more accuracy in your calculations.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org