# Design and Optimization of Non-Coplanar Orbits for Orbital Photovoltaic Panel Cleaning Robots
## 2 Construction of Models
### Smoothing and Optimization
#### 3.2.2 Optimization of Non-Coplanar Trajectories  
The designed Bezier curve is optimized according to the optimization model presented in Section 2.4. The optimization function employs the FMINCON function in MATLAB, utilizing the Sequential Quadratic Programming (SQP) algorithm to enhance convergence speed. The optimization process is ultimately completed after nine iterations, with a total simulation time of approximately 0.08 s. The optimization objective is defined as the average of the minimum distances between the Bezier curve and the data points in the point set during the spanning motion phase. Additionally, azimuthal and curvature constraints are established to facilitate the determination of the scaling parameter, thereby achieving the optimization of the Bezier curve. The final optimization problem can be described as follows: optimize the Bezier curve by Equation (17) to obtain the scaling parameters that satisfy the constraints. The optimized proportional parameters are illustrated in Table 2.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Bezier Curve** & **Scale Parameter** & **Unoptimized** & **Optimized** \\ \hline \multirow{2}{*}{Curve 1} & \(r_{11}\) & 0.040 mm & 0.025 mm \\  & \(r_{12}\) & 0.033 mm & 0.020 mm \\ \hline \multirow{2}{*}{Curve 2} & \(r_{21}\) & 0.033 mm & 0.020 mm \\  & \(r_{22}\) & 0.029 mm & 0.017 mm \\ \hline \hline \end{tabular}
\end{table}
Table 2: The optimized proportional parameters.  
Figure 6: The motion trajectories of the cleaning robot during phases A (translation), B (spanning motion), and C (translation).  
Figure 7: The effects of the smoothing process of Stage B during one working cycle.  
The optimized Bezier curve equation can be derived by substituting the optimized scale parameters from Table 2 into Equation (10). The tangent vector \(n_{1}\) is calculated by taking the difference between vertex 2 and vertex 1 of PV panel 1, as illustrated in Table 1. Similarly, \(n_{2}\) is determined by calculating the difference between vertex 1 and vertex 2 of PV panel 2 in Table 1. Specifically, \(n_{1}=(-1600,\ 0,\ 0)\) and \(n_{2}=(-1586.17,\ 201.91,\ 57.49)\). The vectors \(n_{1}\) and \(n_{2}\) represent the tangent vectors at the starting and ending points of the Bezier curves, respectively. The tangent vectors of Bezier curve 1 and Bezier curve 2 share the same direction but are located at different positions. Consequently, the parametric equations for Bezier curve 1 and Bezier curve 2 can be derived.  
All known data in Stage B are plotted in three-dimensional space, and the optimization effects of the non-coplanar trajectory are illustrated in Figure 8. Bezier curve 1 represents the trajectory of Trajectory 1 during the spanning motion phase, while Bezier curve 2 represents the trajectory of Trajectory 2 during the same phase.\(P_{1}\) and \(P_{2}\) represent the control points \(P_{1,1}\) and \(P_{1,2}\), and \(P_{2,1}\) and \(P_{2,2}\), before and after the optimization, respectively. The initial trajectory refers to the actual path taken by the cleaning robot during Stage B. The smooth trajectory is produced by the smoothing processing model, while the optimized trajectory is generated by the optimization model. The optimization effects are illustrated in Figure 8a,b. The optimized Bezier curves are more closely aligned with the known data points.