Madgwick filter error in Yaw angle when Pitch is moded

Hi!!

I am using the MPU6050 IMU + the HCM5883L magnetometer to obtain yaw, pitch and roll angles. My problem is that when I move in Pitch, the yaw angle change in +- 50 degree approximatelly. However, if I move only in Roll, don't change Yaw. The only error is when move in Pitch.

Can be an error in the axis direction? Or in calibration process maybe?

Magnetometers are generally useless unless properly calibrated. Here is the best procedure: Sailboat Instruments: Improved magnetometer calibration (Part 1)

Also, you have to be certain that your definition of pitch and roll corresponds to the Magwick definition. There is no standard!

Did you figure it out? I am having the same problem.