# Adaptive Observer-Based Sliding Mode Control for a Two-Wheeled Self-Balancing Robot under Terrain Inclination and Disturbances

Authors: Ines Jmel; Habib Dimassi; Salim Hadj-Said; Faouzi M’Sahli
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

This paper investigates an output feedback sliding mode control scheme for a two-wheeled self-balancing robot under terrain inclination and disturbances. First of all, an adaptive high-gain observer is designed for the robot to estimate, simultaneously, the unmeasured states and the unknown terrain inclination angle which appears nonlinearly in the dynamics of the wheeled robot, using the only measured linear and angular positions. Then, the estimated states and the reconstructed unknown inclination angle are used by an appropriate continuously implemented sliding mode controller whose the design is based on the boundary layer approximation approach to reduce the chattering phenomenon. The objective of the proposed robust controller is to ensure the tracking control of the two-wheeled robot despite the unknown terrain inclination and the presence of friction disturbances. The stability of the adaptive observer-based output feedback system is established through a Lyapunov analysis, and it is inspired from sliding modes theory. Numerical simulations results highlight the effectiveness of the proposed tracking control scheme applied on two-wheeled self-balancing robot subject to terrain inclination even in the presence of unavailable disturbances.


---

## Body

## 1. Introduction

The two-wheeled self-balancing robot is an exceptional type of wheeled mobile robots which has been broadly applied in many areas such as hostile terrain, agriculture, and industry. The hard nonlinearity and the underactuation of these systems make the trajectory tracking control a challenging research problem [1, 2]. Some classical control strategies such as backstepping [3, 4] and adaptive controllers [5] are treated by several researchers to control the movement of the wheeled inverted pendulum. In [6, 7], the backstepping technique is combined with an adaptive controller to ensure the stabilization and the convergence of the tracking error. The authors in [8] represented a combination between H∞ and backstepping techniques to stabilize tracking errors under bounded disturbances. In [9], a Kalman filter-based optimal (H-infinity) controller was proposed for the linearized model of the wheeled pendulum. Moreover, Fuzzy systems had attested their effectiveness as a rigorous method in robotics and control applications. In [10], a fuzzy control scheme was proposed for a two-wheeled inverted pendulum. Also, in [11], a nonsingleton general type-2 fuzzy logic controller was designed for an underactuated mobile two-wheeled self-balancing robot. In [12, 13], an adaptive fuzzy control design was performed for dynamic balance and stable tracking of desired trajectories for wheeled inverted pendulum in the presence of uncertainties.In addition, a PD-PI controller based on Kalman filter algorithm was designed in [14] to stabilize a two-wheeled self-balancing robot while avoiding acute and dynamic obstacles in the sensed environment. Furthermore, common networked control strategies have been implemented in [15] for stabilizing a two-wheeled inverted pendulum robot over a wireless channel despite time-varying delays and paket loss. Also, a new feedback reinforcement learning method was proposed in [16] to solve the LQR control problem for the two-wheeled self-balancing robot. The suggested method scheme was completely online and did not require any knowledge of the system parameters.In any formulation of a control problem, the mathematical model developed to establish the control law does not reflect the actual process exactly. These differences may be due to, for example, the direct approximation of complex process behaviors and the variations of system parameters or unmodeled dynamics, especially for systems which are characterized by an inherent instability, nonlinearity, and underactuation like the two-wheeled self-balancing robots. Nevertheless, it must be ensured that, despite all these uncertainties, the resulting control should reach the predefined objectives. For this reason, it is necessary to synthesize a robust controller able to overcome this problem. Sliding mode control is an efficient robust control method which has the advantage to be insensitive to disturbances and characterized by the finite-time convergence property and the simplicity of its implementation [17]. In this context, a sliding mode controller was developed, in [18, 19], for the control of underactuated systems. In [20], the authors discussed the control problem and gave design technology of the sliding mode controller for the two-wheeled mobile robot with lower center of gravity. The validity of the proposed controller was analyzed through numerical simulations. Likewise, the authors in [21, 22] developed a sliding mode controller for nonholonomic mobile robot in order to realize a tracking trajectory in the presence of model uncertainties, frictional disturbances, and measurement noise. Moreover, a novel LMI-based sliding mode controller has been proposed in [23] for the control of a class of underactuated systems which are featured as in cascade form with external disturbances. In [24], an optimization-based nonlinear controller was designed for trajectory tracking for nonholonomic wheeled mobile robots. In the same context, a fast terminal sliding mode strategy has been designed in [25] for finite-time tracking control of nonholonomic systems. The efficiency of this method was illustrated to apply on a wheeled mobile robot as a benchmark of a nonholonomic system. Besides, two sliding mode controllers were designed in [26] to control the balancing and the steering movement of a two-wheeled inverted pendulum robot with friction compensation. In addition a sliding mode control was designed in [27] to track the smooth curved welding path. In [28], a sliding mode velocity control was proposed for mobile wheeled inverted pendulum systems. More recently, in [29], the authors proposed a sliding mode controller (SMC) associated to a high-order disturbance observer (HODO) for mobile wheeled inverted pendulum (MWIP) systems. The stability of the closed loop system and the convergence of the estimation errors have been proved with a Lyapunov analysis, and theoretical results have been also validated experimentally. Motivated by the incontestable advantages of the latter robust control method, we propose, in this paper, a continuously implemented sliding mode controller for the two-wheeled self-balancing robot where the boundary layer approximation method is adopted in the designed controller to reduce the well-known chattering phenomenon often linked to the use of discontinuous controllers.For outdoor applications, mobile robots have to face more challenges such as uneven, sloped, or rough terrain surface. This invites researchers to design controllers in order to control the stability of the two-wheeled self-balancing robot moving on an inclined terrain [30–33]. In [34], the authors had shown the effect of terrain inclination on the performance and stability region of two-wheeled mobile robots. Moreover, they established and analyzed the dynamic model on slope of the treated robot. The linear quadratic regulation (LQR) method was used to design a linear controller whose efficiency was presented through simulation results. In [35], a disturbance observer was used to estimate the handling force and the slope angle when getting on and off a human-riding wheeled inverted pendulum vehicle. A sliding mode control was used in [33] for a two-wheeled inverted pendulum mobile robot driving on uniform slopes. Also, to eliminate the influence of the inclined plane considered as external disturbances, the authors had developed, in [36], an active disturbance rejection control scheme for two-wheeled self-balancing robots which achieved control aims even in the presence of a slope. However, most of mentioned works had resorted to linearization in order to design controller. To deal with problems related to rough terrain, wheeled robots should consistently recognize the current situation of the surface in order to preserve wheel traction and battery energy. The solution that we adopt is to develop an adaptive observer to estimate unmeasured states and the unknown terrain inclination angle.In fact, specific attention has been booked to the design of adaptive observers in order to ensure, under specific condition, a joint estimation of unmeasured states and system parameters with exponential convergence. Various works had focused to design an observer for a linear system as it was improved in [37]. Others were interested in nonlinear systems with linear parameterization as in [38, 39] and nonlinear parameterization as in [40], where the authors had developed an adaptive observer for the nonlinearly parameterized class of nonlinear systems. The exponential convergence is achieved under certain persistent condition by the adjustment of the gain observer. Simulation results highlighted the effectiveness of the developed observer. More recently, the robustness of the latter adaptive observer has been improved in [41] by adding a sliding mode term. The proposed adaptive observer in [41] was also combined with an auxiliary high gain observer to satisfy the so-called observer matching condition and applied for the inverted pendulum system to solve the problem of simultaneous estimation of states, unknown parameter (mass variation parameter), and friction disturbances with experimental validation.In this context, since the inclination parameter appears nonlinearly in the dynamics of the self-balancing robot, we adopt the adaptive estimation approach developed in [40] to deal with terrain inclination.Then, the estimated states and parameters are combined with the continuously implemented sliding mode control law in order to provide a robust adaptive observer-based sliding mode controller. The convergence of the estimated tracking error is established through the Lyapunov analysis.In summary, the two-wheeled self-balancing robot is a benchmark of underactuated system. The hard nonlinearity of this system makes its control an interesting issue.For outdoor application, the two-wheeled self-balancing robot is always faced to several phenomenons such as sloping and skidding that can cause a loss of system stability. Hence, motivated by the advantages of the sliding mode control as a robust controller and to deal with the variation of terrain inclination, we suggest, in this paper, an adaptive observer-based sliding mode controller for a two-wheeled self-balancing robot subject to terrain inclination. From a theoretical viewpoint, the demonstration of the convergence of the adaptive observer with nonlinear parameterization and in the presence of bounded disturbance will be firstly established based on a Lyapunov analysis; then, the analysis of the stability of the output feedback tracking control system composed of the adaptive observer and the continuously implemented sliding mode controller will be carried out based on sliding modes theory. In summary, the main contributions of this paper from both theoretical and application viewpoints are given as follows:(i)
Adaptive estimation of the unmeasured states and the unknown terrain inclination parameter which appears nonlinearly in the dynamics of the two-wheeled self-balancing robot in the presence of disturbances(ii)
Design of the robust adaptive output feedback controller (adaptive observer + sliding mode controller) for the tracking control of the two-wheeled robot despite the unknown terrain inclination and friction disturbances(iii)
Proof of the convergence of the designed adaptive observer and stability analysis of the closed-loop system based on the Lyapunov analysisThe remainder of the paper is organized as follows. The next section presents the problem statement and preliminaries. A robust adaptive observer-based sliding mode control, as well as the convergence of the tracking control scheme, is analyzed in Section3. Simulation results through Matlab/Simulink assert the performance of the proposed method in Section 4. Finally, we conclude the paper with conclusive remarks in Section 5.


### 1.1. Notations

⋅ represents the euclidean norm for vectors and induced norm for matrices. In is an identity matrix with n×n dimension. 0n×m is a null matrix with n rows and m columns. λmaxM and λminM denote, respectively, the maximum and the minimum eigenvalue of M. diagM1,…,Mn represents the block-diagonal matrix = M10⋯00⋱⋱⋮⋮⋱⋱⋮0⋯0Mn, where M1, …, Mn are square matrices. R+∈ℝn×m denotes the pseudoinverse (generalized inverse) of a matrix R∈ℝm×n. That is, R+ is a matrix such that RR+R=R and R+RR+=R+.


## 1.1. Notations

⋅ represents the euclidean norm for vectors and induced norm for matrices. In is an identity matrix with n×n dimension. 0n×m is a null matrix with n rows and m columns. λmaxM and λminM denote, respectively, the maximum and the minimum eigenvalue of M. diagM1,…,Mn represents the block-diagonal matrix = M10⋯00⋱⋱⋮⋮⋱⋱⋮0⋯0Mn, where M1, …, Mn are square matrices. R+∈ℝn×m denotes the pseudoinverse (generalized inverse) of a matrix R∈ℝm×n. That is, R+ is a matrix such that RR+R=R and R+RR+=R+.


## 2. Context and Problem Statement

### 2.1. Model of a Two-Wheeled Self-Balancing Robot

The two-wheeled self-balancing robot is an underactuated system, and it has fewer actuators (2 actuators) than degrees of freedom (3 degree of freedom). The dynamics of this robot is similar to that of a pendulum cart. In fact, the two-wheeled torquesCL and CR are transformed, using a decoupling unit, into two torques Cδ and Cψ. The torque Cψ supervises both the robot position and the pitch angle. It ensures the translation along the x-axis while preserving the upright position, whereas the torque Cδ controls the right and left rotation of the robot which ensures the desired yaw trajectory.Referring to [42–44], the model of the two-wheeled self-balancing robot is as follows:(1)x˙1=x2,x˙2=Fx,ρ+Gx,ρu+dt,where x1=x,ψ,δT, x2=x.,ψ˙,δ˙T, and x=x1,x2T. u=Cψ,CδT is the control input vector. x, ψ, and δ represent, respectively, the linear displacement of the chassis, the pitch angle, and the yaw angle. dt=d1t,d2t,d3tT represents the disturbance vector. dt is assumed to be bounded and differentiable with respect to time. For each t≥0, dt≤ζ, where ζ is a positive number.Gx,ρ=g11x,ρ,0;g21x,ρ,0;0,g32x,ρ and Fx,ρ=f1x,ρ,f2x,ρ,0T, where(2)f1x,ρ=1B¯Mp2L2R2gsinψcosψ+α+MpL2+JpMp+2MrgR2sinα−MpL2+JpMpLR2ψ˙2sinψ+αf2x,ρ=1B¯Mp2L2R2ψ˙2sinψ+αcosψ+α−2MrR2+MpR2+2JrMpgLsinψ+MpMp+2MrLR2gsinαcosψ+α,g11x,ρ=−2B¯MpL2+JpR+MpLR2cosψ+α,g21x,ρ=−2RB¯MpLRcosψ+α+2MrR2+MpR2+2Jr,g32x,ρ=2DMrR+Jr/RD2+2JδRwithB¯=Mp2L2R2cos2ψ+α−2MrR2+MpR2+2JrMpL2+Jp.Jp is the moment of inertia of the chassis with respect to the z-axis, Jδ is the moment of inertia of the chassis with respect to the y-axis, and Jr is the moment of inertia of the wheel. Mp is the total mass of the robot. D is the lateral distance between the contact patches of the wheels, R is the radius of the wheels, and Mr is its mass.ρ=α is the angle of terrain inclination, which is assumed unknown and which will be estimated later through an adaptive observer.


### 2.2. Problem formulation

The two-wheeled self-balancing robot is a nonlinear MIMO underactuated system; thus, it is very challenging to keep balance when it climbs or descends on a slope and, especially, in the presence of nonmeasurable disturbances. In this work, the considered problem consists in designing an output feedback sliding mode controller for the self-balanced robot model subject to unknown disturbances, to generate a robust command for going up and down the slope. In case of going up the slope, the controller generates an acceleration of the gear-motor driving the wheels, whereas in the going down case, a deceleration is performed for the safety of the vehicle. Such behavior is required for ensuring the global engine stability. Despite the importance of the studied issue, according to our knowledge, theoretical developments dealing with the terrain inclination and the disturbances simultaneously for the nonlinear model of the two-wheeled self-balancing robot are infrequent.In addition, it is well known that the dynamics of underactuated systems such as the two-wheeled self-balancing robot may contain hard nonlinearities and nonholonomic constraints which make the control of these systems an open and interesting issue. These features should be considered during control design in order to establish a robust controller which guarantees the system performance even under different operating conditions. Sliding mode control is an efficient robust controller, thanks to its effectiveness for dealing with uncertain and disturbed systems. Persuaded by its advantages, we adopt this popular technique to ensure the tracking objectives.Furthermore, when a mobile robot moves on a trajectory, several phenomenons such as sloping and skidding can cause a loss of wheel traction and battery energy, as well as system stability. Thus, having an instantaneous knowledge of the terrain inclination angle could be lucrative to keep the performance of the adopted control law.The solution to deal with this problem is to design an adaptive observer to estimate conjointly unmeasured states (x˙, ψ˙, δ˙) and the angle of terrain inclination which represents the unknown parameter ρ=α. That is,(3)limt⟶∞xt−x^t=0,limt⟶∞ρt−ρ^t=0.Then, the estimated statesx^t and the reconstructed unknown parameter ρ^t generated by the adaptive observer are to be injected into the sliding mode control law in order to perform the following trajectory tracking aims:(4)limt⟶∞xt−xrt=0,where xrt is the reference trajectory.


## 2.1. Model of a Two-Wheeled Self-Balancing Robot

The two-wheeled self-balancing robot is an underactuated system, and it has fewer actuators (2 actuators) than degrees of freedom (3 degree of freedom). The dynamics of this robot is similar to that of a pendulum cart. In fact, the two-wheeled torquesCL and CR are transformed, using a decoupling unit, into two torques Cδ and Cψ. The torque Cψ supervises both the robot position and the pitch angle. It ensures the translation along the x-axis while preserving the upright position, whereas the torque Cδ controls the right and left rotation of the robot which ensures the desired yaw trajectory.Referring to [42–44], the model of the two-wheeled self-balancing robot is as follows:(1)x˙1=x2,x˙2=Fx,ρ+Gx,ρu+dt,where x1=x,ψ,δT, x2=x.,ψ˙,δ˙T, and x=x1,x2T. u=Cψ,CδT is the control input vector. x, ψ, and δ represent, respectively, the linear displacement of the chassis, the pitch angle, and the yaw angle. dt=d1t,d2t,d3tT represents the disturbance vector. dt is assumed to be bounded and differentiable with respect to time. For each t≥0, dt≤ζ, where ζ is a positive number.Gx,ρ=g11x,ρ,0;g21x,ρ,0;0,g32x,ρ and Fx,ρ=f1x,ρ,f2x,ρ,0T, where(2)f1x,ρ=1B¯Mp2L2R2gsinψcosψ+α+MpL2+JpMp+2MrgR2sinα−MpL2+JpMpLR2ψ˙2sinψ+αf2x,ρ=1B¯Mp2L2R2ψ˙2sinψ+αcosψ+α−2MrR2+MpR2+2JrMpgLsinψ+MpMp+2MrLR2gsinαcosψ+α,g11x,ρ=−2B¯MpL2+JpR+MpLR2cosψ+α,g21x,ρ=−2RB¯MpLRcosψ+α+2MrR2+MpR2+2Jr,g32x,ρ=2DMrR+Jr/RD2+2JδRwithB¯=Mp2L2R2cos2ψ+α−2MrR2+MpR2+2JrMpL2+Jp.Jp is the moment of inertia of the chassis with respect to the z-axis, Jδ is the moment of inertia of the chassis with respect to the y-axis, and Jr is the moment of inertia of the wheel. Mp is the total mass of the robot. D is the lateral distance between the contact patches of the wheels, R is the radius of the wheels, and Mr is its mass.ρ=α is the angle of terrain inclination, which is assumed unknown and which will be estimated later through an adaptive observer.


## 2.2. Problem formulation

The two-wheeled self-balancing robot is a nonlinear MIMO underactuated system; thus, it is very challenging to keep balance when it climbs or descends on a slope and, especially, in the presence of nonmeasurable disturbances. In this work, the considered problem consists in designing an output feedback sliding mode controller for the self-balanced robot model subject to unknown disturbances, to generate a robust command for going up and down the slope. In case of going up the slope, the controller generates an acceleration of the gear-motor driving the wheels, whereas in the going down case, a deceleration is performed for the safety of the vehicle. Such behavior is required for ensuring the global engine stability. Despite the importance of the studied issue, according to our knowledge, theoretical developments dealing with the terrain inclination and the disturbances simultaneously for the nonlinear model of the two-wheeled self-balancing robot are infrequent.In addition, it is well known that the dynamics of underactuated systems such as the two-wheeled self-balancing robot may contain hard nonlinearities and nonholonomic constraints which make the control of these systems an open and interesting issue. These features should be considered during control design in order to establish a robust controller which guarantees the system performance even under different operating conditions. Sliding mode control is an efficient robust controller, thanks to its effectiveness for dealing with uncertain and disturbed systems. Persuaded by its advantages, we adopt this popular technique to ensure the tracking objectives.Furthermore, when a mobile robot moves on a trajectory, several phenomenons such as sloping and skidding can cause a loss of wheel traction and battery energy, as well as system stability. Thus, having an instantaneous knowledge of the terrain inclination angle could be lucrative to keep the performance of the adopted control law.The solution to deal with this problem is to design an adaptive observer to estimate conjointly unmeasured states (x˙, ψ˙, δ˙) and the angle of terrain inclination which represents the unknown parameter ρ=α. That is,(3)limt⟶∞xt−x^t=0,limt⟶∞ρt−ρ^t=0.Then, the estimated statesx^t and the reconstructed unknown parameter ρ^t generated by the adaptive observer are to be injected into the sliding mode control law in order to perform the following trajectory tracking aims:(4)limt⟶∞xt−xrt=0,where xrt is the reference trajectory.


## 3. Adaptive Observer-Based Sliding Mode Control for the Two-Wheeled Self-Balancing Robot

In this section, we present first the adaptive observer design method for the wheeled robot, and then, we combine it with the sliding mode controller whose objective is to ensure tracking control despite the presence of unknown terrain inclination and disturbances. Before describing the adaptive observer-based sliding mode control system, the following assumption must be taken into account.Assumption 1.
For any bounded control inputu, the state x is assumed bounded. Moreover, the unknown parameter ρ is also assumed to be bounded and slowly varying, that is, ρ˙t=0, almost everywhere.
It is to be noticed that some physical autonomous systems such as chaotic systems verify the boundedness assumption of the trajectories naturally (Assumption1). In the case of controlled systems (nonautonomous systems) which include the two-wheeled self-balancing robot considered in this paper, the boundedness of the states may be guaranteed by synthesizing an appropriate bounded control input. We notice also that assuming the unknown angle inclination parameter ρt=αt is usually satisfied in practice in the self-balancing robot system under terrain inclination, which is trivially reasoning from a physical viewpoint.
By considering Assumption1, let u,x,ρ∈U,X,Θ, where U⊂ℝ2, X⊂ℝ6, and Θ⊂ℝ are three compact sets.
For the two-wheeled self-balancing robot system, the nonlinearitiesFx,ρ and Gx,ρ are just once continuously differentiable but not globally Lipschitz. In such a case, we use, under Assumption 1, the Lipschitz prolongation approach in order to build prolongations F˜ and G˜ of the nonlinearities F and G using saturation functions [40, 45], where F˜ and G˜ are globally Lipschitz and defined as F˜x,ρ=Fσx,σρρ and G˜x,ρ=Gσx,σρρ, where σ:ℝn⟶X,x↦σx and σρ:ℝ⟶Θ,ρ↦σρρ are smooth bounded saturation functions such that σx=x and σρρ=ρ for all x∈X and ρ∈Θ.
In this way, the trajectories of the wheeled robot system (46) coincide with those of the following system:(5)x˙1=x2,x˙2=F˜x,ρ+G˜x,ρu+dt,where G˜x,ρ=g˜11x,ρ,0;g˜21x,ρ,0;0,g˜32x,ρ and F˜x,ρ=f˜1x,ρ,f˜2x,ρ,0T are the Lipschitz extension functions of Gx,ρ and Fx,ρ, respectively.
In the rest of the paper, we will rather focus on system (5) for the design of our proposed adaptive observer-based tracking control approach for the considered two-wheeled self-balancing robot.


### 3.1. Adaptive Observer for States and Terrain Inclination Angle Estimation

Adaptive observer design represents a popular method for states and unknown parameter estimation. Since the unknown terrain inclination angle appears nonlinearly in the dynamic of the two-wheeled self-balancing robot and given the triangular structure of our system, we adopt the adaptive observer treated in [40] and we recall, in this section, the main features of this estimation approach.Actually, the two-wheeled self-balancing robot system (5) is included in the class of systems considered in [40] and may be written in the following form:(6)x˙=Ax+f˜x,ρ+g˜x,ρu+Bdt,y=Cx=x1,where A=03I30303, B=03I3, and C=I3,03. g˜x,ρ=03×2G˜x,ρ, f˜x,ρ=03×1F˜x,ρ, and x=x1x2.Conforming to [40], the adaptive observer developed for system (6) is given by(7)x^˙=Ax^+g˜x^,ρ^u+f˜x^,ρ^−θΔθ−1S¯−1+YtPtYTtCTKCx˜,ρ^˙t=−θPtYTtCTKCx˜,Y˙t=θA−S¯−1CTCYt+Δθ∂f˜∂ρx^,ρ^+Δθ∂g˜∂ρx^,ρ^u,withY0=0,P˙t=−θPtYTtCTCYtPt+θPt,withP0=PT0>0,where x^=x^1x^2; Δθ=diagI3,1/θI3, where θ>0 is a real number, x˜=x^−x, and S¯ is the unique solution of the following algebraic Lyapunov equation:(8)S¯+ATS¯+S¯A−CTC=0,where S¯ is the symmetric positive definite (SPD) and the matrix A−S¯−1CTC is Hurwitz. K is a design matrix of appropriate dimensions to be determined later.For the convergence of the unknown parameters estimation errors, the following assumption is required.Assumption 2.
For any trajectoryx^,ρ^∈X×Ω, the matrix CΥt must satisfy the condition of persistent excitation, and it means: ∃δ1,δ2>0;∃T>0;∀t≥0: δ1Im≤∫tt+TYTtCTCYτdτ≤δ2Im.
The persistency of excitation is a classical condition usually adopted in the literature of adaptive estimation. It is behind the asymptotic stability and parametric convergence, and it signifies that the studied system is sufficiently rich in frequencies.Proposition 1.
Consider the system (6) subject to the unknown parameter ρt and the disturbance dt, together with the adaptive observer (7), under Assumptions 1 and 2. Then, the state estimation error x˜=x^−x and the adaption error ρ˜=ρ^−ρ converge to a small compact set whose radius may be reduced by choosing sufficiently high values of the design parameter θ.Proof.
The proof of Proposition1 is mainly based on the proof of Theorem 3.1 in [40] while taking into account the presence of the disturbance dt. We consider the Lyapunov function(9)Wt=ΩtTS¯Ωt+ρ˜TtP−1ρ˜t,where(10)Ωt=x¯t−Ytρ˜t,x¯t=Δθx^−x.
Proceeding as in Theorem 3.1 in [40] and taking into account the presence of the perturbation term dt, one may obtain(11)W˙≤−2μW−2ΩTS¯ΔθBdt≤−2μW+2BζλmaxS¯θ−1WΩ≤−μW−μWΩWΩ−2Bζμ−1λmaxS¯θ−1,where we recall that ζ is a positive constant such that, for all t≥0, dt≤ζ and(12)μ=12θ−c11−c22θθ−c1,where c1 and c2 are positive constants which depend on the upper bounds of the different bounded signals and on the minimal and maximal eigenvalues of the matrices S¯ and P (see the proof of Theorem 3.1 in [40]).
Next, from the last inequality (11), we deduce that as long as Wt≥2Bζμ−1λmaxS¯θ−1, one has(13)W˙t≤−μWt.
IfW0≥2Bζμ−1λmaxS¯θ−1, Ωt and ρ˜t will decrease exponentially such that(14)Wt≤W0e−μt.
Consequently, there exists a finite timeTa such that for all t≥Ta,(15)Wt≤2Bζμ−1λmaxS¯θ−1.
We have(16)12λminS¯Ωt+12λminP−1ρ˜t≤Wt.
Next, combining inequalities (15) and (16) and using (10), it may be deduced that the estimation error x˜t and the adaptation error ρ˜t converge to a compact set whose radius may be reduced by choosing a sufficiently large value of the design parameter θ.
Once the unmeasured states and the unknown parameter are reconstructed by the adaptive observer (6), the estimated signals are employed, in the next section, by the sliding mode control law in order to build an adaptive sliding mode controller.


### 3.2. Adaptive Observer-Based Sliding Mode Control for the Two-Wheeled Self-Balancing Robot

In this section, we apply the sliding mode control on the two-wheeled self-balancing robot and we replace the unknown parameterρ=α and the speed states (x˙, ϕ˙, δ˙), which are not accessible to measurement by their estimates obtained from the proposed adaptive observer as it is denoted in Figure 1.Figure 1
Synoptic diagram of the proposed control method.The problem of trajectory tracking consists to determine the control lawu which insures the convergence of the state vector x1=xψδT to the reference vector xr=xrψrδrT with a tracking error on the first component of the state vector:(17)e=xr−x1.Affected by the influence of terrain inclinationα, the pitch angle ψr will not be identical to zero when the two-wheeled self-balancing robot becomes stable on the slope. In fact, ψr will become a constant ψeq which depends on α, and it is defined as [31](18)ψeq=arccos−MrRsinαMp−arccosRsinαR2sin2α+L2.We select the sliding variables vector as follows:(19)S=λxr−x1+x˙r−x^2=λxr−x1+x˙r−x2+x2−x^2=λxr−x1+x˙r−x2+x˜2,where λ is a positive constant.Inspired from sliding modes theory, we propose the following sliding mode controller incorporating the estimated states generated by the adaptive observer (7):(20)u=G˜x^,ρ^+x¨r−F˜x^,ρ^+λx˙r−x^2−kSS,where k is a positive constant.However, the presence of the discontinuous function, in the sliding mode control, gives rise to the well-knownchattering phenomenon which represents the main disadvantage of sliding modes controllers. To overcome this problem, it is lucrative to transform the discontinuous function by a continuous one using the boundary layer approximation approach to eliminate the chattering phenomenon [46]. Then, we rather consider the following “continuously implemented sliding mode controller” instead of (20):(21)u=G˜x^,ρ^+x¨r−F˜x^,ρ^+λx˙r−x^2+kSS+ε+βS,where G˜x^,ρ^+ represents the pseudoinverse matrix of G˜x^,ρ^. β and ε are positive constants.Before proving the convergence of the tracking error of the closed loop system, we show first, in the proof of the following theorem, thatSt converges to a compact set whose radius may be made as small as possible by adjusting the design parameters ε and β.Theorem 1.
We consider the system (6) under the continuously implemented sliding mode control input (21) and incorporate the adaptive observer (7) such that Assumptions 1 and 2 are satisfied. Then, St is uniformly bounded with an upper bound which may be made arbitrarily small by reducing the design parameter ε and increasing the design parameter β.Proof.
Let us start with an appropriate Lyapunov function:(22)V=12STS.
Differentiating this function and referring to (19), one obtains(23)V˙=SS˙=Sλx˙r−x2+x¨r−x˙2+x˜˙2=Sλx˙r−x2+x¨r−F˜x,ρ−Gx,ρu−dt+x˜˙2=Sλx˙r−x2+x¨r−F˜x^,ρ^−Gx^,ρ^u−dt+x˜˙2−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
Let(24)ηx,x^,ρ,ρ^=−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
Now, replacing the control input vectoru by its expression described in (21), one has(25)V˙=Sηx,x^,ρ,ρ^−dt+x˜˙2−λx˜2−kSS+ε+βS=−βS2−kS2S+ε+x˜˙2−λx˜2+ηx,x^,ρ,ρ^−dt.
At this stage, it is needful to prove the boundedness ofηx,x^,ρ,ρ^ and x˜˙2 in order to admit the convergence St.
Let us first prove the boundedness ofηx,x^,ρ,ρ^. We have(26)ηx,x^,ρ,ρ^=−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
This can be written as(27)ηx,x^,ρ,ρ^=−F˜x,ρ+F˜x^,ρ−F˜x^,ρ−G˜x,ρu+G˜x^,ρu−G˜x^,ρu+F˜x^,ρ^+G˜x^,ρ^u=−F˜x,ρ−F˜x^,ρ−G˜x,ρ−G˜x^,ρu−F˜x^,ρ−F˜x^,ρ^−G˜x^,ρ−G˜x^,ρ^u.
Tacking into account thatF˜x,ρ and G˜x,ρ are Lipschitz with respect to x uniformly in ρ and F˜x^,ρ and G˜x^,ρ are Lipschitz with respect to ρ uniformly in x^, we can write that(28)ηx,x^,ρ,ρ^≤kFx−x^+kGux−x^+kρ1ρ−ρ^+kρ2uρ−ρ^≤kF+kukGx˜+kρ1+kρ2kuρ˜,where kF, kG, ku, kρ1, and kρ2 are a positive constants.
From the convergence of the adaptive observer [40], it follows that there exists a positive constant kη>0 such that(29)ηx,x^,ρ,ρ^≤kη.
Next, we need to show the boundedness ofx˜˙2. To that end, conforming to [40], taking into account the presence of the disturbance term dt and using (7), we have(30)x˜˙=Ax˜+f˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−θΔθ−1S¯−1CTKCx˜+Δθ−1Yρ˜˙−Bdt.
We setx¯c=Δcx˜ and Δc=θI30303I3. Referring to (30) and tacking into account that ΔcAΔc−1=θA and CΔc=C, we get(31)x¯˙c=θA−θKoS−1CTCx¯c+θYρ˜˙+Δcf˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−Bdt.
Hence,(32)x¯˙c=θA¯x¯c+Wu,x^,ρ^,where Wu,x^,ρ^=f˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−Bdt+θYρ˜˙ and A¯=A−θKoS−1CTC. A¯ is Hurwitz, and W˙ is bounded. In fact, we recall that xt, ut, dt, and ρt are assumed to be bounded. Furthermore, ∂g˜/∂x and ∂f˜/∂x are bounded because f˜ and g˜ are assumed continuously differentiable.
Therefore, according to Theorem1 of [47], we can conclude that limθ⟶+∞x¯˙c=0. As a result, limθ⟶+∞x˜˙1=0 and limθ⟶+∞x˜˙2=0.
Now, letk2>0 and k˜2>0 such that x˜2t≤k2 and x˜˙2t≤k˜2.
Returning to (25) and using (29), we deduce that(33)V˙≤−βS2−kS2S+ε+k˜2+λk2+kη+ζS.
Supposingks=k˜2+λk2+kη+ζ, one obtains(34)V˙≤−βS2−kS2S+ε+ksS+εSS+ε≤−βS2−kS2S+ε+ksS2S+ε+ksεSS+ε≤−βS2−k−ksS2S+ε+ksε,sinceSS+ε<1.
Choosingk sufficiently large such that k>ks, we have(35)V˙St≤−βS2t+ksε≤−βVSt−βVSt−ksε.
As long asβVSt≥ksε, i.e, VSt≥ksε/β, we have V˙St≤−βVSt. Then, if VSt≥ksε/β, St will be exponentially decreasing, and there exists a finite time Ts such that, for all t≥Ts, VSt≤ksε/β, which means that, for all t≥Ts, we have(36)St≤2ksεβ1/2,which means that St is uniformly bounded and its upper bound 2ksε/β1/2 may be made small by reducing the design parameter ε and increasing the design parameter β.
Now, it remains to show the convergence of the tracking error of the closed-loop system.Corollary 1.
We consider the system (6) with control input (21) and incorporate the adaptive observer (7) such that Assumptions 1 and 2 are satisfied. Then, the tracking errors of the closed-loop system converge to a compact set whose radius may be reduced by choosing small values of the design parameter ε and by increasing the design parameter β.Proof.
Referring to (17), the derivative of the tracking error becomes(37)e˙=S−λe−x˜2.
Let us consider the Lyapunov functionV1=eTP1e; its derivative is given by(38)V˙1=2eTP1e˙.
Using (37), this allows to obtain(39)V˙1=2eTP1S−λe−x˜2=−2λeTP1e+2eTP1S−2eTP1x˜2.
Reminding thatx˜2t≤k2 and using (36), one obtains(40)V˙1≤−2λV1+2eλmaxP12ksεβ1/2+k2≤−2λV1+c3V1,where(41)c3=2λminP1λmaxP12ksεβ1/2+k2,and (40) can be written as(42)V˙1≤−V1λV1−c3−λV1.
Hence, as long asλV1−c3≥0, i.e, V1≥c3/λ2, we have V˙1et≤−λV1et, which means that V1et will be decreasing exponentially fast until V1et<c3/λ2 after a finite time Tf2.
SinceλminP1et2≤V1et, we have(43)et≤λc3λminP1,∀t≥Tf2.
By considering the expression (41) of the constant c3, we deduce, from inequality (43), that the tracking errors of the closed-loop system converge to a compact set whose radius may be made as small as possible by reducing the design parameter ε and increasing the design parameter β.Remark 1.
Based on the different abovementioned demonstrations and using the different assumptions considered in this paper, we summarize the following algorithm to describe how the different design parameters are selected and the steps of the implementation process:Step 1: we compute the matrixS¯ and the solution of the algebraic Lyapunov equation (8). The latter equation (8) is solvable for S¯ as long as the pair A,C is observable, which is the case for the two-wheeled self-balancing robot considered in this paper. For the choice of S¯, we solve the equation S¯+ATS¯+S¯A−CTC=0 using the pole placement method and the Matlab function place.Step 2: the choice ofθ should ensure a compromise between fast convergence of the state estimation and the satisfactory dealing with noise rejection (with θ>1).Step 3: we choose a large value of the design parameterβ and a small value of the parameter ε such that(44)β≫10<ε≪1.Step 4: we select a positive parameterλ according to the reference tracking priority that we should to give to the state x1 or x2.Step 5: we choose a sufficiently large parameterk such that k>ks with ks=k˜2+λk2+kη+ζ, where ζ, k2, and k˜2 are, respectively, the upper bounds of the disturbance dt, the state x˜2t, and its derivative x˜˙2t; kη is the upper-bound of the signal ηx,x^,ρ,ρ^ given by equation (29).Step 6: we compute the pseudoinverseG˜x^,ρ^+ of the matrix function G˜x^,ρ^ (see the definition of the pseudoinverse of a matrix at the end of Section 1).Remark 2.
Terminal sliding mode control is an efficient robust control approach that has proved interesting advantages compared to conventional sliding mode control: we report, for instance, its fast convergence rate and its high tracking accuracy [25]. In this context, an adaptive nonsingular integral terminal sliding mode control approach has been proposed in [17]. The convergence rate of the latter control approach was recently improved in [17] with application to the trajectory tracking control of autonomous underwater vehicles. Terminal sliding mode control may be investigated in future works for the two-wheeled self-balancing robot to design a more efficient tracking control scheme with improved convergence properties.


## 3.1. Adaptive Observer for States and Terrain Inclination Angle Estimation

Adaptive observer design represents a popular method for states and unknown parameter estimation. Since the unknown terrain inclination angle appears nonlinearly in the dynamic of the two-wheeled self-balancing robot and given the triangular structure of our system, we adopt the adaptive observer treated in [40] and we recall, in this section, the main features of this estimation approach.Actually, the two-wheeled self-balancing robot system (5) is included in the class of systems considered in [40] and may be written in the following form:(6)x˙=Ax+f˜x,ρ+g˜x,ρu+Bdt,y=Cx=x1,where A=03I30303, B=03I3, and C=I3,03. g˜x,ρ=03×2G˜x,ρ, f˜x,ρ=03×1F˜x,ρ, and x=x1x2.Conforming to [40], the adaptive observer developed for system (6) is given by(7)x^˙=Ax^+g˜x^,ρ^u+f˜x^,ρ^−θΔθ−1S¯−1+YtPtYTtCTKCx˜,ρ^˙t=−θPtYTtCTKCx˜,Y˙t=θA−S¯−1CTCYt+Δθ∂f˜∂ρx^,ρ^+Δθ∂g˜∂ρx^,ρ^u,withY0=0,P˙t=−θPtYTtCTCYtPt+θPt,withP0=PT0>0,where x^=x^1x^2; Δθ=diagI3,1/θI3, where θ>0 is a real number, x˜=x^−x, and S¯ is the unique solution of the following algebraic Lyapunov equation:(8)S¯+ATS¯+S¯A−CTC=0,where S¯ is the symmetric positive definite (SPD) and the matrix A−S¯−1CTC is Hurwitz. K is a design matrix of appropriate dimensions to be determined later.For the convergence of the unknown parameters estimation errors, the following assumption is required.Assumption 2.
For any trajectoryx^,ρ^∈X×Ω, the matrix CΥt must satisfy the condition of persistent excitation, and it means: ∃δ1,δ2>0;∃T>0;∀t≥0: δ1Im≤∫tt+TYTtCTCYτdτ≤δ2Im.
The persistency of excitation is a classical condition usually adopted in the literature of adaptive estimation. It is behind the asymptotic stability and parametric convergence, and it signifies that the studied system is sufficiently rich in frequencies.Proposition 1.
Consider the system (6) subject to the unknown parameter ρt and the disturbance dt, together with the adaptive observer (7), under Assumptions 1 and 2. Then, the state estimation error x˜=x^−x and the adaption error ρ˜=ρ^−ρ converge to a small compact set whose radius may be reduced by choosing sufficiently high values of the design parameter θ.Proof.
The proof of Proposition1 is mainly based on the proof of Theorem 3.1 in [40] while taking into account the presence of the disturbance dt. We consider the Lyapunov function(9)Wt=ΩtTS¯Ωt+ρ˜TtP−1ρ˜t,where(10)Ωt=x¯t−Ytρ˜t,x¯t=Δθx^−x.
Proceeding as in Theorem 3.1 in [40] and taking into account the presence of the perturbation term dt, one may obtain(11)W˙≤−2μW−2ΩTS¯ΔθBdt≤−2μW+2BζλmaxS¯θ−1WΩ≤−μW−μWΩWΩ−2Bζμ−1λmaxS¯θ−1,where we recall that ζ is a positive constant such that, for all t≥0, dt≤ζ and(12)μ=12θ−c11−c22θθ−c1,where c1 and c2 are positive constants which depend on the upper bounds of the different bounded signals and on the minimal and maximal eigenvalues of the matrices S¯ and P (see the proof of Theorem 3.1 in [40]).
Next, from the last inequality (11), we deduce that as long as Wt≥2Bζμ−1λmaxS¯θ−1, one has(13)W˙t≤−μWt.
IfW0≥2Bζμ−1λmaxS¯θ−1, Ωt and ρ˜t will decrease exponentially such that(14)Wt≤W0e−μt.
Consequently, there exists a finite timeTa such that for all t≥Ta,(15)Wt≤2Bζμ−1λmaxS¯θ−1.
We have(16)12λminS¯Ωt+12λminP−1ρ˜t≤Wt.
Next, combining inequalities (15) and (16) and using (10), it may be deduced that the estimation error x˜t and the adaptation error ρ˜t converge to a compact set whose radius may be reduced by choosing a sufficiently large value of the design parameter θ.
Once the unmeasured states and the unknown parameter are reconstructed by the adaptive observer (6), the estimated signals are employed, in the next section, by the sliding mode control law in order to build an adaptive sliding mode controller.


## 3.2. Adaptive Observer-Based Sliding Mode Control for the Two-Wheeled Self-Balancing Robot

In this section, we apply the sliding mode control on the two-wheeled self-balancing robot and we replace the unknown parameterρ=α and the speed states (x˙, ϕ˙, δ˙), which are not accessible to measurement by their estimates obtained from the proposed adaptive observer as it is denoted in Figure 1.Figure 1
Synoptic diagram of the proposed control method.The problem of trajectory tracking consists to determine the control lawu which insures the convergence of the state vector x1=xψδT to the reference vector xr=xrψrδrT with a tracking error on the first component of the state vector:(17)e=xr−x1.Affected by the influence of terrain inclinationα, the pitch angle ψr will not be identical to zero when the two-wheeled self-balancing robot becomes stable on the slope. In fact, ψr will become a constant ψeq which depends on α, and it is defined as [31](18)ψeq=arccos−MrRsinαMp−arccosRsinαR2sin2α+L2.We select the sliding variables vector as follows:(19)S=λxr−x1+x˙r−x^2=λxr−x1+x˙r−x2+x2−x^2=λxr−x1+x˙r−x2+x˜2,where λ is a positive constant.Inspired from sliding modes theory, we propose the following sliding mode controller incorporating the estimated states generated by the adaptive observer (7):(20)u=G˜x^,ρ^+x¨r−F˜x^,ρ^+λx˙r−x^2−kSS,where k is a positive constant.However, the presence of the discontinuous function, in the sliding mode control, gives rise to the well-knownchattering phenomenon which represents the main disadvantage of sliding modes controllers. To overcome this problem, it is lucrative to transform the discontinuous function by a continuous one using the boundary layer approximation approach to eliminate the chattering phenomenon [46]. Then, we rather consider the following “continuously implemented sliding mode controller” instead of (20):(21)u=G˜x^,ρ^+x¨r−F˜x^,ρ^+λx˙r−x^2+kSS+ε+βS,where G˜x^,ρ^+ represents the pseudoinverse matrix of G˜x^,ρ^. β and ε are positive constants.Before proving the convergence of the tracking error of the closed loop system, we show first, in the proof of the following theorem, thatSt converges to a compact set whose radius may be made as small as possible by adjusting the design parameters ε and β.Theorem 1.
We consider the system (6) under the continuously implemented sliding mode control input (21) and incorporate the adaptive observer (7) such that Assumptions 1 and 2 are satisfied. Then, St is uniformly bounded with an upper bound which may be made arbitrarily small by reducing the design parameter ε and increasing the design parameter β.Proof.
Let us start with an appropriate Lyapunov function:(22)V=12STS.
Differentiating this function and referring to (19), one obtains(23)V˙=SS˙=Sλx˙r−x2+x¨r−x˙2+x˜˙2=Sλx˙r−x2+x¨r−F˜x,ρ−Gx,ρu−dt+x˜˙2=Sλx˙r−x2+x¨r−F˜x^,ρ^−Gx^,ρ^u−dt+x˜˙2−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
Let(24)ηx,x^,ρ,ρ^=−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
Now, replacing the control input vectoru by its expression described in (21), one has(25)V˙=Sηx,x^,ρ,ρ^−dt+x˜˙2−λx˜2−kSS+ε+βS=−βS2−kS2S+ε+x˜˙2−λx˜2+ηx,x^,ρ,ρ^−dt.
At this stage, it is needful to prove the boundedness ofηx,x^,ρ,ρ^ and x˜˙2 in order to admit the convergence St.
Let us first prove the boundedness ofηx,x^,ρ,ρ^. We have(26)ηx,x^,ρ,ρ^=−F˜x,ρ−G˜x,ρu+F˜x^,ρ^+G˜x^,ρ^u.
This can be written as(27)ηx,x^,ρ,ρ^=−F˜x,ρ+F˜x^,ρ−F˜x^,ρ−G˜x,ρu+G˜x^,ρu−G˜x^,ρu+F˜x^,ρ^+G˜x^,ρ^u=−F˜x,ρ−F˜x^,ρ−G˜x,ρ−G˜x^,ρu−F˜x^,ρ−F˜x^,ρ^−G˜x^,ρ−G˜x^,ρ^u.
Tacking into account thatF˜x,ρ and G˜x,ρ are Lipschitz with respect to x uniformly in ρ and F˜x^,ρ and G˜x^,ρ are Lipschitz with respect to ρ uniformly in x^, we can write that(28)ηx,x^,ρ,ρ^≤kFx−x^+kGux−x^+kρ1ρ−ρ^+kρ2uρ−ρ^≤kF+kukGx˜+kρ1+kρ2kuρ˜,where kF, kG, ku, kρ1, and kρ2 are a positive constants.
From the convergence of the adaptive observer [40], it follows that there exists a positive constant kη>0 such that(29)ηx,x^,ρ,ρ^≤kη.
Next, we need to show the boundedness ofx˜˙2. To that end, conforming to [40], taking into account the presence of the disturbance term dt and using (7), we have(30)x˜˙=Ax˜+f˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−θΔθ−1S¯−1CTKCx˜+Δθ−1Yρ˜˙−Bdt.
We setx¯c=Δcx˜ and Δc=θI30303I3. Referring to (30) and tacking into account that ΔcAΔc−1=θA and CΔc=C, we get(31)x¯˙c=θA−θKoS−1CTCx¯c+θYρ˜˙+Δcf˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−Bdt.
Hence,(32)x¯˙c=θA¯x¯c+Wu,x^,ρ^,where Wu,x^,ρ^=f˜x^,ρ^+g˜x^,ρ^u−f˜x,ρ+g˜x,ρu−Bdt+θYρ˜˙ and A¯=A−θKoS−1CTC. A¯ is Hurwitz, and W˙ is bounded. In fact, we recall that xt, ut, dt, and ρt are assumed to be bounded. Furthermore, ∂g˜/∂x and ∂f˜/∂x are bounded because f˜ and g˜ are assumed continuously differentiable.
Therefore, according to Theorem1 of [47], we can conclude that limθ⟶+∞x¯˙c=0. As a result, limθ⟶+∞x˜˙1=0 and limθ⟶+∞x˜˙2=0.
Now, letk2>0 and k˜2>0 such that x˜2t≤k2 and x˜˙2t≤k˜2.
Returning to (25) and using (29), we deduce that(33)V˙≤−βS2−kS2S+ε+k˜2+λk2+kη+ζS.
Supposingks=k˜2+λk2+kη+ζ, one obtains(34)V˙≤−βS2−kS2S+ε+ksS+εSS+ε≤−βS2−kS2S+ε+ksS2S+ε+ksεSS+ε≤−βS2−k−ksS2S+ε+ksε,sinceSS+ε<1.
Choosingk sufficiently large such that k>ks, we have(35)V˙St≤−βS2t+ksε≤−βVSt−βVSt−ksε.
As long asβVSt≥ksε, i.e, VSt≥ksε/β, we have V˙St≤−βVSt. Then, if VSt≥ksε/β, St will be exponentially decreasing, and there exists a finite time Ts such that, for all t≥Ts, VSt≤ksε/β, which means that, for all t≥Ts, we have(36)St≤2ksεβ1/2,which means that St is uniformly bounded and its upper bound 2ksε/β1/2 may be made small by reducing the design parameter ε and increasing the design parameter β.
Now, it remains to show the convergence of the tracking error of the closed-loop system.Corollary 1.
We consider the system (6) with control input (21) and incorporate the adaptive observer (7) such that Assumptions 1 and 2 are satisfied. Then, the tracking errors of the closed-loop system converge to a compact set whose radius may be reduced by choosing small values of the design parameter ε and by increasing the design parameter β.Proof.
Referring to (17), the derivative of the tracking error becomes(37)e˙=S−λe−x˜2.
Let us consider the Lyapunov functionV1=eTP1e; its derivative is given by(38)V˙1=2eTP1e˙.
Using (37), this allows to obtain(39)V˙1=2eTP1S−λe−x˜2=−2λeTP1e+2eTP1S−2eTP1x˜2.
Reminding thatx˜2t≤k2 and using (36), one obtains(40)V˙1≤−2λV1+2eλmaxP12ksεβ1/2+k2≤−2λV1+c3V1,where(41)c3=2λminP1λmaxP12ksεβ1/2+k2,and (40) can be written as(42)V˙1≤−V1λV1−c3−λV1.
Hence, as long asλV1−c3≥0, i.e, V1≥c3/λ2, we have V˙1et≤−λV1et, which means that V1et will be decreasing exponentially fast until V1et<c3/λ2 after a finite time Tf2.
SinceλminP1et2≤V1et, we have(43)et≤λc3λminP1,∀t≥Tf2.
By considering the expression (41) of the constant c3, we deduce, from inequality (43), that the tracking errors of the closed-loop system converge to a compact set whose radius may be made as small as possible by reducing the design parameter ε and increasing the design parameter β.Remark 1.
Based on the different abovementioned demonstrations and using the different assumptions considered in this paper, we summarize the following algorithm to describe how the different design parameters are selected and the steps of the implementation process:Step 1: we compute the matrixS¯ and the solution of the algebraic Lyapunov equation (8). The latter equation (8) is solvable for S¯ as long as the pair A,C is observable, which is the case for the two-wheeled self-balancing robot considered in this paper. For the choice of S¯, we solve the equation S¯+ATS¯+S¯A−CTC=0 using the pole placement method and the Matlab function place.Step 2: the choice ofθ should ensure a compromise between fast convergence of the state estimation and the satisfactory dealing with noise rejection (with θ>1).Step 3: we choose a large value of the design parameterβ and a small value of the parameter ε such that(44)β≫10<ε≪1.Step 4: we select a positive parameterλ according to the reference tracking priority that we should to give to the state x1 or x2.Step 5: we choose a sufficiently large parameterk such that k>ks with ks=k˜2+λk2+kη+ζ, where ζ, k2, and k˜2 are, respectively, the upper bounds of the disturbance dt, the state x˜2t, and its derivative x˜˙2t; kη is the upper-bound of the signal ηx,x^,ρ,ρ^ given by equation (29).Step 6: we compute the pseudoinverseG˜x^,ρ^+ of the matrix function G˜x^,ρ^ (see the definition of the pseudoinverse of a matrix at the end of Section 1).Remark 2.
Terminal sliding mode control is an efficient robust control approach that has proved interesting advantages compared to conventional sliding mode control: we report, for instance, its fast convergence rate and its high tracking accuracy [25]. In this context, an adaptive nonsingular integral terminal sliding mode control approach has been proposed in [17]. The convergence rate of the latter control approach was recently improved in [17] with application to the trajectory tracking control of autonomous underwater vehicles. Terminal sliding mode control may be investigated in future works for the two-wheeled self-balancing robot to design a more efficient tracking control scheme with improved convergence properties.


## 4. Numerical Simulations

In this section, the numerical simulations carried out usingMatlab/Simulink software, applied on the two-wheeled self-balancing robot, are performed to highlight the effectiveness of the proposed adaptive sliding mode controller.The robot parameters are summarized in Table1.Table 1
Two-wheeled self-balancing robot parameters.
SymbolNameValue (unit)MpBody weight including the loads20.82 (kg)MrMass of the wheel0.420 (kg)DDistance between the contact patches of the wheels0.438 (m)LDistance between the chassis and the center0.4 (m)RRadius of the wheel0.106 (m)gGravity constant9.8 (ms−2)JpThe moment of inertia of the chassis with respect to thez-axis0.28 (kg⋅m2)JδThe moment of inertia of the chassis with respect to they-axis1.12 (kg⋅m2)JrMoment of inertia of the wheel0.1 (kg⋅m2)The initial conditions for the position states are fixed asx=0m; ψ=0.5rad; and δ=0rad, and all the speed states are fixed to zero (x˙=0m/s, ψ˙=0rad/s, and δ˙=0rad/s).The disturbance vectordt is chosen such that d1t=−0.3sin3πtNm, d2t=−0.02sin2πt+πNm, and d3t=−0.2sin5πtNm.Firstly, we apply the adaptive observer (7) to estimate unmeasured states and the terrain inclination with the following initial condition: x^0=0.1m, ψ^0=0.24rad, δ^0=0.5rad, x˙^0=0.5m/s, ψ˙^0=0.5rad/s, δ˙^0=0rad/s, and α^0=0rad.The design parameters of the adaptive observer are selected asθ=10, P0=1 and Y0=000000T.The design matrixS¯−1CT is chosen such that S¯−1CT=200020002100010001.Once the terrain inclination and the unmeasured states are available, we apply the continuously implemented sliding mode controller given by (21) to the two-wheeled self-balancing robot, where St is defined by equation (19) such that pseudoinverse G˜x^,ρ^+ is computed as follows:(45)G˜x^,ρ^+=12g˜11x^,ρ^12g˜21x^,ρ^0001g˜32x^,ρ^,where xrt, ψeqt, and δrt are the desired reference trajectories suitably planned as depicted in Figures 2–4.Figure 2
Linear displacementx.Figure 3
Response of the pitch angleψ according to terrain inclination.Figure 4
Response of the yaw angleδ.The design parameters are chosen as follows:ε=0.1, k=16, λ=10, and β=10.The simulation results are illustrated through Figures2–9.Figure 5
State estimation of linear speed.Figure 6
State estimation of pitch angular speed.Figure 7
State estimation of yaw angular speed.Figure 8
Estimation of terrain inclinationα under the proposed observer.Figure 9
The control inputu under the adaptive sliding mode controller in the presence of a slope.The tracking problem studied in this paper consists to maintain the pitch angle equilibrium even in the presence of a slope and disturbances and to impose the linear displacement to track a reference trajectory. Figures2–4 attest that the tracking objective of displacement is achieved.Indeed, the two-wheeled self-balancing robot tracks well the desired trajectories (Figures2 and 4) although keeping the equilibrium of the pitch angle despite the presence of a slope (Figure 3).Figure5 shows that the linear speed traces a trapezoidal profile. Figures 6 and 7 reveal a right harmony between angular velocities and their estimates.The performance of the proposed adaptive observer to estimate the angle of terrain inclination is outstanding from Figure8. The control input vector u is on view in Figure 9 where small oscillations are recorded. It may be observed in Figure 9 that the couple Cδ is increasing after the instant 20s which corresponds to the beginning of terrain inclination. Thus, the wheeled robot continues to follow its reference trajectory despite the presence of the terrain inclination.In a more sophisticated and realistic scenario, we have added a variation of the yaw angle as it is represented in Figure10. We have also added a white noise ωt of power equal to 10−9. In addition, we have modified the external disturbances as d1t=−0.2sin3tNm, d2t=−0.2cos2tNm, and d3t=−0.3sin5tNm.Figure 10
Response of the yaw angleδ.The simulation results are illustrated through Figures11–18.Figure 11
Linear displacementx.Figure 12
Response of the pitch angleψ according to terrain inclination.Figure 13
State estimation of linear speed.Figure 14
State estimation of pitch angular speed.Figure 15
State estimation of yaw angular speed.Figure 16
Estimation of terrain inclinationα under the proposed observer.Figure 17
The torqueCψ26 under the adaptive sliding mode controller in the presence of a slope.Figure 18
The torqueCδ26 under the adaptive sliding mode controller in the presence of a slope.Figures10–12 attest that the tracking objective of displacement is obtained. Indeed, the two-wheeled self-balancing robot tracks well the desired trajectories (Figures 10 and 11) although keeping the equilibrium of the pitch angle despite the presence of a slope (Figure 12). Figure 13 shows that the linear speed traces a trapezoidal profile. Figures 14 and 15 reveal a right harmony between angular velocities and their estimates.The performance of the proposed adaptive observer to estimate the angle of terrain inclination is shown from Figure16. Figure 17 represents the torque Cψ26 which ensures the translation along the x-axis while preserving the upright position. It seems clear from Figure 18 that the couple Cδ26 increases at the instant 45s which corresponds to the beginning of the yaw angle variation. Thus, the wheeled robot continues to follow its reference trajectory despite the presence of the terrain inclination and the presence of disturbances and measurement noise.


## 5. Conclusions

In this paper, a robust adaptive observer-based sliding mode control has been proposed for the two-wheeled self-balancing robot subject to terrain inclination and disturbances. The application of the adaptive observer guarantees the simultaneous estimation of unmeasured states and the terrain inclination angle which is assumed unknown. The convergence of the proposed controller was illustrated through a Lyapunov analysis and inspired from sliding modes theory. Numerical simulations emphasize the performance of the designed control method applied to the two-wheeled self-balancing robot. In future work, we will enhance our control algorithm by using the terminal sliding mode in order to improve the convergence properties of the controller. Also, we will focus on the problem of observer based-fault tolerant control for the considered system.



---

*Source: 8853441-2021-01-07.xml*