Autonomous Floor
Cleaning Robot Architecture
An embedded systems case study featuring real-time collision aversion, state-machine driven pathfinding navigation, and register-optimized telemetry processing for custom multi-axis hardware platforms.
Project Context
The Autonomous Floor Cleaning Robot is a custom mechatronic setup engineered to perform path navigation and surface sweeping loops. It bypasses the need for high-compute microprocessing boards by utilizing efficient, low-overhead firmware architectures.
Built directly from circuit level to structural casing, the system manages incoming data streams from distance sensor arrays using non-blocking timer triggers. By checking environmental variations through real-time state trees, the vehicle applies deterministic correction maneuvers ideal for handling unmapped layouts.
Problem Statement
Kinematic Collision Risk
Standard blind execution loops often cause hard impacts against moving room hazards, requiring responsive fallback loops to adjust navigation profiles safely.
Signal Echo & Phase Jitters
Acoustic pulse cancellation and external infrared noise introduce severe tracking interference, creating loop errors if data isn't properly debounced.
Constrained Allocations
Running multi-stage choice trees on limited 8-bit registers requires careful code optimization to prevent memory limits or stack overflows.
Technical Objectives
Continuous Scanning
Deploy non-blocking background read cycles to check environmental space without stopping active movement paths.
H-Bridge Matching
Calibrate duty cycles directly on controller pins to enable reliable straight runs and clean turning transitions.
Low-BOM Layout
Maximize performance metrics while using budget-friendly microcontrollers and standard peripheral sensors.
Automatic Corner Release
Build reactive choice sequences to pull the robot out of unexpected physical traps or dead ends autonomously.
Hardware Layer Deep-Dive
Microcontroller Core
Orchestrates the primary asynchronous loop, handles raw signal debouncing, and generates independent PWM channels for velocity control.
Ultrasonic Arrays (HC-SR04)
Calculates spatial distance lines using Time-of-Flight sound reflections to build a structural barrier map ahead of the platform.
Infrared Sensor Array
Provides quick digital edge triggers to cover lateral areas outside the narrow acoustic beam vector.
L298N Dual H-Bridge Platform
Isolates sensitive logic lines from inductive motor draw, safely distributing power to twin drive tracks.
Li-Ion Power Subsystem
High-capacity battery configurations deployed with independent regulator lines to filter motor ripple noise out of processing circuits.
High-Torque Geared DC Motors
Delivers steady rotational force across varying surface transitions, maintaining predictable platform tracking over time.
Firmware & System Architecture
System Data Processing Loop
Main Run Loop Lifecycle
Boot Config & Register Allocation
Configures I/O pin states, sets up timer presets for PWM, and assigns initial safety boundaries.
Ultrasonic Interrogation Wave
Fires a 10-microsecond trigger pulse to capture real-time distance metrics via low-latency hardware counter checks.
Telemetry Boundary Verification
Compares raw echo tracking vectors against safe thresholds to quickly flag oncoming hazards.
Adaptive Correction Sequences
When obstacles block the forward path, the logic alters individual motor tracks, executing a sharp pivot away from the barrier.
Velocity Output Dispatch
Applies calculated power levels to the driver control registers, keeping platform transitions smooth and controlled.
Feature Showcase
Real-Time Aversion Matrix
Monitors physical environment boundaries continuously to reliably adjust drive behaviors before contact occurs.
Differential Traction Steering
Enables high-efficiency rotational turning profiles, reducing wheel drag across tricky carpet-to-hardwood flooring transitions.
Asynchronous Logic Loop
Leverages non-blocking check loops to execute sensor sweeping routines without halting motor propulsion cycles.
Hardware Power Separation
Features split power rails that shield sensitive microcontroller boards from high-amp motor feedback spikes.
Fallback Escape Sequences
Monitors for potential trap states, automatically executing reverse-and-pivoting paths to free the robot from tight corners.
Modular Frame Geometry
Built with an balanced chassis layout that lowers the center of gravity while keeping components accessible for quick updates.
Sensor Interfacing & Conversion Calculations
Ultrasonic Echo Time-of-Flight Calculus
The logic driver converts raw acoustic return times into structural space metrics. The distance calculation relies on standard high-speed sound velocities:
Motor Steering Processing Matrix
Direction adjustments balance relative power levels applied to the H-Bridge lines. Manipulating polarity combinations allows the vehicle to spin inside tight spaces efficiently.
| State Node | Left/Right Pins | Duty Value |
|---|---|---|
| FORWARD | HIGH / HIGH | 85% Output |
| PIVOT_LEFT | LOW / HIGH | 100% Max Torque |
| REVERSE | LOW / LOW | 70% Low Ripple |
Autonomous Navigation Tree Logic
The choice sequencer prioritizes clear space paths. When obstacle distances fall below safe minimum markers, the background checks halt linear runs to prioritize defensive course changes.
Engineering Challenges Faced
Inductive Ripple Resets
Brushed DC motor starts created heavy feedback ripples, causing the core logic chip to undergo random memory drops.
MITIGATION LOGIC //Added electrolytic filters directly across power terminals and completely separated logic buses from actuation power lines.
Ultrasonic Ghost Reflections
Acoustic waves bounced off flat corner surfaces incorrectly, occasionally hiding major walls from the processing checks.
MITIGATION LOGIC //Updated firmware algorithms to use a rolling average buffer, checking distance consistency before executing turns.
Performance Optimization Metrics
Removed all standard programmatic delays to maintain continuous sensor monitoring.
Streamlined variable structures to keep code compact and efficient on basic microchips.
Eliminated electrical logic faults completely during continuous high-load operations.
Validated Metrics
Future Engineering Iterations
// 01 / Planar LiDAR Nodes
Upgrading distance detection with high-resolution 2D laser mapping scanners to construct accurate spatial floorplans.
// 02 / ROS2 Micro-Nodes
Migrating basic navigation scripts onto standard micro-ROS setups to integrate open-source pathfinding libraries.
// 03 / High-Res Encoders
Adding optical code discs onto wheel drive shafts to track precise vehicle velocity variations directly.
Review Code & Circuit Schematics.
Explore firmware structures, physical pin mappings, and optimization logic configurations inside the active open-source codebase.