Objectives

The primary objective behind constructing this self-balancing robot is to gain insight into the functionality of two-wheeled motorized personal vehicles, such as the renowned Segway self-balancing vehicle.

Additionally, I aim to enhance my programming skills by utilizing Arduino and C++ language, exclusively without relying on external libraries. This hands-on experience will provide invaluable learning opportunities as I delve into coding from the ground up.

The control theory that I applied in this project is the PID control, and also the implementation of Kalman filters for readin the data from the sensor. These techniques are leanrt in theory in the course but I want to make it more practical so I decided to engage it to this project.

The code can be found "HERE".

Overview

  • The design consists of a base platform for mounting the L298N motor driver, a platform for mounting the Arduino Uni R3 and the accelerometer MPU6560 and the highest platform is to mount a 12V lipo battery.
  • This project was conceptualized using SolidWorks, drawing inspiration from the inverted pendulum model as a guiding principle.
  • Real model

  • After priting out the CAD files in Solidworks, and upload the code for the first test I relized that the wiring also affect part of the robot so it is not always reliable.
  • Additionally, the PID parameters must be re-tuned for varying surfaces. For example, when placed on a mat floor or carpet, the robot may struggle to maintain balance, requiring adjustments to ensure stability even under these conditions.
  • Testing video

    After spending several hours fine-tuning the PID parameters, the desired outcome has finally been achieved.