The way to tune the controller is to copy the encoder clicks per each sample in a array say 200 samples per motor. This means two byte arrays of 200. make a test function that allows for 200 PID cycles then it should (not required) stop the motors. Then you can send out all of the data stored via uart to Hyper terminal on your PC. If you use println() for each piece of data you can simple copy the data and paste it in excel to make a graph of the motor speed. All you have to do in excel is select the first 200 lines of data and compare them to their respective time. The time that each sample is know because you chose the frequency of the PID controller.

example of what data should look like in excel assuming 50ms sampling (.05s)

mate, get eagle! i cant tell a thing by looking at that (no offense) although i don't know too much about encoders, do "E" and "D" stand for "emitter" and "detector? and by "atmega88" do you mean "atmega8"?when you say "pin out to mother board" you mean I2C correct?sorry for all the questions but im new to encoders too, and its hard to tell from the non-eagle file if you want i could knock up a quick schematic of what you are saying?

1. No, you tie the emitters to GND and through a resistor to Vcc. The detectors are tied to GND and to the microcontroller pin. You eighter need a pull up resistor there or turn ON the internal pull up resistors. I usually use external ones.

2. Yes, you need to program the microcontroller to read the encoders, eighter by polling or by interrupts.

If targeted Velocity is 0.5 m/s, RPM is 60 (standard servo) results a Wheel circumference of 0.5 m, or 500 mm. This is way too big for a servo. Let's calculate the other way around. The wheels that I have are 66.88 mm in diameter, that means the circumference is 210 mm or 0.21 m. For the same targeted velocity, the RPM should be Velocity * 60 / Wheel circumference, that is 0.5 m/s * 60 / 0.21 m = 142.857.

Now to calculate the encoder pulses. For the 210 mm wheel circumference, to have a traveled distance of 5 mm per click, I need 42 clicks per rotation. That means 21 white and 21 black stripes, or 21 holes in the wheel. I would like to have more precision than that, so I will try to mount the encoders directly on the back shaft of the motor that spins 51 times faster (that's the gear ratio) than the output shaft.