Computer Science
Computer Science-2021.gz:143137
Computer Science
bcc75251ebf772b5265cdea70ccc1e55ae003b0a
Design and Characterization of Second Order Sliding Mode Controller for Pendulum System

Accepted: 31st March 2021 Abstract The main purpose of this paper is to design a robust second order sliding mode controller that can deal with uncertain nonlinear systems. This controller can keep the main advantages of the first order sliding mode controller, such as the ability to make the system asymptotically stable by forcing the error and its derivatives to have a zero value, the simplicity in the operation, and the robustness in the existence of perturbations. In spite of the features that characterize the first order sliding mode controller (1 SMC), it still suffers from the unwanted phenomenon “chattering”, which originates from a discontinuous control part (sign function). In this context, saturation function can be used instead of sign function to reduce this problematic chattering. Different from the saturation function method, the second order sliding mode controller can be used to overcome the chattering; suffered by the first order sliding mode controller and to retain the stability and performance of the system. In this paper, the twisting and the super twisting second-order algorithms of the sliding mode controller were used, and their results were compared with the first order sliding mode controller. So, this subject focused on the chattering problem who suffers from it the 1 SMC and try to reduce it by using the 2 SMC, the uncertain pendulum system was adopted in this work for the purpose of checking the three controllers. The simulations results showed that the second order sliding mode controller has the ability to reduce both the chattering magnitude and the steady state error and achieve an asymptotically stable system. The results were obtained by using MATLAB programming.


Introduction
In the latest years, the ability to control nonlinear systems that suffers from perturbations has taken much attention from many researchers and as a result they developed many techniques [1]. One of the most useful techniques is the sliding mode control (SMC), which is a powerful nonlinear method that is recently used widely in many various applications. The SMC is characterized by a special property such as insensitive to parameters uncertainty and disturbances. Despite of the all properties that belong to the SMC, it is still suffered from a drawback known as "chattering", which is considered as unwanted phenomenon, affecting on the performance of the system and may lead to make the system unstable. In order to reduce the chattering problem, the researchers invented many methods. One of these methods is by replacing the sign function in the discontinuous part of the controller by a saturation function which is considered as a simple solution, V. I. Utkin and Shibly Ahmed Al-Samarraie were published about this method in 2009 and 2011 [2,3]. Other authors suggested using an adaptive sliding mode controller that effect on the control input, and hence the chattering is reduced, like S. Mondal in 2012. On the other hands, some of them utilized the integral SMC (ISMC), like A. K. Hamoudi, N. O. Abdul Rahman in 2016, they adopted this controller to reduce the chattering of the pendulum when using 1 SMC. In ISMC, the reaching phase is removed [4,5]. Lately, some authors proposed to utilize the particle swarm optimization method (PSO) in order to improve the controller. Besides the previous methods, there are many other methods, such as using fuzzy, genetic algorithms and others intelligent methods to improve the controller, these methods were studied by Z. Chen, W. Meng, Z. Wang and J. Zhang, and A. K. Hamoudi in 2008 and 2014 [6,7]. The most important feature in using the SMC is the order reduction, of the actual plant equation, by one [8]. Emel ' Yanov, Levant and Sara Rameriz are the first who proved that the higher order SMC in 2000s has the ability to reduce the chattering and can act with the higher order systems [9]. Hence, in this research, the second order SMC was used to control the pendulum position in the presence of perturbations (parameters uncertainty, disturbances and coulomb friction). In this paper, two algorithms of second order sliding mode controller (2 SMC) were proposed. These algorithms are called the twisting and the super twisting algorithms [10]. The 2 SMC is an efficient tool that can able to solve the above drawbacks, with retaining the main characteristics of the standard SMC [11,12,13]. The aim of the 2 SMC is for directing the sliding variable S and its first derivation ̇ toward zero in finite time in spite of all these undesired perturbations [14,15,16]. In this work, the 1 SMC and 2 SMC techniques were compared by using the simulation results and then proof that a 2 SMC is better than a 1 SMC, especially the super twisting algorithm.

First Order Sliding Mode Controller (1 SMC)
The controlling of nonlinear systems with parameters uncertainty has become important topics and problems for researchers [11]. The essential object of the SMC method is to construct a robust controller that can deal with these systems. This controller must have the ability to drive the sliding variable to the sliding surface (SS) in finite time and retain the system in the required sliding mode thereafter [17]. The SMC was developed by Russian scientists in 1950s and 1960s [18]. The SMC is a special case of variable structure system (VSS). Lately, many applications using sliding mode control method have been made. Actually, SMC can now be used widely in different types of industrial applications, such as inverted pendulum, DC motor, electronic throttle valve and others [4]. The design of 1 SMC consists of two stages; first is the design of a suitable SS and second is the design of a controller, which is important to lead the sliding variable to the SS and then steering it to the zero [17]. The 1 SMC is characterized by some properties, such as the simplicity in the operation and also reducing the order of the plants equation [18]. Despite of the robustness that belongs to the 1 SMC, this controller suffered from the effect of chattering [4]. The chattering considered as undesired phenomenon makes the SMC systems unacceptable and affects the stability of the systems [9]. The major problem of chattering can be resolved by utilizing many strategies as mentioned above in the section one. The system trajectory can be split in two parts; the first part is called the reaching mode. In this mode, the trajectory of the system is starting from an initial point and steering directly toward the manifold S=0. This mode is ended after the trajectory reaching the manifold, and during this mode, the system may be affected by different types of perturbations. The other mode is called the sliding mode, it's started once the trajectory is reached to the manifold and then it enforces the trajectory to remain on the sliding surface and to slide along this surface until reaching the origin, as shown in Fig.1 below [9].

NJES24(1)40-51, 2021 Hashim & Hamoudi
In order to make the surface attractive, it's necessary to design a proper control law, which can able to steer the states trajectory to the SS, and then retain them within the surface in spite of the perturbations [9].
The control law can be determined as below: The control law consisted of two parts: and .
is the continuous part called equivalent control. The other part is called the discontinuous control [19].
The law is defined as below: Where, ( ) must be determined so that it can compensate any perturbations in the system, and
By subtitling eq. (2) into eq. (1), the law of the control becomes as: The switching surface is defined as: Where, λ is a positive constant.
The error and its derivative can be defined as: Where, is considered as a constant value and it represents the final position. Then, eq. (5) can be written as: When λ=1, eq. (6) is rewritten as: The signum function in eq. (4) produced a chattering phenomenon. This chattering is described as a bad property that takes place along the SS. It effects on the stability of the system [19]. Therefore, reducing the chattering is very necessary.
Many methods were developed to reduce the chattering problem. The boundary layer is one of these methods that can be used to reduce the chattering. In this method, the sign (s) function in the law of the control is replaced by saturation (sat (s)) function. The saturation function can described as below [14]:
So, the control law will be defined as below:

Second Order Sliding Mode Controller (2 SMC)
In the recent years, the researchers invented a new structure of SMC known as the higher order SMC to overcome the above drawbacks of the first order SMC, especially the chattering phenomenon. This new structure can able to deal with the complicated and uncertainty nonlinear systems. The first one who introduced the idea of the higher order derivatives of the sliding variable was Emel' Yanov in 1993s [9]. The second order SM algorithms are one type of the HOSMC. In particular, lately the second order sliding mode controller (2 SMC) has taken a major attention from the researchers because of its capability for resolving a wide range of practical problems such as the chattering phenomenon [11]. The 2 SMC can converge the switching variable and its first derivation in finite time to the origin with keeping the essential advantages of 1 SMC. The condition of sliding variable is [17]: =̇= 0 …(10) The essential characteristics of the 2 SMC are the chattering reduction, the ability to apply on the higher order relative degree systems, easy to implement and finally can improve the accuracy of the system. The composition of 2 SMC algorithms is consisted of a discontinuous control and a continuous control and as a result, the chattering is reduced [21]. The 2sliding mode is observed on the sliding surface if the trajectories twisting in the area of intersect S=0 and NJES24(1)40-51, 2021 Hashim & Hamoudi = 0 in the state space, as shown in the Fig.(4) below [14].
Consider the following nonlinear system that is defined as below: The control task is to enforce the state trajectory on a suitable sliding surface in the space to realize by the disappearing of the sliding variable ( ): Taking the first and second derivation of the sliding variable ( ), as defined below [14]: The above functions are bounded as described below [9]: Where, , , and are constants larger than zero.
There are many 2 SMC algorithms for stabilizing the systems. In following, only two algorithms are mentioned which are described below:

Twisting Algorithm (TA)
The twisting algorithm is the first algorithm of 2-SMC algorithms that are recognized. This algorithm is presented by L.V. Levantovsky [18]. This algorithm is called twisting because the shape of the motion of the state trajectory around the origin is in twisting way in the plane of S=0 and = 0 and guarantees the trajectory convergence to the zero, as described in the figure below [10].

Figure (5):
The trajectory of twisting algorithm in ( , ) plane [10]. The twisting algorithm is considered as the simplest algorithm of the 2 SMC algorithms. This algorithm is characterized by its ability to reduce the chattering of the systems of relative degree one and two [20,21].
The discontinuous control law of the twisting algorithm is given as below: for the condition of ( 1 > 2 ).

Super Twisting Algorithm (STA):
Different from the twisting algorithm, the super twisting algorithm is able to reduce the chattering more than twisting algorithm. This super twisting algorithm can stabilize the systems only with relative degree one. It was developed by Levant in 1993s [10]. Also, in this algorithm, the state trajectory comes nearer to the zero in finite time on the phase plane of the sliding variable, as shown in the Fig.(6) below [9]. The super twisting algorithm only needed a magnitude of the sliding variable S [10]. The law of NJES24(1)40-51, 2021 Hashim & Hamoudi this algorithm consists of two portions, the continuous function and the integral of the discontinuous of the sliding variable [9].
The discontinuous control law of the super twisting algorithm is given below: Where, 0 < ≤ 0.5 The adequate conditions to ensure the oncoming of the states trajectory closer to the manifold in the finite time are:

The Pendulum Description
In this study, the pendulum plant was used for testing the two algorithms of 2-SMC. The pendulum is a nonlinear system, and in this work, a perturbations term was add to it which consists of the parameters uncertainty, disturbance and coulomb friction. The coulomb friction is considered as a force affecting in the opposed direction to the motion of the pendulum and its nonlinear term. The perturbations term made the system more complicated.
The pendulum system is shown in Fig.(7) below. It consists of a rigid line with length L, a mass m is pending from this line, and the line is pivoted from above by point O [21,22].

Figure (7):
The pendulum system [19]. Consider the mathematical model of the pendulum system which is described as below: Where: is the angular position of the string with the vertical axis, it's measured by (radian) unit, and it is considered as the output of the system.
̇ is the angular velocity and is measured by (radian/second) unit. is the torque that is applied at the mass of the pendulum to make it swing, it is measured by (Newton. Meter) unit, and it is considered as the control action.
( , ) is the perturbation term, which consists of the parameters uncertainty, external disturbance and the coulomb friction term.
The major problem that the pendulum suffered from is the presence of perturbation term. The

…(22)
In this work, the initial value of was chosen equal to 0.

Design the 1 SMC of the Pendulum System
Let the sliding surface is defined as below: = 1 + 2 …(23) The derivative of the sliding variable is written as below: ̇=̇1 +̇2 …(24) The value of the sliding variable S at the sliding surface is equal to zero.

…(27)
Where, 0 is a constant and its value is greater than one ( 0 > 1), D is external disturbance and m is coulomb friction.
The control law of the pendulum is: To reduce the chattering, the sign(s) function in eq. (28) is replaced by sat(s) function as written below:

Design the (2 SMC) by Using Twisting and Super Twisting Algorithms for Pendulum System
The second time derivation of the sliding variable can be determined as in the following:

The Twisting Algorithm (TA)
The discontinuous control of this algorithm is described as:

The Super Twisting Algorithm (STA)
From eq. (30), ( , ) =( ) and ( , )= , are both limited by conditions as explained above. But it is very complicated to find the accurate values of Γ m , Γ M and Φ, therefore by trial and error, the next values can be chosen which can satisfy the above conditions. Let and : = 9, = 11.
The value of will be also assumed, because it is complicated to calculate its value, therefore let = 5.
The parameters λ and W are calculated from eq.

The 1 SMC with Sign Function
The first order sliding mode controller worked at the first step with a required performance to control the position of the pendulum system, but this type of controller suffered from a severe disadvantage problem known as chattering, which is affected on the stability of the system, and this chattering appeared in the control signal u and the sliding variable S, as shown in Figs.10 and 11, respectively.

The 2 SMC with a Sign Function for Both Algorithms:
In this paper, the second order sliding mode controller is adopted to overcome the chattering problem as shown in the (Fig.16) and (Fig.22), and the chattering in the control signal is reduced. Super twisting algorithm is the best controller in reducing the chattering among the other controllers as shown in (Fig.22), and Table 1 shown the differences between the three controllers.

The Results of Super Twisting Algorithm and First Order SMC with the Saturation Function
To get better performance and good results, first it is convenient to use the saturation function instead of sign function only in the control law of the (STA 2

48
SMC), and then make a comparison with the modified (1 SMC) that also uses the sat(s) function in its control law to prove that the STA is still better than 1 SMC even if they used the saturation function instead of the sign(s) function.

The Results of the ST Case with the Saturation Function:
As observed from the above figures that control action is smooth and it get rid from the chattering problem as shown in the (Fig.28), and the steady state error arrived to zero as shown in (Fig.26).

The Simulation Results of the Modified (1 SMC) with the Saturation Function.
As observed from Figs (32-37) that control action is not smooth and it still suffered from the chattering problem as shown in the (Fig.34), and the steady state error did not arrive to zero as shown in (Fig.32). Table 1. below shows the characteristics of the three controllers when using the sign(s) function. On other hand, Table 2. depicts the characteristics of the super twisting of 2 SMC and 1 SMC when using the sat(s) function.

Table (1):
The performance and the characteristics of the three controllers when using the sign(s) function in control law.

Table (2):
The performance and the characteristics of the two controllers when using the sat(s) function in control law.

Conclusion
This work presents the design of the 1 SMC and 2 SMC; they are developed to control the nonlinear systems with present of perturbations. In this paper, the two algorithms of 2 SMC are considered; the twisting and the super twisting algorithms, as well as the 1 SMC is also studied. The three algorithms of the sliding mode controller were applied to control the position of the pendulum with the presence of uncertainties; disturbance and coulomb friction in order to prove that the 2 SMC has better performance than 1 SMC. In this work, it is concluded from the simulation results that the 2 SMC is an efficient tool to reduce the chattering of the 1 SMC but it does not remove it completely, as shown in the (Fig.16), (Fig.17), (Fig.22) and (Fig.23). The 2 SMC can also able to retain the main advantages of the 1 SMC as mentioned above. From the simulation results, it can be observed that when using the 2 SMC, the reduction of the chattering is achieved. From the comparison of the results of the 1 SMC and 2 SMC, it can be observed that the 2 SMC is better than the 1 SMC in the magnitude of chattering and this is listed in Table 1. Also from the simulation results, it can be concluded that the super twisting of 2 SMC is the best case and it can give a perfect results because of its integral term in control law, which converted the discontinuous term to continuous, and as a result the chattering is reduced, as shown in the (Fig.22). Also, the 2 SMC has the ability to reduce the steady state error of the 1 SMC, as shown in the (Fig.26) and (Fig.32) From Table 1, it can be seen that the 2 SMC is better than the 1 SMC and it has the ability to resolve the drawbacks of the 1-SMC, as well as it can able to increase the accuracy of the system. It can be seen clearly from the simulation results that the super twisting of 2 SMC is the best one among the other controllers.
For more improvement of the super twisting of 2 SMC and to get better performance, the sign(s) function of the discontinuous term in control law is replaced with a sat(s) function, and then comparing the results with the modified 1 SMC that also used a saturation function in its control law. The simulation results ensure that the super twisting of 2 SMC is still better than 1 SMC, as shown in Table 2.