# Stabilization of Inverted Cart-Pendulum System UsingPIλDμ Controller: A Frequency-Domain Approach

Authors: Sunil Kumar Mishra; Dinesh Chandra
Journal: Chinese Journal of Engineering
 (2013)

---

## Abstract

This paper focuses on the angular stabilization of inverted cart-pendulum system usingPIλDμ controller. The tuning of PIλDμ controller is formulated as a nonlinear optimization problem, in which the objective function is composed of five design conditions in frequency domain. Particle swarm optimization technique has been used for optimizing PIλDμ parameters. Also a PID controller has been designed based on same specifications, and a comparative study has been carried out. All the responses have been calculated using FOMCON toolbox of Matlab/Simulink.


---

## Body

## 1. Introduction

In recent years, Fractional-order PID (PIλDμ) controller has become a good generalization of standard PID controller using fractional calculus. Compared to PID controller, the tuning of PIλDμ is more complex and remains a challenging problem. As the PID controller is one of the most commonly used controllers in industries, and in recent years fractional calculus [1–5] has been used to present the more generalized form of PID controller, that is, PIλDμ controller.It is well known that inverted cart-pendulum [6] is an example of underactuated, nonminimum phase and highly unstable system. Because of this, it is very difficult to design a controller for a system like inverted pendulum. The design becomes more difficult because of the physical constraints on track length, applied voltage, and the pendulum angle.Podlubny has proposed a generalization of the PID controller asPIλDμ controller. He also demonstrated that the fractional order PID controller has better response than classical PID controller [1, 7]. Also, many valuable studies have been done for fractional order controllers and their implementations [8–14]. Tuning of the PIλDμ controller using the frequency-domain approaches is studied in many papers. For example, [15] propose a method based on optimization strategies. Tuning of H∞ controllers for fractional single-input single-output (SISO) system was suggested in [12]. In [16], tuning method for PIλDμ based on Ziegler-Nichols and Astrom-Hagglund tuning rules is presented.In this study, aPIλDμ controller has been designed for an unstable system (inverted cart-pendulum system) using frequency-domain approach, and particle swarm optimization (PSO) has been used for obtaining the PIλDμ parameters (Kp, Ki, Kd, λ, μ).This work is organized as follows: Section2 covers inverted cart-pendulum system, Section 3 covers FOPID controller, Section 4 presents particle swarm optimization, Section 5 presents FOPID controller design, Section 6 presents simulation results, and the conclusion is provided in Section 7.


## 2.  Inverted Cart-Pendulum System

The inverted pendulum system [6] has two degrees of freedom of motions as shown in Figure 1. The first is linear motion of the cart in the X-axis and is given by
(1)θ¨=mL×(σ{(θ˙)2cosθsinθ+(m+M)gsinθ[F-bx˙]cosθ-mL(θ˙)2cosθsinθ+(m+M)gsinθ})-1,
where σ=mL2(M+mcos2θ)+J(M+m).Figure 1
Inverted cart-pendulum system.The second is rotation of the pendulum about theX-Y plane and is described by
(2)x¨=1×(σ{(J+mL2)[F-bx˙-mLθ˙2sinθ]+mL2gcosθsinθ}σ{(J+mL2)[F-bx˙-mLθ˙2sinθ])-1.Now linearising (1) and (2) for small angle of θ from the equilibrium point and neglecting the friction coefficient b (which is very small compared to other parameters), the following equations are obtained:
(3)θ¨=mL×(σ′{F+(m+M)gθ})-1,
where σ′=mML2+J(M+m)(4)x¨=1×(σ′{(J+mL2)F+mL2gθ})-1.Now taking the Laplace Transform of (3) and (4), the following transfer function is obtained:
(5)G1(s)=θ(s)F(s)=mLs2s2((J(m+M)+MmL2)s2-mgL(M+m)).
From Table 1 putting all values in (5),
(6)G1(s)=0.2638s2s2(s2-6.807)≈0.2638(s2-6.807).Table 1
Inverted cart-pendulum system parameters.
S. no.
Inverted cart—pendulum system parameters (in SI units)
Values
(1)
F—applied force to cart (N)
±24
(2)
X—position of cart from the reference (m)
±0.3
(3)
θ—angle of the pendulum with respect to vertical (rad)
≤0.1
(4)
M—mass of cart (kg)
2.4
(5)
m—mass of the pendulum (kg)
0.23
(6)
L—length of the pendulum (m)
0.4
(7)
J—moment of inertia of pendulum (kg·m2)
0.099
(8)
b—coefficient of cart friction (Ns/m)
0.055
(9)
g—acceleration owing to gravity (m/s2)
9.81Now the DC motor used to convert control voltageU to force F is represented by only a gain block of gain = 15 for simplicity. Then G1(s) become
(7)G1(s)=3.957(s2-6.807)


## 3.PIλDμ Controller

The differential equation of thePIλDμ controller is described by [16, 17]
(8)u(t)=Kpe(t)+KiD-λe(t)+KdDμe(t).After the introduction of this definition, it is easily seen that classical types of PID controllers such as integral order PID, PI, or PD become special cases of the most general fractional order PID controller. In other words, thePIλDμ controller expands the integer-order PID controller from point to plane, as shown in Figure 2, thereby adding flexibility to controller design and allowing us to control our real world processes more accurately but only at the cost of increased design complexity.Figure 2
Generalization of the PID controller from point to plane.Taking Laplace Transform of (8), the controller expression in s-domain is obtained as
(9)C(s)=U(s)E(s)=Kp+Kisλ+Kdsμ.


## 4. Particle Swarm Optimization Method

The PSO method [18] is a wide category of swarm intelligence methods for solving the optimization problems. This technique inspired by bird flocks, fish schools, and animal herds constitute representative examples of natural systems where aggregated behaviors are met, producing impressive, collision-free, and synchronized moves. The PSO is population-based stochastic optimization which was developed by Kennedy and Eberhart in 1995. The major advantage of the PSO over other stochastic optimization methods is its simplicity. It is a population-based search algorithm. The basic idea of the PSO is the mathematical modeling and simulation of the solution searching activities in multi-dimension search space where optimal solution exists. In a PSO system, particles fly around in a multi-dimensional search space. During flight, each particle adjusts its position according to its own experience and the experience of the neighboring particles. Update velocity and position of particle are depended upon inertia, cognitive, and social factors. Each particle has a memory, and hence it is capable of remembering the best previous position in the search space ever visited by it. The position corresponding to the best fitness is known as pbest, and the overall best out of all the particles in the population is called gbest. The modified velocity and position of each particle can be calculated using the current velocity and position as follows.Velocity update equation is given by(10)Vik+1=W×Vik+C1×rand()×(pbest,i-Xik)+C2×rand()×(gbest,i-Xik).Position update equation is given by(11)Xik+1=Xik+Vik+1,
where k = number of iterations, V = velocity of particle, W = inertia weight factor = Wmax-[(Wmax-Wmin)/k]* iteration number, c1, c2 = cognitive and social acceleration factors respectively, rand() = random numbers uniformly distributed in the range (0,1), x = position of particle, and i = ith particle.As shown in Figure3, the PSO algorithm consists of just three steps, which are repeated until some stopping condition is met.(1)
Evaluate the fitness value of each particle.(2)
Update individual and global best fitness values and positions.(3)
Update velocity and position of each particle.Figure 3
Flow diagram of basic PSO algorithm.The first two steps are fairly trivial. Fitness evaluation is conducted by supplying the candidate solution to the objective function. Individual and global best fitness values and positions are updated by comparing the newly evaluated fitness values against the previous individual and global best fitness values and replacing the best fitness values and positions as necessary.


## 5.PIλDμ Controller Design

The concept of frequency domain design ofPIλDμ controllers was first proposed at [8]. If G(s) is the transfer function of the process, then the objective is to find out a controller C(s), so that the open loop system G(s)C(s) meets the following design specifications.


### 5.1. Phase Margin Specification

Consider(12)Arg(G(jωgc)C(jωgc))=-π+ϕm,
where ϕm is the desired phase margin and ωgc is the desired gain crossover frequency.


### 5.2. Gain Crossover Frequency Specification

Consider(13)|G(jωgc)C(jωgc)|=1.


### 5.3. Robustness against System’s Gain Variation

Consider(14)(ddω(Arg[G(jω)C(jω)]))ω=ωgc=0.


### 5.4. Complementary Sensitivity Specification

Consider(15)|T(jω)|dB=|G(jω)C(jω)1+G(jω)C(jω)|dB≤AdB∀ω≥ωt(rad/s)⟹|T(jωt)|dB=AdB,
where A is the specified magnitude of the complementary sensitivity function or noise attenuation for frequencies for all ω≥ωt(rad/s).


### 5.5. Sensitivity Specification

Consider(16)|S(jω)|dB=|11+G(jω)C(jω)|dB≤BdB∀ω≤ωs(rad/s)⟹|S(jωs)|dB=BdB,
where B is the specified magnitude of the sensitivity function or load disturbance rejection for frequencies for all ω≤ωs(rad/s). Now five specifications (12)–(16) have been solved using PSO to obtain the PIλDμ controller parameters, and also a conventional PID controller has been designed using the same specifications.To formulate the objective function (also known as fitness function), (12) and (13) can be combined as
(17)G(jωgc)C(jωgc)=ej(-π+ϕm)⟹G(jωgc)C(jωgc)=cos(-π+ϕm)+jsin(-π+ϕm)⟹Re{G(jωgc)C(jωgc)}+jIm{G(jωgc)C(jωgc)}=-cos(ϕm)-jsin(ϕm)(18)⟹[Re{G(jωgc)C(jωgc)}+cos(ϕm)]+j[Im{G(jωgc)C(jωgc)}+sin(ϕm)]=0.
From (18), let
(19)J1=Re{G(jωgc)C(jωgc)}+cos(ϕm),J2=Im{G(jωgc)C(jωgc)}+sin(ϕm).
From (14), (15), and (16), let
(20)J3=(ddω(Arg[G(jω)C(jω)]))ω=ωgc(21)J4={|T(jωt)|-10A/20},(22)J5={|S(jωs)|-10B/20}.
Now, the objective function J which is minimized to satisfy specifications (12)–(16) is given as
(23)J=w1×|J1|+w2×|J2|+w3×|J3|+w4×|J4|+w5×|J5|,
where |J1|, |J2|, |J3|, |J4|, and |J5| are the magnitudes of J1, J2, J3, J4, and J5, respectively. w1, w2, w3, w4, and w5 are corresponding weights assigned to J1, J2, J3, J4, and J5.


## 5.1. Phase Margin Specification

Consider(12)Arg(G(jωgc)C(jωgc))=-π+ϕm,
where ϕm is the desired phase margin and ωgc is the desired gain crossover frequency.


## 5.2. Gain Crossover Frequency Specification

Consider(13)|G(jωgc)C(jωgc)|=1.


## 5.3. Robustness against System’s Gain Variation

Consider(14)(ddω(Arg[G(jω)C(jω)]))ω=ωgc=0.


## 5.4. Complementary Sensitivity Specification

Consider(15)|T(jω)|dB=|G(jω)C(jω)1+G(jω)C(jω)|dB≤AdB∀ω≥ωt(rad/s)⟹|T(jωt)|dB=AdB,
where A is the specified magnitude of the complementary sensitivity function or noise attenuation for frequencies for all ω≥ωt(rad/s).


## 5.5. Sensitivity Specification

Consider(16)|S(jω)|dB=|11+G(jω)C(jω)|dB≤BdB∀ω≤ωs(rad/s)⟹|S(jωs)|dB=BdB,
where B is the specified magnitude of the sensitivity function or load disturbance rejection for frequencies for all ω≤ωs(rad/s). Now five specifications (12)–(16) have been solved using PSO to obtain the PIλDμ controller parameters, and also a conventional PID controller has been designed using the same specifications.To formulate the objective function (also known as fitness function), (12) and (13) can be combined as
(17)G(jωgc)C(jωgc)=ej(-π+ϕm)⟹G(jωgc)C(jωgc)=cos(-π+ϕm)+jsin(-π+ϕm)⟹Re{G(jωgc)C(jωgc)}+jIm{G(jωgc)C(jωgc)}=-cos(ϕm)-jsin(ϕm)(18)⟹[Re{G(jωgc)C(jωgc)}+cos(ϕm)]+j[Im{G(jωgc)C(jωgc)}+sin(ϕm)]=0.
From (18), let
(19)J1=Re{G(jωgc)C(jωgc)}+cos(ϕm),J2=Im{G(jωgc)C(jωgc)}+sin(ϕm).
From (14), (15), and (16), let
(20)J3=(ddω(Arg[G(jω)C(jω)]))ω=ωgc(21)J4={|T(jωt)|-10A/20},(22)J5={|S(jωs)|-10B/20}.
Now, the objective function J which is minimized to satisfy specifications (12)–(16) is given as
(23)J=w1×|J1|+w2×|J2|+w3×|J3|+w4×|J4|+w5×|J5|,
where |J1|, |J2|, |J3|, |J4|, and |J5| are the magnitudes of J1, J2, J3, J4, and J5, respectively. w1, w2, w3, w4, and w5 are corresponding weights assigned to J1, J2, J3, J4, and J5.


## 6.  Simulation Results

In Figure4, the block diagram of whole system is given. The angle of the rod is controlled via the PIλDμ controller where the aim is to hold the rod at the upright position. Some parameters for PSO program are given in Table 2.Table 2
PSO parameters.
PSO parameters
Values
Number of particles
100
Number of iterations
100
C
1
2
C
2
2
W
max
0.9
W
min
0.1Figure 4
Simulink model of closed loop system.The values ofJ1, J2, J3, J4, and J5 are given in Table 4, and the overall value of objective function J is less in case of PIλDμ controller as compared to PID controller. In (23), the values of all weights are considered as w1=w2=w3=w4=w5=1.Here design specifications have been considered asωgc=20 rad/sec, ϕm=60°, ωt=0.01 rad/sec, ωs=100 rad/sec, and A=B=-20 dB. Using the objective function of (23) and after running the PSO program with parameters given in Table 2, the PIλDμ parameters are given in Table 3, and by taking λ=μ=1, PID controller has been designed using the same conditions as used for PIλDμ controller. The PID parameters are given in Table 3. These are the values for particular case and may vary for running the PSO many times, but the results are almost same for all cases.Table 3
Controller parameters.
Controller
K
p
K
i
K
d
λ
μ
PI
λ
D
μ
4.4659
0.7156
12.4083
0.6734
0.6991
PID
51.4035
36.6624
4.5433
—
—Table 4
Objective function values.
Controller
J
1
J
2
J
3
J
4
J
5
J
PI
λ
D
μ
0.0099
−0.0058
0.0014
0.0302
-
0.2778
×
10
-
5
0.0473
PID
-
3.6750
×
10
-
7
5.1383
×
10
-
6
0.0225
0.0814
−0.0995
0.2035The initial angle has been taken as 0.1 rad. The simulation results are shown in Figures5, 6, and 7 for cart angle, control voltage, and error, respectively, using both PIλDμ and PID controllers. The Bode diagrams of open loop system are given in Figures 8 and 9 for both PIλDμ and PID cases. All results are obtained using FOMCON toolbox of MATLAB/SIMULINK [19]. As it can be noticed in Figures 5 and 7 that cart angle has less deviation around its upright position for PIλDμ controller and settles to upright position slightly faster than PID controller. In Figure 6, PIλDμ controller takes less control effort than PID controller. In Figures 8 and 9, the phase margin condition is almost satisfied for both PIλDμ controller and PID controller.Figure 5
Cart angle of closed loop system.Figure 6
Control voltage applied to the system.Figure 7
Error of closed loop system.Figure 8
Bode diagram for open loop system withPIλDμ controller.Figure 9
Bode diagram for open loop system with PID controller.


## 7. Conclusion

In this work, an attempt has been made to test the effectiveness ofPIλDμ controller for a highly unstable system like inverted cart pendulum. Two different controllers (PIλDμ and PID controllers) using frequency domain approach based on the same specifications have been designed. It is shown in Figures 5–7 that PIλDμ controller performs better than conventional PID controller. In Bode diagrams as shown in Figures 8 and 9, it is clear that gain margin is better for PIλDμ controller than that for conventional PID controller.It is also seen that the use of particle swarm optimization technique for calculating controller parameters is very simple and provides good convergence towards optimal values.In this work, only cart angle has been stabilized at its upright position, but on the other hand, cart position stabilization along with cart angle usingPIλDμ controller and real time implementation might be the subject of future work.



---

*Source: 962401-2013-10-01.xml*