The center of this project is a pair of two PIC32MX170F256B microcontrollers that interact with each other through leader-follower Serial Peripheral Interface (SPI) communication protocol. The leader PIC32 is responsible for time-sensitive tasks, such as driving motors, tape sensing, encoder input captures, and detecting the front bumper limit switch. The follower PIC32 is responsible for tasks that are not as time-sensitive, such as operating collector and yard indication servos, launching acorns, controlling game LED status, detecting the start button response, and detecting beacons.
All electrical connections were soldered onto perf boards or onto existing PCB boards. For example, the the power distribution module, signal conditioning module, each PIC32 module, and each motor driver module had PCB boards with through holes. The computational 5V portable charger that was distributed along through channels of 5V, 3.3V, and ground for sub-systems to connect to. The drive motors and the launch motor were all powered by two 7.2V NiMh batteries connected in series and sent through an isolated section of the power distribution PCB.
The two PICs communicated through SPI and were each responsible for handling a series of tasks. The events created by these tasks were either handled by and carried out through services within each of the PIC, or sent to the master PIC to be entered into the master state chart.
The drive and launcher motors were each powered with 14.4V from the power distribution board. The drive motors were driven using Drive-Brake, each sent a PWM signal to one pin and a digital signal to the other through an H-bridge. The launch motor was connected to a single-direction transistor circuit that was opened an N-type MOSFET with 3.3V to power the motor and no signal to stop it. A 470uF capacitance connected launch motor power to ground to reduce noise effects. Additionally, because of encoder and launch motor proximity, the encoder interrupts had to be disabled when the launch motor was in operation.
Each of the drive motors had a magnetic encoder keeping track of it's revolutions. Each encoder had both phases connected to a PIC pin in order to facilitate bi-directional position control. As said above, when the launch motor needed to be powered, the encoder interrupts were disabled in order to prevent jittering from noise and interference.
Tree detection via infrared (IR) is facilitated by two distinct physical sensors, each optimized for a specific range of distances. The first sensor, designed for proximate tree detection, incorporates a pre-conditioning circuit (transresistive) followed by a Schmitt trigger. This trigger is set with a lower voltage threshold of 1.71V and an upper threshold of 2.39V. The second sensor, aimed at detecting trees at greater distances, also begins with a pre-conditioning stage. It then processes the signal through a band-pass filter, which is characterized by a lower cutoff frequency of 300Hz and an upper cutoff frequency of 5,000Hz. The concluding stage employs a Schmitt trigger, which has lower and upper voltage thresholds of 0.06V and 0.59V, respectively.
Each servo was powered with 5V from the power distribution board and given a PWM signal to command its position. The side indication servo was either at it's neutral position straight up vertically or 90 horizontal in either direction. Each collector arm servo was sent a PWM to put it in a desired closed position to trap ACORNs, or an open position to allow them to be collected and launched.
A series of five QTR-MD-01A analog reflectance sensors were used to detect and react to tape on the field. These were primarily used to align the robot in a direction facing towards the other side of the fence or directly facing either one of the TREEs. These sensors output an analog signal that were evaluated against hysteresis threshold determined by experimentation with performance against tape on the field. They were mounted at an optimal 5mm from the floor.
The game LED, start button, and limit switch were all connected as ordinal input and outputs to the follower PIC, and provided with their necessary power from the power distribution PCB. The start button was not debounced since the start of the game would occur whether there was one or several rising edges.