Skip to content

Stefan1627/Self-Balancing-Robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two-Wheeled Self-Balancing Robot

:::info

Author: Calmac Stefan
GitHub Project Link: link_to_project

:::

Description

The system maintains an upright position on two wheels by continuously adjusting the speed of the motor. It receives data on the angle of inclination and angular velocity from an inertial measurement unit as inputs. A microcontroller processes this data using a PID control algorithm to calculate the necessary corrective forces. The output consists of PWM signals sent to the motor drivers, which actuate the wheels to move forward or backward, counteracting the inclination and keeping the system balanced in real time. The robot will also be controllable from a phone.

Motivation

I’ve been itching to bridge the gap between my software-heavy coursework and hands-on hardware, and a self-balancing robot is the perfect "final boss" to start with. It’s a great way to finally dive into Control Systems and PID algorithms, moving beyond theory to see my code actually fight gravity in real time. Plus, adding smartphone control gives it that extra bit of polish and functionality that makes the whole engineering challenge even more rewarding.

Architecture

Diagram

Log

Week 20 - 24 April

Made initial documentation and ordered hardware parts.

Week 27 - 30 April

Tested all components

Week 4 - 8 April

Assembled first prototype

Week 11 - 15 April

Implemented basic control loop and tested balancing.

Week 18 - 22 April

Added smartphone control and refined LQR parameters.

Hardware

  • Microcontroller: The central logic unit (likely an Arduino, ESP32, or similar) that processes sensor data and controls the motor drivers.

  • MPU6050 IMU: A 6-axis motion tracking device combining a 3-axis gyroscope and a 3-axis accelerometer to measure orientation and acceleration.

  • 42BYGHW609 Stepper Motors (x2): High-torque NEMA 17 stepper motors used for precise positioning or movement.

  • Motor Drivers: (Inferred) Interfaces like the A4988 or DRV8825 used to translate logic signals from the microcontroller into high-current power for the stepper motors.

  • Power Supply: A dedicated DC source (such as a LiPo battery or 12V adapter) to provide sufficient current for the motors and logic circuits.

Schematics

Schematic

Bill of Materials

Device Usage Price
STM32 Microcontroller 129 RON
MPU6050 IMU (Gyroscope + Accelerometer) 14.68 RON
HC-06 Bluetooth Module 30.40 RON
7805CV Voltage Regulator 2.29 RON
2 X DRV8825 Stepper Motor Driver 14.49 RON
2 X 42BYGHW609 Stepper Motor 2 x 55 RON
Hubs Coupling Hubs 12 RON
3 X 18650 Battery 44 RON
Wheels Moving 34 RON
2sc3399 Transistor 2.50 RON
Capacitor 1000uF/16V Filtering 0.59 RON
Capacitor 1000uF/25V Filtering 0.59 RON
Capacitor 470uF/25V Filtering 0.49 RON

Software

Library Description Usage
embassy-stm32 Hardware Interface Base library for project.
defmt Compact logging framework Debug and runtime status messages.
defmt-rtt Real-Time Transfer Logging backend.
panic-probe Panic handler for embedded Rust Reports useful diagnostic information
embassy-executor Async task executor used by the Embassy embedded framework. Structure async tasks.
embassy-futures Provides async utilities for embedded systems join4 runs four async operations concurrently and waits for all of them.
embassy-time Provides timing primitives for Embassy-based embedded firmware. Used where a blocking-style delay object is required by a driver, especially sensor initialization.
embedded-hal Defines generic traits for embedded hardware interfaces. Used the PWM trait abstraction for controlling PWM behavior generically.
mpu6050-dmp Rust driver crate for the MPU6050 IMU. Used to: initialize the MPU6050,configure accelerometer range, configure gyroscope range, read motion data.

Links

  1. https://www.youtube.com/watch?v=I6z26LVu5y0
  2. https://zenn.dev/tana_ash
  3. https://github.com/tana/balance-robot2

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors