Neural Network Control for Trajectory Tracking and Balancing of a Ball-Balancing Robot with Uncertainty

: In this paper, a neural-network-based control method to achieve trajectory tracking and balancing of a ball-balancing robot with uncertainty is presented. Because the ball-balancing robot is an underactuated system and has nonlinear couplings in the dynamic model, it is challenging to design a controller for trajectory tracking and balancing. Thus, various approaches have been proposed to solve these problems. However, there are still problems such as the complex control system and instability. Therefore, the objective of this paper was to propose a solution to these problems. To this end, we developed a virtual angle-based control scheme. Because the virtual angle was used as the reference angle to achieve trajectory tracking while keeping the balance of the ball-balancing robot, we could solve the underactuation problem using a single-loop controller. The radial basis function networks (RBFNs) were employed to compensate uncertainties, and the controller was designed using the dynamic surface control (DSC) method. From the Lyapunov stability theory, it was proven that all errors of the closed-loop control system were uniformly ultimately bounded. Therefore, the control system structure was simple and ensured stability in achieving simultaneous trajectory tracking and balancing of the ball-balancing robot with uncertainty. Finally, the simulation results are given to verify the performance of the proposed controller through comparison results. As a result, the proposed method showed a 19.2% improved tracking error rate compared to the existing method.


Introduction
Mobile robots have been attracting attention in many fields due to their various applications. Therefore, various techniques have been proposed to operate mobile robots, such as automatic control and a brain-computer interface (BCI) that connects the brain and a computer to control the robot [1]. In this paper, we focused on the automatic control of a ball-balancing robot, which is a type of mobile robot. The ball-balancing robot is an omnidirectional mobile robot, the body of which is placed over a spherical wheel. Because of this characteristic, a control strategy different from traditional methods for mobile robots was required to achieve simultaneous trajectory tracking and balancing. However, designing the controller was challenging due to several problems such as underactuation and nonlinear coupling.
Early studies used single-loop control methods such as proportional-integral-derivative (PID) [2] and a linear quadratic regulator (LQR) [3], which was only possible for balancing the robot. To enable both trajectory tracking and balancing of the robot, multi-loop control methods such as PI-LQR [4] and PD-PID [5] were presented using independent inner-and outer-loops. However, the above papers were based on the linearized model, which requires a narrow operating range. Although the partial feedback linearization (PFL) technique [6] was proposed to relax this restriction, the control system using the multi-loop method becomes complex due to additional feed-forward controllers for robustness against uncertainties [7].
Sliding mode control (SMC) is a representative nonlinear control method that is robust to uncertainty. Thus, the hierarchical sliding mode control (HSMC) method [8], which is composed of combinations of independent sliding surfaces, was proposed to address underactuated systems. The HSMC method based on the two-dimensional model of the ball-balancing robot was presented in [9] and then applied to the aggregated model to consider the combined effects [10]. An integral backstepping technique using the HSMC structure was proposed in [11], and an artificial neural network-based method [12] was presented to deal with uncertainty and input saturation. The hierarchical structure used in the above papers can solve the underactuation problem and has robustness for uncertainties. However, the hierarchical structure has the local minimum problem [13], which may not guarantee the convergence of all errors.
Therefore, a different approach was needed to achieve simultaneous trajectory tracking and balancing for the ball-balancing robot. In this regard, we proposed a virtual anglebased approach [14]. The virtual angle composed of the tracking errors was used as a reference angle to achieve simultaneous trajectory tracking and balancing using the single-loop control system. However, the upper bounds of uncertainties for robustness should be known, which may be impossible in the real world. Artificial intelligence can be a solution to address this problem. In [15], deterministic artificial intelligence (DAI) was used for underactuated systems with nonlinear couplings. In [16], a artificial neural network was employed to deal with model uncertainty and the external disturbance of underactuated surface vessels. The field of non-stochastic or DAI involves the assertion of self-awareness statements and uses optimal learning to compensate the deleterious effects of error sources [15]. On the other hand, an artificial neural network (ANN), which is in the field of stochastic artificial intelligence, does not need to devise an algorithm to perform a particular task because the learning process of a neural network takes place by itself [17].
Motivated by these observations, we proposed a neural network-based control for trajectory tracking and balancing of the ball-balancing robot with uncertainty. A virtual angle-based control method was used to design a single-loop control system to achieve trajectory tracking and balancing of the robot. Unlike in [14], the radial basis function networks (RBFNs) [18], a kind of ANN, were used to compensate the uncertainties without knowing their upper bounds, and the dynamic surface control (DSC) method [19] was employed to design the controller. From the Lyapunov stability theory, it was proven that all errors of the closed-loop control system were uniformly ultimately bounded. Finally, the performance of the proposed method was demonstrated through the simulation results.
The main contributions of this paper are summarized as follows: 1.
The trajectory tracking and balancing of the ball-balancing robot was achieved using a single-loop controller; 2.
It was possible to implement a control system without any knowledge of the upper bounds of uncertainties.
This paper is organized as follows. In Section 2, the dynamics of the ball-balancing robot and the RBFNs are described, and the neural network-based controller is developed for trajectory tracking and balancing of the ball-balancing robot. In Section 3, the simulation results are presented to demonstrate the performance of the proposed method, and the discussion is given in Section 4.

Materials and Methods
In this section, we describe the system model of the ball-balancing robot for formulating the problems and introduce the RBFNs for compensating the uncertainty.

Dynamics of the Ball-Balancing Robot
Consider the ball-balancing robot shown in Figure 1. Assuming that there is no slip between the sphere and the floor and between the driving wheels and the sphere, the dynamic equation of the ball-balancing robot can be expressed as [12]: (1) Here, M(q) ∈ R 4×4 is the symmetric inertia matrix, C(q, q) ∈ R 4×4 represents the Coriolis and centripetal matrix, f (q) ∈ R 4 is the friction matrix, g(q) ∈ R 4 is the gravity vector, B(q) ∈ R 4×2 denotes control input matrix, and u ∈ R 2 represents the control input vector. These terms are given by: where the Xand Y-axis positions of the ball are denoted by x and y, respectively, pitch and roll are denoted by θ and ϕ, respectively, and u x and u y denote the control inputs of the virtual acting wheels by the three omnidirectional wheels, respectively. The terms in ζ i (i = x, y, θ, ϕ) are viscous coefficients. r s and r w denote the ball radius and omnidirectional wheel radius, respectively. It is noted that control input matrices B s and B b are invertible with |θ|, |ϕ| < π/2. The terms in M(q), C(q, q), and g(q) are given in Appendix A.
The dynamic equation in (1) can be decoupled into two subsystems of the position and the angle as follows:q In these expressions, q s = x, y , q b = θ, ϕ , and the matrices F j , ∆F j and G j (j = s, b) are given in Appendix B. ∆F j represents the model uncertainties including viscous damping coefficients ζ i (i = x, y, θ, ϕ).
The control objective was to design the control input u satisfying that lim t→∞ q s − q sr = µ 0 and lim t→∞ q b − q br = µ 1 , where q sr = x r , y r and q br = 0, 0 are the reference vectors for trajectory tracking and balancing, respectively, and µ 0 and µ 1 are arbitrary positive constants.

Radial Basis Function Networks
We employed the RBFNs [20] to approximate ∆F b , and it can be expressed as: where χ i ∈ R n (i = 1, 2) is the input vector of the RBFN, ω * i ∈ R m is the optimal weight vector, m is the node number, ε i denotes the reconstruction error, and Φ i ( Here, µ ij ∈ R n is the center of the receptive field and η ij is the width of the Gaussian function.

Assumption 1.
There exists an ideal constant weight vector ω * i such that |ε i | ≤ ε M with a positive constant ε M for i = 1, 2, and the optimal weight vector is defined as the value of ω i that minimizes |ε i |, i.e., Assumption 2. The optimal weight vector is bounded such that ω * i ≤ ω M with a positive constant ω M .

Controller Design
The ball-balancing robot model given in (2) and (3) is underactuated and has uncertainties. To deal with these problems, we introduced a virtual angle that can achieve both the trajectory tracking and balancing of the robot and designed a neural-network-based controller using the DSC method step-by-step.
Let us define the following errors: where θ f and α f are the signals filtered by τ 2 1θ f + 2τ 1θ f + θ f = θ v and τ 2α f + α f = α with positive design parameters τ 1 and τ 2 . In these expressions, α denotes the virtual control input and θ v denotes the virtual angle for the underactuation problem given by: where λ θ is a diagonal matrix and λ > 0 is a design parameter.

Remark 1.
In (8), the boundedness of z 1 implies that θ f and θ v are bounded. This leads to the boundedness of the tracking error e s from (9). If the tracking error converges to zero, it is easily shown that the body angle q b of the robot also converges to zero from (8) and (9). Therefore, we can solve the underactuation problem.
Remark 2. The first and second derivatives of the virtual angle θ v are required to design a controller. By the definition of the virtual angle in (9), it includes the control input u, which is impossible to implement the controller. To avoid this problem, we used the virtual angle θ f passed through the second-order filter.
Step 1: Consider the Lyapunov function candidate as: Let be the filter error of the virtual control input, i.e., = α − α f . Differentiating both sides of (12) along (10) yields: From (13), we chose the virtual control input vector α to be: where K 1 is a diagonal positive definite matrix.
Step 2: Consider the Lyapunov function candidate as: The time derivative of (15) along (11) is: From (16), we chose the actual control vector u to be: where K 2 is a diagonal positive definite matrix and ω i (i = 1, 2) denotes the estimate of the optimal weight vector ω * i for the RBFNs.

Remark 3.
Because the ball-balancing robot is operated by the three driving motors acting on the spherical wheel, it needs torque conversion between the control input u and the actual motors for the implementation (see the details in [7]).

Results
In this section, the stability of the control system designed in Section 2 is analyzed using the Lyapunov stability theory, and the main result of this paper is given. Moreover, the simulation results are provided to verify the performance of the proposed method.

Stability Analysis
The main result of this paper is given by the following theorem. (2) and (3). Under Assumptions 1 and 2, if the control inputs α and u given in (14) and (17) with the update law (20) are applied to the ball balancing model, then for any initial conditions satisfying V T (0) ≤ p, where p is a positive constant, it is ensured that all error signals in the closed-loop system are uniformly ultimately bounded and can be made arbitrarily small.

Theorem 1. Consider the ball-balancing robot model given in
Proof. From (14), one can show that α ≤ η(z 1 , z 2 , , θ f ,θ f ,θ f ) for some continuous functions η. Consider a set Q : where K 0 is a positive constant. Since Q and A are compact sets, there exists a positive constant η M such that η(·) ≤ η M on A × Q. Then, by Assumptions 1 and 2 and Young's inequality, (21) can be rewritten as: where I 2 ∈ R 2×2 denotes the identity matrix.
Integrating both sides of (23) yields: From (24), the boundedness of z 1 is guaranteed, and it leads to the boundedness of the virtual angle θ v .
Integrating both sides of (9) yields: Therefore, all errors in the closed-loop system are uniformly ultimately bounded and can be made arbitrarily small by properly choosing the design parameters. This completes the proof.

Simulation Results
This section presents the simulation results on the proposed method. The model parameters are given in Table 1. The design parameters were chosen as K 1 = diag(10, 10), K 2 = diag(10, 10), λ = 2, λ θ = diag(−0.1, 0.1), σ 1 = σ 2 = 0.1, and τ 1 = τ 2 = 0.1. The initial states of the robot were taken as q = −0.2, 0.2, 0, 0 . The friction parameters were chosen as ζ x = ζ y = 2 N · s/m and ζ θ = ζ ϕ = 1 N · s/rad. To consider perturbed dynamics, we assumed that we knew the nominal parameters as follows: m b = 116 kg, l = 0.23 m, I bx = 16.25 kg · m 2 , and I by = 15.85 kg · m 2 . To verify the performance of the proposed method, the reference trajectory was composed of straight lines and curves, and the proposed controller (PC) was compared with the integral backstepping hierarchical sliding mode control (IBHSMC) method [12]. The simulation results on the trajectory tracking are shown in Figure 2. It can be seen that both methods had precise tracking performance for straight paths and slight errors for curved paths. Figure 3 shows the detailed simulation results. The trajectory tracking errors of the ball-balancing robot are shown in Figure 3a,b, and the body angles of the robot are depicted in Figure 3c,d. It can be seen that neither method made a significant difference in balancing performance. On the other hand, in trajectory tracking, the proposed method showed a 19.2% improved error rate compared to the IBHSMC method. Figure 4a,b shows the control inputs and estimates of the optimal weights for the RBFNs, respectively. Table 2 shows the root mean square (RMS) of the tracking errors for various control gains. This result sufficiently validated that the tracking and balancing errors can be made arbitrarily small by properly choosing the design parameters. From these results, we could demonstrate that the proposed method was effective in achieving simultaneous trajectory tracking and balancing of the ball-balancing robot. Table 2. RMS of tracking errors according to the control gain.

Gain
Nominal Perturbed

Discussion
In this paper, a neural-network-based control method was proposed for trajectory tracking and balancing of a ball-balancing robot. We introduced a virtual angle to solve the underactuation problem and designed a single-loop controller using the DSC method for a simple control system. Moreover, we employed the RBFNs to compensate for the uncertainties and derived the update laws for the RBFNs in the Lyapunov sense. From the Lyapunov stability theorem, it was proven that all errors in the closed-loop control system were uniformly ultimately bounded and could be made arbitrarily small. The simulation results, including comparisons with the previous method, were provided to verify the performance of the proposed method. It was shown that the proposed method had a 19.2% improved tracking error rate compared to the previous method. In addition, it was confirmed that all errors could be made arbitrarily small as the choice of the design parameters shown in Table 2. Therefore, unlike other previous studies, the proposed method had a simple control system structure and guaranteed stability in achieving simultaneous trajectory tracking and balancing.
In this paper, it was assumed that all states, such as the position, body angle, and velocity of the robot, were measurable and exact. However, this may not be practical because it requires many sensors and can be contaminated by noise. The output-feedback control method using the observer can be a solution to this problem. Therefore, as future research, we will provide a control method that minimizes the use of sensors, such as output-feedback control.

Conflicts of Interest:
The authors declare no conflict of interest.