Abstract
The objective of this article is to optimize parameters of a hybrid sliding mode controller based on fireworks algorithm for a nonlinear inverted pendulum system. The proposed controller is a combination of two modified types of the classical sliding mode controller, namely, baseline sliding mode controller and fast output sampling discrete sliding mode controller. The simulation process is carried out with MATLAB/Simulink. The results are compared with a published hybrid method using proportional–integral–derivative and linear quadratic regulator controllers. The simulation results show a better performance of the proposed controller.
Keywords
Introduction
The inverted pendulum system is known as one of the classical benchmark control problems. Many useful applications have been done based on this system. Therefore, the inverted pendulum-cart system has been being an interesting topic that attracts many attentions from researchers. The system has one input and two outputs. The aim of designing controller for this system is to make the cart move to desired position while still guarantee the pendulum balance in the upright position by changing the driving force applied to the cart. With the characteristics of high nonlinearity and non-stability, this single input–multiple outputs (SIMO) system is good enough to verify the performance of control techniques. There are many nonlinear controllers applied for controlling this system, such as model predictive controller, 1 fuzzy logic controller,2,3 and neural network.4,5 Besides these approaches, hybrid controllers are also a promising solution for controlling the inverted pendulum system. When system has many outputs, using hybrid controllers with some control loops is often effective, such as the hybrid controller of proportional–integral–derivatives (PIDs) and linear quadratic regulator (LQR) controller. 6 For this approach, LQR is a controller of inner loop used to stabilize pendulum, while PID controllers are cascaded in parallel at the outer loop. Although this method guarantees the system to track the target effectively with no overshoot, the response time is still relatively long. This method has two drawbacks. First, LQR controller is not the best choice for inner control loop as compared with others because of its linear characteristic. 7 Second, PID controller parameters are determined by the trial-and-error method. For the first reason, instead of using LQR, a sliding mode controller was improved by applying fast output sampling technique. 8 Besides that in order to reduce transient response time of the system, a baseline sliding mode controller (BSMC) was proposed. 9 As mentioned above, using the trial and error method to determine parameters of PID controllers not only takes much time but also does not guarantee to find out the best solution possible. Instead, an optimization algorithm is proposed to determine controller parameters, namely, fireworks algorithm (FWA). 10 Recently, along with the development of computer sciences, artificial optimization algorithms have been playing an important role in many fields, especially automatic control engineering. One of such artificial algorithms was known as swarm intelligence optimization algorithm. These algorithms are classified into two categories, namely, bio-inspired and non-bio-inspired. 11 Some bio-inspired algorithms such as particle swarm optimization (PSO), 12 genetic algorithm (GA), 13 or ant colony optimization (ACO) 14 are used widely. In contrast, the non-bio-inspired algorithms, such as FWA, are not too popular, although its dominant efficiency had been verified in both convergence speed and optimization accuracy as compared with PSO. 10 Basically, when the cost function is simple, optimization speed or computational time of PSO is higher than that of FWA. In contrast, in the case of high complexity in the cost function, the computation time of both algorithms is almost the same. Consequently, FWA is more effective than PSO because of higher optimization accuracy. Therefore, besides proposing the hybrid control design of BSMC and fast output sampling discrete sliding mode controller (FOSDSMC), herein, the FWA is also applied to optimize parameters of BSMC controller with the aim of enhancing performance of the whole system. This article is organized as follows. Section “Inverted pendulum system modeling” briefly describes about modeling system. Section “Methodology” shows the main methodology. Section “Simulation results and discussions” demonstrates the simulation and results. The conclusion is given in section “Conclusion.”
Inverted pendulum system modeling
The inverted pendulum system is shown in Figure 1. The cart is driven by an external force that drives a pair of wheels of the cart. Each wheel of the cart is driven by a dc motor.

The inverted pendulum system.
Consider the coordinate system Oxy as shown in Figure 1,
Let us consider the ball point mass is at the equilibrium position as shown in Figure 1, the resultant force balance equation can be written as
The magnitude of net force on the horizontal axis is obtained as follows
At the equilibrium point, the resultant torque equation can be written as follows
where
From equations (3) and (5), the system dynamics can be represented as follows
The state variables are defined as position, velocity of the cart, angle, and angular velocity of the pendulum, respectively
Then, the above dynamic equations are represented in the form of the state space equations as follows
After linearizing system in equation (8) at the equilibrium point (0, 0), the state space equations are shown as follows
Methodology
Hybrid sliding mode controllers
As analyzed above, the inverted pendulum system is a SIMO system. With such multiple-output nonlinear systems, almost their controllers are in the form of nonlinear controllers, such as fuzzy logic controller or neural networks. However, designing these controllers is often not too easy to make the system performance fulfill expected requirements due to the complexity in controlling structure or due to certain knowledge about the system. With the aim of choosing a controller that is not only easier in designing than previously mentioned controllers but also guarantee controlling this system effectively, the sliding mode controller is introduced.
In fact, depending on specific aims of controlling, a unique controller or a hybrid controller is chosen. For example, in the case of using unique sliding mode controller, it often only guarantees to either stabilize the pendulum balance in the upright position or move the cart to desired target. Instead, a hybrid controller is completely suitable to make the system satisfy both tracking target and stabilizing pendulum. The proposed hybrid sliding mode controller (HSMC) is formed by two modified kinds of classical sliding mode controller, namely, BSMC and FOSDSMC, corresponding to two control loops. The inner loop is controlled by FOSDSMC for stabilizing the pendulum balanced in the upright position, while BSMC is present in the outer loop to control the movement of cart to desired target as fast as possible. The combination of BSMC and FOSDSMC is also a promising solution for designing a robust controller.
BSMC
In the case of controlling nonlinear model system, the modeling inaccuracy is one of the main factors that strongly affects the system. It is probably from actual uncertainty about the plant or from the purposeful choice of a simplified representation of the dynamic system. Therefore, modeling inaccuracy must be considered in designing controllers. There are two approaches to deal with this problem; robust control and adaptive control. This research focuses on the robust control. A simple approach for robust control is known as sliding control methodology. 9 Consider a single-input dynamic system as follows
where the scalar x is the output, the scalar u is the control input of the system, and the state vector
where
The unique solution of the above equation is
where
The condition in equation (12) is the sliding condition (Figures 2 and 3), which states that the squared distance to the surface deceases along all system trajectories, and once on the surface, the system trajectories remain on the surface. The function s(t) that satisfies the condition in equation (14) is sliding surface function, while the system’s behavior once on the surface is called sliding mode.

Sliding condition.

The graphical interpretation of equations (11) and (12).
However, in fact, when the implementation of the associated control switching is necessarily imperfect, an undesired phenomenon, namely, chattering, is present as in Figure 4.

Chattering phenomenon.
In order to solve this problem, first, a term in integral control is added to the original sliding surface
For n = 2
For n = 3
The sliding surface function in equation (14) is in form of proportional–integral (PI) controller, while this function in equation (15) is in form of PID controller. By cascading these two controllers together, a BSMC is formed, sliding surface function of which is as follows
In the discrete form, the sliding surface function is chosen as follows
And the control law can be given as follows
Figure 5 shows block diagram of the BSMC.

Block diagram of baseline sliding mode controller.
FOSDSMC
Fast output sampling is an advanced technique for improving performance of the pure sliding mode controller. Assume that the classical sliding mode controller is discretized at sampling time
Step 1. The state space equations of the linearized system in equation (9) can be shown as follows
where
Step 2. Discretize equation (19) at sampling time
where
Step 3. Discretize equation (19) at sampling time
Step 4. Determine C0 and D0 matrices of the fictitious lifted system
where
Step 5. Determine transformation matrix T of the system in equation (20).
Step 6. Determine system matrices
where
Step 7. Determine specific terms of matrix
With n and m being rows and columns of
Step 8. Determine matrix
Step 9. Determine parameter
where
Step 10. Determine
Step 11. Control law for FOSDSMC is as follows
Step 12. Sliding surface function can be described as
FWA
Frameworks
The natural process–based algorithms such as GA and PSO are often good choices when the cost function has only a few variables and narrow searching space. Otherwise, when the number of variables increases and the search space is larger, the computational time of these algorithms is not too much different. In this article, FWA is proposed to optimize fractional-order proportional–integral–derivative (FOPID) controller parameters. The advantages of FWA as compared with PSO and GA are high optimization accuracy and fast convergence speed. 10 Because of spark generation and specific selection processes, the FWA can avoid premature convergence.
Figure 6 shows the framework of FWA. Similar to the explosion phenomenon of a real firework, a shower of sparks will locally space around a firework when it is set off. By this way, the explosion process of a firework can be viewed as a search in the local space around a specific point where the firework is set off through the sparks generated in the explosion. At the beginning of FWA, n fireworks are set off at n given corresponding locations. Then, after explosion, the locations of sparks are evaluated. When the optimal location is found, the algorithm stops. Otherwise, n other locations are selected from the current sparks and current fireworks for the next generation of explosion.

The framework of FWA program.
There are two key factors to design a good firework, such as number of sparks and explosion amplitude. A good firework should be satisfied that the number of sparks is as high as possible, while amplitude of explosion is as small as possible.
Number of sparks
Assume a general optimization problem as follows
where x represents a location in the searching space,
The number of sparks generated by each firework xi is shown as 10
where m is maximum sparks,
where a and b are constants,
Amplitude of explosion
The amplitude of explosion is generated as the following formula 10
where
Proposed FWA-HSMC design
The procedure of designing FOSDSMC for inner loop is implemented as mentioned above. The parameters of this controller depend on values of the sampling time that is pre-defined. In this article, the FWA is proposed to optimize BSMC controller parameters that affect to the system performance directly, namely,

The structure of the proposed FWA based on hybrid SMC.
The performance of the designed controller depends on the optimization algorithm. One of the most important factors that affects the final result of optimization program is the cost function. In fact, the cost function can be formulated from one or many different performance criteria. In this article, there are three typical performance criteria are given as follows:
Integral of square time multiplied by square error (ISTSE)
where t denotes the current evaluation time, e(t) is error value between set point and current output.
Integral of time multiplied by square error (ITSE)
Mean square error (MSE)
where n is the length of simulation time.
The ISTSE and ITSE performance criteria can make the system response to overcome the disadvantages of integral of absolute value of error (IAE) and integral square error (ISE). However, it does not mean minimizing all the performance parameters of system response such as the percent of overshoot (P.O.), settling time (Ts), rising time (Tr), or steady state (Ess) at the same time. 15
In multi-objective optimization problem, Pareto method which optimizes many different objectives at the same time is very popular. Nevertheless, when the number of objective functions increases, using this method becomes a hard task because of high complexity. In this article, the performance criteria are combined in a single weighted-sum objective function that is defined as follows
where
In this way, in this article, the proposed cost function of optimization process is formulated by ISTSE, MSE, ITSE, and parameter P.O. The combination of these performance criteria, especially P.O., can guarantee that the controller can result in system response with the smallest value of overshoot and the shortest settling time as possible
Simulation results and discussions
Figures 8 and 9 show the simulation model for the optimization process and the hybrid control configuration, respectively. The simulation parameters of inverted pendulum system are set as 6 in Table 1.

Simulation model for optimization process.

Hybrid control configuration.
The inverted pendulum system parameters.
The parameters of the cost function are set as follows:
The FOSDSMC controller parameters are designed at sampling time 0.05 s. The values of
To explore the optimization technique for controlling inverted pendulum system, the dominant performance of the proposed controllers is verified by comparing with a published controller in the work by Prasad et al. 6 that includes two PID controllers in parallel for outer loop and a state feedback controller based on LQR for inner loop. The simulation process of these methods is done in different initial conditions, including zero initial condition, initial angle 0.1 rad, and initial velocity of cart 1 m/s. The results are depicted in Figures 10–12, respectively. The optimized controller parameters and the position tracking performance criteria of Figures 10 and 11 are listed in Tables 2–4, respectively.

The performance comparison in response to (a) position, (b) angle, and (c) control signal of the proposed controller and Prasad et al.’s controller with zero initial conditions.

The performance comparison in response to (a) position, (b) angle, and (c) control signal of the proposed controller and Prasad et al.’s controller with initial angle 0.1 rad.

The performance comparison in response to (a) position, (b) angle, and (c) control signal of the proposed controller and Prasad et al.’s controller with initial velocity of cart 1 m/s.
Optimized controller parameters.
FWA: fireworks algorithm; BSMC: baseline sliding mode controller; FOSDSMC: fast output sampling discrete sliding mode controller.
The position tracking performance comparison between the proposed controller and Prasad et al.’s method in the case of zero initial conditions (in Figure 10).
FWA: fireworks algorithm; BSMC: baseline sliding mode controller; FOSDSMC: fast output sampling discrete sliding mode controller; PID: proportional–integral–derivative; LQR: linear quadratic regulator.
The position tracking performance comparison between the proposed method and Prasad et al.’s method in the case of initial angle 0.1 rad (in Figure 11).
FWA: fireworks algorithm; BSMC: baseline sliding mode controller; FOSDSMC: fast output sampling discrete sliding mode controller; PID: proportional–integral–derivative; LQR: linear quadratic regulator.
It is observed that with the optimization technique, the proposed controller guarantees to make the system stable in the different initial conditions. Moreover, it makes the system response fulfill the requirements as expected. First, for stabilizing pendulum, both methods guarantee to make the pendulum stable at upright position in a short time as fast as possible with just a little bit of oscillations. Second, for target tracking control, the proposed controller results in the system response with smaller values in both settling time and rising time as compared with the Prasad et al.’s controller. Obviously, with the optimization technique, the performance of the proposed controller is completely dominant in both target tracking and stabilizing pendulum with no overshoot and fast response time as compared with Prasad et al.’s 6 controller.
Conclusion
This article proposes the FWA to optimize parameters of the HSMC which is a combination of two modified types of classical sliding mode controller. The proposed controller guarantees that the cart moves to the desired position smoothly and fastly and also stabilizes the pendulum balanced in upright position as fast as possible. Obviously, by applying baseline law and fast output sampling technique for each component controller, the proposed HSMC with fireworks optimization algorithm not only makes the system stable, fulfills controlling performance requirements, but also is a promising solution for robust control. The simulation results show that the performance of controller is better than the published controller.
Footnotes
Academic Editor: Stephen D Prior
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part under MOST no. 104-2221-E-151-015-MY2, Republic of China.
