H ∞ Time-Delayed Fractional Order Adaptive Sliding Mode Control for Two-Wheel Self-Balancing Vehicles

In this paper, a time-delayed fractional order adaptive sliding mode control algorithm is proposed for a two-wheel self-balancing vehicle system. The closed-loop system is proved based on the Lyapunov-Razumikhin function. The switching function is designed to make the system robust when facing uncertainties and external disturbances. It is designed to avoid monotonically increasing gains and can handle state-dependent uncertainties without a prior bound. The two-wheel self-balancing vehicle used in the experiment consists of a gyroscope MPU-6050 and accelerometer, a motor driving circuit composed of a motor driving chip TB6612FNG, and STM32F103x8B that is selected as the control core. The experimental results show that the time-delayed fractional order adaptive sliding mode control algorithm can make the vehicle achieve autonomous balance and quickly restore its stable state while appropriate disturbance is introduced.


Introduction
e movement principle of a two-wheel self-balancing vehicle is based mainly on the basic principle of dynamic stability. e gyroscope and acceleration sensor inside the vehicle are used to detect the changing attitude of the vehicle.
e control system is used to precisely adjust the motor to maintain the balance of the system. At present, two-wheel self-balancing vehicles are widely used in transportation, rescue, and other fields. ey have provided an effective solution to environmental pollution and energy crisis. Twowheel self-balancing vehicles have the characteristics of high order, nonlinearity, strong coupling, and underactuation. However, some uncertainties, such as mechanism friction, ground friction, changing payload, and road gradient still need to be dealt with. At present, the control algorithms used in two-wheel self-balancing vehicles include PID, neural network, mode predictive control, O control, and so on.
Sliding mode control is a branch of variable structure control that was proposed in the 1950s. It belongs to a nonlinear control that is realized through a switching function. It is insensitive to parameter changes and has the capability of rejecting interference. ere are many methods to deal with the considered external disturbance. Li investigated the problem of induced L2 disturbance attenuation control design for T-S fuzzy delta operator systems with time-varying delays via the IO approach [1]. e time delay was handled by the IO approach to facilitate the establishment of the feedback interconnection system. Based on the feedback interconnection system, a sufficient condition of asymptotical stability was obtained for the closed-loop system. e desired DOF controller was designed to guarantee the closed-loop system to be asymptotically stable with an induced L2 disturbance attenuation performance. Liu studied the finite-time H∞ control of a fractional order HTGS [2]. Based on the generalized T-S fuzzy model, the fractional order fuzzy model of a HTGS was presented. By combining finite-time control and H∞ control theory, a finite-time H∞ state feedback control was proposed for the HTGS. e control is based on the fractional order stability theorem. Gao presented a novel descriptor SMO to formulate accurate estimations of both plant states and actuator fault deviation [3]. e stability of error dynamics was analyzed and a developed stability criterion was established. e developed criterion gave a solvable solution to obtain the observer gains using convex optimization algorithm. A linear sliding surface and integral sliding surface were designed. A new SMC law was formulated with a discontinuous control input and an equivalent control to guarantee that the finite-time convergence of the plant trajectories. Liu proposed an ESO-based cascade controller for regulating the oxygen excess ratio of the PEMFC air-feed system to its desired value, using the sliding mode technique [4]. e control objective was to avoid oxygen starvation during sudden load changes. e designed cascade controller consists of oxygen excess ratio tracking outer loop and compressor flow rate regulation inner loop. e ESO was used to reconstruct the oxygen excess ratio. e outer control loop using the estimated oxygen excess ratio provided the compressor flow rate reference for the inner loop based on the STA. A simple SMC law consisting of a linear term and a switching term was designed for the inner loop.
In recent years, sliding mode control has developed rapidly in the field of two-wheel self-balancing robots. Abeygunawardhana proposed a second-order sliding mode controller based on the disturbance observer [5]. Rafael established a reference model based on a dual-relay controller for tracking control problems of a wheel pendulum. [6] Guo proposed a sliding mode controller for an underactuated system consisting of a pendulum and two wheels. [7] Based on the nonlinear dynamic model, Yue divided the whole system into three subsystems: rotational motion, longitudinal motion, and zero dynamics. [8] Within these subsystems, the inclined angle of the vehicle was treated as zero dynamics, the longitudinal acceleration was used as control input, and the sliding mode control technology was used to stabilize the zero dynamic subsystem. Li established a physical model of a two-wheel self-balancing vehicle and designed a sliding mode controller based on Newtonian mechanics. [9] Dai used the sliding mode control to achieve self-balance and pitch angle control of a double-wheel inverted pendulum robot with friction compensation. [10] Ali used a set of highly coupled nonlinear differential equations to represent the motion model of two-wheel selfbalancing robots [11]. Zhou proposed a robust integral sliding mode controller based on bounded system uncertainties with linearization error and input delay [12]. Nasim used back-stepping sliding mode to solve the problem of balancing and trajectory tracking of a two-wheel balanced mobile robot [13]. Chen proposed a robust tracking control based on a nonlinear disturbance observer for self-balanced mobile robots with unknown external disturbances [14]. Wang proposed a model-free fractional order sliding mode control based on an extended state observer, providing a framework that considered nonlinearity of friction, parameter variation, and external disturbance [15].
Designing robust controllers for uncertain time-delay systems has become a key problem. e robustness of sliding mode variable structure control makes it insensitive to the model error, changing parameters, and external disturbance. erefore, variable structure control has become an effective control method for time-delay systems. With the development of variable structure control theory, some research is available on variable structure control of time-delay systems [16,17]. Roy solved the long-standing problem of consistent stability analysis and control design in continuous time for timedelay control (TDC). Based on its newly proposed structure of TDE error, a more robust control law was formulated [18]. Roy made a number of significant contributions: proposing a novel adaptive sliding mode control (ASMC) methodology that does not require a priori bounded uncertainty [19], a novel ASMC strategy that overcomes underestimation and overestimation problems commonly observed in conventional ASMC [20], and a hybrid control methodology called a time-delay sliding mode control for accurate path tracking of nonholonomic wheeled mobile robots [21].
In this paper, an adaptive time-delay fractional order sliding mode control algorithm is proposed to control the motion of a two-wheel self-balancing vehicle. e stability of the closed-loop system is proved based on the quadratic Lyapunov function. e influence of control parameters on control performance is analyzed based on a simulation. e physical experiment of the two-wheel self-balancing vehicle is carried out to verify the effectiveness of the control algorithm.
e technique contribution of the presented control method is summarized as follows: (1) A time-delay control (TDC) algorithm is proposed. e TDC approximates the system uncertainty by using control input and state information of the immediate past time instant.
(2) A fractional order sliding mode control is designed.
Fractional order sliding mode has a memory effect and better stability. Its parameter selection range is wider and more flexible. Fractional calculus operator can obtain faster speed and higher control accuracy. It not only makes the system converge in finite time but also effectively weakens the chattering of traditional integer order sliding mode controller. (3) Adaptive switching gain of the sliding mode control is designed.

Mathematical Model of TWIP
e coordinate system is established as follows: the midpoint of the line segment connecting the centroids of two wheels is set as the origin X. e moving direction of the vehicle is set as the Y axis. e line connecting the centroids of the two wheels is set as the axis. e vertical upward direction through the origin is set as the Z axis. e motion model of the two-wheel self-balancing vehicle is shown in Figure 1.
If we denote M as the mass of vehicle, m as the mass of wheel, R as the radius of wheels, l as the distance from the centroid of the vehicle to the origin, J as the moment of inertia of the vehicle, J w as the moment of inertia of wheel, θ as the angle of inclination of the vehicle, and x m as the 2 Computational Intelligence and Neuroscience displacement of vehicle, then the kinetic energy K of the vehicle is expressed as follows: (1) e kinetic energy of wheels K w is (2) e potential energy of system is given as follows: e Lagrange function is constructed as follows: Defining u as the control input of the system, we obtain the following using the Euler-Lagrange formula: Substituting (4) into (5), we obtain Substituting (4) into (6), we obtain d dt By simplifying and linearizing (6) and (7), we obtain Computational Intelligence and Neuroscience e state variables are given as follows: Define the input matrix as follows: us, the state space can be written as follows: Considering the existence of external disturbance d, the system dynamics can be written as follows: If we define then (15) can be written as follows:

Fractional Order Calculus.
Fractional calculus is the operation of derivatives and integrals extended to the fractional order. It actually provides a more precise tool for describing physical systems. e Riemann-Liouville (RL) fractional differintegral is one of its most common definitions. For a function x that is defined in [t 0 , t], the RL fractional integrator is defined as follows [22]: where α is the fractional order, τ is the integral variable, and Γ(x) is the gamma function that is defined as follows: e RL fractional derivative is defined as follows: where α ∈ [m − 1, m) and m is a positive integer near α.

e Proposed Algorithm. Let x d be the desired state and
x be the state error: en, the following sliding mode surface function can be constructed: where 0 < α < 1, c > 0. Taking the derivative of formula (23) yields Substituting (22) into (24), one can obtain Substituting (21) into (25), one can obtain Denote h as the time delay. e TDC approximates the system uncertainty by using control input and state information of the immediate past time instant. en, (18) can be written as follows: e adaptive control law is constructed as follows: e switching gain satisfies where α 0 > 0, α 1 > 0, K 0 (t) > 0, K 1 (t) > 0.

Stability Analysis
Theorem 1. Based on the Lyapunov's stability theory, considering the kinematics equation (14) of a two-wheel selfbalancing vehicle system with input delay and the adaptive sliding mode controller (28)-(31), the tracking error of the system converges and the system becomes uniform ultimate bounded.
It can be deduced that when t). V(E, t) will enter inside the ball in a finite time. From (41), it can be deduced that selecting small α 0 , α 1 can reduce the size of the ball. erefore, Based on the Lyapunov stability theory, V(E, t) will enter inside the ball in finite time. e system is uniform ultimate bounded and independent of initial conditions. A performance index is proposed to evaluate the parameters of the controller. It consists of the integration of the input and the error between the expected state and the output state. e integral interval should be large enough. e performance index J is defined as follows: Adjust the appropriate control parameters to reduce the performance index as much as possible.

Example Introduction.
In order to verify the control effect of the adaptive sliding mode control algorithm for two-wheel self-balancing vehicles with input delay, the main parameters of the two-wheel self-balancing vehicle used for testing are listed in Table 1.

Simulation Results.
e experiments were carried out on Intel (R) Core (TM) i3-4150T CPU @ 3.00 GHz 3.00 GHz, a 64-bit operating system with 4.00 GB memory and an x64based processor. e initial inclination angle of the system was 45 。 . e initial angular velocity was 0 degrees/s. e initial displacement was 0.2 m. e initial velocity was 0 m/s. e desired inclination angle was set to be 0 degrees. e desired angular velocity was 0 degrees/s. e desired displacement was 0 m. e desired velocity was 0 m/s.   Figure 4 shows the speed response curve of control input. e horizontal axis represents time in seconds, and the longitudinal axis represents the control input in N·m. Figures 2-4 show that the adaptive sliding mode control can make the vehicle achieve autonomous balance.

Performance Comparison of Different Algorithms.
In order to verify the effectiveness of the proposed algorithm, the control effects of the proposed algorithm are compared with other algorithms. e remaining parameters remain unchanged. Figure 5 shows   Figure 7 shows the speed response curve of control input of different algorithms. e horizontal axis represents time in seconds, and the longitudinal axis represents the control input in N·m. Figures 5-7 show that, compared with other algorithms, the proposed algorithm can achieve less adjustment time and require less control input.     Figure 10 shows the speed response curve of control input under disturbance. e horizontal axis represents time in seconds, and the longitudinal axis represents the control input in N·m. Figures 8-10 show when appropriate disturbance is introduced, the vehicle can adjust itself and quickly restore its stable state.

Experiment Results
In this experiment, gyroscope MPU-6050 and accelerometer constituted a vehicle attitude detection device for a twowheel self-balancing vehicle. A motor driving circuit was composed of a TB6612FNG chip. Fusion of the gyroscope data and accelerometer data was completed using a Kalman filter. e system used STM32F103x8B as the control core and completed processing of a sensor signal, realization of a filtering algorithm, body control, human-computer interaction, and so on. e vehicle could achieve autonomous balance without any intervention. When introducing appropriate disturbance, the vehicle could adjust itself and quickly restore its stable state. e vehicle could also complete basic movements, such as forward, backward, left turn, and right turn. Figure 11 is a photo of the two-wheel self-balancing vehicle system. e control circuit included ARM, three attitude sensors, filtering circuits, power circuit, power supply voltage conversion, and voltage stabilization. Its acceleration was measured by accelerometer, and the rotation angular velocity was measured by gyroscope. e motor used 7.4V DC. Figure 12 shows the acceleration curve measured with an acceleration sensor. e horizontal axis represents time in seconds, and the longitudinal axis represents the acceleration in m/s 2 .     Computational Intelligence and Neuroscience Figure 13 shows the angular velocity of rotation measured by a gyroscope. e horizontal axis represents time in seconds, and the longitudinal axis represents the angular velocity in°/s. Figure 14 shows acceleration, rotation angular velocity, and filtering curve. e horizontal axis represents time in seconds. e red line represents the acceleration in m/s 2 . e green line represents the angular velocity in°/s. e blue line represents the Klaman filtered acceleration in m/s 2 . Figures 12 to 14 show that the vehicle can adjust itself and restore its stability rapidly with the introduction of appropriate disturbance.

Conclusion
In this paper, a time-delayed fractional order adaptive sliding mode control algorithm for a two-wheel self-balancing vehicle system with input delay is proposed, and the stability of the closed-loop system is proved. e experimental results show that the adaptive sliding mode control algorithm can make the car achieve autonomous balance. When appropriate disturbance is introduced, the vehicle can adjust itself and quickly restore its stable state. e next step in research should be to improve the control algorithm to better control accuracy and robustness of the two-wheel self-balancing vehicle.

Data Availability
All data, models, or codes generated or used during the study are available from the corresponding author by request. Most data and models generated or used during the study appear in the submitted article.

Conflicts of Interest
e authors declare that they have no financial and personal relationships with other people or organizations that can inappropriately influence this work. ere is no professional or other personal interest of any nature or kind in any product, service, and company that could be construed as influencing the position presented in the manuscript.