Virtual tracking control of underwater vehicles based on error injection and adaptive gain

Funding information National Natural Science Foundation of China, Grant/Award Number: 51839004; Natural Science Foundation of Zhejiang Province, Grant/Award Number: LQ20E090009; Science and Technology on Underwater Vehicle Technology, Grant/Award Number: 6142215190308; Natural Science Foundation of Jiangsu Province, Grant/Award Number: BK20190964; Natural Science Foundation of the Higher Education Institutions of Jiangsu Province, Grant/Award Number: 19KJB510003 Abstract An improved virtual tracking control scheme is proposed based on error injection and adaptive gain for underwater vehicles in the presence of a large initial tracking error and external disturbances. To relieve the effect caused by a large initial tracking error, the developed control scheme is achieved based on two closed-loop systems. Specifically, a virtual closed-loop system is constructed based on an approximate dynamic model of an underwater vehicle, while an actual closed-loop system is built with a real underwater vehicle. Firstly, in order to improve the tracking precision of the virtual tracking control scheme, an auxiliary variable produced by a first-order filter is injected into a virtual tracking error in the virtual closed-loop system. And then, the virtual trajectory provided by the virtual closed-loop system is followed by the actual closed-loop system. In the actual closed-loop system, a modified sliding mode surface is designed to achieve the finite-time stability, while the control gains can be on-line adjusted based on the tracking performance. Finally, the effectiveness and feasibility of the proposed control scheme are demonstrated by case studies on an underwater vehicle subject to different external disturbances.


INTRODUCTION
Underwater vehicles have attracted great attentions from researchers over the past decades since they have presented good or potential performances in different tasks, including targeted sampling [1], creature picking [2], seabed inspection [3] and underwater operation with manipulators [4,5]. To successfully complete the given task, it is necessary to provide a control scheme that should guarantee the vehicle to track the desired trajectory, to counteract the effect from system uncertainty, external disturbances and inherent non-linearity [6,7]. Various control strategies have been proposed for motion control of underwater vehicles [8], from the basic and linear PID controller to intelligent and non-linear controller, including neural network control, adaptive sliding mode control, model predictive control and so on. For example, in [9], a new hybrid [12] gave a tracking control scheme for underwater vehicles based on adaptive fast non-singular integral terminal sliding mode algorithm to achieve faster convergence rate. To achieve the similar goal as [12], another terminal sliding mode control strategy with adaptive gains was presented and applied on a real underwater vehicle in real-time experiments [13]. Furthermore, to achieve global uniform finite-time stability, rather than global finite-time stability, a generalized super-twisting algorithm based trajectory tracking control strategy with quaternion presentation was proposed for a special underwater vehicle in [14]. In [15], the generalized super-twisting algorithm was also applied to design the control law for underwater vehicles to obtain more robustness and convergence rate. Apart from high-precision trajectory tracking, region tracking control is also needed for underwater vehicles with special missions, where the precision is not their first priority. For this special application, [16] presented an adaptive region tracking control scheme for underwater vehicles based on backstepping technique, where the prescribed transient performance of tracking error was also guaranteed while the prescribed stead-state performance was achieved.
In many existing researches about control of underwater vehicles, the thrusters dynamics are always ignored. However, in the process of control design for underwater vehicles, thruster dynamics should be considered [17]. As for this problem, [18] used a third-order state space equation to describe the dynamics of underwater vehicle including thrusters, and then a tracking control scheme together with a first-order auxiliary system was provided to achieve uniformly ultimate boundedness. Model predictive control is also a good option to address the problem of control design with thruster constraints. For example, nonlinear model predictive control was discussed for underwater vehicles with various constraints, for example obstacles, thruster saturation and vehicle velocity, and the results of the way-point tracking experiments showed the efficacy of the developed control strategy in [19].
In the aforementioned researches, the effect of large initial tracking error has not been actively considered. In fact, due to the existence of ocean current and/or waves, it is inevitable that the initial states of an underwater vehicle deviates from the initial conditions of the desired trajectory. In this case, highfrequency oscillation would arise in the control signals in the beginning process, or more possibly the control system would be instable, if the initial tracking error is large. Therefore, it is significant to investigate tracking control for underwater vehicles where there are restively large difference between the initial state of the vehicle and the initial condition of the desired trajectory.
In our previous researches [20,21], large initial tracking error was actively considered in the trajectory tracking control design for underwater vehicles. Specifically, [20] provided a tracking control strategy for underwater vehicles with large initial tracking error, where the original desired trajectory was replanned locally based on the tracking performance. In [21], a trajectory tracking control scheme was presented for underwater vehicles based on virtual closed-loop system, where an approximate dynamics of the underwater vehicle was used to construct the virtual closed-loop system, so as to relieve the effect from the large initial tracking error. These two control schemes provide good performance in terms of dealing with the effect from large initial tracking error according to the simulation results in [20,21]. However, the tracking precision is not satisfactory for those mission with the high-precision requirement.
Based on the aforementioned discussion, this paper focuses on tracking control with high precision for underwater vehicles subject to large initial tracking error, external disturbances and system uncertainty. The main contributions of this paper are presented as follows. (1) This new control strategy is still developed based on the idea of virtual closed-loop system proposed in [21]. To be specific, the original trajectory is firstly input to the virtual closed-loop system, and then the actual underwater vehicle follows the output of the virtual closed-loop system, which can effectively reduce the effect produced by large initial tracking error on the control performance. (2) Different from the existing research in [21], a new error variable is defined by injecting an auxiliary variable produced by a first-order filter, so as to reduce steady-state errors or periodical errors which ever occurred in the virtual closed-loop system in [21]. (3) A modified sliding mode surface is designed in the real closed-loop system to guarantee finite-time convergence of the tracking error, rather than uniformly ultimate boundedness in [21], as a result that the control accuracy is further improved. (4) Adaptive gains, instead of fixed gains, are introduced into the adaptive law such that the adaptive rate can be tuned according to tracking performance and oscillation in the control signal caused by inappropriate gains can be reduced. This paper is organized as follows. In Section 2, the general dynamics model of underwater vehicles is presented, including the preliminaries needed in this work and control objective. Section 3 provides the main results of this paper, including the control designs of two closed-loop systems. Simulation based verifications are given in Section 4. Conclusions are drawn in Section 5.
Notation: For n × 1 vectors X and Y , XY denotes the vector where each entry in X is multiplied by the corresponding entry in Y . Also X = [X (1) , X (2) , … X (n) ] T and sign(X ) = [sign(X 1 ), sign(X 2 ), … sign(X n )] T .

PROBLEM FORMULATION AND PRELIMINARIES
This section will firstly present the general dynamic model of an underwater vehicle. Then the preliminaries needed in this work and control objective are provided.

Dynamic model
There are two frames in the dynamic model of an underwater vehicle: earth inertial frame and body-fixed frame. The motion relationship between these two frames is described by a transformation matrix. As usual, the general dynamic model of an underwater vehicle is described as the following form [22].
where ∈ ℝ 6 is the position and attitude vector in the inertial frame. ∈ ℝ 6 is the velocity vector in the body-fixed frame. J ( ) ∈ ℝ 6×6 is always non-singular matrix, except that the pitch angle of an underwater vehicle is close to ± 2 , which will not occur in general missions [23]. For ease of presentation, the dependence of J ( ) is suppressed later. B ∈ ℝ 6×n is the thruster configuration matrix with fixed entries. u ∈ ℝ n is the bounded control input of thrusters with the number of thrusters denoted n. d is the external disturbances from, for example ocean current, waves or others. M ∈ ℝ 6×6 is the positivedefinite inertial matrix. C ( ) ∈ ℝ 6×6 is the centripetal and Coriolis matrix and D( ) ∈ ℝ 6×6 is the hydrodynamic damping matrix. G ( ) ∈ ℝ 6 is the vector of gravity and buoyancy. Here, the underwater vehicle considered is full-actuated at least, that is n ≥ 6. In general, it is difficult to obtain the exact values of M , C ( ), D( ) and G ( ). However, one can have the following equations.
whereM ,Ĉ ( ),D( ) andĜ ( ) are nominal and known, which can be obtained from analytical/experimental methods, whilẽ M ,C ( ),D( ) andG ( ) are unknown. The dynamic model of an underwater vehicle can be presented in the inertial frame after some routine manipulations, shown below. Interested readers could refer to [22].
where the superscript −1 denotes the inverse operation. And As described in (2), an approximate dynamic model of an underwater vehicle through analytical or experimental methods, also can be described in the inertial frame, shown as follows.
whereM 0 ,Ĉ ( 0 ,̇0),D ( 0 ,̇0) andĜ ( 0 ) are known. They can be obtained by using the nominal parts of M , C ( ), D( ) and Equation (4). Note 0 , J 0 and u 0 , respectively, have the same definitions of , J and u in fact. We will use this approximate model (5) to be as the controlled plant of the virtual closedloop system.

Control objective and preliminaries
In trajectory tracking, the underwater vehicle is commanded to track a desired trajectory d ∈ ℝ 6 . Here, a reference trajectory is obtained by a second-order reference model, shown asẋ where x r ∈ ℝ 12 is the reference trajectory including 6 elements of position and 6 elements of velocity, and the initial values of x r are zero. And A r and B r are given by where n > 0 and > 0 are selected to achieve the difference between d and the position part of x r to be as small as possible.
And I 6×6 and 0 6×6 are respectively the identity matrix and null matrix with 6 × 6 elements. In our previous research, the second-order reference model described as Equation (7) was used in the virtual closed-loop system. From the simulation results in [21], it is difficult to allow the difference between d and the position part of x r to be zero, especially for those time-varying signals. Hence, it results in that there exists a relatively large deviation between the real position of the underwater vehicle and the original desired trajectory d . The control objective of this paper is to improve the control precision of underwater vehicles under the idea of a virtual closed-loop system. The solution we provide is based on error injection in the virtual closed-loop system and an improved sliding mode surface and adaptive gains in the actual closed-loop system. The effectiveness of the provided solution is evaluated by comparing with our previous research.
The following preliminaries are needed in the control design.

Lemma 1 ([24]). Suppose V (x) is a smooth positive definite function.
If the following inequality holds, then the trajectory x will reach the equilibrium point in a finite time T reach1 .
If there exist scalars 3 > 0, 0 < 2 < 1, > 0 and the following inequality holds,V then this system is semi-global practical finite-time stable.

VIRTUAL TRACKING CONTROL
In this section, an improved virtual tracking control scheme is developed based on error injection and adaptive gain for underwater vehicles in presence of initial tracking error and ocean current disturbance. In our previous work, for example [21], the trajectory tracking control was also achieved based on a virtual closed-loop system. From the results of [21], this method provides good results in terms of relieving high-frequency oscillation phenomenon in the control signals for underwater vehicles with large initial tracking error, but the tracking accuracy is not satisfactory if those missions require high tracking precision. Compared with our previous research, the new features of this paper are the inclusion of error injection whose purpose is to reduce the tracking error caused by the classic second-order reference model as Equation (6) in the virtual closed-loop system and an improved sliding mode surface and adaptive gains to further improve control accuracy in the actual closed-loop system. The structure diagram of the improved virtual tracking control scheme is shown as Figure 1.

Error injection in the virtual closed-loop system
In this subsection, the virtual closed-loop system is constructed based on the approximate dynamic model of an underwater vehicle described as Equation (5). Compared with [21], the new feature of this paper is how to improve the control accuracy in the virtual closed-loop system by error injection. As discussed above, the second-order reference model as Equation (6) would introduce steady-state or periodic error, especially for those time-varying signals. One possible solution is to tune the parameters in Equation (6) to reduce this error, but the results are still not satisfactory.
This paper provides another choice to reduce this error by introducing error injection. From our experience in [21], this error is mainly from the difference between the desired trajectory and the reference trajectory. An auxiliary variable ∈ ℝ 12 is generated by the following second-order model. This new variable is an approximate version of ( d − r ) where r is the position part of the reference trajectory x r . And the first-order derivative of new variable is designed as follows.
Then this auxiliary variable is injected into the error variable, that is e 0 = [ 0 ,̇0] T − x r − . We define the virtual tracking error as the position part of the error variable e 0 . If there is a controller to guarantee the error variable e 0 to converge to zero in a finite time, then the virtual state 0 will track the desired trajectory d with a high precision. Thus, taking the time derivative of the error variable e 0 and substituting (5), (6) and (10) giveṡe where F 0 ( 0 ,̇0) =Ĉ ( 0 ,̇0)̇0 +D ( 0 ,̇0)̇0 +Ĝ ( 0 ). The control law in the virtual closed-loop system should have the following form, to guarantee the approximate dynamic model to follow the original desired trajectory with high precision. where ]. And the superscript + means the pseudo-inverse of a matrix. Λ k , Λ w are positive constant; while P ∈ ℝ 12×12 is positive-definitive and diagonal matrix. Next, the stability under the control law (12) is analyzed. The following Lyapunov function is selected After taking the time derivative of V 1 and substituting (11) and (12) giveṡ According to Lemma 1, one has that the error variable e 0 converges to zero in a finite time and the required time is given by The compared method in [21] Since there is no ocean current disturbance in the virtual closed-loop system and the controlled plant is exactly known in priori, one can directly verify the effectiveness of the improved virtual control law with error injection, compared with [21]. Figure 2 gives an example to demonstrate the performance of the proposed virtual closed-loop system, where the desired trajectory and environment set are the same as the first case in simulation studies in the later. Through Figure 2, one can obviously see that the virtual tracking error has been greatly reduced based on the proposed error injection method, in comparison with the method in [21].
Different from most existing control strategies where the system tracks the original desired trajectory, the actual closed-loop system will follow the output of virtual closed-loop system 0 . Next, it will derive the control law to guarantee − 0 to be a small range near zero in a finite time.

Control design in the actual closed-loop system
At first, define the error variables e 1 = − 0 and e 2 =̇e 1 = −̇0. According to the real dynamic model of an underwater vehicle as (3) and its approximate one as (5), the time derivative of e 2 can be expresseḋ whereM is the estimated quantity of M andM = M −M . We takeM =M 0 ̇0). From the expression of F ( ,̇), this function is mainly affected by the value oḟ, while only affects the transformation matrix. Based on our previous experience in [26], together with the boundedness of 0 , d , J anḋ0, one can make the following assumption. Then, to obtain more superior tracking performance, a new sliding mode surface is designed as where k i (i = 1, 2, 3, 4) are 6 × 6 diagonal matrixes, and their diagonal elements are larger than zero. However, it is possible to cause singularity in smo when e 1 approaches to zero while e 2 is not zero in this design. Hence, inspired by [27,28], a modified sliding mode surface is shown as sm = k 1 (e 1 ) + k 2 e 1 + e 2 + ∫ (k 3 sign(e 1 ) + k 4 e 1 )d , (17) where (e 1 ) is a 6 × 1 vector, whose ith element is denoted as i (e 1i ), and where l 1i = 1.5 1i −0.5 , l 2i = −0.5 1i −1.5 , and 1i > 0 is the ith element of vector ∈ ℝ 6 . Also, l 1i and l 2i are, respectively, the ith elements of l 1 and l 2 . e 1i denotes the ith element of the error variable e 1 . From the expression of i e 1i in Equation (18), one has that |e 1i | 0.5 sign(e 1i ) = 1i 0.5 and l 1i e 1i + l 2i e 1i 2 sign(e 1i ) = 1.5 1i 0.5 − 0.5 1i 0.5 = 1i 0.5 for the case of e 1i → 1i . Similarly, one also can obtain that |e 1i | 0.5 sign(e 1i ) = − 1i 0.5 and l 1i e 1i + l 2i e 1i 2 sign(e 1i ) = − 1i 0.5 for the case of e 1i → − 1i . Hence, the derivative of i (e 1i ) with respect to e 1i is always continuous, even at the points |e 1i | = 1i .
The time derivative of Equation (17) is given by To achieve trajectory tracking, the control law has the form of u = u eq + u ad , where u eq is the equivalent part of the control law, while u ad is the adaptive part. u eq should have the following expression to offset the known terms in (19). where JB. Then, the sliding mode surface can be rewritten as below, after substituting (20) into (19).
According to above equation, the adaptive part of control law u ad is designed as the following form, so as to achieve the finitetime stability of the sliding mode surface.
where 3 where is a positive gain. According to the adaptive law, one has that̂is bounded if the sliding mode surface converges to zero in a finite time, that is there exists a positive vector, such that >̂.
In general, this parameter is a fixed gain. However, the gain is expected to be tuned dynamically, that is is expected to be large as the tracking error is large, vice versa. Based on the mentioned-above consideration, is tuned aṡ where 1 and 2 are positive constants. 1 ≥ 1, 0 < 2 < 1 and 2 > 0 . 0 is a positive constant. The initial value of is larger than zero.
Remark 1. When ‖sm‖ > 2 ,̇will be always larger than zero. Then the value of will be increased. While ‖sm‖ ≤ 2 and > 0 , the value of will be decreased. Thus, one has that ∃ a positive constant , such that ≥ for any time.
Theorem 1. Consider underwater vehicles as (1) and Assumption 1 holds. Under the action of control law (20), (22) and the adaptive law (23)- (24), the sliding mode surface (17) will converge to a neighbourhood of zero in a finite time, then the error variable − 0 will also converge to a small range near zero in another finite time.
Taking the time derivative of V 2 and substituting the equivalent part of control law u eq as (20) and the adaptive law (23) givesV Ω. (26) According to Young's inequality, one has where is a positive scale, defined below (22). Then based on Assumption 1 and the adaptive part of control law (22), (26) can be rewritten aṡ From (27), it can be obtained that sm and̃are bounded. Next, it needs to prove the finite-time convergence of the sliding mode surface. Consider another Lyapunov function V 3 = 1 2 sm T sm. Then the time derivative of V 3 is expressed as below, after some routine manipulations.
If the control parameter 3 is selected such that min ( where = sm − ∫ (k 3 sign(e 1 ) + k 4 e 1 )d . The diagonal elements of matrixes k i (i = 1, 2, 3, 4) is denoted as k i j ( j = 1, … , 6). And if these diagonal elements are selected to satisfy k 3 j > j and k 4 j > where j is the j th element of , the error variable e 1 will converge to the range |e 1 j | ≤ 1 j in a finite time, similar to the proof in [29]. □ Remark 2. This subsection has proved that under the action of the proposed control law, the error variable e 1 , that is − 0 , converges to the set |e 1 j | ≤ 1 j in a finite time. And in the above subsection it has demonstrated that 0 can converge to d with high precision from case studies. Thus, one can indirectly conclude that the real tracking error − d converges to a neighbourhood of zero in a finite time under the proposed control scheme.

NUMERICAL EXAMPLES
This section will verify the effectiveness and feasibility of the proposed control strategy by simulation studies, in comparison with the control scheme in [21]. ODIN AUV [30] is the underwater vehicle considered to perform case studies. ODIN AUV has four horizontal thrusters and four vertical thrusters, so it can fully move in six degrees of freedom. Assume these eight thrusters can provide thrust with the range of ±200 N, as [21]. Figures about ODIN AUV and thruster distribution are given in [30], which also gives the dynamic parameters of ODIN AUV and thruster distribution matrix.
To evaluate the capability to reject the modelling uncertainty, the nominal dynamics used in control design is only 70% of the actual dynamics. The desired trajectory is considered as ]. In order to guarantee the continuity of d , a special operation should be added, that is the real value of d is given by subtracting suitable times of on the basis of the solution of arctan.
In the modified sliding mode surface, the parameters should be selected satisfy the inequalities mentioned in Section 3  To facilitate comparative studies, the virtual closed-loop system based control scheme [21] is also considered. The control law and the related parameters remain the same as [21].
To effectively present the performance of the proposed virtual tracking scheme based on error injection and adaptive gain, two cases are included in this section, that is simulations are performed under different types of external disturbances generated through two different ways. The first one, which is also the commonest way, is directly give the expression of d as [12]. The other way is to indirectly generate external disturbances by ocean current simulated as [21].
For the first case, the results of the real tracking error − d are presented in Figure 3 under these two control schemes. From Figure 3, it is obvious that the tracking precision of the proposed control scheme is more superior than the compared method. The corresponding control inputs or thrust signals for each thruster under these two control schemes are, respectively, displayed in Figures 4 and 5. From Figure 4, the control inputs of only 'Thruster 2 and Thruster 4' violate the thruster saturation for a short period time in the early stage. Therefore, the Assumption 1 is valid. Moreover, there are no obvious oscillation with high frequency and high magnitude in the control inputs of 4, in comparison with Figure 5.
To more convincingly present the advantages of the developed control strategy over the compared control scheme, two indices about tracking precision are used, including integral of the absolute error (IAE), the integral of the absolute error   [21]. The results of IAE and ITAE under these two control scheme are shown in Tables 1 and 2, respectively. From these two tables, the values of IAE and ITAE in each degree of freedom under the proposed control scheme are less than those under the comparative control scheme in [21]. These results validate the effectiveness of the improved

Trajectory tracking for the second case
In this subsection, external disturbance is indirectly generated by irrotational ocean current. The magnitude of ocean current V c is simulated by the following equation [16,22].
where c = 3; and c is a Gaussian white noise with mean value 1.4 and variance 1 [21]. The sideslip angle of ocean current c is generated by the sum of a Gaussian noise with mean zero and variance 50, while the angle of attack c is generated by c = 1 2 c [16]. In this case, the average of the generated ocean current is about 0.46m∕s, while c changes between 35 • and 50 • . The effect of ocean current on the system dynamics is described by a general term d . The dynamic model of an underwater vehicle in ocean current as [16] is used as the vehicle used in this case.
In the second case, Figure 6 shows the tracking error for each degree of freedom under these two control schemes. From Figure 6, it is shown that the proposed control scheme can effectively force ODIN AUV to track the original desired trajectory with faster convergence speed and higher tracking precision, compared with the control scheme in [21]. Also the results of IAE and ITAE are given in Tables 3 and 4, respectively. These tables also comparatively validate the effectiveness of the proposed control strategy. In addition, Figure 7 presents the control inputs of each thruster based on the proposed control strategy, while Figure 8 displays the control inputs under the action of

FIGURE 7
Control input of the proposed control scheme for the second case the control scheme in [21]. From the control inputs in Figure 7, these signals are within the saturation limits of thrusters, except for 'Thruster 3 and Thruster 4' for a very short period time. This also demonstrate the reasonability of Assumption 1.
Overall, the effectiveness of the proposed control scheme is demonstrated by simulation results of trajectory tracking on ODIN AUV with different types of external disturbances, in comparison with another virtual closed-loop system based control scheme in [21]. From these simulation results, the proposed control scheme has better tracking performances, especially in terms of tracking precision, in comparison with the control scheme in [21]. Therefore, the control objective is achieved based on the improved virtual tracking control scheme based on error injection and adaptive gains.

CONCLUSIONS
This paper provides a good solution to further improve the control precision of the virtual closed-loop system based control scheme in [21]. An improved virtual tracking control scheme is proposed for underwater vehicles based on error injection and adaptive gain. Under the provided control law, it is theoretically verified the real tracking error can converge to a neighbourhood of zero in a finite time. This developed control scheme is also applied to ODIN AUV and compared with the control scheme in [21]. And the comparative simulation results show that the proposed control strategy can deliver more superior tracking performance, including faster convergence speed and better tracking precision, in contrast to the compared control scheme. These results validate the effectiveness of the proposed control scheme.