The document presents a calibration method for the AK8963 magnetometer utilizing an optimal ellipsoidal fitting to enhance accuracy in autonomous navigation systems. The method addresses common issues such as axis misalignment and environmental disturbances, and includes comparative analysis of calibration effectiveness. It details the configuration and operation of the MPU-9250 sensor and provides insights into the method's implementation and results.