Shop OBEX P1 Docs P2 Docs Learn Events
Prop-integrated Magnetometer (Compass)? — Parallax Forums

Prop-integrated Magnetometer (Compass)?

DogPDogP Posts: 168
edited 2009-06-27 08:45 in Accessories
Well, I was doing some thinking about adding a compass to the prop, and I know there's several modules out there, but I'd like a 3 axis tilt compensated one, which are kinda expensive. One thought was that I've already got accelerometers, so a 3-axis magnetometer (or two 2-axis) would work, then compute the compensatation from the accelerometer readings. Then I saw this: www.sparkfun.com/commerce/product_info.php?products_id=244 ... it's a 3 axis magnetometer, but looks like just a microcontroller plus 3 magnetic (magneto-inductive?) sensors and some passive circuitry.

Is anyone familiar with a circuit like that, and is it possible to do something similar using the prop (instead of the IC on that board)? I'm not really familiar with compass/magnetic sensor circuits, but it seems like the prop can do quite a bit of stuff (I used the inductive proximity sensor in a project a few months ago, which seems somewhat similar). I may be wrong, but it seems like the cost would be very low if it's possible to build the homebrewn sensor into an existing Prop board.

So... any thoughts? Is it possible, and what would be involved in making it work?

Thanks,
DogP

Edit: Oops... sorry, I meant to post this in the Propeller section (I was originally thinking of asking general info on the circuit, then decided to ask specific to the Prop)... feel free to move it if you'd like.

Post Edited (DogP) : 6/22/2009 5:50:12 AM GMT

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-06-22 06:49
    I have used a HMC6343 from sparkfun without problem though its a bit expensive and some people have had problems with it.
    There is a thread by Phil using a 2 axis compass and accelometer to fix up the compass, see http://forums.parallax.com/forums/default.aspx?f=10&m=154009
  • DogPDogP Posts: 168
    edited 2009-06-22 07:39
    Hmm... that's interesting. Hopefully Phil will chime in here, or maybe I'll PM him (I don't want to revive a dead thread)... but it seems to me that you wouldn't be able to completely compensate a 2-axis compass with an accelerometer. I can understand some tilt compensation, but when one axis is perpendicular to the ground it doesn't seem it'd work, otherwise couldn't you do a compass that stays flat with a one-axis magnetometer and accelerometer? Anyone have any details on why it works, or did his test only go partially tilted?

    Anyway, I saw this: www.pnicorp.com/products/all/sen-xy-aka-sen-r ... I believe those are the sensors used on the first board I posted, and they look like they'd be pretty easy to interface with. I've read some of the datasheets, and it seems pretty interesting (although their min order is 10 pieces at $10, so I guess two 2-axis compasses would be cheaper for one project, but now I'm intrigued). If anyone has any input, I'd love to hear it.

    Thanks,
    DogP
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-06-22 19:53
    DogP,

    "(I used the inductive proximity sensor in a project a few months ago, which seems somewhat similar). I may be wrong, but it seems like the cost would be very low if it's possible to build the homebrewn sensor into an existing Prop board." - In theory yes, it should be possible with just the Propeller. I have tried without much success (repeatability) however your mileage or someone else's mileage may vary.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • DogPDogP Posts: 168
    edited 2009-06-22 20:42
    Beau,

    Have you used a sensor similar to that? The IC they use doesn't seem like anything special, and from the little bit of documentation I've read on it, it seems like you just send pulses to the sensors through a resistor and count the output (all digital). They even have a discrete circuit design (www.pnicorp.com/files/Discrete%20Circuit%20for%20Magneto-Inductive%20Sensors_15-May-2008.pdf). Their board claims measurement range of +/-1100uT and resolution as low as 0.015uT (and they seem to draw very little power).

    Do you mean that those types of sensors aren't very good, or just that you haven't had good luck with them hooked to the Prop? I mean... I doubt I'll be able to do any better if you've already tried without luck, but if you mean you've tried a different technology, I'd be interested in trying this, since to me it seems like the prop would be a perfect fit if it just involves sending and counting pulses.

    I guess maybe I should buy the kit from SF first (it's in a nice format with the sensors well aligned, and cheaper than the min order of just the components), then after seeing OEM performance (and making sure I understand how it works), see how well it works w/ the Prop doing the driving.

    Thanks,
    DogP
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-06-24 04:06
    DogP,

    I haven't tried the particular circuit you posted... Perhaps I was just having an OFF day, but the results that I remember observing were just not that distinguishable unless I was looking at an extreme. I tried a balanced coil method where you have equal but opposing windings which will produce a "null" signal on the output. When you remove an oscillating signal to the windings, any external field is supposed to produce a signal on the output proportional to the strength and alignment of the external field. It was interpreting this data that I was having problems with.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • DogPDogP Posts: 168
    edited 2009-06-27 08:45
    Just wanted to update... I got the pre-built kit (MicroMag3) and hooked it up to the prop tonight (using SPI), and it seems to work really well. I don't have an actual magnetic needle compass (I'll have to get one tomorrow for calibration), but the readings seem stable and consistent. I've never used a standard compass IC (like the Honeywell), so I'm not sure what they're usually like, but this one gives me full xyz at 51Hz at the lowest resolution and 7Hz at the highest resolution. At the lowest resolution, full 360 rotation gives me +/-20 in each axis (4.5 degree resolution)... at the highest resolution I get +/- 2000 (0.045 degree resolution). At the highest resolution the readings bounce about +/- 2, and the highest resolution that's stable (not bouncy) goes about +/- 600 (0.15 degree resolution) in each axis at about 20Hz.

    One of these days I'll probably disconnect the original IC from the sensors and see what happens if I have the Prop drive them. That won't be in the next few days though... I got lots of new toys today, and the magnetometer was just the first I got around to trying out [noparse]:)[/noparse] .

    DogP

    Post Edited (DogP) : 6/27/2009 8:53:40 AM GMT
Sign In or Register to comment.