Coding a Line Follower Robot using LSRB and finding the Shortest Path (2024)

Line Follower Robot (Maze Solving Robot)

An MSR (maze solving robot) is a clever little gadget with a silicon brain that finds its way through an arbitrary maze. It competes against other members of its species, racing as fast as it can. Here MSR is an electro-mechanical device, typically consisting of three main subsystems. They are drive system, an array of sensors, and the control system.

The drive system consists of a mechanical chassis, a set of motors, gears and wheels. The chassis is usually designed to operate like a wheel-chair, with two large drive wheels on either side of a lightweight aluminium frame. The chassis is built to house the motors, gear system, batteries, and circuitry, and must also be small enough to manoeuvre within the constraints of the maze.

The control system is a series of circuit boards functioning as the brain of the critter. The control system runs a maze solving algorithm (LSRB) based on the information received by the CPU (ARDUINO BOARD) from the sensors.

The final sub-system is the sensors. They report to the CPU the current state of the surroundings where the walls and paths are. These are usually either infrared sensor which picks up light reflected light of the track. The main objective is to achieve the fastest maze running time and easily find the goal.

Maze

A maze is a tour puzzle in the form of a complex branching passage through which the solver must find a route. In everyday speech, both maze and labyrinth denote a complex and confusing series of pathways, but technically the maze is distinguished from the labyrinth, as the labyrinth has a single through-route with twists and turns but without branches, and is not designed to be as difficult to navigate.

Coding a Line Follower Robot using LSRB and finding the Shortest Path (1)

LSRB Algorithm

This LSRB algorithm can be simplified into these simple conditions:

  1. If you can turn left then go ahead and turn left,
  2. else if you can continue driving straight then drive straight,
  3. else if you can turn right then turn right.
  4. If you are at a dead end then turn around.

    The expunction of LSRB is shown below:

  5. L- Left
  6. R- Right
  7. S- Straight
  8. B- Turning around (Back).

The robot has to make these decisions when at an intersection. An intersection is any point on the maze where you have the opportunity to turn. If the robot comes across an opportunity to turn and does not turn then this is considered going straight. Each move was taken at an intersection or when turning around has to be stored.

At first, we see the searching process of the LSRB Algorithms. the diagrams are the sample of the processing the LSRB.

Coding a Line Follower Robot using LSRB and finding the Shortest Path (2)

The first diagram denotes the starting point and the first decision based on the LSRB priority so the robot is choosing the left side. Second decision Value has been stored in the register. The first decision diagram is shown,

Coding a Line Follower Robot using LSRB and finding the Shortest Path (3)

In the second diagrams is denoted the after processing of the first decision and the next decision is taken to the back side because there are no more options are available. The second decision diagram is shown,

Coding a Line Follower Robot using LSRB and finding the Shortest Path (4)

In the Third diagrams is denoted the after processing of the second decision and the next decision is taken to the left side because there are no more options are available and the second decision Value has been stored in the register. The third decision diagram is shown,

Coding a Line Follower Robot using LSRB and finding the Shortest Path (5)

In the Fourth diagrams is denoted the after processing of the third decision and the next decision is taken to the left side because there are no more options are available and the fourth decision Value has been stored in the register. The fourth decision diagram is shown,

Coding a Line Follower Robot using LSRB and finding the Shortest Path (6)

In the fifth diagrams is denoted the after processing of the fourth decision and the next decision is taken to the back side because there are no more options are available and the fifth decision Value has been stored in the register. The fifth decision diagram is shown,

Coding a Line Follower Robot using LSRB and finding the Shortest Path (7)

In the sixth diagrams is denoted the after processing of the fifth decision and the next decision is taken to the straight side because there are no more options are available and the sixth decision Value has been stored in the register. The sixth decision diagram is shown,

In the seventh diagrams is denoted the after processing of the sixth decision and the next decision is taken to the right side because there are no more options are available and the seventh decision Value has been stored in the register. The seventh decision diagram is shown below, After the seventh step the searching processes will be finished and then finally the “LBLLBSR” value is stored into the register.

The second process is the travelling processes. This process is performing the robot to go the destination without any searching and using the shortest path.

The travelling is simplifying the register value using the following equation and shorted and follow the value of the register the equations are shown below,

LBR = B

LBS = R

RBL = B

SBL = R

SBS = B

LBL = S

The register value is shorted from using the equations and the final register value is “SRR”.diagram is shown below

Coding a Line Follower Robot using LSRB and finding the Shortest Path (8)

Coding

Variable Initialisation

loop() Function

This functions runs over and over, and check accordingly.

Read Sensor Value

Left Hand Wall Algorithm(LSRB Algorithm)

Shortest Path

The above code snippets, does not contains snippets for turnLeft(), turnRight(), turnAround() and done(). There are many delay’s used they are not standards, they need to be modified according to bot.

Clapping shows how much you appreciated my story.

Coding a Line Follower Robot using LSRB and finding the Shortest Path (9)
Coding a Line Follower Robot using LSRB and finding the Shortest Path (2024)

References

Top Articles
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 6456

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.