|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: Gyro Calibration
Quote:
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 |
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Gyro Calibration
Quote:
-Kevin |
|
#5
|
|||
|
|||
|
Re: Gyro Calibration
Quote:
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
|
||||
|
||||
|
Re: Gyro Calibration
Quote:
-Kevin |
|
#7
|
|||||
|
|||||
|
Re: Gyro Calibration
Quote:
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 |
|
#8
|
||||
|
||||
|
Re: Gyro Calibration
Quote:
-Kevin |
|
#9
|
|||||
|
|||||
|
Re: Gyro Calibration
Quote:
(instead of every 4-7 times changing by 1, it happens every 15 or so...) thanks, ~Stephanie |
|
#10
|
||||
|
||||
|
Re: Gyro Calibration
Quote:
-Kevin |
|
#11
|
|||||
|
|||||
|
Re: Gyro Calibration
Quote:
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 ![]() |
|
#12
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |