Check out http://www.societyofrobots.com/robot_tutorial.shtml or http://www.robotliving.com/building-robots/two-wheeled-robot-2/