SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By sebmadgwick
#86754
I've been working with the 6DOF Razor and found that gyroscope bias behaves undesirably.

At zero angular rates the bias drift seems negligible; the on-board 0.034Hz 1st order HP filter is doing its job. However; during motion the bias drift seems to occor at a rapid rate; shifted by 1deg/s in just a second.

This plot should explain...
Image
Blue trace = true angular rate measured with xsens MTx
Red trace = 6DOF Razor angular rate (gain is known to be accurate) using x-io Board: http://www.x-io.co.uk

I would concluded that the bias drift operates within the same bandwidth as the signal, therefore it is imposable to separate noise from signal!

I cannot find any mention or quantification of bias drift in the datasheet. Does anybody have any knoweldge or experience in this area?
By GTBecker
#86822
You don't say what kind of filters are used with the sensors but, if it is a Kalman that combines rate gyro and accelerometer, your data looks like the filter is not well matched to the sensors.

Specifically, the accelerometer noise gain, which is used to calculate a Kalman gain which is, in turn, used to extract the rate gyro bias, looks to be too large; i.e. its data is not well trusted and doesn't appropriately correct the gyro integration.

Are you processing this data yourself?
By sebmadgwick
#86836
There is a miss-understanding, the only processing we are talking about at this stage is getting radians per second from an analogue voltage; i.e.

angularRate = (ADCresult * gain) - bias

However, could you elaborate on something you said...
GTBecker wrote: the accelerometer noise gain, which is used to calculate a Kalman gain which is, in turn, used to extract the rate gyro bias
I am familiar with the theory and implementation of Kalman filters, but can you tell me how an accelerometer can be used to estimate gyroscope bias?
It is my understanding that any such relationship would be built upon differentiation and so be too noisy to use.
By GTBecker
#86840
An accelerometer, when held vertically and stationary at sea level, will yield an output that corresponds to +1g. When horizontal on its sensing axis, its output is ideally zero and when vertical in the opposite rotation, the output represents -1g. That relationship makes it usable as a tilt sensor. But it also senses lateral acceleration, like a flat straight-line speed increase in an automobile, that will falsely appear to be tilt in that application, and mass-produced devices vary somewhat in sensitivity.

A rate gyro yields an output that corresponds to rotation rate, like 0.015v/degree/second, and yields an ideal zero output when it is not rotating on its sensing axis. Mass-produced devices, though, both vary in rate sensitivity, are relatively noisy, and exhibit a DC offset, the bias, at zero rate.

Neither device is ideal for sensing attitude on one axis.

The combination of a rate gyro (not a true gyroscope, BTW, which maintains an attitude; a rate gyro sensor produces change of attitude data) and an accelerometer, via a filter like a Kalman, can produce the current attitude by using one sensor to correct or compensate for the other sensor's weaknesses.

If the rate gyro bias were zero, simply integrating its output (summing successive samples at a constant rate) should produce the current attitude - which should match the tilted accelerometer ideal output. Similarly, the ideal accelerometer output should be matched by the integrated rate gyro data. In practice neither is correct at all times, but the smart math of the well-tuned Kalman (and other filters; the Kalman is not alone) is able to infer and use the errors of each to produce a correct output. The DC bias of the rate gyro is, in fact, one of the values that many Kalman implementations yield - magically, some say - even while the sensors are in constant motion.

You, I believe, are just seeing the slow high-pass correction of a typical biased rate gyro output, which must be corrected. If the bias is stable (most are temperature and shock sensitive, so the bias changes over time), all that might be necessary is to measure the bias when the sensor is stationary and subtract that value it from the output to yield a zero output at zero rotation. More sophisticated methods are usually required, though, in practical implementations that actively track the sensor changes.

There is plenty of information available on gyro/accelerometer Kalman attitude estimation implementations, although much of what you'll easily find online is often the same algorithm. There are also, though, many tomes written about these filters. "Tracking and Kalman Filtering Made Easy", a wonderfully misleading title, by Ely Brookner, is 477 pages. "Fundamentals of Kalman Filtering: A Practical Approach, Second Edition", by Paul Zarchon, et al, is 764 pages, and there are many others. Most of these require understanding some pretty heavy math, but the latter includes many Fortran, MATLAB and Basic code examples that might help.

Tom
By gussy
#86852
When the chip cost of MEMS rate gyros ranges from $5 to $50, you can't expect much from the $5 gyros...

Drift can be filtered out, but your starting at a loss if your using the "bottom of the barrel" gyros like the ones on the Razor :(

Depending on how serious you are, I would look at the AXDRS gyros as a good start. They even have a temperature sensor onboard to help with temperature compensation.
By sebmadgwick
#86864
GTBecker, Thank you for a tougher explanation though this is not what I focusing on. I am fine with Kalman filtering; I have used Kalman filters and EKFs for solving a number of problems including the estimation of a 3D orientation using the 6DOF Razor and a 9DOF senor array. I only wish to discuss (in this thread at least) obtaining a measurement of angular rate.

Just to clarify our discussion...
GTBecker wrote:If the bias is stable (most are temperature and shock sensitive, so the bias changes over time), all that might be necessary is to measure the bias when the sensor is stationary and subtract that value it from the output to yield a zero output at zero rotation.
The plot in my oringal post confirms that this is not a solution; that the bias drift is excited during motion, so much so that its bandwidth overlaps that of the wanted signal’s bandwidth. Hence, non-adaptive filtering will not provide a solution, and an adaptive filters based on a model of the noise process is required; as you've said...
GTBecker wrote:More sophisticated methods are usually required, though, in practical implementations that actively track the sensor changes.
so what we need is a model noise process so that we may design an adaptive filter (perhaps Kalman) around it; as we know others have already done...
GTBecker wrote:The DC bias of the rate gyro is, in fact, one of the values that many Kalman implementations yield - magically
So, what we need to know is: what is noise process that defines the gyroscope bias drift?


gussy, I sure your right but I'm not going to give up. I am determined to make cheap gyros work for me. Infact, cost and form-factor are crucial elements in the project this relates to.
By UhClem
#86870
What you are seeing is not the fault of the gyro but is exactly what is expected from a high pass filter when the input signal has a significant DC component.
By GTBecker
#86883
I'm glad you are comfortable with the Kalman and apologize for the unnecessary dissertation.
... the bias drift is excited during motion...
I believe that's incorrect. You're seeing the DC bias through the high-pass, I think; if anything, the filter is being excited during motion as the signal mean shifts.

I agree with Gussy that you will likely make progress by avoiding the embedded high-pass in the LPR530AL, thus seeing the DC offset and working with it.

I'm not sufficiently familiar with that part to advise on how to disable the high-pass - if that can be done - but I've worked with ADXL203s and ADXRS401s in a number of applications and have found them predictable and unmysterious. Once the bias is removed and the gain is normalized, rate can be easily and directly integrated.
By sebmadgwick
#86912
UhClem and GTBecker, You are saying that the whole time the angular rate is not zero, the HP filter will attenuate the magnitude at a rate corresponding to the time constant of the RC filter; and of course, this is exactly how a 1st order HP works. Thank you for pointing this out; although it is fundamental, I had not fully appreciated it and it does explain the dominate behaviour I was focusing on.

However; the mystery is not completely solved. This plot shows gyro data using a constant value for the bias (known to be correct for majority of data).
Image
Can you offer any explanation why the <DC error NOT corrected> is at steady state (?), it seems as if the gyro bias has shifted during motion.
By GTBecker
#86916
sebmadgwick wrote: Can you offer any explanation why the <DC error NOT corrected> is at steady state?
Nope. Where did that data come from? Can the embedded highpass be disabled?; is that what this is?
By Daniel Wee
#86919
Becker,

My own tests with those gyros indicate that they're not very good to start with, in the sense that repeatability is low. My guess is thermal sensitivity could be one issue so some of that bias may be thermally induced.

As for the high-pass filter, the following post may be of interest to you:-

viewtopic.php?t=18247

Daniel
By sebmadgwick
#86943
GTBecker, I have not removed the RC HP filter yet. The results you see are for:

MyIMU angular rate = [(LPR530AL > RCfilters > ADC) * gain] - bias

where 'gain' and bias are 'constants'. I hope this 'pseudo equation' makes sense?

Thanks Daniel Wee for that link, it certainly is of interest and I think I will conduct some experiments with the HP filter removed. However, my most recent plot above indicates a steady stead DC error which was induced during a period of ~1s of motion. This would suggest to me that the bias was shifted because of the motion, not because a temperature. If this is the case then removing the HP filter will not solve all the problems as Bob Anderson suggests in your link.

I guess this comes back to one of my original questions - Where is gyroscope bias drift quantified!? It seems a pretty significant not to have in the data sheet.
By GTBecker
#86951
sebmadgwick wrote:LPR530AL > RCfilters > ADC[/i]) * gain] - bias
Where did the slow DC restoration go? Did you insert a slow low-pass to compensate? What's the difference between the left and right? With and without that low-pass?
It seems a pretty significant not to have in the data sheet.
Indeed, but - since the LPR530AL doesn't intend to provide the bias on the output - specifying it would be surprising, I think.

By contrast, ADXRS devices do specify the bias, as "null output", 2.5v +/-300mV. Most anyone that has worked with those devices is very familiar with it.
By UhClem
#86953
sebmadgwick wrote:Where is gyroscope bias drift quantified!?
The data sheet does specify a 0.05degree/second/degree C zero offset drift. But that isn't the only source.

The offset and sensitivity are not ratiometric with the power supply so that could cause trouble. If the power supply and ADC Vref are the same (and they frequently are), variation in the output of the voltage regulator will cause drift.

If they were ratiometric with the supply and the ADC Vref was the same then this wouldn't be a problem. As it is you will need to take great care in selecting a voltage regulator. Or whatever your ADC reference source is.

In any case your first step in measuring the offset changes is to ditch the high pass filter. Replace the 4.7uF capacitor with a 0R0 resistor in the same package size. You could remove the 1M resistor if you want but it will have little effect.

Then you can capture some data to see what really happens. Long data runs with temperature constant. With a temperature ramp. After rotating the gyro some amount. Be sure to read up on Allan variance as that is frequently used when trying to characterize the noise sources in gyros.
By sebmadgwick
#86955
OK, it seems there is only one way forward. I shall remove the RC HP filter and begin some investigations to evaluate and quantify the true gyroscope bias drift.

I'll post the results here if anyone is interested? (prob by mid next week)