01-22-2024 03:13 PM
HI,
I used the X-axis and Y-axis data obtained from the BMM150 to perform the following operations
compass = atan2f(mag_mx,mag_my);
if(compass < 0)
{
compass+= 2 * PI;
}
if(compass > 2 * PI)
{
compass-= 2 * PI;
}
TCompass = compass * 180 / PI;
When the X-axis points north I get zero degrees, and I can rotate it to get an Angle from 0 to 360
But as I move horizontally toward the north, my Angle slowly increases. Is that normal? What causes it? How do I fix it?
01-23-2024 09:21 AM
Hi Migrant_worker,
Do you mean you move horizontally toward the north, the angle of the compass increase?
01-26-2024 04:39 AM
HI,
Yes,
moving horizontally to the north increases the Angle of the compass.
What is the cause of this phenomenon?
What can be done about it?
03-08-2024 07:49 AM
Hi Migrant_worker,
Moving BMM150 horizontally will cause a change in the compass reading. In theory, this is normal because the position of the device has already changed.
Individual BMM150 data cannot obtain the angle of the compass, and a fusion algorithm needs to be run in conjunction with IMU data to obtain the compass data.