Backstepping Sliding Mode Control for Inverted Pendulum System with Disturbance and Parameter Uncertainty

The inverted pendulum system is highly popular in control system applications and has the characteristics of unstable, nonlinear, and fast dynamics. A nonlinear controller is needed to control a system with these characteristics. In addition, there are disturbances and parameter uncertainty issues to be solved in the inverted pendulum system. Therefore, this study uses a nonlinear controller, which is the backstepping sliding mode control. The controller is robust to parameter uncertainty and disturbances so that it is suitable for controlling an inverted pendulum system. Based on testing with step and sine reference signals without interference, the controller can stabilize the system well and has a fast response. In testing with disturbances and mass uncertainty, the backstepping sliding mode controller is robust against these changes and able to make the system reach the reference value. Compared with sliding mode control, backstepping sliding mode control has a better and more robust response to disturbances and parameter uncertainty. Keywords—Inverted Pendulum; Backstepping; Sliding Mode Control; Nonlinear; Disturbance; Uncertainty


I. INTRODUCTION
Inverted pendulum system is commonly used and highly popular in control systems [1]- [3]. An inverted pendulum system can be illustrated in Fig. 1. A pendulum stick on a movable cart can move aside freely [4]. The pendulum moves according to the movement of the cart. Therefore, in order to make the pendulum stay upward steadily, the velocity of the cart needs to be controlled. An inverted pendulum has characteristics as nonlinear [5], unstable [6], under-actuated system [7][8], multivariable system [9], and fast dynamic system [10]. The pendulum stick might fall easily even without the cart moving [11]. It makes the system characteristics as nonlinear and unstable. Balancing the pendulum stick requires a great and fast force. Otherwise, the stick will fall immediately. This makes an inverted pendulum system have a fast dynamic response.
The goal of the control system is to balance an inverted pendulum system by giving a control signal (force) to a cart that has been installed with a pendulum system [12] [13]. Some examples of inverted pendulum system applications are: balancing system in a rocket system when the rocket takes off [14], Missile Launcher [15] [16], Segway [17], balancing robots [18]- [20], humanoid robot [21]- [23], etc [24]. Some researches about inverted pendulum have been done by many. Some researchers used Proportional Integral Derivative Control (PID) [25]- [27], Fractional Oder PID [28] and some others used state feedback control with pole placement or Linear Quadratic Regulator (LQR) [29]- [33]. Linear controllers such as PID, FOPID and state feedback can control an inverted pendulum system with a linearization in its nonlinear model. However, a linearized model is just an approximation near the equilibrium with narrow angles; it cannot fully represent the dynamics of the system. Hence, a linear controller is not suitable to be used in an inverted pendulum system.
Other researchers applied fuzzy control in an inverted pendulum system [34]- [38]. According to their results, the fuzzy control can control a nonlinear inverted pendulum system, better than linear controllers. However, fuzzy logic controllers are not suitable to be used by beginners for slowprocessing systems. Additional information is needed to design a proper fuzzy controller; for example, more knowledge of the system's behavior and previous experimental data from another controller. This information will be used to design fuzzy rules that cannot be done arbitrarily. Furthermore, fuzzy controllers use heavy computations. Many processes need to be executed: fuzzification, defuzzification, and if-then rules. This requires a fast-processing system to achieve good performance of the system.
Other than the nonlinear characteristic of the system, the inverted pendulum also has other issues to be solved: parameter uncertainty [39] [40] and disturbance [41]. Parameter uncertainty is found when the pendulum has a changing mass [42], and disturbance is often found in the real system in the form of external force, friction, or noise. Some examples of disturbance are friction force and inertia of the system. Hence, a suitable controller for an inverted pendulum system should also be robust to parameter uncertainty and disturbances.
Some variations of nonlinear controllers that can overcome parameter uncertainty and disturbance are backstepping [43] and sliding mode control [44]- [47]. The sliding mode control is good to solve parameter uncertainty and disturbance [48]. Meanwhile, backstepping control gives a good system response. Therefore, by combining those nonlinear controllers, the proposed controller can solve parameter uncertainty and disturbance with a good response.
The contribution of this research is to design a controller for a nonlinear inverted pendulum system. The proposed design of the controller is robust to parameter uncertainty and disturbance. Another contribution is to make a comparison between the proposed controllers with other controllers to assess a better controller.
This research paper is divided into some sections. The first section is an introduction that contains the background of the research. The next section is the method that consists of modeling an inverted pendulum system, a short explanation of backstepping and sliding mode control. This section also discusses the controller designs of sliding mode control and backstepping sliding mode control. The third section is results and discussions. Then, the last section is conclusions and future work suggestions.

A. Modeling an Inverted Pendulum
Some force that works on an inverted pendulum system can be seen in Fig. 2. Variable and are the mass of the cart and the mass of the pendulum, respectively. Variable is the length of the pendulum stick, variable is angular position of oscillation, variable is the displacement of the cart, and variable is the applied force to the cart.
State variables of the system are the angular position of the oscillation and the angular velocity as represented in 1 = and 2 =. The input variable of the system is the applied force = , and the output of the system is the angular position as = 1 . According to [49], the nonlinear model of an inverted pendulum system can be written as where ( , ) = sin 1 − 2 2 cos 1 sin 1 + ( 4 3 − cos 2 1 + ) The ( , ) is a nonlinear function of the system's states and ( , ) is a nonlinear function of the system's input. Meanwhile, ( , ) is the function of parameter uncertainty and system's disturbance. The nonlinearity of the inverted pendulum system is shown by ( , ) and ( , ) as in (3) and (4). Those functions contain sin and cos functions that show the system is nonlinear, differentiating the nonlinear model from a linear one.

B. Backstepping Sliding Mode Control
The block diagram of the control system is shown in Fig.  3. The reference is a referenced value that the system must achieve. The controller must be able to make the system reach the referenced value. The difference between the reference and the output (the feedback value) is an error that becomes an input to the backstepping sliding mode controller. The output of the controller is the control signal that becomes an input to the inverted pendulum system. Meanwhile, the outputs of the inverted pendulum system are oscillation angle and angular velocity. These will be feedback to calculate the error. The control system will run continuously to keep the system stable.
One of nonlinear controllers is the sliding mode control. Usually, there is a difference between the actual system and This can be called as uncertainty and can be caused by several factors. The role of the designer is to ensure the system runs well even though there is a mismatch between the model and the actual system. Based on this fact, a control method is developed to overcome the mismatch. One of the control methods is the sliding mode control. It belongs to the Variable Structure Control System (VSCS). The sliding mode control has been applied to many systems with a superiority characteristic as insensitive to parameter uncertainty and external disturbance in the sliding condition [50].
Steps to design a sliding mode controller can be written as follows. First, a reference value is defined as and the error is defined as Then, a sliding variable is defined as with > 0. The first derivative of the sliding variable can be written as The Lyapunov function is used to design the controller, which can be written as The first derivative of the Lyapunov function is Hence, the control signal of the sliding mode control can be written as By substituting the control signal of sliding mode control to (12), a equation can be obtained as below Meanwhile, it is known that if > , then the second derivative of the Lyapunov function is also negative.
Therefore, it can be known that the system fulfills the criteria of the Lyapunov stability.
The backstepping control is included in nonlinear control. The main idea of the backstepping control is that a complex nonlinear system can be decomposed into subsystems, and the level of the subsystem must not be greater than the whole system. Therefore, each Lyapunov and virtual control variable is designed separately; the whole system can be obtained with a backstep to design the controller fully. The backstepping method is called as back-deduce method and the desired dynamic index is fulfilled [50].
Steps to design the backstepping sliding mode controller are divided into two. The number of the step depends on the size of the system's states. Since the inverted pendulum system has 2-state model, the step design is divided into two and will be described as follows.

1) Step 1
The first step begins with defining error as with as reference. Then, the derivative of the error is where ̇ is the first derivative of the reference. A Lyapunov function is used to design the controller, which can be written as The derivative of the Lyapunov function is To fulfill the stability of the system, the derivative of the Lyapunov function must be equal to or less than zero ( ̇1 ≤ 0). Then, the variable 2 is defined as so that a new equation can be obtained as in where 1 > 0 as to fulfill Hurwitz criterion, and is defined as the sliding variable.
Then, a derivative of Lyapunov function can be achieved as where ̈ is the second derivative of the reference signal.
Next, the second derivative of the Lyapunov function can be written as To ensure the stability of the system, the derivative of the second Lyapunov function must be equal to or less than zero ( ̇2 ≤ 0). Therefore, the control signal can be designed as

III. RESULTS AND DISCUSSION
Parameters of the pendulum system are as follows. The mass of the pendulum stick is 0.1 , the mass of the cart is 1 , the length of the pendulum is 0.5 , and the gravity acceleration is 9.8 / 2 . The test was made using Matlab Simulink software. The simulation design is shown in Fig. 4. The reference signal, controller, and inverted pendulum blocks are made with s-function blocks. The source code of the backstepping sliding mode controller and inverted pendulum system can be seen in the Appendix section.
Some evaluations made in this research are evaluation with step signal as reference, sine wave signal as a reference, parameter uncertainty, and disturbance. A performance comparison with other control methods is also included in the discussions.

A. Evaluation with Reference Signal as Variation
The results of the augmented system with step signal and sine wave signal as reference are shown in Fig. 5 and Fig. 6.
Black-colored line represents the reference signal and bluecolored line represents the system response. -axis in the graph represents time while -axis represents the system's position in meter.

Fig. 4. Matlab Simulink Simulation Design
This evaluation aims to assess whether the controller is able to make the system reach the expected reference signal. Based on the experiment result in Fig. 5 and Fig. 6, the proposed controller can make the inverted pendulum system to follow the given reference signal. It can be seen that the blue-colored line coincides with the black-colored line. The augmented system achieved the reference value in less than 1 second. Therefore, it can be said that the controller can control the inverted pendulum system in a fast time response.

B. Evaluation with Parameter Uncertainty
The results of the evaluation with mass uncertainty are shown in Fig. 7 and Fig. 8, with the mass changing from 0.1kg to 0.3kg and to 0.5kg, respectively. According to both figures, a change of the mass makes the system have steadystate error. By making the parameter bigger, the controller becomes more robust, and the steady-state error can be eliminated. The implementation of this idea can be seen in the result as in Fig. 9. Therefore, it can be known that the proposed controller can make the augmented system robust to parameter uncertainty. Fig. 7. System response with step as reference and mass of pendulum changing from 0.1kg to 0.3kg Fig. 8. System response with step as reference and mass of pendulum changing from 0.1kg to 0.5kg Fig. 9. System response with step as reference, mass of pendulum changing from 0.1kg to 0.5kg, after the application of bigger

C. Evaluation with Disturbance
In this subsection, an evaluation is done by adding disturbance to the system. The evaluation aims to assess the performance of the controller after the system is given with disturbance that commonly happens in the actual system. The given disturbance is defined as a sine wave that equals to 0.5 sin 2 . The result is shown in Fig. 10. Based on the figure, it can be seen that there are small oscillations in the system response near the reference value.
Modification of variable in the controller should be done to eliminate small oscillations that occurred in the system response as seen in Fig. 10. The initial value of is 0.03, then it is modified to 0.05. The result of system response after the modification can be seen in Fig. 11. According to the figure, the oscillation can be eliminated successfully. Fig. 10. System response with step as reference, mass of pendulum changing from 0.1kg to 0.5kg, and disturbance given as 0,5 sin 2 Fig. 11. System response with step as reference, mass of pendulum changing from 0.1kg to 0.5kg, and disturbance given as 0,5 sin 2 , after is modified

D. Performance Comparison with Other Control Methods
In this subsection, evaluation is done to compare the performance of backstepping sliding mode controller with sliding mode controller. Performance results of both methods with step signal and sine wave as references are shown in Fig.  12 and Fig. 13, respectively. According to the results, The comparison of system responses with mass uncertainty and disturbance given as sin 2πt can be seen in Fig. 14. Based on the figure, the backstepping sliding mode control responds more robustly than the sliding mode control. There is a big oscillation in the system response of sliding mode control, while the backstepping sliding mode control only has insignificant oscillations. These evaluation results prove that the backstepping sliding mode control has better performance and is more robust than the sliding mode control.

IV. CONCLUSIONS
This research proposes a new backstepping combined with a sliding mode control method to control an inverted pendulum system with an external disturbance and parameter uncertainty. The proposed controller can make the system follow step and sine wave as reference signals based on evaluation results. In evaluating parameter uncertainty and external disturbance, the proposed controller can make the system more robust while tracking the reference signal. The system responds in a good performance with a fast response while reaching a steady state. Nevertheless, the research is still limited on simulation, so it needs implementation to the actual system for further analysis. Besides, determining the parameter of the controller to get good results still uses trial and error. Hence, choosing the parameter can use a better and more standardized method in future work.

ACKNOWLEDGMENT
The author would like to thank to Universitas Ahmad Dahlan for the research grant and publication grant.