In order to design, fabricate, program, and troubleshoot product that could not only autonomously follow a black electrical tape line, but also connect to WiFi and follow commands wirelessly, I had to ensure that every aspect of the vehicle's functionality worked seamlessly. Using Texas Instruments' MSP4FR2355 Microcontroller and Launchpad, I primarily worked through the Code Composer Studio (CCS) IDE for development. The product is equipped with two motorized wheels for movement, an IoT module for wireless communication, an ADC peripheral and IR sensors for black line detection, among other features. The entire semester was devoted to running tests to address pin initializations, clocks, tractive movement, interrupt service routines, digital-to-analog and analog-to-digital conversions, serial communication, and WiFi connectivity.
Finished Robot
These are a few of the schematics we used during the development process. Throughout the soldering and debugging stages, we quickly had to become intimately familiar with their contents to ensure proper functionality and troubleshoot any issues that arose.
Soldering P-FETs and N-FETS to a PCB
After a new field-effect transistor (FET) is soldered onto the Custom PCB, it is good practice to probe the test points while the battery is connected and a tractive command is supplied.
Catastrophic Damage
After just having completed the hardware aspect of this project, the robot took a fall while connected to battery and discharged, shorting and leaving flux residue on critical components. This was eventually fixed in the lab after immense troubleshooting.
Observing Clock Speed
By connecting the MSP430FR2355 and Launchpad to an Analog Discovery and changing rate the master clock, it is possible to observe the expected speed on an oscilloscope.
C File: Autonomous Black-Line Following Algorithm
C File: Parsing Messages from an IOT Module
Black Line Detection and Following
WiFi Connection and Remote Control
Emitter/Detector Circuit and Black Line Detection
What was expected of us for this project was to integrate an emitter/detector circuit to detect the black line, along with code to resolve the Thumbwheel to a digital value for verifying the ADC configuration. We were required to manually verify the ADC values as the vehicle transitioned from white to black and vice versa, while independently tracking the Thumbwheel. Additionally, the vehicle had to travel from inside a 36-inch diameter circle, stop when it detected the circle, and then turn approximately 90 degrees to detect and follow the black line.
Serial Communication
What was expected of us was to establish serial communication between our Analog Discovery 2 (AD2) and the vehicle, following the pin layout for proper TX/RX connections. We were required to create at least six different 10-character messages, which should be transmitted from the AD2, received by the vehicle, and displayed on the system’s display. Additionally, when Button 1 is pressed, the vehicle should send the command back to the AD2 and move the command on the display, while Button 2 adjusts the baud rate, which is then displayed on the third line. The demo was to include the sending and receiving of all six commands at different baud rates, with changes in baud rate between transmissions, and potentially multiple transmissions at the same rate.
Semi-Autonomous Course
What was expected of us for this project was to navigate our car around a Wi-Fi-controlled course, stopping at eight numbered pads and sending a command to display “Arrived 0X” at each pad. After reaching pad 8, we had a 45-second window to issue a single command for the car to autonomously find and follow a black line, and navigate to a circle on the board. Once the car followed the line around the circle twice, we could issue a final command to stop the car, move it two feet away from the circle, and display a successful completion message. The demo also included confirming arrival at each pad with a TA, with bonus points awarded for completing the entire course on the first attempt.
The final program required by this class involved creating a simplified map system using a 2D grid where streets were either horizontal (west-to-east) or vertical (north-to-south). The primary tasks were to implement linked lists to store street data, handle map files, and process user commands. The program required defining data structures like Street, Point, and StreetNode, as well as functions to create and manipulate these structures (e.g., creating new streets, calculating street lengths, and identifying street directions). The map was represented as an abstract data type, and the internal details of the map's representation were hidden from other code. In terms of interface, users can interact with streets and their intersections.
Example Map
Example: Commands
m = read map file
a = print all streets
p = print named street
c = print cross streets
h = help
q = quit
Example: Text File
Main (0,10) (20,10)
Elm (10,20) (10,0)
First (3,5) (15,5)
Oak (3,15) (3,5)
Birch (3,0) (20,0)
Second (12,18) (12,2)
Loblolly (10,20) (20,20)
Ponderosa (0,20) (9,20)
Example: Output (command 'a')
All streets in map1
Birch: (3,0)->(20,0) [WE, 17 blocks]
Elm: (10,20)->(10,0) [NS, 20 blocks]
First: (3,5)->(15,5) [WE, 12 blocks]
Loblolly: (10,20)->(20,20) [WE, 10 blocks]
Main: (0,10)->(20,10) [WE, 20 blocks]
Oak: (3,15)->(3,5) [NS, 10 blocks]
Ponderosa: (0,20)->(9,20) [WE, 9 blocks]
Second: (12,18)->(12,2) [NS, 16 blocks]
C Function: Creates and Initializes a New Street
C Function: Returns Street Distance from Start to End
C Function: Returns an Integer Which Gives the Direction of a Street