Let's Make Robots!

Weird Compass readings

Using this tutorial, I set up my new HMC5883l compass module from china onto my robot, and I had a simple program to draw the readings onto a circle.

Anyways, compass readings do not change at a constant rate. at some parts, the angle will quickly increase, and at other times, the readings will change at a slower pace, and this is all when I am rotating the bot/module at a steady pace. I wanted to use the compass to give me better 90 degree turns, but sometimes 90 degrees according to the compass translates to 180 degrees of actual rotation, and sometimes less than 30 degrees of rotation

I have set the declination angle, so that shouldn't be the problem.. Any ideas?

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Interferance? Digital compasses are incredibly prone to it

My compass is set apart from most of the other electronics, I doubt it is causing the interference. 

Try taking it outside and see is it still getting odd readings. Just the telly being on and off makes a difference to my phone, the microwave does too...

Otherwise your just going to have to average out your readings or something.