ArticlePDF Available

DESIGN AND IMPLEMENTATION OF PID BASED TWO WHEELED SELF BALANCING MOBILE ROBOT

Authors:
  • CREC Tirupathi

Abstract and Figures

In this project is to design and implementation of PID based two wheeled self-balancing robot to solve the inclination angle problem to balance the movement of robot and to implement in real time. We are designing the code and implement an efficient self-balancing PID algorithm using the embedded controller and to implement in real time. Accelerometer is fitted on the robot to measure the angle of tilt during load imbalance .It gives a summary of the work done in the fields of mechanical design, electronics, software design, system characterization and control theory. This wide array of fields necessary for the realization of the project holds the project up as a leading example in the field of mechatronics. Here special focus will be on the modelling of the robotic system and the simulation results of various control methods required for the stabilization of the system.
Content may be subject to copyright.
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
99 | P a g e
DESIGN AND IMPLEMENTATION OF PID BASED
TWO WHEELED SELF BALANCING MOBILE
ROBOT
B.Malathi1, M.Ramchandran2
1 PG student ,Department of Electronics and Communication Engineering, SRM University, India
2 Faculty, Department of Electronics and Communication Engineering, SRM University, India
ABSTRACT
In this project is to design and implementation of PID based two wheeled self-balancing robot to solve the
inclination angle problem to balance the movement of robot and to implement in real time. We are designing
the code and implement an efficient self-balancing PID algorithm using the embedded controller and to
implement in real time. Accelerometer is fitted on the robot to measure the angle of tilt during load imbalance
.It gives a summary of the work done in the fields of mechanical design, electronics, software design, system
characterization and control theory. This wide array of fields necessary for the realization of the project holds
the project up as a leading example in the field of mechatronics. Here special focus will be on the modelling of
the robotic system and the simulation results of various control methods required for the stabilization of the
system.
Keywords- Microcontrollers, Accelerometer,PID, Android OS, Smartphone, Bluetooth
I. INTRODUCTION
The research on a two-wheel inverted pendulum, which is commonly known as the self-balancing mobile robot,
has gained momentum over the last decade in a number of robotic laboratories around the world. This is shown
by a rapid increase in the number of journal papers, research projects and theses on the subject, which have been
dealing with similar projects. The principles of operation of such a robot are also used in a commercial electric
transportation vehicle called Segway. The self-balancing mobile robot on two wheels, called Tilter, works on the
principle of an inverted pendulum. The robot is inherently unstable and without external control it would roll
around the wheels’ rotation axis and eventually fall. Driving the motors in the right direction returns the robot to
the upward position. Although the robot is inherently unstable, it has several advantages over the statically
stable multi-wheeled robots since it has only two wheels (two points touching the ground) it requires less
space; since it is based on dynamic stability (it constantly needs to correct its tilt angle to remain stable) it
exhibits improved dynamic behaviour and mobility. This additional manoeuvrability allows easy navigation on
various terrains, turning sharp corners (it can turn on the spot) and traversing small steps or curbs.
The stages in the project realization are explained in the following text. The first part deals with the mechanical
structure of the robot containing the explanation about how it differs from that of classical mobile robots.
In the second part, the selected electronic components, and the design of electrical circuits and printed circuit
boards are explained.
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
100 | P a g e
The next part gives an overview of the system modelling which was built by reference to the controller design
and the estimator design.
The last part deals with the software implemented in the robot, the computer and the cell phone.
1.1 Mechanical structure
The robot is comprised of three Plexiglas boards connected by threaded bars and separated by cylindrical
separators. The bottom board contains a motor controller board and two motors connected to the wheels by
means of a planetary gearbox. The middle board holds the control electronics and the Bluetooth communication
module. On the top board there are two gel type batteries which make the main portion of the robots mass.
Unlike classical mobile robots where the centre of gravity is placed as low as possible, here it should be placed
as high as possible. That is because distributing the larger part of the mass to the upper part of the robot
increases its moment of inertia around the wheel axis, thus slowing down its rotation. This reduces the dynamics
of the upper part in relation to the bottom part, making it easier to stabilize and control the robot. Every
component of the robot was first modelled in SolidWorks and then manufactured.
FIG.1 Prototype of the two-wheeled mobile robot Electronics
The mobile robot has three printed circuit boards, each with a different function. The first one is the main
control board which controls all the other boards. It has an FT232 chip for the USB measuring the components
of the earth’s gravity vector, from which the tilt angle can be calculated.
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
101 | P a g e
Fig.2 An exploded view of the CAD model
1.2 Background/Motivation
To make small size robot with less components.2 wheel instead of 3 or 4 wheel. Efficient improvement on two
wheeled balancing robots are based on inverted pendulum configuration by designing code and implementing a
self-balancing control algorithm using the PID controller. The proposed model implements self-balancing robot
with reduced hardware and increased power efficiency. Also the project simple two-wheeled balanced robot can
become the perfect educational and hobbyist tool to explore the electronics and programming area.
1.3 Algorithm
1.3.1 PID Controller
This project concerns the development of a mobile robot with a platform, which can be levelled using PID
controller. The main objective is to control the flatness of the platform efficiently with a low cost hardware
without limiting the strength and performance of the whole system. There are various stages that have been used
to stabilize the platform such as modelling the system, obtaining the data from sensors and determining how the
control algorithms will be implemented. V.J. Van Doren (2009) suggested a two wheeled robot to perform the
balancing and control of mobile robots. In this project the Proportional, Integral, Derivative (PID) has been
implemented to control the flatness of a mobile robot platform. PID has proven to be popular among the control
engineering community. As stated by the author of article Vance J. Van Doren (2009), “For more than 60 years
after the introduction of Proportional-Integral-Derivative controllers, remain the workhorse of industrial process
control”
1.4 Android Phone Controlled Self balancing Mobile Robot Using Bluetooth
1.4.1 Android Platform
Android devices are powerful mobile computers and they become more and more popular smart phones used
worldwide. They becomes more and more popular for software developers because of its powerful capabilities
and open architecture, also it’s based on the java programming language. Because Android uses the Java
programming language getting started with the Android API is easy; the API is open and allows easy access to
the hardware components. Android devices provide numerous communication interfaces like USB, Wi-Fi and
Bluetooth, that can be used to connect to the robot. We think it is a great platform for a robotic system control,
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
102 | P a g e
because it’s much cheaper than any other ARM-based processing unit. We use android platform because it is the
widest used in the word and runs the largest number of smartphones worldwide.
1.4.2 Connectivity and Communication
For the communication of the robot with the cell phone or a mobile we are using the Bluetooth device. The
Bluetooth device (HC-05) is attached to the robot that receives the data from the mobile and also can transmit
the data.
Bluetooth: Bluetooth is a wireless communications protocol running at 2.4 GHz, with client-server architecture,
suitable for forming personal area networks. It is designed for low power devices such as mobile phones.
Bluetooth now comes as standard on the majority of mobile phones, and desktop computers. It can be easily
fitted with a module to allow Bluetooth communication. Bluetooth is the only appropriate communications
protocol because there is no fear of getting the frequency interference. Bluetooth uses the MAC Address of the
device. The Bluetooth gives the connectivity between two devices using their MAC Address.
1.5 Design
The Android app is generally developed using JAVA language but this Android app can also be build without
knowing the Java language. This app was developed in “App Inventor” developed by MIT [8].
Fig.3 Android App Development
This app inventor is designed specifically for Non Computer Science students those who don’t know the
JAVA language. The figure shown below is the block diagram back- hand design for the application. The app
shown below has 5 buttons and all the buttons gives 5 different bytes in the output that has to be fed to the
Microcontroller to process [9]. For e.g. if we press forward button, the Bluetooth Module will give 1 byte at its
output as shown in the figure. The app consists of the option in the main screen whether to use the accelerometer
of the phone or to use the buttons to control the Robot. This app inventor brings out the revolution in the
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
103 | P a g e
Embedded Systems & Robotics. The app invented by this searches for the Bluetooth devices along with their
MAC addresses. The user just has to select the particular MAC Address.
When a particular MAC is selected, the status shown on the screen is “Connected”. Now all the buttons are
active and the app is now connected with the robot and mobile phone can control the robot.
1.5.1 System Architecture
Fig. 1 shows the overall architecture of the system, and with which components the different types of users will
interact.
Fig.4 System Architecture
1.5.2 Mobile Application
The Mobile application consists of 5 buttons viz. Right, Left, Forward, Reverse, Stop.
Fig. 4 Status- Not Connected
The above screen consists of an overlook of the app. Right now all the 5 buttons are disabled until the Bluetooth
is connected.
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
104 | P a g e
Fig.5 Status- Connected
Now since the Bluetooth of the mobile is connected to another Bluetooth Module, the status shown is
“Connected”.
II. Results & Discussion
As performance limits in mobile robotics are increasing, dynamic effects (and therefore dynamic stability) are
becoming ever more important. This project has resulted in building a working self-balancing mobile robot on
two wheels. The robot is successfully balanced and driven using a computer or a cell phone. Various control
techniques have been designed and tested.
The paper has presented the process in which the project has been carried out from the design and production of
specific parts to the integration of electronic, mechanical and software sections. Because of the need to use the
knowledge in the fields of mechanics, electronics, programming and control, this project is extremely
interdisciplinary and as such one of the most representative mechatronic problems. Further work will include
increasing the level of autonomy of the robot by adding a vision system, thus allowing the robot to avoid
obstacles. Also, by improving the components of the robot we hope to achieve higher speeds.
References
[1] R.S.Meena,VikasKumawat(2011) .Controller Design For Servo Motor Using MATLAB .In Proceeding of
National Conferences on Advances & Research in Electrical System Technology ( AREST 2011).
[2] Popescu, Cristina; Paraschiv, Nicolae; Cangea, Otilia.(2011) Comparison Between Pid And Fuzzy
Controllers Used In Mobile Robot Control annals of daaam& proceedings;jan2011, p223
[3] Kotaki, Masakazu; Yamakawa, Yuji; Yamazaki, Takanori; Kamimura, A Tuning Method for PID Controller
That Considers Changes in System Characteristics. ASHRAE Transactions. 2005, Vol. 111 Issue 2, p13-22.
10p.
[4] Braun,T.,Sutherland ,and Alistair (2002).An Experimental Platform for Researching Robot Balance.
Department of Electrical & Electronic Engineering .University of Western Australia.
International Journal of Advanced Technology in Engineering and Science www.ijates.com
Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 7550
105 | P a g e
[5] Robert L.Woods(1999).Modeling And Simulation Of Dynamic Systems.New Jersey: Prentice Hall.
[6] Nise, Norman S... Control Systems Engineering. Fifth edition 2008.
[7] D. Simon, Kalman Filtering With State Constraints: A Survey Of Linear And Nonlinear Algorithms, IET
Proceediings in Control Theory & Applications, vol. 4, no. 8, pp. 1303-1318, 2010
[8 ] V.J. VanDoren, “PID: Still the One,” Control Engineering, October 2003.Retrieved
Article
Full-text available
The Kalman filter is the minimum-variance state estimator for linear dynamic systems with Gaussian noise. Even if the noise is non-Gaussian, the Kalman filter is the best linear estimator. For nonlinear systems it is not possible, in general, to derive the optimal state estimator in closed form, but various modifications of the Kalman filter can be used to estimate the state. These modifications include the extended Kalman filter, the unscented Kalman filter, and the particle filter. Although the Kalman filter and its modifications are powerful tools for state estimation, we might have information about a system that the Kalman filter does not incorporate. For example, we may know that the states satisfy equality or inequality constraints. In this case we can modify the Kalman filter to exploit this additional information and get better filtering performance than the Kalman filter provides. This paper provides an overview of various ways to incorporate state constraints in the Kalman filter and its nonlinear modifications. If both the system and state constraints are linear, then all of these different approaches result in the same state estimate, which is the optimal constrained linear state estimate. If either the system or constraints are nonlinear, then constrained filtering is, in general, not optimal, and different approaches give different results.
Article
Successful design of control systems depends mainly on a system model to achieve accurate control performance. The complexity of thermal systems, such as an air-conditioning system, makes it extremely difficult to obtain an exact system model to improve control quality. Thus, for tuning PID controllers to complex system dynamics, most systems under control are often approximated by a first-order lag plus deadtime system. PID controller tuning always involves a trade-off between performance and robust stability. This paper describes tuning PID controllers using optimization, subject to constraints on derivatives of control input, and considering model uncertainty caused by changes in system dynamics. Graphs by which optimal PID parameters can be obtained are presented as functions of a normalized deadtime anda perturbation of system parameters. To evaluate control performance, disturbance suppression and reference tracking properties are presented and compared to those by the partial model matching method and the H∞ compensator designed for the same system. Moreover, to avoid making the control system sensitive to measurement noise, a PI controller with a relaxation filter is newly developed. It is found that there is very little difference in control performance between the PI controller and the H∞ compensator.
Article
Part 1: Theory and Methods Introduction: Spatially Explicit Landscape Simulation Models Modular Ecosystem Modeling Spatial Simulation using the SME Calibration of Large Spatial Models: A Multi-Stage, Multi-Objective Optimization Technique.- Part 2: Case Studies Habitat Changes in the Mississippi Delta: Future Scenarios and Alternatives Development and Application of the Everglades Landscape Model Spatial Modeling of Eelgrass Distribution in Great Bay, New Hampshire The Patuxent Landscape Model: Integrated Modeling of a Watershed The Fort Hood Avian Simulation Model-V: A Spatially Explicit Population Viability Model for Two Endangered Species Simulating Land Use Alternatives and Their Impacts on a Desert Tortoise Population in the Mojave Desert, California A Dynamic Model of the Spatial Spread of an Infectious Disease: The Case of Fox Rabies in Illinois Landscape Optimization: Applications of a Spatial Ecosystem Model.
Article
The applications of proportioanl-integrable-derivative (PID) controllers in industrial process control are discussed. The derivative term in a full PID controller is active only when error is changing. The deceleration provided by derivative action reduces likelihood of overshoot and hunting. The derivative action also tends to add dramatic spike or 'kick' to controller's output in case of an abrupt change in error due to new set point. The error between setpoint and process variable would also initiate thermostat's proportional action.
Controller Design For Servo Motor Using MATLAB
  • R S Meena
  • Vikaskumawat
R.S.Meena,VikasKumawat(2011).Controller Design For Servo Motor Using MATLAB.In Proceeding of National Conferences on Advances & Research in Electrical System Technology ( AREST 2011).
An Experimental Platform for Researching Robot Balance
  • T Braun
  • Alistair Sutherland
Braun,T.,Sutherland,and Alistair (2002).An Experimental Platform for Researching Robot Balance. Department of Electrical & Electronic Engineering.University of Western Australia. International Journal of Advanced Technology in Engineering and Science www.ijates.com Volume No.03, Issue No. 03, March 2015 ISSN (online): 2348 -7550