SEBA-ROBOT is a two-wheeled self-balancing robot project for control, embedded systems, and autonomous robotics development.
The current work covers the robot dynamics, balance and motion control, nonlinear simulation, built physical hardware, STM32 real-time firmware, and Raspberry Pi web runtime.
The physical robot has been implemented and validated with stable self-balancing, forward-velocity tracking, yaw-rate control, and closed-loop motor-current regulation.
![]() Figure 1. Front view of SEBA-ROBOT. |
![]() Figure 2. Back view of SEBA-ROBOT. |
![]() Figure 3. Left side view of SEBA-ROBOT. |
![]() Figure 4. Right side view of SEBA-ROBOT. |
The implemented work covers six main areas:
- Robot modeling: nonlinear forward, pitch, and yaw dynamics, together with a reduced model and linearization for control design
- Motion control: a robust servomechanism LQR controller for pitch stabilization, forward-velocity tracking, and yaw-rate tracking
- Simulation and evaluation: a nonlinear Simulink and Simscape Multibody model with four documented test cases, result plots, and animations
- Hardware system: built physical robot hardware, including power distribution, STM32 connections, motor driver, sensors, wiring, and mechanical electronics layout
- STM32 firmware: real-time PlatformIO firmware for state estimation, balance and motion control, actuator current control, telemetry, safety handling, motor control, encoder reading, IMU acquisition, and current sensing
- Raspberry Pi platform: Python web server with local login, an operator control panel, engineering tuner, STM32 UART communication, telemetry display, command handling, staged Ubuntu setup, autostart service, and hotspot fallback support
Dynamics and Velocity-Tracking Control Model
Nonlinear robot dynamics, reduced control model, linearization, and robust servomechanism LQR controller design.
Simulation model configuration, controller settings, test procedures, result plots, and animations.
Electrical hardware, power distribution, STM32 connections, motor driver, sensors, wiring, and physical construction.
Real-time PlatformIO firmware for STM32G474RE sensing, state estimation, balance and motion control, actuator control, telemetry, serial commands, and safety behavior.
Raspberry Pi setup and web runtime for local login, the operator control panel, engineering tuner, STM32 UART communication, telemetry, staged Ubuntu setup, autostart service, and hotspot fallback support.
The controller is evaluated using four closed-loop simulation test cases:
The combined-motion test evaluates simultaneous forward-velocity and yaw-rate tracking while maintaining balance.
combined_motion_tracking.mp4
Plots and simulation animations for all four test cases are available in the simulation documentation.
seba-robot/
|-- control/
| |-- README.md
| `-- simulink/
| |-- README.md
| |-- seba_control.slx
| `-- results/
|-- hardware/
| `-- README.md
|-- firmware/
| `-- stm32/
| |-- README.md
| |-- platformio.ini
| `-- src/
|-- raspberry-pi/
| |-- README.md
| |-- requirements.txt
| |-- seba_pi/
| |-- setup/
| | `-- README.md
| |-- systemd/
| |-- web/
| | |-- README.md
| | |-- apps/
| | |-- http_handler.py
| | `-- server.py
| |-- hotspot.sh
| `-- install.sh
|-- robot/
| |-- photos/
| |-- screenshots/
| `-- thumbnails/
|-- LICENSE
`-- README.md
control/contains the robot dynamics and controller documentation.control/simulink/contains the simulation model, simulation documentation, and test results.hardware/contains documentation for the built robot hardware, including electronics, wiring, power distribution, and physical construction.firmware/stm32/contains the STM32G474RE PlatformIO firmware.raspberry-pi/contains the Raspberry Pi setup tooling, web server, local web authentication, operator control panel, engineering tuner, serial-link backend, NetworkManager hotspot tooling, and systemd service templates.robot/contains photos of the completed physical robot, web-interface screenshots, and demo-video thumbnails.
The model was developed and tested using MATLAB R2025b with Simulink, Simscape, and Simscape Multibody.
Clone the repository:
git clone https://github.com/ShahinFi/seba-robot.git
cd seba-robotOpen the following model in MATLAB:
control/simulink/seba_control.slx
No separate initialization script is required.
See the simulation documentation for the software requirements, model settings, and instructions for reproducing the four test cases.
The STM32 firmware is a PlatformIO project for the NUCLEO-G474RE board.
cd firmware/stm32
pio runSee the STM32 firmware documentation for upload, monitor, serial commands, telemetry, control modules, and safety behavior.
The Raspberry Pi platform provides the robot web interfaces and setup tooling.
For a reproducible Raspberry Pi setup, use the staged installer:
bash raspberry-pi/install.sh allFor a manual web-server run after setup:
.venv/bin/python3 raspberry-pi/web/server.py --serial /dev/ttyAMA0 --port 8080The operator control panel is available at /control, and the engineering tuner is available at /tuner.
See the Raspberry Pi platform documentation for setup and web-runtime documentation links.
Future development will focus on:
- battery and power-status reporting
- localization, mapping, UWB positioning, and navigation
- ROS 2 and high-level autonomous behavior on the Raspberry Pi
This project is licensed under the MIT License.






