Robotics & Embedded | Control • Sensing • PCB

High-Speed Line Follower Robot (STM32)

Competition-grade line follower with 24-IR sensor array, custom PID (gain scheduling), and PWM motor control on STM32. Focus on stability at speed and repeatable lap times.

High-speed line follower robot

Objective

Achieve stable, high-speed tracking on varied surfaces with minimal overshoot and low lap-time variance. Emphasis on robust signal processing for a 24-channel IR array and tight, deterministic control loops on STM32.

System Architecture

  • MCU: STM32 (C, HAL) with timer-driven control loop.
  • Sensing: 24-IR reflectance array, outlier rejection, smoothing.
  • Actuation: Dual DC motors via PWM, dead-zone compensation.
  • Control: PID + gain scheduling by speed and curvature.
  • Hardware: Rapid PCB iterations to improve SNR and reduce latency.
24-IR sensor array snapshot (normalized signals)

Control Design & Tuning

  • Position error computed from weighted sensor centroid; clamped derivative to reduce noise amplification.
  • Anti-windup via integral clamping; conditional integral at high error.
  • Gain scheduling: higher Kd at speed; lower Ki on sharp curvature to prevent oscillation.
Simulated PID step response after tuning

Results

  • Overshoot events reduced significantly after derivative clamp and gain schedule.
  • Lap-time variance tightened across surfaces (glossy/matte/painted).
  • Repeatable performance through deterministic timing and debounced sensor reads.
Lap time mean and standard deviation across surfaces

Tools & Stack

Artifacts