by crawford » Fri May 08, 2009 9:57 pm
Trying to get both numbers at once is difficult.
Start by working on the wheel diameter. Measure it, then place the robot on a starting line and tell it to go ahead some relatively large distance in the units you used for the measurement. I used millimeters for wheel diameter, so told it to move ahead 1000 mm. Measure from the starting line to where the robot ends up. If it went farther than you expected, you need to INCREASE the wheel diameter; if it didn't go as far you need to DECREASE the wheel diameter.
(Why? If you go farther, the code thought it had to turn the wheels more times than necessary for the given distance; if you didn't go as far, it didn't turn the wheels enough times.)
Once you've got this to a tolerance you can live with, work on the track diameter. Again place the 'bot on a starting line and have it turn 90 degrees. You can compare the result with anything you trust to have a right angle. If the bot turned too far INCREASE the track width; if it didn't turn far enough, DECREASE the track width.
(Why? The track width is the radius of your turning circle. If you turn too far, the code calculated too small a turning circle; if you don't turn far enough, the turning circle was too large.)
It's easier to adjust these independently, and the direction of the adjustments can seem a bit counter-intuitive.