Mechatronics / Autonomous systemsJanuary - March 2026

Romi autonomous navigation robot

A two-wheel robot that follows lines, estimates its position from encoders and an IMU, detects a wall without a bump switch, and sequences its own route through a mixed-mode course.

Pink Romi robot with STM32 Nucleo board, line sensor, IMU, and motor wiring
Pololu Romi chassis / STM32 Nucleo / custom MicroPython firmware

05

scheduled tasks

20 ms

observer period

10

navigation stages

Final result

One course, multiple control modes.

The final run combines ordinary line tracking with waypoint checks, precise turns, distance moves, and acceleration-based wall contact. The controller coordinates the transitions without a human selecting each mode.

System design

Feedback from floor to firmware.

Controller

STM32 Nucleo L476RG

Firmware

MicroPython

Feedback

BNO055 IMU + dual encoders

Line sensing

5-channel digital IR array

Control

PI/PID + state estimation

Runtime

Cooperative task scheduler

Wiring diagram connecting the STM32 Nucleo to motors, encoders, BNO055 IMU, Bluetooth, and line sensor
Electrical architecture and STM32 pin assignments

Control architecture

Small tasks, shared state, one coordinated machine.

01

See the course

A five-channel IR array measures line position, while wheel encoders and the BNO055 IMU provide motion and heading feedback.

02

Estimate motion

An observer running every 20 ms fuses motor effort, encoder position, IMU heading, and yaw rate into a live pose estimate.

03

Choose the behavior

A finite-state controller switches between line following, heading control, distance control, and impact-based wall detection.

04

Drive the motors

Independent 50 ms motor tasks apply the requested effort and report encoder data through shared variables and queues.

Cooperative scheduling diagram showing user, controller, motor, and observer tasks

Test progression

Prove the loop, then add the course.

Circular black line used to tune the Romi line-following controller

Stage 01 / PI tuning

Continuous line-following test

A circular course exposed oscillation quickly and made it practical to tune base speed, proportional gain, and integral gain before attempting the full route.

Final mechatronics course with line sections, checkpoints, wall, and open navigation zones

Stage 02 / autonomous route

Mixed-mode final track

The course demanded long line segments, curves, a garage maneuver, wall contact, heading changes, and an unlined finish. A ten-stage hub sequenced each behavior.

Engineering lessons

The useful parts were not all victories.

01

Battery voltage changed the plant

The same motor command behaved differently as the battery discharged. A future revision would measure supply voltage and compensate the effort automatically.

02

Digital sensing made the line coarse

The digital array was quick to integrate, but its five widely spaced sensors produced abrupt corrections. A denser analog array would give the controller a smoother error signal.

03

The IMU doubled as a bump sensor

Instead of adding a mechanical switch, the robot detected a wall through acceleration. It worked, but hard acceleration could mimic an impact and required careful threshold tuning.

Finite-state design

The behavior behind the motion.

Controller finite-state machine
Controller FSM
Serial user-interface finite-state machine
User interface FSM
Motor task finite-state machine
Motor task FSM
State observer finite-state machine
Observer FSM

Team credit

Built together.

This project was created by Shafiq Amat and Max Soury. The firmware, testing, documentation, wiring, diagrams, and physical robot were the result of a shared team effort.