In robot local path planning, the traditional artificial potential field method is a simple and feasible algorithm. However, it suffers from issues of target unreachability and local minima. To address the problem of target unreachability, we introduce the distance term between the mobile robot and the target point in the repulsive function model, gradually reducing the influence of the repulsive potential field on the robot's movement towards the target point. To mitigate the issue of local minima, we employ the methods of repulsive angle deflection and virtual target points. Subsequently, we conduct experimental simulations using MATLAB, which yield results consistent with the analysis. The introduction of the distance between the robot and the target in the repulsive force function effectively solves the problem of target unreachability. Additionally, the issue of local minima can be overcome through the application of repulsive force angle deflection and virtual target points.