View Single Post
  #1   Spotlight this post!  
Unread 05-02-2008, 20:18
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: Gyro Implementation

I guess I'll just clarify the steps you listed...? Although I'm not quite too sure about this, but I'll see if I can help.

1. The gyro is based off the analog-to-digital converter. So you'll want to hook up the T on the gyro to an analog input. (Make sure it's T and not R. It's not Rotation and Temperature, but Turning and Relative Temperature. Who came up with that?)

5. You need to call Process_Gyro_Data in your code to use the gyro. The referenced files contain examples of how to do this.

8. Calculating the gyro bias... You need to calibrate the gyroscope before you can use it. If you're not using Kevin Watson's new code, I believe this is the default calibration routine:
Code:
    i++;
    j++; // this will rollover every ~1000 seconds

    if (j == 10) {
        printf("\r\nCalculating Gyro Bias...\r\n");
    }

    if (j == 60) {
        // start a gyro bias calculation
        Start_Gyro_Bias_Calc();
    }

    if (j == 300) {
        // terminate the gyro bias calculation
        Stop_Gyro_Bias_Calc();

        // reset the gyro heading angle
        Reset_Gyro_Angle();

        temp_gyro_bias = Get_Gyro_Bias();
        printf("Gyro Bias=%d\r\n", temp_gyro_bias);
    }

    if (i == 35 && j >= 300) {
        temp_gyro_rate = Get_Gyro_Rate();
        temp_gyro_angle = Get_Gyro_Angle();
        printf(" Gyro Rate=%d\r\n", temp_gyro_rate);
        printf("Gyro Angle=%d\r\n\r\n", (int)temp_gyro_angle);
    }
Although I thought that was included somewhere... Make sure i and j are declared somewhere. (This should be in teleop.c or the Process Data function of user_routines.c.

9. I'd leave this alone for now. You're better off trying to get the gyro working than working optimaly, really. Save this for later.



Not entirely sure all that information is correct. If it isn't if someone could let me know? So I don't go about spreading misinformation? Thanks.