# PK-APF: Path-Keeping Algorithm for USVs Based on Artificial Potential Field
###### Abstract
When the goal point attraction and the obstacle's repulsion are the same, a USV will stay in place and oscillate, unable to reach the goal point. At the same time, when a USV has avoided the current obstacles and there is no influence from other obstacles, it will sail straight to the goal point and cannot return to the original path due to obstacle avoidance and the effects of external factors such as wind and water waves, which cannot guarantee the high-precision path-keeping. In the literature related to APF improvement, [PERSON] [17] proposed the path planning and obstacle avoidance of multihug (underwater glider) formation by combining artificial potential field method and Kane method. When falling into the local minimum point, a virtual local coordinate is designated to replace the global goal. When escaping from the minimum point, the global goal is reassigned to guide the forward direction. [PERSON] [18] proposed to combine APF with a virtual structure to ensure effective formation, but the planned path would be complicated and prone to fall into a local minimum point collectively. [PERSON] [19] proposed that APF of local path planning can transform vector force into potential field, and APF with multiple subtargets can help USVs solve local minima and ensure an optimal path. [PERSON] [20] proposed the method of combining ant colony optimization and artificial potential field method to search for the global optimal path in the grid environment, and proposed the method of equipotential tangent circle to define the repulsive function and eliminate the situation where the goal point cannot be reached due to nearby obstacles and local minimum point. [PERSON] [21] proposed to adapt to the unpredictable environment and use the simulated artificial potential field method to carry out hierarchical path planning of USVs. By setting virtual return points on the global path and mixing the global path and local path, the disadvantage of USVs falling into local minimum points can be solved. Currently, there have been relatively perfect solutions to lane-keeping for automotive cars. In the literature related to car lane-keeping algorithms, [PERSON] [22] proposed the use of edge detection and aerial view to assist autonomous vehicles in lane recognition and keeping but only evaluated a closed-loop frame PID control system. [PERSON] [23] proposed using image sensors so that cars without lidar can accurately detect lanes and stay moving. However, in a complex road environment, the effectiveness of lane-keeping is weakened. [PERSON] [24] proposed to use CNN for lane-keeping in automatic driving. The parameters of CNN set before the test can be learned in real-time during driving to reduce the influence of data deviation. However, USVs often deviate from their original path during the navigation process due to winds, water waves, and obstacle avoidance. Traditional APF often has the following shortcomings in the navigation of USVs:  
* Traditional APF influences the navigation of USVs through attractive and repulsive forces whereas USVs stop when the attractive and repulsive forces are equal in magnitude and opposite in direction, and the resultant force on USVs is zero--that is, when it falls into a local minimum point;
* Traditional APF only focuses on USVs heading to the goal point and ignores the influences of obstacles and wind on the original planned path, thus, it fails to achieve high-precision path-keeping. Addressing the disadvantages of the traditional APF algorithm, the following improvements are made:  
* The idea of temporal force is proposed for USVs to escape from local minimum point and continue the navigation;
* The idea of virtual foot points is proposed to reduce the path deviation between the actual path and the planned path caused by the negative influence of obstacle avoidance, wind, and water waves in the process of autonomous navigation. In this paper, a high-precision path-keeping artificial potential method is proposed in Section 2. Section 3 describes simulations and high-fidelity experiments.