This is a problem for a lot of teams getting started, and several (many?) posting on this issue. I've documented the procedure in the first couple pages of my programming class "Applied Robot Programming for FRC 'bots"
http://www.chiefdelphi.com/media/papers/1904