Functionality Description
The robot contains 5 main subsystems to compete in the game and score points.
SPUD Communication
A Synchronized Permitting and Usage Designator (SPUD) provides information to the TRACTOR about the status of mining operations. The SPUD is placed on the TRACTOR and connected to the Tiva microcontroller by 4 wires. SPI protocol is used to communicate with the SPUD. Information regarding the status of permits (waiting, issued or expired), the active mining regions (two neutral locations, and the exclusive locations for CKH and GHI), and the locations of miners is used during the game. While waiting for permits, the TRACTOR does not move. Once permits are issued, the green LED is turned on and the TRACTOR actively starts searching for MINERs. After permits expire, the green LED turns off and the TRACTOR stops. The active mining regions determined from SPUD communication are used to determine where picked up MINERs must be placed. As these regions change during the game, the TRACTOR goes back to the MINERs that are not in active regions and place them in active regions. The locations of MINERs as determined from SPUD are used to verify that the MINER has been placed correctly in an active region or if it needs to be picked up.
Miner Detection
An IR photo-transistor is used to detect MINERs. The TRACTOR rotates in place until it detects an IR signal at the same frequency as the IR emitted by MINERs of its own team. MINERs designated for team CKH emit IR at 3333 Hz and 2000 Hz and MINERs designated for GHI emit IR at 1429 Hz and 909 Hz. The location of this MINER as communicated by SPUD is then checked to verify that it is not already in an active region. To ensure that the TRACTOR is going to the nearest MINER from its current location, the MINER’s location and the TRACTOR’s current location are converted to coordinates and the distance between the TRACTOR and each of its team’s MINERs is calculated. The TRACTOR first picks up the MINER that is closest to itself. If the MINER is not in an active region, the TRACTOR drives forward straight towards the MINER. If something appears in between the TRACTOR and MINER as it is driving, the TRACTOR will stop and rotate in place again to detect the correct frequency again and change its path to reach the MINER head on.
Once the TRACTOR reaches the MINER and traps the MINER inside its U-shape, the beam break sensors are triggered and a servo closes a gate to keep the MINER trapped inside the U-shape. The TRACTOR then travels to an active region and opens the servo gate once the MINER is inside the active region. The TRACTOR then reverses leaving the MINER in an active region, and starts the same process again looking for the next MINER of its own team that is not already in an active region.
Once the TRACTOR reaches the MINER and traps the MINER inside its U-shape, the beam break sensors are triggered and a servo closes a gate to keep the MINER trapped inside the U-shape. The TRACTOR then travels to an active region and opens the servo gate once the MINER is inside the active region. The TRACTOR then reverses leaving the MINER in an active region, and starts the same process again looking for the next MINER of its own team that is not already in an active region.
Miner Transport and Navigation
Once a MINER has been captured by the TRACTOR, the TRACTOR navigates across the 4x4 grid by travelling in the cardinal directions – north, south, east and west. As it travels, the color sensor placed underneath the TRACTOR reads what color tile it is on and determines where it is on the grid. The TRACTOR first aligns itself in the north or south direction. Then it moves in a straight line to reach the same row as the desired active mining region. The TRACTOR then makes a turn to align itself in the east or west direction and moves in a straight line until it reaches the same column as the desired active mining region. Once it determines that it is in the correct tile from the reading of its own color sensor and the MINER’s location reading from SPUD, the servo gate is opened and the MINER is left at the desired location. The TRACTOR calculates the nearest active region to itself by converting its own location and the active region locations to coordinates and then calculating the distance between the two. It moves with the MINER to the closest active region.
To ensure that the TRACTOR moves in a straight line throughout the game, encoders placed on the motors are used to implement PI control on the speed of the motors. The speeds of the motors are kept constant relative to each other. To ensure that the TRACTOR turns the right amount of degrees while aligning along the cardinal directions, an accelerometer is calibrated on the field and used to calculate the heading direction of the TRACTOR with an error of +/- 15 degrees.
To ensure that the TRACTOR moves in a straight line throughout the game, encoders placed on the motors are used to implement PI control on the speed of the motors. The speeds of the motors are kept constant relative to each other. To ensure that the TRACTOR turns the right amount of degrees while aligning along the cardinal directions, an accelerometer is calibrated on the field and used to calculate the heading direction of the TRACTOR with an error of +/- 15 degrees.
Bumper
The bumper is made of chipboard and placed all around the TRACTOR from a height of 5 cm to 8 cm above ground. To detect collisions while driving forward or reversing, four limit switches are placed behind the bumper and connected to each other in parallel. Any time the TRACTOR collides with something from the front or back, at least one limit switch is pushed and the TRACTOR goes into collision handling mode. If it was driving forward, it backs away, rotates for a few seconds and then starts driving forward again. If it was reversing when the collision occurred, it drives forward, rotates for a few seconds and starts reversing again. After collision handling is completed, the TRACTOR goes back to performing the last action it was performing when the collision occurred.
Team Display
A toggle switch is placed at the top of the TRACTOR. When toggled one way, a red LED is turned on signifying that the TRACTOR is on Team CKH. When toggled the other way, a blue LED is turned on signifying that the TRACTOR is on Team GHI.