Differential Evolution Algorithm-Based Iterative Sliding Mode Control of Underactuated Ship Motion

The differential evolution algorithm (DEA)-based iterative sliding mode control (ISMC) method was proposed for the path tracking problem of three-degree-of-freedom (3-DoF) underactuated ships under external interference, with the nonlinear separate model proposed by mathematical model group (MMG). To improve control quality and enhance robustness of the control system, a swarm intelligence optimization algorithm is used to design a controller parameter optimization system. The DEA was adopted in the system to solve the minimum system evaluation index function, and the optimal controller parameters are acquired. Considering the impact of chattering on the actual project, a chattering measurement function is defined in the controller design and used as an input of the controller parameter optimization system. Finally, the 5446TEU container ship is carried out for simulation. It is verified that the designed controller with strong robustness can effectively deal with the disturbances; meanwhile, the chattering of the output is significantly reduced, and the control rudder angle signal conforms to the actual operation requirements of the ship and is more in line with the engineering reality.


Introduction
With the continuous improvement of ship automation requirements, the problem of underactuated ship motion control has gradually attracted the attention of scholars. e nonlinear control method of under-driven ships can well improve the maneuverability of ships and improve the economy and safety of ship operations. At the same time, with the continuous development of the marine economy, it is necessary to complete complex tasks such as submarine pipeline laying, marine resource exploration, marine drilling platform positioning, and ocean replenishment, which requires more and more precise ship control. erefore, it has important theoretical significance and practical value to study motion control of under-driven surface ships.
In recent years, with the increasing requirements for trajectory control, more ship trajectory tracking control has been applied to practical engineering, and there are more and more research studies on trajectory tracking. Michiel [1] used the output feedback method to track the preset ship trajectory, and finally the simulation was realized on a 1 : 70 actual model. Ghommam [2] used the backstepping method to achieve global gradual stability and realize the trajectory tracking of under-driven ships. Fu Mingyu [3] designed a semiglobal uniformly exponentially stable controller. However, the shortcoming of literatures [1][2][3] is that they are all under ideal conditions; that is, there is no interference or just constant interference. Yang also used the backstepping method to achieve trajectory tracking under time-varying interference [4]. Annamalai [5] used model predictive control, adapted to environment online, and controlled sudden disturbance of ship, which has a good effect.
ere are also considerable research studies of ship track tracking. Some scholars use sliding mode methods and iterative sliding modes to deal with uncertainty. Cui et al. [6] proposed to combine the state observer with adaptive technology and designed the controller through the Lyapunov theory. e auxiliary system is used directly to solve the input saturation problem for ship control with input saturation limitation to achieve the desired effect [7]. Literature [8] used the minimum parameter method to approximate the unknown items of the model and replaced the online learning of the ownership value with the norm online learning of the neural network weight, which reduces the calculation amount of the controller and obtains a good control effect [9]. Literature [10] used sliding mode control technology to develop the scheme of waypoint tracking for an underactuated autonomous underwater vehicle. e paper also proposes a method to develop robust controllers with model uncertainty and different types of disturbances. e above research on ship path tracking control basically uses the Fossen model. e control variables obtained by using the Fossen model are the lateral thrust, longitudinal thrust, and turning of the ship. For a full-drive ship, these control forces and moments need to be optimally calculated and then distributed to each propeller to achieve control. For single-propeller and single-rudder under-driven ships, these control forces and moments need to be further converted and mapped to rudder angle and diesel throttle. erefore, the control value obtained by using the Fossen model is far from the actual engineering application of the ship control system [11].
For this, the trajectory tracking control for underactuated ship was designed based on the separation model proposed by mathematical model group (MMG) [12]. By defining a control variable chattering measurement variable and a reinforced learning signal, the parameters of neural network can be adjusted online, which can further suppress the chattering effect of the control variable. In reference to the problem of underactuated ship trajectory tracking control, with the reinforcement learning method [13], the neural network-based adaptive ISMC method is proposed for ship with the MMG model. e design of the controller directly obtains the control variables such as diesel engine speed and rudder angle, which promotes engineering applications. Shen et al. [14] proposed a minimum parameter adaptive recursive sliding mode control strategy, in the timevarying range; the output limited range is effectively expanded, which is more in line with actual offshore engineering applications [15].
With the development of intelligent control technology [16], some intelligent control methods [17] are continuously integrated into the towing-driven track control. For example, in the design of dynamical loop, Zhang et al. [18] designed the adaptive law of neural network weights and realized the online estimation of system nonlinearity and the design of actual control law. e effective tracking of the path of a 32 m long single under-driven ship is realized. Aiming at the problem of difficult parameter tuning and poor anti-interference ability in conventional nonlinear autodisturbance rejection control in ships' trajectory control, neural network is adopted to identify the system, and the two parameters have a greater influence on the overall control effect [19]. Aiming at the problems of complex control environment, low controller stability, and large amount of algorithm calculations faced by the track tracking control of smart ships, the deep deterministic strategy gradient algorithm is used as the realization of the controller, and the offline learning method is used to train the controller. To achieve precise control of tracking [20], Dai [21] used the turbidity particle swarm algorithm with shrinkage factor to solve multiple parameter optimization problems in the iterative sliding mode controller for automatic berthing of underdriven ships and realized the automatic berthing of 5446TEU container ships under the disturbance of wind and waves through computer simulation. In literature [22], the adaptive sliding mode control for ship heading is designed with the genetic optimization algorithm. In underactuated ship motion control scheme, the sliding mode surface feedback method is proposed for ship motion. It can be seen from literatures [16][17][18][19][20] that a better control effect can be achieved after using intelligent methods to optimize the controller parameters.
Inspired by the observations mentioned above, the paper introduces the hyperbolic tangent function to design the iterative sliding mode system and proposes the differential evolution algorithm based an adaptive ISMC method for ship [23]. e method is applied to path tracking of underactuated ship. In addition, a control parameter optimization system is constructed to improve the control quality and enhance robustness of the control system. e system takes the status of track yaw, heading deviation, and rudder angle chattering as input, and the differential evolution algorithm is adopted to solve the minimum output optimal controller parameters. Finally, with a type of container ship as the goal, the ship path tracking control simulation is carried out, under the disturbance environment such as wind and waves, and the simulation results of the iterative sliding mode controller are compared and analyzed.

Problem Description
At present, the Fossen ship motion model [24] is used to study ship trajectory tracking control. e calculated output is usually three control variables of ship longitudinal and lateral thrust and turning moment. For conventional underdriven ships with one propeller and one rudder, these three control variables need to be converted. It is the set speed of the diesel engine and the command rudder angle of the steering gear.
erefore, compared with the actual application of ship control, the control quantity designed by the Fossen model cannot be used directly. In order to be consistent with the actual engineering application, this article will design the controller based on the MMG separate model to directly obtain the control variables such as diesel engine rotation speed and rudder angle. e MMG model [14,15] of the horizontal motion of the under-driven ship can be expressed as follows: 2 Computational Intelligence and Neuroscience where X H , Y H , and N H , which are generated by the fluid power of a bare hull, respectively, represent the longitudinal force, lateral force, and rotational moment; X P , Y P , and N P , respectively, represent the longitudinal force, lateral force, and rotational moment of propeller; X R , Y R , and N R stand for the longitudinal force, lateral force, and rotational moment of rudder, respectively; X wind , Y wind , and N wind , which are produced by wind, respectively, represent the longitudinal force, lateral force, and rotational moment; X wave , Y wave , and N wave , which are produced by wave, respectively, represent the longitudinal force, lateral force, and rotational moment; m represents the ship's mass; and m x and m y represent the additional ship's mass in the longitudinal and transverse directions. I and J represent the moment of inertia of the ship, respectively; u stands for the ship's longitudinal speed; u c stands for the current speed; v stands for the ship's lateral speed; r stands for the rotation speed; x and y stand for the ship's longitudinal and lateral position; φ stands for the ship's heading; and φ c stands for the current direction.
In the realization of ship trajectory tracking control, the definition of trajectory error is very important. e definition of trajectory error in this article is shown in Figure 1, where O(x d , y d ) stands for the preset point of trajectory in geographical coordinates; G(x, y) stands for the actual ship point of tracking trajectory in ship's coordinates; D stands for the distance of two points; φ r stands for the expected ship's heading; and x e and y e stand for the deviation of longitudinal and lateral of trajectory. If the two errors of x e and y e can be controlled near zero, then it can be considered that the ship is tracking the expected trajectory.
Assuming that the expected point of the trajectory points to the actual point and the direction angle is θ, the following equation is obtained from Figure 1: en, the design goal of the system controller is as follows: for the ship's MMG model as equation (1) and the ship's trajectory tracking error as equation (2), an adaptive tracking control method is designed to ensure the asymptotic convergence of all signals of the system at the same time and the under-driven ship can track the preset trajectory in a limited time.

Design of Tracking Controller of Ship Motion
e following theorem is given first: Theorem 1. Consider a zero-order nonlinear scalar system: where x represents the state variables, u represents the input, and y represents the output.
Consider the following three assumptions: (1) e state function is defined as _ x � g(u), and g(u) represents continuous function with boundness (2) e bounded nonlinear continuous function is regarded as f(x, u, t) with boundness (3) e sign of the gain of the control input is known, and it is assumed that (zf/zu) > 0 Construct the following feedback control law: x e y e ψ ψ r track G (x,y) Computational Intelligence and Neuroscience where k p > 0 and ε > 0. en, system (3) can achieve uniform asymptotic stability under the control law (4).
Proof. Taking the derivative of equation (4), it can be obtained that Construct the Lyapunov function as Taking the derivative of equation (6) and substituting equations (4) and (5), it can be referred that Considering (zf/zu) > 0, the following inequality is obtained with constants k p and ε: Further, the following results can be obtained: erefore, with the Lyapunov theory, the zero-order nonlinear scalar system in (3) is uniformly asymptotically stable, and eorem 1 holds.
It is considered that u ≫ |v|, and the longitudinal and lateral components of the rudder force are much smaller than the torque, and the angle is smaller than the right angle.
erefore, first try to derive the monotonic function relationship between the constructed highestorder sliding mode surface σ 4 and the rudder angle δ, then use eorem 1 to design the feedback control law, and prove that the track deviation y e converges asymptotically.
According to the MMG ship model in equation (1), it can be obtained by expanding σ 1 as follows: where σ 1 is revisited as output y, in equation (4). Considering that σ 1 is controlled by φ e , in equation (13), φ e can be regarded as the control variable u. It is obtained that σ 1 is a continuous bounded nonlinear function. It can be referred to as follows: In order to prevent the ship from sailing in the reverse direction, it can be assumed that, at initial time, the heading deviation angle φ is set as |φ| < π/2. It is known that u ≫ |v| by assumption (1). erefore, it can be obtained that equation (14) satisfies the condition, which is greater than zero based on the nature of trigonometric function. Further, the control law is designed as According to eorem 1, then with the control law in equation (15), equation (14) can achieve asymptotic stability, that is, σ 1 ⟶ 0. From the first equation of equation (11), it can be obtained that _ y e ⟶ − k 1 tanh k 0 y e . (16) erefore, the track deviation y e is also asymptotically stable. So, if only σ 4 ⟶ 0 is realized, the track deviation y e can be guaranteed to converge stably.
In order to achieve σ 4 ⟶ 0, the following sliding mode surface feedback control law is adopted: where k 5 ∈ R + and ε ∈ R + .

Computational Intelligence and Neuroscience
After fully expanding σ 4 in equation (10), it can be referred that Calculating the partial derivative of equation (18) for δ, considering that only the rudder torque N R , the rudder lateral component force X R , and the rudder longitudinal component force Y R are related to the input rudder angle δ, it can be obtained that where N R � h(x) · cos(δ) · sin(α R ), h(x) stands for a function with positive value, δ stands for the rudder angle, and α R stands for the effective angle of attack, which is related to δ. So, (zN R /zδ) > 0 is established, with constrained δ ∈ (− 35°, 35°). Considering the actual steering, the longitudinal and lateral components of rudder force X R and Y R and their gain are much smaller than the torque N R .
According to the boundedness of trigonometric functions and hyperbolic trigonometric functions, there is k 2 such that the following equation holds: erefore, from equations (17) and (20) and eorem 1, it can be obtained that σ 4 converges to zero asymptotically, so as to ensure the asymptotic convergence of the track deviation y e and realize the path tracking target.

Optimization of Controller Parameters Based on Differential Evolution Algorithm.
From the ship's handling characteristics, it can be known that the ship's roll and interference will cause the control rudder angle to fluctuate back and forth. If the controller design is unreasonable or the parameters are not appropriate, the frequency and amplitude of such fluctuations will be increased. To prolong the life of equipment and to make control effect close to actual steering requirements, the chattering output of the rudder should be reduced as much as possible. erefore, if the designed ISMC is adaptive, the system control performance will be improved.
It is obtained that the parameter k 5 has great impact on quality and robustness of control system in equation (17). Similarly, k 0 ∼k 4 will also have a certain influence on control performance. So, the optimization problem in this paper is to find the best controller parameters in the case of external disturbances, and the designed optimization algorithm can make these parameters adaptive and dynamic adjustment when the external disturbances change.
For this reason, the abovementioned control parameter optimization system is designed to adjust the controller parameters k 0 ∼k 5 by the change of the track deviation. Meanwhile, a kind of chattering measurement variable is defined, with the differential evolution algorithm (DEA), and the online optimization of the system is constructed [25,26] to reduce the output chattering amount of the control input. So, DEA-based adaptive ISMC is designed for ship's path tracking, as shown in Figure 2. In the parameter optimizer, an optimization system [27,28] is designed, which takes the track deviation y e as the input to realize the adaptive adjustment of the control parameters k 0 ∼k 5 . Its input is the track deviation y e and the control rudder angle δ.
e parameter optimization problem of controller is to determine a set of appropriate initial parameters and select indicators to measure whether the initial values of the parameters are optimal. Select the following evaluation indicators: where J is the performance index, y e is the track deviation, φ e is the heading deviation, δ stands for the rudder angle chattering, r represents the rate of turning (ROT), N represents the total number of iteration, and λ 1 ∼λ 4 stand for the coefficients. Its size is generally based on the environmental conditions of the sailing waters. e measurement of rudder angle buffeting δ in equation (21) is calculated using the following publicity [15]: where M represents the expected rudder angle chattering value, which depends on the designer's requirements for system chattering. M is defined as the cumulative sum of the absolute value within n iterations. If the value of M increases in n cycles, it means that chattering increases; conversely, if the value of M decreases in n cycles, it means that chattering decreases. erefore, the change of M can be adjusted. e calculation of M is described as Computational Intelligence and Neuroscience where T represents the simulation period, δ(t − lT) and δ[t − (l − 1)T] are the rudder angle values of different periods before and after, n is the number of accumulation (take n � 50), and ρ k (l) is defined as follows: When chattering occurs in the output of the system, the change trend of the output will change, in equation (24). Combined with equation (23), the chattering change of output will be acquired in last cycle. e complete tracking route is used as the optimized data.
e process of optimizing parameters is shown in Figure 3. e transition between the DEA and the Simulink model is the individual gene (parameters of ISMC) and fitness of individual. e DEA module assigns individuals to parameters by receiving the performance index. e Simulink module exports the performance index by receiving individuals corresponding to parameters.
In detail, the process of optimizing parameters of DEAbased ISMC is described.
Step 1. Initialize gene population and parameters. Randomly generate an initial gene individual x i (0) as follows: where x U and x L stand for the individual's upper and lower bounds, and the range of rand(i) is [0, 1].
Step 2. e initial gene population is assigned to k 0 ∼k 5 , and the parameters are transmitted to the controller to control the ship to perform the track tracking operation and then calculate the performance index function J according to equation (21) and further judge whether the termination condition is met. If the termination conditions are met, the evolution ends and the algorithm exits; otherwise, it proceeds to Step 3.
Step 3 (mutation operation). Randomly select x p 1 ,j , x p 2 ,j , and x p 3 ,j three individuals different from x i,j from j-th generation population to perform mutation operations to generate a variant gene individual h i,j (t + 1).
where p 1 ∼p 3 are numbers, and i ≠ p 1 ≠ p 2 ≠ p 3 ; G is evolutionary algebra, j < G; and F(·) is a factor.
Step 4 (cross operation). Generate new individual v i (t + 1) with variant individual h i,j (t + 1) and evolution individual x i,j (t), which can enhance diversity.
Step 5. With the greedy strategy, select and operate to generate next-generation population individuals. x i (t + 1) is chosen by f(·). Generate next-generation particles, and return to Step 2, and repeat the evolution operation until the maximum evolution algebra G is reached.
where f(·) � 1/J and J represents performance index function.

Research on Computer Simulation of Ship Path following Control
In this part, the ship trajectory integration control system designed in section 3 will be verified through computer simulation. Emphasis is placed on the automatic optimization of the iterative sliding mode control parameters by the online optimization system designed by the differential evolution algorithm in the case of external interference so as to realize the adaptive adjustment of the parameters. e paper uses the 5446TEU container ship in [14] as the object to carry out path tracking control simulation to verify the designed controller. At the same time, the wind and wave interference model of the MMG separation ship motion model adopts the calculation method of literature [14]. In the test, the initial coordinates of the ship are (0, 0), and the initial speed is 20 kn. e center of the tracking circle is (2000,2000), and the radius is 2000 m. At the same time, environmental factors are set as follows: wind speed is 15 m/s; wind direction is 140°; current speed is 2.5 m/s; current direction is 160°; wave height is 4 m, and encounter frequency is 0.6 Hz.
e ISMC and the DEA-based ISMC are designed separately, which are used to simulate the ship path tracking. e parameter ε in the feedback controller is set to 0.001, and the expected rudder angle chattering value M is set to 0.1. e controller design parameters k 0 ∼k 5 are obtained through an optimization system based on the differential evolution algorithm (DEA), and parameters are preset as follows: G � 50, CR � 0.85, F � 0.35, and G � 50. e fitness function change curve of the differential evolution algorithm is shown in Figure 4, which reflects the evolution process. Figures 5-8 are the curves of the trajectory, trajectory error, rudder angle, and parameter changes during the simulation experiment of the setting circular path tracking under the set working conditions of the ship.
It is obtained that the iterative sliding mode algorithm (ISMA) and the DEA-based iterative sliding mode algorithm (DEA-ISMA) have quickly kept up with the target path, but the tracking error of the ISMA is larger from Figure 5. It can be seen more intuitively from Figure 6 that the ISMA method and the DEA-ISMA method are applied to path tracking with a stable time of about 300 s. However, the ISMA method has always had a large error. It is not difficult to find from Figure 7 that the maximum rudder angle of ship using the ISMA is about 20°, while the maximum rudder angle of ship using the DEA-ISMA method is only 12°. Degrees of oscillation of rudder angle are smaller, steering gear will not be excessively worn, and the actual sailing requirements of ship are satisfied. It can be seen from Figure 8 that the parameters k 0 ∼k 5 change drastically at the beginning, and the relative amplitude is relatively large.     Computational Intelligence and Neuroscience When the path is not tracked, adjust k 0 ∼k 5 to a greater extent to reduce the error as soon as possible. After tracking, adjust in a small range. e parameters are only to eliminate chattering, and the DEA-based optimization system realizes the dynamic adjustment of the parameters. It can be obtained that the DEA-ISMA method has better control effect than the ISMA method, which is more stable, more accurate, and more consistent. It is more in line with the actual requirements of the project from Figure 5

Conclusions
Taking into account the actual engineering requirements of ship path tracking control, starting from the MMG ship model, the idea of swarm intelligence optimization is used for reference, and DEA is proposed. And the DEA-based adaptive ISMC method is applied to path tracking of underactuated ship. e calculation example shows that, compared with the ISMA method, the DEA-ISMA method is more robust, more accurate path tracking, long effective range at the same time, and higher efficiency. Similarly, compared with iterative sliding mode, the rudder angle buffeting obtained by the controller is significantly reduced, which can effectively protect the rudder gear, which is conducive to energy saving and more in line with actual engineering needs.
Data Availability e relevant data used for experimental verification have been listed in the text.

Conflicts of Interest
e authors declare that there are no conflicts of interest.

Authors' Contributions
All authors contributed equally to this work.  Computational Intelligence and Neuroscience 9