Maze-solving robots originate from the 1970s. Since then, the IEEE has been holding maze solving competitions called the Micro Mouse Contest. The aim of the contest is to design a robot that finds the midpoint of a maze as quickly as possible. The algorithms used to quickly solve the maze typically fall into three categories; random search, maze mapping, and right or left wall following methods.

The most functional of these methods is the wall following method. In this method, the robot follows the right or left side wall in the maze. If the exit point is connected to the outer walls of the maze, the robot will find the exit. This project uses the right wall following method.

Below we described steps needed to understand how the project was programmed. However, if you just want to get the result of programming, download GreenPAK software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit the program to design the device.

1. Hardware

This application uses:

  • 2 Sharp analog distance sensors
  • Tracker sensor
  • Encoder
  • Motors and motor driver
  • GreenPAK™ SLG46531V
  • Voltage regulator, robot chassis etc.

We will use the analog distance sensor to determine the distances to the right and front walls. The Sharp distance sensors are a popular choice for many projects that require accurate distance measurements. This IR sensor is more economical than sonar rangefinders, yet it provides much better performance than other IR alternatives.

There is a nonlinear, inverse relationship between the output voltage of the sensor and the measured distance. The plot showing the relationship between the sensor output and the measured distance is shown in Figure 1.

Figure 1: Distance-Voltage Graph

A white line against a black color ground is set as the target. We will use the tracker sensor to detect the white line. The tracker sensor has five analog outputs, and the outputted data is influenced by the distance and the color of the detected object. The detected points with higher infrared reflectance (white) will cause a higher output value, and the lower infrared reflectance (black) will cause a lower output value.

Figure 2: Tracker Sensor

We will use the pololu wheel encoder to calculate the distance the robot travels. This quadrature encoder board is designed to work with pololu micro metal gearmotors. It functions by holding two infrared reflectance sensors inside the hub of a Pololu 42 mm ×19 mm wheel and measuring the movement of the twelve teeth along the wheel’s rim.

Figure 3: Pololu Wheel Encoder, Motor and Wheel

Figure 4: Encoder Outputs

A motor driver circuit board (L298N) is used to control the motors. The INx pins are used to direct the motors, and the ENx pins are used to set the speed of the motors.

Figure 5: Motor Driver Circuit Board

Also, a voltage regulator is used to reduce the voltage from the battery down to 5 V.

Figure 6: Inputs and Outputs of GreenPAK Chip

2. Algorithm Description

This project incorporates the right wall following method. This is based upon organizing direction priority by preferring the rightmost possible direction. If the robot cannot detect the wall on the right, it turns to the right. If the robot detects the right wall and there is no wall in front, it goes forward. If there is a wall to the right of the robot and the front, it turns to the left.

Figure 7: Simplified Algorithm

An important note is that there is no wall for reference after the robot has just turned to the right.

Therefore “turning right” is accomplished in three steps. Move forward, turn right, move forward.

Figure 8: Turn Right Sequence

In addition, the robot must keep its distance from the wall when moving forward. This can be done by adjusting one motor to be faster or slower than the other.

Figure 9: Collision Avoidance Algorithm

The final state of the flow chart is shown in Figure 10...

Read more »