Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyroscope Code (http://www.chiefdelphi.com/forums/showthread.php?t=39537)

Gary Bonner 09-02-2007 19:42

Re: Gyro Problems
 
Quote:

Originally Posted by Kevin Watson (Post 574795)
Is this a 2007 ADXRS150 gyro? Open up adc.h and change the sample rate to 1600Hz and samples per update to 16 and report back.

-Kevin

We tried this and we get a bias of 2026. Rotated counter-clockwise, we fairly consistently get an angle of about 3180. Clockwise rotation gives inconsistent results, ranging from about 2900 to 3100.

We tried last year’s gyro, and it consistently gives angles of about 3260 in each direction and at both sampling rates. Also, when printing out the Get_Analog_Value() (using the default code), the values range from 0 to 1005.

Kevin Watson 09-02-2007 20:55

Re: Gyro Problems
 
Quote:

Originally Posted by Gary Bonner (Post 575143)
We tried this and we get a bias of 2026. Rotated counter-clockwise, we fairly consistently get an angle of about 3180. Clockwise rotation gives inconsistent results, ranging from about 2900 to 3100.

We tried last year’s gyro, and it consistently gives angles of about 3260 in each direction and at both sampling rates. Also, when printing out the Get_Analog_Value() (using the default code), the values range from 0 to 1005.

You've got a bad gyro. Ask FIRST for a new one and use the 2006 gyro until you receive the new one. Let me know if you run into any problems.

-Kevin

Gary Bonner 10-02-2007 00:47

Re: Gyroscope Code
 
Thanks for your help.

Ryan O 16-11-2007 18:49

Re: Gyroscope Code
 
Hi,

We're new to gyros, and it seems like it should be okay. My one question is what the output will be like. If I turn the gyro clockwise from zero, will I get positive angles, and negitive if counter? I haven't been able to find it in the whitepapers. Thanks for any help :)

kaszeta 16-11-2007 22:13

Re: Gyroscope Code
 
Quote:

Originally Posted by Ryan O (Post 652257)
Hi,

We're new to gyros, and it seems like it should be okay. My one question is what the output will be like. If I turn the gyro clockwise from zero, will I get positive angles, and negitive if counter? I haven't been able to find it in the whitepapers. Thanks for any help :)

It's in the spec sheet for the actual gyro, but if you mount it right-side up, clockwise is positive.

Kevin Watson 01-03-2008 23:46

Re: Gyroscope Code
 
While porting code to Vex tonight I discovered a bug in the Process_Gyro_Data( ) function that could cause the bias to be calculated incorrectly. Instead of using the bias algorithm I used in the 2008 FRC code, I used this code and found the error:

Code:

if(Get_Gyro_Bias_Status() == GYRO_BIAS_NOT_DONE)
 {
  Start_Gyro_Bias_Calc();
  printf("Start Time=%u\r\n", (unsigned int)Get_Time());
 }
 else if(Get_Gyro_Bias_Status() == GYRO_BIAS_BUFFER_FULL)
 {
  Stop_Gyro_Bias_Calc();
  // reset the gyro heading angle
  Reset_Gyro_Angle();
  printf("End Time=%u\r\n", (unsigned int)Get_Time());
 }
 else if(Get_Gyro_Bias_Status() == GYRO_BIAS_READY)
 {
  printf("Time=%u Gyro Angle=%d\r\n", (unsigned int)Get_Time(), (int)Get_Gyro_Angle());
 }


The bug in on this line of Process_Gyro_Data( ):

// is the circular queue now full?
if(Gyro_Queue_Index == GYRO_QUEUE_SIZE-1)

Remove the -1 to correct the bug:

// is the circular queue now full?
if(Gyro_Queue_Index == GYRO_QUEUE_SIZE)

-Kevin


All times are GMT -5. The time now is 16:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi