# Study of Motion Control and a Virtual Reality System for Autonomous Underwater Vehicles
## 3 Design of AUV Motion Control Algorithm
### Design of Neuro-Fuzzy Controller for AUV Path Tracking  
In this paper, we combine the fuzzy control system with a neural network to design the T-S fuzzy neural network for AUV tracking control. The \"IF\" part of the fuzzy rule of T-S model is similar to the \"IF\" part of [PERSON]'s rule, but its \"THEN\" part is an exact function, usually an input variable polynomial. In the conclusion part of the T-S fuzzy inference model, a linear local equation is used to replace the constant in the general inference process. Therefore, the T-S model can generate complex nonlinear functions with a small number of fuzzy rules, which can effectively reduce the number of fuzzy rules when dealing with multivariable systems, so it offers great advantages. The nonlinear mapping and learning characteristics of a neural network with approximate ability can well solve the difficulty of the uncertainty of the dynamic parameters for an underwater vehicle. We design the path tracking control algorithm for the AUV path tracking. Now, taking the AUV horizontal path tracking motion, a T-S neuro-fuzzy controller is designed. The neuro-fuzzy controller is made up of an antecedent network and a consequent network. The consequent network dynamically adjusts the rule library. The antecedent network consists of five layers: (a) input layer, (b) fuzzification layer, (c) inference layer, (d) normalization layer, and (e) output node layer. In this network, the excitation function (input membership function) at the fuzzification layer adopts a Gaussian function, and the antecedent network makes online adjustments to the position and width of the input membership function, as shown in Figure 3.  
The AUV course tracking controller designed in this paper is double-input and single-output, with two input variables \(e,\;\dot{e}\) which, respectively, represent the course deviation \(e\), and the change rate of the course deviation \(\dot{e}\). The single output variable \(y\) represents the rudder order. The control rules can be expressed as the following analysis formula:  
\[y=-<\alpha e+(1-\alpha)\dot{e}> \tag{14}\]  
Generally, there are different requirements for the weighting degrees of error \(e\) and of the velocity of error \(\dot{e}\). For the two-dimensional fuzzy control system, when the system error is rather large, the main task of the control system is to eliminate this error. At that moment, it needs to give a larger weight to the error control process. The larger the error, the larger the weighting of the process will be. Otherwise, when the error is rather small, the system approaches a steady state, and the principal task of the control system makesthe system stable as soon as possible by reducing overshoots. Thus, in this case, the error change should play a larger role in the control system and it conducts a larger weighting towards error change. According to the rules above, the adjustment factors are changed to be adjustment function \(\alpha(t)\), and it is advisable to use the error and absolute value of the error change itself as the weighting of itself. In addition, it should satisfy the condition of the weighted sum of both being equal to be 1. The function of the error and weight function of the error change are shown as below in Equations (15) and (16):  
\[\alpha_{e}(t) = |e(t)|/\left(|e(t)|+\left|\dot{e}(t)\right|\right) \tag{15}\] \[\alpha_{\dot{e}}(t) = \left|\dot{e}(t)\right|/\left(|e(t)|+\left|\dot{e}(t)\right|\right) \tag{16}\]  
where, \(e(t)\) and \(\dot{e}(t)\) are the normalized deviation and deviation ratio of the AUV at the current time, respectively. The weight function shown above is merely the function of the input variable with the control strategy of the artificial intelligence and is called the weight function of intelligence.