Go to Post Build season is the best time of the year. Better than Christmas because the presents are cooler, and better than new years cause you get to stay up later. - burkey_turkey [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2005, 17:11
roboticsjenkins's Avatar
roboticsjenkins roboticsjenkins is offline
robotics_jenkins
AKA: Andrew
#0616 (Southampton Indian Robotics)
Team Role: Electrical
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Courtland, Virginia
Posts: 15
roboticsjenkins can only hope to improve
Send a message via AIM to roboticsjenkins Send a message via Yahoo to roboticsjenkins
Gyro Calibration

Does anyone have any ideas for calibrating a gyro. Your ideas would be really useful. I don't quite understand the calibration instructions in the readme file for this years Gyro Code.
__________________
  #2   Spotlight this post!  
Unread 11-02-2005, 14:16
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Re: Gyro Calibration

Quote:
Originally Posted by roboticsjenkins
Does anyone have any ideas for calibrating a gyro. Your ideas would be really useful. I don't quite understand the calibration instructions in the readme file for this years Gyro Code.
Using Kevin's instructions, you need to make some changes to the
gyro.h. Specifically, you need to change /add /delete some
#define statements to select your gyro, sampling rate, and
number of samples. I have copied/pasted below part of the
gyro.h file that has worked for me for the BEI GyroChip AQRS-0075.
Note the four #define statements that have the // removed

#define GYROCHIP_75 // BEI GyroChip AQRS-00075-xxx
#define TENTHS_OF_A_DEGREE
#define GYRO_CAL_FACTOR 1000/1000
#define GYRO_SAMPLE_RATE_1600HZ

In order to calibrate, I download the program after compiling with
the settings for the BEI Gyrochip, make sure the gyro is steady
and let the Terminal display output about 5 times. I have read
the gyro angle to be about 0 degrees. Then I slowly turn the
gyro 180 degrees (about 6 seconds for the turn) and read the
gyro angle display. It should read about 1800, since the #define
is set to TENTHS_OF_A_DEGREE. Next, I return the gyro to
it's original position (slowly) and it should read about 0 degrees.

If you turn it quickly, you will probably see that it won't read
the 1800 and return to 0 degrees. Why?


// Pick your gyro by removing the // from one of the six lines below.

#define GYROCHIP_75 // BEI GyroChip AQRS-00075-xxx
// #define ADXRS300 // Analog Devices' ADXRS300EB


// Pick the angular unit by removing the // from one of these two lines.
// #define MILLIRADIANS
#define TENTHS_OF_A_DEGREE


// For optimum performance, you'll need to calibrate the scaling factor
// to match that of your gyro's. One way to calibrate your gyro is to
// mount it very securely to a hefty, square or rectangular object.
// Mounting the gyro to a hefty object will help dampen higher frequency
// vibrations that can adversly effect your measurements. Place the
// mounted gyro against another square object and start the included
// demonstration software. To get good results, the mount must be
// absolutely still when the "Calibrating Gyro Bias..." message appears
// on the terminal screen. After a few seconds, the gyro angular rate
// and angle will be sent to the terminal screen. If the angle drifts
// rapidly while the mounted gyro is motonless, you need to restart the
// software to acquire a new gyro bias measurement. Again, gyros are
// very sensitive and must be still while the bias is calculated. Once
// the gyro is running with little drift, rotate the mount 180 degrees
// and note the reported angle. If the angular units are set to tenths
// of a degree, the ideal reported angle is 1800. If set to milliradians,
// the ideal angle 1s 3142 (Pi times a thousand). For every tenth of a
// percent that the angle is high, decrease the GYRO_CAL_FACTOR numerator
// by one. Conversly, for every tenth of a percent low, increase the
// numerator by one. Repeat until you're satisfied with the accuracy.
#define GYRO_CAL_FACTOR 1000/1000

// Pick a gyro sample rate by uncommenting one of these lines. Faster
// is better, but your CPU will spend more time servicing interrupts.
// Pick the slowest sample rate that still meets your performace criteria.
// These #defines are used below to set the value of GYRO_SAMPLE_RATE and
// to set the timer 2 update rate in gyro.c/Initialize_Timer_2().
// #define GYRO_SAMPLE_RATE_200HZ
// #define GYRO_SAMPLE_RATE_400HZ
// #define GYRO_SAMPLE_RATE_800HZ
#define GYRO_SAMPLE_RATE_1600HZ


// Number of ADC samples that will be averaged for each gyro update. More
// is better, but your update rate will decrease proportionatly. This must
// be sixty-four or less. The gyro sample rate divided by number of samples
// per update should be at least equil to fifty, which is the number of
// gyro updates per second.
#define GYRO_SAMPLES_PER_UPDATE 64

// If you modify stuff below this line, you'll break the software.

#define ADC_VOLTS_PER_BIT 5/1024
#define MILLIRADIANS_PER_DEGREE 349/20
#define TENTHS_OF_A_DEGREE_PER_DEGREE 10

#ifdef GYRO_SAMPLE_RATE_200HZ
#define GYRO_SAMPLE_RATE 200
#endif

#ifdef GYRO_SAMPLE_RATE_400HZ
#define GYRO_SAMPLE_RATE 400
#endif

#ifdef GYRO_SAMPLE_RATE_800HZ
#define GYRO_SAMPLE_RATE 800
#endif

#ifdef GYRO_SAMPLE_RATE_1600HZ
#define GYRO_SAMPLE_RATE 1600
#endif


// BEI GyroChip AQRS-00075-xxx (sensitivity = 30.0mV/deg/sec)
#ifdef GYROCHIP_75
#define GYRO_SENSITIVITY 33 // in units of deg/sec/volt
#endif



// Analog Devices' ADXRS300 (sensitivity = 5.0mV/deg/sec)
#ifdef ADXRS300
#define GYRO_SENSITIVITY 200 // in units of deg/sec/volt
#endif
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
  #3   Spotlight this post!  
Unread 12-02-2005, 01:09
thinkpad thinkpad is offline
Registered User
AKA: Mr. Know Nothing
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Canada
Posts: 15
thinkpad is an unknown quantity at this point
Re: Gyro Calibration

We are also having problems with our gyro caliberation. We are trying to use Mr. Watsons latest code with the the ADXRS150EB gyro chip. We have followed the instructions step by ste but, the rate of print of the gyro angle is really slow and takes a long time to print out the change in angle (like an hour for a 180 deg change). I have doublechecked my wiring of the gyro and the gyro is on a surface free from any possible vibrations. I have tried it out at 1600Hz with 64 as the sampling rate, with similar really slow results. Can anyone suggest why this is so?

thanks for all possible help.
  #4   Spotlight this post!  
Unread 12-02-2005, 01:21
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: Gyro Calibration

Quote:
Originally Posted by thinkpad
...the rate of print of the gyro angle is really slow and takes a long time to print out the change in angle (like an hour for a 180 deg change).
Can you be more specific? Are you saying that the angle information being sent to the terminal screen isn't being updated fast enough? Are use using the user_routines.c code I included in the .zip file?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 12-02-2005, 11:32
thinkpad thinkpad is offline
Registered User
AKA: Mr. Know Nothing
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Canada
Posts: 15
thinkpad is an unknown quantity at this point
Re: Gyro Calibration

Quote:
Originally Posted by Kevin Watson
Can you be more specific? Are you saying that the angle information being sent to the terminal screen isn't being updated fast enough? Are use using the user_routines.c code I included in the .zip file?

-Kevin
I apologize, Ill try to explain better:

The print of the gyro angle increments at a very slow rate, for example when i start the program the gyro angle stays at 0 till i actually move the gyro(as expected), after I turn the gyro slowly to say 90 deg, the gyro angle starts to change, but at a very slow rate. It increases by 1 for every 5-6 print outs of the gyro angle, so if it has to reach 900 (90 deg with setting at tenths of a degree), it will take a long time to increment to that value. Isnt the gyro angle supposed change faster?

I am using the frc_gyro code version 0.4 from your website, without any changes other than gyro sample ratte at 1600Hz and samples per update at 64 (Ive tried other values to but with same results). I have not changed anything with user_routines.

Hope this makes it clearer,

Thanks.
  #6   Spotlight this post!  
Unread 12-02-2005, 13:04
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: Gyro Calibration

Quote:
Originally Posted by thinkpad
I apologize, Ill try to explain better:

The print of the gyro angle increments at a very slow rate, for example when i start the program the gyro angle stays at 0 till i actually move the gyro(as expected), after I turn the gyro slowly to say 90 deg, the gyro angle starts to change, but at a very slow rate. It increases by 1 for every 5-6 print outs of the gyro angle, so if it has to reach 900 (90 deg with setting at tenths of a degree), it will take a long time to increment to that value. Isnt the gyro angle supposed change faster?

I am using the frc_gyro code version 0.4 from your website, without any changes other than gyro sample ratte at 1600Hz and samples per update at 64 (Ive tried other values to but with same results). I have not changed anything with user_routines.

Hope this makes it clearer,

Thanks.
Yes, it should change much faster than that. When you assembled the gyro, did you connect a jumper wire between the AVCC (pin 1) and PDD pins (pin 13)? If not, connect the two pins together and it should start working.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 18-02-2005, 13:43
RbtGal1351's Avatar
RbtGal1351 RbtGal1351 is offline
~La Reina de los Robots~
AKA: Stephanie
FRC #1351 (TKO)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 166
RbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to behold
Send a message via AIM to RbtGal1351 Send a message via MSN to RbtGal1351
Re: Gyro Calibration

Quote:
Originally Posted by Kevin Watson
Yes, it should change much faster than that. When you assembled the gyro, did you connect a jumper wire between the AVCC (pin 1) and PDD pins (pin 13)? If not, connect the two pins together and it should start working.

-Kevin
i've been having the same problem as thinkpad...
we have the ADXRS150 gyro from analog devices, and we HAVE connected those pins (1 and 13).
here are pictures

also, i've noticed that the (excuse my terminology, im a programmer, not an electronics person) little terminal-thingies labeled C1 through C7 do not match up with the picture on the spec sheets.

http://kevin.org/frc/adxrs150eb.pdf (spec sheet, thanks Kevin)


~Stephanie
Attached Thumbnails
Click image for larger version

Name:	P1010069.JPG
Views:	74
Size:	47.5 KB
ID:	2981  Click image for larger version

Name:	P1010070.JPG
Views:	79
Size:	36.7 KB
ID:	2982  
__________________
2004 Founding member and Arm leader, 2005 Lead programmer, 2006 Controls leader, 2007 Project Manager/President
Thanks for making FIRST such a great experience for me. I'm no longer on 1351, and I'm not currently planning to mentor team 97, but FIRST has meant so much in getting me to where I am now, in life and at MIT, class of 2011.
I met Billfred! He recognized me!
SVR 04: 11th seed - Highest Rookie Seed - Semifinalists w/ 1120 and 568 - GM Industrial Design Award
SVR 05: Semifinalists w/ 8 and 766
SVR 06: 6th seed - Quarterfinalists w/ 368 and 1072
Davis 06: 1st seed - Quarterfinalists w/ 649 and 100 - KPCB Entrepreneurship Award
SVR 07: 36th seed
David 07: 4th seed - Semifinalists w/ 1280 and 692 - Johnson and Johnson Sportsmanship Award
  #8   Spotlight this post!  
Unread 18-02-2005, 16:32
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: Gyro Calibration

Quote:
Originally Posted by RbtGal1351
i've been having the same problem as thinkpad...
we have the ADXRS150 gyro from analog devices, and we HAVE connected those pins (1 and 13).
here are pictures

also, i've noticed that the (excuse my terminology, im a programmer, not an electronics person) little terminal-thingies labeled C1 through C7 do not match up with the picture on the spec sheets.

http://kevin.org/frc/adxrs150eb.pdf (spec sheet, thanks Kevin)


~Stephanie
It's hard to tell, but it looks like you've attached a tantalum capacitor to the rateout pin. If so, that would certainly explain why you're seeing the rate change so slowly. Remove everything from pin two except the white wire and try it again.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #9   Spotlight this post!  
Unread 18-02-2005, 17:21
RbtGal1351's Avatar
RbtGal1351 RbtGal1351 is offline
~La Reina de los Robots~
AKA: Stephanie
FRC #1351 (TKO)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 166
RbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to behold
Send a message via AIM to RbtGal1351 Send a message via MSN to RbtGal1351
Re: Gyro Calibration

Quote:
Originally Posted by Kevin Watson
It's hard to tell, but it looks like you've attached a tantalum capacitor to the rateout pin. If so, that would certainly explain why you're seeing the rate change so slowly. Remove everything from pin two except the white wire and try it again.

-Kevin
ok that's done... it still drifts, but now it drifts less.
(instead of every 4-7 times changing by 1, it happens every 15 or so...)

thanks,
~Stephanie
__________________
2004 Founding member and Arm leader, 2005 Lead programmer, 2006 Controls leader, 2007 Project Manager/President
Thanks for making FIRST such a great experience for me. I'm no longer on 1351, and I'm not currently planning to mentor team 97, but FIRST has meant so much in getting me to where I am now, in life and at MIT, class of 2011.
I met Billfred! He recognized me!
SVR 04: 11th seed - Highest Rookie Seed - Semifinalists w/ 1120 and 568 - GM Industrial Design Award
SVR 05: Semifinalists w/ 8 and 766
SVR 06: 6th seed - Quarterfinalists w/ 368 and 1072
Davis 06: 1st seed - Quarterfinalists w/ 649 and 100 - KPCB Entrepreneurship Award
SVR 07: 36th seed
David 07: 4th seed - Semifinalists w/ 1280 and 692 - Johnson and Johnson Sportsmanship Award
  #10   Spotlight this post!  
Unread 18-02-2005, 17:33
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: Gyro Calibration

Quote:
Originally Posted by RbtGal1351
ok that's done... it still drifts, but now it drifts less.
(instead of every 4-7 times changing by 1, it happens every 15 or so...)

thanks,
~Stephanie
Hmmm... Now I'm confused. Is it drift you're seeing or slow response? Drift is where the angle changes without rotation of the gyro. Slow response is where the angle changes too slowly after you rotate the gyro.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #11   Spotlight this post!  
Unread 18-02-2005, 17:44
RbtGal1351's Avatar
RbtGal1351 RbtGal1351 is offline
~La Reina de los Robots~
AKA: Stephanie
FRC #1351 (TKO)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 166
RbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to beholdRbtGal1351 is a splendid one to behold
Send a message via AIM to RbtGal1351 Send a message via MSN to RbtGal1351
Re: Gyro Calibration

Quote:
Originally Posted by Kevin Watson
Hmmm... Now I'm confused. Is it drift you're seeing or slow response? Drift is where the angle changes without rotation of the gyro. Slow response is where the angle changes too slowly after you rotate the gyro.

-Kevin
o alright sorry.. its drift

when i posted that, we had just tried seeing if they all ( the analog value from Get_Analog_Value and the Get_Gyro_Angle ) stayed zero when we didn't touch the gyro or anything. it ended up drifting 1 (tenth of degree? its not in milliradians any more, so i believe its tenths of a degree) every 15 loops or so.
however, now the drift is much worse and its 1 tenth of degree every 2 loops...

thanks....
~Stephanie
__________________
2004 Founding member and Arm leader, 2005 Lead programmer, 2006 Controls leader, 2007 Project Manager/President
Thanks for making FIRST such a great experience for me. I'm no longer on 1351, and I'm not currently planning to mentor team 97, but FIRST has meant so much in getting me to where I am now, in life and at MIT, class of 2011.
I met Billfred! He recognized me!
SVR 04: 11th seed - Highest Rookie Seed - Semifinalists w/ 1120 and 568 - GM Industrial Design Award
SVR 05: Semifinalists w/ 8 and 766
SVR 06: 6th seed - Quarterfinalists w/ 368 and 1072
Davis 06: 1st seed - Quarterfinalists w/ 649 and 100 - KPCB Entrepreneurship Award
SVR 07: 36th seed
David 07: 4th seed - Semifinalists w/ 1280 and 692 - Johnson and Johnson Sportsmanship Award
  #12   Spotlight this post!  
Unread 21-02-2005, 20:39
obitusis obitusis is offline
Registered User
#1351
 
Join Date: Feb 2005
Location: San Jose, California
Posts: 6
obitusis is an unknown quantity at this point
Re: Gyro Calibration

Nevermind - we got it. We found it in the famous 1000/1000 of code in gyro.h. We followed the instructions above that code and it worked out fine. Thanks.
Our gyro had the following calibration number:
Code:
GYRO_CAL_FACTOR 958/1000
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updated: Example Gyro Interface Code Kevin Watson Programming 2 28-03-2005 04:36
Example gyro code released. Kevin Watson Programming 60 17-03-2005 18:32
Gyro Troubles SteveO Programming 13 30-01-2005 16:46
ADXRS150 gyro yaw rate sensor Brian M. Electrical 13 17-10-2004 02:28
Wierd gyro code problems...pls help Salik Syed Programming 4 14-03-2004 01:29


All times are GMT -5. The time now is 10:07.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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