TKJElectronics / KalmanFilter

This is a Kalman filter used to calculate the angle, rate and bias from from the input of an accelerometer/magnetometer and a gyroscope.
http://blog.tkjelectronics.dk/2012/09/a-practical-approach-to-kalman-filter-and-how-to-implement-it
1.75k stars 730 forks source link

Calibration #25

Open nices0325 opened 3 years ago

nices0325 commented 3 years ago

hello tkj electronics. Well read your good library, it really helped me understand what the kalman filter is. Anyway, I wanna know how to calibrate mpu6050 accel,gyro offsets using kalman filter. In other IMU like DMP or MAHONY filter, It has a way to calibrate the offsets(accel,gyro). I have no idea how to add calibration code to your example... If you don't mind , Could you let me know the way to calibrate or related links?? Thanks a a lot!

ps.

double accX, accY, accZ; double gyroX, gyroY, gyroZ;

Would it be proper to use this variables with my own accel&gyro offsets with using my calibration codes?? thank you

NilotpalMaitra commented 6 months ago

Some MPU6050 libraries (e.g., MPU6050_tockn) have built-in calibration functions like calcGyroOffsets that collect readings during stillness and calculate offsets.