Is there any document or tutorial to get error corrected Roll, Pitch and YAW (AHRS) using 3 axis accelerometer + 3 axis Magnetometer +3 axisGyro. I tried finding the quaternion using Madgwick algorithm for AHRS but it didn't worked. When I tried changing the orientation from 0-90 degree , the values showed 0-360 degrees multiple times. So I wanted to follow the standards and make it work. In this I wanted self calibration and using these sensor error correction also. Please Look into the matter.