Hi, Steve.
I looked over the comments in the AHRS program, and I think the comment that says that nose down should produce positive pitch is wrong (and so is the one that says counterclockwise yaw is positive). After all, the point of the different SENSOR_SIGN definitions is to make the program report consistent angles regardless of the way the board is mounted. So in all cases, it should be:
// Positive pitch : nose up
// Positive roll : right wing down
// Positive yaw : clockwise
and at this point, I think the directions you see are correct. (Thanks for noticing this; I’ll fix the comments in the code.)
Your yaw problems are probably due to the magnetometer still not being calibrated well. You might try running our calibration program again to see if you can improve your results, although it sounds like you’ve already tried a few times.
In general, calibrating a magnetometer can be tricky, and the method that we use in our examples does not always work well. We would like to eventually provide a better tool for magnetometer calibration and make it easier to use the calibration data in an AHRS program, but we don’t have any specific plans for those right now.
If you are interested in trying to work out a better calibration method, you might want to take a look at the ongoing discussion in this thread.
Kevin
