Abstract
This study presents a novel algorithm implementation that optimizes manually recorded toolpaths with the use of a 3D-workpiece model to reduce manual error induced. The novel algorithm has three steps: workpiece declaration, manual toolpath declaration, and toolpath optimization using steepest descent algorithm. Steepest descent finds the surface route wherein the manually recorded toolpaths traverse over a 3D-workpiece surface. The optimized toolpaths were simulated and tested with an industrial robot showing minimal error compared to the desired optimized toolpaths. The results obtained from the presented implementation on three different trajectories demonstrate that the proposed methodology can reduce the manual error induced using as a reference the CAD-workpiece surface.
Introduction
The industrial robot–workpiece interaction has an important role to perform tasks over complex surfaces such as painting 1 –3 milling, 4 grinding, 5 laser cladding, 6 nondestructive examinations, 7,8 and robotic automated fiber placement applications. 9,10 The path planning can be classified into online and offline programming. In online programming, the main disadvantages are the time spent on manual robot programming and the manual error induced (error due to operator skills-dependency). On another side, the performance of off-line path planning methods is faster and often model-based 3D CAD. 7,11 –13 Some robotic applications take advantage of 3D-workpiece for diverse applications, for example, in Xingguo and Li, 14 a robotic model-based offline programming method made the projection of a 2D-plane onto the surface of a CAD model for machining processes, taking into consideration the spin angle of the tool. If a CAD model is not available, it is possible to take advantage of reverse engineering techniques using scanned data 15,16 offering discrete 3D-workpiece models where special algorithms generate trajectories on point clouds and meshes. 8,13 In an earlier study, 3 the authors propose an incremental approach for automated trajectory generation from CAD model, the whole surface is meshed and divided into surface sections (SS) based on spray radius, and these SS are painted by spray gun located at a standoff distance from the surface section point (SSP) along the surface section normal (SSN). To calculate the SSP, the weighted average of all the centroids of the triangle inside the SS is used and the weighted average of the normals of the triangles in the SS determines the SSN. Subsequently, a new SS is generated with an incremental distance along the x axis, steps are repeated till the end of the surface is reached, and the incremental distance in y axis depends on the optimal overlap distance. To generate the optimal overlap distance and the velocity for a given paint pass (SS), a genetic algorithm is used and the process ends when the whole surface is reached. Li et al. 6 propose a path planning method whose key lies in the topological reconstruction of the artificial joint surface. From an STL file, the information to create the relations among points, edges, and facets is extracted, facilitating the path planning method. Via equidistant parallel planes that intersect the CAD model, a series of intersections point were generated (slicing algorithm) to obtain transversal lines that use the topological relation of the edges instead of using a sorting algorithm to reduce the number of intersection calculations. The height error method is used for the robot interpolation points and the normal vectors of each point can calculate the position and pose of the robot tool center point (TCP) to ensure the perpendicularity between the laser beam and the surface. Finally, by connecting the interpolation points sequentially, the motion path is obtained.
Other works have addressed the problem by mesh following techniques using a triangular mesh of a surface as a guide for path-planning algorithms; Mineo et al. 7,8 present a flexible off-line trajectory planning for inspection of complex curved surfaces on nondestructive testing systems. The toolpath is generated to follow the contour of a triangular meshed CAD surface without the need for an approximating analytical surface. To generate the path planning, it is necessary to create a curve contour of the surface, as the surface is a triangular mesh, the surface edge is a segment with extremities of two adjacent triangles, then always is possible to find the intersections points between the plane perpendicular to the segment and the edges of the triangles of the surface mesh. The curvilinear distance is calculated by cumulating the segment of the intersection points from the reference edge that is the distance along the surface contour where every point of the curve must be normal to the relative triangle.
This article presents a novel algorithm implementation that combines the skills of the operator and the advantages of the CAD model to optimize manually recorded toolpaths with the use of 3D-workpiece models to reduce manual error induced avoiding exhaustive touch up reprogramming when considering large, workpiece surfaces. The procedure was tested both with a simulation and experimentation on a real industrial robot arm; model ABB IRB 1600-7/1.45 type A. The results show a high-quality trajectory reproduction, allowing more accurate adjustments on manually recorded toolpaths.
The organization of this article is divided into four sections: Methodology presents a generalized explanation of the proposed algorithm for optimizing manually recorded trajectories, Steepest Descent algorithm selects the number of nodes in the objective function for reconstructing the surface route on the 3D-workpiece surface. Experimentation and Results were carried out at ABB industrial robot using three different trajectories where the mean absolute error was calculated by comparing the robot TCP trajectory and the desired optimized trajectory. Finally, the Conclusions and Future Work are presented.
Methodology
The presented novel algorithm implementation combines the manually recorded toolpaths stored in a text file with the use of a 3D-workpiece-model to optimize robotic toolpaths and reduce manual error induced. The steepest descent algorithm finds the surface route wherein the manually recorded toolpaths traverse over the CAD-workpiece. The three-step procedure of the novel algorithm implementation is presented as follows:
Step 1: Workpiece declaration
The first step is the workpiece declaration, Figure 1 shows a curved surface that represents a 3D-workpiece using point cloud data. This figure includes 656 points, covering an area of

Point cloud data representing the 3D-workpiece surface displayed with the surf instruction in MATLAB.
The manually recorded toolpaths and the point cloud data that conform to the CAD-workpiece can be referenced to the robot base coordinate system or any other specific coordinate system (see Figure 2). This characteristic allows identifying the distancing

(a) Reference of a 3D-workpiece point
Step 2: Manual toolpath declaration
The second step is the declaration of manually recorded toolpaths. These manually recorded toolpaths conventionally present variable standoff distancing between TCP and CAD-workpiece (represented as point cloud data), due to manually induced error. Every manually recorded toolpath can be traversed using at least two poses sequentially, and the result can be a straight toolpath that is subdivided into tiny segments.
17
As an example, Figure 3 shows five poses
and
Every element of

Example of linear interpolations created by five manually recorded poses.
As a result of implementing equation (4), 17 straight toolpaths subdivided into tiny segments were created as a first approximant reference of the desired optimized trajectories.
Step 3: Toolpath optimization
In the third step, every segment from the straight toolpaths “
The first two elements

(a) Distance between adjacent points
For every

(a) r-neighborhood surrounding
The distance between every transition
Steepest descent algorithm implementation
The steepest descent (SD) algorithm for unconstrained optimization problems is a popular method for minimizing differentiable functions.
20
For this case, every segment
Thus,

(a) Optimization of every recorded toolpath with respect to the z-axis coordinate frame. (b) Approximation of the 3D-workpiece surface using SD.
A variant of steepest descent algorithm applied to the optimization of manually recorded toolpaths is presented in Algorithm 1.
Steepest descent algorithm.
The stopping criterion for algorithm 1 is defined as

(a) Toolpath traced over the curved surface, where
Algorithm 2 shows the complete procedure used to optimize trajectories in the industrial robot for both the simulation and experimentation implemented in the following section.
Procedure to optimize the trajectory.
Experimentation
The experimentation was carried out using an ABB industrial robot IRB 1600-7/1.45 type A, (Figure 8) and a program-like based on algorithm 2 that converts a set of instructions in

(a) ABB IRC5 controller. (b) Robot Arm ABB IRB 1600-7/1.45 type A.
Trajectory 1 presents variable standoff distance in the Z axis simulating manual induced error during point-to-point programming or lead-through method (see Figure 9(a)). In this example, the trajectory finalizes its trajectory in the same pose as the beginning and it is composed of five poses as shown in Figures 3 and 9(a).
Trajectory 2 depicts a zigzag programmed in 2D (with components only in
Trajectory 3 presents a closed trajectory without sharp corners. The main purpose of this trajectory is to move the TCP as close as possible from one corner to another without stopping. For this case, 41 poses characterize the trajectory, as presented in Figure 9(c).

Manually recorded toolpaths and their corresponding desired optimized trajectories over the surface.
The 3D-workpiece surface from Trajectories 1–3 (see Figure 9(a) to (c)) is known and was selected to validate algorithm 2 using an industrial robot. Equation (12) represents the 3D-workpiece surface with defined intervals of
Algorithm 2 was computed in MATLAB® with a graphic user interface that includes the 3D-workpiece surface, robot, toolpath, and an additional window that allows selecting a file with

Graphic user interface application generated in MATLAB® to simulate the performance of an ABB IRB 1600/7 1.45 type A robot.
Results
The three presented trajectories in the previous chapter were simulated and evaluated using the ABB Industrial robot IRB 1600-7/1.45 type A (Figure 8
Number of points manually and automatically recorded.
The mean absolute error (MAE) was measured from the difference between the desired trajectory route based on equation (12) and the TCP final measurement from the robot (reading the angular motion from encoders/resolvers and the length of every link). Table 2 shows the MAE obtained from the robot varying the mesh density (
Standoff distance error.
The results obtained from Table 2 demonstrate that the mesh density (
MAE corresponding to every coordinate conforming to the real TCP.
Conclusions and future work
In this article, a novel algorithm implementation combines the manually recorded toolpaths stored in a text file with the use of a CAD-workpiece model to reduce manual error induced and optimize the final robotic toolpath. The steepest descent algorithm finds the surface route wherein the manually recorded toolpaths traverse over the CAD-workpiece.
The results shown in the previous chapter demonstrates that the proposed methodology can reduce the manual error induced using the CAD-workpiece as a reference. The results obtained for the three different trajectories evaluated indicate that the accuracy of the trajectory depends directly on the mesh-distancing
Supplemental material
Supplemental Material, sj-pdf-1-arx-10.1177_17298814211064767 - Novel surface optimization for trajectory reconstruction in industrial robot tasks
Supplemental Material, sj-pdf-1-arx-10.1177_17298814211064767 for Novel surface optimization for trajectory reconstruction in industrial robot tasks by Miguel Angel Funes-Lora, Eduardo Vega-Alvarado, Raúl Rivera-Blas, María Barbara Calva-Yáñez and Gabriel Sepúlveda-Cervantes in International Journal of Advanced Robotic Systems
Footnotes
Acknowledgements
The authors would like to offer our special thanks to Professor Albert J Shih for all the support provided during the elaboration of this article, in the same way, the authors would like to thank Arturo Gil for the ARTE library. All authors also thank CONACyT of México.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by SIP Projects 20211583 and 20210825 at the Instituto Politécnico Nacional of México and the University of Michigan.
Supplemental material
Supplemental material for this article is available online.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
