## 3 Path-following Control Based on Improved LOS
### Improved LOS
#### 3.2.2 Adaptive Heading Control Strategy  
The traditional LOS follows the current path by calculating the heading angle and tilt error based on the position error and then calculates the control volume. However, the adjustment time and following distance of this method are long for large position errors. To address this issue, an adaptive heading control strategy is proposed in this paper. This strategy introduces a scaling coefficient to adjust the priority of parallel and vertical paths based on the distance relationship between the robot and the path. To achieve fast, stable, and accurate path following, this paper addresses the problem of large path-following errors and slow convergence speeds to achieve fast, stable, and accurate path following. Figure 7 presents the adaptive heading control strategy. In this strategy, \(P_{i-1}P_{i}\) is the current path segment for following, \(P_{i}(x_{i},y_{i},z_{i})\) is the coordinates of the path point, \(P\) is the position of the robot, and \(P^{\prime}\) represents the robot's projected position on the path segment. In Figure 7, the vector \(n^{t}\) corresponds to the direction of the velocity, \(V\). As shown in Figure 4, the velocity of the robot can be decomposed into \(Vcos\gamma\) components in the horizontal direction and \(Vsin\gamma\) components in the vertical direction. Additionally, the \(Vcos\gamma\) component in the horizontal direction can be further decomposed into x-axis and y-axis components based on the trajectory inclination. Figure 7: Schematic of heading control. The adaptive heading control strategy in this paper introduces a scaling coefficient, \(m\), to regulate the priority between vertical and horizontal following exclusively while not interfering with the vector components in the \(x\)_-axis_ direction and \(y\)_-axis_ direction components within the horizontal following. Therefore, a 2D coordinate system, \(\hat{z}-\hat{h}\), composed of horizontal and vertical axes is employed. As shown in Figure 7, the workflow of the velocity control strategy for each path segment of the robot in the _xoy_ plane is as follows:  
1. The start and end points of the current path segment are designated as \(P_{i-1}\) and \(P_{i}\), respectively. The robot's path following involves closed-loop control of the current path segment. The next path segment is then controlled in a similar way. 2. The point \(P\) represents the robot's centroid. \(P^{\prime}\) is defined as the projection of \(P\) onto the linear path. \(d_{l}\) refers to the distance between the robot and the planned path. 3. The vector \(n^{t}\) represents the forward direction of the robot at time \(t\). The vector \(n^{t}_{\parallel}\) is the parallel projection of \(n^{t}\) onto the segment \(P_{i-1}P_{i}\), while \(n^{t}_{\perp}\) is the orthogonal vector to \(n^{t}_{\parallel}\), thus representing the vertical vector of the segment, \(\hat{P}_{i-1}P_{i}\). 4. The letter m is defined as the scaling coefficient of the distance, \(d_{l}\), between the robot centroid, \(P\), and the planned path; thus, the forward direction vector of the control robot is \[n^{t}=\frac{md_{l}}{1+md_{l}}n^{t}_{\perp}+\frac{1}{1+md_{l}}n^{t}_{\parallel}\] (6)  
Equation (6) shows that if the value of the scaling coefficient \(m\) is close to 0, the coefficient of \(n^{t}_{\perp}\) approximates to 0 while the coefficient of \(n^{t}_{\parallel}\) approximates to 1. This causes the robot to advance in the direction parallel to the path. Conversely, if the scaling coefficient, \(m\), is close to \(\infty\), the robot advances in the vertical direction to the path. Altering parameter \(m\) provides different path-following priorities. To facilitate analysis, Equation (6) can be rewritten as follows:  
\[n^{t}=\frac{1}{1+\frac{1}{md_{l}}}n^{t}_{\perp}+\frac{1}{1+md_{l}}n^{t}_{ \parallel} \tag{7}\]  
At a greater distance from the planning path, the value of \(d_{l}\) increases, causing the scaling coefficient of \(n^{t}_{\perp}\) to exceed that of \(n^{t}_{\parallel}\).