A Variable-Order Fuzzy Logic Controller Design Method for an Unmanned Underwater Vehicle Based on NSGA-II

: UUV depth control requires the controlled system to have good transient response and robustness under the premise of ensuring real-time performance. The ﬂexibility of fractional-order control provides an idea to solve this problem. This paper proposes a controller design method for UUV depth control (VD-SIFLC) based on fractional calculus, fuzzy control, dynamic parameters and a fast non-dominated sorting genetic algorithm (NSGA-II). First, the overall structure of the controller, the UUV model and the model of external disturbances are presented. Then, the design methods of control input, order selector, membership function and scale factor selector are given, respectively. Then, the necessary conditions, such as optimization objectives and optimization parameters in the optimization algorithm, are analyzed. Finally, the effectiveness of the proposed control scheme is veriﬁed by comparative experiments with the SIFLC. Simulation results show that the controlled system with the VD-FIFLC could achieve better robustness and dynamic and steady-state performance. Moreover, according to the actual task requirements, the appropriate parameters can be selected by the user from the pareto solution set, which is suitable to be used in the actual applications.


Introduction
Unmanned underwater vehicles (UUVs) have a broad range of practical applications. In the military aspect, this concept is generally applied for underwater warning, reconnaissance, tracking and covert attack. In the civilian application, it can be used for tasks such as hydrographic surveys, oceanographic research and water quality monitoring. As a maritime force multiplier, a UUV not only has extensive and important military applications, but also contributes an indispensable and important force to the peaceful development of the oceans by mankind. In recent years, the applications of UUVs have been widely explored, and now it has become the forefront of military marine technology in developed countries.
The UUV depth control technology is one of the most important parts of UUV control. For example, in the process of underwater docking of UUVs, both UUVs need to maintain a stable attitude at a given depth [1,2]. This puts forward higher requirements for the dynamic and steady-state performance of UUV depth control. The UUV motion control has the following characteristics. First, UUVs generally work in complex marine environments with complex and changeable external disturbances, so they should have strong robustness. Then, the UUV model is quite complex, which makes the controller design more difficult. Finally, UUVs are not always equipped with a high-performance processor, which requires the controller to have better real-time performance.
In the related studies of UUV motion control, the fuzzy control and variable order control methods have been widely used. The fuzzy control does not depend on the 1.
The design method of the proposed controller is given with the 'fractional distance' as the input and the simplified fuzzy logic controller as the output. 2.
The fractional order selection method is presented. According to the given depth, the real-time depth of the vehicle and the PWM wave, the corresponding controller order can be obtained.

3.
The scale factor selector is given. According to the given depth and the real-time depth of the vehicle, the corresponding scale factor can be obtained. 4.
The controller parameters are optimized by the non-dominated multi-objective genetic algorithm (NSGA-II), and the Pareto optimal solution set is achieved. 5.
The effectiveness of the proposed scheme is verified by comparing the dynamic and steady-state control performance of the VD-SIFLC and the SIFLC.

Control System Structure
The workflow of the control system includes the following processes as shown in Figure 1. The parameters involved in the control system are shown in Table 1. First, according to the needs of the task, the user selects the parameters that meet the needs from the Pareto solution set and gives the reference signal of the depth changing with time. Then, the controller obtains the control output according to the reference signal and controls the UUV model [18,19]. At the same time, the external disturbances are also applied to the UUV model [20,21]. Finally, the attitude information of the UUV is obtained through the sensor.
Then, the controller obtains the control output according to the reference signal and trols the UUV model [18,19]. At the same time, the external disturbances are also ap to the UUV model [20,21]. Finally, the attitude information of the UUV is obt through the sensor.

UUV Depth Controller
The controller mainly includes two parts, namely the proposed controller an controller parameter optimization part. The controller consists of fractional order logic controller, order selector and scale factor selector. Part of the controller param are obtained by the NSGA-II algorithm, and the optimization objectives include t treme value of the pitch angular velocity, the ITAE index and adjustment time depth. The block diagram of the entire control system is shown in Figure 2.

UUV Depth Controller
The controller mainly includes two parts, namely the proposed controller and the controller parameter optimization part. The controller consists of fractional order fuzzy logic controller, order selector and scale factor selector. Part of the controller parameters are obtained by the NSGA-II algorithm, and the optimization objectives include the extreme value of the pitch angular velocity, the ITAE index and adjustment time of the depth. The block diagram of the entire control system is shown in Figure 2. There are three key points in the controller design, namely, the definition of fractional distance, the construction of one-dimensional rule table and the selection of membership function. The design ideas of the controller will be described below from these three aspects. The block diagram of the entire control system is shown in Figure 1.  There are three key points in the controller design, namely, the definition of fractional distance, the construction of one-dimensional rule table and the selection of membership function. The design ideas of the controller will be described below from these three aspects. The block diagram of the entire control system is shown in Figure 1.
Choi et al. combined the depth error (e) and its derivatives ( . e, .. e, ... e . . .) into a single control input and used a one-dimensional rule table. This method has good control performance. However, the composition of the control input is too complex and requires more computing resources; it is not suitable for direct use in UUV control [22].
The e. This method is called the signed distance method. This method defines the control input through a distance-like definition method. We call this the signed distance (d), where d is the distance from absolutely each diagonal to the main diagonal L Z .
In the previous work, in order to improve the adaptability of the system and provide more choices and possibilities for controller design, . e was replaced with a D α t f (t) and called the fractional distance (d FD ). This article will continue to use this form as input. It is defined as follows: The Riemann-Liouville fractional calculus definition is adopted in d FD , which is defined as:  Table 2. In the rule table, the same output membership is used on both the main and sub-diagonals. Furthermore, the size of each point on a particular diagonal is proportional to its distance from the main diagonal L Z . This structure is called a Toeplitz structure. For FLCs that use e and e as control inputs, it has the Toeplitz property.  Table 3, where L NL , L N M , L NS , L Z , L PS , L PM and L PL refer to the diagonals in Table 2. Through simulation experiments, it is verified that using d FD as input can still make the control system converge. The selection of input membership function and output membership function follows the principle of "simple but effective". That is to make the control surface as smooth as possible and have better dynamic performance. Based on the above principles and relevant experience, the following options are given: 1.
The number of fuzzy subsets of the input quantity is selected as 7, among which, the 5 fuzzy subsets in the middle adopt triangular membership functions, and the two sides are selected as sigmoid membership functions. The advantage of this setting is that it can maintain good control performance with moderate computational complexity. The input membership function is shown in Figure 3; 2.
The number of fuzzy subsets of the output is 7, and the singleton-type membership function is used. The output membership function is shown in Figure 4; 3.
The defuzzification method adopts wtaver (weighted average method). Compared with other methods, this method has better comprehensive performance.

Order Selector
To illustrate the reasons for adopting order selectors in the controller, the following comparative experiments are designed. The controller in the comparative experiment adopts a fixed order, which is selected between ( ) 0, 2 . Except for the order difference, other parameters are the same among different controllers. The experimental results are shown in Figures 5 and 6. According to the experimental results, the following conclusions can be drawn: 1   , it will cause the propeller to reverse in the early stage of adjustment, which needs to be avoided; 2. For the pitch velocity curve, when 1.1  = , its extreme value is the smallest, but there are two points to note. First, it causes the propeller to reverse. Second, its extreme value does not appear at the first peak;

Order Selector
To illustrate the reasons for adopting order selectors in the controller, the following comparative experiments are designed. The controller in the comparative experiment adopts a fixed order, which is selected between ( ) 0, 2 . Except for the order difference, other parameters are the same among different controllers. The experimental results are shown in Figures 5 and 6. According to the experimental results, the following conclusions can be drawn: 1. For the depth curve, with the increase of  , the adjustment time of the depth gradually decreases, but the change is not large. Smaller orders will perform better on ITAE. When 1   , it will cause the propeller to reverse in the early stage of adjustment, which needs to be avoided; 2. For the pitch velocity curve, when 1.1  = , its extreme value is the smallest, but there are two points to note. First, it causes the propeller to reverse. Second, its ex-

Order Selector
To illustrate the reasons for adopting order selectors in the controller, the following comparative experiments are designed. The controller in the comparative experiment adopts a fixed order, which is selected between (0, 2). Except for the order difference, other parameters are the same among different controllers. The experimental results are shown in Figures 5 and 6. According to the experimental results, the following conclusions can be drawn:

1.
For the depth curve, with the increase of α, the adjustment time of the depth gradually decreases, but the change is not large. Smaller orders will perform better on ITAE. When α > 1, it will cause the propeller to reverse in the early stage of adjustment, which needs to be avoided; 2.
For the pitch velocity curve, when α = 1.1, its extreme value is the smallest, but there are two points to note. First, it causes the propeller to reverse. Second, its extreme value does not appear at the first peak; 3.
In the pitch velocity curve, the starting directions of α > 1 and α ≤ 1 are different, and the periods of different orders are also different, which provides conditions for the variable order method.   According to the above conclusions, the following order selection algorithm is designed. The variation law of the order mainly depends on the given depth, the real-time depth of the vehicle and the variation of the PWM wave. The key point is to determine c t . c t is the moment when a given depth changes or the UUV is subjected to a large external perturbation resulting in an abrupt change in depth.
The specific way of determining c t is as follows. First, the switching conditions need to be determined. The difference between the given depth and the actual depth at time t is compared with the difference at time t  − and divided by the difference between the given depth at time t and the previous given depth, denoted as r, which is defined as:   According to the above conclusions, the following order selection algorithm is designed. The variation law of the order mainly depends on the given depth, the real-time depth of the vehicle and the variation of the PWM wave. The key point is to determine c t . c t is the moment when a given depth changes or the UUV is subjected to a large external perturbation resulting in an abrupt change in depth.
The specific way of determining c t is as follows. First, the switching conditions need to be determined. The difference between the given depth and the actual depth at time t is compared with the difference at time t  − and divided by the difference between the given depth at time t and the previous given depth, denoted as r, which is defined as: According to the above conclusions, the following order selection algorithm is designed. The variation law of the order mainly depends on the given depth, the real-time depth of the vehicle and the variation of the PWM wave. The key point is to determine t c . t c is the moment when a given depth changes or the UUV is subjected to a large external perturbation resulting in an abrupt change in depth.
The specific way of determining t c is as follows. First, the switching conditions need to be determined. The difference between the given depth and the actual depth at time t is compared with the difference at time t − τ and divided by the difference between the given depth at time t and the previous given depth, denoted as r, which is defined as: where z now is the given depth at this time, and z be f ore is the previous given depth. e(t) is the depth error at time t, and e(t − τ) is the depth error at time t − τ. Then, a conditional judgment is made. If r is greater than the minimum allowable ratio r min , it indicates that the time at this time is between t c and t c + τ, and the control method of variable order is adopted. Otherwise, a fixed fractional order is used.
After the time is determined, the change of the order is controlled by the PWM wave to achieve the purpose of reducing the extreme value of the pitch angular velocity: where y PW M is the function value of the PWM wave, 0 < α 1 ≤ 1, 1 < α 2 < 2, 0 < α 3 < 2. τ is a time delay. Its value is the length of the first cycle of the pitch velocity change curve in the transient process. The whole process is shown in Figure 7. For this method, two points need to be noted: 1.
There are two reasons for choosing PWM wave as the judgment condition. On the one hand, the PWM wave does not require additional calculation and will not affect the real-time performance of the control. On the other hand, the PWM wave changes periodically, in harmony with the pitch velocity; 2. α 1 and α 2 are used alternately, and α 1 is before α 2 . This has two advantages. Not only can the influence of reversal be avoided, but also the extreme value of the pitch velocity can be reduced by the characteristic of the opposite starting direction; 3.
The PWM wave resets when the given depth changes, which ensures that the PWM wave matches the pitch velocity curve; 4.
In theory, the continuous change of order will have better control performance, but it requires a lot of computing resources and is not suitable for UUV.  To design the scale factor selector used in the controller, the following comparative experiments are designed. The order of the controller in the comparative experiment is 1.1, and the scale factor is selected between (5,25). Except for the different scale factors, other parameters are the same among different controllers. The experimental results are shown in Figures 8 and 9. According to the experimental results, the following conclusions can be drawn:

1.
Larger scale factor has smaller depth adjustment time and smaller steady-state error; 2.
A smaller scale factor can reduce the extreme value of the pitch angular velocity.  Based on this idea, the scale factor function is improved by the softsign function, and the scale factor function is defined as:   Based on this idea, the scale factor function is improved by the softsign function, and the scale factor function is defined as:  In order to combine the advantages of both, the following order selection algorithm is designed.
In the dynamic process, the smaller factor is used in the shorter time when the depth error abruptly occurs, and the larger factor is used in the subsequent adjustment process. The change in the scale factor should preferably be gentle so that it does not have a large impact on the pitch velocity. In the steady-state process, a larger factor is adopted in the case of bounded external perturbations to further reduce the steady-state error. However, when the UUV encounters a short-term and large-scale disturbance similar to the internal wave flow in the South China Sea, a smaller factor is used to maintain the balance of the UUV [21]. It is best to change the scale factor quickly so that unexpected situations can be dealt with in a timely manner.
Based on this idea, the scale factor function is improved by the softsign function, and the scale factor function is defined as: where b is the upper bound of the scale factor, and a 1 and a 2 are the lower bounds of the scale factor, as well as the vertical stretch and translation transformations of the original function. k 1 , k 2 , m 1 and m 2 are mainly for the original function of the horizontal expansion and translation transformation. It is also the adjustment of the speed of change and the position of the center of symmetry. x p and x e are used to determine the range of steady-state error and maximum acceptable disturbance, and the values are determined by the actual situation. In this controller, x p = 2%, x e = 0.3%. x is defined as: where z actual is the actual depth. In this way, the depth change can be judged by x.

Controller Parameter Optimization Method Based on NSGA-II
The NSGA-II algorithm is a commonly used multi-objective optimization algorithm. The controller adopts this algorithm as the optimization algorithm of the controller parameters, mainly based on the following two reasons:

1.
In the actual depth control of UUV, the requirements for control performance are different in different situations. For example, when the UUV performs an emergency salvage or rescue mission, it is hoped that the adjustment time is as short as possible, and its balance can be appropriately relaxed. In the case of UUVs equipped with precision instruments, it is hoped that the bumps will be as small as possible in the case of external disturbances, and the requirements for adjustment time can be appropriately relaxed. At this time, the single-objective optimization algorithm cannot meet the actual needs.

2.
In the field debugging of UUV, it is often necessary to combine parameter optimization with physical experiments to obtain the best control performance. This requires the optimization algorithm to have a faster execution speed. However, NSGA-II adopts a fast non-dominated sorting algorithm, and the computational complexity is greatly reduced compared to NSGA.

Optimization Objective
The optimization objectives are the adjustment time (t s ) of the depth, the ITAE index of the depth and the extreme value of the pitch velocity (q extremum ). t s and q extremum reflect the dynamic performance of the controller, and ITAE can better suppress long-term errors.

Parameters to Be Optimized
For the controller parameters, it is obviously unreasonable that all parameters are determined by the optimization algorithm, which will greatly increase the computational complexity, and some parameters can be determined entirely by experience. The parameters optimized by the optimization algorithm include k, a1, a2, b1, b2, a3 and the period and pulse width of the PWM wave. Other parameters and the value range of the optimized parameters are selected according to experience and conditions. The whole process will be demonstrated through concrete examples in comparative experiments. The flow of NSGA-II for VD-SIFLC is shown in Figure 10

UUV Model for Depth Control
For the depth control of UUV, in order to make it conform to the actual situation, the following assumptions need to be made.
1. It is assumed that the origin of the coordinates coincides with the center of gravity of the UUV. The heading angular velocity ( r ) and the translational and rotational velocity ( v ) relative to the motion coordinate system are all zero; 2. When the UUV is navigating in the vertical plane, it can be assumed that the UUV is advancing at a constant speed, and the roll and yaw are negligible; 3. At steady state, 0  is constant and According to the above assumptions, the following kinetic equation can be obtained. The entire model is expressed in the form of a matrix. The model is as follows: The UUV model adopted in this paper sails at a constant speed of . Using the state space model, the dynamic equation can be further expressed as:

UUV Model for Depth Control
For the depth control of UUV, in order to make it conform to the actual situation, the following assumptions need to be made.

1.
It is assumed that the origin of the coordinates coincides with the center of gravity of the UUV. The heading angular velocity (r) and the translational and rotational velocity (v) relative to the motion coordinate system are all zero; 2.
When the UUV is navigating in the vertical plane, it can be assumed that the UUV is advancing at a constant speed, and the roll and yaw are negligible; 3.
At steady state, θ 0 is constant and q 0 = φ 0 = 0. According to the above assumptions, the following kinetic equation can be obtained. The entire model is expressed in the form of a matrix. The model is as follows: The UUV model adopted in this paper sails at a constant speed of u 0 = 4.11m/s. Using the state space model, the dynamic equation can be further expressed as: It should be pointed out that external disturbances only directly affect the depth, and the disturbance acts on the whole UUV system, not the control input.

External Disturbance Modeling
Under water, the external disturbance mainly includes two parts. Part of it is conventional ocean wave disturbance, which is characterized by boundedness, small amplitude and long duration. The other part is a sudden strong disturbance, which is characterized by large amplitude and short duration. The internal wave current in the South China Sea is a typical example. The South China Sea is a sea area with frequent occurrence of internal waves, which are characterized by fast flow and strong suddenness. When the UUV encounters the internal wave flow, it will cause a drastic change in the motion of the UUV.
Both of these disturbances can be described by the ocean wave model. The model uses a robust parameter estimation algorithm and introduces a damping term in the oscillator. Its transfer function can be written as: The value of K w needs to be determined according to the actual situation, ζ is the relative damping ratio, w 0 is the peak frequency of the wave spectrum, and σ w is the wave strength. The value range of relative damping ratio is 0.01 < ζ < 0.1. The value range of the general wave is 0.3rad/s < w 0 < 1.3rad/s. For conventional wave disturbance, the value is ζ = 0.1, σ w = 0.5 and w 0 = 1.2 [23]. For sudden strong disturbances, ζ = 0.1, σ w = 5 and w 0 = 1.2 [24]. The variation of waves with time is shown in Figure 11.
It should be pointed out that external disturbances only directly affect the depth, and the disturbance acts on the whole UUV system, not the control input.

External Disturbance Modeling
Under water, the external disturbance mainly includes two parts. Part of it is conventional ocean wave disturbance, which is characterized by boundedness, small amplitude and long duration. The other part is a sudden strong disturbance, which is characterized by large amplitude and short duration. The internal wave current in the South China Sea is a typical example. The South China Sea is a sea area with frequent occurrence of internal waves, which are characterized by fast flow and strong suddenness. When the UUV encounters the internal wave flow, it will cause a drastic change in the motion of the UUV.
Both of these disturbances can be described by the ocean wave model. The model uses a robust parameter estimation algorithm and introduces a damping term in the oscillator. Its transfer function can be written as:  Figure 11.

Results
This section mainly gives the method of parameter initialization and comparative test. Comparative experiments verify the effectiveness of the proposed scheme by comparing the dynamic and steady-state control performance of VD-SIFLC and SIFLC.

Parameter Initialization
Parameter initialization mainly adopts the combination of empirical parameter adjustment method and NSGA-II. On the one hand, if all parameters are optimized with NSGA-II, it will cause the optimization algorithm to run too long. On the other hand, some parameters can be determined empirically and can be fixed.

Generation of Pareto Optimal Solution Set
Before generating the pareto solution set, constraints need to be given. For VD-SIFLC, the constraints are shown in Table 4. Table 4. Constraints for NSGA-II.

Order Selector Parameters Ranges Scale Factor Selector Parameter Ranges
The optimization function adopts the gamultiobj function in MATLAB, and the optimized pareto optimal solution set is shown in Table 5 [25].

Comparison of Experimental Results
The parameters in the comparison experiment take the first solution in the pareto solution set. Two control groups, SIFLC-A and SIFLC-B, were set up. The former makes the ITAE approximately equal by adjusting the value of k, while the latter selects k = b. Several indicators are selected to measure the control performance of the controller in an all-round way. The control performance comparison results are shown in Figure 12, Tables 6 and 7. There are two things to note about control performance: The error integral criterion is a performance index expressed by the integral expression of a function of the deviation between the expected output of the system and the actual output or the main feedback signal. Integrated Time and Absolute Error (ITAE) is a method of integrating the time after multiplying the absolute value of the error by time. Its expression is:

Conclusions
In this paper, a variable-order fuzzy logic controller based on NSGA-II for dynamic parameters of unmanned underwater vehicles is proposed. The design of the order selector and scale factor selector of the proposed controller can improve the controlled system dynamic, steady-state performance and robustness. The controller structure is relatively simple, and the computational complexity is relatively small which is applied on a UUV. Multiple non-inferior solutions were obtained by using the multi-objective genetic algorithm. The users can select appropriate parameters according to the specific requirements   The control system designed according to this criterion has small transient response oscillation and good selectivity to parameters. Thus, it can be used to measure depth changes. Integral square error (ISE) is to integrate the time after squaring the absolute value of the error. Its expression is: The integration interval is only during the huge disturbance period. The control system designed according to this criterion often has a faster response speed. Therefore, it is used to measure the change of pitch velocity, so that the system will have better robustness.

2.
The scale factor of VD-SIFLC will be actively reduced when encountering strong disturbance to improve the anti-jamming ability.

Discussion
According to the experimental results of VD-SIFLC and SIFLC, the former has better dynamic and steady-state performance than the latter. Especially regarding the extreme value of pitch angular velocity and pitch angle, the former is only about 60% and 70% of the latter. The comparison results in Table 7 demonstrate that the use of the scale factor selector also improves the disturbance immunity of the system. The simulation is an ultra-real-time simulation, and the ratio of the system simulation time to the actual system time is about 6:1.

Conclusions
In this paper, a variable-order fuzzy logic controller based on NSGA-II for dynamic parameters of unmanned underwater vehicles is proposed. The design of the order selector and scale factor selector of the proposed controller can improve the controlled system dynamic, steady-state performance and robustness. The controller structure is relatively simple, and the computational complexity is relatively small which is applied on a UUV. Multiple non-inferior solutions were obtained by using the multi-objective genetic algorithm. The users can select appropriate parameters according to the specific requirements of the task, which is more in line with the actual needs. In our future research, the UUV actuator fault and state quantification will be taken into account, and the controller performance will be verified in actual experiments.