Indoor Autonomous Control of a Two-Wheeled Inverted Pendulum Vehicle Using Ultra Wide Band Technology

In this paper, we aimed to achieve the indoor tracking control of a two-wheeled inverted pendulum (TWIP) vehicle. The attitude data are acquired from a low cost micro inertial measurement unit (IMU), and the ultra-wideband (UWB) technology is utilized to obtain an accurate estimation of the TWIP’s position. We propose a dual-loop control method to realize the simultaneous balance and trajectory tracking control for the TWIP vehicle. A robust adaptive second-order sliding mode control (2-RASMC) method based on an improved super-twisting (STW) algorithm is investigated to obtain the control laws, followed by several simulations to verify its robustness. The outer loop controller is designed using the idea of backstepping. Moreover, three typical trajectories, including a circle, a trifolium and a hexagon, have been designed to prove the adaptability of the control combinations. Six different combinations of inner and outer loop control algorithms have been compared, and the characteristics of inner and outer loop algorithm combinations have been analyzed. Simulation results demonstrate its tracking performance and thus verify the validity of the proposed control methods. Trajectory tracking experiments in a real indoor environment have been performed using our experimental vehicle to further validate the feasibility of the proposed algorithm in practice.


Introduction
Two-wheeled inverted pendulum (TWIP) vehicles are a popular test platform to validate the performance of advanced control algorithms, such as the control capacity for nonlinear, instability and rapidity situations. The motion of a TWIP vehicle is governed by its under-actuated configuration, which makes it difficult to control by simply applying traditional robotics approaches [1]. In recent years, control design for the stability and robustness of TWIP vehicles has attracted great research interest. In [2], a neural network control method was proposed for an under-actuated wheeled inverted pendulum model with small overshoot and quick response to changes in the desired trajectories. In [3], adaptive backstepping control for a two-wheeled autonomous robot around an operating point was investigated. In [4], an adaptation concept was brought into neural network control, which demonstrated the yaw angle and pitch angle convergence time was less than 0.4 s with an initial value of 0.3 rad.
The sliding mode control (SMC) method was first proposed by Soviet scholars in the 1960s. The SMC method has some advantages such as robustness to parameter uncertainty, insensitivity to bounded disturbances, fast dynamic response, a remarkable computational simplicity with respect The control system configuration of our testbed is illustrated in Figure 2. The attitude data of the TWIP vehicle is measured via the onboard IMU, the location information of the TWIP vehicle is measured by an onboard UWB receiver and used to control the motion of the vehicle. In Figure 2, A0, A1, A2 and A3 are four UWB positioning technology anchors, T0 is a UWB receiver used as an onboard tag. The TWIP vehicle can communicate with both cellphones and laptops via Bluetooth devices.
This paper is organized as follows: in Section 2, the nonlinear dynamic model of the TWIP vehicle is established using a Lagrange energy equation. In Section 3, inner and outer loop controllers are designed, and necessary stability considerations are discussed. Then the feasibility and effectiveness of the different control methods are compared by MATLAB simulation in Section 4, followed by the conclusions in Section 5. The configuration of an experimental set-up of the TWIP vehicle and the results are given in Section 6. The control system configuration of our testbed is illustrated in Figure 2. The attitude data of the TWIP vehicle is measured via the onboard IMU, the location information of the TWIP vehicle is measured by an onboard UWB receiver and used to control the motion of the vehicle. In Figure 2, A0, A1, A2 and A3 are four UWB positioning technology anchors, T0 is a UWB receiver used as an onboard tag. The TWIP vehicle can communicate with both cellphones and laptops via Bluetooth devices.
This paper is organized as follows: in Section 2, the nonlinear dynamic model of the TWIP vehicle is established using a Lagrange energy equation. In Section 3, inner and outer loop controllers are designed, and necessary stability considerations are discussed. Then the feasibility and effectiveness of the different control methods are compared by MATLAB simulation in Section 4, followed by the conclusions in Section 5. The configuration of an experimental set-up of the TWIP vehicle and the results are given in Section 6.

Related Work
A second-order adaptive sliding mode control method based on STW algorithm was proposed for the control of an under-actuated system in [15], which performed better effectiveness and reduced chattering compared with conventional SMC and ordinary second-order SMC. However, the adaptive sliding mode control method is not very effective for a controller of multi-control parameters. In [16], the structure of the inner/outer loop control system has been used in simultaneous balancing and trajectory tracking control for two-wheeled inverted pendulum vehicles, and two trajectories, including a circle and a trifolium have been designed for tracking. For the purpose of controlling the TWIP vehicle, an inner/outer loop control structure and a second-order STW algorithm have been also used in this paper. We proposed a different adaptive control method in this paper to keep convergence of sliding mode surface under unknown disturbances. What's more, three typical trajectories, including a circle, a trifolium and a hexagon, have been designed to prove the adaptability of our controller.

System Description and Modeling
The motion of the TWIP vehicle is described under an inertial coordinate system. The simplified schematic diagram and the two-dimensional plan view of the vehicle are shown in Figure 3.

Related Work
A second-order adaptive sliding mode control method based on STW algorithm was proposed for the control of an under-actuated system in [15], which performed better effectiveness and reduced chattering compared with conventional SMC and ordinary second-order SMC. However, the adaptive sliding mode control method is not very effective for a controller of multi-control parameters. In [16], the structure of the inner/outer loop control system has been used in simultaneous balancing and trajectory tracking control for two-wheeled inverted pendulum vehicles, and two trajectories, including a circle and a trifolium have been designed for tracking. For the purpose of controlling the TWIP vehicle, an inner/outer loop control structure and a second-order STW algorithm have been also used in this paper. We proposed a different adaptive control method in this paper to keep convergence of sliding mode surface under unknown disturbances. What's more, three typical trajectories, including a circle, a trifolium and a hexagon, have been designed to prove the adaptability of our controller.

System Description and Modeling
The motion of the TWIP vehicle is described under an inertial coordinate system. The simplified schematic diagram and the two-dimensional plan view of the vehicle are shown in Figure 3.

Related Work
A second-order adaptive sliding mode control method based on STW algorithm was proposed for the control of an under-actuated system in [15], which performed better effectiveness and reduced chattering compared with conventional SMC and ordinary second-order SMC. However, the adaptive sliding mode control method is not very effective for a controller of multi-control parameters. In [16], the structure of the inner/outer loop control system has been used in simultaneous balancing and trajectory tracking control for two-wheeled inverted pendulum vehicles, and two trajectories, including a circle and a trifolium have been designed for tracking. For the purpose of controlling the TWIP vehicle, an inner/outer loop control structure and a second-order STW algorithm have been also used in this paper. We proposed a different adaptive control method in this paper to keep convergence of sliding mode surface under unknown disturbances. What's more, three typical trajectories, including a circle, a trifolium and a hexagon, have been designed to prove the adaptability of our controller.

System Description and Modeling
The motion of the TWIP vehicle is described under an inertial coordinate system. The simplified schematic diagram and the two-dimensional plan view of the vehicle are shown in Figure 3.   The origin O of the fixed coordinate system OXY is the center of the axle, the positive direction of OX-axis is the forward motion of TWIP, OY-axis is coincident with the axle, the positive direction of OZ-axis is vertically upward. The parameters and variables of the system are shown in Table 1. During the motion process of our two-wheeled vehicle, since there are only two points contacting with the ground, and the body has a motion similar to inverted pendulum motion, we can make a few assumptions in order to build dynamic model for the system: (1) There exists sufficient friction between the wheels and the ground, which makes the system subject to non-holonomic constraints, i.e., the assumption of no sliding and skidding holds throughout. (2) Take the TWIP vehicle as a perfectly rigid body, the distance from the center of mass of the body to the axle is l; (3) The influence caused by the dynamic characteristics of DC motors is ignored; (4) Ignore the effects caused by friction and damping force of bearings and revolute pairs to the motion state of the system. In the paper, we adopt the Lagrange energy equation to build the kinematic model of the two-wheeled car. In order to eliminate the effect caused by the non-holonomic constraint, we choose q = [θ l θ r θ] T as the generalized coordinates system, then the kinematic model of the two-wheeled car can be written in the following form: where, M(q) ∈ R 3×3 denotes the inertia matrix, V q, . q ∈ R 3×3 is the vector of coriolis and centrifugal forces G(q) ∈ R 3 is the vector of gravitational forces, B(q) ∈ R 3×2 denotes the matrix of control coefficients, u ∈ R 2 is the vector of control inputs. Then the dynamics of the system can be formulated as follows: where: In order to simplify the controller design, the state-space equations can be derived from (3): . . . . where: is known as the system state. u = (τ ω τ v ) T is the system control input, and

Design of the Controller
An inner/outer loop controller needs to be designed to make the vehicle achieve trajectory tracking on the ground while maintaining its own balance. The structure of the designed inner/outer loop control system is shown in Figure 4. The inner loop control consists of two control subsystems: the rotational velocity control subsystem and the longitudinal velocity and balance control subsystem. v d , ω v are defined as the desired value of the longitudinal velocity v and the rotational velocity ω respectively. And the tracking errors of v and ω are introduced as e v = v − v d , e ω = ω − ω d . A reference trajectory is known in prior as x r (t), y r (t), δ r (t), and the control laws of v d and ω d are given by the outer loop controller.

Inner Loop Controller Design
Considering the desired inclination angle θ d = 0, a set of error state-space equations can be obtained as follows:

The Rotational Velocity Control
It is well known that the classical discontinuous sliding mode control provides finite-time convergence for a system of relative degree one. As the rotational velocity control subsystem (7) has a relative degree equal to two, a sliding surface is needed when using STW algorithm.
The tracking error of δ is introduced as e δ = δ r -. And the equilibrium point of system (7) can be defined as . Defining a traditional linear sliding surface s 1 as: 1 1 s ce e     (10) where, c 1 is a positive constant. Differentiating (10) with respect to time, it follows that: where, The continuous control law τ w is constituted by two terms. The first is defined by means of its discontinuous time derivative, while the other is a continuous function of the available sliding surface s 1 .
Assume that there exists a bounded time-variable disturbance signal   1 d t in the system (7), which satisfies , L is a Lipschitz constant. According to the STW algorithm [10], the control law of τ w can be obtained as follows: Theorem 1. According to the convergent method proposed in [17], when k 1 > 2, k 2 > ( k 1 ) k 1 ( k 1 ) , the states of system (7) can reach s 1 =s 1 =0 in finite time, and converge to origin.

Inner Loop Controller Design
Considering the desired inclination angle θ d = 0, a set of error state-space equations can be obtained as follows: . . . .

The Rotational Velocity Control
It is well known that the classical discontinuous sliding mode control provides finite-time convergence for a system of relative degree one. As the rotational velocity control subsystem (7) has a relative degree equal to two, a sliding surface is needed when using STW algorithm.
The tracking error of δ is introduced as e δ = δ r − δ. And the equilibrium point of system (7) can be defined as X e1 = [e δ e ω ] T = [0 0] T . Defining a traditional linear sliding surface s 1 as: where, c 1 is a positive constant. Differentiating (10) with respect to time, it follows that: . where, . ω d . The continuous control law τ w is constituted by two terms. The first is defined by means of its discontinuous time derivative, while the other is a continuous function of the available sliding surface s 1 .
Assume that there exists a bounded time-variable disturbance signal d 1 (t) in the system (7), which satisfies . d 1 (t) ≤ L, L is a Lipschitz constant. According to the STW algorithm [10], the control law of τ ω can be obtained as follows: Theorem 1. According to the convergent method proposed in [17], when k 1 > 2, k 2 > Due to its ingenious design, simple algorithm structure and good control effect, hierarchical sliding mode control theory is widely used in complex under-actuated systems control [18][19][20]. Therefore, we adopt the hierarchical sliding mode surface to design the control law of τ v .
In order to design control strategy, two traditional linear sliding mode surfaces with known positive constants c 2 and c 3 are defined as: Differentiating s 2 and s 3 with respect to time, we can obtain: .
A control law based on piecewise linear hierarchical sliding mode control method needs to be changed occasionally, bringing in severe oscillation during the control process. In view of the decoupled sliding-mode control method introduced in [21], a hierarchical sliding mode control method based on model analysis is proposed.
The first layer sliding mode surface s 2 and s 3 is used to construct the second layer sliding mode surface S. Define the second layer sliding mode surface S as: Differentiating (15) with respect to time and then: . (8) and (9), which satisfies . d 2 (t) ≤ L 2 , L 2 is a Lipschitz constant. Similar to the analysis of rotational angle control, the 2-SMC control law for the longitudinal velocity and balance control subsystems (8) and (9) can be deduced as follows: where, S is the sliding mode surface of the control subsystem.
Theorem 2. According to Theorem 1, when k 3 > 2, k 4 > Proof. The process to prove the subsystems (8) and (9) can reach S = . S = 0 is similar to Theorem 1's, so for simplicity, the proof is omitted here. Suppose that s 2 > 0 at a moment before the system return back to the equilibrium position. A negative control input τ v is given to push s 2 to zero, that is, . s 2 < 0. At this moment, under the same negative control input, s 3 < 0 and . s 3 > 0. Since α is chosen as a positive constant, when S converges to 0, s 2 and s 3 can always satisfy the condition that s 2 > 0, s 3 < 0, and gradually converge to 0 and vice versa. It can be concluded that subsystems (8) and (9) will converge to e xv = e v = θ = . θ = 0 in exponential form.

Robust Adaptive 2-SMC (2-RASMC)
Considering the rotational velocity control subsystem (7), when f 1 (x), g 1 (x) are unknown functions, defining a new coordinate vector z = s 1 , the system model can be written as the following form: .
where g 1 (x) is assumed strict positivity without loss of generality, ω d + c 1 e ω and g 1 (x) are bounded unknown functions, and satisfying the following inequalities with positive constants As the system model contains uncertain part, the control input τ w can be designed as two parts: where, τ wnom is the nominal part of τ w , and τ wcom is the compensation control part of τ w . The nominal system model (ψ(x) = 0) can be obtained as: According to Theorem 2, the control system (22) is asymptotically stable and reach z = . z = 0 within finite time with the following control law of τ wnom (23): In view of an adaptive sliding mode control method introduced in [19], an adaptive sliding mode control law of τ wcom is proposed, with which the system perturbation can be compensated. Firstly, an auxiliary variable z aux ∈ R is introduced and satisfying . z aux = −τ ωcom , then define a sliding mode variable σ(z) ∈ R as: Differentiating (24) with respect to time, it is easily obtained that: .
τ ω is the total uncertainty of the system, and satisfying |a(x, τ ω )| < r 1 , where r 1 is an unknown positive constant. Let us considerr 1 as the estimation of true value r 1 , and consequently an estimated error can be governed by r 1 =r 1 − r 1 . In addition, considering the fact that a(x, τ ω ) is exhibiting slow time-varying behaviors, then, it holds that . r 1 ≈r 1 . The compensation control law for the subsystem can be given by: with the adaptive law as follows: .
Theorem 3. Consider the given dynamic sliding mode (24) with the nominal controller (23) and the compensation controller(26), the sliding mode variable σ = 0 can be guaranteed in finite time.
Proof. Consider a positive Lyapunov candidate as: By differentiating V with respect to time and considering . r 1 ≈ . r 1 , it holds that: .
Similar to the above analysis, we can deduce the robust adaptive 2-SMC control law for the longitudinal velocity and balance control subsystems (8) and (9) as follows: where, S is the sliding mode surface (15) of the control subsystem.
Theorem 4. According to Theorems 2 and 3, when k 3 > 0, k 4 > 0, γ 2 > 0, the state of systems (8) and (9) can reach S = . S = 0 with the control law (31), and converge to origin in finite time. The proof process is similar with above and is omitted here.

Comparative Simulations for the Robust Performance
In this section, a comparative simulation has been done to verify the robustness of the modified 2-RASMC control method. Since the 2-RASMC controller is based on the 2-SMC controller, they share the same control parameters, except two additional parameters γ 1 and γ 2 . We have done a lot of simulations to find the appropriate control parameters of the designed controller.
Set ω d = 0.5 rad/s, v d = 0.5 m/s as the control target for the 2-RASMC controller. Then the initial state variables are supposed as Figure 5 depicts the control performance of our controller for tracking the descried ω d and v d with six different sets of designed parameters as Table 2 shows. Figure 5 shows the control performance of case1~case6 without system uncertainty. It can be concluded that the controllers have the same control performance when the control parameters of the nominal controllers are the same. It can be easily obtained that case 1 and case 2 have the best control performance.   During the process of tuning the control parameters, we have found the effects of the controller parameters on control performance. The increases of 1

Control Parameter
contribute to the faster convergence speed, and make overshoot volume increase. However, the increase of 2 c contributes to bigger overshoot volume and longer settling time of θ, and bigger  During the process of tuning the control parameters, we have found the effects of the controller parameters on control performance. The increases of c 1 , α, k 1 , k 2 , k 3 and k 4 contribute to the faster convergence speed, and make overshoot volume increase. However, the increase of c 2 contributes to bigger overshoot volume and longer settling time of θ, and bigger overshoot volume and shorter settling time of v. The increase of c 3 makes overshoot volume of θ decrease, overshoot volume of v increase, and slows down the convergence speed of θ and v.
Then we will consider the control performance of case1 and case2 with system uncertainty. We assumed that the mass of the body is considered as a variable value in the simulation: m = 2, t ≤ 10 s 5, t > 10 s Figure 6 shows the simulation results of case1 and case2. Then we will consider the control performance of case1 and case2 with system uncertainty. We assumed that the mass of the body is considered as a variable value in the simulation: 10 s 5, 10 s t m t Figure 6 shows the simulation results of case1 and case2. It can be seen that case2 has better robustness than case1, so we choose the same control parameters as case2. The designed parameters of the inner loop controller are shown in Table 3. Table 3. The designed parameters of the inner loop controller.

Control Parameter
Set ω d = 0.5 rad/s, v d = 0.5 m/s as the control target for our inner loop controller. Then the initial state variables are supposed as In order to verify the robustness of the two controllers, the mass of the body is considered as a variable value in the simulation: 10 s 3, 10 s t m t Figure 7 shows the simulation results. It can be seen that case2 has better robustness than case1, so we choose the same control parameters as case2. The designed parameters of the inner loop controller are shown in Table 3.  It can be seen that case2 has better robustness than case1, so we choose the same control parameters as case2. The designed parameters of the inner loop controller are shown in Table 3.
In order to verify the robustness of the two controllers, the mass of the body is considered as a variable value in the simulation: 10 s 3, 10 s t m t Figure 7 shows the simulation results.  Comparing Figure 7a,b,e with Figure 7c,f, it can be concluded that the robust performance of the control law of ω is much better than that of the control law of v in the 2-SMC controller. Considering Figure 7a,b,e, it can be easily seen that the state variables of the subsystems (8) and (9) in the 2-SMC controller oscillates near the equilibrium point after t > 10 s, while the control performance of the 2-RASMC controller is almost unaffected.
By increasing the value of m, the comparison of the robust performance of the two controllers will be more obvious. Set the value of m as Comparing Figure 7a,b,e with Figure 7c,f, it can be concluded that the robust performance of the control law of ω is much better than that of the control law of v in the 2-SMC controller. Considering Figure 7a,b,e, it can be easily seen that the state variables of the subsystems (8) and (9) in the 2-SMC controller oscillates near the equilibrium point after t > 10 s, while the control performance of the 2-RASMC controller is almost unaffected.
By increasing the value of m, the comparison of the robust performance of the two controllers will be more obvious. Set the value of m as m = 2, t ≤ 10 s 5, t > 10 s , then the simulation result is shown as Figure 8. Comparing Figure 7a,b,e with Figure 7c,f, it can be concluded that the robust performance of the control law of ω is much better than that of the control law of v in the 2-SMC controller. Considering Figure 7a,b,e, it can be easily seen that the state variables of the subsystems (8) and (9) in the 2-SMC controller oscillates near the equilibrium point after t > 10 s, while the control performance of the 2-RASMC controller is almost unaffected.
By increasing the value of m, the comparison of the robust performance of the two controllers will be more obvious. Set the value of m as From Figure 8, we can see the control performance of the 2-SMC controller becomes terrible after t > 10 s, while the 2-RASMC controller still maintains good control performance although the degree of system uncertainty is exacerbated. Combining Figures 7 and 8, it can be observed that the 2-RASMC controller has better robustness.

Outer Loop Controller Design
The motion states of the TWIP vehicle on x-y plane are described by the center position of its wheel axis O (x, y) and the heading angle δ as shown in Figure 9. Defining Defining x r , y r and δ r as the reference trajectory in the earth fixed coordinate system, then the reference longitudinal v r and rotational velocities ω r can be calculated in prior respectively. The position and orientation errors are defined as: Differentiating (33) with respect to time, the tracking error dynamics can be obtained as: From Figure 8, we can see the control performance of the 2-SMC controller becomes terrible after t > 10 s, while the 2-RASMC controller still maintains good control performance although the degree of system uncertainty is exacerbated. Combining Figures 7 and 8, it can be observed that the 2-RASMC controller has better robustness.

Outer Loop Controller Design
The motion states of the TWIP vehicle on x-y plane are described by the center position of its wheel axis O (x, y) and the heading angle δ as shown in Figure 9. Defining p = [x y δ] T , q = [v ω] T , the kinematic equations of the vehicle can be obtained as: Defining x r , y r and δ r as the reference trajectory in the earth fixed coordinate system, then the reference longitudinal v r and rotational velocities ω r can be calculated in prior respectively. The position and orientation errors are defined as: Differentiating (33) with respect to time, the tracking error dynamics can be obtained as: Backstepping control method is often used to deal with underactuated stabilization. Backstepping has good tracking performance, fast response time without overshoot and is suitable for online control. Therefore, we design the outer-loop controller using the idea of backstepping.
Take x e as a virtual control variable, the new error variable is defined as: When x e → 0 and δ e → 0 , according to Equation (35): . y e = −x e ω = −λ 1 ωtanh(ω)y e , λ 1 > 0 (36) Backstepping control method is often used to deal with underactuated stabilization. Backstepping has good tracking performance, fast response time without overshoot and is suitable for online control. Therefore, we design the outer-loop controller using the idea of backstepping. Take where, λ1, λ2, λ3 and λ4 are the designed positive constants.

Lemma 1.
For all x ∈ R, and the absolute value of x is bounded, there is φ(x) = xtanh(x) ≥ 0, if and only if x = 0 the equality holds. So, when t→ ∞, y e exponentially converges to zero, thus x e →0. Adopting backstepping control method, the control law is deduced as follows: where, λ 1 , λ 2 , λ 3 and λ 4 are the designed positive constants.
Theorem 5. The control system (34) is stable, and the posture errors are asymptotically stable with the backstepping control law (37).
Proof. First, define a Lyapunov candidate as: Differentiating Equation (38) with respect to time: x e + y e . y e + 1 Substituting the control law equations of ω and v (37) into Equation (39), then: By LaSalle's invariance principle [22,23] and the Lyapunov stability criterion [24], the stability of the outer-loop controller is proved.

Simulation and Discussion
In this section, a lot of comparative simulations have been done to verify the validity of the proposed control methods. We have done a lot of simulations and found the appropriate control parameters of the designed outer loop controller as shown in Table 4. Table 5 exhibits several different algorithmic approaches combined by diverse control methods of inner and outer loop controllers. The simulation framework for 2S-B controller is shown in Figure A1 of the Appendix A.  The control parameters of the PID controller used for comparison in this paper are settled by the Ziegler-Nichols method and shown in Table 6. First, a reference circular trajectory with ω r = 0.5 rad/s, v r = 0.5 m/s is given and the radius of the desired trajectory r is 1 m. Furthermore, we assume that the vehicle start point is [x(0) y(0) δ(0)] T = [1.3 − 0.3 2π/3] T , and the initial state variables are supposed as Figure 10 shows the practical tracking for the circle mentioned above with six different control combinations.
From Figure 10a, it is clearly shown that the 2S-B controller has the shortest settling time of the tilt angle (about 1.55 s), while the worst settling time of the tilt angle is about 7.06 s in the P-D controller. The tracking error of x decreases to zero after t = 0.95 s by the 2S-B controller. When it comes to the P-D controller, the tracking error of x has the longest settling time of 4.44 s (Figure 10d). Moreover, the overshoots of θ and e x in the 2S-B controller are smallest among them. Figure 10d indicates that the DMLF method has better response about the tracking error of δ, but worse performances of e x and e y than the backstepping method. Considering these simulation results, the 2S-B controller is the most effective control combination strategy.
To further verify the effectiveness of the proposed controllers, a more sophisticated trifolium trajectory is used as a reference trajectory.
Then, the reference longitudinal velocity v r (t) = .
x r 2 (t) + performances of e x and e y than the backstepping method. Considering these simulation results, the 2S-B controller is the most effective control combination strategy.
To further verify the effectiveness of the proposed controllers, a more sophisticated trifolium trajectory is used as a reference trajectory.
Here, the desired length of each leaf ρ is chosen as ρ = 5, ω c = 0.05. Then, the reference longitudinal velocity          Finally, a hexagon trajectory, which contains an abrupt variation of longitudinal velocity and rotational velocity, is more difficult to track than the trifolium one. The hexagon trajectory we adopt is described by piecewise linear functions. Furthermore, assume that the vehicle start point is  Finally, a hexagon trajectory, which contains an abrupt variation of longitudinal velocity and rotational velocity, is more difficult to track than the trifolium one. The hexagon trajectory we adopt is described by piecewise linear functions. Furthermore, assume that the vehicle start point is [x(0) y(0) δ(0)] T = [3.7 − 0.3 3π/4] T , and the initial state variables are set as  Similarly, the system states are divergent for tracking a hexagon using P-D controller and P-B controller. Moreover, the simulation results are shown in the Appendix A. Figure 12 shows the practical tracking performances for the hexagon mentioned above with four different control combinations. Similarly, the system states are divergent for tracking a hexagon using P-D controller and P-B controller. Moreover, the simulation results are shown in the Appendix A. Figure 12 shows the practical tracking performances for the hexagon mentioned above with four different control combinations.   Although the hexagon trajectory seems to be tracked effectively, the torque performance is actually terrible due to the abrupt variation of the trajectory of longitudinal velocity and rotational velocity, and this situation is undesirable in practice. Table 7 shows the different control effects of the six control combinations, such as the overshoot and the settling time of θ, e x , e y , e δ , and a coincidence factor indicator (CFI) which illustrates the trajectory tracking performance. We define a coincidence factor indicator (CFI) to describe the tracking performance. The CFI is obtained as follows: where, ()* means the normalization of expressions in brackets, min is the minimum of e xi 2 + e yi 2 from i = 1 to i = N, max is the maximum of e xi 2 + e yi 2 from i = 1 to i = N, N = T/0.05 is the number of samples, and T is the total time of simulation. Different control effects of the six control combinations are clearly shown in Table 7, where we can see that the P-D and the P-B controller have poor adaptability to different trajectories. The convergence rates of e x , e y and e δ are much faster by using the backstepping method than using the DMLF method. It can be clearly seen that 2S-B method has the best CFI as well as shortest settling time of the tilt angle for all three trajectories, so it can be concluded that among the six control combinations, 2S-B controller has the best control performance for its fast convergence speed, small overshoot and best trajectory coincidence.

Experimental Results
Since the sensor (MPU-6050) has an embedded 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer, we need to utilize an information fusion algorithm to obtain relatively accurate information. Figure 13 shows the frame of the complementary filter for information fusion.  Table 7, where we can see that the P-D and the P-B controller have poor adaptability to different trajectories. The convergence rates of e x , e y and e δ are much faster by using the backstepping method than using the DMLF method. It can be clearly seen that 2S-B method has the best CFI as well as shortest settling time of the tilt angle for all three trajectories, so it can be concluded that among the six control combinations, 2S-B controller has the best control performance for its fast convergence speed, small overshoot and best trajectory coincidence.

Experimental Results
Since the sensor (MPU-6050) has an embedded 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer, we need to utilize an information fusion algorithm to obtain relatively accurate information. Figure 13 shows the frame of the complementary filter for information fusion. The attitude data of the TWIP vehicle is measured via the onboard IMU, the velocity data is measured by two rotary encoders, and the location information of the TWIP vehicle is measured by the UWB positioning technology just as shown in Figure 2. The placement of anchors in space is shown in Figure 14. The position of the Tag can be expressed as follows: Figure 13. The frame of multi-sensor information fusion algorithm.
The attitude data of the TWIP vehicle is measured via the onboard IMU, the velocity data is measured by two rotary encoders, and the location information of the TWIP vehicle is measured by the UWB positioning technology just as shown in Figure 2. The placement of anchors in space is shown in Figure 14.  Table 7, where we can see that the P-D and the P-B controller have poor adaptability to different trajectories. The convergence rates of e x , e y and e δ are much faster by using the backstepping method than using the DMLF method. It can be clearly seen that 2S-B method has the best CFI as well as shortest settling time of the tilt angle for all three trajectories, so it can be concluded that among the six control combinations, 2S-B controller has the best control performance for its fast convergence speed, small overshoot and best trajectory coincidence.

Experimental Results
Since the sensor (MPU-6050) has an embedded 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer, we need to utilize an information fusion algorithm to obtain relatively accurate information. Figure 13 shows the frame of the complementary filter for information fusion. The attitude data of the TWIP vehicle is measured via the onboard IMU, the velocity data is measured by two rotary encoders, and the location information of the TWIP vehicle is measured by the UWB positioning technology just as shown in Figure 2. The placement of anchors in space is shown in Figure 14. The position of the Tag can be expressed as follows: The position of the Tag can be expressed as follows: To verify the tracking performance of the proposed design, an indoor tracking test was implemented. The desired trajectory was set to be a circle with ω r = 0.5 rad/s, v r = 0.5 m/s. The radius of the desired trajectory r was 1 m. Considering the existence of mismatch between the real-time system model and the mathematical model, the feedback gains obtained from simulations may not function well on the real-time platform, thus the control design parameters need to be adjusted through experiments on the prototype. In practice, we use the control design parameters as c 1 = 5, c 2 = 0.4, c 3 = 4, α = 4, k 1 = 5, k 2 = 12, k 3 = 10, k 4 = 15, γ 1 = 1/3, γ 2 = 1/3, Figure 15 shows the indoor experimental results using the 2S-B controller for tracking the circle.
To verify the tracking performance of the proposed design, an indoor tracking test was implemented. The desired trajectory was set to be a circle with ω r = 0.5 rad/s, v r = 0.5 m/s. The radius of the desired trajectory r was 1 m. Considering the existence of mismatch between the real-time system model and the mathematical model, the feedback gains obtained from simulations may not function well on the real-time platform, thus the control design parameters need to be adjusted through experiments on the prototype. In practice, we use the control design parameters as  Figure 15 shows the indoor experimental results using the 2S-B controller for tracking the circle.  After the battery is fully charged, the TWIP vehicle can run continuously for about 30 min. The test of tracking a circle lasts about 30 s, and the TWIP vehicle finished the trajectory tracking for more than two rounds. Figure 15a shows the tilt angle of the TWIP vehicle. Figure 15g,h shows the position tracking errors. Because there is a cm-level measure error in the position measurement by UWB technology, the position tracking errors cannot converge to zero. The maximum position tracking error is about ±0.27 m for x-direction and about ±0.23 m for y-direction, but more than 80% of the all recorded horizontal points remain in a circle with a radius of 0.1 m. The RMS value of the position error is 0.1036 m in x-direction, and 0.0841 m in y-direction. The settling time of the tilt angle is about 3.5 s. Td the tilt angle is controlled within ±1.5 • . This demonstrates the good tracking performance achieved in the indoor environment.

Conclusions
In this paper, an inner/outer loop control is proposed for the trajectory control of a TWIP vehicle. Several control methods have been utilized in the inner or outer loop controller and then different control combinations of inner and outer loop control methods have been proposed. A lot of simulations have been conducted to compare the control performance of different control combinations. Then, the simulation results illustrate that the 2S-B combination has the most effective control performance and highly adaptability to different trajectories. Finally experiments have been carried out to verify the effectivity of the 2S-B combination. In our future work, the Kalman filter and its variants will be considered to obtain the state estimation such that the effects of sensor noises can be attenuated. Further investigation will be conducted on path-planning arithmetic for environment exploration.
Author Contributions: Dun-Zhu Xia conceived the topic and developed the model; Yan-Hong Yao and Li-Mei Cheng finalized the simulation; Yan-Hong Yao analyzed the results; all authors wrote the paper.

Conflicts of Interest:
The authors declare no conflict of interest. Figure A2a-d illustrate that the system states are divergent for tracking a trifolium trajectory using the P-D controller and P-B controller. Compared with the circle trajectory, the trifolium trajectory is more sophisticated and the tracking velocity v d changes rapidly at the beginning. Figure A3a-d illustrate that the system states are divergent for tracking a hexagon using the P-D controller and P-B controller. Comparing with the circle trajectory, the hexagon trajectory is more sophisticated and the tracking velocity v d and w d changes rapidly at the beginning.