I actually just did this
Lemme run you through some of the math first, (these numbers may, scratch that, will change depending on your algorithm and a bunch of other factors)
So our programmer wizzes have told me that the minimum number of “ticks” (not counting double if you have quadrature output) to be a minimum of ten ticks per second (10 hz) for the PID to be effective so… what does that mean?
First, we need a few paramaters about your robot, I will use our robot from last year as an example. Our robot had 12 inch diamater wheels, and maxed out at about 10 feet/sec and (let’s assume) a minimum effective speed of about 1/2 ft/sec. Our center of rotation was about 8 inches from the front of our robot. We need to be able to measure speed accurately down to zero feet/sec. Also, the encoders are mounted on the output stage of the gearbox to eliminate confounding due to backlash. Common encoder values are 32, 64, 128, 200, 250, 256, 500 and 512 counts/revoloution, before they get prohivitably expensive.
So, the wheel circumfrance is pi * diamater => 12pi ~ 38 inches. Minimum effective speed is 1/2 ft/sec or 6 in/sec. This gives us 6/38 rotations/sec or roughly .158 rotations/sec. Therefore, we need 10 ticks to occur in .158 of a rotation each second.
Using a simple proportion, we find .158/10 = 1/x or 10 = .158x and 10/.158 = x. This gives us roughly 64 ticks/rotation minimum.
So that’s all fine and dandy, but lets look more at the math. 64 ticks only gives us 38/64 ticks per inch or roughly one tick every .568 inches. That kinda stinks. Also, with two motors on opposite sides, that could produce up to twice that error! So one tick every 1.2 inches!!! Even worse, the angular error, as a result of that, is tremendous!
How can we solve that?? We can do many things, go to larger resoloution encoders (we did that and used 512 grayhill encoders - which give us about one tick per 1/3 inch), go to smaller tires, place the encoders higher up in the drivetrain, or use a seperate system (with smaller seperate wheels and maybe geared up output).
All of that is still not entirely perfect, slippages (burnouts!) can and will occur. The gearboxes will not be entirely symmetric. Remember, the motors produce more power in one direction then in the other, build your gearboxes as mirror images, not as duplicates. Also, if you use pnumatic tires, differences in the wheel’s circumfrance will signifigantly alter calculations (and make your robot asymmetric - ie. doesn’t drive streight).
Again, this will vary greatly based on algorithms etc. This is a specific application and your results may vary.
the math is kinda sketchy, look for a revised set of calculations later
good luck!!
-Andy
PS, the spellcheck does not seem to work in firefox, so pardon the errors