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

WOLAITA SODO UNIVERSITY

ELECTRICAL AND COMPUTER ENGINEERING


[Comparison of Integral PID and Genetic Algorithm Based PID Controller for

Stabilizing Inverted Pendulum System].

BY

Name ID Signature

1. Mohammed Sehim Eng/R/583/08 …………


2. Sisay Eshetu Eng/R/855/08 …………
3. Kulalo Kutema Eng/R/304/08 …………

Advisor Name

1. Alemneh Bzuayehu ……………………….

A Project Submitted to the Department of Electrical and Computer Engineering of


Wolita SodoUniversity [Industrial Control]

Date 29/05/2012 E.C

Wolaita Sodo, Ethiopia

i
Declaration
we, the undersigned, declare that this Project is our original work, has not been presented for a
degree in this or any other universities, and all sources of materials used for the Project have been
fully acknowledged.

_______________________ _________

Name Signature

Date of Submission: __________

This Project has been submitted for examination with my approval as a university advisor.

_____________________ __________________

Project Advisor Signature

ii
Acknowledgment
First of all, we would like to express our gratitude for GOD to help the accomplishment of this
project.
Secondly, we would like to express our gratitude and sincere thanks to our respected advisor,
“Mr. Alemneh Bzuayehu” for the guidance and support that he has provided throughout the
course of this work project. We would like to thank all our friends and instructors of Department
of Electrical and Computer engineering for their extreme help throughout our course of study at
this institute.
We would like to express gratitude to our head of Department, Electrical and Computer
Engineering “Mr. Degu Mena”.

Finally, we express our gratitude to faculty and all other members who supported us either directly
or indirectly for the completion of this project.

iii
Table of content

Table of Contents
Declaration................................................................................................................................................... ii
Acknowledgment ........................................................................................................................................ iii
Table of content .......................................................................................................................................... iv
List of Figure ............................................................................................................................................... v
List of Table ................................................................................................................................................ vi
List of acronyms ........................................................................................................................................ vii
Abstract..................................................................................................................................................... viii
Chapter One ................................................................................................................................................ 1
1 Introduction ......................................................................................................................................... 1
1.1 Back Ground of the Study .......................................................................................................... 1
1.2 Problem Statement...................................................................................................................... 5
1.3 Objective of the Study................................................................................................................. 6
1.3.1 General Objective ............................................................................................................... 6
1.3.2 Specific Objectives .............................................................................................................. 6
1.4 Methodology ................................................................................................................................ 6
1.5 Contribution of the Project ...................................................................................................... 10
1.6 Scope........................................................................................................................................... 10
1.7 Organization of the Project ...................................................................................................... 10
Chapter Two .............................................................................................................................................. 12
2 Literature Review ............................................................................................................................. 12
Chapter Three ........................................................................................................................................... 15
3 System Design and Analysis ............................................................................................................. 15
3.1 PID Controller Design .............................................................................................................. 15
3.1.1 Integral PID controller ..................................................................................................... 15
3.1.2 GA Based on PID Controller ........................................................................................... 17
Chapter Four ............................................................................................................................................. 20
4 Simulation Results and Discussion .................................................................................................. 20
4.1 Simulation Results of Inverted Pendulum Using PID Controller ........................................ 20
4.2 Simulation Result of Inverted Pendulum using FOPID Controller Based on GA .............. 22
4.3 Simulation Results of Inverted Pendulum using PID and FOPID Controller .................... 23

iv
Chapter Five .............................................................................................................................................. 24
5 Conclusion and Recommendation ................................................................................................... 24
5.1 Conclusion ................................................................................................................................. 24
5.2 Recommendations ..................................................................................................................... 24
Reference ................................................................................................................................................... 25
Appendix .................................................................................................................................................... 26

v
List of Figure
Figure 1. 1: Simple Inverted Pendulum Setup, ............................................................................................. 1
Figure 1. 2: Inverted Pendulums parametric presentation ............................................................................ 7
Figure 1. 3: Inverted Pendulums free body diagram ..................................................................................... 7
Figure 1. 4: Pendulums free body diagram. .................................................................................................. 8

Figure 3. 1: PID loop schematic. ................................................................................................................ 15


Figure 3. 2: Control strategy of two-loop PID Controller for Inverted Pendulum...................................... 16

Figure 4. 1: Block diagram of inverter pendulum using PID controller ..................................................... 20


Figure 4. 2: displacement simulation result of IP using PID controller ...................................................... 20
Figure 4. 3: angle simulation result of IP using PID controller .................................................................. 21
Figure 4. 4: block diagram of IP GA based PID controller ........................................................................ 22
Figure 4. 5: Angle Simulation Result of IP using GA based PID controller .............................................. 22
Figure 4. 6: block diagram of IP using PID and GA based PID Controller ................................................ 23
Figure 4. 7: angle of IP using PID and GA based PID controller ............................................................... 23

v
List of Table
Table 1. 1: parameters and values ................................................................................................................. 9

Table 4. 1: performance of PID controller .................................................................................................. 21


Table 4. 2: performance of PID controller .................................................................................................. 21

vi
List of acronyms
DC__ Direct Current

FOPID__ Fractional Order Proportional Integrative Derivative

FPAA__ Field Programmable Analog Array

GA__ Genetic Algorithm

IP__ Inverted Pendulum

PI__ Proportional Integrative

PID__ Proportional Integrative Derivative

PSO__ Particle Swarm Optimization

vii
Abstract
The inverted pendulum is a classical control problem, which involves developing a system to
balance a pendulum. The Dynamics of Cart Inverted Pendulum is related to many real life
applications like missile launching system, balancing systems like human walking. This is a highly
Unstable and non-linear system. This system is a under actuated system and also a non-minimum
phase system so design a Controller for Inverted Pendulum System is very complex. Generally,
PID Controllers are widely used for control applications. The performance of PID Controller can
be improved by appropriate setting of fractional integral and derivative actions. In this paper
modeling of an inverted pendulum has been done and then different controllers have been used for
stabilization of the pendulum. The design methods of integer order controllers and fractional order
controllers are given. The majority of tasks is carried out by means of the FOMCON (“Fractional
–Order Modeling and Control”) toolbox running in the MATLAB computing environment. The
simulation results prove that the proposed method can achieve high performance comparing the
integer order PID controller, as whole the fractional order PID controller is the best controller.

viii
Chapter One

1 Introduction
1.1 Back Ground of the Study
The inverted pendulum is among the most difficult systems being an inherently unstable system,
is a very common control problem, and so being one of the most important classical problems, the
control of inverted pendulum has been a project interest in the field of control engineering. Due to
its importance this is a choice of dynamic system to analyze its dynamic model and propose a
control law [1]. The aim of this case study is to stabilize the Inverted Pendulum (IP) such that the
position of the cart on the track is controlled quickly and accurately so that the pendulum is always
erected in its inverted position during such movements. Realistically, this simple mechanical
system is representative of a class of altitude control problems whose goal is to maintain the desired
vertically oriented position at all times.

The problem associated with stabilization of Inverted Pendulum is a very basic and benchmark
problem of Control System. The design of Inverted Pendulum consists of a DC motor, Cart,
Pendulum and Cart driving mechanism.

Figure 1. 1: Simple Inverted Pendulum Setup,


The nature of this system is single input and multi output system where Control voltage act as
input and the output of the system are cart position and angle. Here we have to stabilize the
1
pendulum angle to Inverted position which is a challenging work to do as the Inverted position is
a highly unstable equilibrium. The main characteristics of the system are Highly Unstable as we
have to stabilize the pendulum angle to Inverted position, it is a highly non-linear system as
because the dynamics of inverted pendulum consists non-linear terms, as the system have a pole
on its right hand it is a non-minimum phase system and the system is also under actuated because
the system have only one actuator (the DC Motor) and two degree of freedom [2].
Basic Controller Types: PID controllers use a 3 basic types or modes: P - proportional, I -
integrative and D - derivative. While proportional and integrative modes are also used as single
control modes, a derivative mode is rarely used on its own in control systems. Combinations such
as PI and PD control are very often in practical systems.
P Controller: In general it can be said that P controller cannot stabilize higher order processes. For
the 1st order processes, meaning the processes with one energy storage, a large increase in gain
can be tolerated. Proportional controller can stabilize only 1st order unstable process [3]. Changing
controller gain K can change closed loop dynamics. A large controller gain will result in control
system with:
 Smaller steady state error, i.e. better reference following
 Faster dynamics, i.e. broader signal frequency band of the closed loop system and larger
sensitivity with respect to measuring noise
 Smaller amplitude and phase margin
When P controller is used, large gain is needed to improve steady state error. Stable systems do
not have problems when large gain is used. Such systems are systems with one energy storage (1st
order capacitive systems). If constant steady state error can be accepted with such processes, than
P controller can be used. Small steady state errors can be accepted if sensor will give measured
value with error or if importance of measured value is not too great anyway.
PI Controller: PI controller will eliminate forced oscillations and steady state error resulting in
operation of on-off controller and P controller respectively [4]. However, introducing integral
mode has a negative effect on speed of the response and overall stability of the system. Thus, PI
controller will not increase the speed of response. It can be expected since PI controller does not
have means to predict what will happen with the error in near future. This problem can be solved
by introducing derivative mode which has ability to predict what will happen with the error in near
future and thus to decrease a reaction time of the controller. PI controllers are very often used in

2
industry, especially when speed of the response is not an issue. A control without D mode is used
when:
 Fast response of the system is not required
 Large disturbances and noise are present during operation of the process
 There is only one energy storage in process (capacitive or inductive)
 There are large transport delays in the system.
PID Controller: PID controller has all the necessary dynamics: fast reaction on change of the
controller input (D mode), increase in control signal to lead error towards zero (I mode) and
suitable action inside control error area to eliminate oscillations (P mode). Derivative mode
improves stability of the system and enables increase in gain K and decrease in integral time
constant Ti, which increases speed of the controller response. PID controller is used when dealing
with higher order capacitive processes (processes with more than one energy storage) when their
dynamic is not similar to the dynamics of an integrator (like in many thermal processes). PID
controller is often used in industry, but also in the control of mobile objects when stability and
precise reference following are required. Conventional autopilot is for the most part PID type
controllers.
A Proportional-Integral-Derivative controller (PID) is widely used in industrial control systems.
It’s a simple yet versatile controller. In the field of process control systems the PID controller have
proved their usefulness by providing satisfactory control but in many situations PID controllers
may not provide optimal control.

Introduction to Genetic Algorithm PID: In 1975, GA was proposed firstly by (Holland, 1976).
It is an optimization algorithm and applied to various fields, including business, science, and
engineering. Based on the survival-of the-fittest strategy proposed by Darwin, this algorithm will
eliminate unfit components to select the fittest component by Man-made fitness functions
generation by generation.

GA is stochastic global search methods based on the mechanics of natural selection and natural
genetic. They are iterative method widely used in optimization problems in general branches of
science and technology. It was first proposed by Holland in 1976. GA offer some advantages over
other search tools in the following ways (Magaji and Mustafa, 2010):

 GAs search from a population of points not a single point

3
 GAs use probabilistic transition rules not deterministic ones
 GAs work on encoding parameters set rather than the parameter set itself (except where
real-valued individuals are used)
 GAs do not require derivative information or other auxiliary knowledge; only the objective
function and the corresponding fitness levels influence the directions of the research.

FOPID Controller: Fractional order control has been applied with success in rigid robots
Subhransu Padhee, Abhinav Gautam, Yaduvir Singh, and Gagandeep Kaur (2011). In Manue F.
Silva, J. A. Tenreiro Machado and A. M. Lopes. (2003-04) fractional control is applied to Hexapod
Robot. In Manue F. Silva, J. A. Tenreiro Machado. (2006) a fractional order position/force
algorithm is proposed for legged robot and control algorithms have superior performance.
Fractional order PID controller is also used in Genetic Algorithm to tune the parameters of the
Fractional Order PID controller Subhransu Padhee, Abhinav Gautam, Yaduvir Singh, and
Gagandeep Kaur (2011).
FO-PID controllers have a number of advantages compared to the conventional PID controllers.
These include [5]: (1) more degrees of freedom (more tuning parameters), (2) better performance
with high order systems, and (3) better response in the case of non-minimum phase systems.
Various methods for tuning the parameters of FO-PID controllers have been proposed in the
literature.
They can be categorized as analytical-based [6], graphical-based [7], and optimization-based [8].
In the optimization-based approach, the controller’s parameters are computed to achieve some
predefined time domain specifications [9]. In the analytical approach, the controller’s parameters
are found by solving a system of analytical equations in order to achieve some pre-specified
frequency-domain specifications. Graphical tuning approaches are based on space plotting of the
stabilizing region where some predetermined frequency domain specifications are satisfied.
Varun Aggarwal, Meng Mao and Una-May O’Reilly discusses a low power self-tuning analog
proportional-integral-derivative controller model. By using a model-free tuning method, it
overcomes problems associated with reconfigurable analog arrays. In comparison to a self-tuning
digital PID controller, it combines the advantages of low power, no quantization noise, high
bandwidth and high speed. Prototype hardware used is a commercially available field
programmable analog array (FPAA) and Particle Swarm Optimization (PSO) as the tuning method.

4
The developed scheme is to correct the variance in measurement and shows that a self-tuned
controller can outperform a hand tuned solution and demonstrate adaptability to plant drift.
Digital PID controller: In most books on digital control one is quickly introduced to the z-
transform and the z-plane, as opposed to the s-plane, which we have used primarily for the root
locus in designing PID controllers. We have chosen not to use the z-transform here to explain
digital controls. Rather the explanation here is more practical. It explains digital controls more
directly, discusses how to implement a digital PID, and describes several phenomena to be aware
of when implementing digital control systems.

Aims of digital PID

 To show how PID control can be implemented in a digital computer program


 To deliver a template for a PID controller that you can implement yourself on the micro-
processor platform of your choice
 To consider practical constraints on digital control
 To present a quick description of pulse-width modulation

1.2 Problem Statement


The most widely the IP control issues are the conventionally handled by fixed gain proportional
(P) and proportional integral (PI) controllers. The conventional P and PI controllers are fixed gain
controllers. However, the performances of P and PI controllers are reducing under the uncertainties
of motor which include unknown disturbance on IP. It’s also sensitive to system nonlinearity.
Thus, the controller’s parameters must be continually adapted or tuned. P (Proportion action) -
Rapid response error but does not eliminate steady state error and low stability. I (Integral action)
- Eliminate steady state error but may cause overshoot easily, or even oscillation. D (Derivation
action) –Reduce the overshoot, to overcome the oscillation improve stability. Fast response of the
system is not required. Therefore, in order to overcome such problems and achieve high
performance, it is better to use the PID and fractional order PID controller to solve this problem
also analysis the controllers.

5
1.3 Objective of the Study
1.3.1 General Objective
The aim of the project is Comparison of PID and GA based on PID with FOPID Controller for
Stabilizing Inverted Pendulum System.

1.3.2 Specific Objectives


 To study the mathematical model of inverted pendulum
 To design PID controller
 To design GA based on PID controller
 To compare the PID and GAPID controller for IP using MATLAB/Simulink

1.4 Methodology
Pole placement, also known as full state feedback, is a method employed in feedback control
system theory to place the closed-loop poles of a plant in determined locations. This is desirable
because the location of the poles corresponds directly to the eigenvalues of the system, which
control the characteristics of the response of the system. This method is widely used in systems
with multiple inputs and multiple outputs.

Introduction to Inverted pendulum modelling. Characteristics of the inverted pendulum. The


inverted pendulum is known as one of the most important and classical examples of the control
theory. It is inherently unstable, non-linear and often used as an academic example. An inverted
pendulum is often formed by a cart that can move freely alongside a guide and a pendulum that
can rotate freely with the center of rotation in the cart. The only variable that can be control is the
force applied to the cart. The pendulum must be actively balance in order to remain upright. This
can be done by several different ways:

 Applying a torque at the pivot point.


 Moving the pivot point horizontally.
 Changing the rate of rotation of a mass mounted on the pendulum on an axis parallel to the
pivot axis.
 Oscillating the pivot point vertically.
A motor (in the cart) acts on the cart with a force F. This force is manipulated by the controller to
stabilize the pendulum in an upright position or in a downright position at a specified position of
the cart. A mathematical model of the system is derived below. This model is used to design a

6
stabilizing controller, namely an optimal controller. The mathematical model is based on the
following principles: The resulting non-linear model is then linearized. In this section defines the
system dynamics of Inverted Pendulum with the help of Newton’s law of motion. According to
the system dynamics the system has two degree of freedom the one is for cart movement and the
other one is for Pendulums rotational motion.

Figure 1. 2: Inverted Pendulums parametric presentation


Where:-

M- Cart mass, m- Pendulum mass, J- Moment of inertia, L- Pendulum length, b- Cart friction co-
efficient, g – Gravitational force

Figure 1. 3: Inverted Pendulums free body diagram


We are considering only horizontal forces for analysis as because the motion of the cart is linear
in nature. Thus

𝑀𝑎𝑥 = 𝐹 + 𝑁 − 𝐵, Where acceleration in Horizontal plane is denoted by 𝑎𝑋 (1.1)

N is the Horizontal reaction force and N is given by the equation

𝑚𝑑2
𝑁= (𝑋 + 𝐿 sin 𝜃) = 𝑚𝑥̈ + 𝑚𝜃̈ 𝐿 cos 𝜃 − 𝑚(𝜃̇)2 𝐿 sin 𝜃 (1.2)
𝑑𝑡 2

7
Figure 1. 4: Pendulums free body diagram.
Here vertical reaction force is defined by P and this given by weight given by the pendulum on
cart. Here 𝐿 cos 𝜃 is given by the Pendulums displacement from the pivot. So

𝑚𝑑2
𝑃 + 𝑚𝑔 = (𝑥 + 𝐿 cos 𝜃) = 𝑚𝐿𝜃̈ sin 𝜃 + 𝑚(𝜃̇)2 𝐿 cos 𝜃 (1.3)
𝑑𝑡 2

Velocity of center of mass is denoted by 𝑉𝑐𝑚𝑡 now if will taking the sum of moments we get

−𝑁𝐿 cos 𝜃 − 𝑃𝐿 sin 𝜃 = 𝐽𝜃̈ (1.4)

Now put the values of (1.2) and (1.3) in equation no (1.4) we get

𝑚𝐿𝑥̈ cos 𝜃 − (𝑚𝐿2 + 𝐽)𝜃̈ = −𝑚𝑔𝐿 sin 𝜃 (1.5)

Now if we will substitute the equation (1.2) in equation no (1.1) we get

𝑚𝐿
𝜃̈ = 𝜎 [(𝐹 − 𝑏𝑥̇ ) cos 𝜃 − 𝑚(𝜃̇)2 𝐿 cos 𝜃 sin 𝜃 + (𝑚 + 𝑀)𝑔 sin 𝜃] (1.6)

If we solve (1.5) and (1.6) and simplify we will get

1
𝑥̈ = 𝜎 [(𝐽 + 𝑚𝐿2 )(𝐹 − 𝑏𝑥̇ − 𝑚𝐿𝜃̇ 2 sin 𝜃) + 𝑚𝐿2 𝑔 sin 𝜃 cos 𝜃] (1.7)

Here 𝜎 is given by 𝜎 = 𝑚𝐿2 (𝑀 + 𝑚𝑐𝑜𝑠 2 𝜃) + 𝐽(𝑀 + 𝑚) (1.8)

Linearization of the inverted pendulum. Here in this section the description about the linearization
of the non-linear equations are given. Here we use tailors series expansion for Linearize the non-
linear equations. We have to stabilize the pendulum angle at the Inverted position so assume

𝜃=0 (1.9)
sin 𝜃 = 𝜃 (1.10)

8
cos 𝜃 = 1 (1.11)
𝐴𝑛𝑑 𝜃̇ 2 = 0

After linearizing the equations we get


𝑚𝐿
𝜃̈ = 𝜎′ [(𝐹 − 𝑏𝑥̇ ) + (𝑚 + 𝑀)𝑔𝜃] (1.12)
1
𝑥̈ = 𝜎′ [(𝐽 + 𝑚𝐿2 )(𝐹 − 𝑏𝑥̇ ) + 𝑚𝐿2 𝑔𝜃] (1.13)

Here 𝜎 ′ denoted by 𝜎 ′ = 𝑀𝑚𝐿2 + 𝐽(𝑀 + 𝑚) (1.14)


Now converting in to state space form we get

𝑍̇1 0 1 0 0 0
(𝐽+𝑚𝐿2 ) 𝑚2 𝐿2 𝑔 𝑚𝐿𝑏𝑡
𝑍1 (𝐽+𝑚𝐿2
𝑍̇2 0 − − 𝑍
𝜎′ 𝜎2 𝜎′ 𝜎′
= [ 2 ]+ (1.15)
𝑍̇3 0 0 0 1 𝑍3 0
𝑚𝐿𝑏 (𝑀+𝑚)𝑚𝑔𝐿 (𝑀+𝑚)𝑏𝑡 𝑍4 −𝑚𝐿
[𝑍̇4 ] [ 0 𝜎′ 𝜎′
− 𝜎′ ] [ 𝜎′ ]
And the output equation is given by
𝑥
1 0 0 0 𝑥̇
𝑌=[ ][ ] (1.16)
0 0 1 0 𝜃̇
𝜃̈
Now if we neglect the cart friction co-efficient then the transfer functions will be as
𝑋(𝑆) (𝐽+𝑚𝐿2 )𝑆 2 −𝑚𝑔𝐿
= 𝑆2 (𝑀𝑚𝐿2 +(𝑀+𝑚)𝐽)𝑆2 −𝑚𝑔𝐿(𝑀+𝑚) (1.17)
𝐹(𝑆)

𝜃(𝑆) 𝑚𝐿𝑠2
= 𝑠2 (𝑀𝑚𝐿2 +(𝑀+𝑚)𝐽)𝑠2 −𝑚𝑔𝐿(𝑚+𝑀) (1.18)
𝐹(𝑆)

Now we going to substituting the values on the given parameters


Table 1. 1: parameters and values

Parameters values
Mass of cart (M) 3kg
Mass of pendulum (m) 0.15kg
Moment in inertia (J) 0.054kg-m2
Length of pendulum (L) 0.2m

9
Cart friction co-efficient (b) 0.05Ns/m
Acceleration due to gravity (g) 10m/s2

𝑋(𝑆) (0.054+0.15∗(0.2)2 )𝑠2 −0.15∗10∗0.2 0.342𝑠2 −1.71


= 𝑠2 (3∗0.15∗(0.2)2 +(3+0.15)0.05)𝑠2 −0.15∗10∗0.2(3+0.15) = (1.19)
𝐹(𝑆) 𝑠4 −5.356

𝜃(𝑆) (0.15∗0.2)𝑠2 0.171𝑠2


= 𝑠2 (3∗0.15∗(0.2)2 +(3+0.15)0.05)𝑠2 −0.15∗10∗0.2(3+0.15) = 𝑠4 −5.356 (1.20)
𝐹(𝑆)

1.5 Contribution of the Project


 Integral PID controller has designed and successfully implemented only in simulation
result.
 FOPID controller has designed and successfully implemented again only in simulation
results.
 We have been the comparison results of integral PID and fractional order PID
 We proved how modeled PID and FOPID controller can by using pole placement method
 This study has no direct environmental implications. The computing power would be the
only real environmental problem and because only one computer is needed for the
simulations there is no real incentive for optimizing the code as long as this does not
change.

1.6 Scope
The scope of the project is to study and design the control system of an unstable system, in this
case an inverted pendulum. The first step will be to simulate different alternatives on a computer
with a modeled system of the reality. After that, once the simulations are stable, the control system
will be used on the real system of the inverted pendulum control system. The final goal is to be
able to stabilize the pendulum in its upright position while keeping the cart oscillating around a
desired position, to evaluate the different alternatives and to draw conclusions.

1.7 Organization of the Project


This project includes five chapter. Chapter one consists of the introduction about the project such
as back ground of the project, statements of the problem, methodology, contribution of the project
and scope of the project.

10
Chapter Two: - Literature Review: the previous proposed action about this project have been
written by different authors and their limitation parts.

Chapter Three: - System Design and Analysis: how it’s design this inverted pendulum system by
using the integral PID and fractional order PID controller and its comparison of the simulation
.output results in MATLAB

Chapter Four: Simulation Result and Discussion.

Chapter five: Conclusion and Recommendation.

11
Chapter Two

2 Literature Review
In this section, the project work proposed by several persons and accepted in the field of modeling
and stabilizing inverted pendulum using numerous control strategies is presented. Persons have
been worked out on the stabilizing of inverted pendulum using various control techniques. Some
of the techniques are the P controller method, PI controller method, PD controller method, FOP
controller method, FOPI controller method and FOPD controller

Inverted Pendulum is a very important control problem in the application areas of Control System.
The use of Inverted Pendulum take place first time in Great Britain in the year of 1844 for design
purpose of a Seismometer.

A.Hashim and O. Ahmed present PI based speed stabilizing the inverted pendulum to stable high
non stable system. However, the PI controller requires exact mathematical model to control the
system. When there are system parametric variations, the behavior of the system is unsatisfactory
and it deviates from the desired performance. Also this control method is not satisfactory because
the PI gains are selected by using trial and error.

Smriti Rao, Ravi Mishra, 2Assistant Professor SSTC Bhilai, and Chhattisgarh, India, © 2014
IJEDR: Proportional (P) Controller: A P controller system is a type of linear feedback control
system. The P controller system is more complex than on-off control systems like a bi-metallic
domestic thermostat, but simpler than a PID control system used in something like an automobile
cruise control In general it can be said that P controller can’t stabilize higher order processes.

For the 1st order processes, meaning the processes with one energy storage, a large increase in
gain can be tolerated. Proportional controller can stabilize only 1st order unstable process.
Changing controller gain K can change closed loop dynamics.

Limitations

 Smaller steady state error, i.e. better reference following


 Faster dynamics, i.e. broader signal frequency band of the closed loop system and larger
sensitivity with respect to measuring noise
 Smaller amplitude and phase margin

12
Smriti Rao, Ravi Mishra: Proportional Integral (PI) Controller: At present, the PI controller is
most widely adopted in industrial application due to its simple structure, easy to design and low
cost. Despite these advantages, the PI controller fails when the controlled object is highly nonlinear
and uncertain. PI controller will eliminate forced oscillations and steady state error resulting in
operation of on-off controller and P controller respectively. However, introducing integral mode
has a negative effect on speed of the response and overall stability of the system. Thus, PI
controller will not increase the speed of response. It can be expected since PI controller does not
have means to predict what will happen with the error in near future. This problem can be solved
by introducing derivative mode which has ability to predict what will happen with the error in near
future and thus to decrease a reaction time of the controller. PI controllers are very often used in
industry, especially when speed of the response is not an issue

Limitation

 Fast response of the system is not required


 Large disturbances and noise are present during operation of the process
 There is only one energy storage in process (capacitive or inductive)
 There are large transport delays in the system.
M Venkata Ganesh Babu1, Dr. R.Srinu Naik2 Andhra University [A], Visakhapatnam,
India: I-P controller: Integral proportional controller is advance form of proportional integral
controller. In this controller the integral part is in feed forward path and proportional part is in
feedback path.

The disadvantage in P-I controller is that high peak overshoot. To reduce that peak overshoot
considerably we can use this I-P controller.

The Proportional-Integral-Derivative (PID) controllers have been most commonly used in


automatic control systems for decades. The controller structure is simple and well understood by
process engineers. It provides feedback, can eliminate steady state sets through integral action and
anticipate the future through derivative action (Astrom and Hagglund, 1995). They are fairly robust
and versatile over a wide range of processes. In fact, over 90% of industrial controllers are of the
PID type. Today PID control is still an active research area in control community due to its
importance and the possibility for improvement. Almost all control journals including IEEE TAC

13
and Automatic continue to publish papers on PID controllers. For example, Issue 1 in Volume 26
of IEEE Control Systems Magazine, 2006, is a special issue on PID.

Turk J Elec Eng & Comp Sci (2018) 26: 2768 – 2778 © TÜBİTAK doi: 10.3906/elk-1712-183
recently, fractional-order modeling has attracted the attention of researchers and developers in the
field of control system design. It has been shown that fractional-order differential equations can
describe the behavior of many real-life dynamical systems better than their integer-order
counterparts [10]. Using fractional order modeling, a generalized version of the classical PID
controllers, known as fractional-order PID (FO-PID), was proposed [11]. Various methods for
tuning the parameters of FO-PID controllers have been proposed in the literature.

They can be categorized as analytical-based, graphical-based, and optimization-based. In the


optimization-based approach, the controller’s parameters are computed to achieve some
predefined time domain specifications [12]. In the analytical approach, the controller’s parameters
are found by solving a system of analytical equations in order to achieve some pre specified
frequency-domain specifications. Graphical tuning approaches are based on space plotting of the
stabilizing region where some predetermined frequency domain specifications are satisfied.

To modify previous worked project by PI, PD, by PID controller for stabilizing inverted pendulum
system by modifying settling time, pick time, rise time, overshoot, and by reducing steady state
error . PID controller has all the necessary dynamics: fast reaction on change of the controller input
(D mode), increase in control signal to lead error towards zero (I mode) and suitable action inside
control error area to eliminate oscillations (P mode). Derivative mode improves stability of the
system and enables increase in gain K and decrease in integral time constant Ti, which increases
speed of the controller response. PID controller is used when dealing with higher order capacitive
processes (processes with more than one energy storage) when their dynamic is not similar to the
dynamics of an integrator (like in many thermal processes).

14
Chapter Three

3 System Design and Analysis


3.1 PID Controller Design
A PID controller is a control loop feedback mechanism widely used in industrial control systems.
A PID controller continuously calculates an error value as the difference between a desired
reference and a measured process variable and applies a correction based on its proportional,
integral and derivative terms. The controller attempts to minimize the error over time by
adjustment of a control variable to a new value determined by a weighted sum of the control terms.
The response of the proportional term is proportional to the error and if there is no error, there is
no proportional response.

3.1.1 Integral PID controller


The integral term accounts for past values and integrates them over time. When the error becomes
zero, the integral term will cease to grow.
The derivative term is an estimate of the future trend of the error based on its current rate of change.
This means that the derivative term alone cannot bring the error down to zero. This is why it is
also called anticipatory control. Implementations of controllers that include a derivative action
tend to also include a low-pass filtering for the derivative term to limit high-frequency gain and
noise.

Figure 3. 1: PID loop schematic.

15
The control signal u is entirely based on the error generated e. The command input r is also called
the set-point weighting in process control literature. The mathematical representation of the control
action is

Figure 3. 2: Control strategy of two-loop PID Controller for Inverted Pendulum.

Here C1 and C2 are the PID Controllers. One is displacement controller and another one is angle
controller. P1 and P2 are the Plant transfer functions. We give angle reference as zero as we have
to stabilize the Pendulum angle to Zero.
Now if we simplify the block diagram then we get characteristic equation as

1 − p1 c1 + p2 c2 (3.1)

5.841 kd1 s2 +kp1 s2 +ki1 5.841


1− ( ) + (𝑠2 −6.76) (kd1 s2 + kp2 s 2 + ki2 ) = 0 (3.2)
𝑠2 s

Now from the desired pole location we get the characteristic equation as

𝑠 4 + 10𝑠 3 + 35𝑠 2 + 50𝑠 + 24 = 0 (3.3)

Here we have six unknown and five equations. Thus we assume Kd2 as 10.
After Comparing equation (3.2) and (3.3) we get the PID gain values as follows.
C1:- Kp1 = 43.3, Ki1 = 33.796, Kd1 = 2.254 And

C2:- Kp2 = 120.9, Ki2 = 247.43, Kd2 = 10

16
3.1.2 GA Based on PID Controller
 Initialization: In the initialization, the first thing to do is to decide the coding structure.
Coding for a solution, termed a chromosome in GA literature, is usually described as string
of symbols from {0, 1}. These components of the chromosome are then labeled as genes.
The number of bits that must be used to describe the parameters is problem dependent.
 Selection: GA uses proportional selection; the population of next generation is determined
by independent random experiments.
 Crossover: Cross over is an important random operator in GA and the function of this
operator is to generate a new ‘child ‘chromosome from two ‘parents ‘chromosomes by
combining the information extracted from the parents.
 Mutation: Mutation is another important component in GA, though it is usually conceived
as a background operator. It operates independently on each individual by probabilistically
perturbing each bit string. A usual way of mutation used in GA is to generate a random
number between zero and one and then make a random change in the v-the element of the
string with probability belonging to (0, 1).
 Encoding & Decoding: The design variables are mapped onto a fixed-length binary digit
string, which are constructed over the binary alphabet {0, 1}, and is concatenated head-to-
tail to form one long string referred as a chromosome. That is, every string contains all
design variables. The physical values of the design variables are obtained by decoding the
string.
 Fitness Function: In GA, the value of fitness represents the performance, which is used to
rank the string, and the ranking is used to determine how to allocate reproductive
opportunities. This means that individuals with higher fitness value will have higher
probability of selection as a parent. Fitness thus is some measure of goodness to be
optimized. The fitness function is essentially the objective function for the problem.

The process begins with a set of solutions. This process is initialization and then followed by
selection which means choosing random solutions. There are two methods for initialize the
population and they are random initialization and heuristic initialization. The diversity of the
population should be maintained. The population size should not be very large. Therefore, an
optimal population size needs to be decided. Parent solutions are selected to form new offspring.
This process will stop when a stopping criterion is reached [11]. The terminating conditions are;

17
 A solution is found which satisfies minimum criteria
 Fixed number of generations reached
 Allocated budget reached
 Manual inspection

FOPID Controller Design. The differential equation of fractional order controller 𝑃𝐼 𝛼 𝐷𝛽 is


described by [2]:
𝑈(𝑡) = 𝐾𝑃 𝑒(𝑡) + 𝐾𝑖 𝐷𝑡 −𝛾 𝑒(𝑡) + 𝐾𝑑 𝐷𝑡 𝛿 𝑒(𝑡) (3.4)

The continuous transfer function of FOPID is obtained through Laplace transform, which is given
by:

𝑈(𝑡) = 𝐾𝑃 𝑒(𝑡) + 𝐾𝑖 𝐷𝑡 −𝛾 𝑒(𝑡) + 𝐾𝑑 𝐷𝑡 𝛿 𝑒(𝑡) (3.5)

Here in this section, two cases of fractional order controller is discussed. The first one is fractional
order PID controller (FOPID) design without considering the damping of the system and the
second one is fractional order PID controller design with considering the damping of the system.

The integer order PID controller (IOPID) has the transfer function as,

𝑘𝑖
𝐶(𝑆)𝑃𝑖𝑑 = 𝑘𝑃 + + 𝑘𝑑 𝑠 (3.6)
𝑠

And the fractional order PID controller (FOPID) has the transfer function as,

𝑘
𝐶(𝑆)𝑓𝑜𝑝𝑖𝑑 = 𝑘𝑝 + 𝑠𝛼𝑖 + 𝑘𝑑 𝑠 𝛽 (3.7)

Where, 0 < 𝛼 < 1, 𝑎𝑛𝑑 0 < 𝛽 < 1

Including integer order PID controller (IOPID), three cases are presented here for designing of
controllers and there comparison is also shown in this section.

 Integral PID controller (IOPID).


 Fractional PID (FOPID) controller.

SET block indicates the desired points at which the system get to stable. Disturbance is the external
input which can be applied either on cart or on pendulum. The controller will react with the input
and the feedback and control the POAC system.

18
Clearly in equation (1.23), selecting𝛼 = 𝛽 = 1, a classical PID controller can be obtained. The
options of𝛼 = 1, 𝛽 = 0, 𝛼 = 0, 𝛽 = 1, respectively corresponds to traditional PI and PD
controllers.
Traditional (classical) PID controller are the special type of the fractional 𝑃𝐼 𝛼 𝐷𝛽 controller and
expected that the controller 𝑃𝐼 𝛼 𝐷𝛽 may enhance the systems control performance J.Samardzic,
M.P.Lazarevic, B. Cvetkovic (2011). Since this kind of controller has five parameters to tune
(𝑘𝑝 , 𝑘𝑑 , 𝑘𝑖 , 𝛼, 𝛽), up to five design specifications for the controlled system can be met, this is, two
more than in the case of a traditional PID controller, where 𝛼 = 1 𝑎𝑛𝑑 𝛽 = 1. It is essential to
study which specifications are more interesting as far as performance and robustness are
concerned. All these constraints will be taken into account in the tuning technique in order to take
advantage of the introduction of the fractional orders C. A. Monje, YangQuan Chen, B. M.
Vinagre, Dingy Xue, Vicente Feliu. (2010).The aim of this system is to make the cart position and
pendulum angle to be stable at desired (set) points.

19
Chapter Four

4 Simulation Results and Discussion

4.1 Simulation Results of Inverted Pendulum Using PID Controller

Figure 4. 1: Block diagram of inverter pendulum using PID controller

Figure 4. 2: displacement simulation result of IP using PID controller

20
Table 4. 1: performance of PID controller

Controller PID

Peak overshoot (%) 81.944

Rising time (sec) 157.308m

Settling time(sec) 0.02

Under shoot (%) 95.833

Figure 4. 3: angle simulation result of IP using PID controller


Table 4. 2: performance of PID controller

Controller PID

Peak overshoot (%) 53.077

Rising time (sec) 235.716m

Settling time(sec) 0.02

Under shoot (%) -5.663

21
4.2 Simulation Result of Inverted Pendulum using FOPID Controller Based
on GA

Figure 4. 4: block diagram of IP GA based PID controller

Figure 4. 5: Angle Simulation Result of IP using GA based PID controller

22
4.3 Simulation Results of Inverted Pendulum using PID and FOPID
Controller

Figure 4. 6: block diagram of IP using PID and GA based PID Controller

Figure 4. 7: angle of IP using PID and GA based PID controller

23
Chapter Five

5 Conclusion and Recommendation


5.1 Conclusion
In this paper, PID and Genetic Algorithm based PID controller are successfully designed for
Inverted Pendulum system. Based on the results, both controllers are capable of controlling the
inverted pendulum’s angles and the cart position of the linearized system. However, the simulation
result shows that Genetic Algorithm based PID controller has a better performance as compared
to the PID controller in controlling the Inverted Pendulum system. Parameters adjustment at
different problems takes more time up by hard mathematical calculating. At this paper was tried
one simple application from algorithm "GA" considered by control engineering problem. We can
find the optimal answer with "GA" algorithm. This answer should be careful and simple rarely
acceptable.

5.2 Recommendations
The project is boundless. At the end of this study many points could be taken as recommended
future works.

The work done in this project Genetic Algorithm based (GA) optimization method is applied to
determine the optimized parameters of the PID controller, but there are other optimization methods
like Particle Swarm Optimization (PSO) and Sequential Quadratic Programing (SQP) those may
increase the performance of controllers and linearized inverter pendulum using intelligent
controller (Fuzzy logic, neural network and fuzzy logic neural network) also the project extended
for hardware implementation.

24
Reference
[1] Krishnan R. Electric Motor Drives: Modeling, Analysis, and Control. 1st ed. Upper Saddle
River, NJ, USA: Prentice Hall, 2001.

[2] Soliman HM, Saleem A, Tutunji TA, Al Ratrout S. Robust digital pole-placer for electric drives
based on uncertain Diophantine equation and interval mathematics. T I Meas Control 2018; 40:
2546-2559.

[3] Astrom K, Hagglund I. PID Controllers: Theory, Design and Tuning. 2nd ed. Durham, NC,
USA: Instrument Society of America, 1995. 2777

[4] Rahimian M, Tavazoei M. Improving integral square error performance with implementable
fractional-order PI controllers. Optim Contr Appl Met 2014; 35: 303-323.

[5] Podlubny I. Fractional-order systems and PID controllers. IEEE T Automat Contr 1999; 44:
208-213.

[6] Podlubny I, Dorcák L, Kostial I. On fractional derivatives, fractional-order dynamic systems


and PI D controllers. In: 36th IEEE Conference on Decision and Control. 10–12 Dec 1997; San
Diego, CA, USA.

[7] Yeroglu C, Onat C, Tan N. A new tuning method for PIDcontroller. In: Proceedings of the
Electrical and Electronics Engineering; 5–8 Nov 2009; Bursa, Turkey.

[8] Monje A, Chen YQ, Vinagre BM, Xue D, Feliu V. Fractional-order Systems and Controls:
Fundamentals and Applications. 1st ed. London, UK: Springer-Verlag, 2010.

[9] Zeng GQ, Chen J, Dai YX, Li LM, Zheng CW, Chen MR. Design of fractional order PID
controller for automatic regulator voltage system based on multi-objective extremal optimization.
Neurocomputing 2015; 160: 173-184.

[10] Al-Ratrout S, Saleem A, Soliman H. Optimization methods in fractional order control of


electric drives: a comparative study. In: 10th IEEE International Symposium on Mechatronics and
its Applications (ISMA). 8–10 Dec 2015; Sharjah, UAE.

[11] Ogata K. Modern Control Engineering. 5th ed. Upper Saddle River, NJ, USA: Pearson, 2009.

25
Appendix

Appendix A:
clc
clear
%%GA initiazation.
nvars=5;% number of design variables.
A=[];%inequuality constrait at A
b=[];%inequality constraint at b
Aeq=[];%equality cnstraint at A
beq=[];%equality constraint at b
nonIcon=[];% no nonlinear constraints.
lb = [0;0;0;0;0;0]; %% lower bound of the variables.
ub = [200;200;1;200;1];%% upper bound of the variables.
[x,fval] = ga(@myobj,nvars,[],[],[],[],lb, ub);

Appendix B:
function y=myobj(x)
assignin('base','x1',x(1));
assignin('base','x2',x(2));
assignin('base','x3',x(3));
[~,~,yout]=sim('inverter',10);
q=yout;
[m,~]=size(q);
v=0;
R=0;
for i=1:m
v=v+(R-q(i))^2;
end
y=v;
end

26

You might also like