1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

2 motors on robot -- how can I save the movement history?

  1. Jun 14, 2015 #1
    hello,
    I have a car robot with 2 motors which follows a black line.
    I want to save the track which the car follows.
    I can get the speed of each motor every.
    I thought about saving the 2 motor speeds every 100msec and then figure from this the track.
    Any ideas how I can do it?
     
    Last edited: Jun 14, 2015
  2. jcsd
  3. Jun 14, 2015 #2

    CWatters

    User Avatar
    Science Advisor
    Homework Helper

    Velocity = Δdistance/Δtime
    so
    Δdistance = velocity * Δtime

    So you can work out how far each wheel (d1 and d2) has moved in Δtime=100mS.

    Using that information you can estimate the radius and angle of any turn. See diagram..

    Radius.jpg

    More calculations are needed to work out the new position relative to the old position.

    This will not give very accurate results because any error will be compounded.
     
  4. Jun 14, 2015 #3

    CWatters

    User Avatar
    Science Advisor
    Homework Helper

    Correction: Sin(angle) = 0.5 (d1-d2)/S
     
  5. Jun 14, 2015 #4
    Thank you its a very nice idea.
     
  6. Jun 14, 2015 #5

    CWatters

    User Avatar
    Science Advisor
    Homework Helper

    Beware what I said..

    Expect very large errors. If each 100mS step has a 1mm error then after 10 seconds the position could be out by 100mm. 20 seconds = 200mm etc.
     
  7. Jun 14, 2015 #6

    CWatters

    User Avatar
    Science Advisor
    Homework Helper

    I think it should be possible to use Excel to process the data and do curve fitting to plot the track.
     
  8. Jun 23, 2015 #7
    I found more accurate solution
    @CWatters
    upload_2015-6-23_20-35-0.png
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook