My compass continues to be possessed by evil demons. I am pretty confident that living in the shadow of Brunel's Sounding Arch bridge outside of Maidenhead, home of one of the worlds busiest train lines, is part of the problem. The HMC5883L is supposed to be accurate within a couple of degrees but mine varies all over the map and is convinced that east and west are not 180 degrees apart. I have not had a chance to prove this by testing somewhere else but will at some point.
I could live with this behavior for now assuming it were reasonably stable...which it has not been. For example, I tell the 'bot to turn 10 degrees to the right and it went into an infinite loop chasing a bearing that it never attained. This is not good! It turns out that my own electric motors kick up enough magnetic disturbance to freak it out (maybe in tandem with the electric train lines near us)? I had originally mounted the device on the bread board in the center of the Explorer PCB but moved it to the rear and mounted it on a little mast. I have now raised that mast and it seems to have helped...with at least one aspect of it's behavior!
My original thought was that I could use the compass when doing mapping (a function that I envisioned for my 'bot). At this point I am not convinced that I am going to be able to do this given the required accuracy. This leaves me with the quandary of how to know the bot's position. I was hoping to have a bearing and use the range finder for distance. Hmmmm.
For an update on this issue see this post.