Two wheels self balancing robot

Stabalization, command and control of two wheels robot is a challenging problem in automation theory. It is a practical manifestation of inverted pendulum. In this project a linearized model of the two wheels robot was used for controller si,ulation in MATLAB. Six degress of freedom data is obt

2025-06-28 16:36:29 - Adil Khan

Project Title

Two wheels self balancing robot

Project Area of Specialization RoboticsProject Summary

Stabalization, command and control of two wheels robot is a challenging problem in automation theory. It is a practical manifestation of inverted pendulum. In this project a linearized model of the two wheels robot was used for controller si,ulation in MATLAB. Six degress of freedom data is obtained from 3 accelerometers and 3 gyros mounted on MPU-6050. The raw data is processed by Kalman Filter and is input to  PID loop. The error signalas are processed through Arduino UNO 328 and Pulse Width Modulation (PWM)  output to motor drivers to achieve balancing of the robot. 

Project Objectives

Two-wheel robot is inherently unstable. We need to design an algorithm that will balance this unstable robot. The algorithm will process the data by IMU and encoder and operate the motor through motor driver to achieve balancing state.

To attain this aim, our objectives are:

  1. Derive dynamical equations of the two wheels robot.
  2. Form transfer functions for the angle deviation, ? and position, x.
  3. Simulation of the model through transfer function.
  4. Designing of PID algorithm and Kalman Filter for the system.
  5. After implementation the self-balancing robot, evaluating its performance.
Project Implementation Method

First of all we connected the IMU sensor MPU-6050 with Arduino UNO in such a way that Vcc of the sensor is connected to 5V pin, GND with ground, SCL with pin A5 and SDA with pin A4 of the Arduino.

Then, we connected motor driver with Arduino UNO is such a way that PWM-A and PWM-B of motor driver are connected to digital pin ~9 and pin ~10 of Arduino respectively. AIN-1 and AIN-2 are connected to pin 7 and pin ~6 of Arduino respectively. Similarly pin 13 and pin 12 are connected to BIN-1 and BIN-2 or motor driver respectively. Standby pin is connected to pin 8 of Arduino. Vcc is connected to 5V pin of Arduino while Vm is connected to 12V DC source.

Then, we connected encoder 1 and 2 of  two motors in such a way that pin A of encoder 1 is connected to pin 4 and encoder 2 pin A is connected to pin 2 of Arduino.  M+ of encoder 1 is connected to B02 while M- is connected to B01 of motor driver TB6612FNG. Similarly, M+ of encoder 2 is connected to A01 while M- is connected to A02 of motor driver. Vcc and GND of both encoders are connected to 5V and ground pin of Arduino respectively.

Finally we connected Bluetooth module in the circuit. Transmission (Tx) pin of Bluetooth module is connected to receiving (Rx) pin of Arduino while receiving (Rx) pin of Bluetooth module is connected to transmission (Tx) pin of Arduino. Supply is given to Bluetooth through Arduino.

Whole circuit is designed on PCB for simplicity and good looking of the robot. For the assembling of robot first install the motor fixed bracket. Then motor, shaft connector and tire are installed and controller is installed on top of the assembly. Then 12V DC supply is connected at the top of the whole assembly.

Benefits of the Project

1. Reduces time for travelling foot distance.

2. A clean, green, eco-friendly machine! (zero emission)

3. Require less space for riding, parking .

4. Become more productive: more work can be done by using the product versus walking

5. low operating costs: no need for gas and inexpensive battery charging (A complete cycle charge will take eight to ten hours)

Technical Details of Final Deliverable Final Deliverable of the Project HW/SW integrated systemType of Industry Transportation Technologies RoboticsSustainable Development Goals Industry, Innovation and InfrastructureRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 13110
Arduino UNO Equipment1750750
MPU-6050 Equipment2200400
HC-06 Bluetooth module Equipment2400800
Motor Driver TB6612FNG Equipment25001000
DC encoder motors Equipment225805160
Acrylic sheets Miscellaneous 52001000
PCB designing Miscellaneous 140004000

More Posts