## 2 Materials and Methods
### Automatic Deviation Correction Control Strategy
#### 2.2.2 Path Planning Research  
The main research aim is to generate a path from the starting point \(P_{0}\) to the endpoint \(P_{1}\) of the driving cycle, which satisfies the kinematic constraints, as a reference for driving the body motion of the roadheader. To ensure that the path is feasible, the following constraints should be met [28]:  
The first derivative of the path curve function is continuous. The tangent of the starting point on the path is consistent with the initial speed direction of the roadheader, and the tangent direction of the endpoint on the path is consistent with the roadway centerline (i.e., \(Y\) axis). The curvature of each point on the path should be continuous and bounded. The trajectories satisfying the above conditions include plane curves, such as polynomial fitting curves and Bezier curves. Polynomial Fitting Path  
If the above constraint conditions are to be met, at least cubic polynomial curve shall be used. The general formula of a polynomial is:  
\[x=ay^{3}+by^{2}+cy+d \tag{3}\]  
The classification and discussion according to different cycle endpoints are as follows:  
1. \(|e_{1}|\leq\,|e_{0}|\)  
At this time, the target point \(P_{1}\) is set on an extension line in the initial speed direction. Clearly, the planned path is a straight line, starting from \(P_{0}\) and ending at \(P_{1}\). The curve equation is:  
\[x=y\tan\alpha_{0}+e_{0},(0\leq y\leq L_{c}) \tag{4}\]\(|e_{1}|>|e_{0}|\) and \(|e_{0}|\leq[e]\)  
As shown in Figure 6, the target path is a cubic polynomial curve connecting the start point \(P_{0}\) and the endpoint \(P_{1}\). According to the constraint conditions, the polynomial boundary conditions are:  
\[\left\{ \begin{array}{l}x(0)=e_{0}\\ x(L_{c})=0\\ x^{\prime}(0)=\tan\alpha_{0}\\ x^{\prime}(L_{c})=0\end{array} \right. \tag{5}\]  
The first two constraints represent the position constraints of the roadheader at the starting point and the endpoint, respectively. The last two constraints represent the orientation constraints of the roadheader at the start and endpoints. In order to avoid the attitude sudden change of the roadheader when stared, the tangent vector of the start point is consistent with the direction of the initial speed. In order to correct the heading of the roadheader, the tangent vector at the endpoint is consistent with the Y axis. By substituting the boundary condition (5) into the general Formula (4), the coefficient can be obtained  
\[\left\{ \begin{array}{l}a=\dfrac{L_{c}\tan\alpha_{0}+2e_{0}}{L_{c}^{3}}\\ b=-\dfrac{2L_{c}\tan\alpha_{0}+3e_{0}}{L_{c}^{2}}\\ c=\tan\alpha_{0}\\ d=e_{0}\end{array} \right. \tag{6}\](3) \(\left|e_{1}\right|>\left|e_{0}\right|\) and \(\left|e_{0}\right|>\left[e\right]\)  
As shown in Figure 7, the solution of the curve equation is similar to the second case, and the boundary conditions are:  
\[\left\{ \begin{array}{l}y(0)=e_{0}\\ y(L_{c})=e_{0}\pm[e]\\ y^{\prime}(0)=\tan\alpha_{0}\\ y^{\prime}(L_{c})=0\end{array} \right. \tag{7}\]  
By substituting the boundary condition (7) into Equation (4), the coefficients can be obtained  
\[\left\{ \begin{array}{l}a=\dfrac{L_{c}\tan\alpha+2(e_{0}\pm[e])}{L_{c}^{3}} \\ b=-\dfrac{2L_{c}\tan\alpha+3(e_{0}\pm[e])}{L_{c}^{2}}\\ c=\tan\alpha_{0}\\ d=e_{0}\end{array} \right. \tag{8}\]  
The Bezier curve is a two-dimensional curve obtained by a recursive method according to the positions of starting point, endpoint and control point. The shape of the Bezier curve can be changed by adjusting the position of the control points. The n control point corresponds to the Bessel curve of order n - 1. The third-order Bessel curve has the following important characteristics: the derivative of the curve at t = 0 is the same as the slope (derivative) of P\({}_{0}\)C\({}_{1}\), and the derivative at t = 1 is the same as the slope (derivative) of C\({}_{2}\)P\({}_{1}\). Therefore, the third-order Bessel curve meets the requirements of path planning. The third-order Bezier curve needs two control points, C\({}_{1}\) and C\({}_{2}\).