View Single Post
  #5   Spotlight this post!  
Unread 23-03-2007, 11:23
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: Gyro Autonomous Problems

Have you caclulated the Bias for the gyro?

This is the value for the null (Not Rotating) output of the gyro. Until you calculate and save this value, the Gyro code will "Think" it's rotating very fast conter clockwise.

The bias is caclulated by taking the average of many gyro values while the robot is stationary. Kevin has provided an easy way to do this...

First you call Start_Gyro_Bias_Calc() and then a few seconds later you call Stop_Gyro_Bias_Calc(). You must be calling Process_Gyro_Data() thoughout this time interval.

You probably don't want to do this at the start of tele-operated mode, or autonomous mode, unless you are willing to keep the robot still for a few seconds.

In our code we do this ONCE when the robot enters "Disabled" mode. We figure that it will be in that state for at least two seconds. Just in case we save the gyro bais in EEPROM. If we don't get a full two seconds in disable mode we use the last saved vale from EEPROM.

To debug this, print out the "Rate" value every second. That way you'll know if the gyro thinks it's turning or not. Use Get_Gyro_Rate();
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor