Page 1 of 1

LSM303DLHC compass testing is slowly starting

PostPosted: Dec 18, 2013 10:05 pm
by caver.adam
I've got my first simple test completed for my digital compass. I was just trying to get a feel for how it was working.

There are a LOT of sources for variation and error in this simple test. One thing I learned was that I should get easier to press buttons if I ever make another one.

http://projectsampson.weebly.com/rev-c-first-test.html

Let me know if you have any thoughts about what you see here.

Adam

Re: LSM303DLHC compass testing is slowly starting

PostPosted: Dec 20, 2013 11:19 am
by driggs
1. You will NEVER get precise or accurate readings with a digital compass inside the basement of a house. You must test it in an area completely free from magnetic and electromagnetic interference. Caves work well! If you must be tethered to a laptop via USB for development, use a long 5-meter cable.

2. De-bounce your button press in firmware. Don't start sampling the sensor until you've delayed a small time interval due to the physical movement of the actuation. Even better, add a feature with a one or two second delay after button press like the delay on a digital camera; this is a feature that the DistoX sorely lacks.

3. Expect random variation from the sensor. Take multiple samples and combine them into an average. Consider throwing a "warning" if the distribution of samples is too wide, as this could indicate interference.

4. Do not be afraid to "stand on the shoulders of giants". See design docs for DUSI, DistoX, Shetland Attack Pony.

5. Lynn Brucker has a large amount of real-world digital instrument testing experience and has posted a great deal about it in the Survey & Cartography forum.

Re: LSM303DLHC compass testing is slowly starting

PostPosted: Dec 20, 2013 1:19 pm
by caver.adam
1). I was bored and it was cold. Will test in a local cave preserve after the holidays.

2). Debouncing a button press is a MUST! I already was forced to do that.

3). I'm currently averaging 5 samples by eliminating the top and bottom sample and then averaging the middle 3. My code is written so that I can use any number of samples over 3.

4). Thanks!

5). I've been reading his stuff. I either need to get out to a set-up someone else has (driving time) or need to make something here. This first test was just to get a gut feel.

Thanks for the repsonse. I actually hadn't read about the DUSI and am looking forward to that now too!

Re: LSM303DLHC compass testing is slowly starting

PostPosted: Dec 20, 2013 4:46 pm
by Extremeophile
driggs wrote:You will NEVER get precise or accurate readings with a digital compass inside the basement of a house. You must test it in an area completely free from magnetic and electromagnetic interference. Caves work well!

I tried setting up a compass course in my yard with a closure loop going around the house. There were massive interferences from underground plumbing, coaxial cable, electrical, nails in fences, and other unknown and unseen objects. These caused major problems for my electronic compass, but it also seemed to affect my Suuntos. It becomes obvious when you can't get FS/BS agreement. The magnetometer in the digital compass seemed to be more sensitive than the analog dial of the Suunto. Perhaps this is something that can be tuned, but getting the sensitivity high enough to detect the Earth's magnetic field, without being so sensitive that it is affected by the iron in your blood seems like a challenge. It's a hassle to leave civilization to perform these tests, especially in the cold and short days of winter, but it seems like the only practical option. As Dave points out, conducting this type of calibration work in a cave is probably the best bet.

Re: LSM303DLHC compass testing is slowly starting

PostPosted: Dec 31, 2013 10:55 pm
by caver.adam
Thanks. So much for the local option. LoL.