Midiendo La Complejidad Computacional

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Computers and Electrical Engineering 61 (2017) 31–47

Contents lists available at ScienceDirect

Computers and Electrical Engineering


journal homepage: www.elsevier.com/locate/compeleceng

Fuzzy-logic control of an inverted pendulum on a cartR


Ahmad Ilyas Roose a, Samer Yahya b,∗, Hussain Al-Rizzo b
a
Department of Mechanical, Materials and Manufacturing Engineering, The University of Nottingham, Malaysia Campus, Malaysia
b
Systems Engineering Department, George W. Donaghey College of Engineering and Information Technology, University of Arkansas at
Little Rock, Little Rock, AR, USA

a r t i c l e i n f o a b s t r a c t

Article history: The inverted pendulum on a cart is an under actuated, unstable non-linear system that is
Received 14 January 2016 used as a benchmarking problems in control theory. The non-linear nature of the system
Revised 15 May 2017
makes linear controllers, such as the proportional integral derivative (PID) controllers, pos-
Accepted 15 May 2017
sibly unfeasible as they only guarantee stability of a linear system. A fuzzy-logic controller
Available online 2 June 2017
provides many different stable controllers applicable to inverted pendulum on a cart. In
Keywords: this paper, the fuzzy parallel distributed compensation (PDC) controller is introduced and
Inverted pendulum on a Cart implemented on an unstable system, and the performance is demonstrated in MATLAB
Fuzzy-logic control Simulink. The fuzzy PDC controller is dependent on the Takagi–Sugeno (TS) fuzzy model
Parallel distributed compensation control to obtain the state feedback gains required by solving the linear matrix inequalities (LMI).
Takagi–Sugeno Fuzzy Inference Systems The LMI produced satisfactory results for all initial pendulum positions simulated even
under uniformed disturbance. Our results have been compared against two other works to
reveal the effectiveness of the proposed model.
© 2017 Elsevier Ltd. All rights reserved.

1. Introduction

An inverted pendulum on a cart presents a classical problem in dynamics and control theory due to its complex, multi-
variable, non-linear, and unstable system. It consists of two degrees of freedom (DOF), an inverted pendulum which is
attached to a cart, where the only actuated DOF provides the horizontal motion of the cart. This means that for all control
algorithms to be tested on this system, the main objective is to stabilize the pendulum in the upright position for any initial
pendulum position above the horizontal axis. As it is a benchmarking problem for testing control algorithms, numerous
research has been reported encompassing Proportional Integral Derivative (PID) controller [1], Linear Quadratic Regulators
(LQR) [1], state-space controller [2], Neural Networks (NN) [3], and fuzzy-logic controllers [4–11].
Applications range from simulating the human balancing system [12], missile guidance systems, seismometers and most
notably, self-balancing two-wheeled vehicle such as the one which has already been commercialized as the Segway Personal
Transporter (PT) [13].
The term ‘fuzzy’ implies that decisions made by a machine cannot be exclusively expressed as ‘true’ or ‘false’, but instead
as partially ‘true’ and ‘false’ for each of the defined linguistic variables such as ‘high’, ‘medium’, ‘low’ . These partial ‘truths’
are expressed as membership functions ranging from zero to one quantifying how true a linguistic variable is. All of the
linguistic variables and their membership functions are used in the rule- base design to determine the fuzzy controller
output.

R
Reviews processed and recommended for publication to the Editor-in-Chief by Associate Editor M. S. Kumar.

Corresponding author.
E-mail address: [email protected] (S. Yahya).

http://dx.doi.org/10.1016/j.compeleceng.2017.05.016
0045-7906/© 2017 Elsevier Ltd. All rights reserved.
32 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fuzzy-logic control provides a natural, flexible and intuitive way to express ambiguous responses in systems where the
dynamics may be too complex or not known. Fuzzy-logic control can also be combined with conventional controllers such as
the linear PID controller, which traditionally only guarantees stability for linear systems, allowing it to control a non-linear
system, hence providing improved robustness and response as demonstrated in [5,8].
The use of the Fuzzy PID controller to control an inverted pendulum on a cart was discussed in [4,5]. While [4] imple-
mented a fuzzy PD controller to stabilize the system, an LQR and a conventional PID controller are implemented in [5] to
compare the performance with the fuzzy-logic controller. The performance showed that the fuzzy-logic controller provided
much better response or settling time, lowest overshoot, and the least fluctuations.
The idea behind the controller is to design a rule-base such that mimics the ideal response of the conventional PID
controllers. For this purpose, equations governing conventional PID controllers are discretized to arrive at the fuzzy model,
where the output of the controller depends on the error-prone defuzzification process and the derivative of the system as
the inputs. This type of controller uses the Mamdani based Fuzzy Inference Systems (FIS) for the construction of the rule
base and the defuzzification process.
Commonly, the derivative, integral, and proportional gains are usually optimized via LQR method in [6], this has been
further expanded by fine-tuning the gains of the controller using an immune PD control algorithm. The algorithm works by
attempting to mimic the immune mechanism in a biological system. The implementation, the fuzzy immune PD controller
yields improved settling time and reduced overshoot when compared to the LQR tuned fuzzy PD controller.
For the PDC controller, the Takagi–Sugeno FIS is used. Initially introduced in [8] and emulated in [9], the controller is
applied on a simplified dynamic model of the inverted pendulum on a cart. The simplification is achieved by neglecting
the Lagrange cart position equations, since the problem only involves the stabilization of the inverted pendulum, not the
control of the cart. In our paper, local approximation is used to create the rule-base of the TS fuzzy model. Results show
that the controller is stabile to the inverted pendulum at all positions when compared to the basic linear controller which
only allowed stabilization for angles ranging from − π4 to π4 r.
However, it is mentioned in [9] that for some systems, the local approximation method does not guarantee stabilization.
From this, [7] attempted the full dynamic model, and the sector non-linearity instead of local approximation to construct
the rule-base for the design of the controller. For three points of initial pendulum position and their derivatives tested, the
pendulum achieved less than ideal stabilization containing fluctuations. The use of sector non-linearity guarantees stabiliza-
tion of the controller with the expense of design feasibility. A performance-oriented PDC was also initially introduced and
implemented in [18], which works on the assumption that the compensating gains for the conventional fuzzy PDC controller
is not fixed. The performance-oriented PDC showed better results when compared to the conventional fuzzy PDC method.
In [10], the use of a robust fuzzy controller is to compensate the approximation error that causes stabilization issues due
to the use of local approximation in the construction of the rule-base. The robust fuzzy controller is simply an improvement
to the fuzzy PDC controller, allowing it to guarantee stabilization of the controller, while reducing the work-load on the
design of the rule-base. Results showed satisfactory performance where the performance was better than the conventional
fuzzy PDC controller.
The optimal fuzzy controller is designed to optimize the fuzzy PDC controller or the robust fuzzy controller providing
better response and less overshoot as demonstrated in [9]. Reference [11] implemented this controller on the inverted pen-
dulum on a cart system with decent performances.
The paper is structured as follows: in Section 2, the PDC controller has been built and the Takagi-Sugeno has been
introduced and explained. In Section 3, the dynamics of inverted pendulum on a cart has been explained, and the dynamics
equations have been derived. The fuzzy controller has been designed in Section 4. Section 5 showed the simulation and
results of the controller and the comparison against other works. Finally, Section 6 concludes the results and findings of the
paper.

2. Fuzzy Inference Systems

In this section, the Takagi–Sugeno is selected and explained. Next, the PDC controller is built based on the TS fuzzy
model and the structure of the controller is covered. The PID controller is also briefly explained since it will be used for
comparison against the fuzzy controller.
The output of the controller for any fuzzy controller is governed by the defuzzification process and its rule-base after
which the inputs are fuzzified into membership functions. The defuzzification process depends on two FIS: Mamdani and
Takagi–Sugeno. Fig. 1 describes the fuzzy inference system.
While both FIS uses membership functions to fuzzify the inputs or premise variables, Takagi–Sugeno FIS uses a weighted
average method to compute the output of the fuzzy model; which is different from the Mamdani FIS that requires the
defuzzification of the consequent to compute the output. In other words, the consequent for Mamdani FIS rule-base is fuzzy
in nature, while the consequent for Takagi–Sugeno FIS is not. This fuzzy nature allows Mamdani FIS to be more intuitive
and interpretable in design at the expense of computational power. The lack of a fuzzy consequent allows the integration of
Takagi–Sugeno FIS with adaptive and optimization techniques. For these reasons, the Takagi–Sugeno FIS is selected in this
paper. The difference in the defuzzification process is depicted in Fig. 2.
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 33

Fig. 1. Fuzzy inference system [14].

Fig. 2. Difference in defuzzification process [14].

The TS fuzzy model was first introduced by Takagi and Sugeno [15]. The main idea of the Takagi–Sugeno FIS method
partitions a nonlinear system dynamic into linearized subsystems, such that the overall behavior of the system would be
captured via fuzzy blending of all the subsystems.
In general, there are two approaches to construct the fuzzy model: identification using input-output data, and derivation
from the dynamics of the non-linear system. Since the dynamics equations of the system are known for this project, the
second approach would be used in this paper.
Any non-linear system can be represented in the form of:
x˙ (t ) = Ax(t ) + Bu(t ) (1)
The TS fuzzy model presented in [16] can be used to approximate the non-linear system defined in (1) as:

r
x˙ (t ) = hi (z (t ) )[Ai x(t ) + Bi u(t )] (2)
i=1

where
r

r
wi (z (t ) )
hi (z (t ) ) = ir=1
i=1 i=1 wi (z (t ) )

and z refers to the inputs of the system, h denote the normalized weights for the corresponding premise variables z; w
represent the weights computed from the inference mechanism of either the product or the minimum of the membership
functions fired for each rule in the fuzzification process. This is means that for each rule, if there are four premise variable
34 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Table 1
System parameters.

Description Notation Value

Mass of cart M 1 kg
Mass of pendulum m 0.2 kg
Length of pendulum L 1m
Gravity g 9.8 m/s2

involved; for each rule, the minimum or product of each membership functions fired involved in each premise variable is
computed. In this work, the product inference mechanism is used. To define the other variables: uis the control output, state
variables are defined as x, r is the total number of rules, and i is the rule number.
The ith linear subsystems are represented by the equation Ai x(t) + Bi u(t) that can be found from the system dynamics (1).
The number of linear subsystems depends on the method of constructing the rule-base. The TS fuzzy model rule-base has
the form of:

IF z1 is M1m , . . . . . . . . . AND zn is Mnm


T HEN x˙ (t ) = Ai x(t ) + Bi u(t )

where M is the mth membership function of the nth premise variable.


There are two methods for constructing the TS fuzzy model rule-base; the first being sector non-linearity and the second
is local approximation [16]. If the purpose of the project is merely to approximate the system via a fuzzy model, it is simpler
to use only local approximation, or a combination of both. Local approximation functions by approximating the non-linear
terms in the dynamics by the selected linear terms; leads to reduction of rules when compared with sector non-linearity.
The problem encountered by local approximation is that for a controller to stabilize a system, it cannot guarantee stability
[16]. This is unlike local sector non-linearity first introduced in [17] which aims of finding a sector boundary where each
non-linear term operates in. This means that each premise variable corresponds to each unique non-linear term in the
system dynamics. From the reasons mentioned, only sector non-linearity method is used to construct the rule-base in this
paper.
The purpose of the TS fuzzy model is to define the ith matrices to be used in the fuzzy PDC controller design.
First introduced in [8], the idea of the PDC controller is to design a compensator for each linear subsystem of the TS
fuzzy model. In this case, the fuzzy PDC controller is analogous to the TS fuzzy model, possessing the same membership
functions and the antecedent part of the rule-base defined as:

IF z1 is M1m , . . . . . . . . . AND zn is Mnm


T HEN u(t ) = −Fi x(t )

Likewise, the fuzzy PDC controller is designed to stabilize the TS fuzzy model (2) is defined as:


r
u(t ) = − Fi x(t ) (3)
i=1

where Fi are the feedback gains to be found for each ith rule.
Substituting the above Eq. (3) into (2) yields the closed loop equation of:


r 
r  
x˙ (t ) = hi (z (t ) )h j (z (t ) ) Ai − Bi Fj x(t ) (4)
i=1 j=1

Initially reported in [18] and implemented in [16], stability analysis was done on the closed loop Eq. (4) to find linear
matrix inequalities (LMI) which must be satisfied to find each local feedback gains Fi . Following the theorem in the work of
[16]:

Theorem 1. The equilibrium of the continuous fuzzy control system described by (4) is globally and asymptotically stable if there
exists a common positive definite matrix P such that:

GTii P + P Gii < 0


 T   (5)
Gi j +G ji Gi j +G ji
2
P+P 2
≤0

Where Gij = Ai − Bi Fj
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 35

Fig. 3. Inverted pendulum on a cart.

Fig. 4. Simulink model of controller and plant.

This can be expressed as:

X ATi + Ai X − MiT BTi − Bi Mi < 0

X ATi + Ai X − MTj BTi − B j Mi + X ATj + A j X − MiT BTj − Bi M j ≤ 0 (6)

i< j

where X = P − 1 and the state feedback gains are found from Fi = Mi X − 1


From of [16] and [18] the proof of the LMI is as follows:

Theorem 2. The equilibrium of the continuous fuzzy system (2) with u(t) = 0 is globally and asymptotically stable if there exists
a common positive definite matrix P such that the Lyapunov function defined below as:

ATi P + P Ai < 0 (7)

Introducing the Lyapunov candidate and its derivative as:

V = xT P x
(8)
V˙ = x˙ T P x + xT P x˙
36 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fig. 5. Simulation results of pendulum position vs. time for set 1.

Substituting the closed loop Eq. (4) into the above (8) yields:

T

r
T T
 
r 
r
Gi j + G ji Gi j + G ji
V˙ = hi x GTii P + P Gii x + 2 hi h j x T
P+P x (9)
2 2
i=1 i=1 j=1

where i < j
G +G G +G
It can be seen that ( i j 2 ji )T P + P ( i j 2 ji ) is the same as the LMI conditions in Theorem 1, thus this completes the proof.
The PID controller works by continuously calculating the error e defined as the difference between the measured output
and the desired set-point. In this work, the set-point is zero as it is a stabilization problem. The controller then attempts to
minimize the error over time via the controller input. The PID controller is defined as:

t de
u(t ) = K p e(t ) + Ki ∫ e(τ )dτ + Kd (10)
0 dt

where Kp , Ki , and Kd are the proportional, integrative, and derivative gains respectively; which have to be fine-tuned to pro-
vide a good response of the system. In this work, MATLAB Simulink integrated tuner is used to optimize the gains. For
fine-tuning, increasing Kp improves response with the expense of stability, increasing Ki minimizes the off-set of the con-
troller output, and increasing Kd damps the response to give much less fluctuations. It is worth noting that unlike the fuzzy
controller, the PID controller functions on the linearized dynamics about an operating point. In this work, this operating
point is zero.

3. Dynamics of inverted pendulum on a cart

The above diagram, Fig. 3 presents the inverted pendulum on a cart. It can be seen that M and m represents the mass
of the cart and the pendulum respectively, θ is the pendulum position, F represents the force exerted on the cart in the
horizontal direction which represents the control action, L is the length of the pendulum link, and g is gravity.
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 37

Force or Control Input vs. Time


1.5
x2 = 0.2
0.4
0.6
0.8
1.0
1
1.2
1.4

0.5
Force or Control Input (N)

-0.5

-1

-1.5
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
Fig. 6. Simulation results of force or control input vs. time for set 1.

The dynamics of the system is derived assuming that the pendulum is a point mass, which implies that there is no
uniform mass along the pendulum link, and there is negligible friction in the pendulum link joint and the wheels.
The Euler Lagrange method is utilized to derive the dynamic model using the following general equations of:

L = T −U
(11)
d δL δL
− = Qi
dt δ x˙ δx

where T and U is the total kinetic and potential energy of the systems respectively, Qi is the forced function representing
the force or torque applied to the system, and xi are the generalized coordinates or the state variables.
Deriving the equations of the inverted pendulum yields:

(M + m)ẍ + mLθ̈ cos (θ ) − mLθ˙ 2 sin (θ ) = u


(12)
Lθ̈ + ẍ cos (θ ) − gsin(θ ) = 0

Putting the state variables as x = [x1 x2 x3 x4 ] = [x θ x˙ θ˙ ] and representing the equations in the form of
(1), one obtains:

x˙ = Ax + Bu (13)
38 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fig. 7. Simulation results of pendulum position vs. time for set 2.

where
⎡ ⎤
0 0 1 0
⎢ ⎥
⎢0 ⎥
⎢ 0 0 1 ⎥
1 ⎢ ⎥
A= ⎢ −mgLcos(x2 )sin(x2 ) ⎥
det(E ) ⎢0 0 mL x4 sin(x2 )
2

⎢ x2 ⎥
⎣ (m + M )gsin(x2 )

0 0 −mLx4 cos (x2 )sin(x2 )
x2
⎡ ⎤
0
1 ⎢ ⎢ 0 ⎥

B=
det(E ) ⎣ L ⎦
−cos(x2 )

  
det (E ) = L m 1 − cos2 (x2 ) + M

It can be seen that (12) is independent of any non-linear x1 and x3 . As the objective of this paper is to stabilize the in-
verted pendulum, with no required control of the cart position; as mentioned in Section 2.2, the equations can be simplified
into a 2 × 2 matrix. However, in this work, the full dynamic model will be used in the design of the TS fuzzy model and the
fuzzy PDC controller similar to the work reported in [7].
As an inverted pendulum, the bounds x2 ∈ [− π2 , π ] are followed. The bounds for the pendulum velocity are self de-
2
fined as x4 ∈ [−1, 1]rad/s.
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 39

Fig. 8. Simulation results of force or control input vs. time for set 2.

4. Design of fuzzy controller

Following the sector non-linearity method, the premise variables zn from the system dynamics (12) are defined as:
1
z1 =   
L m 1 − cos2 (x2 ) + M
sin (x2 )
z2 =
x2
z3 = cos (x2 )

z4 = x4 sin(x2 )

And the membership functions for each premise variable are:

z1
max z1 − z1
M11 =
max z1 − min z1
z1 − min z1
M12 =
max z1 − min z1
z2
max z2 − z2
M21 =
max z2 − min z2
z2 − min z2
M22 =
max z2 − min z2
z3
max z3 − z3
M31 =
max z3 − min z3
40 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fig. 9. Simulation results of pendulum position vs. time for set 3.

z3 − min z3
M32 =
max z3 − min z3
z4
max z4 − z4
M41 =
max z4 − min z4
z4 − min z4
M42 =
max z4 − min z4

where min zn and max zn represent the minimum and maximum premise values, respectively which depends on the de-
fined bounds. The membership functions, Mn1 and Mn2 become the degree of ‘trueness’ of the minimum and maximum
values.
Following this, the rule-base that consists of 24 = 16 rules for the TS fuzzy model is constructed as follows:

Rule 1: IF z1 is M11 , z2 is M21 , z3 is M31 AND z4 is M41


T HEN x˙ = A1 x + B1 u
Rule 2: IF z1 is M11 , z2 is M21 , z3 is M31 AND z4 is M42
T HEN x˙ = A2 x + B2 u
Rule 3: IF z1 is M11 , z2 is M21 , z3 is M32 AND z4 is M41
T HEN x˙ = A3 x + B3 u
Rule 4: IF z1 is M11 , z2 is M21 , z3 is M32 AND z4 is M42
T HEN x˙ = A4 x + B4 u
Rule 5: IF z1 is M11 , z2 is M22 , z3 is M31 AND z4 is M41
T HEN x˙ = A5 x + B5 u
Rule 6: IF z1 is M11 , z2 is M22 , z3 is M31 AND z4 is M42
T HEN x˙ = A6 x + B6 u
Rule 7: IF z1 is M11 , z2 is M22 , z3 is M32 AND z4 is M41
T HEN x˙ = A7 x + B7 u
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 41

Fig. 10. Simulation results of force or control input vs. time for set 3.

Rule 8: IF z1 is M11 , z2 is M22 , z3 is M32 AND z4 is M42


T HEN x˙ = A8 x + B8 u
Rule 9: IF z1 is M12 , z2 is M21 , z3 is M31 AND z4 is M41
T HEN x˙ = A9 x + B9 u
Rule 10: IF z1 is M12 , z2 is M21 , z3 is M31 AND z4 is M42
T HEN x˙ = A10 x + B10 u
Rule 11: IF z1 is M12 , z2 is M21 , z3 is M32 AND z4 is M41
T HEN x˙ = A11 x + B11 u
Rule 12: IF z1 is M12 , z2 is M21 , z3 is M32 AND z4 is M42
T HEN x˙ = A12 x + B12 u
Rule 13: IF z1 is M12 , z2 is M22 , z3 is M31 AND z4 is M41
T HEN x˙ = A13 x + B13 u
Rule 14: IF z1 is M12 , z2 is M22 , z3 is M31 AND z4 is M42
T HEN x˙ = A14 x + B14 u
Rule 15: IF z1 is M12 , z2 is M22 , z3 is M32 AND z4 is M41
T HEN x˙ = A15 x + B15 u
Rule 16: IF z1 is M12 , z2 is M22 , z3 is M32 AND z4 is M42
T HEN x˙ = A16 x + B16 u

With the defined system parameters and bounds, the values of Ai and Bi will be defined in Appendix A. The values of the
feedback gains Fi are found by solving the LMI (6) from the matrices using MATLAB’s Robust Control Toolbox. Note that the
solutions for the gains are not strictly feasible; looking at the inequalities in (6), the left hand side is approximately equals
to the right hand side. Yet, this still yields satisfactory results that will be presented in the next section.
42 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fig. 11. Comparison of the three controllers at x2 (0) = 25◦ .

5. Simulation

Fig. 4 presents the Simulink model which includes the dynamics of the plant in (13) and the fuzzy PDC controller defined
in (3). The first set of simulations was done for seven different initial pendulum positions, 0 < x2 < π2 r. For the seven tests,
the pendulum velocity x4 is kept at zero. The second set maintains the initial pendulum position at x2 = 0.8 while varying the
velocity of the pendulum at four different points between 0 < x4 < 1rad/s. The third set introduces a uniform disturbance in
the force in the form of a pulse generator of 10 Hz and 2 N. This set was tested at the exact same four points as the second
set. The last set compares the fuzzy PDC controller and the PID controller for one point: x2 = 1.2, x4 = 0.8 under the effect of
the same uniform disturbance of the third set.
Figs. 5–10 present the results for all four sets over a span of 10 s for the pendulum position and force or control input,
respectively.
From Figs. 5 and 6, it can be seen that the controller stabilized the system at all the points tested. As the initial position
of the pendulum increases away from zero, the overshoot and settling time increases. Only at the point of x2 (0) = 1.4, did
the performance of the controller behaved differently giving a double overshoot where the first overshoot is comparatively
much larger. The controller input plot suggests that at this point, the initial estimation was underestimated forcing the
control input to increase slightly before falling which leads to the large overshoot.
From Figs. 7 and 8, it is shown that increasing the initial pendulum velocity increases the overshoot slightly for the
pendulum position, but the effect on the controller input is negligible. This observation is the same when under the effect
of uniformed disturbance, providing slightly more overshoot compared to the non-disturbance results as seen in Fig. 9
and 10.
To show the efficiency of the proposed model, the results have been compared against the results of the models are
reported in [7] and [8] respectively. The dynamics of the inverted pendulum on a cart system in [7] using our variables is
given below:

x˙ = Ax + Bu
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 43

Fig. 12. Comparison of the three controllers at x2 (0) = 50◦ .

where

⎡ ⎤
0 0 1 0
⎢0 0 0 1 ⎥
⎢ ⎥
A= 1 ⎢ mgLcos(x2 )sin(x2 ) ⎥
det(E ) ⎢0 0 mL2 x4 sin(x2 ) ⎥
⎣ x2

0 − (m+M)xgsin
2
( x2 )
0 −mLx4 cos (x2 )sin(x2 )
⎡ ⎤
0
⎢ ⎥
⎢ 0 ⎥
B= 1
det(E ) ⎢ ⎥
⎣ L ⎦
−cos(x2 )

  
det (E ) = L m 1 − cos2 (x2 ) + M

For the work of [8], strictly feasible solutions can be found. The parameters used in this paper and are given in Table 1,
which are different from the parameters defined in [8]. The controller design is exactly replicated using the method
of local approximation, with its defined bounds for the pendulum position between −88◦ and 88◦ which explains the
variable β = cos( ± 88◦ ) in [8]. As mentioned earlier, this paper uses simplified 2 × 2 matrices in the dynamics which ignore
the control of the cart position. Using the defined matrices defined in [8]:
44 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

Fig. 13. Comparison of the three controllers at x2 (0) = 75◦ .




0 1 0
A1 = g , B1 = a
4l 0 − 4l −aml
3 −aml 3




0 1 0
A2 = 2g , B2 = − aβ
π ( 4l3 −amlβ 2 )
0 4l
3 −aml β2
where
1 L
a= , l=
m+M 2
Then, substituting the parameters in Table 1, and solving the LMI, we obtain the gains:
 
F1 = −148.96 −43.06
 
F2 = −317.13 −93.18
To compare the proposed 16-rule fuzzy PDC controller, the PID controller and the 2-rule fuzzy PDC controller in [8],
simulations were performed at an initial pendulum position of 25◦ , 50◦ , and 75◦ The results are presented in Figs. 11–13.
Fig. 14 presents the results under a uniform disturbance of 10 Hz and 2 N with the initial pendulum position as in Fig. 13,
and initial pendulum velocity of 0.8 rad/s.
The results indicate that while all controllers exhibited increased settling time when moving away from the stable po-
sition of x2 = 0, the effect is much more pronounced for the 16-rule fuzzy PDC controller, and the smallest pronounced for
the 2-rule fuzzy PDC controller. Applying uniform disturbance accentuates the observation. The 2-rule fuzzy PDC controller
yields absolutely no overshoot for all the simulations.

6. Conclusion

The fuzzy PDC controller implemented in this paper successfully stabilized the inverted pendulum on a cart as re-
vealed from the results even under the effects of uniformed disturbances. A comparison between our results and the results
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 45

Fig. 14. Comparison of three different controllers under uniform disturbance.

reported in [7] and [8] shows that the controllers increased settling time when moving away from the stable position and
it is more pronounced for the 16-rule fuzzy PDC controller than for the 2-rule fuzzy PDC controller. Using MATLAB Robust
Control Toolbox, the gains found were not strictly feasible, when compared to the work in [8], in which the strictly feasi-
ble gains produced better results. This is due to the local approximation method used to construct the rule-base instead of
sector-nonlinearity which is used in this paper. This allowed for fewer LMI equations to solve; which made it easier to find
strictly feasible solutions. The problem with local approximation method is that it does not guarantee stabilization of the
system; hence it may not be applicable for all systems. It can be concluded that if strictly feasible solutions were found,
then the fuzzy PDC controller would perform better than the PID controller.

References

[1] Prasad L, Tyagi B, Gupta H. ’Optimal control of nonlinear inverted pendulum system using PID controller and LQR: performance analysis without and
with disturbance input. Int J Autom Comput 2014;11(6):661–70.
[2] Grasser F, D’Arrigo A, Colombi S, Rufer AC. JOE: a mobile, inverted pendulum. IEEE Trans Ind Electron 2002;49(1):107–14.
[3] Li Z, Yang C. ‘Neural-adaptive output feedback control of a class of transportation vehicles based on wheeled inverted pendulum models’. IEEE Trans
Control Syst Technol 2012;20(6):1583–91.
[4] Wu J, Zhang W, Wang S. ‘A two-wheeled self-balancing robot with the fuzzy PD control method’. Math Prob Eng 2012;2012:1–13.
[5] Bature AA, Buyamin S, Ahmad MN, Muhammad M, Muhammad AA. ‘Identification and model predictive position control of two wheeled inverted
pendulum mobile robot’. Jurnal Teknologi 2015;73(6).
[6] Fang J. ‘The research on the application of fuzzy immune PD algorithm in the two-wheeled and self-balancing robot system’. Int J Control Autom
2014;7(10):109–18.
[7] Vafaee K, Geranmehr B. ‘Controlling Inverted pendulum using performance-oriented PDC method’. J Autom Control 2014;2(2):39–44.
[8] Wang H, Tanaka K, Griffin M. ‘Parallel distributed compensation of nonlinear systems by Takagi–Sugeno fuzzy model’. In: Proceedings of the inter-
national joint conference of the fourth IEEE international conference on fuzzy systems and the second international fuzzy engineering symposium;
1995.
[9] Tanaka K, Wang H. Fuzzy control systems design and analysis. New York: Wiley; 2001.
[10] Yu Gwo-Ruey, Wang Shun-Min. ‘Robust fuzzy control for inverted pendulum with model uncertainty and output constraint via LMI stability analysis’.
In: International conference on fuzzy theory and it’s applications (iFUZZY); 2012. p. 18–23.
[11] Mohanlal P, Kaimal M. ‘Exact fuzzy modeling and optimal control of the inverted pendulum on cart’. In: Proceedings of the 41st IEEE conference on
decision and control; 2002.
[12] Loram Ian D, Kelly Sue M, Lakie Martin. ’Human balancing of an inverted pendulum: is sway size controlled by ankle impedance. J Physiol
2001;532(3):879–91.
[13] Segway.com. ‘Segway homepage’ [Online]. Available http://www.segway.com/.
46 A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47

[14] Mehran K. ‘Takagi–Sugeno fuzzy modeling for process control’. Ind Autom Rob Artif Intell 2008.
[15] Takagi Tomohiro, Sugeno Michio. ‘Fuzzy identification of systems and its applications to modeling and control’. IEEE Trans Syst Man Cybern
1985;15(1):116–32.
[16] Seidi M, Hajiaghamemar M, Segee B. ‘Fuzzy control systems: LMI-based design’. Fuzzy controllers- recent advances in theory and applications; 2012.
[17] Kawamoto S, Tada K, Ishigame A, Taniguchi T. ‘An approach to stability analysis of second order fuzzy systems’. In: IEEE International conference on
fuzzy systems. San Diego; 1992. p. 1427–34.
[18] Seidi M, Markazi A. ‘Performance-oriented parallel distributed compensation’. J Franklin Inst 2011;348(7):1231–44.
A.I. Roose et al. / Computers and Electrical Engineering 61 (2017) 31–47 47

Ahmad Ilyas Roose received his B.Sc. and M.Sc. degree from the University of Nottingham Malaysia Campus in Malaysia. His research interests include
Fuzzy logic controllers, Linear Quadratic Regulators controllers and nonlinear systems controllers.

Samer Yahya received his Ph.D. degree from the University of Malaya in Malaysia. Currently he is working as a visiting Scholar at University of Arkansas
at Little Rock in the USA. His research interests include artificial intelligence, robotics and antenna design.

Hussain Al-Rizzo joined the Systems Engineering Department, University Arkansas at Little Rock (UALR) since 20 0 0, where he is currently a Professor
of Telecommunication Systems Engineering. He received the prestigious Ted and Virginia Bailey Foundation, University of Arkansas at Little Rock Faculty
Excellence Award in Teaching, 2007. Also received the University of Arkansas at Little Rock Faculty in Research in 2009. His research areas include im-
plantable/wearable antennas, wireless systems, smart antennas, WLAN/MIMO deployment and load balancing, electromagnetic wave scattering by complex
objects.

You might also like