lsm303 on Rover 5 4wd
February 9, 2013
Has anyone had any success using a lsm303dlhc as a compass on a Rover 5 4wd with the motors running?
After some research, I noted that some people had them mounted on a mast so I've placed it 400mm above the motors. This has completely removed any interference from everything except the motors. Even with an XBee transmitting continuously, the headings don't vary more than 1-2 degrees with the Rover stationary (which is much better than I'd hoped for). But as soon as I fire up the motors, the readings are useless. I tried raising it to 600mm but this didn't alleviate the problem.
I only had a quick google, but mu-metal sheet doesn't seem to be easily obtainable in Australia and I'd only be guessing at the required thickness anyway.
I only fitted a compass because the optical encoders are becoming a bit unreliable of late and I use them to turn the Rover the required number of degrees. Also, one of the motors is a bit slow so the Rover slowly turns left when it's going straight ahead. I tried tweaking the PWM on that motor but it's not linear and needs to be compensated according to how fast the Rover is going. (I'll work out the maths later). I was hoping to use the compass to adjust the course on the fly.
Anyway, it's not a show stopper - I'll just stop the Rover when I want to take a reading and I'll keep using the encoders to turn and then stop and fine-tune with the lsm303. If I feel like pulling it all apart (no motivation at this stage) I'll try OddBot's suggestion and play with the encoder pot to see if I can improve the reliability.
Just thought someone might have solved this.