kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 472 forks source link

questions about calibration the magnetometer #438

Open liutianxin0722 opened 3 years ago

liutianxin0722 commented 3 years ago

Hello Kriswiner, Thank you for your code and help! I have a question about the magetometer calibration. How to move the sensor in a figure"8" pattern? Is it put the sensor horizontally on a table and then move in a figure "8" pattern? Or the sensor does not need to be horizontally placed? Besides, when we move it in figure"8", do you mean change the heading point of the sensor during the process? I think it will be better if we have a video to teach us how to calibrate magnetormeter.

I notice lots of people have the problem that when rotate the sensor about only x-axis, the roll and yaw value change together. When i use 6-axis sensor,there is no such problem, but for 9-axis sensor, we have. Maybe the calibration of magetometer is the key and input the Acc ,gyro , Mag in a proper order into filter is also important.

kriswiner commented 3 years ago

The purpose of the magnetometer calibration is to center the sensor response surface on the origin and rescale the axes sensitivities to round up the response surface. The way this is done is to move the sensor in all possible directions (not fixed to the plane of a table). That is because the response surface is a 3D sphere which in an uncalibrated mag is off center from the origin and distorted into an ellipsoid shape or worse.

So accel and gyro calibration must be doe with the sensors flat and motionless. Mag calibration must be done with the sensor moving through every possible orientation multiple times.

If the sensors are not calibrated, you can get any result. But the cross axis effects you describe are usually the result of incorrect (not NED) sensor data input to the Madgwick fusion filter.

On Thu, Oct 29, 2020 at 1:36 AM liutianxin0722 notifications@github.com wrote:

Reopened #438 https://github.com/kriswiner/MPU9250/issues/438.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/438#event-3935077696, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKVEWNCBPJSL3MYGSCLSNESRZANCNFSM4TDKRO7A .