top of page

Goal

The goal of this exercise is to perform a PD reactive control capable of following the line painted on the racing circuit.
 

First implementation
     On this first implementation i used a simple method, using a color mask on the processed image  to have only the color of the line, then it checks the middle point of the line , if the i is at the right of the screen, the car turns right, if the line is at the left it turns left.
The problem whit this implementation is that it goes very slow  and does snake like movements, so i will have to improve this method.


Improvements
    The first improvement i made is checking 3 points of the screen and drawing circles that mark the path, then  taking the three point and see if they are aligned, if they are, the car is on the right path so the the speed rises, if they are not the speed lowers because this means   that there is a turn near or the car is not on the line.
    In the first picture the car isn't aligned with the line, in the second it is so we get a message and rise the speed.

Screenshot from 2020-10-24 13-11-40.png
Screenshot from 2020-10-24 13-12-01.png

    The second improvement is using the point that is farther form the car to check if it is going straight, in a curve or in a close curve. Depending on this we use 3 different speeds and 3 different PD controllers which we got by trial and error, it is not perfect yet, but it completes the  circuit in just under a minute, even thought it is not the most stable.

    After tinkering for a while adjusting the constant PD i get a more solid control, although the time could be better, it is still under a minute (59.32 seconds), and the car is pretty stable.

    Finally a added a recuperation state so it goes backwards and spinning (slowly) until it finds the line, i also removed the blue dots that i wasn't using.

© 2020 por Alberto Delgado

bottom of page