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 ofrod 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).
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
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)
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. 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