Skip to content

Commit c4eb77c

Browse files
authored
Project/stefan.calmac (#1011)
* Create index.md * stefan.calmac documentation * update architecture * Update index.md * Schematic upload * Documentation refined
1 parent 3f0067c commit c4eb77c

3 files changed

Lines changed: 95 additions & 0 deletions

File tree

6.66 KB
Loading
18 KB
Loading
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Two-Wheeled Self-Balancing Robot
2+
3+
:::info
4+
5+
**Author**: Calmac Stefan \
6+
**GitHub Project Link**: [link_to_project](https://github.com/UPB-PMRust-Students/acs-project-2026-Stefan1627)
7+
8+
:::
9+
10+
## Description
11+
12+
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.
13+
14+
## Motivation
15+
16+
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.
17+
18+
## Architecture
19+
20+
![Diagram](./images/architecture.webp)
21+
22+
## Log
23+
24+
### Week 20 - 24 April
25+
Made initial documentation and ordered hardware parts.
26+
27+
### Week 27 - 30 April
28+
Tested all components
29+
30+
### Week 4 - 8 April
31+
Assembled first prototype
32+
33+
### Week 11 - 15 April
34+
Implemented basic control loop and tested balancing.
35+
36+
### Week 18 - 22 April
37+
Added smartphone control and refined LQR parameters.
38+
39+
## Hardware
40+
41+
- Microcontroller: The central logic unit (likely an Arduino, ESP32, or similar) that processes sensor data and controls the motor drivers.
42+
43+
- MPU6050 IMU: A 6-axis motion tracking device combining a 3-axis gyroscope and a 3-axis accelerometer to measure orientation and acceleration.
44+
45+
- 42BYGHW609 Stepper Motors (x2): High-torque NEMA 17 stepper motors used for precise positioning or movement.
46+
47+
- 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.
48+
49+
- Power Supply: A dedicated DC source (such as a LiPo battery or 12V adapter) to provide sufficient current for the motors and logic circuits.
50+
51+
### Schematics
52+
53+
![Schematic](./images/schematic.webp)
54+
55+
### Bill of Materials
56+
57+
| Device | Usage | Price |
58+
|--------|--------|-------|
59+
| [STM32](https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html) | Microcontroller | [129 RON](https://ro.farnell.com/stmicroelectronics/nucleo-u545re-q/development-brd-32bit-arm-cortex/dp/4216396?CMP=e-email-sys-orderack-GLB) |
60+
| [MPU6050](https://cdn.sparkfun.com/datasheets/Sensors/Accelerometers/RM-MPU-6000A.pdf) | IMU (Gyroscope + Accelerometer) | [14.68 RON](https://www.optimusdigital.ro/en/inertial-sensors/13611-mpu6050-accelerometer-and-gyroscope-module-soldered-pins.html)
61+
| [HC-06](https://www.rajguruelectronics.com/Product/707/HC-06%20core%20bluetooth%20module.pdf) | Bluetooth Module | [30.40 RON](https://www.optimusdigital.ro/en/wireless-bluetooth/9629-hc-06-slave-module-with-adapter-33v-and-5v-compatible.html?search_query=0104110000063557&results=1) |
62+
| [7805CV](https://www.alldatasheet.com/datasheet-pdf/view/22634/STMICROELECTRONICS/L7805CV.html) | Voltage Regulator | [2.29 RON](https://www.tme.eu/ro/details/l7805cv/regulatoare-de-tensiune-neregulata/stmicroelectronics/?brutto=1&currency=RON&utm_source=google&utm_medium=cpc&utm_campaign=RUMUNIA%20%5BPLA%5D%20CSS&utm_content=&campaign_id=10591401989&gad_source=1&gad_campaignid=10591401989&gclid=Cj0KCQjww8rQBhDjARIsAE43KPNMQx9BcwCRkYgH--lNO9846eYcD11bwCDiKmXQAqxLTKGlnEeu9BgaAp3-EALw_wcB) |
63+
| [2 X DRV8825](https://www.tme.eu/Document/1dd18faf1196df48619105e397146fdf/POLOLU-2133.pdf) | Stepper Motor Driver | [14.49 RON](https://www.optimusdigital.ro/ro/drivere-de-motoare-pas-cu-pas/154-driver-pentru-motoare-pas-cu-pas-drv8825.html) |
64+
| [2 X 42BYGHW609](https://www.openimpulse.com/blog/wp-content/uploads/wpsc/downloadables/42BYGHW609-Stepper-Motor-Datasheet1.pdf) | Stepper Motor | [2 x 55 RON](https://www.optimusdigital.ro/en/stepper-motors/1968-motor-pas-cu-pas-42byghw609.html) |
65+
| Hubs | Coupling Hubs | [12 RON](https://www.optimusdigital.ro/en/coupling-hubs/227-hexagonal-motor-coupling-hub-5-mm.html) |
66+
| [3 X 18650](https://www.tme.eu/Document/b0696c4f778ad42c714b01b76e452497/XTAR+18650+3500.pdf) | Battery | [44 RON](https://www.tme.eu/ro/details/xtar-18650-3.5ah10/acumulatori/xtar/18650-350pcm/?brutto=1&currency=RON) |
67+
| Wheels | Moving | [34 RON](https://sigmanortec.ro/roata-65mm-cu-cauciuc) |
68+
| [2sc3399](https://www.alldatasheet.com/datasheet-pdf/view/108623/SANYO/2SC3399.html) | Transistor | [2.50 RON](https://www.digikey.lt/en/products/detail/rochester-electronics-llc/2SC3399-AC/12098102) |
69+
|Capacitor 1000uF/16V | Filtering | [0.59 RON](https://www.optimusdigital.ro/ro/componente-electronice-condensatoare/7822-condensator-electrolitic-1000-uf-16-v.html) |
70+
|Capacitor 1000uF/25V | Filtering | [0.59 RON](https://www.optimusdigital.ro/ro/componente-electronice-condensatoare/3005-condensator-electrolitic-de-1000-uf-la-25-v.html) |
71+
|Capacitor 470uF/25V | Filtering | [0.49 RON](https://www.optimusdigital.ro/ro/componente-electronice-condensatoare/3007-condensator-electrolitic-de-470-uf-la-25-v.html) |
72+
73+
74+
## Software
75+
76+
| Library | Description | Usage |
77+
|---------|-------------|-------|
78+
| [embassy-stm32](https://github.com/embassy-rs/embassy/tree/main/embassy-stm32) | Hardware Interface | Base library for project. |
79+
| [defmt](https://crates.io/crates/defmt) | Compact logging framework | Debug and runtime status messages. |
80+
| [defmt-rtt](https://crates.io/crates/defmt-rtt) | Real-Time Transfer | Logging backend. |
81+
| [panic-probe](https://crates.io/crates/panic-probe) | Panic handler for embedded Rust | Reports useful diagnostic information |
82+
| [embassy-executor](https://crates.io/crates/embassy-executor) | Async task executor used by the Embassy embedded framework. | Structure async tasks. |
83+
| [embassy-futures](https://crates.io/crates/embassy-futures) | Provides async utilities for embedded systems| join4 runs four async operations concurrently and waits for all of them. |
84+
| [embassy-time](https://crates.io/crates/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. |
85+
| [embedded-hal](https://crates.io/crates/embedded-hal) | Defines generic traits for embedded hardware interfaces. | Used the PWM trait abstraction for controlling PWM behavior generically. |
86+
| [mpu6050-dmp](https://crates.io/crates/mpu6050-dmp) | Rust driver crate for the MPU6050 IMU. | Used to: initialize the MPU6050,configure accelerometer range, configure gyroscope range, read motion data. |
87+
88+
## Links
89+
90+
1. https://www.youtube.com/watch?v=I6z26LVu5y0
91+
2. https://zenn.dev/tana_ash
92+
3. https://github.com/tana/balance-robot2
93+
94+
95+

0 commit comments

Comments
 (0)