Sunteți pe pagina 1din 44

IMPLEMENTAION OF PID CONTROLLER

THROUGH PHYSICAL AND MATHEMATICAL


MODELLING OF SELF BALANCING ROBOT

A PROJECT REPORT

Submitted by

SHIKHAR SHUKLA [RA1511004010248]


HARSH PUROHIT [RA1511004010276]
YOGANANDAM V [RA1511004010555]
ADITYA SINGH [RA1511004010581]

Under the guidance of


Dr.P.RADHIKA
(Asst., Professor, Department of Electronics & Communication Engineering)

in partial fulfillment for the award of the degree


of

BACHELOR OF TECHNOLOGY
in

ELECTRONICS & COMMUNICATION ENGINEERING


of

FACULTY OF ENGINEERING AND TECHNOLOGY


S.R.M. Nagar, Kattankulathur, Kancheepuram District
APRIL 2019

i
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)

BONAFIDE CERTIFICATE

Certified that this project report titled “IMPLEMENTAION OF PID


CONTROLLER THROUGH PHYSICAL AND MATHEMATICAL
MODELLING OF SELF BALANCING ROBOT ” is the bonafide
work of “ SHIKHAR SHUKLA [RA1511004010248], HARSH PURO-
HIT [RA1511004010276], YOGANANDAM V [RA1511004010555],
ADITYA SINGH [RA1511004010581], ”, who carried out the project
work under my supervision. Certified further, that to the best of my
knowledge the work reported herein does not form any other project re-
port or dissertation on the basis of which a degree or award was conferred
on an earlier occasion on this or any other candidate.

SIGNATURE SIGNATURE

Dr.P.RADHIKA Dr. T. RAMA RAO


GUIDE HEAD OF THE DEPARTMENT
Asst., Professor Dept. of Electronics & Communica-
Dept. of Electronics & Communica- tion Engineering
tion Engineering

Signature of the Internal Examiner Signature of the External Examiner


ABSTRACT

With the ever increasing crimes and terrorism, the threat to safety of peo-
ple is a grave concern. This project aims to create a multirole capable
robot which can be used in scenarios like surveillance, reconnaissance,
tactical superiority it is useful in these situations due to its small size and
compact chassis. The robot is based on the concept of the inverted pen-
dulum. Therefore the system requires active control to be stable, this is
achieved by modelling the PID controller. It consists of a chassis sup-
ported by two wheels instead of regular four wheeled rovers which re-
stricts manoeuvrability, a two wheeled system provides a much better
solution because of its compact nature. One of the main advantage of
this design is the size, its small frame can traverse much better than any
four wheeled design, giving the robot access to tiny crevices which can
be crucial in many situations. this project is mainly aimed fire safety and
mining safetly operations.
ACKNOWLEDGEMENTS

I would like to express my deepest gratitude to my guide, Mrs. P. Radhika her valu-
able guidance, consistent encouragement, personal caring, timely help and providing
us with an excellent atmosphere for doing research. All through the work, in spite of
her busy schedule, she has extended cheerful and cordial support in completing this
research work. We would all like to thank our parents for their unwaivering support in
all our endeavours and also all the professors who helped us at various different stages
throughout the completion of this project.

Authors

iv
TABLE OF CONTENTS

ABSTRACT iii

ACKNOWLEDGEMENTS iv

LIST OF TABLES vii

LIST OF FIGURES viii

ABBREVIATIONS ix

LIST OF SYMBOLS x

1 INTRODUCTION 1
1.1 Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 LITERATURE SURVEY 3
2.1 Analysis and design of TWSBV . . . . . . . . . . . . . . . . . . . 3
2.2 Self Balancing using Fuzzy logic. . . . . . . . . . . . . . . . . . . 3
2.3 Self Balancing Cart and Line Follower. . . . . . . . . . . . . . . . . 4
2.4 Lypunov and Legrange method to set kinetic model. . . . . . . . . . 4
2.5 Use of both Fuzzy logic and PID controller. . . . . . . . . . . . . . 4
2.6 Relation between rider and vehicle in TWSBV. . . . . . . . . . . . 4
2.7 Response of two wheeled system on rough terrain. . . . . . . . . . 5

3 System Design 6
3.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 System Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.1 Mathematical Modelling . . . . . . . . . . . . . . . . . . . 6
3.2.2 Motor Modelling . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.3 Closed loop feedback controller system . . . . . . . . . . . 11

v
3.2.4 Pole Placement . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.5 PID Algorithm Design . . . . . . . . . . . . . . . . . . . . 11
3.2.6 PID Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 12

4 Hardware and Software Description 13


4.1 MQ135 Gas Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2 LM 35 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . 13
4.3 L298N Motor Driver Module . . . . . . . . . . . . . . . . . . . . . 14
4.4 MPU6050 (Accelerometer and Gyroscope) . . . . . . . . . . . . . 15
4.5 Software Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.5.1 Drawing the Open-loop Root Locus . . . . . . . . . . . . . 16
4.5.2 Finding the loop gain with a lag controller . . . . . . . . . . 21

5 Result 26
5.1 Mathematical Modelling . . . . . . . . . . . . . . . . . . . . . . . 26
5.1.1 Motor Simulation . . . . . . . . . . . . . . . . . . . . . . . 26
5.1.2 PID Model . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.2 Hardware Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

6 Conclusion and Future Work 30


6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

7 References 32
LIST OF TABLES

vii
LIST OF FIGURES

1.1 Simple Inverted Pendulum . . . . . . . . . . . . . . . . . . . . . 2

3.1 Closed loop feedback system . . . . . . . . . . . . . . . . . . . . 11


3.2 General PID Algorithm . . . . . . . . . . . . . . . . . . . . . . . 12

4.1 MQ135 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 LM35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3 L298N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 MPU6050 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.5 Root locus of open loop . . . . . . . . . . . . . . . . . . . . . . . 17
4.6 Step Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.7 Compensator Design . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.8 Step Response with compensator . . . . . . . . . . . . . . . . . . 21
4.9 Root locus with compensator . . . . . . . . . . . . . . . . . . . . 22
4.10 Root locus of system . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.11 Root locus of system . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.1 Motor Simulation 1 . . . . . . . . . . . . . . . . . . . . . . . . . 26


5.2 Motor Damping . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3 System Transfer Function . . . . . . . . . . . . . . . . . . . . . . 27
5.4 PID Tuned Output . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.5 Robot Chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.6 Yaw, Pitch and Roll Data . . . . . . . . . . . . . . . . . . . . . . 29

viii
ABBREVIATIONS

TWSBV Two Wheeled Self Balancing Vehicle

DMP Digital Motion Processing

PID Proportional Integral Derivative

YPR Yaw Pitch Roll

SOPC System on Processor Chip

LQR Linear Quadrature Response

MMAR Methods and Model in Automation and Robotic

GND Ground

MEMS Micro Elctromechanical Sensors

ix
LIST OF SYMBOLS

J Innertia , Kgm
T Total Kinetic Energy , joule
Kt , Ke Electro-mechanical conversion coefficients
b Eenergy, Joule
L Inductance, Henry
R Resistance, Ohm
V Voltage, Volt
Kp Proportional Gain
Ki Integral Gain
Kd Derivative Gain
g Acceleration due to gravity
Θ Angle of Inclination, Degree

x
CHAPTER 1

INTRODUCTION

The aim of this project is to be able to create a ground based robot which can be used
for several different applications including surveillance, safety, dilevery etc. The robot
will be a TWSBV. This design concept allows far greater manouverability, agility and
its compact construction allows it to be able to traverse several different types of terrain.
Since its balanced on just two wheels instead of conventional configurations it gives the
robot great mobility.This a new technology which has several different applications in
several different and diverse fields.

1.1 Principle

The basic principle of the model is the inverted pendulum. The pendulum has its centre
of mass above its pivot point. It is unstable and without additional help will fall over. It
is usually designed as a rigid rod attached by a frictionless joint to a cart moving in one
direction. The degrees of freedom are restricted to one. . A control system is required
to balance it which can be implemented as a closed loop feedback controller. We intend
to use the PID algorithm to design the control system required to keep it in balance.
Where.

Ax , acceleration along x axis.

Ay , acceleration along y axis.

g, acceleration due to gravity.

Θ , angle of inclination.

As we can see in the figure above the pivot point of the body can only move in one
dimension i.e. it can only either fall forward or lean backwards balancing this at right
angle with respect to the ground will be our main aim. Based on this principle we will
design a self-balancing robot which will be used in surveillance based applications.
Figure 1.1: Simple Inverted Pendulum

Since this is a dynamically ustable system the design will invovle real time contin-
uous correction in the positioning of the robot in its pitch this mapping will be done
using a gyroscope which will giv us the continuous output of the Yaw, Pitch and Roll
of the robot. Due to the obvious complexity of the system this project will be aimed at
just balancing in one dimention. Improvements in the future can be done to make this
model vaiable under sevaral different terrains and environments.

2
CHAPTER 2

LITERATURE SURVEY

Most of the work done on self-balancing robots was done in the recent past. With the
introduction of products like Segway™a market was created for several applications.
The system we tend to introduce has not yet been implemented yet and hence we attempt
to lay its groundwork. Due to the extreme versatility it can have several applications
and also has the ability to be introduced into several current fields.

2.1 Analysis and design of TWSBV

[1]Muhammed Atif Imtiaz [et.al.], in thier paper described the design and mathematical
modelling of a two wheeled non-linear system. they used the legrange method and the
LQR method to design the control system and the PID controller to implement it in
hardware. They acheived a TWSBV in hardware which acieves the self balance.

2.2 Self Balancing using Fuzzy logic.

[2] Ju Fang [et.al.], proposed a self-balancing personal transportation system based on


fuzzy technology. They assumed the following constraints for their model the cornering
forces were considered negligible, the left and right wheels are analogues to each other,
the frictional forces between surface and wheels was ignored. They used fuzzy logic to
control the balancing of the robot, the formulated two error calculating functions which
could be used by the robot to self-correct to achieve stability. The position error and
change in error was calculated to change the rotating angles of the motor.
2.3 Self Balancing Cart and Line Follower.

[3]Zhenghuan [et.al.], They based it on SOPC (System on Processor Chip) technology.


They used PID controller to balance the robot and a line following system with a camera
to move the robot along fixed lines. This was done by contrast imaging between the path
and the rest of the floor. They designed a suitable algorithm. The Kp, Ki, Kd values
determine the stability.

2.4 Lypunov and Legrange method to set kinetic model.

[4]Kui Peng [et.al], presented a system to balance self-balancing robot on slopes they
used legrange method to set up the dynamic model, the Lypunov method was used to
set the kinetic model from which required equation were derived. The LQR (Linear
Quadrature Response) was used to describe its balanced state.

2.5 Use of both Fuzzy logic and PID controller.

[5] Adik S Wardoyo [et.al], the concept of using both fuzzy logic and the PID controller
to control the balancing of the robot, they proposed that the error function would be
first calculated from fuzzy logic then these function would be processed by the PID
controller this would make the reading far more accurate and the stability of the robot,
the LQR response will further trim the balancing deficiencies. This requires increased
processing power because of the additional PID loop.

2.6 Relation between rider and vehicle in TWSBV.

[6] Maciej CiÄŁÄłkowski [et.al.] presented the relation between the rider and the
TWSBV (two wheeled self-balancing vehicle) in this case of the inverted pendulum
there needed to be two degrees of freedom to make sure that the vehicle moves accord-
ing to the user, the torque was calculates according to the orientation of the users ankle

4
joint. The tilt induced by the user supplied the information for the PID loop and con-
trolled the torque that the motor supplies to the wheels. This in turn is used to steer the
vehicle.

2.7 Response of two wheeled system on rough terrain.

[7] Wu XiaoTan [et.al.], presented the method by which the two wheeled system can
maintain stability even under rough terrain. They used the concept of stability pyramid
model, in this four points of contact and barycentre create a pyramid. Therefore due to
rough terrain there is a transfer of energy i.e. Potential energy becomes kinetic energy
which may cause the robot to lose stability this can be maintained by the rollover angle
which can be measured from the barycentre and one of the sides of the pyramid formed.
The rollover angle can hence be used to maintain stability.

5
CHAPTER 3

SYSTEM DESIGN

3.1 Methodology

To complete the project we employ the following method,

Step 1: Physical modelling of the motor is done using Simulink to determine the
required torque and power.

Step 2: Mathematical modelling of the motor’s functioning and the PID controller
is done via Simulink to improve the stability of the system.

Step 3: Construct the chassis out of durable and lightweight materials (Acrylic).

Step 4: Implement physical and mathematical model result to create working phys-
ical prototype.

Step 5: Integrate the proposed sensors according to requirements.

Step 6: Validate simulated data with actual performance of prototype.

3.2 System Design

3.2.1 Mathematical Modelling

Equations for the cart

The only equation needed from the cart is the one who sums the forces in the x direction

Fin = mc ẍ + f ẋ + Nx (3.1)

where Fi n is an applied force, mc is the mass of the cart, f is a constant of friction and
Nx is the contact force in the axis between cart and pendulum in x-direction.
Equations for the pendulum

The sum of forces in the x direction on the pendulum is

Nx = mp ẍ + mp lθ̈ cos θ − mp lθ̇2 sin θ (3.2)

where mp is the mass and l is the distance to the center of mass. Variable θ is the angle
between a vertical line and the pendulum. The sum of all forces perpendicular to the
pendulum is

Ny sin θ + Nx cos θ − mp gl sin θ = mp lθ̈ + mp ẍ cos θ (3.3)

where Ny is the force in y direction and g is the gravity constant. Summarization the
torque acting on the center of the pendulum gives the following equation

−Ny l sin θ − Nx l cos θ = Ip θ̈ (3.4)

where Ip is the moment of inertia of the pendulum.

Combining the equations

Insert equation (3.2) in (3.1) gives the following equation

Fi n = (mc + mp )ẍ + f ẋ + mp lθ̈ cos θmp lθ̇2 sin θ (3.5)

Combine equations (3.2) and (3.3)

(Ip + mp l2 )θ̈ + mp gl sin θ = −mp lẍ cos θ (3.6)

Linearising the equations

Equation (3.5) and (3.6) are necessary to get transfer functions for the position x and the
angle deviation Ψ. To compute the transfer functions the equations need to be linearised.
A proper equilibrium point would be when the pendulum is in upright position. The

7
angle will represent the deviation of the pendulum from the equilibrium. The following
approximations for small deviations will be used in the nonlinear equations (3.5) and
(3.6).
cos θ = cos (π + Ψ) ≈ −1 (3.7)

sin θ = sin (π + Ψ) ≈ −Ψ (3.8)

θ̇2 = Ψ̇2 ≈ 0 (3.9)

Linearization with (3.7), (3.8) and (3.9) in (3.5) and (3.6) leads to the following approx-
imated linear equations where Finput has been substituted for the more general control
effort uinput.
(Ip + mp l2 )Ψ̈ − mp glΨ = mp lẍ (3.10)

Uin = (mc + mp )ẍ + f ẋ − mp lΨ̇ (3.11)

Laplace transform

To obtain the transfer functions, equations (3.10) and (3.11) are transformed to the
Laplace domain, the transformation is here denoted by upper case letters.

(Ip + mp l2 )Ψ(s)s2 − mp glΨ(s) = mp lX(s)s2 (3.12)

Uin (s) = (mc + mp )X(s)s2 + f X(s)s − mp l(s)s2 (3.13)

A transfer function is a relationship between a single input and a single output,


therefore it is needed to solve X(s) from equation (3.12)

(Ip + mp l2 ) g
X(s) = [ − 2 ]Ψ(s) (3.14)
(mp l) s

8
Substitute (3.14) into (3.12) gives

I + ml2 g
(mc + mp )[ ]φ(s) − mlφ(s)s2 = U (s) (3.15)
ml s2

(Ip + mp l2 )
Uin (s) = (mc + mp ) 2 (3.16)
(mp l) − g
s2
Ψ(s)s2 + f [ (Ip(m
+mp l )
p l)
− g
s2
]Ψ(s)s − mp lΨ(s)

If equation (3.15) is rearranged we get the transfer function GP si(s) as the relation
between Ψ(s) and Uin (s) as seen in (3.16).

ml 2
Φ q
s
= 2 (3.17)
U (s) s4 + q
s − (mc +mq p )mgl s2
b(l+ml ) 3
− bmgl
q
s

[ mqp 1 ]s
Ψ(s) = 2 (3.18)
s3 + [f Ip +m
q
p1
]s2 − [ (mc +mqp )mp gl ]s − [f mqp gl ]Uin

where
q = [(mc + mp )(Ip + mp l2 )mp l2 ] (3.19)

The transfer function Gx(s) that describes the cart position X(s) looks as

(Ip +mp l2 )s2 −gmp l


q
X(s) = f (Ip +mp l2 ) (mc +mp )mp gl 2 f mp gl
Uin (s) (3.20)
s4 + q
s3 − q
s − q
s

(I+ml2 )s2 −gml


[ X(s)
U (s)
= q
]
Pc art(s) = b(I+ml2 ) 3 (M +m)mgl 2
(3.21)
bmgl
s4 + q
s − q
s − q
s

2. State-Space

The linearized conditions of movement from above can likewise be translated to


in state-space structure in the event that they are improved into a progression of first
request differential conditions. Since the conditions are direct, they would then be able

9
to be put into the standard lattice structure appeared as follows.
       
ẋ 0 1 0 0 ẋ 0
       
2
   −(I+ml )b m2 +gl2     I+ml2 
ẍ 0 I(mc +mp )+mc l2 I(mc +mp )+mc l2
0 ẍ  I(mc +mp )+mc l2 
 
  = 



  + 
  
u

φ̇ 0 0 0 1 φ̇  0 
       
−mlb mgl(M +m) ml
φ̈ 0 I(mc +mp )+mc l2 I(mc +mp )+mc l2
0 φ̈ I(mc +mp )+mc l2
(3.22)
 

     
 
1 0 0 0 ẍ 0
y=   
  +  u (3.23)
0 0 1 0 φ̇ 0
 
φ̈

The matrix has 2 rows because both the cart’s position and the pendulum’s position
are part of the output. Specifically, the cart’s position is the first element of the output
and the pendulum’s deviation from its equilibrium position is the second element of .

3.2.2 Motor Modelling

Our system deals with conversion of the mechanical domain to the electrical domain.
This involves the conversion of basic factors of each domain to the other thus by fol-
lowing the steps for conversion the following equations are formulated

d2 θ dθ d2 θ 1 dθ
J 2
= T − b ⇒ 2
= (Kt i − b ) (3.24)
dt dt dt J dt

Ldi di 1 dθ
= −Ri + V − e ⇒ = (−Ri + V − Ke ) (3.25)
dt dt L dt
These are devised using the legrangian method of classical physics in which we measure
the changes in energies. These equations helps us in modelling the requirements of the
motor and also extend the work into the PID tuning stage

10
3.2.3 Closed loop feedback controller system

In any closed loop feedback controller an error signal is detected by comparing a mea-
sured value to a set value. This removes the need for continuous operator intervention
because based of the error signal the algorithm will by itself decide the corrective mea-
sure to be taken. This correction will eliminate the error value through some corrective
measure, in this case by varying the supply to the motor hence affecting its rotation,
bringing the measurement to its original set value.

Figure 3.1: Closed loop feedback system

3.2.4 Pole Placement

To style a stable control system we’d like to use a way of design which gives us the
most stable design. we’ve chosen the pole placement methodology. Pole placement
methodology is a controller style methodology within which you establish the places of
poles on the complicated plane by setting a controller gain K.

Poles describe the behaviour of linear dynamic systems. Through use of feedback
you’re making an attempt to vary this behaviour in a method which is additionally fa-
vorable for your demand. therefore you’ll be able to design the control system poles
ought to be, then force them to be there by planning a feedback system via pole place-
ment methodology where you select a controller gain K that places the poles on their
desired locations

3.2.5 PID Algorithm Design

The PID system is a very popular method used for feedback control. It provides ex-
tremely accurate control performance and is easy to understand and implement. It pro-

11
vides stable outputs several dynamic criteria and processes. The PID algorithm is al-
most self-explanatory. It consists of three modes which are Proportional mode, Integral
mode and Derivative mode. The first step in its design involves the selection of which
modes will be used (P, I or D). Then the configuration is selected, generally it is P, PI or
PID. Our implementation involves the use of P and D modes i.e. PD. The next step in
the design involves the selection of the controller parameters for each node. These are
used to maintain the measurement to a desired value.

Figure 3.2: General PID Algorithm

3.2.6 PID Algorithm

Like any control system first we have to implement a transfer function. The transfer
function for the PID control loop is as given below

Ki
U (s) = (Kp + + Kd s)E(s) (3.26)
s

U (s) Ki
= (Kp + + Kd s) (3.27)
E(s) s

(Kd s2 + Kp s + Ki )
= (3.28)
s
Where Kp is proportional gain, Ki is integral gain and Kd is derivative gain.

12
CHAPTER 4

HARDWARE AND SOFTWARE DESCRIPTION

4.1 MQ135 Gas Sensor

Sensors of the MQ arrangement are utilized for distinguishing gases and their focuses
in the environment around them. MQ arrangement of gas sensors utilize a little radiator
inside with an electrochemical sensor. The delicate material in MQ 135 gas sensor is the
Tin Dioxide (SnO2) layer which gets diminished or oxidized by gases in the air along
these lines changing its conductivity. The adjustment in grouping of toxins noticeable
all around triggers an adjustment in conductivity. MQ 135 is touchy to gases like CO2,
sulfide, alcohols, fragrant mixes, smoke and so forth. Working Voltage of this sensor
runs between 2.5V-5V. There are four sticks on the sensor module.

Dout - Digital Output (0-5V)

Aout - Analog Output (0-5V)

GND - System ground

Vcc - used to control the sensor (2.5-5V)

MQ-135 plays out a decent recognition to smoke and other unsafe gases, particu-
larly delicate to alkali, sulfide and benzene steam. Its capacity to distinguish different
unsafe gas and lower cost settle on MQ-135 a perfect decision of various uses of gas
identification.

4.2 LM 35 Temperature sensor

LM 35 is a sensor that creates a voltage that is relative to the temperature (Celsius). It is


utilized for an exact proportion of temperature. This sensor delivers high yield voltage
than contrasted with thermocouple and may not require enhancement. It has a scale
Figure 4.1: MQ135

factor of 0.01V/C. It can gauge the temperatures in the scope of - 55C to 150C and has
low self-heating . This sensor just draws 60 miniaturized scale amperes from the supply
and creates results exact to - 0.8C-+0.8C in the range 0 to 100C. It reacts quickly, has no
impact on the medium, is exact and has an effectively molded yield alongside minimal
effort which settles on it an extraordinary decision for temperature detecting.

Figure 4.2: LM35

4.3 L298N Motor Driver Module

L298N motor driver module is utilized to intensify the control signals from a circuit
so as to drive the inductive loads, for example, transfers, solenoids, DC and stepper
engines. It has double full-connect (H-connect) drivers with high voltage and high ebb
and flow taking care of ability to drive two gadgets at the same time. It utilizes a driver
control supply of +5 to +46V, with a driver ebb and flow of 2A and 25W appraised
control. It has two power pins for every one of the scaffold drivers to power gadgets
autonomously of the information signals. The scaffold drivers can be utilized to put a
motor in 3 states, forward, invert or end state.

14
Figure 4.3: L298N

4.4 MPU6050 (Accelerometer and Gyroscope)

MPU6050 is a mix of two gadgets gyroscope (speed along every one of the three axes),
accelerometer (increasing speed along the three axes).

The MPU6050 has a 3-pivot gyroscope with Micro Electromechanical Sensors (MEMS)
to recognize the speed along every one of the three axis. At the point when a pivot hap-
pens about any of the axis, Coriolis Effect makes a flag be produced inside the MEMS.
This flag is enhanced and sifted to create a voltage corresponding to the angular rate. A
16 bit ADC flag is acquired from this flag in the wake of digitizing to test every pivot.
It quantifies the angular velocity in degree/second unit.

MPU6050 has a 3-hub accelerometer used to discover the introduction along the 3
axes. It has a versatile mass (moving plate) which gets diverted because of speeding up
along the axis causing an awkwardness in the differential capacitance circuit bringing
about yield relative to the increasing speed. This flag is digitized and changed over to a
16-bit ADC flag. The units are estimated in g (increasing speed because of gravity).

Figure 4.4: MPU6050

15
4.5 Software Model

4.5.1 Drawing the Open-loop Root Locus

The principle thought of root locus configuration is to foresee the shut circle reaction
from the root locus plot which delineates conceivable shut circle post areas and is drawn
from the open-circle exchange work. At that point by including zeros as well as posts
by means of the controller, the root locus can be adjusted so as to accomplish an ideal
shut circle reaction.

We utilized for our plan the Control System Designer graphical UI. This instrument
enables you to graphically tune the controller by means of the root locus plot.First
make the root locus for the uncompenstated plant. This is cultivated by including the
direction controlSystemDesigner (0 rlocus0 , Pm otor) as far as possible of your plan and
running the record at the order line or by heading off to the applications tab of the matlab
toolstrip and on the application symbol leveled out System Analysis and Design.

One window titled Control System Designer will open at first having the structure
appeared in the fig 4.5. In the window, you will almost certainly observe both the
root locus plot and the shut circle step reaction of the exchange work passed by means
of the controlSystemDesigner work. On the off chance that the string ’rlocus’ is over-
looked from the capacity call, the default beginning window incorporates the Bode plot,
notwithstanding the root locus plot and closed loop step reaction plot. You can orches-
trate the situation of plots from the VIEW tab of the Control System Designer window.
Right-tapping on the root locus plot and choosing Grid will influence your window to
show up as pursues.

Finding the loop gain

Review that our structural necessities determine that the settling time be under 2 sec-
onds and that the overshoot be under 5 percent . The area of the framework’s closed
loop shafts give data with respect to the framework’s transient reaction. The Control
System Designer enables you to determine the area in the intricate s-plane relating to

16
explicit structure prerequisites. The gave areas compare to a sanctioned second-request
framework, however by and large are a decent spot to begin from notwithstanding for
higher-request frameworks with zeros.

These ideal areas can be added to the root locus plot by right-tapping on the plot
and picking Design Requirements new from the subsequent menu.Settling time, Per-
cent overshoot, Damping proportion, Natural recurrence, and nonexclusive Region lim-
itation were the structure components that were incorporated.

Including our settling time and percent overshoot prerequisites to the root locus plot
delivers the yield appeared in fig 4.5.

Figure 4.5: Root locus of open loop

The subsequent wanted district for the closed loop shafts is appeared by the un-

17
shaded area of the above figure. All the more explicitly, the two beams focused at the
source speak to the overshoot necessity; the littler the point these beams make with
the negative genuine pivot, the less overshoot is permitted. The vertical line at s = −2
speaks to the settling time necessity, where the more remote to left the closed loop posts
are found the littler the settling time is. From examination of the above figure, there are
estimations of the circle gain that will put both closed loop shafts in the ideal locale.
This can be seen from the way that the two parts of the root locus are symmetric and
go through the unshaded locale. Besides, since the shut circle framework has two posts
without any zeros, putting the closed loop shafts in the indicated locale will ensure
fulfillment of our transient reaction necessities.

You can choose a particular pair of shut circle shafts from the subsequent figure so as
to decide the relating circle gain that puts the posts at that area. For our framework, we
should put the closed loop poles with the goal that they are situated on the vertical parts
of the root-locus between the genuine hub and the limit of the overshoot prerequisite.
The pink boxes on the root locus show the area of the closed loop posts for the present
loop gain. Tapping on the pink boxes and hauling them along the root locus to the ideal
area naturally adjusts the controller to put the closed loop shafts at the demonstrated
position. Give us a chance to drag a shut circle post to an area close - 6 + 2i. The post
area will be demonstrated at the base of the window alongside the relating damping
proportion and common recurrence. We can likewise check the relating circle gain in
the lower left corner by tapping on C in the Controllers and Fixed Blocks tab. The circle
gain, as should be obvious in the figure, is roughly 10.

We check the closed loop step reaction for the framework with this new increase
by moving to the IOTransferr2y: step tab. Accordingly, another window titled New
Step to plot will show up. From the Select Responses to Plot menu, at that point pick
IOTransferr2y and snap the catch Plot. The reaction of the yield y of the shut circle
framework for a stage reference r will at that point show up in the Control System
Designer window.Some qualities of the progression reaction were recognized. In par-
ticular, right-click on the figure and under Characteristics pick Settling Time. At that
point rehash for Steady State. Your figure will show up as appeared in fig 4.6

By graphically moving the closed loop shafts vertically upward along the root locus,

18
Figure 4.6: Step Response

19
this compares to expanding the loop gain. The progression reaction plot will change
naturally to mirror the altered loop gain. we have to add a slack controller to decrease
the consistent state mistake prerequisite while as yet fulfilling the transient necessities
and including a slack controller in the above it was seen that the overshoot and settling
time criteria were met with the relative controller, however the relentless state mistake
necessity was definitely not. A slack compensator is one sort of controller known to
have the capacity to lessen consistent state blunder. In any case, we should be cautious
in our plan to not build the settling time excessively.

We can utilize the Control System Designer to plan our slack compensator. To make
the Control System Designer have a compensator parameterization relating to the one
appeared, click on the Preferences menu at the highest point of the Control System
Designer window. Select a Zero/shaft/gain parameterization as appeared in fig 4.7.

Figure 4.7: Compensator Design

20
4.5.2 Finding the loop gain with a lag controller

The root locus currently changes to mirror the expansion of the shaft and zero from
the slack compensator as appeared in the figure fig 4.8. We can again pick closed loop
poles areas to accomplish our ideal transient requirements.By setting two of the closed
loop posts in our ideal locale close to the limit of the overshoot prerequisite. A loop
addition of roughly 20 (set in the Compensator Editor) will put the posts at the positions
appeared in the figure Fig 4.9.

Figure 4.8: Step Response with compensator

The corresponding closed-loop step response will then update to match the figure
shown in Fig 4.10.

The reaction was not exactly agreeable despite the fact that two of the close dloop

21
Figure 4.9: Root locus with compensator

22
poles were set in the ideal sopts. The purpose behind this was on the grounds that the
closed loop framework never again has the type of a standard second-request frame-
work. In particular, there is a third pole on the genuine hub demonstrated in the root
locus plot over that is outside of the ideal area. The way that this third post is to one side
of the two conjugate shafts put above implies that it will back the framework reaction
off, that is the reason the settling time prerequisite is never again met. Moreover, the
overshoot necessity is met effectively despite the fact that the two conjugate poles are
close to the edge of the permitted area. This is expected again to the third pole which
is very much damped and will in general command the reaction since it is "slower"
than different poles. This means we can additionally build the circle increase with the
end goal that the conjugate posts move past the inclining lines while as yet meeting the
overshoot prerequisite.

Coming back to the root locus plot and graphically moving the conjugate posts
more distant far from the genuine pivot; this relates to expanding the circle gain. As
you move the closed loop poles an adequate separation, the breaking points of the plot
should refresh naturally. Then again, you can change the cutoff points physically by
right-tapping on the root locus and choosing Properties to open the Property Editor. At
that point you can tap on the Limits tab and change the fanciful hub cutoff points to
[-15,15], for instance, as appeared in Fig 4.11.

Presently the settling time is under 2 seconds and the relentless state blunder and
overshoot prerequisites are still met. the root locus configuration process requires some
experimentation. The Control System Designer is useful in this procedure. Utilizing
the Control System Designer, it is anything but difficult to tune your controller and
quickly observe the impact on the root locus and different examination plots, similar to
the closed loop step response. On the off chance that we had not had the capacity to get
an agreeable reaction by tuning the loop gain, we could have had a go at moving the
post and zero of the slack compensator or we could have attempted an alternate kind of
unique compensator (extra shafts or potentially zeros).

23
Figure 4.10: Root locus of system

24
Figure 4.11: Root locus of system

25
CHAPTER 5

RESULT

5.1 Mathematical Modelling

The system was first designed from the mathematical equations which were derived.
This was simulated on simulink. The first step involved the design for the motor re-
quirements which were derived as follows

5.1.1 Motor Simulation

From the equations we determined the required output that we will need from the motor.
As we know in essence a motor is nothing but a combination of Inductances, Resistive
and Capcitive circuit. So therefore through simulating these values we determined the
performance required for the fuctioning of the robot. Hence through the equations
we determined the damping of the motor. The damping is nothing but the opposing
force produced due to the rotation of the motor shaft. This was important to calculate
because this determines the response of the motor and its stable fuctioning. With this
the damping of the motor was obtained. As seen in figure 5.1

Figure 5.1: Motor Simulation 1


The damping must be bought to the lowest level possible and this can be done by
further simulation work after real time testing. Shown in Figure 5.2

Figure 5.2: Motor Damping

5.1.2 PID Model

To balance the the entire system we needed to find the transfer function of our system.
This was done while tuning the PID controller. to make sure that our system maintains
balance we simulated the values of Kp , Ki , Kd values to get the most stable system.
The model output we achieved is shown in figure 5.3

Figure 5.3: System Transfer Function

As we can observe from the output of the PID simulation the system takes a bit of
time and then stability is maintained continuously. This output is shown in Figure 5.4

27
Figure 5.4: PID Tuned Output

5.2 Hardware Output

Using the simulations results the hardware model was developed given below the chas-
sis developed is shown below in Figure 5.5

Figure 5.5: Robot Chassis

The sensor data was also collected to show the fuctioning of the robot as can be seen
from the acheived result. The raw data represents the change in the pitch value due to
the change in position of the robot. Graphical representation of the yaw, pitch and roll
can be seen below.

The data from the Gas and temperature sensors was also collected and the applica-
tions were tested.

28
Figure 5.6: Yaw, Pitch and Roll Data

29
CHAPTER 6

CONCLUSION AND FUTURE WORK

6.1 Conclusion

At the start of the project, through the literature survey we completed, we observed that
the projects that were implemented were mostly for non-linear systems. Our project was
based on a linear system. This helped us reduce complexity by removing the need to
implement a LQR model. As the LQR model is extremely complex and requires higher
processing power. All these factors help us in reducing complexity of our system and
increasing reliability.

As anticipated through testing of the robot it proves that due to its two wheeled de-
sign it has unmatched versitility to other vehicular systems such as four or three wheeled
system. The size of robot also gives it a big advantage in its intended application. Our
objective to use this robot in a surveillance robot was succesful. It provides the required
performance to meet the reqiurements.
6.2 Future Work

Some of the future work that can be implemented in the project is the implementaion of
artificial intelligence to make the robot completely autonomous. This can also fecilitate
the inclusion of a camera system which can be used for different types of recognition
like facial or structural. The robot can also be made modular by changing the sensor
suite that is included in the package. Due to the extreme versitility offered by the base
concept of this project it can be used in multiple different applications and configura-
tions.

The constarints with this project is the range of the robot. This is limited due to the
hardware. Also the battery performance needs to be improved, which is limited by the
budget and the battery capacity because it is the most expesive component of the robot.
The project may also need regulatory authorization before being deployed.

31
CHAPTER 7

REFERENCES

[1]. Control System Design, Analysis & Implementation of Two Wheeled Self Balanc-
ing Robot (TWSBR). 2018 IEEE 9th Annual Information Technology, Electronics and
Mobile Communication Conference (IEMCON).

[2]. 2016, Junfeng Wu, Wanying Zhangn representing The College of Automation
Harbin University of Science and Technology, at the 6th International Forum on Strate-
gic Technology.

[3]. the Department of Electronic and Electrical Engineering, WuHan Institute of


Shipbuilding Technology, at the 2014 International Conference on Image Analysis and
Signal Processing proposed a self-balancing carrier cart.

[4]. 2016, The Beijing Institute of Technology at the 10th World Congress on Intel-
ligent Control and Automation

[5]. The 2015 International Conference on Control, Automation and Robotic pre-
sented ” Implementation of fuzzy logic based TWSBV”

[6]. The 2015 20th International Conference on Methods and Models in Automation
and Robotics (MMAR) ”Reaction and compatibility of rider with TWSBV”

[7]. The School of Mechanical Engineering Shanghai Jiao Tong University at the
2017 IEEE International Conference on Robotics and Biomimetics ” Response of TWSBV
to Rough Terrains”

[8]. J. Fang, ”The Research on the Application of Fuzzy Immune PD Algorithm in


the Two Wheeled and Self Balancing Robot System,” International Journal of Control
and Automation, vol. 7, no. 10, 2014, pp.109-118.

[9]. M. Yue, W. Sun, P. Hu, ”Sliding Mode Robust Control For Two Wheeled Mo-
bile Robot With Lower Center Of Gravity” International Journal of Innovative Comput-
ing, Information, and Control vol. 7, 2011, Number2,637-646.
[10]. Z. Zhi-qiang, ”Two-wheeled self-balance vehicle based on STM32” Electronic
Design Engineering,2007,vol9, no.11,pp103-106.

[11]. T. Braunl and J. Pan,”Balancing a Two-Wheeled Autonomous Robot,” The


University of Western Australia School of Mechanical EngineeringFinalYearThesis,2003.

[12]. Y. Xu, B. Ben and K. Au , ”Dynamic mobility with single-wheel configura-


tion,” International Journal of Robotics Research, vol. 18, no.7,2009,pp.728-738.

[13]. J. F. Wu and W. Zhan, ”Design of fuzzy logic controller for two wheeled
self-balancing robot,” Strategic Technology (IFOST), 2011, pp.1266-1270.

[14]. G. Bal, E.l Bekiroħlu, Åd̄. Demirbaŧ, Äř. Colak, ”Fuzzy Logic Based
DSP Controlled Servo Position Control for Ultrasonic Motor,” Energy Conversion and
Management45,2004,3139-3135.

[15]. K. Heong AngandG. Chong,”PID Control System Analysis, Design, and Tech-
nology,” IEEE Transactions Control Systems Technology, vol.13, No.4,2005,pp.559-
576.

[16]. H. Xiong Li, L. Zhang, K. Yuan Cai, G. Chen, ”An Improved Robust Fuzzy-
PID Controller With Optimal Fuzzy Reasoning,” IEEE Transaction On System, Man,
And Cybernetics-Part B:Cybernetics, 2005, Vol35,No6,pp.1283-1294.

[17]. O. Montiel, R. SepÞlveda, P. Melin, O. Castillo, M. ÃAngel


˛ Porta, Iliana
Marlen Meza, ”Performance of a Simple Tuned Fuzzy Controller and PID Controller
on DC Motor,” Proceedings of the 2007 IEEE Symposium on Foundations of Compu-
tational Intelligence(FOCI2007),2007,pp.531-537.

[18]. www.google.com

[19]. www.wikepedia.com

[20]. www.ieeexplore.ieee.org

33

S-ar putea să vă placă și