Shop OBEX P1 Docs P2 Docs Learn Events
Optical Encoder on a compass — Parallax Forums

Optical Encoder on a compass

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-11-13 17:37 in General Discussion
So I was looking around and you can find compass modules for dirt cheap on ebay although im not sure how well they work or if there easy to use with a prop. I had this idea quite some time ago and was wondering if it should theoretically work. I want to somehow mount a cheapo compass and then hit the lines with two reflective sensors i.e quadrature encoding. Seems like this may a viable way of making a "digital" compass

quick example imagine two ir sensors though

IMG_20121112_180449.jpg
1024 x 768 - 48K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-12 18:45
    It would work as long as you knew what your initial heading was. Quadrature encoders register relative rotational motion, not absolute position.

    -Phil
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-11-12 19:59
    hmmm that is quite the delima, maybe a motor to pull the compass to a certain posistion everytime the power is turned on... im not sure how you could do that didnt even think aabout needing to know the starting position :/.

    I see alot of hmc5883l digital compass modules on ebay for dirt cheap, there even cheap on spark fun but I dont really see any objects on obex for them. It makes me wonder how easy they actually are to use. Do you have any recommendation on some type of inexpensive compass?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-12 20:01
    maybe a motor to pull the compass to a certain posistion everytime the power is turned on...
    ... or a small electromagnet.

    -Phil
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-11-12 20:10
    ahhh yes that would be alot more simple than some kine of motor system lol :). somehow keeping the disc from falling off a needle while on a robot seems like the biggest chore of all though, at least when you dont have fancy tooles to go print up/cnc a custom case. Do you think this is wort the effort i mean is this going to be even close to as accurate as a compass module? the plate seems to take a few seconds to settle on the coreect postistion so if there was alot of movement it may be hard to get the correct baring, would this be true on a sensor also?
  • kwinnkwinn Posts: 8,697
    edited 2012-11-12 20:46
    ahhh yes that would be alot more simple than some kine of motor system lol :). somehow keeping the disc from falling off a needle while on a robot seems like the biggest chore of all though, at least when you dont have fancy tooles to go print up/cnc a custom case. Do you think this is wort the effort i mean is this going to be even close to as accurate as a compass module? the plate seems to take a few seconds to settle on the coreect postistion so if there was alot of movement it may be hard to get the correct baring, would this be true on a sensor also?

    It might be usable if the robot stops to take a reading but it will not be of much use on a moving robot since any movement will affect it. If the compass disk has an index mark of some kind at one position you could use that to get your initial heading by rotating the disk with a solenoid and then releasing it. Another option would be to have the robot turn until the index mark is found.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-11-12 21:21
    ... or a small electromagnet.

    -Phil

    With three holes each 90 degree quadrant. One to indicate index and two to indicate quadrant. Need never go much over 90 degrees in any direction to "home" the devive. Or just one to require max one full revolution to find "home".

    Is there a reason to not use an electronic compass chip similar to what is in tablets, smartphones etc.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-11-12 22:24
    I see alot of hmc5883l digital compass modules on ebay for dirt cheap, there even cheap on spark fun but I dont really see any objects on obex for them.

    There's Spin code on Parallax's product page.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-11-12 23:09
    well there sure is I thought parallax used an hc55b or something... lol well ill probably just get a 5883l then
  • jmgjmg Posts: 15,183
    edited 2012-11-13 02:09
    So I was looking around and you can find compass modules for dirt cheap on ebay although im not sure how well they work or if there easy to use with a prop. I had this idea quite some time ago and was wondering if it should theoretically work. I want to somehow mount a cheapo compass and then hit the lines with two reflective sensors i.e quadrature encoding. Seems like this may a viable way of making a "digital" compass

    If you do want to try a rotating disk compass, then have a look at Single Track Gray Code designs.

    Those use multiple sensors, all looking at different sections of one single, special slotted pattern.

    One example :
    =====V=====V=====V=====V=====V=====V   6 Sensors, 6 spaced, for 36 step absolute Encoder. (10' resolve)
    --------------xxx----xxxxxxx---xxxxx  Slot pattern, either polarity
    



    They tend to be studied equally spaced around 360' if you are a mathematician, and spaced around just over 180', if you are an engineer who also worries about how to assemble things... ;)

    You could use two slots, and twice as many sensors, to square the resolution.

    There is even a right angle Optical - Photointerrupters - Slot Type - Transistor Output the TCST5250

    http://www.digikey.com/product-detail/en/TCST5250/751-1039-5-ND/1681173
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 06:12
    I really like this idea for bling on a robot. It's impractical compared to an electronic compass sensor, but would just be neat if pulled off correctly.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-13 08:12
    I don't know if this will help any, but attached is a paper about a compass I made from a tuna can and a couple magnets. It used color for sensing direction, but it could be adapted for other methods of encoding that information.

    -Phil
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 09:12
    Phil, that is neat. I never thought of using a color sensor as an absolute position encoder. That could be used for many different tasks besides a compass.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 16:10
    Phil, the pdf mentions a file called ColorWheel.jpg which I didn't see on the color sensor product page. Do you know where it is located?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-13 16:20
    Martin,

    The entire installation package is attached below. It includes the color wheel image.

    -Phil
  • idbruceidbruce Posts: 6,197
    edited 2012-11-13 16:32
    @Phil

    It looks like your boe-bot has a big air filter and breather on it :) Pretty cool looking actually. With a couple of artificial air intakes, it would almost look like ram air. :)
  • ercoerco Posts: 20,259
    edited 2012-11-13 17:16
    I'm assuming that tuna was DOLPHI safe, DolPhiPi!

    Tip your waiters, thanks, I'll be here all week...

    Totally great compass project.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 17:37
    Martin,

    The entire installation package is attached below. It includes the color wheel image.

    -Phil

    Great thanks a bunch!
Sign In or Register to comment.