Design and Control of Two-Wheeled Self-Balancing Robot Using Arduino

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/344586377

Design and Control of Two-wheeled Self-Balancing Robot using Arduino

Conference Paper · October 2020


DOI: 10.1109/ICOSEC49089.2020.9215421

CITATIONS READS

3 1,104

2 authors:

Yogesh Rohilla Anmol Singh Shekhawat


Indian Institute of Technology Mandi JK Lakshmipat University
9 PUBLICATIONS   13 CITATIONS    1 PUBLICATION   3 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Arduino Project View project

Arduino Project View project

All content following this page was uploaded by Yogesh Rohilla on 18 May 2021.

The user has requested enhancement of the downloaded file.


Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

Design and Control of Two-wheeled Self-Balancing


Robot using Arduino
Anmol Singh Shekhawat Yogesh Rohilla
Electrical and Electronics Engineering Electrical and Electronics Engineering
IET, JK Lakshmipat University IET, JK Lakshmipat University
Jaipur, India Jaipur, India
[email protected] 0000000276332226

Abstract—This paper discusses the design, construction, and designed to reach a specific target and to do so; they must
control of a two-wheel study level, small self-balancing robot. maintain a certain angle which is like a self-balancing
Two-wheel robots are compact and require less number of robot [3].
motors and other equipment in comparison to conventional
four-wheel robots. Consequently, they offer a complex control 3. Hoverboard: Hoverboards are almost the same as
system problem of balancing on two-wheel. The system Segway, but they don't have a handle and have small
architecture comprises of Arduino Nano microcontroller board, wheels. They are getting quite popular in recent years [4].
DC stepper motor, gyroscope, and accelerometer sensor. PID
controller controls it through the program written in Arduino
4. Toys: Many semi-autonomous toys are available in the
IDE. A detailed description of constituting materials in making market, which can react to gestures, voice commands,
the robot has been provided. Flow chart and closed loop control remote controller and even smartphone. These have many
diagrams have been given for understanding the controlling of inbuilt playing modes which are safe and exciting to play
the robot. A step-by-step process of connecting the hardware [5].
components has been listed, and finally, hardware assembly is This paper provides the design, construction, and control
shown. of a study-level, two-wheeled, small self-balancing robot.
Keywords—MPU-6050, stepper motor, PID controller,
Many papers have provided the design and procedure to make
Arduino Nano, self-balancing robot the self-balancing robot. Some of them used MATLAB for
simulation [6, 7]; some used fuzzy algorithm for controlling it
I. INTRODUCTION [8, 9]; some used complex mathematical modelling approach
[10]; and some used control system concepts for controlling
In today's world, we get to see Segway or Hoverboard in
the robot [11-13]. Fig. 1 shows the block diagram of the
movies, TV shows, YouTube videos and in similar video
proposed self-balancing robot. Here Arduino Nano
platforms. These devices work on the same principle that of a
microcontroller board with MPU-6050 (gyroscope +
self-balancing robot. A self-balancing robot is a robot,
accelerometer), stepper motors, and proportional-integral-
balances itself on two wheels, by constantly correcting its
derivative (PID) controller has been used to make the self-
position.
balancing robot.
In the '80s, a Japanese Professor, Kazuo Yamafuji, built
The things which make this work unique than the existing
the first model to simulate the behaviour of an inverted
literature are the detailed description of components and step
pendulum [1]. Since then, many different prototypes have
by step explanation of connections. A detailed description of
been built by many researchers. The widespread accessibility
components with the technical specification has been
of economical electronic components has made it a fascinating
provided which help any other interested person in making the
project for makers and students.
robot. Similarly, working and construction are given in a step
A self-balancing robot is an inverted pendulum. In the case by step manner for easy understanding.
of an ordinary pendulum, it just swings around a point (centre)
The paper arrangement is as follows: after the introduction
as it has a centre of gravity (COG) below the centre point
section, the paper provides detailed descriptions of the
which is the centre of the circle. When it comes to a self-
components in section II. Sections III discusses the robot's
balancing robot, it has COG above the centre point, which
makes it unstable. By balancing this unstable inverted
pendulum, a self-balancing robot is made. By minimising the
amplitude of this inverted pendulum, a very stable self-
balancing robot can be made which can stand still.
Inverted pendulum based devices can be used in many
applications, such as automated transportation. Following are
the applications of a self-balancing robot:
1. Segway: Segway is a two-wheeled, personalised and
simple self-balancing robot. It can handle the weight of
single person suitably and used for short distance outdoor
transportation, indoor transportation, in tourism, and
medical purposes [2].
2. Rockets and missiles: Rocket and missiles are also lifted
on the principle of an inverted pendulum. They are Fig. 1. Block diagram of the self-balancing robot.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1025

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

TABLE I. PIN DESCRIPTION OF ARDUINO NANO


Type Pins Description
Power Vin, 3.3 V, Vin is used for giving supply to the
5 V, GND Arduino board, which can vary from 6 to
12 V.
5 V and 3.3 V give output voltages as
stated.
GND refers to the ground pin.
Reset RST This is reset pin in Arduino which resets
the Arduino.
Analog A0-A7 These are analog input pins. Arduino has
an inbuilt ADC (analog to digital
converter) which helps to measure the
input voltage from 0 to 5V. Arduino
doesn't have a DAC (digital to analog
converter) but it can do PWM (pulse
Fig. 2. A default Arduino IDE window. width modulation) which are locate at in
digital pins and can be used to give some
working and balancing control. Section IV lists the step by of the functions of an analog output as
step process of hardware connections. Section V concludes well.
A4(SDA), A5(SCL): These pins are used
the paper with the results. for TWI (Two-Wire Interface)
communication. (SCL: serial clock line,
II. CONSTITUTING MATERIALS SDA: serial data)
Digital D0-D13 These are digital input-output pins These
Software and hardware components have been used in Pins pins give logic high (5V) or logic low
making the proposed robot. Only one software is used which (0V). They can also be used as input logic
is Arduino IDE, and different hardware is used such as high and logic low.
Arduino Nano as the brain, stepper motor to provide the 3,5,6,9,11: These are some 8-bit PWM
output present on the board.
motion, MPU-6050 to get the orientations, and HC05 as 13: Pin 13 is for inbuilt LED.
communicating device. Explanation of these constituting Serial Rx, Tx Rx-Receiver
materials are as follows: Tx-Transmitter
These are used for serial communication.
A. Arduino IDE SPI 10 (SS), 11 Used for SPI communication. SS, MOSI,
Arduino IDE is simple to use software yet the best one to (MOSI), 12 MISO, and SCK stand for Slave Select,
(MISO) and Master out Slave in, Master in Slave out,
code, compile and upload the code in Arduino microcontroller 13 (SCK) and Serial clock.
boards. It is developed by the Arduino team [14]. One can AREF AREF To provide reference input voltage.
code on other platforms too, such as visual code studio, but
Arduino IDE is official and accepted worldwide. It is the first C. MPU-6050
one to receive all the updates of the libraries and the boards. The MPU-6050 is a motion-tracking device. Here, this
Many libraries are available which make it convenient to code sensor gets the alignment of the bot, which is further processed
in the Arduino IDE. A default window of the Arduino IDE is to take the control actions. The MPU-6050, as shown in Fig.
shown in Fig. 2. 4, constitutes a Micro-Electro-Mechanical Systems (MEMS)
B. Arduino Nano 3-axis accelerometer and a MEMS 3-axis gyroscope on a
single chip. It also has a temperature sensor inbuilt on it.
The Arduino Nano is used in this paper as the brain of the
MPU-6050 delivers accurate results and can provide hundreds
robot. This microcontroller is the smallest member of the
of measurements per second. It captures the x, y, and z
Arduino family. It is based on the ATmega328
orientation at the same time. It uses the ‫ܥʹܫ‬-bus to interact
microcontroller, which is capable for several projects. It is a
with the Arduino. Pin diagram and pin description of MPU-
͵Ͳ pin breadboard-friendly board with ʹʹ I/O pins. It can
6050 is given in Fig. 5 and TABLE II, respectively.
work as same as Arduino UNO in almost all projects, but due
to its small size, it is the perfect choice to work with. The main D. HC-05
difference between UNO and Nano is very minute. Nano has HC-05 is the Bluetooth module used to get the PID values
a different architecture than UNO and has 8 analog pins, from the Android smartphone for calibration. It is versatile,
whereas UNO has only 6 analog pins. It works with a Mini-B reliable and easy to work. HC-05 Bluetooth module has 6
USB cable instead of a power jack. An Arduino Nano is pins, and pin description is given in TABLE III.
shown in Fig. 3. Pin description of Arduino Nano is provided
in TABLE I.

Fig. 3. The Arduino Nano. Fig. 4. The MPU-6050.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1026

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

TABLE II. PIN DESCRIPTION OF MPU-6050.


Type Pins Description
Power VCC, GND VCC is 5 V input.
GND is for grounding.
Communication SDA (Serial SDA transfers data and
Data), SCL SCL provides clock pulse
(Serial Clock) for communication.
Auxiliary XDA (Auxiliary Can be used to interface
Communication Serial Data), other modules as Arduino
XCL (Auxiliary have limited SDA and Fig. 6. The stepper motor.
Serial Clock) XCL ports.
Other AD0, INT AD0 (Slave address at 0th As stated earlier, the stepper motor provides precision
bit, i.e. this is 0th number movement. It can be as precise as 0.9 degrees per half step. It
bit of a 7-bit slave address has enough torque to stabilise to the bot. Conventional DC
of the module) is used motor achieve required torque by using gears which make
when more than 1 MPU
6050 modules are used to
them slightly unsuitable for this project. DC motor has some
communicate in unnecessary motion due to gaps in gears making the bot
synchronous. unstable and also their reaction time is high. Due to these
INT is interrupt pin to reasons, the steeper motor is preferred over DC motor.
indicate that data is
available for MCU to read. F. Stepper Motor Driver (A4988)
This is a very versatile driver which can be operated up to
TABLE III. PIN DESCRIPTION OF HC-05 BLUETOOTH MODULE. 35 V with around ± 2A. This driver contains the allegro
Type Pins Description A4988 chip which works as a translator, i.e. there is no need
Power VCC, VCC is 5 V input. to provide step signals instead just need to provide step size
GND GND is for grounding. and directions. The A4988 stepper motor driver module and
Key EN It is used to toggle between data mode and
(Enable) AT (Attention) command mode. Set it high its pinout diagram are shown in Fig. 7 (a) and (b). This driver
to get into AT command mode. is capable of providing rotation to stepper motor from a full
Serial RX, TX RX is the receiver and TX is the transmitter. step to as low as one by sixteenth of a step. It contains a reset
Used for serial communication. (ܴܵܶ) and a sleep pin (ܵ‫ )ܲܮ‬which need to be shortened to
State State This pin is connected to the inbuilt LED of start the motor. To operate the motor in full-step, there is no
the module and is used as a feedback to need to connect any pin to ‫( ͳܵܯ‬micro-step), ‫ʹܵܯ‬, and ‫͵ܵܯ‬.
check the working of the module by the
microcontroller. Fractional step rotation can be provided using pins
‫ͳܵܯ‬ǡ ‫ʹܵܯ‬ǡ and ‫ ͵ܵܯ‬as per TABLE V.
E. Steppe motor
Stepper motors work as the legs of the bot providing EN VMOT
movement to it. Stepper motor provides accurate movements MS1 GND
making it much stable than traditional geared motors used in MS2 A4988 2B
projects. Stepper motor works in steps. They have multiple MS3 stepper 2A
coils groups forming pairs when they rotate. By supplying RST driver 1A
current to different pairs, the motor moves one step at a time. SLP module 1B
By providing a synchronised supply to consecutive coils, STEP VDD
precise movements can be achieved. When controlling DIR GND
through a microcontroller, stepping can be excellent means in
(a) (b)
achieving precise positioning and speed control. The stepper
motor was chosen in this paper, and its technical Fig. 7. (a) A4988 Stepper motor driver module, and (b) its pinout
specifications are given in Fig. 6 and TABLE IV, diagram.
respectively.
G. Miscellaneous
Other than the components mentioned above, some
general things which used in the making of this robot are
acrylic sheet, screws, and connecting wires. Connecting
wires are required to connect all the hardware to supply
power; acrylic sheets to make the base for all the components;
and long M5 screws to join multiple levels of the bot on
acrylic sheets.

TABLE IV. TECHNICAL SPECIFICATIONS OF STEPPER MOTOR TABLE V. ROTATION SEQUENCE INPUT IN STEPPER MOTOR
DRIVE
Specifications Value
Step Angle 1.8 deg. (full step) Resolution MS1 MS2 MS3
Full Step 0 0 0
Current 4 A (max)
Half Step 1 0 0
Resistance 2.4 ȳ
Quarter step 0 1 0
Inductance 6.5 mH
Eight step 1 1 0
Holding Torque 4.2 kg-cm
Sixteenth step 1 1 1
Fig. 5. Pin Voltage 2-18 V, 12 V (with driver)
arrangement of MPU-6050.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1027

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

III. THE SELF-BALANCING ROBOT


Block diagram of the self-balancing robot is shown in Fig.
1. The robot gets the PID values from the mobile phone using
the HC-05 Bluetooth module. Values can be put manually in
the phone using an application. The bot is then calibrated by
placing it on the horizontal surface.
After these preliminary steps, the bot comes to action. It
gets the acceleration values and gyro values, i.e. the angles.
The microcontroller processes this data applying PID to get (a)
the right amount of movement given to the motors. Based on
the data received by the controller from MPU-6050, the
controller commands the motor to run forward or reverse to
maintain the position of the robot. The robot should make Ͳι
angle with the y-axis, Fig. 8 (a). When bot body tilts in a
direction, clockwise or anti-clockwise, then there is a change
in the angle between y-axis and body, Fig. 8 (b) and (c). The
MPU-6050 gyro sensor detects this angle, and the
microcontroller initiates actions to maintain it to the desired
(b) (c)
angle. The bot can do this whole cycle for around 400 times
Fig. 8. Self-balancing positions of robot. (a) Mean position of robot,
in second to maintain a stable position at its place. (b) correction of the robot when tilted at an angle in anticlockwise side,
As stated earlier, to put the PID values in the bot, a mobile and (c) correction of the robot when tilted at an angle in clockwise side.
application is needed. Similarly, to make the Arduino respectively. ݁ሺ‫ݐ‬ሻ is the error signal which shows the
function, it needed to code. These three things, i.e., mobile difference between y-axis and the actual position of the bot.
application, PID values, and microcontroller programming,
are important and discussed in detail here. The angle set points where the bot has to maintain its
default position and PID values are fed to the Arduino using
A. PID controller the mobile application through the Bluetooth device. ‫ܭ‬௣ is the
The closed loop control system of the self-balancing robot proportional term, which multiplies with the error and
is shown in Fig. 9. The output shows the actual position of speeds-up or slows-down the response. Any change in ‫ܭ‬௣
the robot. The MPU-6050 sensor senses the actual position of makes the bot to balance at another set-point. ‫ܭ‬௜ is the
the robot. Sensor feedbacks the data to compare with the integrating parameter. This element reduces the steady-state
reference input. Reference input or the aim of the robot is to error and smoothens the motion of the bot. Being an
stay in the ͻͲι vertical position with reference to ground, as integrating factor, even a small change affects the bot very
shown in Fig. 8 (a). The comparison of output and reference much. ‫ܭ‬ௗ is the derivative term. It increases the reaction time
input provides the tilt angle. This tilt is the error which needs of the bot. Increasing it too much may make the bot unstable.
to be reduced to zero. It requires a fast controller to handle The values of PID is set with the help of Ziegler–Nichols
this task of error reduction. PID controller has been used for tuning method [15].
this purpose. PID controller sends the command to the motor
driver, and in result, it controls the motion of the stepper B. Microcontroller Programming
motors precisely. PID controller is also shown in Fig. 9, and To program the microcontroller, an open-source platform,
mathematically can be written as: known as balancingwii, was used [16]. This firmware is
based on multiwii firmware which is also an open-source
݀
‫ݑ‬ሺ‫ݐ‬ሻ ൌ ‫ܭ‬௣ ݁ሺ‫ݐ‬ሻ ൅ ‫ܭ‬௜ න ݁ሺ‫ݐ‬ሻ݀‫ ݐ‬൅ ‫ܭ‬ௗ ݁ሺ‫ݐ‬ሻ ሺͳሻ firmware but used for aerial projects, such as quadcopter. It
݀‫ݐ‬ had inbuilt compatibility to use the mobile application. A
where ‫ݑ‬ሺ‫ݐ‬ሻ is the response of the controller. ‫ܭ‬௣ , ‫ܭ‬௜ , and ‫ܭ‬ௗ flowchart explaining the function of microcontroller
are the proportional constant, integral constant, and programming is shown in Fig. 10. It can be seen in the
derivative constant respectively, which are corresponds to initiation of the flowchart; first Arduino verifies whether ‫ܥʹܫ‬
proportional, integral, and derivative controllers, communication has been established or not (this means that

Microcontroller

Differential
unit (Kd)

Reference Tilt Reference angle Proportional Control Motor Stepper Motor


input calculation (error signal) unit (Kp)
¦ commands driver (Plant)
Output
e(t) u(t)
Integral unit
(Ki)

Sensor
(gyro + accelerometer)

Fig. 9. The closed loop control system of the self-balancing robot.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1028

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

provided to the motors, accordingly. After repeating this


Start
process several times, the bot tries to be stable after some to
and fro motions.
Ensure 12C C. Mobile application
communication
establishment, i.e. MPU- An Android platform-based mobile application EZ-GUI
6050 connection. has been used to feed PID values to the microcontroller
through the Bluetooth module. The mobile application
removes the need for a laptop or computer system again and
Receive PID
values and ensure again in sending and receiving the values, set calibration
calibration point, and changing modes. This app was initially developed
for Cleanflight, Betaflight, iNav, and Multiwii, which are the
flight systems. It allowed the user to quickly change the PID
Read current values, which were very hectic when using a computer or
angles of the bot
laptop to do such things. The best part of using this app was
that it could share the required information through many
communication means, such as Bluetooth, WiFi, radio
What is the transmission, and USB. Any other compatible application can
difference between the also be used.
reference angle and
current angle?
IV. HARDWARE IMPLEMENTATION
This section discusses the hardware connections of the
Difference is Difference is self-balancing robot. A connection diagram is shown in Fig.
No difference
positive negative
11. The step by step process of connections are as follows:
Step 1. Place Arduino Nano, MPU-6050, two stepper
PID calculation PID calculation
motors and their A4988 drivers, HC-05 Bluetooth
module, LD11173 voltage regulator, 100 ݊‫ܨ‬
Forward Backward ceramic capacitor, ͳͲߤ‫ ܨ‬electrolytic capacitor, and
No
movement
movement
movement battery as shown in Fig. 11.
of bot of bot
Step 2. Make common positive bus (bus ൅‫ )݁ݒ‬and connect
Arduino ܸ௜௡ to it. Similarly, make common ground
Fig. 10. Flowchart of microcontroller programming. bus (bus ‫ )ܦܰܩ‬and connect Arduino ‫ ܦܰܩ‬to it.
Step 3. Connect ܸ‫ ܥܥ‬of MPU-6050 to positive of ͳͲߤ‫ܨ‬
it check for the availability of the gyro sensor, i.e. MPU-6050
capacitor and ܸ௢௨௧ of the voltage regulator.
is connected or not). After that, set-point is calibrated, and
Step 4. Connect MPU-6050 ‫ ܦܰܩ‬to ground bus, its ܵ‫ ܮܥ‬to
PID values are received through the Bluetooth module HC-
Ardunio ‫ܣ‬ͷ, and its ܵ‫ ܣܥ‬to Arduino ‫ܣ‬Ͷ.
05. After receiving all the values, the bot comes to action by
Step 5. Connect first motor driver ܱܷܶʹ‫ܣ‬, ܱܷܶʹ‫ܤ‬,
taking the difference between the set-point (or reference
point) and the current angles. Then calculations are ܱܷܶͳ‫ܣ‬, and ܱܷܶͳ‫ ܤ‬to first stepper motor ‫ܦ‬, ‫ܤ‬, ‫ܥ‬,
performed, and specific acceleration value and direction are and ‫ ܣ‬respectively.

Stepper motors

HC-05

Arduino Nano MPU-6050 A4988 Stepper motor driver Voltage


Capacitors
regulator

USB cable
Battery

Fig. 11. Connection diagram for the self-balancing robot.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1029

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

Fig. 12. Hardware assembly of the self-balancing robot.

Step 6. Connect first motor driver ‫ ܴܫܦ‬to Arduino ‫ʹܦ‬, its would make the learning process more exciting and mainly a
‫ ܦܰܩ‬to bus ‫ܦܰܩ‬, ܵܶ‫ ܲܧ‬to Arduino ‫͵ܦ‬, and ܸ ൅ to differentiating factor from those custom robots which uses
bus ൅‫݁ݒ‬. four wheels in these tasks.
Step 7. Connect second motor driver ܱܷܶʹ‫ܣ‬, ܱܷܶʹ‫ܤ‬,
REFERENCES
ܱܷܶͳ‫ܣ‬, and ܱܷܶͳ‫ ܤ‬to second stepper motor ‫ܦ‬, ‫ܤ‬,
‫ܥ‬, and ‫ ܣ‬respectively. Connect its ‫ ܴܫܦ‬to Arduino [1] K. Yamafuji and A. Koshiyama, "Postural and Driving Control of a
‫ܦ‬Ͷ, its ‫ ܦܰܩ‬to bus ‫ܦܰܩ‬, ܵܶ‫ ܲܧ‬to Arduino ‫͵ܦ‬, and Variable-Configuration-Type Parallel Bicycle," J. Robotics
Mechatronics, vol. 3, no. 5, pp. 365-372, 1991.
ܸ ൅ to bus ൅‫݁ݒ‬. [2] D. L. Kamen et al., "Personal mobility vehicles and methods," 2001.
Step 8. Connect HC-05 ‫ ܦܰܩ‬to bus ‫ܦܰܩ‬, ܶܺ to Arduino [3] N. J. Mathew, K. K. Rao, and N. Sivakumaran, "Swing up and
‫Ͳͳܦ‬, and ܴܺ to Arduino ‫ͳͳܦ‬. stabilization control of a rotary inverted pendulum," IFAC Proceedings
Step 9. Connect voltage regulator ܸ௜௡ to Arduino ͷܸ, HC- Volumes, vol. 46, no. 32, pp. 654-659, 2013.
05 ܸ‫ܥܥ‬, and 100 ݊‫Ͳ݊݋ܿ ܨ‬. Connect it's Ͳ to bus [4] A. Mehrvarz, M. J. Khodaei, W. Clark, and N. Jalili, "Modeling and
dynamics analysis of a beam-hoverboard self-transportation system,"
‫ܦܰܩ‬. in Dynamic Systems and Control Conference, 2018, vol. 51913, p.
Step 10. Connect 100 ݊‫ ͳ݊݋ܿ ܨ‬and ͳͲߤ‫ ݃݁݊ ܨ‬to bus ‫ܦܰܩ‬. V003T32A008: American Society of Mechanical Engineers.
Step 11. Connect Arduino Nano to the computer using a USB [5] (2020). WowWee®- MiP. Available: https://wowwee.com/mip
cable. [6] W. An and Y. Li, "Simulation and Control of a Two-wheeled Self-
Step 12. Connect battery ൅‫ ݁ݒ‬to bus ൅‫ ݁ݒ‬and battery Ȃ ‫ ݁ݒ‬to balancing Robot," in 2013 IEEE International Conference on Robotics
and Biomimetics (ROBIO), 2013, pp. 456-461: IEEE.
bus ‫ܦܰܩ‬. [7] V. Kongratana, S. Gulphanich, V. Tipsuwanporn, and P. Huantham,
Step 13. Upload code in Arduino Nano using the USB power "Servo state feedback control of the self balancing robot using matlab,"
mini. It will test all the wiring. in 2012 12th International Conference on Control, Automation and
Step 14. Test the MPU-6050, stepper motors, and HC-05. Systems, 2012, pp. 414-417: IEEE.
Send PID values through the mobile application and [8] Q. Yong, L. Yanlong, Z. Xizhe, and L. Ji, "Balance control of two-
wheeled self-balancing mobile robot based on TS fuzzy model," in
test again. Proceedings of 2011 6th International Forum on Strategic Technology,
2011, vol. 1, pp. 406-409: IEEE.
Hardware assembly of all the components is shown in Fig. [9] J. Wu and W. Zhang, "Design of fuzzy logic controller for two-wheeled
12. It contains a two-level partition. The lower one contains self-balancing robot," in Proceedings of 2011 6th international forum
the motor driver, Arduino Nano, and motors attached at the on strategic technology, 2011, vol. 2, pp. 1266-1270: IEEE.
lower side. The top one contains the battery, HC-05 [10] N. Razmjooy and M. Ramezani, "Optimal control of two-wheeled self-
Bluetooth module, and the MPU-6050 gyro sensor. The balancing robot with interval uncertainties using Chebyshev inclusion
method," Majlesi Journal of Electrical Engineering, vol. 12, no. 1, pp.
reason to place the battery at the top of the arrangement is to 13-21, 2018.
keep the center of gravity above the horizon of motors. [11] R. S. Martins and F. Nunes, "Control system for a self-balancing
robot," in 2017 4th Experiment@ International Conference (exp.
The partitions are made out of the laser cut acrylic sheets. at'17), 2017, pp. 297-302: IEEE.
These sheets are held together by the long M5 screws, nuts, [12] S. Yuan, G. Lei, and X. Bin, "Dynamic modeling and sliding mode
and bolts. All the modules are attached using double-sided controller design of a two-wheeled self-balancing robot," in 2016 IEEE
glue tapes. International Conference on Mechatronics and Automation, 2016, pp.
2437-2442: IEEE.
V. RESULT AND CONCLUSION [13] J. Qiu et al., "Two-wheeled self-balancing robot modeling and
nonlinear control," in 2017 14th International Conference on
After some testing and calibrating, the two-wheeled robot Ubiquitous Robots and Ambient Intelligence (URAI), 2017, pp. 734-
balanced itself independently. It required appropriate PID 739: IEEE.
values fed to the microcontroller and accurate measurement [14] (2020). Arduino - Software. Available:
from the gyro sensor. Using a CAD designed, laser-cut and https://www.arduino.cc/en/Main/Software
[15] J. G. Ziegler and N. B. Nichols, "Optimum settings for automatic
3D printed structure, the bot stood straight with good controllers," trans. ASME, vol. 64, no. 11, 1942.
stability. [16] Mahowik. (2020). BalancingWii. Available:
https://github.com/mahowik/BalancingWii
There are many possibilities to extend this work. In place
of a breadboard, a printed PCB can be used, which would
make it look more aesthetic. By adding more sensor and
features, this bot can be used in many places and can be a
great learning tool. For instance, standard line following
robot, obstacle avoiding robot, and maze solving robot can be
made using this self-balancing robot. These applications

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 1030

Authorized licensed use limited to: Middlesex University. Downloaded on October 20,2020 at 08:52:41 UTC from IEEE Xplore. Restrictions apply.
View publication stats

You might also like