How git-jaishnu/line_follower works
This repository implements STM32F4 line-following robot firmware plus a desktop PID-tuning dashboard. The main workflow samples sensor and battery inputs, interprets line position and junctions, computes steering, and drives the motors; Bluetooth carries telemetry and tuning commands. The README describes the domain flow, while the source index and excerpts provide only partial implementation evidence, so documented relationships cite the README and unsampled internals are not treated as inspected.
Main entry points: main.c Control loop · pid_tuner.py PID tuner dashboard · motor.c Motor control · bluetooth.c Bluetooth protocol
Components 16
Robot firmware
- ADC and DMA
Core/Src/main.c - Sensor synchronization
Core/Src/sensor_module.c - Control loop
Core/Src/main.c - Utility helpers
Core/Src/utils.c
Navigation and control
- Sensor processing
Core/Src/sensor_module.c - Junction detection
Core/Src/sensor_module.c - Line error
Core/Src/sensor_module.c - PID steering
Core/Src/sensor_module.c - Motor control
Core/Src/motor.c
Telemetry and tuning
- Bluetooth protocol
Core/Src/bluetooth.c - PID tuner dashboard
pid_tuner.py
Robot hardware
- IR sensor array
- Battery divider
- H-bridge motors
- Bluetooth UART
Core/Src/main.c
Other components
- Robot operator
Connections 17
- IR sensor array → ADC and DMA: supplies readings
README.md - Battery divider → ADC and DMA: supplies voltage
README.md - ADC and DMA → Sensor synchronization: transfers samples
README.md - Control loop → Sensor synchronization: synchronizes inputs
README.md - Control loop → Sensor processing: processes sensors
README.md - Control loop → Junction detection: checks junctions
README.md - Control loop → Line error: calculates error
README.md - Control loop → PID steering: calculates steering
README.md - Control loop → Motor control: sets motor output
README.md - Motor control → H-bridge motors: drives motors
README.md - Control loop → Bluetooth protocol: handles commands
README.md - Bluetooth protocol → PID steering: updates gains
README.md - Control loop → Bluetooth UART: sends telemetry
README.md - Bluetooth UART → PID tuner dashboard: streams telemetry
README.md - Robot operator → PID tuner dashboard: tunes gains
README.md - PID tuner dashboard → Bluetooth UART: sends tuning commands
README.md - Control loop → Utility helpers: uses helpers