I m working in my first robotics project.my robot is an obstacle avoiding one and the problem is that the robot sometimes deviates from the defined path ( such as it does not move in a straight line ) so i hope this issue can be minimized by using pid controller to control speed in dc motors. can any one guide me how to achieve this ?
first you need some obstacle detector similar to those
**broken link removed**
when you have detect the obstacle you could make the avoidance moves you have.
For the PID control you could find excellent examples on internet for the controller you are using.
Look the link for example. **broken link removed**