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

1. Jun 14, 2015

### Barhemo

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. Jun 14, 2015

### CWatters

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..

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.

3. Jun 14, 2015

### CWatters

Correction: Sin(angle) = 0.5 (d1-d2)/S

4. Jun 14, 2015

### Barhemo

Thank you its a very nice idea.

5. Jun 14, 2015

### CWatters

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.

6. Jun 14, 2015

### CWatters

I think it should be possible to use Excel to process the data and do curve fitting to plot the track.

7. Jun 23, 2015

### Barhemo

I found more accurate solution
@CWatters