How to determine Position
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
·
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
http://rossum.sourceforge.net/papers/DiffSteer/DiffSteer.html
this link to MIT has an odometry tutorial with data--very good
http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-186January--IAP--2005/StudyMaterials/index.htm
sorry it wrapped
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 -->
Fatso
See if this helps:
http://www.emesystems.com/BS2mathC.htm
Thanks go to Dr. Tracy Allen.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
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
www.parallax.com/detail.asp?product_id=604-00030
www.parallax.com/detail.asp?product_id=604-00050