# An Algorithm for Painting Large Objects Based on a Nine-Axis UR5 Robotic Manipulator
## 7 Discussion and Conclusions  
This paper proposes an algorithm that employs a nine-axis robotic manipulator to automatically paint large objects. With the proposed algorithm, automatic processing of complex objects is achieved. The algorithm is divided into three aspects that consist of extraction of the target model, the establishment of the inverse kinematics model of the manipulator, and the planning of the target trajectory. In the section of the proposed algorithm for extracting the target model, as per the STL file of the target trajectory, the triangles of the target trajectory are extracted. A full 3D data point cloud model is obtained with a triangle-based filling algorithm. Subsequently, the PCA algorithm is harnessed to identify the normal vectors of the target points inside the point cloud model. With the normal vectors, [PERSON] rotation formula is harnessed to extract the pose of each point of the painting trajectory. Finally, the number of target points is compressed to reduce the time and space complexity of the algorithm so that the painting process requirements can be satisfied. In the section of the proposed algorithm where the inverse kinematics model of the manipulator is established, in conformity with the processing range of the robot, the inverse solution algorithm is divided into the inverse solution of the recommended region and the inverse solution of the non-recommended region. The corresponding inverse kinematics model is established by employing the closed-form solution method and SQP, respectively. During the planning of the painting trajectory, in line with the point cloud model of the target points, the minimum envelope rectangles of the target points are found. The target points are divided into different painting areas in accordance with the minimum rectangles. For each painting area, a TSP trajectory planning model based on GA is harnessed to plan the robot's painting trajectory with which the inverse kinematics model of the UR5 robot is created. Not only does the trajectory created by the proposed algorithm consider the singularities of the kinematic joints of the UR5 robot joints, but it also helps the UR5 robot to paint large objects with precision and efficiency. Multiple reliable simulations of the painting process on the car roof surface were conducted, and the results show that the algorithm can meet the technical requirements of painting and that the algorithm has promising practicability. The proposed algorithm has several benefits. The trajectory created by the proposed algorithm allows the motion platform of the UR5 robotic manipulator to have the least amount of movement while the UR5 robot paints a large object. Therefore, the proficiency of the painting process can be significantly improved. The standard triangle language (STL) file, algorithm of principal component analyses (PCA), and k-dimensional tree (k-d tree) were employed to obtain the point cloud model of the car roof to be painted. The  
Figure 34: The UR5 robot’s axis errors. point cloud model was later converted into multiple traveling salesman problem (TSP) models, each of which was created with genetic algorithms (GAs). In this way, the UR5 robot could identify the object to be painted and generate a trajectory to paint the large object more efficiently. However, limitations still exist in the current research. The closed-form solution method and SQP were employed to establish the inverse kinematics model of the UR5 robot. SQP is not intelligent enough and still requires a myriad of training solutions. If a more intelligent neural network model had been utilized, the preparation time for the entire painting process would have been reduced. In this research, only the painting trajectory was created, but the dynamics and velocity-planning of the UR5 robot were not involved. Therefore, future studies need to focus on a more intelligent neural network model that helps to establish the inverse kinematics model of the UR5 robot as well as the dynamics and velocity-planning of the UR5 robot.