Is it possible, to use a 3-Axis Digital Compass for attitude control?

At the moment I am using a 3-Axis Digital Honeywell Compass IC HMC5883L (similar to a JY RM 3100) at my copter. That works fine to turn the yaw axis to the desired direction.

The output of 3 axis is momentary reduced to one variable, to show the direction in reference to the horizontal surface. But for every direction beween 0 and 360 degree and every bank angle I obtain a different XYZ vector. So I am quite sure, that somebody has already thought about using those 3D vectors to pull out the nick, roll and yaw information to create an internal realtime model to be used for the PID control. Has that theme already been discussed here ?

The Ardupilot EKF fuses the full compass 3-vector into its state estimate:
https://ardupilot.org/dev/docs/ekf2-estimation-system.html

Brilliant technical solution. Thank you for your quick reply.
As I can see, you are using the “24 state extended Kalman filter” based on the Journal of Guidance, Control, and Dynamics.

Forty years ago I have been working at the university on the development of Kalman filters at huge computers. It is astonishing to see, how incredible that developed to the size of microcomputers.

1 Like