kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

Gyro Offset (Bias) #65

Open barakman opened 8 years ago

barakman commented 8 years ago

I have empirically found that I need to use:

data[0] = (+gyro_bias[0]/4 >> 8) & 0xFF; data[1] = (+gyro_bias[0]/4) & 0xFF; data[2] = (-gyro_bias[1]/4 >> 8) & 0xFF; data[3] = (-gyro_bias[1]/4) & 0xFF; data[4] = (+gyro_bias[2]/4 >> 8) & 0xFF; data[5] = (+gyro_bias[2]/4) & 0xFF;

This is different from the original code, in those '+' signs (originally '-' signs).

kriswiner commented 8 years ago

It doesn't make sense to treat one axis differently from the other two. I suspect you have an integer sign conversion problem instead. It doesn't matter for this particular MPU9250 if you use this fix but this coding is guaranteed to give the wrong result with any other.

Sent from my iPhone

On Jun 19, 2016, at 7:06 AM, barakman notifications@github.com wrote:

I have empirically found that I need to use:

data[0] = (+gyro_bias[0]/4 >> 8) & 0xFF; data[1] = (+gyro_bias[0]/4) & 0xFF; data[2] = (-gyro_bias[1]/4 >> 8) & 0xFF; data[3] = (-gyro_bias[1]/4) & 0xFF; data[4] = (+gyro_bias[2]/4 >> 8) & 0xFF; data[5] = (+gyro_bias[2]/4) & 0xFF;

This is different from the original code, in those '+' signs (originally '-' signs).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

barakman commented 8 years ago

Any chance that this my observation is the result of the physical position of the MPU controller?

kriswiner commented 8 years ago

No.

Sent from my iPhone

On Jun 19, 2016, at 10:26 AM, barakman notifications@github.com wrote:

Any chance that this my observation is the result of the physical position of the MPU controller?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.