## 6 Experimental Verification  
To demonstrate the effectiveness of the proposed method, a B-spline curve with a butterfly style is selected as the target curve to optimize the robot joint trajectory. The resulting optimized joint trajectory is then used to control the robot to process. To discrete the target parameter curve, the proposed method utilizes a relationship between chord length and arc length, as shown in Figure 4. In this case, the curve is discretized into 257 points, and more points are distributed in the place where the curvature changes greatly. Compared with Figure 5, which adopts a constant node vector step size \(\Delta u=0.0001\), the data volume is significantly reduced. Figure 4: Diagram of the discrete trajectory points using the proposed method. The experimental device is shown in Figure 6. The spindle motor and ball end milling cutter are installed at the end of the robot in sequence. In this paper, the material used for machining is titanium alloy (Ti-6 Al-4V). The spindle weight is 4 kg, and the power is 1.5 KW. In the process of milling, the spindle speed is 1500 r/min. The radius of the ball end milling cutter is 1 mm. The position relationship between the clamped workpiece and the robot is shown. Then measure the pose matrix of \({}^{6}_{tool}T\) and \({}^{w}_{0}T\). \[{}^{w}_{0}T= \begin{bmatrix}1&0&0&-612.111\\ 0&1&0&283.874\\ 0&0&1&214.917\\ 0&0&0&1\end{bmatrix} _{tool}T= \begin{bmatrix}0&0&-1&-143.882\\ 1&0&0&96.636\\ 0&1&0&66.288\\ 0&0&0&1\end{bmatrix} \]  
Because the surface geometry of the curved workpiece is complex, if the tool posture angle is not selected correctly, it is easy to cause collision and interference between the workpiece and the tool, reduce the quality of the workpiece surface processing and even scrap the workpiece. Therefore, choosing the range of tool posture angle \((\alpha,\ \beta)\) is very important. The constraint of the tool posture angle \((\alpha,\ \beta)\) in this paper is as follows:  
\[4^{\circ}\leq\alpha\leq 16^{\circ} \tag{11}\]  
Figure 5: Local diagram of the discrete trajectory points by using the node vector \(\Delta\)u = 0.0001. Figure 6: Schematic of robot processing coordinate system. \[0\leq\beta\leq 180^{\circ} \tag{12}\]  
Constraint \(\beta\) in the range of \(0\,\sim 180^{\circ}\) so that the tool axis is always to the left of the \(X\)-axis of \([LCS]\) to prevent local interference. The reason why \(\alpha\) is limited to \(4\,\sim 16^{\circ}\) is to avoid direct milling of the tool-tip with a milling speed of 0 and to prevent interference in surface machining due to excessive angle. According to the parameters given by the robot, the joint limit range and the load of each joint are obtained, as shown in Equation (13) and Table 2. In addition, after calculation, the load coefficients \(w_{j}\) of each joint are obtained, and the joints with a larger load are given a greater weight so that the optimization objective \(JT_{1}\) and \(JT_{2}\) is obtained in Figure 7.  
\[ \begin{cases}-3.14\leq\theta_{1}\leq 3.14\\ -2.35\leq\theta_{2}\leq 2.35\\ -2.61\leq\theta_{3}\leq 2.61\\ -3.14\leq\theta_{4}\leq 3.14\\ -2.56\leq\theta_{5}\leq 2.56\\ -3.14\leq\theta_{6}\leq 3.14\\ \end{cases}  \tag{13}\]  
Given the tool posture angle \(\alpha=5^{\circ}\) and \(\beta=45^{\circ}\) in the angle range of Equation (11), the initial value of the fixed posture is solved by inverse kinematics, as shown in Figure 8.  
The SQP function in MATLAB is selected for optimization. The optimized joint variables during processing are shown in Figure 8, and the processing posture angle \((\alpha,\,\beta)\) after optimization is shown in Figure 9. Obviously, the joint trajectory obtained by the proposed methods is obviously decreased with the tool posture angle satisfying the constraints. Table 3 compares the joint trajectory values before and after optimization.