Follow Line PID 2

    The main change in the newer version is the linear speed, wich now is regulated by a PD controller. The controller for the angular speed has been modified as well, now it contains an intregral part making it a complete PID.

    This time the regulation of PIDs constants was the main issue, it took more time than the code desing since it is almost the same as the previous one.

     

    Now the car finishes the circuit in 2 minutes and 20 seconds, aproximately, sometimes it takes a little longer or reduces the time depending on the previous execution, because the image it obtains at the start is the same as the point where it stoped the last time. I also added an "error meter" for visualization and depuration  that allows to see how much error , in pixels, is present at the moment:

   

    For sturdiness reasons when the camera does not see the red line the car strarts to make circles until it finds it. The first part of the next video shows the basic movement, in the second we see it in action:


    A possible problem of this behaivour is the fact that since the system do not know which way of the line it has to go, if the camera catches the line when the car is facing the wrong way it will follow the line doing the circuit in the opposite direction. But the chance for this to happen is very little so i do not think it is a big issue.


 

Comments