m5stack / M5StickC

M5StickC Arduino Library
MIT License
477 stars 222 forks source link

Yaw value keeps increasing/decresing even without movement #80

Closed jokandre closed 4 years ago

jokandre commented 4 years ago

Hi there, I have been trying to debug getAhrsData(&pitch,&roll,&yaw) without success. With the M5StickC on the table without movement the values I get for yaw keeps growing in circles.

I did take a look into MahonyAHRSupdateIMU and other versions available on the internet but still cant get it to work properly.

This happens only for yaw. Pitch and roll values are quite stable after few seconds.

Gist of the values: https://gist.github.com/jokandre/be502bc3ed397fcd13013df5cd740ddd

jokandre commented 4 years ago

Any help is welcomed since I couldn't find much information about the mpu6886 chip. Thanks in advance

EeeeBin commented 4 years ago

mpu6886 datasheet in here: https://github.com/m5stack/M5-Schematic/blob/master/datasheet/MPU-6886-000193%2Bv1.1_GHIC.PDF.pdf Mostly the same as mpu6050 Gyro yaw drift is normal, if want to get stable yaw angle, it need to use the magnetometer calibrate

jokandre commented 4 years ago

@EeeeBin Any advice on how to calibrate the magnetometer? Or at least any resource I can follow?