I am not very good at mathematics and as such I hope I've come to the right place to ask this question.
Currently, I am programming an iRobot Roomba to make a circle. All is well, except that I need it to stop after a complete circle. The Roomba itself cannot know this, so I am taking a time-based approach.
However, this approach is not working.
What I am doing at the moment is this: Let's say I am letting the Roomba make a circle with a radius of 100mm, and set its speed to 100mm/s. The radius is the distance from the centre of the circle to the centre of the Roomba; the Roomba follows the circumference of the circle.
I had calculated that the time for it to complete one circle was (2*pi*100mm) / 100mm/s, which equates to roughly 628/100 = ~6.3s. However, I find that it easily takes the Roomba 10 seconds to follow the circumference, so this current approach leads to the Roomba stopping before even making a full circle.
Have I made a very stupid mistake in assuming I could just divide the circumference with the speed? I have no clue where to look. I looked all over the internet for a day now, but I haven't been able to find a clue.
I thank you for your time and any pointers in the right direction.
Edit: Two things I should indeed point out. The speed given is defined as the average speed of the two wheels on the Roomba. The speed works out to be correct in straight lines. When I increase the radius, between r = 200mm and r = 300mm there comes a point to where the Roomba makes the circle faster than calculated.
EDIT 2: For those interested, I was able to get it to work thanks to JohnJPershing's hints and Ross Millikan's Mathematical aid. I calculated Vl and Vr with help of his explanation and put them in the Roomba using the Drive Direct (145) opcode. Then, the calculated time (6.3 seconds) came to be true!