NIMBY utilizes two PIC32s, where one acts as the leader PIC32 and the other as the follower PIC32. The follower PIC32 is responsible for motor control of the drivetrain motors, intake motors, and encoder feedback, while the leader PIC32 is responsible for everything else, including two IR phototransistors, an IR LED, an indicator servo, an on/off LED and button, and three opto-reflectance sensors.Â
The leader PIC32 handles all of the gameplay logic with the hierarchical state machine and the majority of sensor feedback, and feeds it through SPI (Serial Peripheral Interface) communication lines to the follower. It utilizes two universal signal conditioning boards, one for the beacon identification IR phototransistor, and one for the puck detection IR phototransistor in conjunction with an IR LED. The three opto-reflectance sensors are for tape following and cross identification and are fed through a comparator. The indicator servo is used to display which yard NIMBY is in during the start of gameplay. The on/off LED is to display robot state, whether ready for game, ready for sudden death, or in-game, while the button is used to start gameplay. All sensors are powered from the power distribution board with 3.3V or 5V.
The follower PIC32 handles all the DC motor control. There are two drivetrain motors, each with an H-bridge and encoder for PI feedback control. There are also two intake motors, each with an H-bridge in open loop control. All motors are run in drive-brake mode from the high voltage battery line from the power distribution board, and the encoders are powered with 5V.
The beacon IR phototransistor's (LTR-3208E) sensor input goes through a multi-stage signal conditioning circuit as shown below, with three amplification phases using a MCP6294 op-amp, a high pass filter with a cutoff frequency of 724 Hz (lower than that of the slowest beacon pulse at 909 Hz), a low pass filter with a cutoff frequency of 4825 Hz (higher than that of the fastest beacon pulse at 3333 Hz). The two filters combine into a bandpass filter for the input signal, which then enters into a MCP 6546 comparator with hysteresis bounds between 0.78V and 4.20V to transform the sensor input into a digital signal for the leader PIC32. The fourth op-amp circuit on the MCP6294 is used to provide a reference voltage of 2.5V to the circuit.
The puck IR phototransistor's (LTR-3208E) sensor input goes through a multi-stage signal conditioning circuit as shown below, with three amplification phases using a MCP6294 op-amp, a high pass filter with a cutoff frequency of 34 Hz to filter out noise from environmental light but low enough for the IR LED's 76.3 Hz frequency, a low pass filter with a cutoff frequency of 482 Hz (lower than that of the slowest beacon pulse at 909 Hz). The two filters combine into a bandpass filter for the input signal, which then enters into a MCP 6546 comparator with hysteresis bounds between 0.78V and 4.20V to transform the sensor input into a digital signal for the leader PIC32. The fourth op-amp circuit on the MCP6294 is used to provide a reference voltage of 2.5V to the circuit.
The On/Off LED is a simple LED that is off when the robot is off, flashing slowly when the robot is on and idle, flashing quickly when the robot is on and idle in sudden death mode, and solidly on when the robot is in gameplay. It is powered with a standard leader PIC32 3.3V output.
The Intake IR LED is an IR LED that flashes at a frequency of 76.3 Hz with a duty cycle of 50% for ACORN IR feedback on the Puck IR phototransistor. It is powered with a PWM signal from a standard leader PIC32 3.3V output.
The On/Off button is simple push button that is physically integrated with the On/Off LED but electrically independent. When the robot is on and the On/Off LED is flashing, pushing the button will start standard gameplay. Pressing and holding the button for a few seconds and releasing will instead change the game mode to sudden death. A following button press will start sudden death gameplay, while a long press again will change the game mode back to standard gameplay. Inputs from the On/Off button are processed by the leader PIC32 and is pulled up to a 3.3V line.
The indicator servo is used to indicate which YARD the robot is currently in after the beacon IR phototransistor is used to locate and identify the various beacons in conjunction with the puck IR phototransistor for beginning orientation lock. The servo horn starts in an upright position, turning left to indicate Karl's YARD and turning right to indicate Ed's YARD. The indicator servo is controlled by a 3.3V PWM output from the leader PIC32 and is powered by a 5V line.
Three opto-reflectance sensors (Polulu 4201 QTR-HD-01A) are used for tape following. A custom PCB board has a LM339AN comparator with three of the four outputs used for the three sensors. Each of the sensors is powered by a 5V line, and sends the analog sensor input into the comparator. The comparator has hysteresis bounds between 1.36V and 2V with a pullup resistor to 3.3V for digital output lines to the leader PIC32.Â
The drivetrain uses two TLE5206-S H-bridges controling two 12V DC motors (lab provided). The motors and H-bridges are powered through the high voltage battery power line, with control inputs in drive-brake mode from the follower PIC32.
The drivetrain motors are controlled in PI feedback control with two quadrature encoders (Polulu 4760 Magnetic Encoders). They are powered with a 5V line and send a PWM waveform to the follower PIC32 to calculate the current drivetrain motor speeds. Only one of the two lines is used on each of the encoders, since the encoders are only used to determine motor speed and not motor direction, which is instead kept track of in software.
The intake has two TLE5206-S H-bridges controling two 12V DC motors (Polulu 3202 Metal Gearmotor). The motors and H-bridges are powered through the high voltage battery power line, with control inputs in drive-brake mode from the follower PIC32.
Refer to intake motor specification calculations below for more details in the motor downselect process.