SlideShare a Scribd company logo
IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163
__________________________________________________________________________________________
Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 359
TUNING OF PID CONTROLLER OF INVERTED PENDULUM USING
GENETIC ALGORITHM
P. Kumar1
, O.N. Mehrotra
2
, J. Mahto3
Abstract
The paper presents two different ways of mathematical modeling of Inverted Pendulum. A Proportional-Integral-Derative (PID)
controller is designed for its stabilization. Some reference stable system is selected after designing of PID controller to optimize
different types of error using Genetic Algorithms. The proposed system extends classical inverted pendulum by incorporating two
moving masses. A tuning mechanism is implemented by genetic algorithm for optimizing different gains of controller parameter. Also,
different performance indices are calculated in MATLAB environment. This paper exhibits to demonstrate the capability of genetic
algorithm to solve complex and constraint optimization problems and as a general purpose optimization tool to solve control system
design problems.
Keyword-Inverted pendulum,Mathematical modelling,swing up control ,PID controller,Tuning,Genetic
Algorithm,Performance Indeces,Error minimization.
--------------------------------------------------------------------*****--------------------------------------------------------------------
1.INTRODUCTION
The inverted pendulum may be viewed as a classical problem in
dynamics and control theory[1,9] and is widely used as a
benchmark[16] for testing control algorithms(PID controllers,
Linear Quadratic Regulator (LQR), neural networks, fuzzy logic
control, genetic algorithms, etc)[7,8].The inverted pendulum is
unstable[11] in the sense that it may fall any time in any
direction unless a suitable control force is applied. The control
objective of the inverted pendulum is to swing up[4] the
pendulum hinged on the moving cart by a linear motor[12] from
stable position (vertically down state) to the zero state(vertically
upward state) and to keep the pendulum in vertically upward
state in spite of the disturbance[5,13].
In the field of engineering and technology the importance of
benchmark [14,7] needs no explanation. They make it easy to
check whether a particular algorithm [6] yields the requisite
results.
Several work has been reported on the inverted pendulum for its
stabilization. Attempts have been made in the past to control it
using classical control [3]. In this paper, the controller is
proposed to be tuned using Genetic Algorithm(GA)[15]
technique.. Genetic Algorithm[2,10] have been shown to be
capable of locating high performance areas in complex domains
without experiencing difficulties, even associated with high
dimensionality or false optima as many occurring with some
other optimization method.
2. MECHANICAL CONSTRUCTION
The system comprises of a horizontal plate connected to two
wheels through a connecting rod. The wheels are independent of
each other and are placed in the centre of the rail. The platform
thus can move on a horizontal surface and is able to rotate about
the axis of wheels. There are two masses on top of the system
that can slide along the horizontal rail, the masses being on both
sides of the rail. The system is shown in fig (1)
3. MATHEMATICAL MODEL OF THE PLANT
Defining the angle of the rod from the vertical (reference) line
as θ , displacement of the cart as x, assuming the force applied
to the system be F , centre of gravity of the pendulum rod is at
its geometric centre and l be the half length of the pendulum rod,
the physical model of the system is shown in fig (2).
IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163
__________________________________________________________________________________________
Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 360
The Lagrangian of the entire system is given as,
L=
1
2
(mx2 +2mlx cos�+ml2
θ2+Mx2)+
1
2
Iθ2 ]-mglcos�
The Euler-Lagrange’s equation for the system is :
d
dt
δL
δx
−
δL
δx
+ bx = F
d
dt
δL
δθ
−
δL
δθ
+ dθ = 0
The dynamics of the entire system using above equation is
I + ml2
θ + ml cos θ x − mgl sin θ + dθ = 0 ……….(1)
M + m x + ml cos θ θ − ml sin θ θ2
+ bx = F ……..(2)
𝑥1 = 𝑥 + 𝑙 sin 𝜃
𝑦1 = 𝑙 cos 𝜃 𝜃 𝑚𝑔 𝑙
F 𝑀 𝑥
Fig 2 : The Inverted Pendulum System
In order to derive the linear differential equation model, the non
linear differential equation obtained need to be linearized. For
small angle deviation around the upright equilibrium (fig.2)
point, assumption made
sin θ = θ, cos θ = 1, θ2
= 0
Using above relation , equation (3) and (4) is derived.
rθ+qx-kθ+d =0………..(3)
px + qθ + bx = F …….(4
)
Where, (M + m)= p, mgl=k, ml=q, I + ml2
= r
Eq (3&4) is the linear differential equation model of the entire
system.
Laplace transform model of the system is obtained substituting
the parameter value (table 1),
θ s
F s
=
−qs2
rs2 −k+ ds
θ s
F s
=
−0.04283097s2
0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s
θ s
F s
=
−0.2783 S2
s (s + 2.026) (s − 1.978) (s + 0.03402)
and
X s
F s
=
rs2−k+ds
pr−q2 s4 + pd +br s3+ bd −pk s2−kbs
X(s)
F(s)
=
0.106 S2 + 0.005 S− 0.4197
0.1539 S4 + 0.01265 S3 − 0.6167 S2− 0.02099 S
X s
F s
=
0.68843 (s + 2.014) (s − 1.967)
s (s + 2.026) (s − 1.978) (s + 0.03402)
The system poles lies on R.H plane confirming the system to be
unstable.
Table 1. Parameters of the system from feedback instrument
.U.K.
Parameter Value unit
Cart mass(𝑀) 1.206 Kilo gram
Mass of the pendulum(𝑚) 0.2693 Kilo gram
Half Length of
pendulum(𝑙)
0.1623 meter
Coefficient of frictional
force(𝑏)
0.005 Ns/m
Pendulum damping
coefficient(q)
0.005 𝑀𝑚/rad
Moment of inertia of
pendulum(𝐼)
0.099 𝑘𝑔/𝑚2
Gravitation force(𝑔) 9.8 𝑚/𝑠2
4. PERFORMANCE INDICES
The design of a control system is an attempt to meet a set of
specifications which define the overall performance of the
system in terms of certain measurable quantities. In the normal
way, some specific parametric values of the system are assumed
and the control system is designed accordingly to meet desired
performance of the system.. Four most commonly mathematical
functions are used as a performance index associated with error
of a closed loop system. A performance index is a number
which indicates goodness of system performance. The objective
is to design an optimal system by proper choice of its parameters
such that the specified performance index is optimum. A
performance index must be a single positive number or zero, the
latter being obtained if and only if the measure of the deviation
becomes identically zero.
IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163
__________________________________________________________________________________________
Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 361
The commonly used performance indices (PI) are:
 Integral of squared error (ISE),
J = 𝑒2∞
0
𝑡 𝑑𝑡
 Integral of time multiplied squared error (ITSE),
J = 𝑡𝑒2
𝑡 𝑑𝑡
∞
0
 Integral of absolute error (IAE),
J = 𝑒(𝑡)
∞
0
𝑑𝑡
 Integral of time multiplied absolute error (ITAE),
J= 𝑡 𝑒(𝑡)
∞
0
𝑑𝑡
Here the error is define as e t = x t − y t . The stable
reference model has been taken for angle whose transfer
function is
The transfer function of the system with angle as the output is
θ s
F s
=
−0.04283097s2
0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s
Table 2. The different performance indices with the angle of
the pendulum as output.
Performance Indexes PID
ISE
−50.87𝑠2
− 58.99𝑠 − 149.5
𝑠
ITSE
−50.72𝑠2
− 58.95𝑠 − 150.8
𝑠
IAE
−50.66𝑠2
− 58.87𝑠 − 149.1
𝑠
ITAE
−50.05𝑠2
− 58.41𝑠 − 151.4
𝑠
Table 3 The different performance indices with position of the
cart as output
Performance Indexes PID
ISE
45.66𝑠2
− 58.99𝑠 − 149.5
𝑠
ITSE
42.78𝑠2
+ 174.6𝑠 + 22.42
𝑠
IAE
44.56𝑠2
+ 187.9𝑠 + 22.4
𝑠
ITAE
43.09𝑠2
− 175.7𝑠 − 38.28
𝑠
Transfer function of stable reference model with position of the
cart is:
Reference Model
X1(s)
F1(s)
=
s + 2
s4 + 9s3 + 43s2 + 143s + 204
The transfer function of the system with position as the output
is:
X(s)
F(s)
=
0.106s2
+ 0.005s − 0.4197
0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s
5. GENETIC ALGORITHM
Genetic algorithms (GA) are search procedures inspired by the
laws of natural selection and genetics. They can be viewed as a
general-purpose optimization method and have been
successfully applied to search, optimization and machine
learning tasks. GA has the ability to solve difficult, multi
dimensional problems with little problem-specific information
and hence has been chosen as the optimization technique to
solve various problems in control systems.
It has been shown that compared with other traditional heuristic
optimization method, Genetic Algorithm is likely to be more
computationally efficient. The controller parameters are usually
determined by trial-and-error through simulation. In such case,
the paradigm of GA appear to offer an effective way for
automatically and efficiently searching for a set of control
performance.
6.SIMULATION & RESULTS
Fig. 3.ISE GA PID Controller of angle
Fig. 4.ITSE GA PID Controller of angle
IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163
__________________________________________________________________________________________
Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 362
Fig. 5.IAE GA PID Controller of angle
Fig. 6.ITAE GA PID Controller of angle
Fig. 7.ISE GA PID Controller of cart
Fig. 8.ITSE GA PID Controller of cart
Fig. 9.IAE GA PID Controller of cart
Fig. 10.ITAE GA PID Controller of cart
CONCLUSIONS
Modeling of inverted pendulum shows that system is unstable
with non-minimum phase zero. Results of applying PID
controllers show that the system can be stabilized. while PID
controller method is cumbersome because of selection of
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Amplitude
PID
GA PID
IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163
__________________________________________________________________________________________
Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 363
constants of controller, Constant of the controllers can be tuned
by some Genetic Algorithm technique for better result. Results
with GA tuned controller are better in respect of rise time and
overshoot wgen the angle is measured. The choice of the
reference model like that of our system yields comparatively
better result. The use of Walsh function in equation (1&2)
would help finding out the solution of non-linear differential
equations thus helping towards the design of non-linear
controller.
REFERENCES
[1] Elmer P. Dadias, Patrick S. Fererandez, and David
J,”Genetic Algorithm on Line Controller For The Flexible
Inverted Pendulum Problem”, Journal Of Advanced
Computational Intelligence and Intelligent Informatics
[2] ] R. Murillo Garcia1, F. Wornle1, B. G. Stewart1 and D. K.
Harrison1, “Real-Time Remote Network Control of an Inverted
Pendulum using ST-RTL”, 32nd ASEE/IEEE Frontiers in
Education Conference November 6 - 9, 2002, Boston, MA.
[3] DONGIL CHOI and Jun-Ho Oh “Human-friendly Motion
Control of a Wheeled Inverted Pendulum by Reduced-order
Disturbance Observer” 2008 IEEE International Conference on
Robotics and Automation Pasadena, CA, USA, May 19-23,
2008.
[4] W. Wang, “Adaptive fuzzy sliding mode control for inverted
pendulum,” in Proceedings of the Second Symposium
International Computer Science and Computational
Technology(ISCSCT ’09) uangshan, P. R. China, 26-28, Dec.
pp. 231-234, 2009.
[5] Berenji HR. A reinforcement learning-based architecture for
fuzzy logic control. International Journal of Approximate
Reasoning 1992;6(1):267–92.
[6] I. H. Zadeh and S. Mobayen, “ PSO-based controller for
balancing rotary inverted pendulum, ” J. AppliedSci., vol. 16,
pp. 2907-2912 2008.
[7] I. H. Zadeh and S. Mobayen, “ PSO-based controller for
balancing rotary inverted pendulum, ” J. AppliedSci., vol. 16,
pp. 2907-2912 2008.
[8] Mohd Rahairi Rani,Hazlina Selamat,Hairi Zamzuri,”Multi
Objective Optimization For PID Controller Tuning Using The
Global Ranking Genetic Algorithm”,International Journal Of
Innovative Computing, Information and Control, VOL-8,
Number 1(A),January-2012
[9] Ohsumi A, Izumikawa T. Nonlinear control of swing-up and
stabilization of an inverted pendulum. Proceedings of the 34th
Conference on Decision and Control, 1995. p. 3873–80.
[10] Eiben, A.E., Hinterding, R. and Michalewicz, Z. Parameter
Control in Evolutionary Algorithms. IEEE Transactions on
Evolutionary Computation, 3, 2 (1999), 124-141.
[11] Kumar,P, Mehrotra, O.N, Mahto, J, Mukherjee, Rabi
Ranjan,”Modelling and Controller Design of Inverted
Pendulum”, National Conference on Communication,
Measurement and Control, Vol-I, 14th August, 2012,in press.
[12]Kumar,P, Mehrotra, O.N, Mahto, J, Mukherjee, Rabi
Ranjan,”Stabilization of Inverted Pendulum using LQR”,
National Conference on Communication, Measurement and
Control, Vol-I, 14th August, 2012 in press.
[13] Behra Laxmidhar & Kar Indrani; Intelligent Systems and
Control Principals and Applications; Oxford University Press
[14]Ogata, K.; System Dynamics, 4th Edition Englewood Cliffs,
NJ: Prentice-Hall, 2003.
[15]Goldberg, D.E. Genetic Algorithms in search, optimization,
and machine learning. Reading, Mass. : Addison-Wesley, 1989.
[16] feedback instrument,U.K
BIOGRAPHIES:
Mehrotra, a Gold Medalist at B.Sc.
Engineering(B.U), M.E.(Hons)(U.O.R) and
Ph.D. (R.U) all in Electrical Engineering,
has the industrial exposure at SAIL as
Testing & Commissioning Engineer. Served
Department of Science & Technology, Govt.
of Bihar & Govt. of Jharkhand for 35 years
and retired as Professor in Electrical Engineering. Served as
coordinator of various projects sanctioned through MHRD and
AICTE, including TEQIP, a World Bank Project. His research
interests include control and utilization of renewable energies,
power quality and power system.
Jagdeo Mahto was born in Madhubani,
Bihar, India, in 1943. He obtained the B.Sc
(Engg) degree in Electrical Engineering
from Bhagalpur University in 1964,
M.Tech. in Control System from IIT
Kharagpur, India in 1970 and Ph.D in
Control System in 1984 from IIT Delhi,
India. He served MIT Muzaffarpur from 1964 to 1971 in the
capacity of Lecturer and Assistant Professor. From 1971 to
1980 he served as Asst. Professor, from 1980 to 1985 as
Associate Professor and from 1985 to 1988 as Professor in the
Department of Electrical Engineering at BIT Sindri, India. He
taught at Bright Star University, Brega (Libya) from 1988 to
1989. From 1989 to 2003 he was again at BIT Sindri. From
2004 till date he is Professor at Asansol Engineering College,
India.
Pankaj Kumar was born in Muzaffarpur,
India, in 1970 and received the B.Sc and
M.Sc. degree in Electronics Honours and
Electronic Science respectively from
Magadh University and Gauhati
University Assam. He received M.Sc
Engineering in Control System
Engineering from Patna University in 2004. He began his
career as Lecturer in Bihar University Muzaffarpur. Currently
he is an Assistant Professor in the Department of Electrical
Engineering, Asansol Engineering College, Asansol, India.

More Related Content

PDF
The efficiency of the inference system knowledge
PDF
A comparative analysis for stabilize the temperature variation of a water bod...
PDF
Simultaneous State and Actuator Fault Estimation With Fuzzy Descriptor PMID a...
PDF
The efficiency of the inference system knowledge strategy for the position co...
PDF
Evaluation the affects of mimo based rayleigh network cascaded with unstable ...
PDF
Risk assessment of a hydroelectric dam with parallel
PDF
Margin Parameter Variation for an Adaptive Observer to a Class of Systems
PDF
Robust control of pmsm using genetic algorithm
The efficiency of the inference system knowledge
A comparative analysis for stabilize the temperature variation of a water bod...
Simultaneous State and Actuator Fault Estimation With Fuzzy Descriptor PMID a...
The efficiency of the inference system knowledge strategy for the position co...
Evaluation the affects of mimo based rayleigh network cascaded with unstable ...
Risk assessment of a hydroelectric dam with parallel
Margin Parameter Variation for an Adaptive Observer to a Class of Systems
Robust control of pmsm using genetic algorithm

What's hot (19)

PDF
Fz3410961102
PDF
Multistage condition-monitoring-system-of-aircraft-gas-turbine-engine
PDF
Analytical Model of Cage Induction Machine Dedicated to the Study of the Inne...
PDF
Measures of different reliability parameters for a complex redundant system u...
PDF
A comparative study of nonlinear circle criterion based observer and H∞ obser...
PDF
Adaptive Neuro-Fuzzy Control Approach for a Single Inverted Pendulum System
PDF
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
PDF
Adaptive pi based on direct synthesis nishant
PDF
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
PDF
Ik analysis for the hip simulator using the open sim simulator
PDF
Rasool_PhD_Final_Presentation
PDF
griffm3_ECSE4540_Final_Project_Report
PDF
Instrumentation and Automation of Mechatronic
PDF
A computational approach for evaluating helical compression springs
PDF
Preliminary Research on Data Abnormality Diagnosis Methods of Spacecraft Prec...
PDF
Evaluation of 6 noded quareter point element for crack analysis by analytical...
PDF
Alienor method applied to induction machine parameters identification
PDF
HYPERCHAOS SYNCHRONIZATION USING GBM
PDF
Design Analysis
Fz3410961102
Multistage condition-monitoring-system-of-aircraft-gas-turbine-engine
Analytical Model of Cage Induction Machine Dedicated to the Study of the Inne...
Measures of different reliability parameters for a complex redundant system u...
A comparative study of nonlinear circle criterion based observer and H∞ obser...
Adaptive Neuro-Fuzzy Control Approach for a Single Inverted Pendulum System
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
Adaptive pi based on direct synthesis nishant
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
Ik analysis for the hip simulator using the open sim simulator
Rasool_PhD_Final_Presentation
griffm3_ECSE4540_Final_Project_Report
Instrumentation and Automation of Mechatronic
A computational approach for evaluating helical compression springs
Preliminary Research on Data Abnormality Diagnosis Methods of Spacecraft Prec...
Evaluation of 6 noded quareter point element for crack analysis by analytical...
Alienor method applied to induction machine parameters identification
HYPERCHAOS SYNCHRONIZATION USING GBM
Design Analysis
Ad

Viewers also liked (20)

PDF
Microstructural and electrical study of
PDF
Fault model analysis by parasitic extraction method for embedded sram
PDF
Three dimensional finite element modeling of pervious
PDF
A theoretical study on partially automated method
PDF
The longitudinal perturbated fluid velocity of the
PDF
A design for improving the core shelf system in a core
PDF
Analysis of methane diffusion flames
PDF
Studies and mechanical tries regarding the cutting
PDF
Static analysis of c s short cylindrical shell under internal liquid pressure...
PDF
Study on soundness of reinforced concrete structures by ndt approach
PDF
Response sensitivity of the structure using vibration
PDF
A novel approach for efficient skull stripping using
PDF
Securing the cloud computing systems with matrix vector and multi-key using l...
PDF
Estimation of surface runoff in nallur amanikere
PDF
Design of fuzzy logic controller for starch
PDF
A novel token based approach towards packet loss
PDF
Optimization of friction stir welding process
PDF
Resource potential appraisal assessment and to
PDF
Adsorption studies of fluoride on activated carbon
PDF
Channel feedback scheduling for wireless communications
Microstructural and electrical study of
Fault model analysis by parasitic extraction method for embedded sram
Three dimensional finite element modeling of pervious
A theoretical study on partially automated method
The longitudinal perturbated fluid velocity of the
A design for improving the core shelf system in a core
Analysis of methane diffusion flames
Studies and mechanical tries regarding the cutting
Static analysis of c s short cylindrical shell under internal liquid pressure...
Study on soundness of reinforced concrete structures by ndt approach
Response sensitivity of the structure using vibration
A novel approach for efficient skull stripping using
Securing the cloud computing systems with matrix vector and multi-key using l...
Estimation of surface runoff in nallur amanikere
Design of fuzzy logic controller for starch
A novel token based approach towards packet loss
Optimization of friction stir welding process
Resource potential appraisal assessment and to
Adsorption studies of fluoride on activated carbon
Channel feedback scheduling for wireless communications
Ad

Similar to Tuning of pid controller of inverted pendulum using genetic algorithm (20)

PDF
Position control of a single arm manipulator using ga pid controller
PDF
Modelling & simulation of human powered flywheel
PDF
Modelling & simulation of human powered flywheel motor for field data in ...
DOCX
Design and simulation of radio frequency
PDF
COMPARATIVE ANALYSIS OF CONVENTIONAL PID CONTROLLER AND FUZZY CONTROLLER WIT...
PDF
Pso based fractional order automatic generation controller for two area power...
PDF
Design of a Controller for Systems with Simultaneously Variable Parameters
PDF
Design and optimization of pid controller using genetic algorithm
PDF
Two-link lower limb exoskeleton model control enhancement using computed torque
PDF
Neural Network Control Based on Adaptive Observer for Quadrotor Helicopter
PDF
Explicit model predictive control of fast dynamic system
PDF
Explicit model predictive control of fast dynamic system
PDF
Performance optimization and comparison of variable parameter using genetic
PDF
Delayed feedback control of nonlinear phenomena in indirect field oriented co...
PDF
Delayed feedback control of nonlinear phenomena in indirect field oriented co...
PDF
1011ijaia03
PDF
Control Strategy of Triple Effect Evaporators based on Solar Desalination of...
PDF
12 article azojete vol 8 125 131
PDF
Automatic load frequency control of two area power system with conventional a...
PDF
Automatic load frequency control of two area power system with conventional a...
Position control of a single arm manipulator using ga pid controller
Modelling & simulation of human powered flywheel
Modelling & simulation of human powered flywheel motor for field data in ...
Design and simulation of radio frequency
COMPARATIVE ANALYSIS OF CONVENTIONAL PID CONTROLLER AND FUZZY CONTROLLER WIT...
Pso based fractional order automatic generation controller for two area power...
Design of a Controller for Systems with Simultaneously Variable Parameters
Design and optimization of pid controller using genetic algorithm
Two-link lower limb exoskeleton model control enhancement using computed torque
Neural Network Control Based on Adaptive Observer for Quadrotor Helicopter
Explicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic system
Performance optimization and comparison of variable parameter using genetic
Delayed feedback control of nonlinear phenomena in indirect field oriented co...
Delayed feedback control of nonlinear phenomena in indirect field oriented co...
1011ijaia03
Control Strategy of Triple Effect Evaporators based on Solar Desalination of...
12 article azojete vol 8 125 131
Automatic load frequency control of two area power system with conventional a...
Automatic load frequency control of two area power system with conventional a...

More from eSAT Publishing House (20)

PDF
Likely impacts of hudhud on the environment of visakhapatnam
PDF
Impact of flood disaster in a drought prone area – case study of alampur vill...
PDF
Hudhud cyclone – a severe disaster in visakhapatnam
PDF
Groundwater investigation using geophysical methods a case study of pydibhim...
PDF
Flood related disasters concerned to urban flooding in bangalore, india
PDF
Enhancing post disaster recovery by optimal infrastructure capacity building
PDF
Effect of lintel and lintel band on the global performance of reinforced conc...
PDF
Wind damage to trees in the gitam university campus at visakhapatnam by cyclo...
PDF
Wind damage to buildings, infrastrucuture and landscape elements along the be...
PDF
Shear strength of rc deep beam panels – a review
PDF
Role of voluntary teams of professional engineers in dissater management – ex...
PDF
Risk analysis and environmental hazard management
PDF
Review study on performance of seismically tested repaired shear walls
PDF
Monitoring and assessment of air quality with reference to dust particles (pm...
PDF
Low cost wireless sensor networks and smartphone applications for disaster ma...
PDF
Coastal zones – seismic vulnerability an analysis from east coast of india
PDF
Can fracture mechanics predict damage due disaster of structures
PDF
Assessment of seismic susceptibility of rc buildings
PDF
A geophysical insight of earthquake occurred on 21 st may 2014 off paradip, b...
PDF
Effect of hudhud cyclone on the development of visakhapatnam as smart and gre...
Likely impacts of hudhud on the environment of visakhapatnam
Impact of flood disaster in a drought prone area – case study of alampur vill...
Hudhud cyclone – a severe disaster in visakhapatnam
Groundwater investigation using geophysical methods a case study of pydibhim...
Flood related disasters concerned to urban flooding in bangalore, india
Enhancing post disaster recovery by optimal infrastructure capacity building
Effect of lintel and lintel band on the global performance of reinforced conc...
Wind damage to trees in the gitam university campus at visakhapatnam by cyclo...
Wind damage to buildings, infrastrucuture and landscape elements along the be...
Shear strength of rc deep beam panels – a review
Role of voluntary teams of professional engineers in dissater management – ex...
Risk analysis and environmental hazard management
Review study on performance of seismically tested repaired shear walls
Monitoring and assessment of air quality with reference to dust particles (pm...
Low cost wireless sensor networks and smartphone applications for disaster ma...
Coastal zones – seismic vulnerability an analysis from east coast of india
Can fracture mechanics predict damage due disaster of structures
Assessment of seismic susceptibility of rc buildings
A geophysical insight of earthquake occurred on 21 st may 2014 off paradip, b...
Effect of hudhud cyclone on the development of visakhapatnam as smart and gre...

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
Project quality management in manufacturing
PPTX
Geodesy 1.pptx...............................................
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
additive manufacturing of ss316l using mig welding
PDF
Well-logging-methods_new................
PPTX
OOP with Java - Java Introduction (Basics)
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
573137875-Attendance-Management-System-original
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Project quality management in manufacturing
Geodesy 1.pptx...............................................
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
additive manufacturing of ss316l using mig welding
Well-logging-methods_new................
OOP with Java - Java Introduction (Basics)
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
Lecture Notes Electrical Wiring System Components
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
573137875-Attendance-Management-System-original
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Model Code of Practice - Construction Work - 21102022 .pdf

Tuning of pid controller of inverted pendulum using genetic algorithm

  • 1. IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163 __________________________________________________________________________________________ Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 359 TUNING OF PID CONTROLLER OF INVERTED PENDULUM USING GENETIC ALGORITHM P. Kumar1 , O.N. Mehrotra 2 , J. Mahto3 Abstract The paper presents two different ways of mathematical modeling of Inverted Pendulum. A Proportional-Integral-Derative (PID) controller is designed for its stabilization. Some reference stable system is selected after designing of PID controller to optimize different types of error using Genetic Algorithms. The proposed system extends classical inverted pendulum by incorporating two moving masses. A tuning mechanism is implemented by genetic algorithm for optimizing different gains of controller parameter. Also, different performance indices are calculated in MATLAB environment. This paper exhibits to demonstrate the capability of genetic algorithm to solve complex and constraint optimization problems and as a general purpose optimization tool to solve control system design problems. Keyword-Inverted pendulum,Mathematical modelling,swing up control ,PID controller,Tuning,Genetic Algorithm,Performance Indeces,Error minimization. --------------------------------------------------------------------*****-------------------------------------------------------------------- 1.INTRODUCTION The inverted pendulum may be viewed as a classical problem in dynamics and control theory[1,9] and is widely used as a benchmark[16] for testing control algorithms(PID controllers, Linear Quadratic Regulator (LQR), neural networks, fuzzy logic control, genetic algorithms, etc)[7,8].The inverted pendulum is unstable[11] in the sense that it may fall any time in any direction unless a suitable control force is applied. The control objective of the inverted pendulum is to swing up[4] the pendulum hinged on the moving cart by a linear motor[12] from stable position (vertically down state) to the zero state(vertically upward state) and to keep the pendulum in vertically upward state in spite of the disturbance[5,13]. In the field of engineering and technology the importance of benchmark [14,7] needs no explanation. They make it easy to check whether a particular algorithm [6] yields the requisite results. Several work has been reported on the inverted pendulum for its stabilization. Attempts have been made in the past to control it using classical control [3]. In this paper, the controller is proposed to be tuned using Genetic Algorithm(GA)[15] technique.. Genetic Algorithm[2,10] have been shown to be capable of locating high performance areas in complex domains without experiencing difficulties, even associated with high dimensionality or false optima as many occurring with some other optimization method. 2. MECHANICAL CONSTRUCTION The system comprises of a horizontal plate connected to two wheels through a connecting rod. The wheels are independent of each other and are placed in the centre of the rail. The platform thus can move on a horizontal surface and is able to rotate about the axis of wheels. There are two masses on top of the system that can slide along the horizontal rail, the masses being on both sides of the rail. The system is shown in fig (1) 3. MATHEMATICAL MODEL OF THE PLANT Defining the angle of the rod from the vertical (reference) line as θ , displacement of the cart as x, assuming the force applied to the system be F , centre of gravity of the pendulum rod is at its geometric centre and l be the half length of the pendulum rod, the physical model of the system is shown in fig (2).
  • 2. IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163 __________________________________________________________________________________________ Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 360 The Lagrangian of the entire system is given as, L= 1 2 (mx2 +2mlx cos�+ml2 θ2+Mx2)+ 1 2 Iθ2 ]-mglcos� The Euler-Lagrange’s equation for the system is : d dt δL δx − δL δx + bx = F d dt δL δθ − δL δθ + dθ = 0 The dynamics of the entire system using above equation is I + ml2 θ + ml cos θ x − mgl sin θ + dθ = 0 ……….(1) M + m x + ml cos θ θ − ml sin θ θ2 + bx = F ……..(2) 𝑥1 = 𝑥 + 𝑙 sin 𝜃 𝑦1 = 𝑙 cos 𝜃 𝜃 𝑚𝑔 𝑙 F 𝑀 𝑥 Fig 2 : The Inverted Pendulum System In order to derive the linear differential equation model, the non linear differential equation obtained need to be linearized. For small angle deviation around the upright equilibrium (fig.2) point, assumption made sin θ = θ, cos θ = 1, θ2 = 0 Using above relation , equation (3) and (4) is derived. rθ+qx-kθ+d =0………..(3) px + qθ + bx = F …….(4 ) Where, (M + m)= p, mgl=k, ml=q, I + ml2 = r Eq (3&4) is the linear differential equation model of the entire system. Laplace transform model of the system is obtained substituting the parameter value (table 1), θ s F s = −qs2 rs2 −k+ ds θ s F s = −0.04283097s2 0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s θ s F s = −0.2783 S2 s (s + 2.026) (s − 1.978) (s + 0.03402) and X s F s = rs2−k+ds pr−q2 s4 + pd +br s3+ bd −pk s2−kbs X(s) F(s) = 0.106 S2 + 0.005 S− 0.4197 0.1539 S4 + 0.01265 S3 − 0.6167 S2− 0.02099 S X s F s = 0.68843 (s + 2.014) (s − 1.967) s (s + 2.026) (s − 1.978) (s + 0.03402) The system poles lies on R.H plane confirming the system to be unstable. Table 1. Parameters of the system from feedback instrument .U.K. Parameter Value unit Cart mass(𝑀) 1.206 Kilo gram Mass of the pendulum(𝑚) 0.2693 Kilo gram Half Length of pendulum(𝑙) 0.1623 meter Coefficient of frictional force(𝑏) 0.005 Ns/m Pendulum damping coefficient(q) 0.005 𝑀𝑚/rad Moment of inertia of pendulum(𝐼) 0.099 𝑘𝑔/𝑚2 Gravitation force(𝑔) 9.8 𝑚/𝑠2 4. PERFORMANCE INDICES The design of a control system is an attempt to meet a set of specifications which define the overall performance of the system in terms of certain measurable quantities. In the normal way, some specific parametric values of the system are assumed and the control system is designed accordingly to meet desired performance of the system.. Four most commonly mathematical functions are used as a performance index associated with error of a closed loop system. A performance index is a number which indicates goodness of system performance. The objective is to design an optimal system by proper choice of its parameters such that the specified performance index is optimum. A performance index must be a single positive number or zero, the latter being obtained if and only if the measure of the deviation becomes identically zero.
  • 3. IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163 __________________________________________________________________________________________ Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 361 The commonly used performance indices (PI) are:  Integral of squared error (ISE), J = 𝑒2∞ 0 𝑡 𝑑𝑡  Integral of time multiplied squared error (ITSE), J = 𝑡𝑒2 𝑡 𝑑𝑡 ∞ 0  Integral of absolute error (IAE), J = 𝑒(𝑡) ∞ 0 𝑑𝑡  Integral of time multiplied absolute error (ITAE), J= 𝑡 𝑒(𝑡) ∞ 0 𝑑𝑡 Here the error is define as e t = x t − y t . The stable reference model has been taken for angle whose transfer function is The transfer function of the system with angle as the output is θ s F s = −0.04283097s2 0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s Table 2. The different performance indices with the angle of the pendulum as output. Performance Indexes PID ISE −50.87𝑠2 − 58.99𝑠 − 149.5 𝑠 ITSE −50.72𝑠2 − 58.95𝑠 − 150.8 𝑠 IAE −50.66𝑠2 − 58.87𝑠 − 149.1 𝑠 ITAE −50.05𝑠2 − 58.41𝑠 − 151.4 𝑠 Table 3 The different performance indices with position of the cart as output Performance Indexes PID ISE 45.66𝑠2 − 58.99𝑠 − 149.5 𝑠 ITSE 42.78𝑠2 + 174.6𝑠 + 22.42 𝑠 IAE 44.56𝑠2 + 187.9𝑠 + 22.4 𝑠 ITAE 43.09𝑠2 − 175.7𝑠 − 38.28 𝑠 Transfer function of stable reference model with position of the cart is: Reference Model X1(s) F1(s) = s + 2 s4 + 9s3 + 43s2 + 143s + 204 The transfer function of the system with position as the output is: X(s) F(s) = 0.106s2 + 0.005s − 0.4197 0.1539s4 + 0.01265 s3 − 0.6167s2 − 0.02099 s 5. GENETIC ALGORITHM Genetic algorithms (GA) are search procedures inspired by the laws of natural selection and genetics. They can be viewed as a general-purpose optimization method and have been successfully applied to search, optimization and machine learning tasks. GA has the ability to solve difficult, multi dimensional problems with little problem-specific information and hence has been chosen as the optimization technique to solve various problems in control systems. It has been shown that compared with other traditional heuristic optimization method, Genetic Algorithm is likely to be more computationally efficient. The controller parameters are usually determined by trial-and-error through simulation. In such case, the paradigm of GA appear to offer an effective way for automatically and efficiently searching for a set of control performance. 6.SIMULATION & RESULTS Fig. 3.ISE GA PID Controller of angle Fig. 4.ITSE GA PID Controller of angle
  • 4. IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163 __________________________________________________________________________________________ Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 362 Fig. 5.IAE GA PID Controller of angle Fig. 6.ITAE GA PID Controller of angle Fig. 7.ISE GA PID Controller of cart Fig. 8.ITSE GA PID Controller of cart Fig. 9.IAE GA PID Controller of cart Fig. 10.ITAE GA PID Controller of cart CONCLUSIONS Modeling of inverted pendulum shows that system is unstable with non-minimum phase zero. Results of applying PID controllers show that the system can be stabilized. while PID controller method is cumbersome because of selection of 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Step Response Time (sec) Amplitude PID GA PID
  • 5. IJRET: International Journal of Research in Engineering and Technology ISSN: 2319-1163 __________________________________________________________________________________________ Volume: 01 Issue: 03 | Nov-2012, Available @ http://www.ijret.org 363 constants of controller, Constant of the controllers can be tuned by some Genetic Algorithm technique for better result. Results with GA tuned controller are better in respect of rise time and overshoot wgen the angle is measured. The choice of the reference model like that of our system yields comparatively better result. The use of Walsh function in equation (1&2) would help finding out the solution of non-linear differential equations thus helping towards the design of non-linear controller. REFERENCES [1] Elmer P. Dadias, Patrick S. Fererandez, and David J,”Genetic Algorithm on Line Controller For The Flexible Inverted Pendulum Problem”, Journal Of Advanced Computational Intelligence and Intelligent Informatics [2] ] R. Murillo Garcia1, F. Wornle1, B. G. Stewart1 and D. K. Harrison1, “Real-Time Remote Network Control of an Inverted Pendulum using ST-RTL”, 32nd ASEE/IEEE Frontiers in Education Conference November 6 - 9, 2002, Boston, MA. [3] DONGIL CHOI and Jun-Ho Oh “Human-friendly Motion Control of a Wheeled Inverted Pendulum by Reduced-order Disturbance Observer” 2008 IEEE International Conference on Robotics and Automation Pasadena, CA, USA, May 19-23, 2008. [4] W. Wang, “Adaptive fuzzy sliding mode control for inverted pendulum,” in Proceedings of the Second Symposium International Computer Science and Computational Technology(ISCSCT ’09) uangshan, P. R. China, 26-28, Dec. pp. 231-234, 2009. [5] Berenji HR. A reinforcement learning-based architecture for fuzzy logic control. International Journal of Approximate Reasoning 1992;6(1):267–92. [6] I. H. Zadeh and S. Mobayen, “ PSO-based controller for balancing rotary inverted pendulum, ” J. AppliedSci., vol. 16, pp. 2907-2912 2008. [7] I. H. Zadeh and S. Mobayen, “ PSO-based controller for balancing rotary inverted pendulum, ” J. AppliedSci., vol. 16, pp. 2907-2912 2008. [8] Mohd Rahairi Rani,Hazlina Selamat,Hairi Zamzuri,”Multi Objective Optimization For PID Controller Tuning Using The Global Ranking Genetic Algorithm”,International Journal Of Innovative Computing, Information and Control, VOL-8, Number 1(A),January-2012 [9] Ohsumi A, Izumikawa T. Nonlinear control of swing-up and stabilization of an inverted pendulum. Proceedings of the 34th Conference on Decision and Control, 1995. p. 3873–80. [10] Eiben, A.E., Hinterding, R. and Michalewicz, Z. Parameter Control in Evolutionary Algorithms. IEEE Transactions on Evolutionary Computation, 3, 2 (1999), 124-141. [11] Kumar,P, Mehrotra, O.N, Mahto, J, Mukherjee, Rabi Ranjan,”Modelling and Controller Design of Inverted Pendulum”, National Conference on Communication, Measurement and Control, Vol-I, 14th August, 2012,in press. [12]Kumar,P, Mehrotra, O.N, Mahto, J, Mukherjee, Rabi Ranjan,”Stabilization of Inverted Pendulum using LQR”, National Conference on Communication, Measurement and Control, Vol-I, 14th August, 2012 in press. [13] Behra Laxmidhar & Kar Indrani; Intelligent Systems and Control Principals and Applications; Oxford University Press [14]Ogata, K.; System Dynamics, 4th Edition Englewood Cliffs, NJ: Prentice-Hall, 2003. [15]Goldberg, D.E. Genetic Algorithms in search, optimization, and machine learning. Reading, Mass. : Addison-Wesley, 1989. [16] feedback instrument,U.K BIOGRAPHIES: Mehrotra, a Gold Medalist at B.Sc. Engineering(B.U), M.E.(Hons)(U.O.R) and Ph.D. (R.U) all in Electrical Engineering, has the industrial exposure at SAIL as Testing & Commissioning Engineer. Served Department of Science & Technology, Govt. of Bihar & Govt. of Jharkhand for 35 years and retired as Professor in Electrical Engineering. Served as coordinator of various projects sanctioned through MHRD and AICTE, including TEQIP, a World Bank Project. His research interests include control and utilization of renewable energies, power quality and power system. Jagdeo Mahto was born in Madhubani, Bihar, India, in 1943. He obtained the B.Sc (Engg) degree in Electrical Engineering from Bhagalpur University in 1964, M.Tech. in Control System from IIT Kharagpur, India in 1970 and Ph.D in Control System in 1984 from IIT Delhi, India. He served MIT Muzaffarpur from 1964 to 1971 in the capacity of Lecturer and Assistant Professor. From 1971 to 1980 he served as Asst. Professor, from 1980 to 1985 as Associate Professor and from 1985 to 1988 as Professor in the Department of Electrical Engineering at BIT Sindri, India. He taught at Bright Star University, Brega (Libya) from 1988 to 1989. From 1989 to 2003 he was again at BIT Sindri. From 2004 till date he is Professor at Asansol Engineering College, India. Pankaj Kumar was born in Muzaffarpur, India, in 1970 and received the B.Sc and M.Sc. degree in Electronics Honours and Electronic Science respectively from Magadh University and Gauhati University Assam. He received M.Sc Engineering in Control System Engineering from Patna University in 2004. He began his career as Lecturer in Bihar University Muzaffarpur. Currently he is an Assistant Professor in the Department of Electrical Engineering, Asansol Engineering College, Asansol, India.