Sigmoid Function based Modelling and Route Tracking of Obstacle avoidance for Ship in Restricted Water

In order to solve the problem of obstacle avoidance of ship in restricted waters, a type of path planning method for obstacle avoidance based on sigmoid function was designed. Firstly, with the concept of path planning, sigmoid function was used to construct the trajectory of ship movement for obstacle avoidance on the basis of analyzing the process of ship obstacle avoidance and the geometric features of sigmoid function. Then, the route tracking in real time was achieved by ship motion control system based on active disturbance rejection control. The simulation shows that ship can ensure avoid obstacle and that the route built based on sigmoid function in confined waters is effective.


Introduction
The Yangtze River is a typical narrow waterway and it is one of the busiest waterways for ship transportation in China. Due to the frequent traffic of vessels in the waterway, the narrow width of the channel and the sedimentation caused by flood discharge in the upper reaches of the Yangtze River, it is more difficult for ship to navigate and avoid collisions when sailing in Yangtze River. In order to effectively solve that, domestic and foreign scholars used various methods to carry out theoretical application research from different angles.
The artificial potential field method [1] was used to introduce the ships maneuvering characteristics into the navigation planning gravity model and the repulsion model was established for avoiding obstacles, and then the gravitational-repulsive field was virtualized to realize the automatic obstacle avoidance of ship. On the basis of literature [1], the artificial intelligence field [2][3] was improved by the swarm intelligence method to overcome local minimum problem in potential field, so as to realize the automatic obstacle avoidance of the ship. In literature [4], the obstacle collision expansion zone was designed on the basis of collision risk, and the fuzzy rules were used to plan the strategy of ship's obstacle avoidance, which realized the intelligent collision avoidance purpose under multi-ship conditions. It was proposed by a prediction method based on elliptical collision cone [5] to derive the collision between predicted point and ellipse so as to improve the efficiency of obstacle avoidance for unmanned boat. And in literature [6], an obstacle avoidance algorithm was designed with local environmental information perception and fuzzy theory was used to improve the algorithm to reduce the risk avoidance error caused by the inertia of USV.
However, the above researched results ignored the actual situation of ship navigation and collision avoidance were focused on artificial intelligence technology which was too complex and too difficult to achieve collision avoidance, and which was not easy to understand for ship pilots and application. The obstacle avoidance tasks [7][8] was completed by constructing a preset path [9][10] combined with actual collision avoidance experience and the restrictions on the external conditions of the navigation. Therefore, this paper started from the usual safe practice of pilot with the concept of ship obstacle avoidance path planning and constructed a generalized sigmoid function curve to re-plan the route which could achieve the purpose of safe avoidance.

Ship's obstacle avoidance
In order to avoid navigational hazards, such as shallow waters, obstacles, etc., ship usually takes a change of course to keep away from the above-mentioned dangerous goods or dangerous areas, although this operation will cause deviation from the planned route. After clearance, ship's pilot will change course so that it will return to the original route. In the detailed analysis of ship operation described above for obstacle avoidance, it is not difficult to find ship's trajectory which is similar to the geometric of sigmoid function curve shown in Fig 1. Sigmoid function is the function of S type that is common in biology. In information science, the sigmoid function is often used as a threshold function of neural network. It can map variables to between 0 and 1. Through careful observation of the graph, it can be found that the trajectory depicted by the graph is very similar to the actual navigational trajectory of ship for obstacle avoidance. For this reason, this paper constructed a proper sigmoid function and applied it to ship motion route planning.

Safe passing distance
When ship traveled along sigmoid function curve, it can maintain a safe distance 1 D , from dangerous objects at any time. Considering that the ship was sailing in restricted waters, the width and depth of the channel were also limited, and the ship must maintain another safe distance 2 D , from the boundary of the fairway when it was driving. In order to further simplify subsequent modeling and computational complexity without sacrificing security, these two safety distance values were taken as the maximum value, that is In actual navigation, the above-mentioned value of the safety distance was generally determined according to the sailing experience of the ship driver.

Ship's trajectory Modeling in restricted waters
In this paper, a type of path planning [11] method for obstacle avoidance based on sigmoid function was designed. At the same time, taking into account the restrictions on the actual navigational waters of fairway, combined with the navigational direction of the ship, the X-axis is on the side of the channel where the hazard or obstruction is located, and the Y-axis is on the vertical channel, the initial position of the ship is the origin of the coordinates, a plane diagram displayed of ship's route is established in restricted waters based on the sigmoid function shown in Fig.1.

Modeling settings
Suppose 1, the fairway is a straight segment, not a curved one.
Suppose 2, the width of the navigable water area of the ship is W , where, the influence of the bank wall effect on the sailing route of the ship is not considered.
Suppose 3, the actual size of dangerous objects or impediments P is limited, and an arc region with a radius of r0 is approximated. Suppose 4, it is not considered the impact of wind and water flow on the yaw size of the ship, ie neglecting the influence of wind and water flow on the ship's navigational path.
Suppose 5, under initial conditions, the vessel can not safely avoid dangerous obstruction while sailing in a straight-line.
Suppose 6, during the obstacle avoidance process, the risk of collision with other ships does not considered.

Ship Trajectory Planning Based on sigmoid Function
Considering the constraints of the actual conditions of obstacle avoidance for ship in restricted water, ship hedging trajectory planning was designed based on sigmoid function, and the general mathematical expression of which was described as follows, In formula (1), variable x represents the longitudinal displacement in global coordinate system, and variable y represents the lateral displacement, a, b and c are the three undetermined parameters of the sigmoid curve, which can be obtained by actual qualification.
Based on the above assumptions, the navigation path, y = f ( x ), of ship in the actual hedging process was limited by the following conditions. Restriction 1: Minimum passing distance limit, that is, the minimum distance from the outermost Q point of the dangerous object or the actual dangerous area of the obstacle to the safe path sigmoid curve should be greater than or equal to the safe passing distance. d D ≥ (2) Where, D is the safe passing distance.
According to the Q point as the coordinate ( 1 x , 1 y ) and the sigmoid curve function, the minimum distance can be obtained as, 1 1 Restriction 2: Initial ship position deviation limit. c Ship Domain ≥ (7) In the formula, Ship Domain is the size of ship's field.

Ship's trajectory tracking control
In the actual situation, according to the preset obstacle avoidance trajectory, the process of ship's movement was firstly altering course by operating steering wheel and then operating. In order to simplify the simulation operation process, the paper designed a ship motion trajectory tracking control algorithm to realize the ship's automatic tracking obstacle avoidance trajectory. The control idea was to construct a ship trajectory tracking algorithm based on ship movement mathematical model and auto disturbance rejection control theory.

Ship Motion Equation
The mathematical model of nonlinear ship motion control system with external disturbance and system parameter perturbation [12] was: In formula, K and T represent ship's cycle index and follow-up index, ϕ is ship's heading and δ is rudder angle. H ϕ  ( ) is a nonlinear function that can be approximated as H ϕ αϕ α ϕ α ϕ Where, ( ) i α i =1,2,3, is a real value constant.
For formula (8), by making the following settings, x ϕ =  , it can be converted to formula (10).
Where, 1 x and 2 x are system variable, 2 ( ) f x is unknown function of system, g is known gain of control input, , y is the actual output of the system.

Ship trajectory linear auto disturbance rejection control
According to the ship mathematical model expression (10), a linear auto-disturbance disturbance tracking control algorithm [11] for ship motion trajectory was designed. It is well known that the linear auto-disturbance rejection controller consists of three parts: a Linear Tracking Differentiator (LTD), a Linear Combination (LSEF), and a Linearly Extended State Observer (LESO).
(1) LTD LTD replaces the differential link of traditional PID control, which not only solves the contradiction between PID tracking fastness and overshoot, but also avoids the problem of rapid fluctuation of control input signal. The discretization form of the LTD algorithm is: is target input signal, h is system simulation step size, k is number of samples, 1 ( ) v k and 2 ( ) v k are the tracking value of the sum respectively, 1 k and 2 k are system designed parameters.
(2) LESO The function of LESO is to treat model uncertainty and external disturbance as an overall disturbance and observe it. The second-order linear auto-disturbance rejection controller used the third-order LESO to observe the disturbance quantity. The discrete expression of the thirdorder LESO is:  (3) Linear state error feedback control law The LSEF is essentially a linear PD control law whose discrete form of algorithm is: The control law 0 u is a linear combination of the differential of error 1 e and error 2 e . In order to eliminate the total unknown interference, it is necessary to cancel these unknown disturbances before inputting the controlled object execution mechanism. The actual control effect on the controlled object executing mechanism can be expressed as the following discrete form: 5 Simulation

Simulation conditions
The simulation of obstacle avoidance for ship in limited waters was carried out by the trainee in the literature [12].The effective width of proposed channel was 200m, and ship traveled along the channel. The initial position of the ship was 30m to the right of the center of the channel, and there was an obstacle at about 700m in front of it. Through the investigation and analysis of the actual situation of the Yangtze River channel, it was difficult to measure and determine the safety distance between ship and obstacle, and between ship and the boundary of the channel. Considering that the width of the entire channel was only 200m, the safety distance for obstacle avoidance should not be too large, therefore, it had been taken 50m temporarily.

Simulation results
The ship navigation trajectory was modeled for obstacle avoidance by route planning on the basisi of sigmoid function, and the tracking control algorithm of which was designed by linear auto disturbance rejection control theory. The trajectory of the ship in the process of obstacle avoidance was shown in Figure 2, the change of the rudder angle of the ship was shown in Figure 3, and the change of the ship's heading was shown in Figure 4. It could be clearly seen from Fig.2 that the ship's motion trajectory perfectly tracked the sigmoid function curve and maintained a safe distance with obstacles throughout the process, fully demonstrating that the sigmoid function curve could be used for obstacle avoidance in narrow waterway. Figure 3 was the real-time curve of the ship's control rudder angle during the ship's obstacle avoidance process. The curve trend was in accordance with the change operation of the rudder angle during the actual obstacle avoidance operation. Figure 4 was a real-time change curve of the ship's heading change. It could also objectively reflect the change of the ship's heading during the actual obstacle avoidance process of the ship's pilot, which was in line with the actual situation. Therefore, the sigmoid function curve could be used for the trajectory planning of obstacle-avoided for ship in narrow-water. With the concept of path planning, sigmoid function was used to construct the trajectory of ship movement for obstacle avoidance on the basis of analyzing the process of ship obstacle avoidance and the geometric features of sigmoid function. Then, the route tracking in real time was achieved by ship motion control system based on active disturbance rejection control. The simulation shows that ship can ensure avoid obstacle and that the route built based on sigmoid function in confined waters is effective. In view of the fact that the model was based on a more ideal situation, it ignored the collision risk situation with other ships and the influence of fairway water flow on vessel trajectory tracking. Therefore, the follow-up study should be further expanded.