I am trying to get heading information of a forklift. I've designed a small PCB for this purpose. This PCB has a 3 axis magnetometer and a 6 axis gyroscope-accelerometer (Z- axis looking towards the ground). I've used Madgwick's sensor fusion algorithm to combine 9 axis' informations. There are 3 choices for the sensor fusion implementation;
- Choice 1: It uses all 9 axis information and returns roll, pitch, yaw values (Affected by magnetic interference)
- Choice 2: It uses only gyroscope and accelerometer readings and returns relative roll, pitch, yaw values (Does not get affected by magnetic interference however value drifts over time)
- Choice 3: It uses only magnetometer and accelerometer readings returns tilt compansated heading (Affected by magnetic interference)
Which one would be more suitable in metal heavy environment? Are there any other methods that you can suggest?
Also due to dynamic magnetic interference of the forklift's moving parts, I've mounted the device at the rear top side of the forklift. Should I do hard and soft iron calibrations when the device is mounted on the forklift or should I do calibrations before mounting? If I try to calibrate when the device is mounted, I won't be able to rotate device around the Z axis.