Elevation

The Website of Team 14.


Project maintained by ECE3400-Team14 Hosted on GitHub Pages — Theme by mattgraham

Milestone 1

Overview of Robot Modifications

In order to implement line-following functionality, we added four analog line sensors to our robot. These sensors contain photo-diodes that output a varying voltage based on the light entering the sensor (voltage decreases as light increases). Since the grid is made of white tape on a dark surface, we used the voltage from these sensors to distinguish between when the robot is over the white line (low voltage) and when it is on the black surface (high voltage).

To gather accurate readings, we mounted the sensors close to the ground using the bent stilt 3D-printed pieces provided in the lab. Because the wheels we used were too small, we had to mount the stilts above the chassis using spacers. We also added spacers to the ground-facing end of the stilts to lower the sensor to the ideal height. We go into more detail on the optimal calbiration of these sensors in later sections.

While we were able to get this design to perform successful line detection and grid navigation, we were unsatisfied with the disorganized wiring and instability of the sensor stilts. We are in the process of performing a redesign of the robot using bigger wheels to raise the chassis and clean up the sensor wiring. Updates on the modified design can be found here.

Circuit Diagram:

Line Detection

After reading anolog values from the line sensors, we have to determine what values correspond to the white line and what values correspond to the dark surface by setting a threshold. The readings vary across different sensors due to different setup and installations. Thus, we have to calibrate our threashold for each sensor. Here’s one of the four functions:

/* returns 0 if white detected, 1 if black */
int readLeftSensor() {
  int val = analogRead(0);
  return val > 800? 1:0;
}

Algorithm

In order for the robot the detect the white line for the robot to follow, we decided to use two line sensors close together on the front side of the chassis. These two sensors can provide the robot with the necessary information to orient itself on a line:

    if (readLeftSensor() == 0 && readRightSensor() == 0)
      forward();
    else if (readLeftSensor() == 0 && readRightSensor() == 1){
      writeRight(180);
      writeLeft(90);
    }
    else if (readLeftSensor() == 1 && readRightSensor() == 0){
      writeLeft(180);
      writeRight(90);
    }

Demonstration of Line Navitation

Intersection Detection

Once we finished the line detection part, we moved on to the having our robot detect intersections. In addition to the two line sensors already installed, we added two more sensors to achieve this task, mounting to the sides of the othe two line sensors and farther back under the chassis.

Algorithm

Our robot makes a turn as follows:

  while (readLeftmostSensor() == 1 || readRightmostSensor() == 1){
    trackLine();
  }
  while (readLeftSensor() == 0 && readRightSensor() == 0);
  while (readLeftSensor() == 1 || readRightSensor() == 1);

Demonstration of Figure Eight

At first, we had the turn executed with only one wheel turning, and the other stationary to act as a pivot:

Then, we implemented a faster turn using both wheels. We called this a “dime turn”: