Micromouse robot for 2025 NRC
|
|
Description of Robot Main robot board is an ActivityBot 360 WX from Parallax. This board contains the microprocessor and memory storage for the program. It also contains the electronics for controlling the two motors. In addition, the board contains digital input/output ports and analog to digital input ports used to control the custom-made IR sensors. The robot motors are continuous rotation servos with internal encoders from Parallax. The robot contains four IR sensors assembled from electronic components by Jacob and Caleb. The control board for the sensors (the red one) is mounted at the top of the robot. All of the individual components of this board were soldered by hand by Jacob and Caleb. The control board also contains three green LEDs and two red LEDs which are connected to digital output ports of the ActivityBot board. The LEDs serve as visual indicators of specific events. For example, the green LEDs indicate wall detection. As the robot visits a cell of the maze, it must determine which sides of the cell contain a wall. After the walls are detected, the robot program makes a decision on which direction to move (straight ahead, turn right, turn left or make a u-turn). If all three green LEDs light up when the robot arrives in a cell, then that cell contains walls to right, left and to the front. Since there is no way forward, the robot must make a u-turn. If only the left green LED lights up, then there are possible pathways straight ahead and to the right. The program will decide which is the better choice. The body of the robot was modeled using Onshape software and 3D printed. The IR Sensors Each sensor contains an IR LED and an IR sensitive phototransistor housed in a 3D printed body. The body is mounted to the frame with only one screw so that the sensor can be rotated to point in a specific direction. To make a distance measurement to a wall, the IR LED turns on to send out a beam of infrared light. The light reflects off the wall and returns to the phototransistor which detects the infrared. The closer the wall is to the sensor, the more IR detected. The phototransistor output is connected to an analog to digital port on the ActivityBot board. The signal is forwarded from the port to the analog to digital chip on the ActivityBot board. This chip converts the voltage (0 to 5 volts) to a digital value (0 to 4096). The Sensor Control Board All components on this board were soldered by Jacob and Caleb. Five volt regulated supply for this board comes from the ActivityBot board. All eight components of the sensor bank are supplied +5 volts from the control board. The negative wires of the IR LEDs and phototransistors are connected to the board as labeled. The current path returning from the IR LEDs passes through a current limiting resistor, then to an output pin on the Darlington array. This is an array of switching transistors. The transistors are turned on and off to supply current to each IR LED at the appropriate time. The transistor bases (which control the transistors) are connected to digital output ports on the ActivityBot board. When a measurement is called for in the program, 3.3 volts is output from the digital port on the ActivityBot. This causes the transistor of the Darlington array to turn on, which in turn allows current to flow through the IR LED. The output (negative wire) of the paired phototransistor is routed to a A/D port on the ActivityBot board. Synopsis of the program for solving the maze Unlike the Robot Maze Contest, the layout of the maze for the Micromouse Contest is not published in the NRC Contest Manual. Therefore, developing a program to solve this maze is considerably more difficult. The program for the GEAR robot was written in C language. The logic for finding the target includes the so-called flood-fill algorithm. We start with the knowledge that the maze contains 100 cells in a 10 X 10 grid. The robot starts in one of the corner cells and must find one of the four central cells. Imagine that you have a maze of this size but without any internal walls. You pour water into the central cells and watch it flow to the corners. The water proceeds first to the neighboring cells of the center ones and so on. If we number the central cells with a value of zero, those adjacent to them with a value of one and so on, we can develop a map of the maze containing flood fill values. In addition, a map of the walls of the maze is created early in the program. The only walls known at the start of a robot run will be those around the perimeter. The initial map contains only the perimeter walls. As the robot explores the maze, it will discover the internal walls and add them to the map.
We use the flood-fill map to find a pathway to the center. The robot starts in a corner cell that has a value of 8. The rules state there will be walls on all sides of the start cell except in front of the robot. If the robot is located in the southwest corner, then its first move will be to the north. After completing that move the robot will be in a cell with a value of seven. For the next move the robot should move to a cell that has a lower flood-fill value than seven. The cells ahead and to the right both have values of six. The program includes the logic that the robot should move forward if possible rather than make a turn if the flood-fill values are the same. As the robot lands in the second cell, the sensors are fired to determine the presence of walls to left, front and right. The walls detected are added to the initial wall map of the maze. Then the robot will make a decision on which movement it should make to go to the third cell (u-turn, right, left or forward). All the while the robot will continue to move to cells with lower flood-fill values, which will ensure that it eventually finds a center cell. You can satisfy this yourself by using the flood-fill map above and making imaginary moves. To make it simple, just assume no internal walls. If you keep making moves to lower flood-fill values, you will find your way to the center! When the robot visits a cell, it increases the flood-fill value of that cell. In this way, it is less likely that the robot will return to cells it has already visited as it explores the maze. While the above code description can be applied to any robot, the code for making the robot move will be more specific to the robot. Our GEAR members spent much more time on this part of the coding. Odometry was used to determine how far the robot should move traveling cell to cell. The robot stops briefly in each cell, fires all sensors to discover the walls of the cell, determines which move to make, then moves to the next cell. Odometry was possible because the motors are equipped with encoders which can be used to determine the amount of wheel rotation. Considerable time was spent on calibrating the sensors and developing code to reliably detect the walls of each cell. GEAR club owns a maze that is the same as the one used at the NRC. Much testing in the maze was done while developing the drive code for the robot. We believe this is essential in developing a program. |