# Trajectory Planning of Shape-Following Laser Cleaning Robot for the Aircraft Radar Radome Coating
## 2 Materials and Methods
### Laser Cleaning Robot Trajectory Planning
#### 2.3.3 Execute Point Fitting to Generate Cleaning Robot Trajectory  
Discrete Point Fitting for Generating Cleaning Robot Trajectory  
In accordance with the requirements of laser cleaning tasks performed by the cleaning robot, the vertical distance from the laser cleaning actuator to the surface of the target workpiece was denoted as \(L\). The trajectory parameters of the laser cleaning actuator can be obtained using the following offset algorithm:  
\[Q_{j}=u_{s_{j}}+L\frac{\mathbf{u}_{j}}{\|\mathbf{u}_{j}\|} \tag{18}\]  
As shown in Figure 10, the point \(Q_{j}\) includes the position (coordinate values) and directional information (opposite to the direction of \(\mathbf{u}_{j}\)) of the end effector of the laser cleaning actuator. To obtain the offset point set \(Q\), a similar method was applied to traverse all points in the sampling point set \(R\). Consequently, the information contained in the entire point set \(Q\) represented the trajectory parameters (position and direction) of the laser cleaning device on the operating surface during the cleaning process. B-spline curves are derived from the basis of Bezier curves, which were introduced by [PERSON] in the 1940s [25] and later formulated recursively by [PERSON] [26; 27] and [PERSON] [28]. The recursive nature of B-spline curves makes the computation straightforward and stable, leading to widespread adoption. These curves are generated by combining control points with B-spline basis functions to define the shape of the curve. In this paper, B-splines were employed for curve fitting purposes. The mathematical expression for a \(p\)th-degree B-spline curve is given by Equation (19). By connecting the respective execution points, a continuous path was formed, which can be transformed into a specific model of laser cleaning robot's motion program. This enabled automated laser cleaning of the workpiece surface for coating removal. \[C(d)=\sum_{t=0}^{s}N_{t,p}(d)b_{t}\qquad l_{1}\leq d\leq l_{2} \tag{19}\]  
where \(p\) represents the degree of the spline curve and \(\{b_{t}\}\) denotes the control points of the curve. The control polygon, formed by connecting the control points in a specific order, is referred to as the control polygon of the curve. Typically, the parameter values \(l_{1}=0\) and \(l_{2}=1\) are used. \(N_{t,p}(d)\) represents the basis function of a pth-degree B-spline curve, as given by Equation (21), which is defined as a piecewise polynomial function determined by the knot vector \(D=\{d_{0},d_{1},\cdots,d_{\varepsilon}\}\). The knot vector is a non-decreasing sequence composed of all the knots. In B-spline curves, the first and last control points are typically used as the start and end points of the curve, while the intermediate control points serve as the breakpoints or knots of the curve. To ensure that the \(p\)th-degree spline curve passes through the first and last control points, the first and last knots are repeated \(p\)+1 times. In this paper, the knot vector was parameterized using the cumulative chord length method, as shown in Equation (20). \[\left\{ \begin{array}{l}d_{0}=d_{1}=d_{2}=d_{3}=0\\ d_{j+3}=d_{j+2}+\left|\Delta q\right|\right|\!,j=1,2,\cdots,s-1\\ d_{s+3}=d_{s+4}=d_{s+5}=d_{s+6}=1\end{array} \right. \tag{20}\]  
where \(\Delta q_{j}=\frac{q_{j}-q_{j-1}}{\sum_{j=1}^{3}\left|q_{j}-q_{j-1}\right|}\) represents the normalized chord length vector. \[\left\{\begin{array}{l}N_{t,p}(d)=\left\{ \begin{array}{l}1,\quad d_{t}\leq d \leq d_{t+1}\\ 0,\;others\end{array} \right.\\ N_{t,p}(d)=\frac{d-d_{t}}{d_{t+p}-d_{t}}N_{t,p-1}(d)+\frac{d_{t+p+1}-d}{d_{t+ p+1}-d_{t+1}}N_{t+1,p-1}(d)\\ \text{set}: \begin{array}{l}0\\ 0\end{array} \right. \tag{21}\]  
where the number of control points are \((s+1)\), the degree of the spline curve (\(p\)) and the number of knots \((e+1)\) satisfies \(e=s+1+p\). Once the degree (\(p\)) and the knot vector (\(D\)) are determined, the basis functions of the B-spline curve can be computed. Figure 10: The position and direction of the laser cleaner at point \(u_{s}\).