Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyro inconsistencies... (http://www.chiefdelphi.com/forums/showthread.php?t=62435)

Chris Hibner 26-01-2008 16:52

Re: Gyro inconsistencies...
 
Quote:

Originally Posted by Jake M (Post 685189)
Settings and such...
-------------------
ADC Sample Rate of 1600Hz
32 ADC Samples per Update
Deadband set to 16 (Deadband and Bias double when resolution goes from 2048 to 4096)
Using ADXRS150

I will almost guarantee that the problem is caused by asymmetry in the ADC and being augmented by the dead band.

In general, any dead band on an integrator is not a good idea if you want accuracy in your results. See this whitepaper: http://www.chiefdelphi.com/media/papers/1449

It's been our experience that with a good bias routine you can expect less than 1/2 degree of heading drift over 15 seconds worth of autonomous operation. Just be sure to have a lot of resolution in your bias calculation.

Here is what I would suggest for a simple solution:

- For the bias routine, check the status of the disabled flag. As long as the robot is disabled, do a moving sum of the last 64 A/D samples. Make sure it is a moving sum, not average - this will make sense after the next step. See the following example code (put it in user_routines.c function Process_Data_From_Master_uP()):

Code:

if (disabledMode)
{
    bias = bias - biasBuffer[biasCounter] + gyroADC;
    biasBuffer[biasCounter] = gyroADC;
    biasCounter++;
    if (biasCounter > 63)
    {
        biasCounter = 0;
    }
}

just be sure to initialize all values in biasBuffer to 0 during code initialization.

- After the bias routine, take your A/D samples and multiply them by 64 (i.e. shift the bits left by 6 so that the bits are in the upper most bits of the variable.) The A/D reading is now in the same resolution as your bias. Now just subtract the bias from the left-justified A/D reading.

- Use the above bias adjusted value in your integral. Use a 32-bit variable for the integral. DO NOT right shift the new bias adjusted A/D reading or else you'll lose all of the resolution you gained in the bias.

Doing this should keep your heading drift very minimal over 15 seconds while it doesn't have the asymmetry problems associated with dead bands.

Good luck.

eugenebrooks 26-01-2008 18:09

Re: Gyro inconsistencies...
 
Chris has it right here. The dead band is the source of the symmetry problem. We sample our gyro at 152 hz and compute the integral using the trapezoid rule in 256ths. We use the average of many 128 sample sums, hard coded in, for the bias. The result is a drift of only a tenth of a degree or two for the 15 second autonomous period, with good symmetry.

Eugene


Quote:

Originally Posted by Chris Hibner (Post 686257)
I will almost guarantee that the problem is caused by asymmetry in the ADC and being augmented by the dead band.

In general, any dead band on an integrator is not a good idea if you want accuracy in your results. See this whitepaper: http://www.chiefdelphi.com/media/papers/1449

It's been our experience that with a good bias routine you can expect less than 1/2 degree of heading drift over 15 seconds worth of autonomous operation. Just be sure to have a lot of resolution in your bias calculation.



All times are GMT -5. The time now is 18:34.

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