Hi everyone,
I'm building a drone that will be radio controlled and hopefully one day semi-autonomous.
I am using an MPU6050 for attitude measurement and PIDs for attitude control.
The heading of the vehicle is controlled by the z-gyro, which obviously drifts over time as there is nothing to reference it against.
I am using a complementary filter for pitch and roll measurements fusing the gyro and accelerometer values which works very well.
My question is; is there a similar fusion that can be performed in connecting the gyro heading to the reading from a magnetometer to remove the gyro drift over time.
My initial gut feel was fusing the gyro rate with the differential of the magnetometer reading so they are both in angular velocity, similar to the complementary filter used in angle measuring, and then have a PID to compare the current angle rate with a desired value. So when an RC yaw command is sent, it will change the desired yaw rate and the PID will do the rest. Sound feasible or is there a better way to go about it? Thanks.