Shop OBEX P1 Docs P2 Docs Learn Events
Straight Tracking: Compass vs. Wheel Encoders — Parallax Forums

Straight Tracking: Compass vs. Wheel Encoders

MikerocontrollerMikerocontroller Posts: 310
edited 2010-03-09 05:27 in Robotics
· My prototype robotic vehicle has been drive tested and it looks like it will need help to track a reasonably straight line.· I've adjusted the motor speeds but it tends to dart in both directions.···Has anyone found a compass (such as the HM55B·) to be as useful (or at least serviceable) ·as wheel encoders?· I just want to correct some of the wandering and am not interested in magnetic heading accuracy.·

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2010-03-09 02:40
    The same thought has occurred to me, but I've never tried it. In a sense you are using the magnetic field like a navigation beacon which is a technique that does work. But I don't know if the compass is accurate enough.
  • ercoerco Posts: 20,256
    edited 2010-03-09 02:45
    So what do you have against wheel encoders? [noparse]:)[/noparse] They are cheaper and more accurate (on relatively smooth surfaces) than a compass for going straight.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2010-03-09 03:42
    Thanks. Erco you are the wizard when it comes to wheel encoders! After sitting still for an hour I decided to pursue the odometry route. I have a compass chip but I'll set that aside for now. Can you link me to one of your encoder threads or something you can recommend? I guess I'm just trying to overcome a case of "getitdoneitis". I've already nixed the OLED display for now. I'm also trying to clean up the bird nest of wiring growing from this prototype! How is the Poor Cousin?

    @Martin_H..... I'll be trying the compass next time!
  • kwinnkwinn Posts: 8,697
    edited 2010-03-09 04:10
    Wheel encoders are useful but they are really dead reckoning devices. They can not compensate for slippage. A compass is not very accurate but does give reliable heading information as long as there are no stray magnetic fields to affect it. Use the two of them together and you should get much better results than from either one alone. Use an optical encoder disk with an index position and an attached magnet to keep it oriented north/south and the result will be even better.
  • ercoerco Posts: 20,256
    edited 2010-03-09 04:42
    Mikero: Ts'all good! I·started·a few threads·that you may want to review.

    First there's the long & rambling PC thread at·http://forums.parallax.com/showthread.php?p=869446

    One on the gearmotor/wheel combo I used, with some encoder details at http://forums.parallax.com/showthread.php?p=853015

    And another·just on encoders at ·http://forums.parallax.com/showthread.php?p=874406

    Also, Robot magazine has an article I just wrote on PC (AKA Retrobot) in the new May/June issue, just hitting newsstands now. They'll be posting my software (incl the latest Pathfinder code, see video link below) on their botmag.com website "any day now"...

    kwinn: True, wheel slippage must be avoided when dead reckoning. Amazing results (accuracy & repeatability) can be achieved·by accelerating gently and keeping speeds moderate:

    http://www.youtube.com/watch?v=PX0IhUqnwrk

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2010-03-09 05:12
    Many thanks. I shall move the vehicle out of reach and start reading.
  • ercoerco Posts: 20,256
    edited 2010-03-09 05:27
    BTW, there are many varying opinions on best ways to implement "navigation" by odometry. I'm a fan of dead reckoning with periodic reference and alignment to known reference points (walls or beacons). It can get quite complicated! If all you need right now is to drive straight, that's relatively simple & straightforward. You just count encoder pulses on each wheel and control the speeds to make them sync up 100%. Radial turns are almost as easy, just slow down the inside wheel and control motor speeds to make the outer wheel encoder count a multiple (perhaps twice) of the inside wheel.

    Many excellent articles exist on the subject that provide thought-provoking detail. So while you are in a reading kinda mood, check out our own PhiPi's article at http://www.parallax.com/dl/docs/prod/datast/ApplyEncoder.pdf ··· and also this competition Legobot article at http://www.seattlerobotics.org/encoder/200108/using_a_pid.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.