This paper investigates the process when the autonomous robot moves in a straight line. Set up physic model and use mathematical principles to calculate and get the relation between the rate of left and right wheels.Analysis the method of control,using photoelectric coded disks and exporting in PWM ways. Robots could be timely adjusted through close cycle control of PID arithmetic.