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

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
6 replies · 1K views
Barhemo
Messages
3
Reaction score
0
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:
Physics news on Phys.org
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.
 
  • Like
Likes   Reactions: Barhemo
Correction: Sin(angle) = 0.5 (d1-d2)/S
 
  • Like
Likes   Reactions: Barhemo
Beware what I said..

CWatters said:
This will not give very accurate results because any error will be compounded.

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.
 
I think it should be possible to use Excel to process the data and do curve fitting to plot the track.