Anda di halaman 1dari 5

1

Swing-Up Fuzzy Controller and Adaptive State


Controller for Inverted Pendulum on Cart System
Phuchong Kheawchaoom,Teerapong Chanasuan, and Waree Kongprawechnon
School of Information, Computer and Communication Technology (ICT)
Sirindhorn International Institute of Tehnology, Thammasat University
P.O.Box22, Thammasat-Rangsit Post Office Pathum Thani 12121, Thailand
Tel: +66(0)25643221-9, Fax: +66(0)29869112-3
E-mail: phuchong.kheawchaoom@studentmail.siit.tu.ac.th

Abstract—An inverted pendulum on a cart with restricted Samatthachai and Taworn [5] presented hybrid controller
travel was a challenge of nonlinear control techniques that which included PD controller to swing up pendulum and
dealing with nonlinear system, unstable, and under actuated. sliding mode controller to stabilize the inverted pendulum. It
It was used for illustration of various control techniques. The
objectives of this study are (i) to design controllers for upswing was also swing-up and balance the pendulum within 5 seconds.
and stabilization of the inverted pendulum on cart, (ii) to
determine which control stategy delivers better performance with In this study, Fuzzy logic controller[6], adaptive state con-
respect to pendulums angle and carts position. Two controllers troller[2] and switching PD controller[5] are designed to the
are presented to swing up pendulum to upright position i.e.
proportional-derivative (PD) and fuzzy logic controller (FLC)
inverted pendulum on a cart for swinging up and stabilizing
for controlling the nonlinear system of inverted pendulum. Later the inverted pendulum respectively.
on, the controller was switch to the adaptive state controller to
stabilize the inverted pendulum on up-right position. Simulation
study has been done in Simulink shows that FLC produced II. M ODELING OF THE INVERTED PENDULUM
better ease swinging up compared to switching PD controller and
Adaptive state controller is robustness for stabilization inverted
pendulum.

I. I NTRODUCTION
An inverted pendulum is a classical problem in control
theories and experiments because of its nonlinear nature,
unstable and under actuated. The controlled inverted
pendulum from its stable pendant position to upright position
was seemed to be a nonlinear control due to the movement of
rod. The angle of pendulum and the movement of a cart are
controlled by only one force that directly apply to the cart
which is called an under actuated problem(i.e. one input-two
outputs). The upright position pendulum is also an unstable Fig. 1. Inverted pendulum on cart
system. It may fall over any time in any direction unless a
suitable control force is applied.
Modeling of an inverted pendulun[7] is shown in Fig. 1.
which derived by the Euler-Lagrange equation of motion
As the previous research, Åström and Furuta [1] solved
which involve determining the kinetic and potential energies of
the problem of swinging up inverted pendulum by an energy
the system. The mathematical model of the inverted pendulum
control strategy without testing on application. Nenad and
is shown in Equations (1) and (2).
Boris [2] implemented on a real inverted pendulum and
compared swinging up based on energy control with fuzzy
multi-swing behavior control. The result appeared that
the fuzzy multi-swing behavior performs better than the F − cẋ = (M + m)ẍ + ml θ̇ 2 sin θ − ml θ̈ cos θ , (1)
2
energy controller. Mariagrazia, et al.[3] introduced a new −bθ̇ = −ml ẍ cos θ + mgl sin θ + (ml + I)θ̈ (2)
Fuzzy Sliding Mode technique based on a piecewise linear
sliding manifold that can swing up and balance inverted where, F is an external force that moves the cart in
pendulum. Pritpal and Frank [4] created only one nonlinear horizontal plane, c is a cart friction coefficient, b is a pivot
controller to control both swing-up and balance based on friction coefficient, M is the mass of cart, m is the mass of
State Dependent Riccati Equation method. It got rid of the rod, l is the length of rod, I is moment of rod inertia, θ is
dividing the swing-up and balance into two different tasks. angle of pendulum, and x is position of cart.
2

A. Common Linear State Space Model θ̇ (cos θ ) < 0. Similarly Ė is negative if ẍ < 0 and θ̇ (cos θ ) > 0
The linearization of differential equation of motion[7] is or ẍ > 0 and θ̇ (cos θ ) < 0.
derived by assuming θ ≈ π. It means that cosθ ≈ cosπ + (π − Therefore, the energy can be pumped into the pendulum by
θ )(−sinπ) = −1, and sinθ ≈ sin(π) + (π − θ ) cos(π) = π − θ . applying force to the cart for generating ẍ (an acceleration
Define a new coordinate as φ = θ − π ,then sin θ ≈ π − (φ + on the cart) satisfying the sign conditions listed as previously
π) = −φ . According to this assumption, the common linear mentioned. However, the controller cannot only concentrate
state-space model is derived by inherit the inverted pendulum on swinging-up the pendulum without considering the limited
parameter from [5] after that the pivot frictions is assumed to range of x for travelling cart. Therefore, E has to be controlled
be zero(b = 0) and the moment ofrod inertia I = 0, where whilst keeping the constraint on x in mind.
0 1 0 0 0
 46.7103 0 0 1.028  −6.2305 TABLE I
A= , B= , RULE OF S WINGING UP F UZZY ALGORITHM
 0 0 0 1   0 
−1.8776 0 0 −0.257 1.5576
T
 
y = φ φ̇ x ẋ .

ẋ = Ay + BF (3)
The state-space model representation of inverted pendulum
on a cart system is shown in Equation(3).

III. C ONTROLLER STRUCTURE


The structure of fuzzy and adaptive state controller is shown
in Fig. 2.

Fig. 2. Structure of control

Fig. 3. Fuzzy Control surface

A. Swinging up Fuzzy logic controller In fuzzy controller, the angle of pendulum, angular velocity
Fuzzy logic controller is designed to swing up the pendulum of pendulum and position of cart is determined as an input
from its pendant position to the ±0.262 rad of upright position of fuzzy controller when the output is force that applied to
without exceeding the limited course of motion. The basic the cart. The definition range of the variable are as follow;
strategy is to move the cart in such a way that energy is slowly cart position x ∈ [-0.3 m, 0.3 m] (due to the length of
pumped into the pendulum. This is achieved by satisfying a linear slide is 0.6 m), pole angle : θ ∈ [-3.14 rad, 3.14 rad],
particular mathematical condition derived from the mechanical angular velocity : dθ /dt ∈ [-8 rad/s, 8 rad/s], Force : ∈
energy equations while designing the rule base of fuzzy control [-2.9 N, 2.9 N]. There are three input variables of the system
system. The total mechanical energy of the pendulum and its which are θ , dθ /dt, and x and one output variable which
derivative Ė are given by [9]. is force(F). The rule for Fuzzy logic algorithm is shown
in Table I which includes the condition that if x equals
1 to positive large (negative large), the action value will be
E = ml 2 θ 2 + mgl(1 − cos θ ), (4) negative large (positive large). Memberships function is shown
2
Ė = ml θ̇ (cos θ )ẍ, (5) in Fig. 4. The Fuzzy logic control surface is shown in Fig. 3.
F = M ẍ. (6)
This reference input is derived from (θ , θ̇ ) and generates ẍ
satisfying the sign condition listed as previously mentioned.
From Equations (4),(5), and (6), it show that energy E can This is done in order to control E to the prescribed value
be pumped or removed from the system by changing the sign corresponding to the energy of the pendulum at the upright
of Ė. Thus Ė is positive if ẍ > 0 and θ̇ (cos θ ) > 0 or ẍ < 0 and equilibrium point. Since the pair of (θ , θ̇ ) that makes E equals
3

acceleration of cart when the angle of pendulum is zero or at


pendant position. Therefore, the criterion for moving the cart
to the next assigned position is zero angle condition occurred
at the stop point of the present position. The sequential
traveling positions of cart are assigned to be 10, -10, 10, -
10, and 2 cm.

C. Stabilizatiion of pendulum
After pendulum swings up and approaches to linearized
point, the controller will switch to Adaptive State Controller
for stabilizing pendulum around upright position. The adaptive
state controller responsibled for stabilizing the pendulum in
upright position. Adaptation method is based on N2 norm of
the state vector which is shown in Equation (9).
q
N2 (y) = (φ 2 + φ̇ 2 + x2 + ẋ2 ). (9)
The LQR[6] is used to find the optimal gain matrix K,
where
K = R−1 BT S. (10)
That minimizes the cost function,
Z
JLQR = (yT Qy + F T RF) dt, (11)

where S is given by a solution of the following Riccati


equation,
AT S + SA − SBR−1 BT S + Q = 0. (12)
The output of state controller F becomes

Fig. 4. Memberships function for Fuzzy logic algorithm.


F = k1 φ + (k2 − N2 (y))φ̇ + k3 x + (k4 + N2 (y))ẋ, (13)
where y is state parameters, Q and R are weighting param-
to the desired value is not unique, the upright equilibrium point eters. Since this control law is based on the linearized system,
cannot be stabilized using only this control method. For this the adaptive state-feedback controller is only effective when
reason a different control law is utilized when the pendulum the pendulum is near the upright position.
approaches the upright equilibrium point. This is referred to
as stabilizing control. IV. S IMULATION RESULTS
In this section, the parameter values[4] of the inverted
B. Switching PD controller pendulum system are shown in Table II.
The control law for controlling position of cart is
TABLE II
PARAMETER VALUE
de(t)
F(t) = K p e(t) + Kd , (7)
dt
where K p and Kd are the proportional and the derivative
gains respectively, and e(t) is the error of the cart position.
The PD controller is tuned by pole placement.The choosen
dominant closed-loop poles at s = −88.39 which correspond In order to investigate the efficiency of the proposed hybrid
to 0.5 second for settling time and 5% for percent overshoot. controller, the length variation of the inverted pendulum will be
Thus, the desired proportional gain K p and derivation gain Kd increase and decrease from the original length of 25 cm. The
are respectively obtained as 97.205 and 12.54. simulation results when varying the length of the pendulum
Due to the relative movement of the cart and the pendulum as l = 22.5 and 25 cm are shown in Fig. 5 to Fig. 8. It can
in Equation (8), be seen that the pendulum can be swung up from the natural
pendent position to the upright position within 3 seconds when
using PD controller and within 5 seconds when using fuzzy
l θ̈ = ẍ cos θ − g sin θ , (8)
controller for l = 25. For l = 22.5, the PD controller cannot
swing the pendulum up to the upright position but fuzzy
the angular acceleration of pendulum is highly effective by controller can swing the pendulum to the upright position
4

Fig. 5. Pendulum angle of swing up the pendulum with the fuzzy controller Fig. 8. Pendulum angle of swing up the pendulum with the PD controller
and stabilization with adaptive state controller when length of the rod is 25 and stabilization with adaptive state controller when length of the rod is 22.5
cm.

Fig. 9. Noise input


Fig. 6. Pendulum angle of swing up the pendulum with the PD controller
and stabilization with adaptive state controller when length of the rod is 25
cm.

within 6 seconds.The system is switched to Adaptive state


controller to stabilize the pendulum at it upright position when
the switching condition is |θ | < 0.262 radian. For the adaptive
state controller, the optimal gain matrix is calculated which
is K = [-43.9883 -7.3902 -12.2474 -10.2267] when R = 0.1
and Q = diag[8 1 15 1] are selected. After changing reference
position of cart and applying noise to force input as Fig. 9,
the results of pendulum angle and cart position are shown in
Fig. 10 and Fig. 11.
Fig. 10. Simulation result of tracking reference with adaptive state controller
after giving noise

Fig. 7. Pendulum angle of swing up the pendulum with the fuzzy controller
and stabilization with adaptive state controller when length of the rod is 22.5
cm. Fig. 11. Simulation result of balacing the pendulum with adaptive state
controller after giving noise
5

V. CONCLUSIONS
In conclusion, the control stategy with a simple fuzzy logic
controller perfrom that it can swing the pendulum up to
upright postion within 5 seconds and without exceed a limited
distance. This Fuzzy logic controller is more comfortable
than Switching PD controller from the [5]. After controller
switch to adaptive state controller, it can balance pendulum
with tracking on reference cart position when the reference
position of cart is changed. After giving noise to the force
input, the results have shown that Adaptive state controller
tolerates to noise by tracking reference position and balancing
pendulum on up-right position. The further study is verifying
by experimental study.

R EFERENCES
[1] K.J. Åström and K. Furuta, ”Swinging up a pendulum by energy control”,
in Automatica, vol. 36, no. 2,pp. 287-295,Feb. 2000
[2] Nenad Muskinja and Boris Tovornik, ”Swing Up and Stabilization of a
Real Inverted Pendulum”, IEEE Trans. Ind. Electron.,vol. 53, no. 2,April.
2006
[3] Mariagrazia Dotoli,Bruno Maione, David Naso and Biagio Turchiano,
”Fuzzy Sliding Mode Control for Inverted Pendulum Swing-up with
Restricted Travel”, 10th IEEE International Conference on Fuzzy Systems
The University of Melbourne, Australia December 2001
[4] Pritpal Dang and Frank L.Lewis, ”Controller for Swing-Up and Balance
of Single Inverted Pendulum Using SDRE-Based Solution”, Industrial
Electronics Society, 2005. IECON 2005. 31st Annual Conference of IEEE
[5] Samatthachai Panya and Taworn Benjanarasuth, ”Hybrid Controller for
Inverted Pendulum System”, Communications and Information Technolo-
gies, 2008. ISCIT 2008. International Symposium on
[6] Christopher T.Kilian, Modern Control Technology Components and Sys-
tems, 3rd edition,DELMAR THOMSON LEARNING,2006
[7] Andrew K.stimac, ”‘Standup and Stabilization of the Inverted Pendulum”,
Report at MIT on June 1999
[8] Jeffrey B. Burl, ”‘Linear optimal control H2 and H∞ methods”, Addison
Wesley Longman, Inc.,1999
[9] SINGH VIVEKKUMAR RADHAMOHAN, MONA SUBRAMANIAM
A, DR. M.J.NIGAM, ”‘FUZZY SWING-UP AND STABILIZATION OF
REAL INVERTED PENDULUM USING SINGLE RULEBASE”, Journal
of Theoretical and Applied Information Technology

Anda mungkin juga menyukai