Research on control method of unmanned underwater vehicle dynamic positioning based on energy consumption optimization

To satisfy the requirements of position control accuracy and allow unmanned underwater vehicle to maintain in the target zone with energy consumption as little as possible, this article proposes a flexible dynamic positioning strategy and control method, so as to extend the operating time of unmanned underwater vehicle dynamic positioning. Taking the distance between unmanned underwater vehicle and target point as the judgment condition for control method switching, this article delimits the working zone of different control levels for unmanned underwater vehicle and designs corresponding dynamic control methods for different working conditions. When unmanned underwater vehicle is far away from the target point, cuckoo search optimization method is proposed to plan the optimal motion scheme of energy consumption for the process of unmanned underwater vehicle reaching the target point. When unmanned underwater vehicle is close to the target positioning point, a flexible model predictive control method is proposed to reduce the energy consumption of unmanned underwater vehicle in the process of dynamic position control. The simulation case is designed to verify the flexible dynamic control capability of monomer unmanned underwater vehicle. The experimental results show that the strategy and control method proposed in this article, compared with the traditional proportion integration differentiation control method, could obtain the same control effect and reduce energy consumption, to achieve the purpose of prolonging the unmanned underwater vehicle operating time.


Introduction
Unmanned underwater vehicle (UUV) could be used as underwater motion carrier to carry out the load of object equipment, mainly through remote control or autonomous operation to complete specific tasks. 1 Among a number of key UUV technologies, dynamic positioning control technology mainly studies how to use the propulsion force (moment) generated by its own propulsion device to resist external interference to maintain its posture. 2 In recent years, the civil applications of UUV based on dynamic positioning control technology mainly include hydrological information survey, seabed search and rescue, overhaul of deep-sea facilities, mining of mineral resources, and so on; 3 the military applications based on dynamic positioning control technology mainly include information reconnaissance (port monitoring, dangerous goods survey and positioning, hydrometeorological data, and seabed information collection), target tracking, weapon deployment, and so on. 4,5 Kongsberg Simrad company of Green dynamic positioning system in Norway (Green-DP) compared with the traditional dynamic point guard always keep controlled object in a precise position state. 6,7 Energy is one of the main factors limiting the operation ability of UUV. Therefore, the concept of green DP is introduced in this article. In the process of operation, with the premise of ensuring the completion of the operation, flexible dynamic positioning control can be carried out within a set range, so as to reduce the working frequency of the propulsion device, extend the underwater operation time of UUV, and improve the underwater operation ability of UUV. At present, the flexible dynamic positioning control based on energy consumption optimization is mainly used in the shipbuilding industry. 8 Proportion integration differentiation (PID) control and the control method based on Kalman filter and optimal control theory have been successfully applied to the dynamic positioning control system since the 1960s. [9][10][11] The flexible dynamic positioning is mostly used in the shipbuilding industry so far, and there are few research in the field of UUV. Due to the great influence of energy on the operation ability of UUV, this article proposes the flexible energy consumption optimization control strategy and control method by establishing the total energy consumption model of the system to realize the dynamic positioning control of UUV energy consumption optimization.
In terms of energy consumption optimization, Cao and Li 12 determined each external force transformation according to the navigation environment of ship dynamic positioning in 2017, refined the objective function and constraints in the control optimization problem, and then designed a multiobjective algorithm based on genetic algorithm to complete the optimization solution. Johansen et al. 13 derived new simple formulas to relate the dynamic energy storage capacity to the maximum allowed ship position deviation, as a function of the frequency of the requested dynamic energy storage. Many researchers have also used particle swarm optimization algorithm, multigroup comprehensive learning particle swarm optimization algorithm, neural network, and other optimization algorithms to optimize the thrust effectively. [14][15][16] In 2009, scholars Xinshe Yang and Deb Suash from the University of Cambridge, UK, proposed cuckoo search (CS) algorithm. 17 The algorithm is simple and easy to implement and has few parameters. [18][19][20] It does not need to rematch a large number of parameters when solving special problems. Ouaarab 21 applies the CS algorithm to the optimal design of spring and the design of welding beam. The results show that the optimal solution obtained by the CS algorithm is the same or better than the existing optimal solution, while the CS algorithm uses less estimates than other algorithms.
In terms of controller design, Deng 22 put forward the optimization algorithm of ship energy consumption based on power distribution in 2018, which uses electric propulsion to study the motor power of the ship under the service speed mode. In recent years, as a control algorithm developed in industrial practice, model predictive control (MPC) could avoid the influence of system modeling error, environmental interference, and other aspects and make use of multistep test, online rolling optimization, and feedback correction, which has high robustness and control effect. [23][24][25][26][27][28] Li 29 combines the constraint problem of the surface ship and studies the MPC scheme with interference compensation. Aiming at the UUV sailing near the water surface, Du et al. 30 established a linear mathematical model of the UUV longitudinal motion based on the random wave interference in the motion. Steenson Leo 31 considers the UUV equipped with vertical thruster actuator. Aiming at the constraints caused by the existence of thrusters, the MPC algorithm is used to control the depth and longitudinal angle of UUV hovering. In the process of UUV flexible dynamic positioning control, the general motion form of each UUV monomer is low-speed motion, and the mobility requirements are weak. Moreover, the motion trend of UUV can be properly estimated according to its ocean current state, the output of the actuator, and the environmental information sensed by the sensor, especially the dynamic positioning control process in the flexible position control zone, which can advance the system state measurement, so that it can be corrected before the deviation occurs. 32,33 Therefore, this article takes UUV as the research object, aiming at the dynamic positioning control of UUV based on energy consumption optimization. Establish the kinematics and dynamics model of UUV at first. Through the classification of working zone, the control strategy of UUV based on energy consumption optimization is proposed, and the flexible dynamic positioning control of UUV under different working zone levels is realized.

Problem description
In this article, a small range of motion in the control zone is proposed in the form of low-speed maneuver, which allows individuals to deviate from the array point with a small deviation after being disturbed by slow random. However, there should be an upper limit for this deviation to constrain the UUV to not exceed the maximum offset that its zone maintains. When UUV conducts fixed-point guard, it usually carries out detection, investigation, communication networking, and other tasks. Due to the high requirements of sensors such as underwater acoustic communication, underwater acoustic detection, and optical photography for the attitude maintenance of UUV, the preset heading of UUV should be kept unchanged in the process of flexible dynamic positioning control.
The safety distance constraint and communication distance constraint should be considered in dynamic positioning control. 34,35 Let l s and l c be the shortest safe distance between group members and the farthest communication distance of communication equipment carried by UUV, respectively. As shown in Figure 1, d min is the shortest distance between UUV and position control center when UUV is in stable dynamic positioning control state (i.e. within the set maneuvering range); d max is the longest distance between UUV and position control center. The shortest distance d min shall be greater than the shortest safety distance l s to avoid collision accidents, and the longest distance d max shall be less than the farthest communication distance l c between communication devices carried by UUV to ensure effective coverage of communication signals, so as to ensure the basic conditions for the realization of communication functions. Then we get the following relationship While setting the precise control position of the main UUV, the preset heading should also be kept strictly unchanged, which is conducive to the execution of underwater tasks. When UUV completes the task of dynamic positioning control, the main environmental interference is ocean current. It can be assumed that the ocean current changes slowly in the studied local ocean zone, that is, the flow direction is fixed and the velocity is uniform. The UUV studied in this article is equipped with thrusters, rudders, and auxiliary thrusters, which can achieve forward, steering, floating, diving, translation, and vertical rise. According to the analysis of the UUV control capability under the interference of ocean current, UUV has strong dynamic positioning control ability under the conditions of forward flow and top flow and has weaker dynamic positioning control ability in cross flow. Thus, based on the premise of energy consumption optimization, we can not only predict and estimate the limiting environmental conditions but also predict the dynamic feasible working zone of UUV. According to different levels of working zone, the corresponding control strategy and controller are designed to achieve the optimal energy consumption of UUV flexible dynamic positioning control.

UUV kinematic model
The UUV in the literature 23 is taken as the research object. The UUV shape is a revolving body structure, symmetrical left and right, and approximately symmetrical up and down. The heading angle of UUV is turned to the right to be positive, the longitudinal angle q is turned to be positive, and the transverse angle ' is turned to the right to be positive. To ensure the single value in the transformation, it is necessary to limit each attitude angle to a certain range 26 The space motion model of UUV can be written as follows If expressed in vector form, it is where vector h ¼ ½x; y; z; '; q; T , ¼ ½u; v; w; p; q; r T , matrix J ðh Þ is expressed as:

UUV dynamic model
To analyze the dynamics of UUV horizontal and spatial motion, the six degree of freedom dynamics model is written in vector form. [27][28][29] For the case that the center of gravity of UUV coincides with the origin of coordinate system R, the matrix vector form of the UUV dynamic model established based on Lagrangian mechanics knowledge is as follows where M is a positive definite inertia matrix composed of mass, moment of inertia matrix, and additional mass matrix, C RB ðnÞ is the UUV centripetal force matrix, C A ðnÞ is the Coriolis centripetal force matrix produced by the added mass, CðnÞ ¼ C RB ðnÞ þ C A ðnÞ is the Coriolis centripetal force matrix of central symmetry, DðnÞ is the matrix of the viscous force of the fluid, which ignores the secondary viscous force, n ¼ ½u v w p q r T 2 R 6Â1 is the linear velocity and angular velocity vector of UUV in the hull coordinate system, is the fully driven UUV control input force and torque, gðhÞ is the static force and the static moment vector. In this article, it is assumed that when UUV is completely immersed in water, the buoyancy is equal to gravity, that is, W ¼ B. The UUV studied in this article is underactuated. For the control input and control torque of full-drive UUV, the control input of underdrive UUV is only the longitudinal thrust, trim torque, and turning torque provided by the main propeller and steering gear. Therefore, the number of control input is less than six degrees of freedom. It is an underdrive motion system.
The underactuated UUV satisfies the following assumptions: Hypothesis 1: The velocity and control input of underactuated UUV are bounded, that is, jt u j t u ,jt r j t r ,juj u,jvj v,jrj r, where t u , t r , u, v, r are known upper bounds. Hypothesis 2: The mass distribution of UUV is uniform; the nonlinear hydrodynamic coefficients higher than the second order are ignored.
UUV position control strategy based on energy consumption optimization UUV flexible dynamic positioning control is achieved with less power consumption, lower thruster frequency, and longer operation time. The idea of flexible dynamic positioning is used for reference to expand the strict position control zone of UUV from a single point to a fixed size circular zone in the horizontal plane. As shown in Figure 2, UUV is converted from traditional single point precise position control to regional flexible dynamic positioning control. In this article, it is considered that any position state of UUV in this zone is reasonable, and it is not necessary to adjust its position to the target location point. If it is beyond this zone, the motion control system of UUV needs to start working immediately to make UUV return to this set zone and continue to perform cooperative observation and detection task. After adopting the dynamic positioning control method, it can reduce the power consumption of UUV during its working period to improve the quality of the task. On the other hand, the underwater acoustic equipment carried by UUV needs to collect and detect signals in a quiet environment, so the sonar carried by UUV can give full play to its detection performance by reducing the motor car frequency. The dynamic positioning control strategy of this article firstly classifies the feasible working zone of UUV.
As shown in Figure 3 under the premise of energy consumption optimization, to achieve the best operation performance under the condition of position self-defense, the concepts of rigid conservation zone and flexible conservation zone (both expressed by circle) are introduced as internal and external constraints. The flexible guard zone is added from the performance point of view. Through the smooth motor car, noise can be reduced and power can be saved. It is a soft state constraint. To maintain the safety, communication, and geometric characteristics of the detection array, the rigid guard zone is an inviolable hard state constraint.
Take each target location point from UUV as the center, take the dynamic positioning ability of UUV as the constraint condition, and use the radius of UUV working zone to enclose the rigid positioning zone of UUV. When UUV is located outside the rigid guard zone, that is, III-level working zone, it is considered that it needs to enter the holding zone immediately. The conservation zone includes rigid conservation zone and flexible conservation zone. The I-level working zone is the flexible guard zone of UUV. In this zone, the dynamic positioning control of UUV is not as strict as the precise control. It only needs to control the heading of each UUV time to maintain the basic formation conditions of the formation but does not control the position of the UUV, allowing the UUV to drift freely in the first flexible zone. In the II-level working zone, it is considered that UUV has deviated from its maximum drift region, so it is necessary to return to the I-level zone as soon as possible. Once UUV enters the holding zone, it is considered that it will not sail outside the holding zone under the action of motion control system, unless the dynamic positioning control task of UUV is stopped. The size of UUV I-level working zone is mainly affected by the array keeping accuracy, that is, the smaller the distance that UUV can deviate from the target point, the smaller the radius of I-level working zone and vice versa.
Considering that when the initial position of UUV is located in the III-level working zone far away from the target location point, the route it needs to navigate is far away, and the energy consumed by UUV in this process is far greater than the energy consumed by the process of reaching the target location point after entering the guard zone, it can be considered that the main energy loss is caused by the large deviation between UUV and the target location point. In the process of UUV completing the dynamic positioning control task, its motion control system is responsible for realtime motion planning and control. Every possible speed and thrust planning of UUV corresponds to one energy consumption, and different motion planning schemes will lead to different energy consumption. Global optimal motion planning is an off-line optimization method, which can provide the optimal acceleration and time allocation scheme for UUV to reach the target point from the outside of the rigid conservation zone with the optimal energy consumption as the optimization objective on the premise of known environmental information. Therefore, when UUV is in the level III working zone, this article introduces CS optimization algorithm, aiming at the minimum energy consumption, to carry out the global optimal motion planning for UUV and update the UUV motion state at any time, until UUV enters the level I working zone, stop the work mode and switch to the level I working zone control mode. The flow of flexible dynamic control strategy is displayed in Figure 4.

The Flexible dynamic positioning based on CS algorithm
Large deviation UUV dynamic positioning control strategy When UUV is in flexible dynamic positioning control, the optimization problem aiming at minimizing its total power  consumption is a nonlinear optimization problem with constraints. In the process of UUV dynamic positioning, the optimization objective function mainly considers the motion consumption and mechanical loss of UUV. The motion consumption includes the work E m of UUV moving from the ocean current point to the target location point and the work E c of overcoming the ocean current force; mechanical losses are caused by the mechanical efficiency of the UUV mechanical structure. Due to friction and the weight of mechanical equipment, there is a certain proportion of loss between the active work and the input work. Due to friction and the weight of mechanical equipment, there is a certain proportion of loss between the useful work and the input work, which accumulates with the increase of time and is a function of time. Therefore, two subfunctions of the optimization objective can be obtained where f 1 represents the motion energy consumption of UUV, f 2 represents the action time of the system, and k is the mechanical loss coefficient. When CS optimization is used to solve the problem, the environmental information needs to be known as much as possible, so the ocean current is assumed to be a constant directional current with uniform velocity, that is, its size and direction do not change with the change of time and space. After the UUV obtains the ocean current information, the horizontal auxiliary push is used to decompose and cancel the ocean current force in the horizontal direction. The heading is adjusted to the direction toward the target positioning point and the direction is maintained. In the subsequent process, since there is no need for the UUV to change the heading direction, the horizontal auxiliary push in the horizontal direction keeps the original thrust to offset the ocean current effect. The optimal speed and acceleration planning scheme solved by the CS algorithm in the vertical direction is shown in Figure 5.
To make the motion planning scheme of UUV fit the reality as much as possible and avoid the frequent change of UUV acceleration as much as possible, the scheme is mainly divided into three sections, namely, uniform acceleration, uniform velocity, and uniform deceleration, as shown in Figure 5. When UUV reaches the target location point, the speed is reduced to 0, so as to avoid overshoot impact in theory. The work E c done by UUV to overcome the ocean current includes the energy consumption E x and E y in the x-axis and y-axis. In the process of dynamic positioning, the maximum motion speed of UUV is set as v max . According to the mathematical verification, the work E m of UUV moving along the straight-line distance from the ocean current point to the target positioning point is only related to the UUV mass and the maximum moving speed v max , then equation (7) can be further written as follows In equation (8), rC X ða c ÞA TS V 2 c =2 represents the longitudinal interference force of ocean current to UUV, and rC Y ða c ÞA LS V 2 c =2 represents the transverse interference force of ocean current to UUV. The meanings of symbols in the formula are as follows: r is the sea water density; C X ða c Þ represents the resistance coefficient of the longitudinal ocean current, corresponding to the flow direction angle a c is obtained by pool test; C Y ða c Þ represents the resistance coefficient of the transverse ocean current, corresponding to the ocean current with the flow direction angle a c is obtained through the pool test; a c is the flow direction angle of ocean current relative to UUV; A TS is the UUV longitudinal upstream  zone; A LS is the UUV transverse flow zone; V c is ocean current velocity; s x is the UUV sailing distance along x-axis under the action of ocean current ( Figure 6); s y is the UUV sailing distance along y-axis under the action of ocean current ( Figure 6). According to the above content, the two optimization subfunctions are transformed into the single objective function to be optimized in this article through the weight coefficient as follows: where t 1 and t 2 are weight parameters of motion energy consumption and action time. Let a 1 ¼ Àa 2 ¼ a and t a ¼ t 0 , then t c À t b ¼ t 0 , jv m j ¼ ja 1 t 0 j, and at 2 0 þ l ¼ at 0 t c . Substitute equation (8) into equation (9) and simplify according to the constraints to get the final optimization objective function Because of previous article, A 0 , A 1 , and A 2 are constants, then the variables to be optimized are a and t 0 . Due to the a and t 0 , the desired velocity and position could be obtained, which inspires the later work to transform into position and velocity control.

Large deviation UUV dynamic positioning control method based on CS control
In this section, the optimal motion planning based on CS mainly solves the problem of optimal distribution of velocity, acceleration, and time of UUV, so the motion of UUV in this stage can meet the constraints and have the optimal energy consumption. CS is a bionic optimization algorithm to simulate the intelligent behavior of cuckoos. It takes advantage of cuckoos' special breeding patterns and Lévy flight to find the solution. The characteristic of Lévy flight is that it moves in small steps, but sometimes in large steps, which prevents repeating searching locally. In CS optimization, firstly, a group of particles are randomly initialized, which are the potential solutions of the optimization problem. In each iteration, the value updates by tracking the individual extremum and the global extremum, where the individual extremum is the ocean current optimal solution, and the global extremum is the ocean current optimal solution in the whole solution space. As Lévy flights (Lðs; lÞ) have infinite mean and variance, CS can explore the search space more efficiently. This advantage, combined with both local and search capabilities and guaranteed global convergence, makes CS very efficient to solve the UUV planning problem. 18 Lévy*u ¼ t Àl ; ð1 < l 3Þ which has an infinite variance with an infinite mean. Here the steps essentially form a random walk process with a power-law step-length distribution with a heavy tail. Some of the new solutions should be generated by Lévy walk around the best solution obtained so far, this will speed up the local search.
The CS algorithm steps are as follows: (1) In the search space, 10 groups of initial bird's nests are randomly generated. (2) According to the target function of energy consumption as the evaluation index, the energy consumption indexes of all bird nests at the ocean current position are calculated and tested. According to the test results, the initial global optimal bird nests are selected and the value is retained to the next generation. (3) Use equations (11) and (12), to update the position of other bird's nests and then test the updated bird's nest position, compare the previous generation bird's nest position, select the corresponding bird's nest position with better test value, and keep it to the next operation.
where x t j and x t k are two different random sequences, HðÁÞ is the Heaviside function, e is a random number from the random distribution, and s is the step size. s 1þl , s ! s 0 > 0, 1 < l 3. (4) A random r 2 ð0; 1Þ which obeys the uniform distribution is generated. The probability p a of finding cuckoo's eggs by the nest master set in the algorithm is compared with the random number. If r > p a , the value of x tþ1 i will be changed randomly; otherwise, if r p a , the value of x tþ1 i will remain unchanged. After this process is complete, test the changed nest position. According to the test results, it is compared with the test values of a group of bird nest positions updated in step (3). From the corresponding bird's nest location, select the better one and keep it, so as to select the global optimal bird's nest location pb Ã t . (5) Judge whether f ðpb Ã t Þ satisfies the algorithm termination conditions set by the problem to be optimized. If it is not satisfied, return to step (3) to continue the calculation; if it is satisfied, pb Ã t is the global optimal solution. The termination condition can also be iterated to a specified number of steps.
He, Wang, and Yang have proved the global convergence of CS using a Markov chain framework. The constructed stochastic sequences could converge to the optimal state set and guarantee the global convergence by satisfying two conditions. 36 According to the above optimal planning scheme about acceleration, we can deduce the magnitude of the combined external force of UUV in each stage and then combined with the known environmental information and the principle of force decomposition and synthesis, we can get the UUV thrust planning scheme in the corresponding stage.

Small deviation UUV dynamic positioning control method based on analytic predictive control
When UUV is located in the level I and level II working zones, it is considered that UUV has entered a stable dynamic positioning control state. When UUV is located in the level I and level II working zones, it is considered that UUV has entered a stable dynamic positioning control state. The design of flexible dynamic positioning control strategy is also based on the concept of zone keeping. Region keeping control is a kind of control problem with output state variable constraints. At present, the common control methods for this kind of problems are MPC, override control, and reference setting method. The idea of predictive control is introduced into the control of UUV dynamic positioning controller, and the one-time global optimal programming is adopted when the local optimal programming is repeated to take over the remote deviation. In the local optimal programming of each beat, the latest motion state information at the ocean current time is fully utilized to optimize the local objective function in the ocean current scroll window. Achieve the effect of real-time rolling dynamic optimization within the small deviation range of the flexible guard zone. Therefore, when UUV is in the rigid conservative region, MPC is used to control UUV in real time.
The division of I-level and II-level working zones is based on formation keeping and flexible control. Therefore, when UUV is in I-level working zone, the effect of accurate control at the target point is not considered. Therefore, at this time, only the course of UUV is precisely controlled to ensure the overall formation and detection effect, without controlling its position, and lower power consumption is obtained by sacrificing part of the control accuracy. When UUV is in class II working zone, it is considered to be in a dangerous state and it needs to be returned to class I in time. At this time, the requirements for UUV dynamic positioning control are higher than those for class I zone, so the position and heading of UUV are accurately controlled at this time.
All the derivation in this section is based on the constant longitudinal velocity of the under actuated underwater vehicle, 37 thus,û ½i ðtÞ ¼ 0ði ! 1Þ. Therefore, the state space model of kinematic model and dynamic model of underactuated UUV is rewritten as The specific forms of each item in the formula are ð16Þ In this article, a comprehensive performance index should be given. Considering the functions of all aspects, to realize the MPC algorithm under the continuous time condition, rather than applying it to the discrete system, and considering other aspects of the system, in the traditional predictive controller design process, the performance index function is usually selected as It can be seen that only output prediction error and control increment are considered in this performance index function. Under the circumstance that UUV consumes the least energy, the output can be avoided to produce a large overshot and cause a large fluctuation due to environmental interference, thus increasing the fluctuation range of UUV output. Therefore, the variation of UUV output is also taken as one of the performance index functions. This theoretically plays a role in suppressing overshoot, reducing the fluctuation of the output signal and making the control output of UUV track the target state more smoothly. So as to achieve the purpose of reducing the frequency of UUV bullet train in this article, it is expected to be able to suppress the overshoot of output and track the fluctuation generated when the desired state. In this article, the optimization of criterion function is proposed as follows R 1 , R 2 is the radius of flexible and rigid conservation zone, respectively, R 1 < R 2 ; C 1 , C 2 is a constant set according to experience C 1 < C 2 . The criterion function shown in equations (4) to (15) not only considers the softness of the output signal but also fully embodies the design idea of green DP, that is, to measure the deviation of the motion state according to the degree of deviation from the target positioning point, which reduces the severity of the precision requirements of the motion control system. In this article, the CS optimization algorithm is used to solve the minimum value of the above criterion function and obtain the optimal control sequence. To obtain the nonlinear predictive control law, the system output and performance index in receding horizon ½t; t þ T are expanded by Taylor series.
On the basis of underactuated UUV model, the system output is y ¼ ½ x y T , thus, the parameters in equations (21) and (22) are expressed that The Taylor series expansion of performance index J is that In a word, equation (27) is the derivative of the control input uðtÞ and then the derivative value is set to zero. TheûðtÞ obtained is the control law of MPC. Moreover, due to the continuous state value of the obtained control law, the problem of oscillation caused by switching between different states of the system can be solved that whereû 2 ðtÞ ¼ ½û 2 1 ðtÞû 1 ðtÞû 2 ðtÞû 2 2 ðtÞ T ; j ¼ 1; 2;3, and coefficients could be worked out such as qj 1;0 , qj 2;0 , qj 2;1 , qj 3;0 , qj 3;1 , qj 3;2 , which are listed in the Appendix 1. The measured value at each sampling time is used to refresh the performance indexes J constantly, and the closed-loop system is formed. The closed-loop system of predictive control is To prove the stability of the closed-loop system, the following hypothesis is raised. Assumption 1.
1. f : R n Â R m ðx; uÞ ! f ðx; uÞ 2 R n is secondorder continuous differentiable and f ð0; 0Þ ¼ 0. Thus, 0 2 R n is an equilibrium point of the system. 2. U 2 R m is compact and convex, x 2 R n is connected, and ð0; 0Þ is contained inside X Â U . 3. For any initial condition xð0Þ 2 X and any piecewise continuous/ right-continuous input function uðÁÞ : ½0; T p ! U , the system (32) The stability proof of the closed-loop system as shown in equations (3) to (29) is proposed.
Proof. If xðtÞ ¼ 0, the optimal solution of the problem (33) is u Ã Á; xðtÞ; t : ½t; t þ T p ! 0, that is, u Ã ðtÞ ¼ 0 exists when any t satisfies t 2 ½t; t þ d. Because of f ð0; 0Þ ¼ 0, an equilibrium point of the closed-loop system shown in equation (32) is x ¼ 0. For the determined xðtÞ ¼ x, the value function of equation (33) is the candidate system Lyapunov function that When x 6 ¼ 0, V ð0Þ ! 0 exists. When x ¼ 0, the function V ðxÞ is continuous. For any closed-loop system path starting from xð0Þ 2 X , the relationship exists that The above conditions are properties of the function V ðxÞ: 23 The small neighborhood B r at the equilibrium point exists when b 2 ð0; 1Þ is tenable. Then W b in a certain path range is proposed that It is obvious that the neighborhood B r contains the full range of W b .
From the first two properties of the function V ðxÞ, b < min x¼r V ðxÞ exists when b 2 ð0; 1Þ is true. At this point, the definition of W b in a certain path range is given From this definition, we can see that the neighborhood B r contains the full range of W b . Moreover, the monotonic performance of V ðxÞ along the path of the closed-loop system is sufficient: for any t ! 0, there is V xðtÞ V xð0Þ b. Therefore, the path range W b has the characteristic of "all paths beginning from W b satisfying the closed-loop system (32) remain in W b ." In summary, combining with the characteristics of the function V ðxÞ, it can be obtained that the existence of h > 0ðh < rÞ makes x < h, namely V ðxÞ < b, that Therefore, the stability of x ¼ 0 at the equilibrium point is proved. to the continuity of the function f. Therefore, when t ! 0, due to the uniform continuity of xðtÞ and the uniform continuity of xðtÞ 2 Q to x satisfying set x 2 R n jx < e 1 f g , xðtÞ 2 Q is uniformly continuous. In summary, In a word, equation (32) indicates that the equilibrium point x ¼ 0 of the closed-loop system is asymptotically stable. Although the movement in the beginning moment does not track the desired path immediately, the trend is closed to the expected path gradually. Then the desired path has been fully tracked and stable path tracking has been achieved. To sum up, the UUV model is consistent with the actual motion characteristics, which is reasonable and reliable.
The optimal planning simulation based on CS algorithm According to the above design of UUV dynamic control in the process of optimization of objective function, assuming that UUV distance between the current point and target anchor point is 500 m, propeller thrust limits as mentioned in the second chapter as shown   in Figures 11-13. The optimization objective function in this assumption UUV in acceleration and deceleration period of acceleration is the same as the convergence curve shown in Figure 9, the optimal energy consumption index is 189.74, then each x and y coordinates actually represents a set of two dimensions of information, namely the UUV variable section and the size of the acceleration of UUV uniform speed value, and z coordinate represents   the corresponding coordinates of the value of the objective function of energy consumption as shown in Figure 14.

Dynamic control simulation of UUV energy consumption optimization
This section is divided into three parts to carry out simulation of several typical situations corresponding to the UUV dynamic control strategy including the verification of analytic MPC, initial position in the flexible guard zone, and initial position outside the rigid guard zone.
(1) Firstly, the analytic MPC method for UUV dynamic control is verified, that is, the ability of UUV single-point real-time accurate control. The trajectory diagram of UUV is shown in Figure 10. It is observed that both the traditional PID control and the analytic MPC in this article could make UUV reach the target registration point. By real-time motion controller in this article, considering the variation of the output, the flexible control output is improved, which reduces the impact of the system. Compared to PID control of trajectory, the movement track of analytic MPC is smoother and overall motion path is shorter; meanwhile, variations in the action of propeller are obviously less than PID's.
The data processing and analysis shows that, the rapidity of PID control is better than the analytic MPC for position control, this article adopts PID control. However, the analytic MPC has a higher degree of smoothness and a smaller deviation in the north direction in the whole process. When UUV after target controller role anchor point, then the controller will be applied to offset current interference and make UUV keep the target point. When the UUV reach the target location, the north error of PID is larger than that of analytic MPC.
Combined with simulation results of above analysis, the analytic MPC control method can have real-time accurate heading and position control of UUV. Although the quickness is not as well as PID, the state change is smoother that is beneficial for reducing dynamic frequency and low energy consumption.
(2) The UUV is initially located in the flexible zone in the following simulation. Based on the dynamic control strategy, the heading is controlled precisely when the UUV stays the initial position in some zone.
According to the trajectory curve in the figure above, the action of UUV in this process can be divided into two parts: drift segment which is disturbed by ocean current and control segment under the action of real-time control position controller. According to the UUV dynamic position control strategy mentioned above, when the UUV is within the rigid defending zone, it is considered to be close to the target positioning point. In the whole process, the error curves of the northern and eastern directions of UUV are shown in Figure 15.
When the initial bias phase at the same time, the control action is not conducted until the UUV moves out of  flexible zone. The PID control in the same initial state carries out real-time control of the UUV position from the beginning, while the control strategy proposed in this article has a certain allowable range for the UUV position error. Figure 16 displays that the north and east to position error of UUV high overall by the proposed dynamic control strategy and method, which could be considered as sacrificing    some control precision for lower power consumption, make UUV in lower frequent adjustment by propeller thrust. In this process, PID control method carries out real-time and accurate control of UUV position in the whole process, while the flexible dynamic control method only controls the position deviation of UUV at the necessary time, that is, after UUV floats out of the flexible position guard zone, so the former control works longer, resulting in greater actuator loss.
At the initial moment, when there is a large deviation between the initial course of UUV and the target course, both control methods have obvious control output, among which the turning torque under PID control has a larger change range per unit time. Under the interference of ocean current, the output turning moment of the two control methods in the second half of the simulation experiment is not 0, to maintain UUV heading, but the value of turning moment is small because of the small current interference as shown in Figure 17-20.
(3) The following simulation is performed to verify that the UUV is initially located outside the rigid zone. According to the flexible dynamic control strategy designed above, UUV will obtain the global optimal motion plan from the initial point to the target positioning point through CS optimization algorithm.
The UUV in the period of the trajectory of the approximate global optimal motion planning for a straight line. However, it can be found the segment trajectory of curvature, the lateral thrust influenced by the lateral forces of ocean current as shown in Figure 21 and Figure 22. Under the influence of ocean current, since the current to the lateral forces of UUV is compensated, the UUV in the    period of the trajectory of the approximate global optimal motion planning for a straight line, but after amplification can be found that the segment trajectory of curvature, the lateral thrust and failed to fully compensate current transverse interference force as shown in Figure 21 and 23.
The transverse force, longitudinal force, and torque curves of this part of the simulation experiment are shown in Figure 23. In the whole simulation process, if only the time of the control method to control the UUV is considered, the control time to its position and heading are both 200 s as shown in Figure 24. The control time of the flexible position control method for UUV heading is the same as PID, but the control time for the position is only about 60 s. In the position and heading control segment of each method, the flexible method has lower control frequency, which consumption less energy and mechanical loss of propelling devices, avoiding the impact of UUV overshoot.
According to the results and analysis of the three simulation experiments, it is illustrated that the flexible control strategy and method in this article can make the UUV approach to the zone close to the target registration point from a point outside the rigid zone with a low working frequency of propellers and rudders.

Conclusion
In this article, aiming at the requirements of UUV longendurance operation, a UUV flexible dynamic control strategy is designed to make a corresponding control scheme aiming at the optimal energy consumption when UUV is at different distances from the target positioning point in the horizontal plane. In dynamic control demand analysis, the UUV is located in the work area with flexible and rigid guard area division. When UUV is far away from the target location, that is, outside the rigid guarding region, it is considered that the requirement of energy consumption in this stage is higher than the real-time performance and control accuracy of the system. When UUV is close to the target positioning point, that is, within the flexible guarding zone, it is considered that the requirement for real-time performance of the system in this stage is higher than the energy consumption and control accuracy. The simulation results show that compared to the traditional PID control method, the flexible dynamic control method and strategy proposed in this article can complete the dynamic control task with lower energy consumption.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The work was supported by Natural Science Foundation of China (51709062); China Postdoctoral Science Foundation (2019M651265); and Equipment Preresearch Key Lab Fund (6142215180107).