Skip to content
Open access

State Machine Model of the Operation Control of a Differential- Drive Mobile Robot

Jul 2026 · Electronics · 0 citations · 37 references

Abstract

Existing robotic control frameworks often rely on complex hierarchical state machines or middleware infrastructures, which may be unsuitable for resource-constrained embedded systems and difficult to map directly to low-level code. This work presents a complete state-machine model for the reactive control layer of a differential-drive mobile robot. Although mobile-robot controllers often exhibit considerable complexity—particularly at lower levels, where numerous hardware-dependent operations occur—this work shows that a network of concurrent state machines provides a clear and lightweight method for specifying and implementing control behavior. The proposed approach decomposes the reactive controller into two concurrent extended finite-state machines (CEFSMs) responsible for locomotion and lidar operation, connected through simple and predictable protocols. This structure enables a direct mapping from model diagrams to procedural code in languages such as C++ and Lua. The method has been used extensively in an undergraduate Embedded Systems course since 2011, supporting both physical robots (Arduino-based) and their digital twins in CoppeliaSim. We also introduce a discrete control strategy that approximates continuous behavior and incorporates a simplified proportional–integral–derivative (PID) controller for pose correction. The approach reduces development effort, increases model clarity, and yields reusable code across hardware and simulation platforms. Quantitative evaluation shows that the proposed PID-based control strategy can improve positioning accuracy by up to an order of magnitude compared to a baseline on–off controller, without increasing the computational cost. In addition, the control cycle time has been significantly reduced (from 31 ms to 12 ms) in order to ensure a stable execution period; this, in turn, results in a more predictable controller output and improved trajectory consistency.

Read PDF