Electrical Hardware
Electrical Hardware
Tera Turbine utilizes three PIC32 chips as the central processor. They handle all the sensor inputs and generate various commands in response to different signals. The three PIC32 chips are named: LogicPIC, MotorPIC, and Turbine PIC.
The LogicPIC handles our game play strategy. It starts the start timer and determines when the game is over. Additionally, it decides when to enter a lane (only if the barrier is closer to our side than to the opponent's side) and when we have to make a U turn to avoid driving into the wall.
Since the Logic PIC takes the role of the Leader in the SPI communication, it sends commands to the Motor PIC. At the same time, it receives feedback from the Motor PIC.
The Motor PIC receives commands from the Logic PIC and is responsible for the actuation of the robot. It also informs the Motor PIC about the completion of tasks.
The Turbine PIC is solely controlled with a digital I/O communication with the Motor PIC and only switches on/off the Turbine.
Logic PIC Schematic (Leader PIC)
Logic PIC
This Leader PIC uses SS1, SDO1, SCK1, and SDI1 to communicate with the follower PIC via SPI. Four IC channels are used to read distance from four ultrasonic sensors. One Output Compare (OC) is used to control servo orientation. Three digital output pins control the LEDs.
LED circuit
To achieve the desired aesthetic look for each color set, we used eight LEDs per color per light box. However, the forward voltage f0r each LED is 2V. In order to light all LEDs, we power them directly from the power distribution board with ~15V. An N-type Mosfet is controlled by the PIC32 to switch the LEDs on and off.
Ultrasonic sensor attenuation schematic
The ultrasonic sensor outputs 5V signal, but most of the PIC pins can only take in up to 3.3V. We have a simple voltage divider circuit to attenuate the voltage.
Servo schematic
The servo is powered by 5V and PWM signal from PIC
Motor PIC Schematic (Follower PIC)
Motor PIC
The Motor PIC uses the SS1, SDO1, SCK1, and SDI1 pins to communicate with the leader PIC (Logic PIC) via SPI. It also controls the two DC Motors which each need a PWM and a logic 1 or 0 signal. With the change of the logic signal, the direction of the motors can be changed individually. Due to the characteristics of the H-bridges, the PWM signal then also needs to be inverted (100% - x%).
The Motor PIC is also connected to two magnetic encoders. Those are used both to detect when the robot has rotated 90 and 180 degrees and to calculate the angle between the light emitting beacons in order to determine on which side of the arena we start.
To track the tape, the Motor PIC receives input signals from two reflectance sensors. If the Robot drives straight, both sensors detect the white ground. If we deviate from the tape one of the sensors will detect the black tape, leading to an adjustment of the motor speeds.
To detect the IR light emitting beacons, pin RB3 is connected to a IR diode which triggers the Input Capture 4 of the PIC at every rising edge of a light pulse.
To switch on/off the turbine, we simply send a logic value 1 or 0 to the Turbine PIC, thus pin RB9 is the only connection to the Turbine PIC.
Signal Conditioning Schematic
Signal Conditioning
The signal conditioning board is comprised of a three stage system and a reference generator.
The reference generator is a op amp circuit that creates a consistent, clean, 2.5v signal as Vref for our three stage signal conditioning. It features a capacitor that functions as a low pass filter into the 5v power going into the op amp.
The first stage of the system is a transresistive, inverting opamp circuit. It takes the input signal from the phototransistor and inverts and amplifies the signal. The gain chosen in this stage is carefully selected such that it is not so large that in dark or bright environments we lose the amplitude of the output signal.
Between the first and second stage an A/C coupler is added to help eliminate any shifting amplitudes due to the differing ambient light situations our bot may be in. The output signal is centered on Vref and is now a spiking signal instead of a square wave.
The second stage of the system amplifies this new spiking signal using a noninverting amplifing op amp circuit. The circuit is created such that the amplfied output signal remains centered on Vref. This is done by using Vref as reference for the gain configuration. Additionally, a capacitor is added as a low pass filter to prevent high frequency noise feeding back into the op amp.
The final stage of the system is an inverting comparator circuit with hysteresis. The hysteresis band is centered around Vref, this helps to trigger edges of the spikes only. The output of the signal is now a square wave from vce to the pullup voltage of 3.3v.
Turbine PIC Schematic
Turbine PIC
Since the BLDC Controller needs a PWM signal, one more PIC is used since the PWM capabilities of the Motor PIC are already fully occupied. Accordingly, the Turbine PIC has only one input and one output (apart from the pins used by the SNAP programmer, the USB2Serial bridge and the reset button).
The input comes from the Motor PIC and determines wheter the Turbine should be switched on or off. The output is in the form of a PWM signal and directly leads to the ESC which then controls the Turbine.