Line Follower
Description
The two-wheeled robot uses cooperative multitasking along with several tasks and helper classes in order to follow a line around a path, navigating obstacles as necessary. There are several challenges to the objective, such as complicated geometry for the reflectance sensors, walls to go around, or navigating back to the starting position after finishing the route.
How It Works
Using a Romi chassis and motor/encoder driver from Pololu, an STM32L476RG Microcontroller is fastened to the body along with multiple sensors for distance, reflectance, and direction. Each sensor/motor has a function library developed for use in a task scheduler. The "run" function for each sensor describes the continuous work expected of each sensor.
The finite state machine for the reflectance sensor.
Fusion360 was used to design the reflectance sensor mounts. This design supports 3 sensors for effective line sensing and better PID control of the robot.
The robot was rigorously tested on the following track after the development of each sensor and motor library. Commitment to frequent testing ensured that each part worked as expected by the end of the project.