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

-is 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.-en, 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. -e 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. -e 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.


Introduction
e 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. e 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. e 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. e 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. ese 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. e 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. e 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. e 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. is invites researchers to design controllers in order to control the stability of the two-wheeled self-balancing robot moving on an inclined terrain [30][31][32][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. e 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. e 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. e 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. e 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. en, 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. e 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. e 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 analysis e remainder of the paper is organized as follows. e 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 Section 3. 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. I n is an identity matrix with n × n dimension. 0 n×m is a null matrix with n rows and m columns. λ max (M) and λ min (M) denote, respectively, the maximum and the minimum eigenvalue of M. diag(M 1 , . . . , M n ) represents the block-diagonal matrix �

Model of a Two-Wheeled Self-Balancing
Robot. e two-wheeled self-balancing robot is an underactuated system, and it has fewer actuators (2 actuators) than degrees of freedom (3 degree of freedom). e dynamics of this robot is similar to that of a pendulum cart. In fact, the two-wheeled torques C L and C R are transformed, using a decoupling unit, into two torques C δ and C ψ . e 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][43][44], the model of the two-wheeled self-balancing robot is as follows: where x, ψ, and δ represent, respectively, the linear displacement of the chassis, the pitch angle, and the yaw angle.
Mathematical Problems in Engineering J p 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 J r is the moment of inertia of the wheel. M p 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 M r is its mass.
ρ � α is the angle of terrain inclination, which is assumed unknown and which will be estimated later through an adaptive observer.

Problem formulation.
e 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. ese 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. us, having an instantaneous knowledge of the terrain inclination angle could be lucrative to keep the performance of the adopted control law. e 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 ρ � α. at is, en, the estimated states x(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: where x r (t) is the reference trajectory.

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 input u, the state x is assumed bounded. Moreover, the unknown parameter ρ is also assumed to be bounded and slowly varying, that is, It is to be noticed that some physical autonomous systems such as chaotic systems verify the boundedness assumption of the trajectories naturally (Assumption 1). 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 Assumption 1, let (u, x, ρ) ∈ (U, X, Θ), where U ⊂ R 2 , X ⊂ R 6 , and Θ ⊂ R are three compact sets. For the two-wheeled self-balancing robot system, the nonlinearities F(x, ρ) and G(x, ρ) 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 In this way, the trajectories of the wheeled robot system (46) coincide with those of the following system: where 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.

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: , and x � x 1 x 2 .
Conforming to [40], the adaptive observer developed for system (6) is given by and S is the unique solution of the following algebraic Lyapunov equation: where S is the symmetric positive definite (SPD) and the matrix (A − S − 1 C T C) 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 trajectory (x, tρ) ∈ X × Ω, the matrix CΥ(t) must satisfy the condition of persistent excitation, and it means: e 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 d(t), together with the adaptive observer (7), under Assumptions 1 and 2.
en, 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.
e proof of Proposition 1 is mainly based on the proof of eorem 3.1 in [40] while taking into account the presence of the disturbance d(t). We consider the Lyapunov function where Proceeding as in eorem 3.1 in [40] and taking into account the presence of the perturbation term d(t), one may obtain where we recall that ζ is a positive constant such that, for all t ≥ 0, |d(t)| ≤ ζ and where c 1 and c 2 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 eorem 3.1 in [40]). Next, from the last inequality (11), we deduce that as long as If ����� W(0) ≥ 2|B|ζμ − 1 ������ � λ max (S)θ − 1 , Ω(t) and ρ(t) will decrease exponentially such that Consequently, there exists a finite time T a such that for We have 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.

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. e problem of trajectory tracking consists to determine the control law u which insures the convergence of the state vector x 1 � x ψ δ T to the reference vector x r � x r ψ r δ r T with a tracking error on the first component of the state vector: 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] We select the sliding variables vector as follows: 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): where k is a positive constant. However, the presence of the discontinuous function, in the sliding mode control, gives rise to the well-known chattering 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]. en, we rather consider the following "continuously implemented sliding mode controller" instead of (20): where [G(x, tρ)] + represents the pseudoinverse matrix of G(x, tρ). β 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, that S(t) 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. en, S(t) 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: Differentiating this function and referring to (19), one obtains Let Now, replacing the control input vector u by its expression described in (21), one has At this stage, it is needful to prove the boundedness of η (x, x, ρ, ρ) and _ x 2 in order to admit the convergence S(t). Let us first prove the boundedness of η(x, x, ρ, ρ). We have is can be written as Tacking into account that F(x, ρ) and G(x, ρ) are Lipschitz with respect to x uniformly in ρ and F(x, tρ) and G(x, tρ) are Lipschitz with respect to ρ uniformly in x, we can write that where k F , k G , k u , 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) Next, we need to show the boundedness of _ x 2 . To that end, conforming to [40], taking into account the presence of the disturbance term d(t) and using (7), we have We set x c � Δ c x and Δ c � θI 3 0 3 0 3 I 3 . Referring to (30) and tacking into account that Δ c AΔ − 1 c � θA and CΔ c � C, we get Hence, where A is Hurwitz, and _ W is bounded. In fact, we recall that x(t), u(t), d(t), and ρ(t) are assumed to be bounded. Furthermore, zg/zx and zf/zx are bounded because f and g are assumed continuously differentiable. erefore, according to eorem 1 of [47], we can conclude that lim θ⟶+∞ _ x c � 0. As a result, lim θ⟶+∞ _ x 1 � 0 and lim θ⟶+∞ _ x 2 � 0. Now, let k 2 > 0 and k 2 > 0 such that |x 2 (t)| ≤ k 2 and | _ x 2 (t)| ≤ k 2 .
Returning to (25) and using (29), we deduce that Two-wheeled self-balancing robot Adaptive observer Sliding mode control

Mathematical Problems in Engineering
Supposing k s � k 2 + λk 2 + k η + ζ, one obtains Choosing k sufficiently large such that k > k s , we have As long as βV(S(t)) ≥ k s ε, i.e, V(S(t)) ≥ k s ε/β, we have _ V(S(t)) ≤ − βV(S(t)). en, if V(S(t)) ≥ k s ε/β, S(t) will be exponentially decreasing, and there exists a finite time T s such that, for all t ≥ T s , (V(S(t)) ≤ )k s ε/β, which means that, for all t ≥ T s , we have which means that S(t) is uniformly bounded and its upper bound (2k s ε/β) 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. en, 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 Let us consider the Lyapunov function V 1 � e T P 1 e; its derivative is given by Using (37), this allows to obtain

Mathematical Problems in Engineering
Reminding that |x 2 (t)| ≤ k 2 and using (36), one obtains where and (40) can be written as Hence, as long as λ ), which means that V 1 (e(t)) will be decreasing exponentially fast until V 1 (e(t)) < (c 3 /λ) 2 after a finite time T f2 .
Since λ min (P 1 )|e(t)| 2 ≤ V 1 (e(t)), we have By considering the expression (41) of the constant c 3 , 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 matrix S and the solution of the algebraic Lyapunov equation (8). e latter equation (8) is solvable for S as long as the pair (A, C) is observable, which is the case for the two-wheeled selfbalancing robot considered in this paper. For the choice of S, we solve the equation S + A T S + SA − C T C � 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). Mathematical Problems in Engineering 9 Step 3: we choose a large value of the design parameter β and a small value of the parameter ε such that Step 4: we select a positive parameter λ according to the reference tracking priority that we should to give to the state x 1 or x 2 .
Step 5: we choose a sufficiently large parameter k such that k > k s with k s � k 2 + λk 2 + k η + ζ, where ζ, k 2 , and k 2 are, respectively, the upper bounds of the disturbance d(t), the state x 2 (t), and its derivative _ x 2 (t); k η is the upper-bound of the signal η(x, x, ρ, ρ) given by equation (29).
Step 6: we compute the pseudoinverse [G(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]. e 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.

Numerical Simulations
In this section, the numerical simulations carried out using Matlab/Simulink software, applied on the two-wheeled self-balancing robot, are performed to highlight the effectiveness of the proposed adaptive sliding mode controller.
e simulation results are illustrated through Figures 2-9. e 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. Figures 2-4 attest that the tracking objective of displacement is achieved.
Indeed, the two-wheeled self-balancing robot tracks well the desired trajectories (Figures 2 and 4) although keeping the equilibrium of the pitch angle despite the presence of a slope (Figure 3). Figure 5 shows that the linear speed traces a trapezoidal profile. Figures 6 and 7 reveal a right harmony between angular velocities and their estimates. e performance of the proposed adaptive observer to estimate the angle of terrain inclination is outstanding from Figure 8. e 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 20 s which corresponds to the beginning of terrain inclination. us, 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 Figure 10. We have also added a white noise ω(t) of power equal to 10 − 9 . In addition, we have modified the external   e simulation results are illustrated through Figures 11-18. Figures 10-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. e performance of the proposed adaptive observer to estimate the angle of terrain inclination is shown from Figure 16. 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 45 s which corresponds to the beginning of the yaw angle variation. us, the wheeled robot continues to follow its reference trajectory despite the presence of the terrain inclination and the presence of disturbances and measurement noise.

Conclusions
In this paper, a robust adaptive observer-based sliding mode control has been proposed for the two-wheeled selfbalancing robot subject to terrain inclination and disturbances. e application of the adaptive observer guarantees the simultaneous estimation of unmeasured states and the terrain inclination angle which is assumed unknown. e 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.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.