System Block Diagram
The mechatronics system of our SQRL consists of two PIC 32 MCUs, peripheral sensors, a DC motor module, an ACORN manipulation module, and a yard indication module. The leader PIC32 takes the input signals from peripheral sensors and makes decisions based on sensor readings and the current state of the machine. The DC motor module is directly controlled by the leader PIC32, while other output modules are controlled by the follower PIC32 based on the commands sent from the leader PIC32 to the follower PIC32 through SPI communication.
Schematics Overview
Leader System
Leader PIC32
The leader PIC32 MCU makes decisions and coordinates the movements of our SQRL based on sensor data and information sent from follower PIC 32.
The leader PIC32 communicates with the follower PIC 32 via SPI. 3 input capture channels capture the beacon and encoder pulses. 2 pins are configured as PWM output compare pins to drive 2 DC motors. Other pins are configured as digital I/Os to control the direction of DC motors and sense the tape and game start command.
Drivetrain
The DC motors are driven by TLE5206 H-bridge using the drive-brake mode. Two Hall Effect encoders are installed to measure the angles of rotation for the two DC motors.
IR Beacon Signal Conditioning
The IR beacon signal conditioning circuit transduces the IR beacon signal to square waves while retaining the original frequency. The circuit has 4 amplifying/ comparing stages to convert the original signal to a clean square wave.
Stage 1: This stage converts the current signal flowing through the phototransistor to a voltage signal.
Stage 2: The RC high-pass filter decouples the high-frequency beacon signal from ambient light and the inverting amplifier amplifies the decoupled signal.
Stage 3: The signal is filtered by an RC low-pass filter and amplified again by an inverting amplifier.
Stage 4: The output signal from stage 3 is then compared to the reference voltage and becomes a square wave
Reference voltage: the 5V voltage is divided to 2.5V by the voltage divider and then buffered by a voltage follower.
Tape Sensors
TCRT5000 IR reflective sensor pulls the output to low when the black line is detected. Two tape sensors are used for tape following and the other two sensors detect the horizontal tapes.
Switches
Two limit switches pull the corresponding PIC32 pins high when they are triggered by a wall hit. The toggle switch pulls a PIC32 pin high to signal the game start.
The debouncing circuit ensures a clean transition for the switch signal.
Follower System
Follower PIC32
The follower PIC32 controls the ACORN manipulation module and Indication peripherals. 4 pins are configured as PWM output compare pins to drive the servos. Other pins are configured as digital I/Os to control the DC motor and LEDs and read data from sensors.
In addition, the follower has its SPI module configured as the follower, enabling it to receive and send data every 100ms.
ACORN Manipulation Module
The LM317T Step-Down regulator provides a roughly 5.5V power source with >1.5A output capability.
Two MG996R servos drive the sweeper and lifter respectively.
The SG90 servo controls the opening and closing of the valve mechanism.
The IRLZ34N MOSFET controls the ejection motor.
The IR sensor sends the active signal to the Leader PIC32 when the ejector has been retracted.
Indication Peripherals
An SG90 controlled by the follower PIC32 rotates to a specific angle for yard indication.
Green, yellow, and red jumbo LEDs driven by 2n 7000 MOSFET indicate 5V power on/ SQRL operating/ 15V power on respectively.