
so basically proportional is responsible for the strength of action of the robot. For example, if the error is large then the robot's action will also be strong. This value is responsible for turning of the robot. The more the error the more the value of the proportional part. But what does these 3 terms exactly mean? lets see these terms one by one :ġ.Proportional: This term is proportional to the error(E) term. This will be used in our robot to follow a perfectly straight path. PID in pid controller stands for proportional integral and derivative. If you think it's possible by 3 sensors please dm me or share it with me in the comment section below. If your robot follows absolute straight path then only its possible to implement shortest path Algorithm in it. For making it work you will have to make the robot to follow the absolute straight path using PID Algorithm. Is shortest Path Algorithm Possible with 3 IR sensors? Well if you are using just 3 IR Sensors then it's difficult. So main objective of shortest path is to Eliminate all the ‘Backs ‘ or ‘B’ of the robot. Now let's take a quick look at how can we turn this into code: //LSRB ALGORITHM IR1 = IR2 = IR3 = void setup Key to remember : When robot is encountered a 'BACK' path it means that it has followed a wrong path or way. End of Maze: Here the maze ends so the robot will stop here. Four lane intersection(Cross): Here again by the image Left turn is possible so the robot will take left turn here. so the robot will take left turn 7.Dead End: Here LEFT, STRAIGHT, and RIGHT all three are not possible. 6.Right T Intersection(Straight or right): Here Left is not possible but the Straight path is. Left T Intersection(straight or left): Again by image, we can see Robot can take left path so Robot will take left turn here.

So by algorithm Robot will take a Left Turn. Here Robot can take the left turn as you can see in the picture. T intersection(T): This intersection has a T like shape so it's called T intersection. 3.Right Turn(right only): Again as the name suggests it's a right turn so LEFT and STRAIGHT path are both not possible so according to LSRB Algorithm robot will take Right turn. According to LSRB algorithm robot should follow left whenever possible. 2.Left Turn(left only): As the name suggests it's a left turn so LEFT is possible here. Let's take a look one by one: 1.Simple or Straight lane : Here LEFT is not possible but the STRAIGHT path is. Based on this there are 8 scenarios possible. This is the only thing you need to understand the LSRB algorithm. If all the three turns are not possible then and then only BACK.

if LEFT is not possible then STRAIGHT and if both are not possible then RIGHT.

This means that whenever robot is on a turning point or an intersection it will always go LEFT whenever possible. Step 4: if LEFT, STRAIGHT, and RIGHT are not possible go BACK( or it means take a U-Turn).Step 3: If LEFT and STRAIGHT both are not possible take RIGHT.Step 2: If LEFT is not possible go STRAIGHT.Step 1: Always follow LEFT whenever there is a turn possible.Let's see what this algorithm looks like: In this algorithm LEFT direction has the highest priority and the BACK (U-Turn) direction has the least priority. This Algorithm is simple and straight forward. These LEFT, RIGHT, STRAIGHT, and BACK are the directions that the robot follows. In "LSRB" L stands for 'LEFT', S for 'STRAIGHT', R for RIGHT, and B for 'BACK' or BACKWARD. This is the algorithm by which the robot solves the maze.
