i m amateur to programming …
doing project on “path follower robot” in which i have to give path virtually that part is done
robot is also going on path but it is not going straight so it is distracting from path…
Since the motor has an encoder, you could implement PID to control the speed of the motors to get the robot to drive straight; you could also use the encoders to control the distance traveled by counting the encoders ticks. In general, brushed DC motors of the same model can vary, so even if you implement PID control you should calibrate the voltage to each motor to get approximately the same base speed.
You might find this Arduino page about rotary encoders helpful in understanding how to use quadrature encoders with the Arduino. Also, you might find the robot built by one of our forum members, solderspot, interesting; it uses encoders to navigate. You can find more information about the robot in this forum thread which includes links to his blog where he explains what he did including the code for his robot.