An In-Depth Analysis of Sliding Mode Control and Its Application to Robotics

In this study, a sliding mode control scheme with a bounded region and its convergence analysis are explained to the finest detail and are applied to robotic manipulators which represent the best examples for strongly coupled, highly nonlinear, time-varying dynamical systems. Simulation studies have been applied separately to two different control systems in order to demonstrate the feasibility, performance, and effectiveness of the proposed control methodology through the design of the sliding mode controller: firstly, the position control of an armature-controlled dc servo motor subject to a varying external disturbance, and secondly, a two-link robot manipulator that were also analyzed in terms of its robustness by adding extra mass to one of the joints to be able to maintain the trajectory in the sliding surface. Simulations show that a fast convergence rate, and therefore quick response, the ability to reject the varying external disturbances, and the robustness against the model uncertainty assumed to be unbounded and fast-varying have all achieved its purpose entirely. This study also examines the advantages of SMC and PID comparably. The results given here do not contradict the view that one can use it instead of the other without losing too much performance, and confirm the success of the presented approach. feasibility and effectiveness of proposed control i.e., the position control of a dc motor subject to a varying and a two-link robot manipulator. Simulations show that a fast convergence rate, and hence quick response, the ability to reject the varying external disturbances, and the robustness against the model uncertainty assumed to be unbounded and fast-varying have all achieved its purpose entirely. Chattering is eliminated by using the boundary layer whose attractiveness and invariance properties of the boundary layer were also introduced. This study also examines the advantages of SMC and PID comparably. Although, in the comparisons given in the literature, the pros and cons of both strategies are mentioned, it is generally observed that SMC performs better than PID. Nevertheless, PID control can still be used as an alternative to SMC. When the PID control strategy does not work well under unknown disturbances and payload changes, SMC provides robustness against parameter uncertainties and unmodeled disturbances so long as the observed undesirable chattering effect is overcome through some modifications as in the Robustness analysis has been performed and successfully applied to the two-link rigid planar robotic manipulator. We have not observed any performance degradation of the trajectory to be maintained in the sliding surface. The results given here do not contradict the view that one can use it instead of the other without losing too much performance. Finally, a two-step simulation has been carried out, testing all the features above, and the results have confirmed the success of the presented approach. However, it meaningful and challenging to develop new SMC theories and methods for nonlinear systems due to its broad application potentials in today ’ s


Introduction
Unknown plant parameters or, more generally, plant uncertainty and the preferences in which the system dynamics are purposely represented by simplifications, such as the use of linearized friction model, lead to model imprecision [1]. Control engineering classifies the model inaccuracies, which were used here as synonym of imprecision, into two main categories as structured and unstructured uncertainties. The first one implies inaccuracies within the model and the second one corresponds to inaccuracies on the system order (i.e., underestimated system order). Modeling inaccuracies can have adverse effect on nonlinear control systems [1].
Robotic manipulators represent the best examples for strongly coupled, highly nonlinear, time-varying dynamical systems [2]. These qualities alongside structured uncertainties caused by model imprecision of link parameters and payload variation, and unstructured uncertainties produced by unmodeled dynamics such as nonlinear friction, compliance in gearing, sensor noise, external disturbances, and the high-frequency part of the dynamics turn the motion control of rigid-link manipulators into a complex problem [2]. Particularly, robotic manipulators suffer so much from these structured and unstructured uncertainties. The consequence of having to deal with various uncertainties in their dynamics and the necessity to manage the various tools and, hence, the variation of dynamic parameters during operation make it difficult for robots to introduce a mathematical model suitable for employing model-based control strategies.
The theory of conventional sliding mode control (SMC) as a simple robust nonlinear control scheme has been applied to robotic manipulators successfully since the 1980s. In those studies, the advantages of the SMC properties such as its robustness against disturbances and variation of parameters, and its fast dynamic response have been utilized greatly. Two important approaches, such as robust control and adaptive control, can deal with modeling uncertainty [1]. Particularly, adaptive control is effective in solving the structured and unstructured uncertainties and is capable of maintaining a uniformly good performance over a limited range.
SMC as a special class of the variable structure systems (VSS) has been preferred in practical applications for over 50 years due to its simplicity and robustness against parameter variations and disturbances [3]. VSS concept was first evolved from the pioneering work of Emel'yanov and Barbashin in the early 1960s in Russia [4]. Especially, VSS and SMC have received a great attention by the control research community worldwide since the published 1977 article [4]. SMC methodology is used to design a control law that imposes all system trajectories to converge on a surface in the state space, the so-called sliding surface S t ð Þ. The designer chooses the dynamics of this surface so that all trajectories will asymptotically converge to the set point. When the trajectory lies inside the sliding surface, the system operates in so-called sliding mode and is sensitive to parametric variations and external disturbances [5]. Control action in sliding mode is discontinuous by nature and can stimulate high-frequency dynamics [6]. Discontinuous nature of the control action serves to maintain a resulting superior system performance of VSS and SMC by switching between two incomparably different system structures such that sliding mode with this feature is also referred to as a new type of system motion in a manifold, or in another substantial terms, in the vicinity of a prescribed switching manifold, the velocity vector of the controlled state trajectories is always directed toward the switching manifold by such motion induced by imposing discontinuous control actions [3,6]. This system performance is expected to exhibit insensitivity to parameter variations as well as demonstrate complete disturbance rejection [6].
Despite its advantages such as simplicity and robustness, SMC suffers from a rather widespread and well-known chattering problem, which is generally perceived as motion oscillating about the predefined switching manifold(s) [3,6]. There are two reasons behind the chattering phenomenon: first, under the absence of switching nonidealities such as delays, that is, in a situation where the switching device ideally switches at an infinite frequency, the presence of parasitic dynamics in series with the plant causes a small amplitude high-frequency oscillation to occur around the sliding manifold. If the closed loop pole locations are well defined or the closed loop poles are well assigned with the aid of the pole placement design technique, these parasitic dynamics which represent the fast actuator and sensor dynamics are often neglected in the open loop model used for control design in control applications. In general, the motion of the real system is closer to an ideal system where the parasitic dynamics are neglected, and the difference between the ideal and the real motion, which is at negligible time constants, shows a rapid decline. However, the parasitic dynamics interacted with variable structure control (VSC) in particular produce a nondecreasing oscillatory component with a finite amplitude and a frequency, referred previously to as chattering phenomenon already. Second, the switching nonidealities alone can cause such high-frequency oscillations around the sliding surface S t ð Þ [3,6]. These may include small time delays due to sampling (e.g., zero-order hold), execution time required to calculate the control, and transmission delays in networked control systems [3]. As time delays cause the resulting chattering phenomenon, and the delay type of switching nonidealities is the most relevant to any electronic implementation of the switching device whether it includes analogue or digital circuits, delay type nonidealities are considered in general for the design approaches, and discrete-time control design techniques are the most commonly used design approaches by control engineers to mitigate the chattering caused by the switching delays [6]. Many design methodologies have been applied so far to mitigate or reduce the chattering. To eliminate the chattering, a boundary layer around the sliding surface S t ð Þ has been introduced [1]. Inside the boundary layer, the switching function is replaced by a high-gain proportional control [5]. In order to reduce the chattering level, several switching functions such as saturation functions, relay functions, hyperbolic functions, and hysteresis saturation functions have been used in literature. The use of these functions can minimize or, if desired, completely eliminate the chattering, but it turns perfect tracking into a tracking with a guaranteed precision problem, meaning that a steady-state error is always maintained.
SMC design procedure is split into two major steps corresponding to the two main phases [3]: reaching phase is defined to derive the system state from initial state to reach the switching manifolds in finite time; and sliding-mode phase is defined to induce the system into the sliding motion on the switching manifolds like an attractor.
No matter how active the research on SMC has been during the last 50 years, the key technical challenges such as chattering, the elimination of the effects caused by unmodeled dynamics, disturbances and uncertainties, adaptive learning, and improved robustness can still remain to be addressed to reach a perfect solution [3]. An ideal sliding mode can only be achieved when the dynamic equation governing the sliding mode is satisfied by the system state for all time. This implies an infinite switching to assure the sliding motion [3]. Although the switching rate of the switching control device of the SMC system (design) is infinite ideally, it is much lower than that in practice due to the physical limitations of switching [6]. Physical limitations of switching have been tried to be explained in the previous paragraphs.
Usually, intelligent control approaches can mitigate the effects of structured parametric uncertainty and unstructured disturbance with their effective learning ability without requiring a detailed knowledge of the controlled plant within the design process. SMC research has recently been integrated with intelligent control approaches such as neural networks, fuzzy logic, genetic algorithms, and probabilistic reasoning, just a few of them, to make it more intelligent [3,[7][8][9][10][11]. Another goal behind the combination of the intelligent control with the attractive features of this traditional control is to create more powerful control algorithms. Nevertheless, it appears that many intelligent control algorithms do not take into account actuator dynamics in robot control systems, which play a critical role in overall robot dynamics and their negligence can cause adverse effects, especially in the case of high-speed torque, respectable load variations, friction, and actuator saturations [2]. Electrical actuators are very much controllable than others and are more suitable for driving robot manipulators [2,12].
Sliding mode control strategy is the simple approach to robust control. By intuition, controlling first-order systems is much easier than controlling general nthorder systems, even if they are nonlinear or uncertain. Therefore, an introduction of a notational simplification allows nth-order problems to be replaced by equivalent first-order problems. Thus, it is then easy to demonstrate in principle the achievement of perfect performance under the presence of arbitrary parameter inaccuracies for the transformed problems. However, such performance is only achieved at the expense of extremely high control activity. This is typically disputed by the other source of modeling uncertainty, such as the presence of neglected dynamics, which the high control activity can stimulate. This leads to a change in control laws aimed at achieving an effective trade-off between tracking performance and parametric uncertainty, given the acceptable control activity [1].
The concepts will first be presented for systems that have a single control input that allows us to develop an intuition about the fundamental aspects of nonlinear controller design.

Sliding surfaces
Consider the single-input dynamic system given below: where the scalar x is the output we are interested in, the scalar u is called the control input, and (1) is not exactly known, an upper bound on f x ð Þ is set by a known continuous function of x to limit the size of the imprecision. Similarly, the control gain b x ð Þ is not exactly known either, only its sign is known; therefore, it is also bounded by the known continuous functions of x. The control problem is to ensure that the state x tracks an explicit time-varying state In order for the tracking task to be achieved using a finite control u, desired initial state x d 0 ð Þ must be such that it ultimately validates the following relationship: For example, in a second-order system, the position or speed cannot bounce; as a result of this fact, any desired trajectory that can be workable from time t ¼ 0 necessarily starts at the same position and speed as those of the plant.

A notational simplification
Let us definex ¼ x À x d as the tracking error in the variable x, and where λ is a strictly positive constant. For example, if n ¼ 2, Eq. (3) takes the following form: that is, it simply consists of a weighted sum of the position and the velocity errors; thus, we can expressx from Eq. (3) as follows: More specifically, a first-order stabilization problem in s is basically nothing other than a replacement for the problem of tracking the n-dimensional vector x d (i.e., the original nth-order tracking problem in x). Indeed, s needs to be differentiated only once for the appearance of the input u due to the presence of the term x nÀ1 ð Þ in the expression s in (3). Additionally, the bounds on s can be evaluated directly as the bounds on the tracking error vectorx, and therefore, the scalar s is considered a true measure of tracking performance. Specifically, under the assumption thatx 0 ð Þ ¼ 0 (in the meantime, we make a note that the effect of non-zero initial conditions inx can be added separately), we write: where ε ¼ Φ=λ nÀ1 : Indeed, Eq. (3), or more precisely, Eq. (4) derived from (3) clearly indicates that the tracking errorx can be obtained from s through a sequence of first-order low-pass filters (see Figure 1, where p ¼ d=dt ð Þis commonly known as the Laplace operator).
In general, a first-order low-pass filter's input-output relationship is given as follows: where K f is filter gain and τ is filter time constant. Let y 1 be the output of the first filter. We can express the output of the first filter in terms of a convolution integral in time domain by taking into account the fact that the input is already defined as s: Using s j j ≤ Φ, we get the following: We can apply similar reasoning to the second filter, et cetera, until we reach y nÀ1 ¼x. Ultimately, we getx j j ≤ Φ=λ nÀ1 ¼ ε: Similarly,x i ð Þ can be considered to be acquired through the sequence of Figure 2.
One can easily make another similar relationship, z I j j≤ Φ=λ nÀ1Ài by referring to the previous result. Here, z I is the output of the n À i À 1 ð Þ th filter. It is worth noting, however, that One sees that the remaining i blocks right after n À i À 1 blocks in the sequence of Figure 2 include numerators of p as can typically be seen in practical filter applications, and that the sequence of Figure 2 means that where the first multiplier to the right of inequality sign includes the first n À i À 1 blocks which do not have p as the numerator. When i blocks multipliers are arranged, the expression takes the form: where term comes from the result derived for the sequential blocks each of which is represented by 1= p þ λ ð Þ, and 1= p þ λ ð Þ i ≤ 1=λ i : Besides, the positive sign must be considered to obtain the prospective upper bound. In this case, the next step is: Computing bounds onx i ð Þ : Thus, as a result, we reach the following statement: i.e., the bounds of (5) are proven. Finally, in the case wherex 0 ð Þ 6 ¼ 0, the bounds of (5) are obtained asymptotically, that is, within a short time constant n À 1 ð Þ=λ. Please note that since the single filter block has a time constant equal to 1=λ as seen from the above analysis starting from (3), the sequence of n À 1 ð Þfilter blocks will have the time constants equal to n À 1 ð Þ=λ. Hence, we, indeed, have replaced an nth-order tracking problem by a first-order stabilization problem, and have quantified with inequality (5) the transformations in which the performance measures correspond to.
Keeping the scalar s at zero, which is a simplified first-order problem, can now be achieved by choosing the control law u of (1) such that apart from S t ð Þ where η is a strictly positive design constant and ensures inequality (6) which is called ηreachability condition. A fundamental requirement is that the sliding mode dynamics must be attractive to the system state and there are many reachability conditions defined in the literature [13][14][15][16][17]. Basically, inequality (6) indicates that the squared "distance" to the surface, as measured by s 2 , decreases throughout entire system trajectories. Therefore, it restricts trajectories to head toward the surface S t ð Þ, as depicted in Figure 3. Particularly, when they are on the surface, the system trajectories remain on the surface. In other words, the fact that the surface is an invariant set indicates that condition (6) (a.k.a., sliding condition) is satisfied. Moreover, as we shall notice, inequality (6) also suggests tolerating some disturbances or dynamic uncertainties while still holding the surface stationary (i.e., an invariant set). In Figure 3, this graphically means that the trajectories away from the surface can "move" while still denoting the surface. S t ð Þ verifying (6) is referred to as a sliding surface, and the system behavior that occurs on the surface is called sliding regime or sliding mode.
Another appealing feature of the invariant set S t ð Þ is that when the system trajectories are on the set, it is defined by the equation of the set itself, i.e., d dt þ λ nÀ1x ¼ 0: That is to say, the surface S t ð Þ represents both a place and a dynamics. This fact is clearly the geometric interpretation of our previous statement that definition (3), in fact, allows us to substitute a first-order problem for an nth-order one.
Finally, if condition (2) is not fully validated, i.e., if x t ¼ 0 ð Þis indeed away from x d t ¼ 0 ð Þ, then, nevertheless, satisfying (6) gives a guarantee for reaching the surface S t ð Þ at a finite time smaller than s t ¼ 0 ð Þ j j =η. Indeed, assume, for instance, that s t ¼ 0 ð Þ> 0 and define t reach as the time needed to hit the surface s ¼ 0. Integrating (6) between the points t ¼ 0 and t ¼ t reach (i.e., in the interval [0, t reach ]) gives rise to: which means that This result can simply be proven to be true by starting to integrate both sides of (6) between 0 and t reach as follows: Making the necessary simplifications within the integrals, we get the following: Now, the integrals are taken and evaluated for the lower and upper limits as shown below: Finally from here, is written, and the same result as (7) is hereby obtained. Even if s t ¼ 0 ð Þ< 0, a similar result would be obtained, and thus, writing the above inequality as follows would be a correct representation: Furthermore, definition (3) implies that once on the surface, the tracking error tends exponentially to zero, with a time constant n À 1 ð Þ=λ. The typical system behavior implied by satisfying sliding condition (6) is shown in Figure 4 for n ¼ 2. A line with slope -λ and containing the time-varying point T represents the sliding surface in the phase plane. The state trajectory reaches the time-varying surface in a finite time smaller than s t ¼ 0 ð Þ=η from any initial condition, and then slides across the surface towards x d exponentially, with a time constant equal to 1=λ.
In conclusion, the idea behind (3) and (6) is to obtain an appropriate function of the tracking error, s, in accordance with (3), and then choose the feedback control law u in (1) such that s 2 continues to be used as a Lyapunov-like function of the closed-loop system, in spite of the presence of model imprecision and of disturbances. Then, the controller design is a two-step procedure. First, the selection of a feedback control law u is performed to verify sliding condition (6). However, it is required that the control law be discontinuous throughout S t ð Þ to take into account the presence of modeling imprecision and of disturbances. Since the execution of the associated control switchings is not necessarily perfect (for instance, in practice, switching is not instantaneous, and the value of s is not known with infinite precision), this causes chattering ( Figure 5). Now, with a few important exceptions, chattering is practically undesirable, because it contains high control activity and can trigger neglected high-frequency dynamics during modeling (such as unmodeled structural modes, neglected time-delays, etc.). Thus, in a second step, the discontinuous control law u is smoothed accordingly to reach an optimal compromise between control bandwidth and tracking precision: while the first step explains parametric uncertainty, the second step ensures robustness to highfrequency unmodeled dynamics.
As mentioned previously, the discontinuous control law causes chattering of the trajectories to take place around the surface s ¼ 0. This problem can be eliminated  by smoothing out the discontinuities in the vicinity of the sliding surface through the introduction of a boundary layer thickness. An adaptation of saturation nonlinearity instead of signum nonlinearity in a position control system in which it is represented by Eqs. (83) and (84) in order to decrease the chattering phenomenon caused by sliding mode control law is the result of the same effort of smoothing out the discontinuities with the introduction of the boundary layer thickness as illustrated in Figure 6.
To maintain the system work in the sliding surface, a switching action term, u sw , is added to the control law, and is defined by and overall control law can be expressed as: High frequency control , which will be explained in more detail in Section 5.1. Here, the nonlinear saturation function sat s ð Þ, which is the replacement for nonlinear signum function sgn s ð Þ, is defined by where ∅ is the boundary layer thickness.

Sliding mode control design
A continuous-time dynamical equation of an n-link robot manipulator is defined as follows: where q ∈ R nx1 denotes the joint configuation variables (translational or rotational) representing the generalized position coordinates (alias the joint positions) of the robot links. Similarly, _ q, € q ∈ R nx1 represent the joint velocity and acceleration of the robot links, respectively. M q À Á ∈ R nxn is the symmetric, bounded, positive definite inertia mass matrix. C q, _ q À Á ∈ R nxn is the matrix of Coriolis and centripetal forces and F _ q À Á ∈ R nx1 is the vector of viscous friction. Furthermore, the vector of G q À Á ∈ R nx1 represents the gravity terms, and finally, τ ∈ R nx1 is called the control torque vector, or the vector of applied joint torques.
Sliding surface defined below is considered in the design of SMC controller: where e ¼ Àq ¼ q À q d represents the error vector and λ is assumed to be a symmetric positive definite matrix such that s ¼ 0 would evolve into a stable surface. The reference velocity vector _ q r is the same as the definition in [1]: Hence, one can define the sliding surface as follows: Now, the following lemma refers to the sliding mode controller design. Lemma 1. Let us consider the system consisting of (8) through (10). If the following control rule is selected: such thatτ and then the following sliding condition [1], is satisfied. In (14), K sg i stands for the element of sliding gain vector K sg and Γ is a design parameter vector that must be chosen to ensure the inequality Γ i ≥ F up þ η i .
Proof. Let Lyapunov function candidate be given as follows: Since M is positive definite and s is different from zero (s 6 ¼ 0), V is always greater than zero (V > 0) and by taking time derivative of (16) and taking into account the symmetric property of M, it takes the following form: Using (11), we get: Taking € q from (8) and replacing it in (18), we have: Then, taking _ q from (11) and replacing it above yields: In the above equation, the second term is zero due to the asymmetry property; therefore, it disappears. In this new case, Next, applying (12) and (13) successively for τ andτ in Eq. (19), and proceeding step by step, the following result is reached: In robot modeling, the terms M q À Á and G q À Á can be well and accurately determined, but in most cases it is not easy to have the parameters C q, _ q À Á and F _ q À Á precisely. Therefore, in this work, the matrix C is considered where C i,j stands for the elements of the matrix C. Also, the vector F is assumed an external disturbance with the upper bound defined as, where the operator : k k denotes Euclidian norm [2]. Now, by rearranging (20) as shown step by step below, we get the following: At this point, we can briefly verify that the terms on the right side of (14) are positive. First of all, it is easiest to say that the first term on the right, ΔC _ q r , is positive in any case, because the Euclidian norm is used. The other term Γ i is also positive. Because, as we have already stated in (14) that (22), which also indicates that it is absolutely positive, and η is a strictly positive design constant and ensures inequality (6). Hence, Γ i ≥ 0. Now, if the inequality K sg i given by (14) is substituted in Eq. (23) under the acceptance of its equality sign for a moment, we can rewrite Eq. (23) by extending it as follows: The first, second and third terms on the right side of the equation above are negative in varying amounts and contribute to the final term, which is P n i¼1 η i s i j j, more negatively. Therefore, we can easily conclude that This shows that V is a Lyapunov function and the satisfaction of sliding condition in (15) is proven.

Achievement of the control law for robot manipulators for the adapted reaching mode
VSC systems include a group of different, generally fairly simple, feedback control laws and a decision rule. Depending on the system condition, a decision rule, usually called the switching function, determines which control law is "on-line" at any time. The transient dynamics of VSC systems consists of two modes: a "reaching mode" (or "non-sliding mode"), and a subsequent "sliding mode". Hence, VSC design involves two stages: the first one involves the design of the appropriate n-dimensional switching function s x ð Þ for a desired sliding mode dynamics. The second one involves a control design for the reaching mode where a reaching condition is met. The desired sliding mode dynamics usually includes a fast and stable error-free response without overshoot. In sliding mode, an asymptotic convergence to the final state will be accomplished. The desired response in the reaching mode, in general, is to reach the switching manifold defined as in a finite time with a small amount of overshoot with regard to the switching manifold [18].
The reaching law is a differential equation that determines the dynamics of a switching function s x ð Þ. If s x ð Þ is an asymptotically stable differential equation, then, it is solely a reaching condition. Further, the parameter selection in the differential equation controls the dynamic quality of the VSC system in the reaching mode. The reaching law can be expressed practically in general form as follows [18]: where The design principle of the SMC law for the plants of arbitrary order is to force a variable's error and its derivative to zero. Tracking of a desired motion q d t ð Þ is the main task of the robot arm. Here, let us start first by defining a 2n-dimensional error vector [18]: and then, an n-dimensional vector of switching function: where _ e represents the tracking speed error and: that determines the system bandwidth. Next, the time derivative of (28) is taken as follows [18]: Now, constant plus proportional rate reaching law as represented by is adapted. Substituting (30) into (29) and setting € q apart yields: Finally, substituting (31) into the non-linear plant of continuous-time dynamic model of robot systems in (8) results in: This is also known as the final control law.

Proofs of the boundedness and convergence properties of smooth sliding mode controllers
In this section, the proofs of the boundedness and convergence properties of the smooth sliding mode controllers are introduced. In particular, the convergence analysis of smooth sliding mode controllers will be explained and discussed to the finest detail. Lyapunov's direct method is used to handle the finite-time convergence of the tracking error vector to the boundary layer. Also, once in the boundary layer, the tracking error vector is said to have exponentially converged to a bounded region, as proven analytically.

Problem statement
Consider the following non-linear system class of n-th order: where u is the control input, x n ð Þ , is the n-th order derivative of the interested scalar output variable x with respect to time t ∈ 0, ∞ ½ Þ. Here, also, represents the system state vector, and both f(x) and b(x), such that f , b : R n ! R, denote nonlinear functions.
The following assumptions will be made in terms of the dynamic system presented in (33).
Assumption 1. f is an unknown function such that it is bounded by a known

Assumption 2. Input gain b x ð Þ is an unknown function such that it is positive and bounded
In the proposed state space control problem, the x state vector must be able to follow a desired trajectory Let us define a sliding surface S in the state space by the equation sx ð Þ ¼ 0 in which s is the function mapping from n-dimensional real space R n to onedimensional real space R, i.e., s : R n ! R, and satisfying the following equation: which can be plainly rewritten as with c i representing binomial coefficients as follows: which makes c nÀ1 λ nÀ1 þ … þ c 1 λ, c 0 a Hurwitz polynomial. It can be easily verified from (35) that c 0 ¼ 1, for ∀n ≥ 1. Therefore, the time derivative of s will be expressed in the following form: i.e., where, here, as used for the first time above, there is a definition in the form At this point, let us evaluate Eqs. (34) and (36) for n ¼ 3, i.e., from which c appears to be as and c 2 λ 2 þ c 1 λ þ c 0 is a Hurwitz polynomial. That is, it is defined as the polynomial with its coefficients (i.e., c i ) that are positive real numbers, and its zeros are located in the left half-plane -i.e., the real part of every zero is negative-of the complex plane. Now, Let the problem of controlling the uncertain nonlinear system expressed by (33) be handled for review through the classical sliding mode approach that defines a control rule consisted of an equivalent controlû ¼b À1 Àf þ x n ð Þ d À c Tx and a discontinuous term ÀKsgn s ð Þ as follows: whereb ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi b max b min p represents the estimated value of b, and K represents a positive gain. Furthermore, the sign or signum function represented by sgn s ð Þ above Based on Assumptions 1 and 2 given above and taking into account the fact that , the gain K must be determined in such a way as to ensure the following inequality: where η is a strictly positive constant of the reaching time. Now, in this step, let us reaffirm the validity of the lower and upper bounds of b using theb and β definitions given: first of all, Let the definitions ofb and β be placed in the expression β À1 ≤b=b ≤ β given above. In this case, If each side is multiplied by 1= ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi b max b min p , the following inequality is obtained: In this inequality, if inversion is applied to all terms, inequalities will be completely displaced, that is to say, it will become b max ≥ b ≥ b min . This is a necessary initial acceptance. Therefore, when we turn b's upper and lower bounds into inequality, we once again confirm the correctness of the definitions forb and β. Since the control rule will be designed to be robust against the inequality β À1 ≤b=b ≤ β, that is, a bounded multiplicative uncertainty, taking advantage of the similarity to the terminology used in linear control, we can call β the gain margin of the design.
In order to ensure x x d system tracking, we define a sliding surface s ¼ 0 When we derive the expression s, we obtain the following: x ¼ 0 to be realized, other terms outside of u must be determined equal to the opposite sign ofû, which is the best approximation of a continuous control rule u that can implement _ s ¼ 0, that is, In fact, to see this result, the first thing to do is to draw u from the equation x is obtained. Then, from here, in order to obtain the approximate value of u, searching for the approximation of the function on the right side of the equation, and representing this approximated function byf symbolically are sufficient to lead us to the correct result, as seen above.
The control rule u ¼b À1û À ksgn s ð Þ ½ with predefined s andû, and k defined by the inequality k ≥ β F þ η ð Þþ β À 1 ð Þû j j-as will be explained little below-meets the sliding condition. Indeed, when we substitute this control rule in the expression _ which is more specific to this type of structure, instead of € x ¼ f þ u used only just two above, we obtain the following, Once the previously determinedû is replaced above, the following equation is reached: The organized form of this statement will be as follows: Such that k should meet the following condition, We can really achieve this condition by following the steps below: Here, it was previously described that f Àf ≤ F. But, when determining k, it will be necessary to take into account the reaching time η. Therefore, we will allow F þ η to be written instead of F. Removing the term sgn s ð Þ, k will be determined as follows as a result of our compensation through expressing, with an absolute value, the effect of its reciprocations being of which the negative s values relative to the positive s values and of which only the sign changed: Note here that F ≥ 0 and η > 0 (absolute positive). For this reason, there is no need to take absolute values of these terms. Here again, using the definitionbb À1 ≜ β, for k, we get the expression,

Remark 1.
To avoid any confusion, if we wanted to verify (40) by proceeding from (39), since η has already been taken into account in (39), we would not need to take F þ η instead of F. We would proceed directly with f Àf ≤ F.

Remark 2.
Considering the fact that the F value can be faced with moments where the estimation problem will be relatively large by nature and similarly with the moments when η reaching time will be relatively larger, it is possible to state precisely that it is the right choice or necessity to take the direction of inequality k greater than or equal to.
Thus, it can be easily verified that the control rule u ¼b À1 Àf þ x n ð Þ d À c Tx À Ksgn s ð Þ is sufficient to impose the shift condition, which indeed guarantees the convergence of the tracking error vector to the sliding surface S and consequently its exponential stability in a finite-time. In response to the uncertainty of f on dynamics, we add a discontinuous term toû across the surface s ¼ 0 to meet the slip condition given above, that is: u ¼û À ksgn s ð Þ: Here we can now guarantee that the sliding condition will be verified by This last operation is important; because we have reached this point by using the x, and u ¼û À ksgn s ð Þ as follows: If we continue where we were, Therefore, since sgn s ð Þs ¼ s j j, the following expression is reached, So that, when k ¼ F þ η is selected, the above statement follows, However, although the definition off À f ≤ F is given at the beginning of the section, recalling that we prefer the form f Àf ≤ F to be used in the case study below, Let us give the statement its final form: In fact, note that here the expression f Àf , which we substitute for F represents the smallest value that F can take. We generally know that F is greater than this value.
We will now carry out the following case studies for the Eq. (41): Case 1. If f Àf and s are both negative or positive, as such, f Àf s À f Àf s j j ¼ 0. However, it is known to be F ≥ f Àf , hence, f Àf s À F s j j ≤ 0, i.e., it will always be negative.

Case 2.
However, if f Àf and s opposite signs; f Àf s will always be negative.
ÀF s j j will also be negative. Hence, f Àf s À F s j j will always be more negative as compared to Case 1. As a result, is always true. However, the presence of a discontinuous term (i.e., ÀKsgn s ð Þ) in the control rule leads to the well-known chattering effect. To prevent these unwanted high-frequency oscillations of the controlled variable, Slotine had proposed the idea of adopting a thin boundary layer S ∅ around the switching surface [1]: Here ∅ is an absolute positive constant, which represents the boundary layer thickness.
The boundary layer is accomplished by replacing the sign function with a continuous interpolation in S ∅ . It should be emphasized that this smooth approximation referring to the flatness or smoothness of the interpolating curve and its derivatives, which will be called φ s, ∅ ð Þ, here, will definitely act as a sign function outside the boundary layer.
Various options are available to smooth out the ideal switch. But the closest choices are the saturation function expressed by and the hyperbolic tangent function expressed by tanh s ∅ . Thus, the smooth sliding mode control rule can be expressed as follows:

Convergence analysis
The attractiveness and invariance properties of the boundary layer are introduced in the following theorem: Theorem 1. Consider four previously made assumptions with the uncertain nonlinear system given in (33). Therefore, the smooth sliding mode controller defined by (38) and (44) provides the finite-time convergence of the tracking error vector to the boundary layer S ∅ defined by (42).
Proof. Let a positive-definite Lyapunov function candidate V be defined as, Here, as a measure of the distance of the current error to the boundary layer, s ∅ can be computed as follows: Noting that s ∅ ¼ 0 in the boundary layer, it is shown that _ V t ð Þ ¼ 0 inside S ∅ . It is also possible to easily verify that _ s ∅ ¼ _ s outside the boundary layer through (43) and (46), and in this case, _ V can be written as follows: Next, considering that the control rule given by (44) is written as outside the boundary layer and noting that f ¼f Àf À f , we get the following result: Thus, by taking the Assumptions 1 and 2 into consideration, and defining K according to (38), _ V can be written as follows, Because the Lyapunov function candidate, which we initially defined with (45) as positive definite, essentially inspired by the inequality in the form of 1 2 d dt s 2 ≤ À η s j j which we have always correctly demonstrated above, may well be represented by a similar structure to the form, 1 2 d dt s ∅ 2 ≤ À η s ∅ j j: It will be seen from here that _ V t ð Þ ¼ s ∅ _ s ∅ ≤ À η s ∅ j j, as well. Hence, the inequality _ V t ð Þ ≤ À η s ∅ j j will imply that V t ð Þ ≤ V 0 ð Þ and therefore s ∅ is bounded. Moreover, from the definitions of s and s ∅ expressed in (35) and (46), respectively, it can be verified thatx is bounded. Therefore, Assumption 4 and (36) imply that _ s is also bounded. Finite-time convergence of the tracking error vector to the boundary layer can be shown remembering the expression, Then, dividing both sides into s ∅ j j above and integrating them between 0 and t will refer to the following result:

Remark 3.
Here, considering the ratio s ∅ = s ∅ j j as the ratio of two numbers of the same size and therefore assuming it disappeared, that is, since it has no effect in size, substantially it is a correct approach to consider the integral as an equivalent to Ð t 0 _ s ∅ dτ. This produces the result s ∅ t ð Þ j jj t 0 : Consequently, knowing the fact that in the situation before taking this approach, the product s ∅ _ s ∅ which appears in the numerator of the integral to the left of inequality is essentially equal to the derivative of the positive-definite V Lyapunov candidate function and is therefore positive again, it is essential to show the terms on the left side of the inequality with absolute value. That is to say, it is important to see that s ∅ _ s ∅ s ∅ j j > 0: Then, the next step to ensure this will turn into the form s ∅ t ð Þ j jÀ s ∅ 0 ð Þ j j≤ À ηt: In this way, considering t reach as the time required to reach s ∅ and noting that s ∅ t reach ð Þ j j¼ 0, we have the expression, guaranteeing the convergence of the tracking error vector to the boundary layer in a time interval less than s ∅ 0 ð Þ j j=η: That is, the right-hand side will act as the largest value achievable for t reach . In other words, it will appear as a guaranteed upper value. Then, the value of s ∅ 0 ð Þ j j Às ∅ t ð Þ j j η is expected to be less than this guaranteed value of s ∅ 0 ð Þ j j=η: Therefore, to keep the reaching time, t reach , as short as possible, the value of the positive constant η can be chosen appropriately. We clearly see from Figure 7 that the time evolution of s ∅ j j is bounded by the linear equation s ∅ t ð Þ j j¼ s ∅ 0 ð Þ j jÀ ηt. Lastly, the proof of the boundedness of the tracking error vector is based on Theorem 2. Theorem 2. Let the boundary layer S ∅ be defined according to (42). Then, once inside S ∅ , the tracking error vector will exponentially converge to an n-dimensional box defined according tox i Proof. Considering the fact that sx ð Þ j j≤ ∅ can be rewritten as À∅ ≤ sx ð Þ ≤ ∅ with the definition of s given in (34), the expression below ð Þ or the following, can be written. If (49) is multiplied by e λt , the following statement is reached: In fact, this expression is equal to That is to say, We can confirm this form of (51) for small n values. Namely, if binomial is written. Hence, At this point, we can make a confirmation by taking n ¼ 3: The binomial coefficient of this single term is 1, and this number is at the top of the Pascal triangle. For n ¼ 2, it becomes sx ð Þ ¼ 1 Here, the coefficients of both terms are 1. It gives the numbers of one-down row from the top of the Pascal triangle. For n ¼ 3, it becomes Here, the coefficients of the three terms from left to right are 1, 2, 1. This gives the elements of the two-down row from the top of the Pascal triangle. If the expression À∅ ≤ sx ð Þ ≤ ∅ is multiplied by e λt , À∅e λt ≤ sx ð Þe λt ≤ ∅e λt is obtained. If the result for n ¼ 3 in Eq. (52), or its equivalent (53) is substituted above, or the following expression is obtained: This verifies the multiplication of sx ð Þ with e λt for n ¼ 3. In other words, the is satisfied. Once this statement is generalized for n, the validity of Eq. (51) is proven.
If the inequality (50) is integrated between 0 and t, and one step later, and finally the following expression is reached: as a result of replacing the derivative terms in the inequality (54) with their equivalents expressed with an absolute value one above, the inequality conditions will be preserved exactly as the term with the absolute value will be smaller than the term that satisfies the "less than or equal to" condition on the left and greater than the term that provides "greater than or equal to" condition on the right in the equality (54). Furthermore, aside from the absence of a violation, the conditions of inequality have been further reinforced. Therefore, it is possible to write the following under these conditions, Also, since both ∅ and λ are initially defined as positive definite constants, we take À∅=λ instead of the leftmost ∅=λ and ∅=λ instead of the rightmost À∅=λ, which can be more safely adapted to existing inequality conditions without loss of generality will be preferred at this stage. Hence, the inequality (54) will turn into a rewritten appropriate form given below: The same reasoning can be applied repeatedly until the n À 1 ð Þth integral is reached on the inequality (50). Once (50) is integrated, recall that (54) is obtained. If we apply a second integral on (54) or, alternatively, a first integral to the form of (54) given immediately above, the following expression is obtained: In determining the generalized cases below, we would like to state in advance that we do not focus on other terms that will appear in the shape of increasing powers of t in the form of t n n! especially in Parts (a) and (c), and we do not show them in the generalized statements. For that matter, as shown a little below, if Eq. (55) is divided by e λt and the limit is taken as t goes to infinity (i.e., t ! ∞), those terms will eventually disappear completely, since the denominator will go to infinity faster than the numerator. After this essential explanation, For Part (a): Starting with (50), when the term in the middle of inequality, d nÀ1 dt nÀ1x e λt À Á , is integrated n À 1 ð Þtimes in a row, it is obvious that only the result,xe λt , will be found. Therefore, by multiplying each side of the inequality of (56) by the term λ 2 , and with, by multiplying each side of inequality of (60) by the term 2λ. Once these bounds determined by the inequalities (63) and (64) are imposed on (62), the expression, and hence in brief, the result, is concluded. As in obtaining (56), (60) and (65), the following general conclusion is reached if the similar procedure is applied sequentially until the bounds ofx nÀ1 ð Þ are achieved: Here, the coefficients ζ i i ¼ 0, 1, ⋯, n À 2 ð Þ are related to the pre-acquired bounds of eachx i ð Þ and are summarized in Theorem 2. In this way, by examining Eqs. (56), (60), (65), and (66) and, as much as other skipped boundaries, the integrals of (50), the tracking error will be kept within the bounds ofx i ð Þ ≤ ζ i λ iÀnþ1 ∅, i ¼ 0, 1, ⋯, n À 1, where ζ i is defined by (47).

Figure 8.
Convergence region Φ in the case of a second-order system.

Remark 5.
It should be noted that an n-dimensionally separated partition defined according to the boundaries mentioned earlier is not entirely within the boundary layer. Considering the attractiveness and invariant properties of S ∅ proved in Theorem 1, the convergence region can be expressed as the intersection of an n-dimensional separated partition and boundary layer defined in Theorem 2. Thus, the tracking error vector will converge exponentially to a closed region where ζ i is defined by (47). Figure 8 describes the Φ convergence region defined according to Remark 5 for a second-order (n ¼ 2) system.

Numerical experimentation and simulation examples
6.1 Position control system by an armature-controlled dc servo motor

Positioning system description
The plant is an armature-controlled dc servo motor, the scheme of which is given in Figure 9 [19].
In order to derive the state-space mathematical model from the physics of the motor, we first start by writing Kirchoff's voltage equation around the armature current: where e a t ð Þ is the armature input voltage to the dc amplifier that drives the motor, i a t ð Þ is the armature current, R a is the armature resistance, K b is a constant of proportionality called the back emf constant, or briefly, the armature constant, and θ m is the angular displacement of the armature.
The torque, T m t ð Þ, delivered by the motor is expressed separately in relation to both the armature current and the load seen by the armature as follows: where J m and D m both represent the equivalent inertia and viscous damping seen by the armature, respectively. Solving Eq. (68) for i a t ð Þ and substituting the result into Eq. (67) yields Defining the state variables x 1 and x 2 as and substituting into Eq. (69), we get Solving for dx 2 =dt yields Using Eqs. (70), (71) and (73), the state equations are written as Hence, in vector-matrix form, 3 5 e a t ð Þ: Now, let us consider a position control system and assume a case of varying external disturbance torque to the dc motor. In other words, we assume that a varying external disturbance can enter into the system in the form of varying torque τ t ð Þ on the shaft of the motor. Therefore, in this derivation, taking account of the external disturbance term which will appear as an extra term in the state equation, we finally describe the state-space representation (a.k.a. the state differential equation) as follows: with J the moment of inertia of all the rotating parts. For the controller variable we choose the angular position: The numerical values of motor's parameters have been taken from the case study in [20]: Finally, we try several varying external disturbance torque Nm ð Þoptions such as • sin at ð Þ, γsin at ð Þ, or msin at ð Þ, where a ¼ 3, 4, ⋯ and m is any appropriate multiplier that is compatible and proportional to the size of the system variables and parameters.
• sin as examples, and we decide that the torque of τ t ð Þ ¼ sin 3t ð Þ Nm is the one we choose for the numerical experimentation and simulations as trade-off after we weigh the pros and cons upon several performance tests and considerations. In addition, the simulations given for the DC motor have been run in the form of script code using Matlab [21].

Design of the sliding mode controller for the position control system
Sliding mode surface is defined as: where e t ð Þ ¼ r t ð Þ À x 1 t ð Þ, _ e t ð Þ ¼ _ r t ð Þ À x 2 t ð Þ, and r t ð Þ is a desired input signal and defined as r t ð Þ ¼ Asin 2πFt ð Þin the simulations where A and F are suitably determined, and c is a positive constant. Therefore, once we get a derivative of the expression above, we get the following: Taking the second row from Eq. (76) and replacing it with _ x 2 t ð Þ above yields: _ sðtÞ ¼ c_ eðtÞ þ € rðtÞ þ αx 2 ðtÞ À κe a ðtÞ þ γτðtÞ: Next, we obtain the control law e a t ð Þ by equalizing _ s t ð Þ to zero and then using γ ¼ 1=J and τ t ð Þ ¼ Ksgn s t ð Þ ð Þ in Eq. (79) as follows: Once Eq. (80) is substituted into Eq. (79), we obtain the following: where K is a positive constant. Letting K ¼ max τ t ð Þ j j ð ÞþηJ, where η > 0, and multiplying (81) by s t ð Þ yields: s t choose the PD control strategy because of the advantages it offers [26]. We should emphasize that the errors between the actual points and the waypoints, each of which can also be viewed as intermediate setpoints, do not necessarily have to be eliminated completely. As a result, we have decided to use the PD control because of the advantages it offers and to move faster between the waypoints by tolerating or neglecting the steady-state error computations that would bring extra computational burden (Figures 20-22).

Modeling and simulation of A two-link (2-DOF) planar robot manipulator
A manipulator consists of an open kinematic chain of rigid links. Power is supplied to each degree of freedom of the manipulator by independent torques. The  dynamical equations of motion of an n-link (i.e., n-degree-of-freedom) robot manipulator using the Lagrangian formulation has already been described in Section 3 by the Eq. (8). The robot model there is characterized by the following structural properties which are important for our sliding mode controller design of the tracking problem [27]: Property 1. A vector α ∈ R m with components that depend on manipulator parameters (masses, moments of inertia, etc.) exists, such that where Φ ∈ R nxm is called the regressor, v ∈ R n is a vector of smooth functions. This property implies that the dynamic equation can be linearized according to a specially selected manipulator parameter set, hence constituting the basis for the linear parameterization approach.

Property 2. Both M q
À Á and C q, _ q À Á in Eq. (8), using a properly defined matrix C q, _ q À Á , satisfy with x T the transposition of x: That is, _ M À 2C À Á is a skew-symmetric matrix. Property 2 simply states that the so-called fictitious forces, defined by C q, _ q À Á _ q, do not work on the system.  The model given in Figure 23 is known as a two-Link (2-DOF) planar robot, as it corresponds to the two-dimensional special case, where n ¼ 2 is taken in the n-link robot manipulator [27].
The dynamic model chosen for the simulations is given by and the dynamic equation is given by    Tracking error under PD control of the position control system.

Introducing boundary layer
The same parameters and initial conditions for the simulations have been chosen as in Section 6.2.1 except for the following ones which include the boundary layer thickness in particular:  Please note that due to the space constraint, we will be able to give only the figures whose effect is clearly observed, not eight figures as given in Section 6.2.1 (Figures 32-34).
For tracking a desired trajectory by two-link rigid planar robotic manipulator, PID control strategy will not work well under unknown disturbances and payload changes, and hence will not be represented here. In addition, the values of control input will get  higher as in the case of DC motor position control and that would complicate the realization of such high gains through the proper actuators. On the other hand, SMC provides robustness against parameter uncertainties and unmodeled disturbances so long as the observed undesirable chattering effect is overcome through some modifications by simply replacing nonlinear signum function with nonlinear saturation function and introducing boundary layer thickness in there as explained in earlier sections. In order to realize this, the boundary layer has been introduced for the first time in Section 6.2.2 simulations, and consequently, no switching or chattering effect has been observed as can be verified by the phase portrait in Figure 34.  Later, the robustness of the SMC will be analyzed by adding an extra mass of 0:5 kg to Joint 2, and we have not observed any performance degradation of the trajectory to be maintained in the sliding surface. Therefore, the controller is said to be robust enough. However, it is expected that switching will reappear to maintain the trajectory in the sliding surface.
As a rule of thumb, It is possible to do tracking with more load by reducing the boundary layer to allow more switching to occur. Now, we reduce the boundary layer thickness from 0.02 to 0.005 and add the extra mass to Joint 2 by 0.75 kg to a final of 1.25 kg and we can still observe that SMC will be able to do the tracking by  • The rest of the parameters and the IC's were kept the same as before.

Conclusions
In this study, a sliding mode control scheme with a bounded region and its convergence analysis are explained to the finest detail. In particular, it can easily be said that the work done here is a field study that specifically gives the relevant subject with such meticulous detail. It is our claim that this study has a guiding identity for the researchers who are interested in this control method or want to present it with the intelligent and modern control methodologies with its understandability and clarity targeted here. In this regard, the design of SMC including its finite-time convergence is handled by using Lyapunov's direct method. The tracking error vector converges exponentially to the bounded region once in the  boundary layer as proven analytically. Two examples were used for simulation studies to demonstrate the feasibility and effectiveness of the proposed control problems, i.e., the position control of a dc motor subject to a varying external disturbance, and a two-link robot manipulator. Simulations show that a fast convergence rate, and hence quick response, the ability to reject the varying external disturbances, and the robustness against the model uncertainty assumed to be unbounded and fast-varying have all achieved its purpose entirely. Chattering is eliminated by using the boundary layer whose attractiveness and invariance properties of the boundary layer were also introduced. This study also examines the advantages of SMC and PID comparably. Although, in the comparisons given in the literature, the pros and cons of both strategies are mentioned, it is generally observed that SMC performs better than PID. Nevertheless, PID control can still be used as an alternative to SMC. When the PID control strategy does not work well under unknown disturbances and payload changes, SMC provides robustness against parameter uncertainties and unmodeled disturbances so long as the observed undesirable chattering effect is overcome through some modifications as described in the text. Robustness analysis has been performed and successfully applied to the two-link rigid planar robotic manipulator. We have not observed any performance degradation of the trajectory to be maintained in the sliding surface. The results given here do not contradict the view that one can use it instead of the other without losing too much performance. Finally, a two-step simulation has been carried out, testing all the features mentioned above, and the results have confirmed the success of the presented approach. However, it is meaningful and challenging to develop new SMC theories and methods for nonlinear systems due to its broad application potentials in today's world.