#### Abstract

Automated tool trajectory planning for spray painting robots is still a challenging problem, especially for a large complex curved surface. This paper presents a new method of trajectory optimization for spray painting robot based on exponential mean Bézier method. The definition and the three theorems of exponential mean Bézier curves are discussed. Then a spatial painting path generation method based on exponential mean Bézier curves is developed. A new simple algorithm for trajectory optimization on complex curved surfaces is introduced. A golden section method is adopted to calculate the values. The experimental results illustrate that the exponential mean Bézier curves enhanced flexibility of the path planning, and the trajectory optimization algorithm achieved satisfactory performance. This method can also be extended to other applications.

#### 1. Introduction

Spray painting robot is an important advanced paint production equipment, which is widely used in the paint production line of automotive. The complex shape of the workpiece in the actual industrial production is often encountered. The basic steps of the existing method in the trajectory optimization for spray painting on this kind of complex curved surface are as follows:

After obtaining the CAD (Computer Aided Design) data of the workpiece surface, triangulation is directly performed on the surface. And the surface is modeled by the corresponding method.

After patching the complex curved surface according to the surface topology, each patch is approximated as a plane. Then the spray painting trajectory is optimized on each patch.

The spray painting trajectory at the junction between patches is optimized. It needs to be optimized according to the geometric position relation of the painting path on every two patches: PA-PA (parallel-parallel), PA-PE (parallel-perpendicular), and PE-PE (perpendicular-perpendicular) [1–3].

Perform the tool trajectory optimal integration on each patch. Specifically, we can use ant colony algorithm or genetic algorithm.

In general, such trajectory optimization method for spray painting on a complex curved surface can basically meet the requirement of spray painting. However, this method has many steps to perform, and it needs to undergo three optimization operations such as the trajectory optimization on patch, optimization for spray painting trajectory at the junction of every two patches, and the tool trajectory optimal integration on each patch in actual process [4–6]. The operation will be more troublesome, and a lot of system time will be consumed. In addition, when the area of complex curved surface is larger or with more patches, the following two problems will occur:

It is necessary to combine the optimized trajectories at the junction between the patches after the optimization for the painting path. The error will be larger, which will make the uniformity of the paint thickness at the junction of the patches worse. What is more, a lot of system execution time will be consumed in this process [7].

When the number of patches is large, the population size (this is the concept of ant colony algorithm) will increase when performing the tool trajectory optimal integration on each patch. In this case, the convergence speed of genetic algorithm or ant colony algorithm is slow, and the algorithm is easy to fall into different local optimum fields, which leads to poor spray painting effect and lower spray painting efficiency [8–10].

Because of the existence of the problems above, the spray painting effect of the complex workpiece surface is still not very satisfactory in the current spray painting operations. Under this background, a new trajectory optimization method on curved surface based on Bézier surface is proposed in this paper. The specific idea for this method is after modeling the complex curved surface by using the Bézier triangular surface modeling technique, the discrete point array on the equidistant surface of the complex curved surface is found by the calculation method for discrete point array on equidistant surface of Bézier surface. Then the spatial painting path generation method based on the exponential mean Bézier curve is used to obtain the spatial painting path on the complex curved surface. According to the new trajectory optimization method on the complex curved surface, the spray painting trajectory is optimized along the specified spatial path, and the complete optimized trajectory for spray painting on the complex curved surface is obtained. The advantage of this method is that it does not need to split the complex curved surface but makes the full use of the flexible regulatory property of exponential mean Bézier curve to plan for the spatial painting path. This method not only increases the flexibility in the optimization process, but also greatly simplifies the steps of spray painting operations on complex curved surfaces.

#### 2. Path Planning

Trajectory optimization of the spray painting robot consists of two parts, one is the path planning and the other is the spray speed optimization. The effect of spray painting on the complex curved surface workpiece is still not very satisfactory in the current spray painting operation. In the spray painting operation, the curvature of the workpiece surface is likely to be large due to the complexity of curved surface and the shape of the workpiece surface, which makes it more difficult to optimize the spray painting trajectory. In the first part of the description, the existing method is curved triangulation. In this method, Cubic Cardinal spline curves are used to connect the discrete point arrays on the equidistant surface of the Bézier surface, and each adjacent Cardinal spline curve is connected by Hermite spline curve [11–13]. Since both Cardinal and Hermite curves are parametric cubic polynomials, the local control properties for the curves are particularly poor and it is difficult to make a direct and geometric intuitionistic estimate of the geometry of the curve under normal circumstances.

In the current surface modeling technology of CAGD (Computer Aided Geometric Design) for free-form curved surface, Bézier theory and method have been widely used in the CAM/CAD system as a set of mature algorithm theories, which shows a strong vitality and practical value. The main reason is that Bézier method is easy to operate and it has good geometric properties. The traditional Bézier curve is defined as a convex combination of spatial position vector with the Bernstein basis function as weight, which is also a kind of average value. But the traditional Bézier curve has great limitations on describing the geometry of the entity, and its rational and polynomial form also have many shortcomings. Therefore, it is of vital importance to find the new basis functions of Bézier curves. In this section, Bézier curves are evenly combined with exponential mean, and the definition of exponential mean Bézier curves with parameter is put forward [14, 15]. The three basic properties of this kind of curves are given, such as the elevation, de Casteljau algorithm, and segmentation theorem which are applied to the method for generating the painting path in complicated surface. Finally, better results can be obtained.

##### 2.1. Definition and Properties of Exponential Mean Bézier Curves

The traditional arithmetic weighted Bézier curve is defined as follows:where basis Bernstein function , . is the control vertices. Since , can be seen as the weighted average of control vertices .

Make the exponential mean of control vertices on this basis; we can get the definition of exponential mean Bézier curve.

*Definition 1. *Definefor ; is called the -time -order exponential mean Bézier curve.

Obviously, -time first-order exponential mean Bézier curve is the Bézier curve in traditional sense. After introducing the displacement operator , difference operator , and unit operator motioned above, then we haveso, has the following operator representation:The derivative formula of is given as follows:obviously,

Note the exponential mean Bézier curves determined by the control vertices as . Then, it satisfies the interpolation properties at the endpoints, which isand when , from , we can obtainand when , similarly we can obtain

It can be seen that the exponential mean Bézier curve defined by the same control polygon is unique. The parametric cubic Hermite interpolation does not have the symmetry represented by the formula above.

In the Bézier curve design, the flexibility of curve designing can be improved by increasing the number of control vertices while keeping the curve shape unchanged, which is called elevation. The exponential mean Bézier curve is also a parametric polynomial curve segment with global properties. In the discrete point arrays on the equidistant surface of a complex curved surface, it is possible that the control vertices cannot reach the ideal curve (path) shape no matter how we adjust them. That is, the “rigidity” of the curve (path) is adequate while the “flexibility” is insufficient. The control vertices are added by elevation, which reduces the “rigidity” of the painting path on the complex curved surface, increases its “flexibility,” and enhances the potential flexibility of controlling the shape of the painting path on complex curved surfaces.

Theorem 2. *When , suppose a -time -order exponential mean Bézier curve is expressed asThe control vertices are ; -time -order exponential mean Bézier curve is expressed asand the control vertices are , and then -time curve can be elevated to -time curve and satisfies*

*Proof. *and ; thusand when , -time first-order exponential mean Bézier curve can be also elevated to -time first-order exponential mean Bézier curve .

In particular, when and ,and when ,where is the control point of the -time -order exponential mean Bézier curve and is the control point of the -time -order exponential mean Bézier curve after elevation.

In the process of selecting the control vertices according to the discrete point arrays on the equidistant surface of the complex curved surface, the geometric properties of the complex curved surfaces themselves determine that the geometrical properties of the Bézier curves obtained from these control vertices are also complex. The process of each intermediate vertex generated by the de Casteljau algorithm is linear interpolation. This algorithm can resolve a complex geometric computation problem into a series of linear operations. The algorithm is easy to program and the speed is quite fast. Also, it facilitates the rapid generation of spatial painting path on complex curved surface.

Theorem 3 (de Casteljau algorithm theorem). * is the -time -order exponential mean Bézier curve. Suppose that the control vertex and parameter are given. Then is defined as follows:and this satisfies , *

*Proof. *When ,while Let and ; then we haveWhen ,while and thereby thusLet and ; then we havede Casteljau’s algorithm theorem improves the rapidity of generating the spatial paths on complex curved surfaces. However, since the curvature of the complex curved surface itself changes greatly, in the actual spray painting operations, sometimes the entire painting path needs to be processed by segment. That is, the entire path curve needs to be divided into two subpath curve segments. The de Casteljau algorithm can not only determine a point on the path curve, but also introduce the path curve segmentation problem. There are two vertices sets and in the de Casteljau algorithm. We can get the two subcurve segments divided from the entire exponential mean Bézier curve by using the exponential mean Bézier curve determined by these two vertices sets as the control vertex.

Theorem 4 (path curve segmentation theorem). *Suppose and , for ; we have*

*Proof. *When ,When , it can be proved as the same token.

The aim of the segmentation theorem is actually to find the two control vertices on the subcurve segment of the painting path in order to get the two small control polygons, which are closer to the curve than the original control polygon.

##### 2.2. Spatial Path Generation of Exponential Mean Bézier Curves

Due to the large curvature changes of the complex curved surface studied in this paper, the Cardinal splines and the parametric polynomial expressions of the Hermite splines themselves determine that the local control is relatively poor. Therefore, the exponential mean Bézier curves with parameter are used in order to overcome these shortcomings. The discrete point arrays (-direction or -direction) are regarded as the experimental data point arrays, and an exponential mean Bézier curve is used to fit the data points. Then the control vertices of the curves are inverted to generate the spatial painting path, where the -direction spatial path of the surface is shown in Figure 1 and the -direction spatial path of the surface is shown in Figure 2.

In the following, we will make the following first-order () exponential mean Bézier curve as an example.

Take the -direction as an example; the discrete point array is represented as a set of data points:Obtain an exponential menial Bézier curvethese data points are fitted, and the control vertex is to be determined. The curve is obtained by using the least-squares approximation method.

First, is parameterized. The parameter sequence is determined by using the specification accumulation chord length parameterization: , so we haveThe problem is transformed into solving the least-squares solution of the equation set. The problem can be solved by solving the following regularization equation:whereIn practical problems, we often hope that , . That is, the two ends of the curve coincide with the first and last points of the data point. Then (32) becomes the following equation:then its least-squares solution together with the two endpoints forms the control vertices of the curve.

In the following, the smooth stitching condition of two adjacent curves is obtained by using Beta constraint formula. Suppose that the control vertex of the curve on the left of is , the control vertex of the curve on the right of is . In order to obtain a common unit tangent vector and a common curvature vector at the connection point of the two curved segments, we need to meet the following requirements: By solving the derivative of , the above condition can be transformed intoThenAt this point, the curve obtained by the smooth stitching of two adjacent curves is the specified spatial painting path.

The application of the three basic properties of exponential mean Bézier curves and their own parameters improves the flexibility of the painting path on complex curved surfaces. And the potential flexibility of shape controlling on the painting path is also enhanced. At the same time, it makes the algorithm very simple, stable, and reliable. The algorithm is easy to program and the speed is quite fast. Also, it facilitates the rapid generation of spatial painting path on complex curved surface.

#### 3. Trajectory Algorithm

After generating the exponential mean Bézier curves according to the method described in Section 2, a new simple algorithm for trajectory optimization on complex curved surfaces is introduced in this section. The method is simple in expression and fast in operation speed, which can meet the requirement of spray painting quality on complex curved surface.

When the end effector is in a specific position, the trajectory and position vector at a point on the surface can be expressed as , where is the spray painting trajectory and is the paint flow which changes with the movement of the end effector. The spray painting trajectory is determined by the distance of the end effector and the surface and its spatial position. The spray painting model of the system is shown in Figure 3. Here, an experimental method is used to establish the paint deposition rate model. In the experiment, after a period of time, the paint deposition rate of the end effector is measured at a fixed position, and the paint deposition rate model is determined by the reverse flow distribution method. When the position of the end effector is , the expression of spray painting trajectory iswhere denotes the vector of the end effector to point , denotes the angle between and the normal vector of point , and represents the droplet distribution of the conical paint stream. The droplet distribution depends on the normal vector of the end effector (it is determined by the position of the end effector), the angle between and the perpendicular bisector of the end effector, and the inner half-angle of the conical paint flow, which can be represented as a regularized Dirac function:Through a large number of spray painting experiments, it can be found that under normal circumstances. In some spray painting experiments (especially on metal surfaces), a significant portion of the paint is wasted due to splashing and sticking efficiency . The expression of sticking efficiency iswhere represents the paint efficiency, represents the fitting parameters in usual case , and . In fact, it has been assumed in the model of Figure 1 that there is no paint deposition outside the paint cone angle . In the actual spray painting operation, there will be a small amount of splash paint falling outside the paint cone angle, but this situation can be ignored.

Assuming that the paint thickness distribution on the curved surface is , one of the objectives of the spray painting operation is to achieve the desired paint thickness distribution . In practice, the paint thickness distribution varies on the curved surface. However, in the experiment, it is common to predefine an expected value in the system. That is, the paint thickness distribution is a constant. Therefore, for determining the vector of the locus and position of the nozzle as well as the flow rate , the minimum difference between the actual paint distribution and the actual paint thickness distribution can be selected as the optimization objective function. That is,where represents a paint curved surface and indicates the completion time of the spray painting operation. Since the objective function is not a convex function, the optimization problem is difficult to solve. Suppose that is a constant, the distance of the end effector and the curved surface remains constant and is always perpendicular to the curved surface. Then the expression of spray painting trajectory iswhere represents the constant painting path. If the moving speed of end effector remains unchanged while the paint flow can be adjusted in the process of spray painting operation, then the above optimization problem can be transformed intoHere, the golden section method in mathematical programming can be used to solve the discrete points on the spray painting trajectory, from which we can get the optimized trajectory on the complex curved surface.

#### 4. Experimental Verification

##### 4.1. Spray Painting Simulation

Taking the automotive body of a brand as the paint objective, we have simulated the feasibility of exponential mean Bézier method. Since the left and right sides are completely symmetrical, only one side is listed. In addition, the car body spraying path is shown in Figure 4.

According to the actual spray painting requirements in the production process of the car, the ideal paint thickness = 50 um, the error of the maximum paint thickness = 10 um, painting radius mm, painting distance = 80 mm, and painting speed = 389 mm/s (the optimization speed on the plane). We have collected 200 discrete points at the top, side, and rear of the body. The paint thickness curve of each sampling point on the automobile body is shown in Figure 5. The graph shows that the coating thickness meets the requirements, and the simulation results verify the effectiveness of the trajectory optimization method.

##### 4.2. Spray Painting Experiment

We use FANUC industrial robots in the experiment. According to the characteristics of FANUC industrial robot off-line programming and spraying space trajectory, the method of spraying space trajectory converting to the robot motion trajectory is proposed.

By analyzing the relationship between the workpiece coordinate system and the robot coordinate system, the robot tool coordinate system is calibrated, and then the space trajectory in the workpiece coordinate system is transformed into the robot coordinate system. In the inverse solution of the robot, the optimal model of the shortest joint motion is established, and the inverse solution of the robot is derived [16].

Finally, the best inverse combination is obtained to realize the transformation of the spraying space trajectory to the robot motion trajectory.

The spatial paths obtained from different directions are shown in Figures 6, 7, and 8.

The spray painting experiment will be carried out along the specified painting path. Before the experiment, the following two points need to be explained:

In the literature [12], the experimental results show that the spray painting effect is better with the path planning scheme along the -direction path, and it is not easy to further improve the effect with the prior technology. As the spray painting effect along the -direction path is not ideal, we just generate the -direction path here in order to form a contrast between the two.

The spatial painting path generation method based on the exponential mean Bézier curve is used in the experiment of this paper. As this method is more accurate but the calculation process is more complex, more discrete points of the equidistant surface need to be generated in the calculation. Then the spatial path density in -direction generated by this method is also large (i.e., the distance between adjacent two paths is small). Therefore, in the spray painting experiment, we no longer need to optimize the spray painting speed. We can only perform uniform spray painting operation along the generated path in the experiment.

Figure 9 shows the robotic spray painting experiment of -direction path planning for FANUC robot. Because the shape of the workpiece is symmetrical, half of the workpiece is sprayed in the experiment.

In the spray experiment, the ideal paint thickness is = 50 um, maximum allowable error = 10 um, painting radius = 50 mm, painting distance = 100 mm, and painting speed = 256 mm/s (the optimization speed on the plane) when performing uniform spray painting. We take 400 discrete points evenly on the workpiece surface after spray painting operation. The paint thickness curve is shown in Figure 10 after using a paint thickness gauge to measure the paint thickness at the discrete points. The results of the experimental data obtained by using the surface spray painting method are shown in Table 1.

It can be seen from the comparison of the experimental results that the spray painting effect is better when using the method proposed in this paper, but the spray painting time is obviously increased. There are two main reasons accounting for this:

The painting path obtained by the spatial painting path generation method based on the exponential mean Bézier curve is longer, which leads to the longer spray painting time.

Since the method is carried out with uniform spray painting, the spray painting speed is not optimized. That is, the robot does not have the acceleration and deceleration process during the spray painting operation. So the spray painting time is longer.

However, it should be noted that although the method in literature [12] can optimize the spray painting speed, it is based on the situation that the workpiece is divided into a number of triangular facets. When the sprayed workpiece is relatively large, the number of triangles will also be very large. In the multiobjective optimization problem with constraints, the two optimization objectives: paint thickness uniformity and spray painting time are coupled and competing with each other, which makes it difficult to solve the exact solution of this multiobjective optimization problem. In this case, for workpiece with large curved surface, the solution will inevitably lead to slower system operation and system real-time deterioration, and the calculation error will become larger. At this point, the spray painting effect should be better when using the method proposed in this chapter for uniform spray painting.

#### 5. Conclusion

In this paper, a new trajectory optimization method based on the Bézier method on complex curved surface is proposed. By using the Bézier triangular surface modeling technique, the complex surface is modeled and the discrete points array on the equidistant surface of the toric surface is found by using the discrete point array calculation method of Bézier surface equidistant surface. Then the spatial painting path generation method based on the exponential mean Bézier curve is used to obtain the spatial painting path on the complex curved surface. And then, according to a new paint thickness algorithm in the spray painting model on complex curved surface, the spray painting trajectory is optimized along the specified spatial path and a complete spray painting trajectory on the complex curved surface is obtained. The biggest advantage of this method is that it does not need to patch the complex curved surface but makes full use of the flexible feature of exponential mean Bézier curves to plan the spatial painting path first. This method enhances the potential flexibility of the shape control on painting path. The experimental results show that it is better to use the method proposed in this paper to make the uniform spraying effect when spraying the large surface workpiece.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest.

#### Acknowledgments

This research is supported by the National Natural Science Foundation of China (nos. 51505193 and 61503162), Project Funded by China Postdoctoral Science Foundation (2016M601691), the Major Research and Development Project (Modern Agriculture) of Zhenjiang City (NY2015025), Top-Notch Academic Programs Project of Jiangsu Higher Education Institutions (PPZY2015C216), and Natural Science Foundation of Jiangsu Province in China (no. BK20150473).