Design and Optimization of Fuzzy Controller for Inverse Pendulum System Using Genetic Algorithm

Similar documents
EEE 241: Linear Systems

Lecture Notes on Linear Regression

Chapter Newton s Method

The Chaotic Robot Prediction by Neuro Fuzzy Algorithm (2) = θ (3) = ω. Asin. A v. Mana Tarjoman, Shaghayegh Zarei

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Grover s Algorithm + Quantum Zeno Effect + Vaidman

COMPARISON OF SOME RELIABILITY CHARACTERISTICS BETWEEN REDUNDANT SYSTEMS REQUIRING SUPPORTING UNITS FOR THEIR OPERATIONS

The Study of Teaching-learning-based Optimization Algorithm

Outline. Communication. Bellman Ford Algorithm. Bellman Ford Example. Bellman Ford Shortest Path [1]

The Minimum Universal Cost Flow in an Infeasible Flow Network

Markov Chain Monte Carlo Lecture 6

A PROCEDURE FOR SIMULATING THE NONLINEAR CONDUCTION HEAT TRANSFER IN A BODY WITH TEMPERATURE DEPENDENT THERMAL CONDUCTIVITY.

CONTRAST ENHANCEMENT FOR MIMIMUM MEAN BRIGHTNESS ERROR FROM HISTOGRAM PARTITIONING INTRODUCTION

The Multiple Classical Linear Regression Model (CLRM): Specification and Assumptions. 1. Introduction

CIS526: Machine Learning Lecture 3 (Sept 16, 2003) Linear Regression. Preparation help: Xiaoying Huang. x 1 θ 1 output... θ M x M

Kernel Methods and SVMs Extension

Problem Set 9 Solutions

Section 8.3 Polar Form of Complex Numbers

Chapter - 2. Distribution System Power Flow Analysis

Physics 5153 Classical Mechanics. D Alembert s Principle and The Lagrangian-1

Foundations of Arithmetic

princeton univ. F 17 cos 521: Advanced Algorithm Design Lecture 7: LP Duality Lecturer: Matt Weinberg

4DVAR, according to the name, is a four-dimensional variational method.

Physics 207: Lecture 20. Today s Agenda Homework for Monday

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

Multilayer Perceptron (MLP)

Fuzzy Boundaries of Sample Selection Model

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Calculation of time complexity (3%)

A Fast Computer Aided Design Method for Filters

AP Physics 1 & 2 Summer Assignment

Using Immune Genetic Algorithm to Optimize BP Neural Network and Its Application Peng-fei LIU1,Qun-tai SHEN1 and Jun ZHI2,*

First Law: A body at rest remains at rest, a body in motion continues to move at constant velocity, unless acted upon by an external force.

1 GSW Iterative Techniques for y = Ax

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

Structure and Drive Paul A. Jensen Copyright July 20, 2003

Difference Equations

Generalized Linear Methods

arxiv:quant-ph/ Jul 2002

2E Pattern Recognition Solutions to Introduction to Pattern Recognition, Chapter 2: Bayesian pattern classification

Solving Nonlinear Differential Equations by a Neural Network Method

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Normally, in one phase reservoir simulation we would deal with one of the following fluid systems:

Physics 5153 Classical Mechanics. Principle of Virtual Work-1

Lecture 10 Support Vector Machines II

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

MMA and GCMMA two methods for nonlinear optimization

Note 10. Modeling and Simulation of Dynamic Systems

Numerical Heat and Mass Transfer

Errors for Linear Systems

Linear Approximation with Regularization and Moving Least Squares

The Synchronous 8th-Order Differential Attack on 12 Rounds of the Block Cipher HyRAL

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

NON-CENTRAL 7-POINT FORMULA IN THE METHOD OF LINES FOR PARABOLIC AND BURGERS' EQUATIONS

DETERMINATION OF TEMPERATURE DISTRIBUTION FOR ANNULAR FINS WITH TEMPERATURE DEPENDENT THERMAL CONDUCTIVITY BY HPM

A Particle Filter Algorithm based on Mixing of Prior probability density and UKF as Generate Importance Function

Suggested solutions for the exam in SF2863 Systems Engineering. June 12,

A New Evolutionary Computation Based Approach for Learning Bayesian Network

Global Sensitivity. Tuesday 20 th February, 2018

The Expectation-Maximization Algorithm

Gravitational Acceleration: A case of constant acceleration (approx. 2 hr.) (6/7/11)

Mathematical Preparations

Markov Chain Monte Carlo (MCMC), Gibbs Sampling, Metropolis Algorithms, and Simulated Annealing Bioinformatics Course Supplement

Solving of Single-objective Problems based on a Modified Multiple-crossover Genetic Algorithm: Test Function Study

A Hybrid Variational Iteration Method for Blasius Equation

Annexes. EC.1. Cycle-base move illustration. EC.2. Problem Instances

Pulse Coded Modulation

Uncertainty in measurements of power and energy on power networks

1 Convex Optimization

The Order Relation and Trace Inequalities for. Hermitian Operators

LOW BIAS INTEGRATED PATH ESTIMATORS. James M. Calvin

Week 5: Neural Networks

Multilayer Perceptrons and Backpropagation. Perceptrons. Recap: Perceptrons. Informatics 1 CG: Lecture 6. Mirella Lapata

3.1 ML and Empirical Distribution

Lecture 20: Noether s Theorem

Quadratic speedup for unstructured search - Grover s Al-

Applied Mathematics Letters

Physics 181. Particle Systems

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

Canonical transformations

Iterative General Dynamic Model for Serial-Link Manipulators

Clock-Gating and Its Application to Low Power Design of Sequential Circuits

NUMERICAL DIFFERENTIATION

Determining Transmission Losses Penalty Factor Using Adaptive Neuro Fuzzy Inference System (ANFIS) For Economic Dispatch Application

A particle in a state of uniform motion remain in that state of motion unless acted upon by external force.

Assortment Optimization under MNL

Mean Field / Variational Approximations

Thin-Walled Structures Group

C/CS/Phy191 Problem Set 3 Solutions Out: Oct 1, 2008., where ( 00. ), so the overall state of the system is ) ( ( ( ( 00 ± 11 ), Φ ± = 1

Newton s Method for One - Dimensional Optimization - Theory

= 1.23 m/s 2 [W] Required: t. Solution:!t = = 17 m/s [W]! m/s [W] (two extra digits carried) = 2.1 m/s [W]

THE ARIMOTO-BLAHUT ALGORITHM FOR COMPUTATION OF CHANNEL CAPACITY. William A. Pearlman. References: S. Arimoto - IEEE Trans. Inform. Thy., Jan.

CHAPTER-5 INFORMATION MEASURE OF FUZZY MATRIX AND FUZZY BINARY RELATION

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Linear Feature Engineering 11

APPROXIMATE PRICES OF BASKET AND ASIAN OPTIONS DUPONT OLIVIER. Premia 14

Lecture 4: Universal Hash Functions/Streaming Cont d

Module 9. Lecture 6. Duality in Assignment Problems

DO NOT DO HOMEWORK UNTIL IT IS ASSIGNED. THE ASSIGNMENTS MAY CHANGE UNTIL ANNOUNCED.

Transcription:

Desgn and Optmzaton of Fuzzy Controller for Inverse Pendulum System Usng Genetc Algorthm H. Mehraban A. Ashoor Unversty of Tehran Unversty of Tehran h.mehraban@ece.ut.ac.r a.ashoor@ece.ut.ac.r Abstract: The reverse movng pendulum system, because of ts nonlnear unstable and non-mnmum phase dynamcs has always been a good crteron for testng and evaluatng control methods. In ths paper, a new method based on fuzzy controllng of the system s presented. Several methods are suggested for optmzng the fuzzy controllers such as, genetc algorthm and neural network. We have used genetc algorthm to fnd the optmum set of fuzzy rules among all possble rules to control the system. Ths controller not only decreases the settlng tme, but also elmnates the fluctuatons of steady state response acceptably and leads to an even moton of the pendulum, whch results n a better controllng of the system n comparson wth the exstng classc methods. KeyWords: Fuzzy Controller, Inverse Pendulum System, Rules Base, Genetc Algorthm (GA), optmzaton. INTRODUCTION A fuzzy controller s based on human logc and attempts to behave lke a human who controls a system. A fuzzy controller for a desred functon requres correct adustment. The number, shape and operatonal range of nput and output membershp functons, table of rules, etc are the parameters that should be adusted accordng to the system specfcatons. Adustng these parameters for a smple system mght be done easly, but for a complcated system t s usually a challenge task, therefore some ntellgent methods such as neural network, that has a hgh level of learnng ablty and Genetc Algorthm that s a powerful searchng method for desgnng a fuzzy controller are appled. In ths document desgn of fuzzy controller based on adustng the rule base usng genetc algorthm s presented. Three methods are usually appled n adustng rule base usng Genetc Algorthm[0] Mchgan method, Pttsburgh method teratve learnng rules In Mchgan method each rule s consdered as a chromosome and populaton conssts of a number of rules. In Pttsburgh method the rule base s consdered as a chromosome. In the thrd method chromosomes consst of a group of rules that each rule enters the chromosome after a large number of teratons. In ths paper Pttsburgh method has been appled to desgn a fuzzy controller for nverse pendulum system based on the two methods presented n [,3]. In part 2 the nverse pendulum system has been descrbed. In part 3 Genetc Algorthm structure s gven. Part 4 explans the procedure of provdng Genetc Algorthm to acheve approprate rule base for the fuzzy controller. Fnally n part 5 Fuzzy controller desgn, the Genetc Algorthm optmzaton and smulatons were done usng MATLAB software. The smulaton results verfy successful applcaton of our method to real moton stuatons. 2 THE INVERSE PENDULUM SYSTEM To solve the problem of nverse pendulum system t s requred to get famlar wth Lagrange Formula n order to be able to formulate the operaton of the system. Therefore we frst descrbe the Lagrange Formula and then usng ths formula we formulate the movement of the nverse pendulum 2. Lagrange Formula q = ( q q,..., q ) Suppose that, 2 n are ndcatons of orthonormal vectors of the space. If T s the Knetc Energy of the system and V s the Potental Energy

of the system, then L = T V s called Lagrangan. In ths case the equatons of the moblty of the system can be acheved from the followng equatons. d L L dt q q =,2,..., n = F For the nverse pendulum system whch s shown n fgure () q = x and q 2 = θ (where x s poston and θ s angle of the pendulum). x p = x + l snθ = l cosθ T = 2 y p 2 ( J + ml ) θ + 2( M + m) + ml xθ cosθ L = T V d L L dt x x = F x ( ) (2) d dt L L θ θ = 0 (3) Fgure : the parameters x, tetta defnton T = J θ + 2 m x p + y p + 2 M x 2 (,2,3 ) ( m+ M) x+ mlθ cosθ mlθ snθ = F 2 ( J + ml ) θ+ mlx cosθ mgl snθ = 0 The system model s also provded n fgure (2) V = mgl cosθ Fgure 2: the nverse pendulum system model

3 GENETIC ALGORITHM Genetc Algorthm (GA) s a powerful searchng method that operates based on selectng and producng generaton n nature. GA deals wth a populaton of chromosomes and s n search of the one that has the best characterstcs. The effcency of each chromosome s evaluated wth a functon that ndcates ts goodness (cost functon). In fact n an optmzaton we are lookng for a chromosome that has the best performance. Each chromosome s constructed from a number of smaller parts called genes. Intally, GA chooses some chromosomes randomly and generates the frst populaton. The cost functon (how good and effcent the chromosome s) s calculated for each of these chromosomes. To produce next generaton, the chromosomes that have bgger cost functon values have hgher probablty to be chosen and GA operators are appled to them n order to produce new chromosomes. GA operators are crossover and mutaton. In crossover a number of genes are two chromosomes are selected and exchanged to generate new chromosomes that make next generaton and replace the prevous generaton. In mutaton a gene of a chromosome wll be selected and replaced by another gene that s produced randomly. Cost functon s calculated for these chromosomes and other generatons are produced accordng to ts value. 4 PROVIDING GENETIC ALGORITHM In ths part a genetc algorthm for optmzng the rule base wll be provded. Accurate preparaton of ths algorthm for a problem s an mportant part of solvng t, and naccurate adustment of ths algorthm may yeld dvergence n optmum response or may lead us to locally optmum responses. The goal s to get an optmum rule base. Therefore, wth a genetc algorthm approach, an optmum rule base should be found. To do ths, each rule base s consdered as a chromosome, the tnest fracture of a rule base s a rule that descrbes the output membershp functon for a specfc state of the angle and ts dervatve (angular velocty). So each rule can be consdered as a gene. A rule can be defned as follows: If angle belongs to the membershp functon and angular velocty belongs to the membershp functon, then the control sgnal belongs to the membershp functon k. Regardng ths defnton each rule can be descrbed as a three dgt number of k. Intal generaton conssts of a number of chromosomes that there genes are produced randomly. Genes of a chromosome may be repeated, whch means havng dentcal rules n rule base s allowed. Also some rules have dentcal f parts but dfferent then parts, lke 566 and 567, n ths case there fuzzy or combnaton wll be appear n the output. Cost functon should be defned accordng to what s as sutable and unsutablty of a chromosome (rule base). The better the rule base s, the better the system wll be controlled and the output wll follow the nput suffcently. Cost functons may be t t 2 2 I = ( e + u )dt and I = 0 ( e + u )dt for 0 contnues sgnals and I = e + u and 2 2 I = ( e + u ) for dscrete sgnals. To defne cost functon frst each chromosome (rule base)and then the lnear model of the nverse pendulum system together wth the Fuzzy controller are put n a loop and are evaluated for several states of the nput and output, after that the weghted summaton of the obtaned errors are calculated due to ths equaton: f ( RB ). In ths = equaton th α α I I s the performance of the system for rule base for th ntal and fnal state, n whch s the weght of each I regardng the ntal and fnal values. In ths case the cost functon wll be maxmzed. Now the genetc algorthm operatons can be exerted on chromosomes. Choosng operaton s done accordng to the cost functon and wth a rotary method. In the mutaton operaton, frst a gene wll be chosen randomly and another gene that s randomly produced wll replace t n the chromosome. Therefore mutaton changes a rule n the rule base. Fuzzy controller has two nputs (error and ts dervatve) and one output sgnals. In the fuzzy controller Mamdan method and also operand MIN for AND and operand MAX for OR have been used.

Snce 5 membershp functons have been chosen for error and dervatve of error, length of a chromosome that s the number of genes s assumed 25. Consderng the 7 membershp functons for the output, all of the forms that a rule can have are equal to 5 5 7 = 75, therefore t s better to choose the number of populaton about 75. As descrbed above, each rule (gene) can be represented n 75 forms, snce each chromosome has 25 genes and dentcal rules are allowed, all of the forms that a chromosome may be represented s 7525. 5 PROVIDING THE OPTIMAL RULE BASE In ths part we perform GA wth populaton number of 50, crossover probablty of, mutaton probablty of 0.5 and smulaton tme of 5 seconds, for 200 generaton, and analyze the results. Step response of the nverse pendulum system wth a fuzzy controller and the best acheved rule base for a number of generatons s provded and depcted n fgure 4. As can be seen n the fgure, the response does not have overshoot and ts steady state error s zero. As t s obvous from fgure 5, t s probable that we don t get the best response n the last generaton. The best response (maxmum cost functon value) s gven n fgure 5. Although there are some fluctuatons n t, but t s ncreasng whch means better responses wll be obtaned n newer generatons. The rule base correspondent to the best answer s provded n table (). In ths table the output membershp functons are as follows. PL (stands for Postve Large), PM (stands for Postve Medum), PS (stands for Postve Small), Z (stands for zero), NL (stands for Negatve Large), NM (stands for Negatve Medum), NS (stands for Negatve Small). It can be seen that some boxes of the table are empty that occurs under three crcumstances: The nverse pendulum system does not nclude such error and error dot, so the fuzzy controller doesn t need to ths type of rule. Because of the overlap of the membershp functons, ths box s affected by the neghbors boxes rules. The dynamc of system orders that under ths condton t doesn t requre a rule and wats untl the condton changes. Fgure 3: the optmum rule base

Fgure 4: the step response for the optmum rule base By omttng the repeated rules we can acheve a table, whch s optmzed regardng number of rules too. The fuzzy controller used n ths system has two nputs and one output, so the plot of the graph (rules surface) can be shown n a three dmensonal space. Fgure (3) ndcates the relatonshp between the error, the error dot and the output control sgnal. Fgure 5: the cost functon for the optmum response(rule base) n each generaton As t can be seen t has a small steady state error, whch s because of the format of the cost functon. As can be seen n these fgures the step response of the system has small overshoot when the error s bg and the controller can control the pendulum wth a very small overshoot whle the error s small. Also the system has a small settlng tme. error NL NS Z PS PL error-dot NL NL NM NS NS - NS NM NS - - PS Z NM - - - PM PS NS - - PS PM PL - PS PS PM PL Table : optmum rule base Fgure 6: step response for ntal state [error, error-dot]= [0.2, 0.05] 6 IMPLEMENTING THE RESULTS ON THE SYSTEM The optmum fuzzy controller explaned n the prevous part s appled to the nverse pendulum n ths secton n real tme mode. The results usng Smulnk Toolbox of MATLAB software for some ntal condtons are shown n fgure 6 and fgure7.

Usng Genetc Algorthms, Dept. of computer scence and AI, Unversty of Granada, Techncal Report, #DECSAI-9508, February,995. Fgure 7: step response for ntal state 2 [error, error-dot]= [0.5, 0.05] 7 CONCLUSION In ths paper a fuzzy controller s desgned for the system of the nverse pendulum system. To optmze the fuzzy controller we used Genetc Algorthm. In ths method not only the rules, but also the number of rules s optmzed. The results showed small overshoot and also small settlng tme whch ndcates the good performance of the desgned system. The Genetc Algorthm succeeded to fnd the desred chromosome n 90th generaton between 7525 chromosomes (after searchng 2750 chromosomes) that shows the power of genetc algorthm. 8 REFERENCES [] A.Fateh, C.Lucas, Optmzaton of the Rule Base and Parameters of a Fuzzy Logc Controller by Genetc Algorthms, Proc.Int.Conf Applcaton of Fuzzy systems (ICAFS), Tabrz, Iran, pp236-240, 994. [2] O.Cordon, F.Herrera, M.Lozano, Genetc Algorthms and Fuzzy Logc n Control Processors, Unversty of Granada, Techncal Report #DECSAI-9807, July, 998. [3] R.Schleffer, H.J.Sebastan, E.K.Antonsson, Genetc Algorthms n Fuzzy Engneerng Desgn, 999 ASME Desgn Engneerng Techncal Conferences, Las Vegas, Nevada, USA. [4] O.Cordon, F.Herrera, F.Gomde, F.Hoffmann, L.Magdalena, Ten Years of Genetc Fuzzy Systems: Current Framework and New Trends, Unversdad de Granada. [5] F.Herrera, M.Lozano, J.L.Verdegay, A Learnng Process for Fuzzy Control Rules