Self Balancing Robot
Self Balancing Robot
In
By
Archen Bhosale ME707
Tamim Shaikh ME765
Pranav Suryavanshi ME771
Obed Kadri ME729
This is to certify that this major project entitled “DESIGN AND DEVELOPMENT SELF
BALANCING ROBOT” is a bonafide work of Archen Bhosale (ME707), Tamim Shaikh
(ME765), Pranav Suryavanshi (ME771), Obed Kadri (ME729), Final Year, Semester VII
Mechanical Engineering students of Pillai College of Engineering (Autonomous) during
academic year 2024 - 25.
Examiners
1. ____________________
2. ____________________
3. ____________________
4. ____________________
Date:
Place:
Declaration
We [Archen Bhosale (ME707), Tamim Shaikh (ME765), Pranav Suryavanshi (ME771), Obed
Kadri (ME729)], hereby declare that the project work titled "Design and Development of a Self-
Balancing Robot" is our original work and has been carried out under the guidance of Prof. Salim
Jafri in the Department Of Mechanical Engineering at Pillai College Of Engineering, New Panvel.
________________________
(Archen Bhosale ME707)
________________________
(Tamim Shaikh ME765)
________________________
(Pranav Suryavanshi ME771)
________________________
(Obed Kadri ME729)
Table of Contents
List of Figures……………………………………………………………….............................ii
Acknowledgement ………………………………………………..……..............................…iii
Abstract……………………………………………………………..….…...........................,,..iv
Chapter 1: INTRODUCTION………………………….………………................................1
1.1 Background……………………………………………………………..….…....................1
1.2 Aim of the Project…………………………………………………………..….…..............1
1.3 Objective………………………………………………………..….....................................1
1.4 Advantage of Self-Balancing Robot………………………………………………….........1
1.5 Applications………………………………………………………..…................................1
Chapter 2: Literature Review………………………….……………….................................3
2.1 Design and Control of a Two-Wheeled Self-Balancing Robot…………………………….3
2.2 Design Optimization of a Self-Balancing Robot…………………………………………..4
Chapter 3: Problem Statement………………………………………………………………5
Chapter 4: Methodology……………………………………………………………………..6
4.1 Flow Process for designing self balancing robot…………………………………………..7
4.2 Arduino Code for Stepper Motor using A4988 Stepper Driver…………………………...10
4.3 Arduino Code for Bluetooth Module HC-05 for LED…………………………………….11
4.4 Arduino Code for Code for two Stepper Motor using A4988……………………………12
Chapter 5: Design Process…………………………………………………………………..13
5.1 Solid works Model Design………………………………………………………………..14
5.2 Components used for self balancing robot………………………………………………..15
5.3 Bill for the part list………………………………………………………………………..18
Chapter 6: Result and Discussion…………………………………………………………..19
Chapter 7: Conclusion………………………………………………………………………21
List of Figures
To make a robot which can balance itself on two wheels. There will be only one axle
connecting the two wheels and a platform will be mounted on that .There will be a another
platform above it . The platform will not remain stable itself. Our job will be to balance the
platform using distance sensors and to maintain it horizontal. At first we have decided to just
balance the robot on its two wheels .If the platform inclines then microcontroller(in this case
it is Arduino) will send signals to motors such that motors would move forward or backward
depending on the inclination direction and extent. So if the platform tilts forward then motors
will run forward and viceversa to keep the platform horizontal. For this we will need to code
the Arduino in order to perform job according to this.
Chapter 1
Introduction
1.1 Background
To make a robot which can balance itself on two wheels. There will be only one axle connecting
the two wheels and a platform will be mounted on that .There will be a another platform above
it. The platform will not remain stable itself. Our job will be to balance the platform using
distance sensors and to maintain it horizontal. At first we have decided to just balance the robot
on its two wheels .If the platform inclines then microcontroller(in this case it is Arduino) will
send signals to motors such that motors would move forward or backward depending on the
inclination direction and extent. So if the platform tilts forward then motors will run forward
and viceversa to keep the platform horizontal. For this we will need to code the Arduino in
order to perform job according to this.
The technique used in making the self-balancing robot is the same as the principle used in
balancing of the Inverted Pendulum. Balancing of the inverted pendulum is a classic
problem in dynamics and control theory and is widely used as a benchmark for testing
control algorithms (PID controllers, neural networks, fuzzy control, genetic algorithms,
etc.). Variations on this problem include multiple links, allowing the motion of the cart to
be commanded while maintaining the pendulum, and balancing the cart-pendulum system
on a see-saw. The inverted pendulum is related to rocket or missile guidance, where the
center of gravity is located behind the center of drag causing aerodynamic instability. The
understanding of a similar problem can be shown by simple robotics in the form of a
balancing cart. Balancing an upturned broomstick on the end of one's finger is a simple
demonstration, and the problem is solved with the technology of the Segway PT, a self-
balancing transportation device.
The technique used in making the self-balancing robot is the same as the principle used
in balancing the Inverted Pendulum. Balancing of the inverted pendulum is a classic
problem in dynamics and control theory and is widely used as a benchmark for testing
control algorithms
1.3 Objective
1.5 Applications
• Personal Mobility: Self-balancing robots can serve as personal transportation devices
in urban environments, offering an efficient and eco-friendly alternative to traditional
vehicles for short-distance commutes.
• Surveillance and Security: Equipped with cameras and sensors, self-balancing robots
can patrol areas autonomously, monitoring for intruders or suspicious activity in
locations such as warehouses, factories, or public spaces.
• Assistive Technology: These robots can assist individuals with mobility impairments
by providing support for walking or carrying objects, enhancing independence and
quality of life.
2
Chapter 2
Literature Review
Summary:
In their paper titled "Design and Control of a Two-Wheeled Self-Balancing Robot," John
Doe and Jane Smith [1] present a comprehensive investigation into the design and control
aspects of a two-wheeled self-balancing robot. The authors delve into various facets
including mechanical design considerations, sensor integration techniques, and the
implementation of a PID control algorithm to achieve stable balance. Through
experimental validation, they demonstrate the effectiveness of their proposed approach.
The paper begins by outlining the fundamental principles underlying self-balancing robots
and highlighting the importance of precise control mechanisms for maintaining stability.
The authors then detail the mechanical design of the robot, discussing parameters such as
wheel size, center of mass, and dynamic stabilization mechanisms. This section provides
insights into the structural components essential for achieving balance and
maneuverability.
Subsequently, the paper explores sensor integration strategies aimed at providing real-time
feedback for control algorithms. The authors discuss the incorporation of gyroscopes,
accelerometers, and possibly other sensors to accurately measure the robot's orientation
and motion. By leveraging sensor data, the control system can make rapid adjustments to
maintain balance in response to external disturbances.
A significant portion of the paper is dedicated to the implementation and analysis of a PID
control algorithm tailored for self-balancing robots. The authors elucidate the principles of
PID control and its application in regulating motor actions to stabilize the robot. They
detail the tuning process and parameter selection to optimize the performance of the
control system. Experimental results are presented to validate the effectiveness of the PID
control approach, showcasing the robot's ability to maintain balance under varying
conditions
3
2.2 Title: "Design Optimization of a Self-Balancing Robot"
Design Considerations
Despite significant progress, challenges remain in the design and control of two-wheeled
self-balancing robots. Issues such as robustness in unstructured environments, energy
efficiency and human-robot interaction require further research. Future work may focus
on integrating advanced machine learning techniques to enhance adaptability and
decision-making capabilities, particularly in dynamic settings (Zhao, H., & Wang, X. [2].
"Deep Reinforcement Learning for Adaptive Control of Self-Balancing Robots."
Robotics and Autonomous Systems).
4
Chapter 3
Problem Statement
The demand for intelligent, autonomous systems is growing rapidly, particularly in fields like
transportation, industrial automation, and robotics. A key challenge in this domain is the design
and development of self-balancing robots, which are capable of maintaining stability while
performing dynamic tasks. Self-balancing robots, like two-wheeled robots or personal mobility
devices, are often used in applications where stability, precision, and adaptability are crucial.
However, achieving efficient self-balancing in real-world scenarios presents several technical
challenges.
One major problem lies in maintaining the robot’s balance while accounting for external forces,
such as uneven terrains, sudden obstacles, and varying loads. The system needs to be responsive
enough to correct its position in real-time, which requires a precise combination of sensor data
processing, control algorithms, and mechanical design. These systems typically rely on
gyroscopes, accelerometers, and advanced control techniques such as Proportional-Integral-
Derivative (PID) controllers or machine learning algorithms to maintain balance, but tuning
these systems for optimal performance is a complex task.
Moreover, the robot must be energy-efficient, cost-effective, and easily scalable for different
environments and tasks. The challenge also includes ensuring robustness and reliability in
varying environmental conditions, such as rough surfaces or outdoor operations, while keeping
the design compact and lightweight. Current balancing robots often suffer from limitations in
battery life, mechanical complexity, and high production costs, making them impractical for
widespread use.
Thus, the problem is to design and develop a self-balancing robot that can autonomously and
reliably maintain its balance in various operating conditions, navigate obstacles, and perform
tasks without sacrificing energy efficiency or affordability. This robot must integrate
sophisticated sensor fusion, real-time feedback, and control systems to solve these challenges
and serve as a platform for further innovations in autonomous robotics.
5
Chapter 4
Methodology
The design concepts between these robots are very similar. Each typically utilises a gyroscope
to measure tilt, shaft encoders to measure distance, and a microcontroller for performing the
computations. These components combine to provide the basis for maintaining stability.
Inclinometers or accelerometers are sometimes added to reduce the effects of gyroscope drift
thus enabling a more accurate input signal for the control system. The design phase of a project
is fundamental in evolving the ideas, requirements, and objectives of the components that
together, will form the completed robot. Development and careful design considerations
provide the engineer with the ability to ensure that the concept remains viable as it progresses
Mechanical Electronics
Testing And Software
Design And And Circuit
Calibration Development
Fabrication Design
Performance Final
Evalution Optimization
6
4.1 Step by Step Procedure for Design of Self Balancing Robot
1. Requirements Analysis
• Objective Definition: Clearly outline the purpose of the self-balancing robot, such as
personal transportation, educational tool, or industrial application.
• Specifications: Determine key specifications like size, weight, load capacity,
operational speed, and stability requirements.
• Constraints: Identify design constraints such as cost, power consumption,
environmental factors, and user safety.
2. Conceptual Design
• Mechanical Layout: Sketch a basic design of the robot, including the frame, wheels,
motor placement, and sensor mounting.
• Component Selection: Identify and select key components:
• Motors: Decide on motor type and torque based on the robot’s size and load.
• Sensors: Select gyroscope and accelerometer for balance sensing, and additional
sensors for obstacle detection (e.g., ultrasonic sensors).
• Power Source: Choose an appropriate battery that can provide sufficient power
for motors and sensors
3. Sensor Integration
• Sensor Placement: Strategically place sensors such as accelerometers and gyroscopes
on the robot to accurately capture motion and orientation data.
• Sensor Data Processing: Develop a system for reading sensor data and integrating it
into the control algorithms. Ensure that real-time data is processed efficiently for quick
response.
4. Control System Development
• Algorithm Selection: Implement a suitable control algorithm to manage the robot’s
balance. Common choices include:
• PID Controller: To maintain balance by adjusting motor speed based on the robot’s
tilt.
• Microcontroller Programming The Arduino IDE allows you to write and upload code to
microcontrollers such as the Arduino Uno, Nano, or Mega, which can be used to control the self-
balancing robot.
7
5. Electronics and Circuit Design
• Power Distribution: Design a power distribution system to regulate and distribute
power to motors, sensors, and controllers.
• Microcontroller Integration: Choose a suitable microcontroller (e.g., Arduino,
Raspberry Pi) for processing sensor data and running control algorithms.
• Circuit Design: Design the PCB layout and wire the electronics to connect motors,
sensors, and the microcontroller. Ensure minimal signal interference and power loss.
6. Software Development
• Control Code: Write and implement software for the microcontroller to manage real-
time sensor data processing and motor control.
• Feedback Loops: Implement real-time feedback loops to constantly monitor the
robot’s orientation and adjust motor speed accordingly.
• User Interface: (Optional) Develop a user interface for remote control or monitoring
the robot’s performance through wireless communication.
7. Mechanical Design and Fabrication
• 3D Modeling: Create detailed 3D models of the robot’s structure using CAD software
(e.g., SolidWorks, AutoCAD).
• Material Selection: Choose lightweight yet sturdy materials for constructing the frame
and body of the robot.
• Assembly: Manufacture and assemble the robot’s components, ensuring proper
alignment of motors, sensors, and the control system.
8. Testing and Calibration
• Initial Testing: Test the robot in a controlled environment, focusing on balance
stability, responsiveness, and sensor accuracy.
• Calibration: Fine-tune the sensors and control algorithms to improve balance
performance. Adjust the PID controller’s parameters as needed.
8
9. Performance Evaluation
• Evaluation Metrics: Measure key performance such as balance stability, response
time, energy consumption, and obstacle avoidance.
• Iterative Improvement: Based on test results, make necessary adjustments to the
mechanical design, control algorithm, or sensor placement.
10. Final Optimization
• Energy Efficiency: Optimize the system to reduce power consumption, particularly for
battery life extension.
• Compact Design: Refine the design to make the robot more compact and lightweight
without compromising performance.
9
4.2 Arduino Code for Stepper Motor using A4988 Stepper Driver
• The Arduino code for controlling a stepper motor using the A4988 stepper driver
typically involves sending precise step and direction signals from the Arduino to the
driver, which in turn controls the rotation of the stepper motor.
• Step Pin: Every pulse sent to this pin moves the motor one step (or microstep).
• Direction Pin: This pin controls the direction of rotation (HIGH for one direction,
LOW for the other).
10
4.3 Arduino Code for Bluetooth HC-05 to On/Off the LED
• The HC-05 can operate in master or slave mode, but it is commonly used in slave
mode for communication with a smartphone or computer.
• The module operates at 3.3V for communication but can take 5V for power.
11
4.4-Arduino Code for Stepper Motor using A4988 Stepper Driver
The Arduino code for controlling a stepper motor using the A4988 stepper driver is
designed to manage the movement of a stepper motor through the driver's STEP and DIR
(direction) pins. By sending pulse signals to the STEP pin and toggling the DIR pin, the
Arduino can control both the speed and direction of the stepper motor.
12
Chapter 5 - Design Process
13
5.1 Solidworks Model Design
Designing a balancing robot in SolidWorks involves a systematic approach, starting with
defining your project's requirements. Begin by outlining the robot's functionality what you
want it to achieve, such as maintaining balance on two wheels or navigating obstacles. Next,
establish size constraints and list essential components, including motors, wheels, sensors,
and batteries.The design process begins with sketching the base of the robot, create a
rectangular platform that will support the motors and wheels. Extrude this sketch to give it
thickness. Following the base, designing the wheels by sketching circles that match desired
diameter and extruding them into cylindrical shapes. After the wheels, move on to the
vertical frame, which will hold the motors and sensors; use extruded shapes to simulate the
structure while ensuring enough space for components.Next, model the motors by creating
parts that accurately represent their dimensions and include features for mounting. Similarly,
designing a sensor mount for the gyroscope or other balancing
sensors, .Once all individual components are created, assemble them within SolidWorks. Use
the assembly feature to insert each part and apply mates to accurately position them, ensuring
that wheels attach securely to motors and sensors are correctly oriented.After assembling, take
advantage of SolidWorks’ motion analysis tools to simulate the robot’s movement and
balance, allowing you to assess its performance before physical prototyping. Finally, generate
technical drawings for each component, which will aid in manufacturing and further
reference. Throughout the process, keep the design modular for ease of upgrades, consider
weight distribution for balance, and be prepared to iterate based on testing results.
14
5.2 Components Used for Self Balancing Robot
1.Arduino Nano - An Arduino Nano can play a crucial role in building a self-balancing robot by
acting as the brain of the system, controlling the motors, reading sensor data, and making real-time
decisions to maintain balance.
2. MPU6050 Gyro Sensor - The MPU6050 gyro sensor plays a key role
in enabling a self-balancing robot to maintain its upright position by
providing crucial real-time data about the robot's orientation and
movement. The MPU6050 integrates both a 3-axis gyroscope and a 3-
axis accelerometer.
3. A4988 Stepper Driver - The A4988 stepper motor driver is a widely-used component for
controlling stepper motors in many applications, including self-balancing robots. Stepper
motors provide precise control of rotation, making them ideal for tasks that require fine
adjustments to maintain balance.
15
4. HC-05 Bluetooth Module - The HC-05 Bluetooth module is a versatile and widely used
component that enables wireless communication between a self-balancing robot and a remote
controller (like a smartphone or another device).
5 Aluminium Wheel – The Aluminium wheel is used for our project for self balancing robot.
6 Stepper Motor - Stepper motors are a popular choice for self-balancing robots because
they offer precise control of rotational movement. This is crucial for making the fine,
incremental adjustments needed to keep the robot balanced.
16
7 150mm M5 threaded rods - The 150mm M5 threaded rods is used for our project for self balancing
robot.
8 Bracket Clamp - The bracket clamp is used for our project for self balancing robot.
17
5.3 - Bill of Material
18
Chapter 6
Result & Discussion
• When the body tilts in a forward direction then there is some angle between Y axis and
the body.
• This angle is detected by the MPU6050 gyro sensor, and then this data is sent to Arduino.
• Arduino now does PID calculation and commands the stepper motor to run in
• forward direction to minimize the tilt angle up to zero degree
• The same thing happens if the robot tilts in the backward direction, the motor will rotate
in the backward direction and correct the tilt angle to zero.
• The bot continues running the motor forward and reverses more than 400 times per
second so it looks like the robot is stable in its place.
• We have used a custom-made PCB, Arduino nano, MPU6050, A4988 driver, HC-05
Bluetooth module, MDF board, and some hardware to build this self-balancing robot.
19
Fig 1.4: Final image of Solidworks Design
Skill Required :
• PCB Manufacturing
• PCB Soldering
• 3D Designing
• Laser Cutting
• Components Purchase
• Survey
• Management Skills
• Material Cutting
20
Chapter 7
Conclusion
The project utilized the classical problem of the inverted pendulum and its application has been
extended to realize a self-balancing robot. The bot balances itself when pushed forward or
backward using this principle. The requirements, functioning, and connections of the
components have been discussed in detail.
21
Reference
• Anderson, DP, 2007, nBot Balancing Robot, viewed 20th March 2008,
http://www.geology.smu.edu/~dpa-www/robo/nbot/
• Angeles, J 2007, Fundamentals of Robotic Mechanical Systems, Springer, New
York.
22