0% found this document useful (0 votes)
42 views5 pages

Fuzzy Optimal Control For Double Inverted Pendulum

The document describes developing a fuzzy optimal controller to stabilize an upright double inverted pendulum. It presents the mathematical modeling of the double pendulum system using Euler-Lagrange equations. It then describes identifying a Takagi-Sugeno fuzzy model for the double inverted pendulum system and using a linear quadratic regulator approach within the fuzzy rules to develop the optimal fuzzy controller.

Uploaded by

Julioroncal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views5 pages

Fuzzy Optimal Control For Double Inverted Pendulum

The document describes developing a fuzzy optimal controller to stabilize an upright double inverted pendulum. It presents the mathematical modeling of the double pendulum system using Euler-Lagrange equations. It then describes identifying a Takagi-Sugeno fuzzy model for the double inverted pendulum system and using a linear quadratic regulator approach within the fuzzy rules to develop the optimal fuzzy controller.

Uploaded by

Julioroncal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Fuzzy Optimal Control for Double Inverted Pendulum

Basil M. Al-Hadithi Antonio Javier Barragan

Jose Manuel Andiijar Agustin Jimenez

Abstract—In this paper a fuzzy optimal control for stabilizing an theory has been done by a controller for stabilizing a double-
upright position a double inverted pendulum (DIP) is developed inverted pendulum at a upright position.
and compared. Modeling is based on Euler-Lagrange equations.
This results in a complicated nonlinear fast reaction, unstable In this paper, fuzzy and optimal nonlinear controller is
developed to stabilize a DIP minimizing an accumulative cost
multivariable system. Firstly, the mathematical models of double
functional quadratic in states and controls. For linear systems,
pendulum system are presented. The weight variable fuzzy input
this leads to linear feedback control, which is found by solving
is gained by combining the fuzzy control theory with the optimal
a Riccati equation, and thus referred to as linear quadratic
control theory. Simulation results show that the controller, which
regulator (LQR). DIP, however, is a highly nonlinear system,
the upper pendulum is considered as main control variable, has
high accuracy, quick convergence speed and higher precision.and its linearization is far from adequate for control design
purposes. Therefore, to solve the nonlinear optimal control
Keywords-component; Takagi-Sugeno model, Linear quadraticproblem, we will employ a LQR fuzzy controller. LQR is used
regulator, double inverted pendulum to obtain the optimal solution at each fuzzy rule. Fuzzy control
will deal with the nonlinearity of the DIP by adjusting the LQR
I. INTRODUCTION parameters in each rule.
As a nonlinear plant, DIP poses a challenging control
problem. It seems to have been one of attractive tools for II. MODELLING OF THE DOUBLE INVERTED
testing linear and nonlinear control laws [2] and [1]. Nearly all PENDULUM
works on pendulum control concentrate on two problems: The DIP system is shown in Fig. L A DIP of two links 11,
pendulums swing up control design and stabilization of the 12 moves under the action of a single control input. Generalized
inverted pendulums. In [5] the stabilization control of DIP is coordinates 9i(t) and 92(t) are attached to the system. The
developed. The authors linearize the DIP in one operating point inputs are xl and T2. The system with link li of mass mi (kg)
which reduces its accuracy. and length li (m); i=l; 2; the unit of time is the second(s).
The classical control theory is based on design of Acceleration due to gravity is written as g. The mathematical
controllers for stable systems which are in many cases more or model is derived from the Lagrange - Euler equation which
less nonlinear. But it is difficult to use linearization methods in describes mutual relations among kinetic, potential and external
systems with high degree of nonlinearities. Therefore the need energy. All three components of energy must be balanced.
of nonlinear controllers arises.
To overcome limitations of the classical control theory, M(0)0 + C(0,0)0 + B0 + g(0) = T (1)
other methods are also introduced into the control design
process, for example NN and fuzzy logic. Above all, fuzzy
logic is very effective and its power has been demonstrated in
various fields of system theory and applications where
M„ M12" ~0x
robustness is a very welcome property which is decisive for the +
choice of the controller. ^21 ^22 _ A. (2)
Furuta et al. [4] designed a controller for DIP by means Px-h0, + h6h
of the state-space approach and the minimal-order observer. + =
Furuta et al. have designed and developed a digital controller Pi A. rsi_ /2_

for a DIP on inclined rail. The study based on fuzzy control


method is based on the identification of functions of the
following form:

f :5R'' ^ 9 ? (3)
y = f(xi,x2,...,x^)

Each IF-THEN rule R'^ °, for an n"' order system can be


rewritten as follows:

S^'^---'"^ : if xi is M'^ and Xj is M'^ and ... x„ is M^« ^ '

then y = p^^''''"h-^ + pf---'"^2+... +p^^"''"^x„

Where the fuzzy estimation of the output is:


Figure 1. Double Inverted Pendulum

Where Oi..^)
X-X^^'-''^[pr-'^^i+-+i'"-''^"
;\ -1 /„ -1
M(9) is a 2x2 DIP inertia matrix (5)
C(d, 0) is a 2x2 DIP centripetal and coriolis torques matrix
Pi and Pi are the coefficients of viscous friction of the joints h -1 L -1
g(9) is a 2-vector of gravitational torques
Let m be a set of input/output system
samples {xjj,, Xjj^,..., x„j,, jj,} . The parameters of the fuzzy
Ml 1 = m^lli + /i + W2 (/f + /i/c2 cos(^1-^2))
system can be calculated as a result of minimizing a quadratic
M12 = m2klc2 cos(^i -62) + m2ll2 + ^1 performance index:
M21 =^2/1/^2005(^1-^2)
^22='«2^c2+-^2 J= Y.^yk-hf=\Y-xp\\ (6)
^ = '«2^1^c2sin(^l-^2) k^\
gl = 'Wi/clg sin Ox + W2g(/c2 sin 62 + k sin d\)
where
g2='«2^c2gsin^2
For the equilibrium point
6\=6\=6\=62=92=d2=^ Y=b xvi ---y-N \

It can be deduced ^-\P\ Pi •••Pn P\ •••Pn


^10 = ^10 = 0> ^20 = ^20 = 0

The DIP under study has the following numerical values:


Pi H\---P\ ^n\ P\ H\---P\ ^n\
wj = 4 /j = 1 /^i = 0.5 / j = 1 ;5i = 0.75 X--
^2 = 3 /2 = 1 1^2= 0-75 /2 = 0.5 132 = 0.75 /?(^-^)x /?(^-^)x •••/?(''i-''«)x /?(''i-''«)x
A'JV HN---PN ^nN PN HN---PN ^nN

We suppose that the action on the second axis is And


negligible T2 =0 and the stabilization of the pendulum at an
upright position is made using only one input r j .
pis...Q w('-'«VxJ
(7)
III. IDENTIFICATION OF T-S MODEL
;\ -1 /„ -1
An interesting method of identification is presented in [13].
The idea is based on estimating the nonlinear system If X is a matrix of complete rank, the solution is obtained as
parameters minimizing a quadratic performance index. The follows:
J = \\Y-XPf =(Y-XPy(Y-XP) ''^^ A. T-S model for the double inverted pendulum
VJ = X'(Y-XP)=X'Y-X'XP =0 In order to obtain T-S model for the DIP, we have to take into
consideration the following variables:
p = (x'xy^x'Y
- Pl 0\ 02 02 \'
In the case of dynamic Systems represented by state variables,
the system model is the following:

x' = f(x, u) (9) if Xi is M} and ... x^ is M^ then


0 1 0 0
x:5R^5R°,u:5R^5R'",f: 9?°+'" -^ 9?"
(hhh'A) AhhhH) JhhhH) AhhhH)
•'21 '22 •'23 •'24
T-S fuzzy model can be expressed as follows:
(hhhH) Jhhhk) Jhhhk) Jhhhk) (13)
"42 "42 "43 "44
(10)
S^'^-'"^ : if xj is M'^ and ... x„ is M^"
0
then x' = A^'^---'"'x + B\l\---ln) AhhhH)
'21
0 n
This is equivalent to n models in differential equation form: AhhhH)
41

S^" "' : if xi is M{ and ... x„ is M„" then Five second order polynomial fuzzy sets have been used. They
x'j = a^-'"ki + aj;^-'")x2 + ... + a^-'"^x„ (11) are centred in , ,0, — , — for angles and three other
6 12 12 6
7l jm ones centred in -3, -1.5, 0, 1.5 3 for their derivatives as shown
in Fig. 2.
Applying the previous method for each one of these models,
we get:

' 1'
jN\
1...1) ^(l...%(l...l) ^(l...l)

«_,1 ---^jm

and each row of the X matrix will be

X k=[Pk4-\,...j3t\, 4-\k.../r^u
k "mk

P^r\k-P, ('!••'•»)

'mk
Figure 1. Membership fimctions

As it can be seen, the X matrix is the same for j models,


Applying the method we obtain
therefore they can be grouped as follows:

P = [Pl ••• Pn]

And the solution is still:

p = {x'xy^x'Y (12)
S .ifxi is M[ and Xj is M j and Xj is M^and X4 is M^ then
0 = -Q + LBR'^B' L- LA- A' L (18)
0 1 0 0 0
3.0724 -0.8453 6.2471 0.5560 -0.3769
The LQR methodology can be applied for each subsystem
0 0 0 1 0 using a common state weighting matrix Q and input matrix R
5.2168 1.2170 -5.2476 -0.9061 0.3903 for all the rules. Thus, Riccati equation is solved for each
subsystem as follows:
S .ifxi is M[ and Xj is M j and Xj is M^ and X4 is M^ then

0 1 0 0 0
(19)
3.0771 -0.8371 6.2498 0.5668 -0.3752
0 0 0 1 0
5.2122 1.2115 -5.2485 -0.9152 0.3874 Then the state feedback gain vector can be obtained as
(14) follows:

5* ^ :if x^ is M j and X2 is M2 and X3 is M3 and X4 is M4 then


(20)
^ ^-15Ol•••'«)' jjh---'n)
0 1 0 0 0
3.0771 -0.8371 6.2498 0.5668 -0.3752
And the controller rule becomes:
0 0 0 1 0
5.2122 1.2115 -5.2485 -0.9152 0.3874
c ( ' ' - ' « l 7 / x i isM} and ...x„ is M'^
(21)
then u = -K ( ' i - - - ' « ) .
IV. DESIGN OF FUZZY OPTIMAL CONTROLLER
Together with the proposed estimation method, the well- In the case of the DIP under study
known LQR method might be an appropriate choice [6]. If the
system can be represented in state space form:
(^(iiiij.^y ^^ ^^ j ^ \ ^ ^ j ---x^ is M\ then
x = Ax + Bu Ti =-[79.9902 31.5107 42.4132 18.1586]x
(15)
xe5R",Me5R'",^e5R'"",Be5R"
^(5555) .^y. ^^ ^.^ j^5 ^ ^ j . . . ^ ^ ^.^ ^ 3 ^^^^
The objective is to find the control action u(t) to transfer the
Ti =-[80.1785 31.6095 42.4828 18.2289]x
system from any initial state x(?o) to some final state
x(oo) = 0 in an infinite time interval, minimizing a quadratic
performance index of the form: V. SIMULATION RESULTS
The controller was tested under different initial conditions,
00 varying intervals of universes of discourse. Fig. 3 and 4 show
/= \\X'QX + U'Rujdt (16) the evolution 9i, 82 from conditions of 20° and -10°
respectively.

where Q GW^" is a symmetric matrix, at least positive a

semi-definite one R e JJ™^™ is also a symmetric positive


definite matrix. The optimal control law is then computed as
follows:

u(t) = -Kx(t)
(17)
K=R'^B'L

where the matrix Le5R™" is a solution of the Riccati


equation:
[5] Li, Q.-R., Tao. W.-H., Na, S., Zhang, C.-Y., Yao, L.-H.: Stabilization
Control of Double Inverted Pendulum System, The 3rd Intetnational
Conference on Innovative Computing Information, and Control (ICICIC'08).
[6] Luo, C , Hu, D., Pang, Y., Zhu, X., Dong, G.: Fuzzy control of a
quintuple inverted pendulum with the LQR method and 2-ary fuzzy piecewise
interpolation function. Proceedings of the 5th IEEE Conference on Decision &
Control FrlP9.6 Manchester Grand Hyatt Hotel San Diego, CA, USA,
December, pp 13-15 (2006).
[7] Horikawa, S.I., Furuhashi, T. Uchikawa, Y.: On fuzzy modeling using
neural networks with the back propagation algorithm. IEEE Trans. Neural
Networks, 3, pp 801-806 (1992).
[8] Lin, C.T., Lee C.S.G.: Neural network based fuzzy logic control and
decision systems. IEEE Trans. Computers, 40, pp 1320-1336 (1992).
[9] Patricar, A., Provence, J.: A self-organizing controller for dynamic
processes using neural networks. Intl. Joint Conf. Neural Networks, 3, pp 359-
364 (1990).
[10] Takagi, H., Hayashi, 1.: NN-driven fuzzy reasoning. Intl. J.
Approximate Reasoning, 5, pp 191-212 (1991).
[11] Kyung, K.H., Lee, B.H.: Fuzzy rule base derivation using neural
network based fuzzy logic controller by self-learning. Proc. IECON'93, 1, pp
435-440 (1993).
Figure 2. Evolution of 9i [12] Sakai, S., Takahama, T.: Learning fuzzy control rules for inverted
theta2 pendulum by simplex method. Proc. of the 13th Fuzzy System Symposium, pp
61-64 (1997).
[13] Takagi, T., and Sugeno, M. Fuzzy identification of systems and its
applications to modeling and control. IEEE Trans. Syst., Man, Cybem., vol.
SMC-15, no. 1, pp 116-132, Jan. (1985).

Figure 3. Evolution of 62

VI. CONCLUSIONS
In this paper an algorithm, using fuzzy optimal control for
stabilizing at an upright position a double inverted pendulum
(DIP), is developed. Modeling is based on Euler-Lagrange
equations. This results in a complicated nonlinear fast reaction,
unstable multivariable system. Simulation results show that the
controller, which the upper pendulum is considered as main
control variable, has high accuracy and quick convergence
speed and higher precision. The control result can be expanded
the control of multilevel inverted Pendulum, and have a
guiding meaning in the control of other unstable system.

REFERENCES
[1] Brockett, R.W., Li, H.: A light weight rotary double pendulum:
maximizing the domain of attraction. In Proceedings of the 42nd IEEE
Conference on Decision and Control, Maui, Hawaii, December (2003).
[2] Furuta, K., Okutani, T., Sone, H.: Computer control of a double inverted
pendulum. Computer and Electrical Engineering, 5, pp 67-84 (1978).
[3] Homik, K., Stinchcombe, M., White, H.: Multilayer feedforward neural
networks are universal approximators. Neural Networks, 2, pp 359-366
(1989).
[4] Furuta, K., Okutani, T., Sone, H.: Computer control of a double inverted
pendulum, Comput. Electr. Eng. 5, pp 67-84.

You might also like