Sonsivri

Electronics => Projects => Topic started by: santoshaxl on March 07, 2012, 12:08:54 12:08



Title: arduino +cmp03+lcd digital compass
Post by: santoshaxl on March 07, 2012, 12:08:54 12:08
hello
i am just sharing what i did .i purchased compass sensor cmp03 from http://www.robot-electronics.co.uk/ and arduino and lcd from local market .i have just assembled all these components and just few lines of programs wow a digital compass . sample code is given in http://www.robot-electronics.co.uk/ sites .


Title: Re: arduino +cmp03+lcd digital compass
Post by: bigtoy on March 14, 2012, 05:49:33 05:49
How accurate do you find the digital compass to be?


Title: Re: arduino +cmp03+lcd digital compass
Post by: Elmer on March 14, 2012, 09:12:42 09:12
How accurate do you find the digital compass to be?
Just FYI, accuracy with this sensor really requires the sensor to be absolutely level, there is no tilt compensation. Also, there is only two sensitive axes, so if you wanted tilt comphensation with this sensor you'd have to provide an estimate of the z-axis based on an approximate magnetic absolute vector length. Along with an accelerometer of course.


Title: Re: arduino +cmp03+lcd digital compass
Post by: solutions on March 16, 2012, 09:14:30 09:14
Um..those mounting holes in the CMPS03....what kind of screws did you use?

Also, your reading of tilt will also be wrong.

Why?

Did you read and do this?

"Calibration

Do not attempt this until you have your compass working! Especially if your using the I2C interface - get that fully working first. The module has already been calibrated in our workshop for our inclination, which is 67 degrees. If your location is close to this, you may like to try the compass without re-calibrating at all. Calibration only needs to be done once - the calibration data is stored in EEPROM on the PIC18F2321 chip. You do not need to re-calibrate every time the module is powered up. "


Your inclination is not 67°...I don't know exactly where you are, but in Katmandu it's 42° 28' not 67°


Title: Re: arduino +cmp03+lcd digital compass
Post by: Elmer on March 21, 2012, 06:02:34 18:02
When I did magnetometer calibrations on an IMU project some years back, I remember I found this paper (http://www.ssec.honeywell.com/position-sensors/datasheets/sae.pdf) very useful. It's a Honeywell paper, but applies to any magnetometer measurements. The rotational equations for tilt compensation may seem tricky but is simply a matrix rotation (http://en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions) of the measured mag vector, opposite to the rotation of the measured gravity vector (pitch/roll). Final azimuth is the corrected mag vector loosing it's Z component (projected onto X,Y plane), the paper uses atan to express angle vs north. In the rotations, remember each rotation is a matrix multiplication which is non-commutative so order of rotations matters.

EDIT: On commutativity, to illustrate order of rotations; if you represent pitch and roll by angles (not by a gravity vector), the angles need be relative to some axis system. If that system has a  in a pitch-roll rotation order, you need to correct the mag vector in backwards order; first reverse roll - then reverse pitch.