natanaeljr / esp32-MPU-driver

ESP32 full library for all MPU6000 MPU6050 MPU6500 MPU9150 MPU9250 with SPI and I2C support and more.
MIT License
250 stars 67 forks source link

Accel calibration incorrect with mpu_real #23

Open Bestagon opened 3 years ago

Bestagon commented 3 years ago

When running mpu_real with ESP32 and MPU6050, the pitch drifts from 0 (correct - in upright position) to 6 degrees in about half a second after starting, then the value stabalizes. Similar problem with Roll. When I delete the fusion with the pitchAccel like this:

//pitch = gyroPitch 0.95f + accelPitch 0.05f; pitch = gyroPitch;

The pitch value is correct. But i want the fusion to work...

I checked the acceleration offset values for x,y and z and changed them manually until accelG.x = 0, accelG.y = 0 and accelG.z = 1. Now the pitch / roll values are correct when using the fusion with accelPitch and accelRoll. The gyro calibration seems to work fine.

Any idea why the acceleration calibration gives wrong offsets?