Fuzzy Optimal Control For Double Inverted Pendulum
Fuzzy Optimal Control For Double Inverted Pendulum
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_
f :5R'' ^ 9 ? (3)
y = f(xi,x2,...,x^)
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 \
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
X k=[Pk4-\,...j3t\, 4-\k.../r^u
k "mk
P^r\k-P, ('!••'•»)
'mk
Figure 1. Membership fimctions
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:
u(t) = -Kx(t)
(17)
K=R'^B'L
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.