In a system with only a gyro, what is the best way to compensate for zero offset? I have tried a number of ways to collect measurements for a number of seconds, and then determine the resting angle rate, and then apply that to each measurement for correction. There is always a remaining angle rate which I haven't succeeded in compensating out. What am I missing?

Andy.

Hi Andy,

The most simple method of computing GYRO offset is spinning several times and then taking an average of at-rest numbers. I assume this is what you are doing but you are not satisfied with the result. Using the above method the bulk of the error should have been removed.

How much residual error are you seeing? This may be an orientation-dependent offset and require an Accel/Mag for further correction. You may refer to NXP Sensor Fusion, in which the gyro offset is computed automatically and the Kalman filter should indicate the output. However, please note that NXP's algorithm uses all available sensors and the Code for the algorithm is not trivial and requires detailed understanding.