Professional Documents
Culture Documents
EDUCATION
FACULTY OF HIGH-QUALITY TRAINING
TOPIC:
AUTONOMOUS TWO-WHEEL
BALANCING ROBOT BY USING PID
Major: Advanced Automatic Control System
Lecturer: Nguyen Minh Tam
1
Abstract
The project develops a two-wheeled autonomous self-balancing robot that can
maintain balance in predetermined locations. Arduino, the MPU6050 board, and
the L293D DC motor control are required for the experiment. The PID controller is
responsible for determining and maintaining the robot's position. After being put
through a series of tests in which its Kp, Ki, and Kd values were varied, the robot
has been given the ability to maintain its balance without the assistance of a human
being. Consequently, balancing is declared and demonstrated as proof for this
nonlinear and unstable system. By making adjustments to the output, the PID
controller reduces the error amount to its minimum possible level. MU6050 reads
the robot's current tilt and communicates that data to the PID algorithm, which
performs calculations to drive the motor and maintain the robot's upright position.
2
CHAPTER I
INTRODUCTION
I. Literature Review
The concept of an autonomous balancing robot combines the self-balancing capacity of two
human legs with the maneuverability of an automobile. This paper will gather ideas on the
balance of humanoid robots, how to coordinate, and the optimal data processing from sensors.
However, Segway's products are not inexpensive because of the pricey sensors that have been
integrated and processed with great precision and dependability. Therefore, we will determine
how to combine single, less expensive sensors, and process their signals to store clean and
accurate signals.
The paradigm is a vehicle with two parallel vertical axes. We will utilize sensors to compute the
angle of inclination of the vehicle's body, the rotational velocity of the vehicle floor around the
wheel axle, and the vertical velocity of the vehicle. With these sensors, the car can maintain its
equilibrium and move autonomously. With this design, the paradigm's center will always be in
the supporting region to maintain balance when traversing basic and challenging terrain. The
representation in figure 1.1 is a real-world example of an autonomous balancing robot.
The purpose of this project was to construct a small robot that is capable of balancing itself
without the assistance of a person. For humans to more easily see a robot, it is designed to fit on a
table that is a more modest size.
V. Project Scopes
In the earliest stages, the two-wheeled, self-balancing robot needs human assistance so it can
function properly. In addition, there are no detection sensors, which means that it cannot identify
4
subjects in front of it. It is not possible to put this product to use in a commercial or industrial
setting, hence it should only be utilized for individual research in a home setting
5
CHAPTER 2
BACKGROUND
For example, if I have a point P in space whose coordinates (a, b, c) are determined in space by
vector p = ai + bj + ck then the rotation of point P according to q is defined as:
p’ = qpq−1 (4)
where p’ is a P’s vector coordinates after rotating. And q−1 is inverse of q. Specifically, we have
the equation.
1 1 1 1−i− j−k
q ¿1= =cos θ−usin θ= (5)
q 2 2 2
In this case, the inverse equals the amount of conjugation resulting from the absolute value of the
quaternions in rotation equal to 1 [2].
b. Pitch movement
Pitch is a form of movement that refers to the movement of an aircraft's nose in either the upward
or downward direction. The movement of the plane's nose around its horizontal axis is referred to
as the pitch [2]. According to figure 2.2, it is now possible for us to have a better understanding
of how Pitch moves.
7
Figure 2.2. The pitch’s movement.
c. Roll movement
A roll is a form of motion that occurs when an airplane throws one of its wings while
simultaneously flinging the other. For instance, if the airplane is rolling to the left, the left wing
will sink, while the right wing would fling outward. The roll movement occurs around the
fuselage's vertical axis [2]. The motion of movement indicated in Fig 2.3 is quite easy for us to
visualize.
d. Yaw movement
8
Figure 2.4 illustrates the movement of the yaw, which occurs when the front of an airplane
rotates to the right or left. The movement of the yaw occurs along an axis that is vertical to the
fuselage and perpendicular to it [2].
9
a. Arduino nano datasheet
Table 2: Arduino Nano Datasheet
PWM output
6
SRAM 2KB
Weighed
7 gms
10
Figure 2.6 Detailed diagrams of Arduino nano
b. ATmega328P – microcontroller
[3] Arduino nano is compatible with three 8-bit AVR microcontroller families: ATmega8,
ATmega168, and ATmega328P. This brain is capable of doing simple tasks like operating a
flashing LED light, processing the signal for a remote-controlled car, constructing a temperature-
humidity monitoring station, and presenting the data on an LCD screen, etc.
11
Figure 2.7. Microcontroller ATmega328
c. I/O Pins
12
III. L298N – DC Motor Control
13
b. L298N Module
L298N Motor Driver contains L298 Motor Driver IC, 78M05 Voltage Regulator, Resistors,
Capacitor, Power LED, and 5V jumper in an integrated circuit.
The 78M05 Voltage Regulator will only be activated when the jumper is in place. When the
power source is less than or equal to 12V, the voltage regulator will power the internal circuitry,
and the 5V pin can be utilized to power the microcontroller. When the power source is more than
12V, the jumper should not be installed, and separate 5V should be supplied through the 5V
connector to power the internal circuitry.
14
Figure 2.11 Internal circuit diagram of L298N Motor
15
DC brush motors are housed within this plastic gear motor. It can function with voltages ranging
from 3 to 6 VDC, and the rotational speed will change based on the voltage. This particular
engine type is the one that is most frequently employed for designing model robots, control
frames, boats, etc. for students to study, do research, and create.
16
Chapter 3:
HARDWARE DESIGN
I. Wiring Diagram
17
Figure 3.2 Top view of the robot.
18
Figure 3.3 Side view of the robot
19
CHAPTER 4
CONCLUSION AND FUTURE
ORIENTATION
I. Conclusion
The robot is not yet completely balanced well enough to be utilized. The robot was
not yet completely stable and required some assistance from a human.
In the future, I plan to make an effort to enhance both the frame and my
understanding of the sensor, coding, and other related topics.
For instances:
20
Reference
[1] Đỗ Triều Dương (2014): Design two-wheel self-balancing robot system. Available at:
http://tailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/brief_44464_48459_201120147
5559dotrieuduong.pdf (Accesses: 1st June, 2014)
[2] Bùi Quang Minh (2014): Quaternion and Space Rotation Method. Available at:
https://minhcly.wordpress.com/2014/01/30/quarternion-va-phep-quay-khong-gian-phan-
1/ (Accessed: 30th January, 2014)
21