Professional Documents
Culture Documents
Application of GA To Design LQR Controller For An Inverted Pendulum System
Application of GA To Design LQR Controller For An Inverted Pendulum System
Application of GA To Design LQR Controller For An Inverted Pendulum System
Abstract - This paper apply Genetic Algorithm (GA) to mathematical formulations. High convergence rapid, low
design weighting matrices in Linear Quadratic Regulator computational burden and do not caught in local minima are the
(LQR) for an Inverted Pendulum System (IPS). Feedback gain illustrious features of this method.
settings of the system are obtained by minimizing the
performance index using GA to optimize the weight matrices of
The purpose of this paper is to add GA to LQR for optimizing
LQR. The divisional of the searching space mechanism and the
the weight matrices of LQR. LQR-GA is expected to overcome
dynamic crossover and mutation rate are used to insure getting
the shortcoming of the experiential-LQR [6]. The paper is
the global optimal results. Time specification performances are
organized as follows. In section II, the dynamic model of the IPS
also compared considering LQR-GA and experiential-LQR [6]
and the linearized of the system are expounded. In section III, the
by determine the control strategy delivers with respect to
concept of LQR optimal control method is shortly reviewed. The
pendulum’s angle and cart’s position. The simulation results
idea of GA is illuminated and introduced how to apply GA on
show that the proposed method gives the response better than
LQR step by step are described in section IV. In section V, the
experiential-LQR [6]. All computations will be carried out
convergence of GA method and the contrasting results of the
using MATLAB®.
optimization in our proposed method and [6] are presented.
Finally, conclusions are summarized in section VI.
Index Terms – Genetic Algorithm (GA), Linear Quadratic
Regulator (LQR) and Inverted Pendulum System (IPS). II. DYNAMIC MODEL OF THE INVERTED PENDULUM SYSTEM
The IPS is a classic control problem that is used in
I. INTRODUCTION universities around the world. It is a suitable process to test
The IP is used for control engineers to verify a modern control prototype controllers due to its high nonlinearities and lack
theory since its characteristics as marginally stable as a control. of stability. The system consists of an inverted pole hinged
This system was chosen as a test model because it is a well-known, on a cart which is free to move in the x-direction as shown
however, it also has its’ own deficiency due to its highly non-linear in Fig. 1.
and open-loop unstable system. Thus, causing the pendulum falls
over quickly whenever the system is simulated due to the failure of
standard linear technique to model the non-linear dynamics of the
system. Moreover, it makes the identification and control become
more challenging. The conventional controller approaches to
overcome the problem by this system is LQR which is an optimal
control method with the quadratic performance indexes and these
indexes have specify physical concepts generally [2]. At the same
time, LQR has simple math disposal process and can achieve
closed loop optimal control with the linear state feedback or output
feedback. Nevertheless, it attribute to difficulty in specifying an (a) (b)
accurate mathematical model of the process [3]. The selection of Fig.1 (a) Inverted Pendulum System, (b) Free body diagram of the
weight matrices in LQR is very importance and it straight affects system
the control effect. In general, the weight matrices are set by
experience of engineers, who need familiar with the controlled
system [4]. Reference [5]-[6] applied LQR to design the control In order to obtain the dynamic model of the system, the
law of the IPS. The weight matrices were set by experience first following assumptions and design requirements have been
and then were adjusted by simulation till obtaining the satisfying made. The assumptions are:
output responses. To this process, if the designer known poor about (1) The system starts in a state of equilibrium meaning
the system, the optimal weight matrices could not be obtained and that the initial conditions are assumed to be zero.
so the control performance also could not be optimal. The GA is (2) The pendulum does not move than a few degrees
one method that help the designer achieve this task. away from the vertical to satisfy a linear or nonlinear model.
The GA is a highly efficient and robust search algorithm based (3) A step input is applied.
on evolution in nature. GA has been widely used to evolve good
solutions to difference problems [7]. It can be applied directly to The design requirements are:
various problems, without need to transform them into
952
Bx = log 2 [(U x − Lx ) / ε ] (11) crossover and using dynamic crossover, then the probability
equal to crossover rate (Pc) of each generation (Gen) can be
For the parameters of weight matrices Q and R (qi and ri), expressed:
the number of bits in whole chromosome is obtained:
n2 n2 Pc = exp( −Gen / Max _ Gen ) (17)
Nbit = ∑ Bq i + ∑ Bri (12)
i =1 i =1 Mutation: This function makes small random changes in
where n1 and n2 are the amount of parameters included in Q the individuals, providing genetic diversity and thereby
and R respectively. increasing the likelihood that the algorithm will generate
individuals with a better fitness value. For each member of
Step 2 Divide searching space: The process begins by the population a random number in the range (0, 1) is
dividing bounded parametric search space into finite pieces
to avoid the solution being trapped in local minima. generated. If the random number is below some pre-
specified mutation threshold, then the gene is allowed to
Step 3 Initialization of population: The number of initial mutate. This paper randomly selected num_m points to
population is randomly generated M individuals. Each mutate and used dynamic mutation that mutation rate (Pm)
individual possesses vector entries with certain length of of each generation (Gen) can be expressed:
gene shown by Fig. 2. Each gene is coded by binary code
with certain length of bit (Nbit). Pm = exp( 0.05 × Gen / Max _ Gen ) − 1 (18)
953
Results by LQR-GA method and experiential-LQR [6] method
for cart’s position
Object LQR-GA LQR[6]
Rising Time, tr 0.58 s 0.41 s
Settling time, ts 1.16 s 2.04 s
Percent Overshoot, OS 0.94 % 0%
Steady state error, ess 0 0
VI. CONCLUSION
In this paper, GA was introduced to LQR and a new
optimal control method (LQR-GA) is successfully designed.
The control results by our proposed method are compared
with the experiential-LQR [6] for controlling the inverted
Fig. 4 Step response of the pendulum’s angle with pendulum’s angle and the cart’s position of the linearized
LQR controller designed parameter by GA.
system. Simulation results show that LQR-GA controller
has better performance compared to experiential-LQR [6] in
controlling the IPS. As seen in the results, LQR-GA can
decrease the requests to the designer and the designing
process is done automatically. The design efficiency is
improved obviously. However, in the future, the design idea
can be extended to the control method such as fuzzy logic
controller, neuro-fuzzy controller for the non-linear model
of IPS which needs to be studied ulteriorly.
954