Compass installation & alignment to vehicle frame

Hi,

I’m installing an external HMC5883L compass in a small 250-size quad. A pic of the particular breakout board I’m using is attached. Could you please confirm that the following approach is correct?

The compass’s axes system is clearly marked on its PCB. I am assuming we have XYZ being the right-handed ENU system (as used in many ground-based robots).

ArduPilot uses NED, also right-handed, so if I wanted to use this compass without any orientation offsets, I would install it on my air vehicle with its X axis pointing out the nose, the Y axis out along the right wing and the Z axis through the floor. This would obviously involve flipping it over from the orientation you see in the pic (assuming that up is towards the top of your monitor).

But I want to mount this compass in the vehicle at a bit of an odd angle. Starting from the orientation described in the last paragraph (already flipped over), I would like to rotate it first around the Z axis by +90 degrees (to the right). Then I want to rotate it around the Y axis by -45 degrees (pitch down).

I must inform ArduPilot of this ‘custom’ orientation and so for the COMPASS_ORIENT parameter, I would choose Yaw90Pitch315 which is option… it doesn’t exist. OK, don’t worry about this right now, but is my method so far correct?

If so, I’ll have to implement this option in the code, which will be my next task.

I have a further question, and it’s a pretty big one. Just how accurately does the compass’s frame need to be aligned to the vehicle’s frame? Is there any particular axis or plane that needs to be more accurately aligned than the others? The reason I ask is that I imagine that good azimuth estimation is critically dependent on the compass’s alignment to the vehicle, and calibration will not solve errors here (though perhaps EK2 can be used to determine alignment error?).

I would be extremely grateful if some kind soul could give me some good info here. Thanks.

Gerry

hmc5883l.jpg

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity