I am trying to use the compass reading to control the heading direction of a mobile robot.
I noticed two issues:
The compass heading takes too long (usually more than 30 seconds) to settle on a heading reading. In my experiment, I kept the erlebrain orientation fixed for about 60 seconds, then I changed the orientation by approximately 90 degrees. I did this for 4 different heading directions. The plot of the compass heading values published by the erlebrain as a function of time is shown below:
I noticed that the heading direction always returned to a fixed value when I installed it on the mobile robot and performed the same experiment mentioned above. Could this be due to some kind of electromagnetic interference on the compass? In this second experiment, changing the orientation involved changing the direction of both the erlebrain and robot (since the brain is fixed at the top of the robot). The plot is shown below:
Please is there a way to fix these? Or do I need to get a new compass.