howardhb wrote:Thanks @EOSBandi!
I will test this in the morning.....
Please confirm, In IMU.pde:Code: Select all
// Attitude of the cross product vector GxM
//******************************************EOSBANDI - removed /10 to increase precision of decliniation calc
heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z );
//******************************************EOSBANDI
//add declination
//Heading is -180 - 180 had to wrap up accordingly
heading = heading + MAG_DECLINIATION
heading = heading /10; // /10 moved here from above
It seems that only a 10th of the defined magnetic declination is being added to heading, owing to the division by 10, after adding declination?
Is this as you require it?
you are right, nice catch. It sould be
heading = headig + MAG_DECLINIATION * 10;