Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

direction sensor (compass?)

Status
Not open for further replies.

arod

New Member
I have been searching the new for the past few days trying to find as much info on compass modules. The robot I have will always be on a flat surface, so a compass would probably be the ideal sensor to detect my direction. The two that I have found are the Hitachi **broken link removed** compass module and a Devantech(?) CMPS03. These compasses claim around 3-5 degrees of accuracy after calibration. I could live with 3-5 degrees of accuracy, but are there any other ideas that I could use that would increase accuracy any more? Are there any better or more accurate modules out there that I have somehow missed? I would be appreciative if anyone who has used any of these could share their experiences. Another thing I am concerned about is the effect that my 4 DC motors will have on the compass module. I don't want to buy one of these and have it completely go to waste because of an overlook on my part. Any and all feedback/suggestions are welcome.
 
Last edited:
arod said:
I have been searching the new for the past few days trying to find as much info on compass modules. The robot I have will always be on a flat surface, so a compass would probably be the ideal sensor to detect my direction. The two that I have found are the Hitachi **broken link removed** compass module and a Devantech(?) CMPS03. These compasses claim around 3-5 degrees of accuracy after calibration. I could live with 3-5 degrees of accuracy, but are there any other ideas that I could use that would increase accuracy any more? Are there any better or more accurate modules out there that I have somehow missed? I would be appreciative if anyone who has used any of these could share their experiences. Another thing I am concerned about is the effect that my 4 DC motors will have on the compass module. I don't want to buy one of these and have it completely go to waste because of an overlook on my part. Any and all feedback/suggestions are welcome.

TO operate around local magnetic fields, you need a compass that can handle those fields as well as the earth's field and not saturate. And then you need to calibrate out those local fields as well as local distortions to get the actual reading (the calibration assumes these fields are constant). By local I mean magnetic sources on your robot as well as materials on your robot thta distort the magnetic field. The stuff I'm going to promote to you now has this stuff...

May I suggest this one?
https://www.sparkfun.com/commerce/product_info.php?products_id=236
**broken link removed**

It is made by
https://www.pnicorp.com/

The company makes magneto-inductive sensors which (and this is what they advertise) are much more sensitive and capable of measuring much stronger magnetic fields than magneto-resistive sensors used in things like Honeywell sensors (and the Devantech modules which use these sensors). THis lets them be very accurate and lets them be used in environments with lots of other magnetic fields without saturating the sensor (so you can calibrate them out and get the actual magnetic bearing reading).

WHat price do you have to pay for this accuracy? You can't sample the sensor as fast. Run through the datasheet and it will show you how the accuracy increases and sampling rate decreases as you take more samples to form a single, more accurate reading. But this is a compass (and not something like integrating gyroscope readings), so you don't really need to sample it very quickly in most cases.

The company also uses these sensors to make 2-axis (**broken link removed**) and 3-axis magnetic field sensor modules
**broken link removed**
https://www.sparkfun.com/commerce/product_info.php?products_id=244

They are very cheap and you can build your own compass from scratch with them if you want (by adding in your own MCU calibration, etc). The module I posted is the actual 2-axis compass (it has calibration for local magnetic fields and distortions etc.) The 3-axis magnetic sensor (called the MicroMag 3) is also on the same order of cost. The actual magnetic compasse modules that use 3-axis though with compensation and everything are >$1000! Like this top-of-the-line one:
**broken link removed**
That's quite a jump between 2 and 3-axis compass modules.

But your application is flat ground so I think the 2-axis compass module it would work great. The 2-axis compass, and 3-axis magnetic sensor modules are also available in evaluation kits and can also be found on that SparkFUn website I keep linking to under Sensors>Magneto

BTW the difference between a magnetic field sensor and a compass is that the compass uses the magnetic field sensor but has calibration and inclinitaton measurement (for 3-axis modules) to produce a navigational bearing.
 
Last edited:
I think when your robot is commanded to move and your motors start to draw current, the compass will be affected by the magnetic field created by the high currents in the wiring. This will probably confuse it. Not to mention what will happen when your robot cruises past a $1000 stereo speaker....
 
Yeah, even with hard iron compensation you probably need to shut off the motors before taking a reading since motor magnetic fields are probably not constant and can't be calibrated for unless you do some overblow, extravagant characterization of the motor behaviour at any given time to figure out it's exact magnetic fields for any operating condition (I doubt anyone, even NASA or the military do that).

It would be preferable to at least hard-iron calibrate for the permanent magnets inside the motor though. The stereo speaker and other environmental magnetic sources you can't calibrate for and people like to stick gyroscopes to help filter those you. Trust the long-term, low-frequency response of the compass but trust the short-term, high frequency response of the gyro.
 
Agreed, compasses can be pretty tricky. Have you considered: 1) A directional gyro (e.g., surplus aircraft). They often will have heading outputs; 2) Accelerometers (e.g., inertial guidance). They have become quite sensitive, small, and cheap (modelers use them) and are reasonably stable over short periods. If the DG is too expensive, a turn and bank indicator might be adapted -- again, you need one with an autopilot output. John
 
Isn't keeping track of your heading such a pain? Probably the hardest thing about mobile robot navigation right after dead reckoning.
 
Hello people,

Im new to forums, so first an introduction:

We, a good friend a I, are building a "robot" (a vehicle which can move to a point, without further help, avoiding obstacles on the way.). Were doing this as a hobby and part school project.

So we bought a radio controlled car. Which we changed to be controlled by a computer, which will the brains of our "robot". We finished this part, but now we need to know where it is. So we thought of an electronic compass, and a revolution counter. We know that this will give a certain measurement error, but we want this a small as possible.

So went looking for an electronic compass, and found a few solutions for it.

This is the part where I would like some advice, for our choice has fallen on this sensor:

FGM - 2 in conjunction with SCL004 Compass Chip
(**broken link removed**) (PDF files with detailled information are on this page aswell)

We are planning to buy this, but its an expensive sensor and chip, so we'd like to be sure this is a good sensor to buy. And especially that there is no other solution with the same accuracy (its claims to have 1 degree accuracy), but cheaper price.

I hope you can help us :)
 
Go onto the main page of each forum, and there is a button on the top left called "New Thread" to make your own post.

All the stuff I said about calibrating to local magnetic sources (ie. magnetic sources that are in fixed positions around your compass at all times, like those onboard your robot) still applies to your magnetic sensor, regardless of how accurate it is.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top