Shop OBEX P1 Docs P2 Docs Learn Events
How to determine Position — Parallax Forums

How to determine Position

SailerManSailerMan Posts: 337
edited 2006-10-22 21:31 in Robotics
OK I have a differential Drive Bot. Current location is the Center of the room.. (X,Y) = (0,0)

Each wheel has an Encoder. The encoders pulse 200 times a revolution. One Complete revolution of a wheel·moves the Bot exact 10 Inches.· The Wheels are 12 Inches Apart.

If both wheel Encoders count 200 I can assume in a perfect world that the bot moved 10 inches forward.·

If the left Wheel moved 200 Counts and the Right Wheel moved 0 obviously the bot turned right... but how do I calculate the Angle? The (X,Y) location will move because the Center of the both rotated around the Right Wheel.

I want to do Dead Reckoning... But I am having trouble with grasping how to keep track of where I am.

If I Start at X,Y @ 0 Degrees... I should be able to count my steps and turns and be able to navigate... with in a degree of error (Alot I'm sure).

Any Idea on how to do the Trig on this?

Eric

·

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-10-10 19:55
    Eric -

    ONLY in the "perfect world" of which you speak will that be true. In the imperfect world in which we are forced to operate, you have to account for things like wheel spin. Only something like an odometer (i.e. a trailing, unpowered wheel) will indicate true forward motion in terms of distance.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • The Fat KidThe Fat Kid Posts: 3
    edited 2006-10-21 04:35
    I've seen guys that use wheel encoders, ultrasonic, and DOG (distance over ground, nothing more than a QTI sensor) and they do some really complicated math to keep accurate position data. Over longer distances they throw in a GPS module. I'll try to find some more info on that and let you know...


    Fatso
  • SailerManSailerMan Posts: 337
    edited 2006-10-21 11:05
    I've figured out the Math for the real world, I just have to figure out how to get it to work with integer math for a microcontroller. I'm still trying to get my head around Cordic.. but it's not clicking yet.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-10-21 11:12
    SailorMan -

    See if this helps:
    http://www.emesystems.com/BS2mathC.htm

    Thanks go to Dr. Tracy Allen.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Tommy BotTommy Bot Posts: 60
    edited 2006-10-22 21:20
    SailorMan,

    12" wheel gap = radius
    20 ep (encoder pulses) per inch (200/10)
    circumference = 2 * pi * radius·= 75.39822 inches
    total circumference encoder pulses = (75.39822 * 20) = 1507.9644
    1507.9644 (total circle ep) / 360 degrees in circle = 4.18879020478 pulses per degree.

    200 ep (distance traveled by one complete wheel revolution) / 4.18879020478 (pulses per degree) = 47.74648 degree shift, (assuming that you meant the left wheel traveled forward and not reverse, then you will haved traveled clockwise in a 47.75648292764144921 degree arc·from the starting reference point.

    Read the link for "Applying the Boe-Bot Digital Encoder Kit (#28107)", It will give insight on getting around the (lack of) whole number issue.

    http://www.parallax.com/dl/docs/prod/datast/ApplyEncoder.pdf


    Tommy

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    (Frequently heard from other's)

    Tommy, I know it wasn't designed to·x, but can you make it·do x·anyway?



    Post Edited (Tommy Bot) : 10/22/2006 9:28:54 PM GMT
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-22 21:31
    For $20 or less, you can get the MicroMega floating point co-processor:

    www.parallax.com/detail.asp?product_id=604-00030
    www.parallax.com/detail.asp?product_id=604-00050
Sign In or Register to comment.