Adaptive Super-Twisting Control for Mobile Wheeled Inverted Pendulum Systems

: Recently, the mobile wheeled inverted pendulum (MWIP) has gained an increasing interest in the ﬁeld of robotics due to trafﬁc and environmental protection problems. However, the MWIP system is characterized by its nonlinearity, underactuation, time-varying parameters, and natural instability, which make its modeling and control challenging. Traditionally, sliding mode control is a typical method for such systems, but it has the main shortcoming of a “chattering” phenomenon. To solve this problem, a super-twisting algorithm (STA)-based controller is proposed for the self-balancing and velocity tracking control of the MWIP system. Since the STA is essentially a second-order sliding mode control, it not only contains the merits of sliding mode control (SMC) in dealing with the uncertainties and disturbances but can also be effective in chattering elimination. Based on the STA, we develop an adaptive gain that helps to learn the upper bound of the disturbance by applying an adaptive law, called an adaptive super-twisting control algorithm (ASTA). The stability of the closed-loop system is ensured according to the Lyapunov theorem. Both nominal experiments and experiments with uncertainties are conducted to verify the superior performance of the proposed method.


Introduction
Mobile robots are widely used in various fields. As a special kind of mobile robot, the mobile wheeled inverted pendulum (MWIP) has attracted more and more attention thanks to its compact size, strong mobility, and high flexibility [1]. However, the control of the MWIP system still remains a very challenging problem because of its natural instability, underactuation, nonlinearity, time variability, and strong coupling.
So far, a plurality of methods have been studied based on the MWIP system. These methods are divided into two categories: model-free algorithms and model-based algorithms. The model-free ones are applicable to general systems, but the control accuracy demands of physical applications are often difficult to meet due to the lack of system information. Moreover, these algorithms, such as PID control, largely rely on well-tuned parameters, and it is difficult to guarantee the stability of the closed-loop system without the mathematical model. Another branch of the model-free approach is neural network (NN)-based approximation. The NN training method requires a large amount of data, and the corresponding parameters are adjusted through the neurons, which cause a heavy computational burden [2]. In addition, fuzzy logic control, a widely used strategy, suffers from a slow response time and a serious dependence on the experience of selecting suitable member functions and rules [3,4]. For the model-based algorithms, we have to get the dynamic model of the system first, which might be controlled by the method of feedback linearization, traditionally. In practice, however, accurate models are often hard to come by, which requires the model-based approaches to have the capacity of handling uncertainties. Although the feedback linearization controller can be directly applied to the nonlinear dynamics without linear approximation, the controller contains high-order derivative terms and is very sensitive to noises and uncertainties. In addition, the nonlinearity of the system cannot be easily canceled out, especially for the underactuated system, whose dynamics are not invertible [5].
Sliding mode control (SMC) appears to be one of the most promising robust nonlinear control techniques for systems with parameter variations and external disturbances [6]; it can keep the system states sliding on the sliding surface and ensure the stability of the closed-loop system. Therefore, SMC has been extensively studied and applied [7][8][9]. However, one serious disadvantage of SMC is the "chattering" phenomenon, which is harmful to the mechanical systems. There are two main causes for the occurrence of the chattering phenomenon. One is the discontinuous switching function in the controller. The other one stems from the switching gain of the SMC, which must be designed to be greater than the bound of the disturbance [10].
Therefore, many researchers have tried to reduce the chattering in the conventional SMC for MWIP systems. In [11], Pupek replaced the sign function with the saturation function on two-wheeled self-balancing mobile robots, which is the most direct way to reduce the chattering. However, the chattering-reduction effect of this method is limited. The saturation function only transforms the discontinuous switching function into a continuous proportional function in the saturated region; therefore, the controller will fail once it leaves the boundary layer. Furthermore, the determination of the boundary layer also remains an ambiguous problem.
The chattering can also be reduced by combining the disturbance observer (DO) and the SMC [12][13][14]. Huang has successfully designed a systematic method of a high-order disturbance observer-based sliding mode control for a class of underactuated robotic systems [15]. The estimation of the disturbance can be used as a feed-forward compensation to the controller such that the switching gain of SMC is only required to be designed greater than the bound of the disturbance estimation error.
High-order sliding mode-based control strategies are also significant ways to deal with the chattering elimination problem. Among them, second-order sliding mode (SOSM) control is promising, and it has been widely used in various applications, such as the regulation problem of a buck converter [16,17], rigid spacecraft attitude control [18], and so on. The super-twisting algorithm, known as a kind of second-order sliding mode control, retains all the advantages of sliding mode and effectively reduces the chattering [19,20]. By adding an integrator to the control input, the actual control signal and its derivative can be obtained explicitly. Instead of acting on the first-order sliding manifold time derivative, the discontinuous term proceeds on its second-order time derivative. Consequently, the actual control law will be a continuous integration of its derivative, and the chattering phenomenon can be eliminated. However, for most SMC-based methods, with respect to disturbances, a common assumption is that the disturbances are bounded by an unknown constant [21,22], which is directly utilized in the controller. However, the disturbance bounds are often not easy to determine in real systems. Therefore, in this paper, we use an adaptive gain on the basis of the super-twisting algorithm, which helps to learn the upper bound of the disturbance by the adaptive law. As a result, the upper bound of the disturbance learned by the adaptive law will be close enough to the real bound of the disturbance to make the gain of the controller as small as possible, which further reduces the chattering.
The main contributions of this paper are as follows: (1) The proposed adaptive super-twisting algorithm is capable of reducing the chattering phenomenon and noise amplification.
(2) The stability analysis of the closed-loop system and convergence of the adaptive parameters are guaranteed by the Lyapunov theorem.
(3) Experiments on a real MWIP system are conducted to show the effectiveness of the proposed method. It might be the first attempt to employ the adaptive STA to a real MWIP system. The rest of the paper is organized as follows. The MWIP system is modeled in Section 2. In Section 3, the controller based on adaptive STA for the MWIP system is proposed. Experiments are presented to demonstrate the effectiveness and robustness of the strategy in Section 4. Finally, a conclusion is given in Section 5.

Modeling of MWIP System
The profile of the MWIP system is shown in Figure 1, in which the specific parameters are indicated in the corresponding positions. ψ l and ψ r are the rotation angles of the left and right wheels, respectively, and α is the yaw angle of the MWIP system. θ is the inclination angle of the body. m b , m w are the masses of the body and a wheel, I by , I bz are the moments of inertia of the body about the Y axis and Z axis. I wa , I wd are the moments of inertia of a wheel about its axis and a diameter, l is the length between the wheel axle and the center of gravity of the body. r is the radius of the wheel, and 2b is the distance between two wheels. D b is used to denote the viscous resistance in the driving system, and D w is the viscous resistance of the ground. u r , u l are the rotation torques generated by the right and left motors coaxial with the wheels. τ ext is used to denote the external disturbance. The dynamic model of the MWIP system derived from Lagrange functions is given by [23]: where To simplify the denotation, we rewrite (1) in vector form: where Since the model process is always subject to noises and measurement errors, the disturbances could not be avoided. It is impossible to get a completely accurate dynamic model. Therefore, we rewrite (2) based on the nominal model of the MWIP system, as shown in Equation (3), whereM (q), N (q,q), andÔ (q) are used to represent the nominal values in the dynamic model. In the following, (·) denotes the nominal value of (·). ∆M(q), ∆N(q,q), ∆O(q) serve as the bias parts to denote the model uncertainties, and all the model uncertainties and external disturbances are assumed to lump into a single disturbance vector where To facilitate the design of the controller, we multiply both sides of this equation with the inverse ofM (q) and rewrite Equation (3) as follows. where In addition, we give the following hypothesis about the lumped disturbances.
where µ is a positive number to represent the bounds of the disturbances.

Design of the Adaptive Super Twisting Controller
In this section, we present the controller design based on the adaptive super-twisting algorithm. The first procedure of the adaptive super-twisting controller design is to define the sliding surface, which is similar to the SMC. Obviously, the MWIP system is an underactuated system. According to the first two equations of the dynamics (5), q 1 and q 2 are coupled. Therefore, we need to define the first sliding manifold that contains both q 1 and q 2 to obtain a relative degree one for u A . Then, the second sliding manifold contains q 3 . The design of the sliding surface is shown in (7).
where e = e 1 e 2 e 3 = q 1 − q 1d q 2 − q 2d q 3 − q 3d , and q d = q 1d q 2d q 3d represents a fixed equilibrium point corresponding to a particular task. λ i (i = 1, 2, 3) are positive coefficients, and they are designed to satisfy the following constraints: where z * 1 =m 11 +m 12 , z * 2 =m 22 +m 12 . q 2d ,q 1d , and q 3d represent the desired inclination angle, the desired velocity, and the desired yaw angle, respectively. Equation (7) also indicates that σ 1 has relative degree one with respect to u A and σ 2 has relative degree one with respect to u B . This makes it possible to achieve the second-order sliding mode σ=σ=0.
The derivative of the sliding surface is described aṡ where K 1 , K 2 are arbitrary positive constants and v 1 , v 2 are auxiliary variables. The auxiliary variables are exploited to include the integration of the sliding mode variable, which is used to reduce the chattering phenomenon caused by the fast switching of the sign function. The derivative of the auxiliary variables is defined asv Γ 1 , Γ 2 are adaptive coefficients of the sliding surface. The adaptive law can be chosen aṡ where ∂ 1 , ∂ 2 are arbitrary positive constants as well. ε is a boundary layer of σ, which is introduced for the practical implementation of the controller. The initial value of Γ satisfies 0 ≤ Γ(0) <Γ.Γ is a constant vector, which is clearly defined in Remark 1. Γ(0) will be selected to be small enough or even equal to zero. In the experimental section, Γ(0) is appropriately selected to increase the initial responses of the system. Based on the above analysis, we can conclude the adaptive STA controller by the following theorem. Theorem 1. The achievement of a sliding motion on the surface (7) can be guaranteed by the selection of the control law where f i (i = 1, 2, 3) and g i (i = 1, 2, 3) are the parts of the dynamic model, which are depicted in Section 2.
In Assumption 1, the lumped disturbances are assumed to be bounded; then the following inequality holds: Remark 1.Γ 1 ,Γ 2 are used to represent the actual bounds of the two kinds of disturbances in (13), respectively. It is worth noting that we are just assuming the disturbance is bounded, while we don't require the knowledge of the upper bound. This unknown upper bound has not been exploited in the design of the controller. It is adaptively learned by (11). We defineΓ = Γ −Γ. It represents the error between the bound obtained by the adaptive law and the actual bound. We will prove below that Γ will converge toΓ by the rendered adaptive law.

Proof. Consider the Lyapunov function
Obviously, it is positive definite. Taking the first time derivative of the defined Lyapunov function yieldsV From (5), (11), and (12), it follows thaṫ Then the derivative of the Lyapunov function can be written aṡ Substituting the control laws proposed in (12) into (20), we can obtaiṅ It is clear thatV is negative definite. Therefore, the trajectory of the system reaches the manifold S = 0 by using the control law, and the variable q 3 can converge to q 3d .
After reaching the sliding surface, the second phase of the sliding mode control, i.e., the sliding phase, needs to be guaranteed. The trajectory is expected to move towards the equilibrium point while sliding on the sliding surface. From (3) and (7), the motion of the system on the sliding surface can be obtained: From (23),q 1 andq 1 can be described as (24) and (25), respectively.
Substituting (25) into (22) and introducing a new state vector x = [x 1 ,x 2 ] = [q 2 ,q 2 ], a new system is derived, which is equivalent to (22) and (23) in the view of stability: where The equilibrium of (26) is denoted by x * = [x * 1 ,x * 2 ] = [0, 0]. We linearize (26) at the equilibrium x * to establish the linear stability criteria that guarantees local exponential stability of the nonlinear system. The linearized system is described bẏ where According to the Hurwitz stability criteria, the closed-loop system is asymptotically stable around the equilibrium when the following condition is satisfied: It is obvious that the inequality (29) holds when the sliding mode coefficients satisfy the constraint (8).
Then, we can conclude that the global stability of the closed-loop system can be guaranteed. This completes the proof.

Remark 2.
In this paper, by conducting the super-twisting controller, the system motion consists of two phases. The first phase is the reaching phase, in which the trajectory of the system moves towards the manifold σ = 0 and reaches the manifold in finite time. The second is the sliding phase, in which the dynamics of the system are represented by the reduced-order model σ = 0. When the system's trajectories slide on the sliding surface σ = 0, the selection of sliding surface can ensure the system's trajectories arrive at the equilibrium point. In order to verify that the equilibrium point is stable, we linearize the system around the equilibrium point, which turns out to be a stable saddle point. Consequently, combining the super-twisting controller and the stable equilibrium, the closed-loop system is asymptotic stable.
The diagram of the control strategy is shown in Figure 2.

Experimental Setup
The physical MWIP system of the experiment is shown in Figure 3a. The hardware of the system is comprised of a main control circuit board (LM3S2965, Texas Instruments, Austin, TX, USA), an accelerometer, a three-axis gyro, and two encoders. The angle information is provided by the accelerometer and gyroscope, and the speed information is provided by the encoder. All the information is sent to the main control board, in which the information is processed, then the control algorithm is completed to generate the control signal. The control signal modulates a pulse signal of a certain width to control the motor speed after each sampling. The sampling period is set as 5 ms. In this section, the effectiveness of the proposed adaptive STA (ASTA) controller will be verified by experiments. The adaptive SMC (ASMC) with the same adaptive law is compared with the adaptive STA to highlight the advantages of the proposed method. The real parameters and nominal parameters of the MWIP system are shown in Tables 1 and 2. It is worth noting that the dynamic model of the MWIP system is established based on real parameters (Table 1), while the design of the controller is based on nominal parameters ( Table 2).  It is well known that maintaining balance is a basic requirement for the naturally unstable MWIP system. Owing to this, we just consider the experiment on balance control. The control goal is to adjust the MWIP system from an initial state with a certain inclination angle error to the upright state and then maintain the upright state on flat ground. This means that the desired inclination angle, speed, and yaw angle should be set as zero. Thus, the sliding surface can be simplified and rewritten as The acceptable initial error of inclination angle is discussed in Remark 3. The whole experiment is divided into two cases, one of which is the nominal case, and the other adds uncertainties to the system. The corresponding MWIP systems under these two cases are shown in Figure 3a,b, respectively. Remark 3. The MWIP system is a peculiar and complex underactuated system. Due to its nonlinear coupling, as depicted in (22), we cannot get a feasible set of initial errors. However, we only need to consider a relatively small initial error of angle. This makes sense in physical applications, since too large an initial error may lead to overshoot, thereby causing unsafe factors. Moreover, in other studies on MWIP systems, the significant initial errors are not taken into account [1,[24][25][26]. Especially, in [26], there exists a support frame to guarantee a small initial error, which ensures a smooth start for the MWIP.
In addition, we conducted simulations with various initial errors, which prove that the MWIP system is under control as long as the controller is non-singular. The feasible range of the inclination angle is (−84.27 • , −84.27 • ). As for the experiment, the feasible initial error is limited by many other physical factors, such as the modeling error and external disturbances. We cannot expect to obtain a specific acceptable initial error range. Through a number of experimental trials, we get a range of (−56.17 • , 55.28 • ) as the initial error of the inclination angle, and this range is adequate for practical applications.
For the sake of fairness, we preset the same initial conditions for each experimental scenario. The initial condition is set as In addition, the two control techniques, adaptive SMC and adaptive STA, are based on the same sliding surface and control parameters. They are selected as follows: According to the values defined in (31) and Table 2 , the denominator term g 2 + λ 2 g 1 will always be non-negative during the experimental process, which means the design of the controller is feasible.

Experimental Results
In balance control, the desired inclination angle and velocity are set as zero.

Case1: Regardless of Disturbances
In this case, no additional disturbances are considered. The experimental system in this case is shown in Figure 3a.
The experimental results of the adaptive STA and adaptive SMC are illustrated in Figures 4-7. Figure 4 compares the inclination angle of the MWIP system by employing the adaptive SMC and adaptive STA, and Figure 5 depicts the value of the sliding surface. One can conclude from the above observation that both strategies can balance the MWIP system effectively. It can be seen from Figure 4 that the variation in the inclination is obviously large when the adaptive SMC algorithm is employed, while the inclination angle is relatively stable and stays near zero when the adaptive STA algorithm is applied. From the perspective of the sliding surface, as shown in Figure 5, both the adaptive SMC and adaptive STA can drive the system's states to slide on the sliding surface. Moreover, the adaptive STA effectively suppressed the occurrence of chattering better than the adaptive SMC. Figure 6 shows the variations in the adaptive coefficients of the adaptive SMC and the adaptive STA, respectively. It can be seen that the adaptive coefficient changes greatly at the initial stage, and its rate of change gradually decreases until it reaches a suitable value, which indicates that the parameters are sufficient to stabilize the system. Additionally, we plotted the control torque in Figure 7. The control torque of the adaptive STA turns out to have a smaller amplitude and lower frequency than that of the adaptive SMC.   The experimental results prove that it is effective to turn discontinuous control into continuous control by hiding the high-frequency switch as the second derivative of the sliding mode variable. At the same time, adaptive gains are used to precisely learn the disturbance bound. As a result, the chattering caused by excessive gain is significantly reduced.
More quantitatively, we compared the RMS (root mean square) errors of the inclination angle and sliding mode variable. We ignored the first two seconds for the adjustment of the adaptive gains and calculated the RMS errors for the next eight seconds: where x = [q 2 , S 1 ]. The RMS error of the inclination angle indicates the equilibrium performance of the MWIP system, and the RMS error of the sliding mode variable is used to describe the chattering degree of the system. The results of the comparison are shown in Table 3. Since the SMC is insensitive to parameter uncertainties and external disturbances, we wanted to verify the relevant features of the STA, which is a special form of second-order SMC. Moreover, we used adaptive gain, whose effects also need to be verified. To this end, we added a board on the nominal MWIP system to greatly increase the uncertainty of the system. The system is shown in Figure 3b, in which the height of the MWIP system is increased by 10 cm and the weight is increased by 0.5 kg. The parameters of the controller remain the same as in the previous case.
The experimental results are shown in Figures 8-11. It turns out that the MWIP system can still be balanced on flat ground. The figures show that the stability of the system can be guaranteed despite the increase in external disturbances. Compared with the previous case, the adaptive coefficients obviously increased faster, and finally reached a relatively large value. This result is consistent with the fact that large values of the switching gains can keep the states of the system sliding on the sliding surface, but it leads to serious chattering at the same time for the SMC-based strategy. From Figure 9, we see that the amplitude of the sliding surface also increases. The inclination angle can still be maintained at zero, as shown in Figure 8. This proves that the adaptive parameters of the algorithm are adjusted effectively according to the disturbance, and the proposed algorithm is robust to large model uncertainties. The control torque shown in Figure 11 concurs with the analysis of other variables, which further supports our conclusion. The comparison of RMS error in this case provides more support for our conclusion, as shown in Table 4.

Conclusions
This paper presented an adaptive super-twisting algorithm for MWIP systems. The stability of the closed-loop system is ensured according to the Lyapunov theorem. Comparison experiments of balance control with uncertainties are conducted. The experimental results on a real MWIP system show that the adaptive gains can effectively learn the disturbance bound so that the switching coefficients of the sliding mode surface is small enough. Moreover, the proposed adaptive STA algorithm shows a superior performance of balance control and capacity to reduce chattering.