looking for a good gyroscope

Hola,guys :slight_smile:

I'm doing a project about calculating position for about three hours.
The object will keep moving till end.

I already have accelerometer,magnetometer,encoder,gyroscope.
Everything is going great,but gyroscope's drift is a big problem.
I already use some calibration at matlab after reading,but still to big for us.
I'm using mpu6050's gyroscope.

i put all sensors on desk for two hours.Other sensor's value is acceptable except gyro.

I read gyro's register directly.Not Dmp's register .
Wondering will read dmp have better result? or should i just find better gyroscope?

code:

void imu6050_data() {
  ID = MPU_addr;

  readmultiRegister(0x43, 6);

  gx1 = values[0] << 8 | values[1];
  gy1 = values[2] << 8 | values[3];
  gz1 = values[4] << 8 | values[5];

  if (gx1 >= 0x8000)
    gx1 = gx1 -  0x10000;
  if (gy1 >= 0x8000)
    gy1 = gy1 -  0x10000;
  if (gz1 >= 0x8000)
    gz1 = gz1 -  0x10000;
  gx1 = gx1 / 131;
  gy1 = gy1 / 131;
  gz1 = gz1 / 131;
}
void readmultiRegister(int fst, int num) {
  int k = 0;
  Wire.beginTransmission(ID);
  Wire.write(fst);
  Wire.endTransmission();
  Wire.requestFrom(ID, num);
  while (Wire.available() && k < num)
  {
    values[k++] = Wire.read();
  }
}

All rate gyros drift and the drift rate depends strongly on temperature.

Most people correct gyro drift in the short term by averaging a number of values while the sensor is (believed to be) stationary, and subtract that as an offset from subsequent readings.