Thursday, June 5, 2025

InEquilibrio01: a simple PID controlled self-balancing robot

ref: 2017


InEquilibrio01 is a compact self-balancing robot that maintains its upright position using a PID control loop.
It is built around an ATmega328 microcontroller running at 8 MHz using its internal oscillator, and uses two inexpensive DC gear motors for actuation. An MPU6050 sensor, which integrates a 3-axis gyroscope and accelerometer, provides real-time feedback on the robot’s orientation.


A lightweight PID library enables real-time tuning of control parameters, allowing the robot to adjust its posture dynamically. PID coefficients can be programmed via PC using a bluetooth adapter (such as the HC-05) and a simple host-side library.


Although the motors are quite basic and relatively slow, making smooth balancing a challenge, the system performs reliably and demonstrates the core principles effectively.


Power is supplied by a 7.4 V LiPo battery, regulated by a DC-DC buck converter that steps the voltage down to 5 V for the microcontroller and electronics.

Code

Notes

  • read risk disclaimer
  • excuse my bad english