View Single Post
  #9   Spotlight this post!  
Unread 21-01-2005, 16:55
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: Example gyro code released.

Quote:
Originally Posted by Tom Bottiglieri
For now, we are using the BEI gyrochip provided in the 2003 kit. This is for testing purposes, seeing as they are illegal for robot use. We are getting gyro bias at startup, with the Calc_Gyro_Bias() function (we plan to poll it more, but we have only done basic tests, seeing how we are learning this as we go). Our gyro use code hasnt really been developed, since we are waiting for our encoder delivery, and we are planning to tackle the PID system all at once. But in our initial tests, we were seeing a bit of drift; The heading would waver about +- 17 milliradians every 8 seconds. (I dont believe we had the scale factor set the right way, seeing as one rotation was giving us a heading of about 10000 mRads.)
Yeah, you'll need to set the scaling factor before you know how much drift you're seeing. I didn't think to add the old gyrochip as one of the options in gyro.h, but will look into it.


Quote:
Originally Posted by Tom Bottiglieri
In order to keep costs down, I was hoping to use the provided accelerometer in place of a yaw gyro for the bot. Im guesing this would work with the gyro driver you wrote, but is there anything I need to change? (yanno.. something that I would probably never be able to figure out on my own.)
I've already released TI accelerometer code. Here's the post. BTW, you can't use the accelerometer to detect yaw. It's great at measuring pitch or roll, though.

Quote:
Originally Posted by Tom Bottiglieri
As for the drift, we have explored 2 options. One was to mount the gyro to a piece of foam tape or rubber, hoping it would cut out motor/compressor vibrations. I think the gyro bias is being set incorrectly due to the vibrations, and since for now we are only polling for bias once, it may have ill effect on our code.

Any tips? Thanks.
Yes, set the scaling factor correctly (I'll try to update gyro.h to include the gyrochip) using the instructions in readme.txt. Then try the manual method I documented in readme.txt (also in gyro.h, I think). I have a ADXRS150EB that, once correctly calibrated, drifts only a few milliradians a minute, which is pretty good.

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