# Research on AGV Path Planning Integrating an Improved A* Algorithm and DWA Algorithm
## 3 Improvement of the DWA Algorithm
### Improvements to the DWA Algorithm  
To ensure the safety of the mobile robot in the global path, the traditional DWA algorithm stipulates that the weight of the evaluation subfunction for the nearest distance between the robot and obstacles should always be larger than the weight of other subfunctions. However, in environments with more obstacles, this can lead to a local optimal state, increasing the robot's moving distance [27]. To address these problems, this paper designs an azimuth evaluation subfunction \(Heading(v,\omega)\) that fuses the global path nodes, representing the azimuth deviation between the current path node and the predicted target node. Additionally, two evaluation subfunctions for the robot's distance to obstacles are designed: \(dist\_sta(v,\omega)\) and \(dist\_dyna(v,\omega)\). The \(dist\_sta(v,\omega)\) subfunction evaluates the nearest distance between the mobile robot and the known obstacles in the global path nodes, while the \(dist\_dyna(v,\omega)\) subfunction evaluates the nearest distance between the mobile robot and unknown obstacles in the local path nodes. The evaluation function can be expressed as follows:  
\[\begin{array}{c}G(v,\omega)=\alpha Heading(v,\omega)+\beta vel(v,\omega)+\\ \gamma dist\_sta(v,\omega)+\delta dist\_dyna(v,\omega)\end{array} \tag{13}\]  
where \(\alpha,\beta,\gamma\) and \(\delta\) are the weighting coefficients of the four evaluation subfunctions, which are used to set different weights.  
\(Heading(v,\omega)\) represents the azimuthal deviation \(\Delta\varphi\) of the predicted trajectory direction from the global path nodes. It updates the current goal point in the order of the global path nodes and updates in real-time when a new goal node is reached, facilitating the dynamic setting of the goal node. \(dist\_sta(v,\omega)\) evaluates the closest distance of the mobile robot to known obstacles in the global path, reducing their interference in global path planning and avoiding the increased moving distances caused by local path planning away from obstacles. \(dist\_dyna(v,\omega)\) evaluates the closest distance of the mobile robot to unknown obstacles in local path planning, enhancing the robot's ability to avoid unknown obstacles by increasing its weighting coefficients. After introducing the new subfunctions, by adjusting the weighting coefficients \(\gamma\) and \(\delta\), the interference of known obstacles on global path planning can be reduced, and the obstacle avoidance ability for unknown obstacles can be improved.  
To verify the path planning effectiveness of the improved DWA algorithm, this paper conducts simulation experiments to compare and validate the results. The experiments use the same start and end points, setting the grid map size to 20 \(\times\) 20 with a unit length of 1 m. The experimental results are shown in Figure 7. In Figure 7a, the traditional DWA algorithm prioritizes real-time and dynamic adaptation in the path planning process at the expense of the global optimum. This leads to the creation of local paths that deviate from the optimal paths, increasing the unnecessary path lengths in complex environments. Additionally, AGVs collide with obstacles during movement, reducing path safety. In Figure 7b, the improved DWA algorithm effectively addresses the local optimum issue and shortens the path length. The improved path length is 16.401 m compared to the 19.255 m path planned by the traditional DWA algorithm, resulting in a reduction of 2.854 m or 14.8%. The closest distance to obstacles is increased by 0.56 m, an improvement of 56%, enhancing the safety of the AGV during movement and reducing the risk of collisions with obstacles.  
Figure 7: Path diagrams of traditional DWA algorithm and improved DWA algorithm. (**a**) Traditional DWA algorithm path. (**b**) Improved DWA algorithm path.