Programming an Autonomous Robot!

Timeline: May - Jul 2019

I had the opportunity to take UBC’s ENPH 253 course in the summer of 2019, where we built and programmed a fully-functioning autonomous robot and participated in a competition (as part of the course) as a group of 4 people.

I contributed to the software design of our robot. Our robot was able to follow black tape on a white ground, collect objects from the ground with its opening & closing doors, deposit the objects to a spot by identifying an infrared signal at a specific frequency, and avoid collisions with another robot. We were happy to win the third place in a competition among fifteen teams.

In terms of the firmware of our robot, we used 2 Blue Pill microcontrollers.

One of the MCUs, which we called “tape follower”, was responsible for processing data from the reflectance sensors we used for detecting the black tape, and utilizing a PID algorithm to follow the tape as accurately as possible. It also used infrared sensors to distinguish between 1kHz and 10kHz infrared waves, one of which specified the location we should deposit the objects the robot collected, by cross-correlating the data received from the sensor with auto-generated 1kHz and 10kHz waves. Lastly, we implemented a timer-based state machine running on this MCU, to modularize the different tasks of the robot, i.e., what our robot should do at each stage of the 3-minute competition.

The other MCU, which we called “signal processing”, was responsible for handling ultrasonic sensor data for detecting objects around, and controlling servomotors for the movement of the doors of our robot accordingly.

We implemented serial communication between the two microcontrollers - the state machine running in the “tape follower” MCU instructed the “signal processing” MCU to take certain actions based on which stage in the competition we were at.

The course was not only technically challenging, but also in my opinion provided a valuable teamwork experience. We had limited time, and had a lot to do, and I learned a lot about time management, clear communication, and working as part of a team.

Lastly, feel free to check out our code here.

Gökçe Dilek
Gökçe Dilek
Software Engineer & Open Source Contributor

Related