by sich » Thu Dec 01, 2011 10:51 pm
Actually the correct way is to determine how many pulses will you get from the encoder output for a certain distance. Once reaches the desired distance, stop or brake the motors. The PWM has to do which how fast the robot moves, not how far it has travelled. Of course the higher the PWM, the farther it moves in a fixed period of time. But that's different story.