# Trajectory Optimization of Spray Painting Robot for Complex Curved Surface Based on Exponential Mean Bézier Method

Authors: Wei Chen; Junjie Liu; Yang Tang; Jian Huan; Hao Liu
Journal: Mathematical Problems in Engineering
 (2017)

---

## 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.


---

## Body

## 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:(
1
) 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.(
2
) 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.(
3
) 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].(
4
) 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:(
1
) 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].(
2
) 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:(1)Bnt=∑i=0nBi,ntVi,0≤t≤1,where basis Bernstein function Bi,n(t)=Cniti(1-t)n-i,   0≤t≤1.   Vi(i=0,1,…,n) is the control vertices. Since ∑i=0nBi,n(t)=1, Bn(t) can be seen as the weighted average of control vertices V0,V1,…,Vn.Make the exponential mean of control verticesV0,V1,…,Vn on this basis; we can get the definition of exponential mean Bézier curve.Definition 1.
Define(2)Lnst=logs∑i=0nBi,ntsVi,s∈R+∗∑i=0nBi,ntVi,s=10≤t≤1for ∀s∈R+; Lns(t) is called the n-time s-order exponential mean Bézier curve.
Obviously,n-time first-order exponential mean Bézier curve is the Bézier curve in traditional sense. After introducing the displacement operator E, difference operator Δ, and unit operator I motioned above, then we have(3)logs∑i=0nBi,ntsVi=logs1-tI+tEnsV0=logsI+tΔnsV0so, Lns(t) has the following operator representation:(4)Lnst=logsI+tΔnsV0,s∈R+∗I+tΔnV0,s=1.The derivative formula of Lns(t) is given as follows:(5)Lnst′=nI+tΔn-1ΔsV0I+tΔnsV0ln⁡s,s∈R+∗nI+tΔn-1ΔV0,s=1;obviously,(6)Lns0′=nln⁡ssV1-sV0sV0,s∈R+∗nV1-V0,s=1,Lns1′=nln⁡ssVn-sVn-1sVn,s∈R+∗nVn-Vn-1,s=1.Note the exponential mean Bézier curves determined by the control verticesV0,V1,…,Vn as Lns(V0,V1,…,Vn;t). Then, it satisfies the interpolation properties at the endpoints, which is(7)LnsV0,V1,…,Vn;0=V0,LnsV0,V1,…,Vn;1=Vnand when s∈R+∗, from Bi,n(t)=Bn-i,n(1-t), we can obtain(8)LnsVn,Vn-1,…,V0;t=logs∑i=0nBn-i,n1-tsVn-i=logs∑i=0nBi,n1-tsVi=LnsV0,V1,…,Vn;1-tand when s=1, similarly we can obtain(9)LnsVn,Vn-1,…,V0;t=∑i=0nBi,ntVn-i=∑i=0nBn-i,n1-tVn-i=∑i=0nBi,n1-tVi=LnsV0,V1,…,Vn;1-t.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.
Whens∈R+∗, suppose a n-time s-order exponential mean Bézier curve is expressed as(10)Lnst=logs∑i=0nBi,ntsVi,n.The control vertices are V0,n,V1,n,…,Vn,n; n+m-time s-order exponential mean Bézier curve is expressed as(11)Ln+mst=logs∑i=0n+mBi,n+mtsVi,n+mand the control vertices are V0,n+m,V1,n+m,…,Vn+m,n+m, and then n-time curve Lns(t) can be elevated to n+m-time curve Ln+ms(t) and satisfies(12)sVi,n+m=∑j=0mCni-jCmjCn+misVi-j,m,i=0,1,…,n+m.Proof.
(13)
L
n
s
t
=
l
o
g
s
∑
i
=
0
n
B
i
,
n
t
s
V
i
,
n
=
l
o
g
s
∑
i
=
0
n
C
n
i
t
i
1
-
t
n
-
i
1
-
t
+
t
m
s
V
i
,
n
=
l
o
g
s
∑
j
=
0
m
∑
i
=
0
n
C
n
i
C
m
j
C
n
+
m
i
+
j
C
n
+
m
i
+
j
t
i
+
j
1
-
t
n
+
m
-
i
+
j
s
V
i
,
n
=
l
o
g
s
∑
j
=
0
m
∑
k
=
j
n
+
j
C
n
k
-
j
C
m
j
C
n
+
m
k
C
n
+
m
k
t
k
1
-
t
n
+
m
-
k
s
V
k
-
j
,
n
=
l
o
g
s
∑
i
=
0
n
+
m
B
i
,
n
+
m
t
∑
j
=
0
m
C
n
i
-
j
C
m
j
C
n
+
m
i
C
n
+
m
i
s
V
i
-
j
,
nand Ln+ms(t)=logs∑i=0n+mBi,n+m(t)sVi,n+m; thus(14)sVi,n+m=∑j=0mCni-jCmjCn+misVi-j,m,i=0,1,…,n+mand when s=1, n-time first-order exponential mean Bézier curve (15)Lnst=∑i=0nBi,ntVi,ncan be also elevated to n+m-time first-order exponential mean Bézier curve Ln+ms(t)=∑i=0n+mBi,n+m(t)Vi,n+m.
In particular, whenm=1 and s∈R+∗,(16)sVi,n+1=in+1sVi-1,n+1-in+1sVi,n,i=0,1,…,n+1and when s=1,(17)Vi,n+1=in+1Vi-1,n+1-in+1Vi,n,i=0,1,…,n+1,where Vi,n is the control point of the n-time s-order exponential mean Bézier curve Lns(t) and Vi,n+1 is the control point of the (n+1)-time s-order exponential mean Bézier curve Ln+1s(t) 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).
L
n
s
(
t
) is the n-time s-order exponential mean Bézier curve. Suppose that the control vertex {Vi}i=0n and parameter t∈[0,1] are given. Then Vi[r] is defined as follows:(18)Vir=logs1-tsVir-1+tsVi+1r-1,s∈R+∗1-tVir-1+tVi+1r-1,s=1,r=1,2,L,n-rVi0=Vi,and this satisfies Lns(t)=V0[n], s∈R+.Proof.
Whens=1,(19)Lnst=∑i=0nBi,ntVi=1-tI+tEnV0while (20)Vir=1-tVir-1+tVi+1r-1=1-tI+tEVir-1=1-tI+tErVi0=1-tI+tErV0.Let i=0 and r=n; then we have(21)V0n=1-tI+tEnV0=Lnst.When s∈R+∗,(22)Lnst=logs∑i=0nBi,ntsVi=logs1-tI+tEnsV0while (23)Vir=logs1-tsVir-1+tsVi+1r-1=logs1-tI+tEsVir-1and thereby (24)Vir=1-tI+tEsVir-1=⋯=1-tI+tErsVi0=1-tI+tErsVi;thus(25)Vir=logs1-tI+tErsVi.Let i=0 and r=n; then we have(26)V0n=logs1-tI+tEnsV0=Lnst.
de 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 setsV0,V0[1],…,V0[n] and V0[n],V1[n-1],…,Vn 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).
Supposet∈[0,1] and u∈[0,1], for ∀s∈R+; we have(27)LnsV0,V01,…,V0n;u=LnsV0,V1,…,Vn;ut,LnsV0n,V1n-1,…,Vn;u=LnsV0,V1,…,Vn;1-1-u1-t.Proof.
Whens∈R+∗,(28)LnsV0,V1,…,Vn;ut=logs∑i=0nBi,nutsVi=logs1-utI+utEnsV0=logs1-uI+u1-tI+tEnsV0=logs∑i=0nCni1-un-iui1-tI+tEisV0=logs∑i=0nBi,nusV0i=LnsV0,V01,…,V0n;u,LnsV0,V1,…,Vn;1-1-u1-t=logs1-u1-tI+1-1-u1-tEnsV0=logsuE+1-u1-tI+tEnsV0=logs∑i=0nCniui1-un-i1-tI+tEn-isVi=logs∑i=0nBi,nusVin-i=LnsV0n,V1n-1,…,Vn;u.When s=1, 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 (U-direction or V-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 U-direction spatial path of the surface is shown in Figure 1 and the V-direction spatial path of the surface is shown in Figure 2.Figure 1
TheU-direction spatial path of the surface.Figure 2
TheV-direction spatial path of the surface.In the following, we will make the following first-order (s=1) exponential mean Bézier curve as an example.Take theU-direction as an example; the discrete point array is represented as a set of data points:(29)Pii=0,1,…,m.Obtain an exponential menial Bézier curve(30)Ln1t=∑i=0nBi,ntVi,0≤t≤1,n<m;these data points are fitted, and the control vertex Vi is to be determined. The curve is obtained by using the least-squares approximation method.First,Pi(i=0,1,…,m) is parameterized. The parameter sequence is determined by using the specification accumulation chord length parameterization: 0=t0<t1<⋯<tm=1, so we have(31)Ln1ti=∑i=0nBi,ntiVi=Pi,i=0,1,…,m.The problem is transformed into solving the least-squares solution of the equation set. The problem can be solved by solving the following regularization equation:(32)ΦTΦV0V1⋮Vn=ΦTP0P1⋮Pn,where(33)Φ=B0,nt0B1,nt0⋯Bn,nt0B0,nt1B1,nt1⋯Bn,nt1⋮⋮⋱⋮B0,ntnB1,ntn⋯Bn,ntn.In practical problems, we often hope that V0=P0, Vn=Pm. 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:(34)∑j=1n-1Bj,ntiVi=Pi-B0,ntiP0+Bn,ntiPm,i=1,2,…,m-1;then its least-squares solution Vj(i=1,2,…,n-1) together with the two endpoints P0,Pm 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 ofL-(t) is {Vi-}i=0n, the control vertex of the curve on the right of L+(t) is {Vi+}i=0m. 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: (35)L+0=L-1,L+′0=β1L-′1,L+′′0=β2L-′1+β12L-′′1.By solving the derivative of L(t), the above condition can be transformed into(36)Vo+=Vn-,mΔVo+=β1nΔVn-1-.Then(37)ΔV1+=nmm-1β2ΔVn-1-+nn-1mm-1β12Δ2Vn-2-.At 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.


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

The traditional arithmetic weighted Bézier curve is defined as follows:(1)Bnt=∑i=0nBi,ntVi,0≤t≤1,where basis Bernstein function Bi,n(t)=Cniti(1-t)n-i,   0≤t≤1.   Vi(i=0,1,…,n) is the control vertices. Since ∑i=0nBi,n(t)=1, Bn(t) can be seen as the weighted average of control vertices V0,V1,…,Vn.Make the exponential mean of control verticesV0,V1,…,Vn on this basis; we can get the definition of exponential mean Bézier curve.Definition 1.
Define(2)Lnst=logs∑i=0nBi,ntsVi,s∈R+∗∑i=0nBi,ntVi,s=10≤t≤1for ∀s∈R+; Lns(t) is called the n-time s-order exponential mean Bézier curve.
Obviously,n-time first-order exponential mean Bézier curve is the Bézier curve in traditional sense. After introducing the displacement operator E, difference operator Δ, and unit operator I motioned above, then we have(3)logs∑i=0nBi,ntsVi=logs1-tI+tEnsV0=logsI+tΔnsV0so, Lns(t) has the following operator representation:(4)Lnst=logsI+tΔnsV0,s∈R+∗I+tΔnV0,s=1.The derivative formula of Lns(t) is given as follows:(5)Lnst′=nI+tΔn-1ΔsV0I+tΔnsV0ln⁡s,s∈R+∗nI+tΔn-1ΔV0,s=1;obviously,(6)Lns0′=nln⁡ssV1-sV0sV0,s∈R+∗nV1-V0,s=1,Lns1′=nln⁡ssVn-sVn-1sVn,s∈R+∗nVn-Vn-1,s=1.Note the exponential mean Bézier curves determined by the control verticesV0,V1,…,Vn as Lns(V0,V1,…,Vn;t). Then, it satisfies the interpolation properties at the endpoints, which is(7)LnsV0,V1,…,Vn;0=V0,LnsV0,V1,…,Vn;1=Vnand when s∈R+∗, from Bi,n(t)=Bn-i,n(1-t), we can obtain(8)LnsVn,Vn-1,…,V0;t=logs∑i=0nBn-i,n1-tsVn-i=logs∑i=0nBi,n1-tsVi=LnsV0,V1,…,Vn;1-tand when s=1, similarly we can obtain(9)LnsVn,Vn-1,…,V0;t=∑i=0nBi,ntVn-i=∑i=0nBn-i,n1-tVn-i=∑i=0nBi,n1-tVi=LnsV0,V1,…,Vn;1-t.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.
Whens∈R+∗, suppose a n-time s-order exponential mean Bézier curve is expressed as(10)Lnst=logs∑i=0nBi,ntsVi,n.The control vertices are V0,n,V1,n,…,Vn,n; n+m-time s-order exponential mean Bézier curve is expressed as(11)Ln+mst=logs∑i=0n+mBi,n+mtsVi,n+mand the control vertices are V0,n+m,V1,n+m,…,Vn+m,n+m, and then n-time curve Lns(t) can be elevated to n+m-time curve Ln+ms(t) and satisfies(12)sVi,n+m=∑j=0mCni-jCmjCn+misVi-j,m,i=0,1,…,n+m.Proof.
(13)
L
n
s
t
=
l
o
g
s
∑
i
=
0
n
B
i
,
n
t
s
V
i
,
n
=
l
o
g
s
∑
i
=
0
n
C
n
i
t
i
1
-
t
n
-
i
1
-
t
+
t
m
s
V
i
,
n
=
l
o
g
s
∑
j
=
0
m
∑
i
=
0
n
C
n
i
C
m
j
C
n
+
m
i
+
j
C
n
+
m
i
+
j
t
i
+
j
1
-
t
n
+
m
-
i
+
j
s
V
i
,
n
=
l
o
g
s
∑
j
=
0
m
∑
k
=
j
n
+
j
C
n
k
-
j
C
m
j
C
n
+
m
k
C
n
+
m
k
t
k
1
-
t
n
+
m
-
k
s
V
k
-
j
,
n
=
l
o
g
s
∑
i
=
0
n
+
m
B
i
,
n
+
m
t
∑
j
=
0
m
C
n
i
-
j
C
m
j
C
n
+
m
i
C
n
+
m
i
s
V
i
-
j
,
nand Ln+ms(t)=logs∑i=0n+mBi,n+m(t)sVi,n+m; thus(14)sVi,n+m=∑j=0mCni-jCmjCn+misVi-j,m,i=0,1,…,n+mand when s=1, n-time first-order exponential mean Bézier curve (15)Lnst=∑i=0nBi,ntVi,ncan be also elevated to n+m-time first-order exponential mean Bézier curve Ln+ms(t)=∑i=0n+mBi,n+m(t)Vi,n+m.
In particular, whenm=1 and s∈R+∗,(16)sVi,n+1=in+1sVi-1,n+1-in+1sVi,n,i=0,1,…,n+1and when s=1,(17)Vi,n+1=in+1Vi-1,n+1-in+1Vi,n,i=0,1,…,n+1,where Vi,n is the control point of the n-time s-order exponential mean Bézier curve Lns(t) and Vi,n+1 is the control point of the (n+1)-time s-order exponential mean Bézier curve Ln+1s(t) 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).
L
n
s
(
t
) is the n-time s-order exponential mean Bézier curve. Suppose that the control vertex {Vi}i=0n and parameter t∈[0,1] are given. Then Vi[r] is defined as follows:(18)Vir=logs1-tsVir-1+tsVi+1r-1,s∈R+∗1-tVir-1+tVi+1r-1,s=1,r=1,2,L,n-rVi0=Vi,and this satisfies Lns(t)=V0[n], s∈R+.Proof.
Whens=1,(19)Lnst=∑i=0nBi,ntVi=1-tI+tEnV0while (20)Vir=1-tVir-1+tVi+1r-1=1-tI+tEVir-1=1-tI+tErVi0=1-tI+tErV0.Let i=0 and r=n; then we have(21)V0n=1-tI+tEnV0=Lnst.When s∈R+∗,(22)Lnst=logs∑i=0nBi,ntsVi=logs1-tI+tEnsV0while (23)Vir=logs1-tsVir-1+tsVi+1r-1=logs1-tI+tEsVir-1and thereby (24)Vir=1-tI+tEsVir-1=⋯=1-tI+tErsVi0=1-tI+tErsVi;thus(25)Vir=logs1-tI+tErsVi.Let i=0 and r=n; then we have(26)V0n=logs1-tI+tEnsV0=Lnst.
de 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 setsV0,V0[1],…,V0[n] and V0[n],V1[n-1],…,Vn 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).
Supposet∈[0,1] and u∈[0,1], for ∀s∈R+; we have(27)LnsV0,V01,…,V0n;u=LnsV0,V1,…,Vn;ut,LnsV0n,V1n-1,…,Vn;u=LnsV0,V1,…,Vn;1-1-u1-t.Proof.
Whens∈R+∗,(28)LnsV0,V1,…,Vn;ut=logs∑i=0nBi,nutsVi=logs1-utI+utEnsV0=logs1-uI+u1-tI+tEnsV0=logs∑i=0nCni1-un-iui1-tI+tEisV0=logs∑i=0nBi,nusV0i=LnsV0,V01,…,V0n;u,LnsV0,V1,…,Vn;1-1-u1-t=logs1-u1-tI+1-1-u1-tEnsV0=logsuE+1-u1-tI+tEnsV0=logs∑i=0nCniui1-un-i1-tI+tEn-isVi=logs∑i=0nBi,nusVin-i=LnsV0n,V1n-1,…,Vn;u.When s=1, 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 (U-direction or V-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 U-direction spatial path of the surface is shown in Figure 1 and the V-direction spatial path of the surface is shown in Figure 2.Figure 1
TheU-direction spatial path of the surface.Figure 2
TheV-direction spatial path of the surface.In the following, we will make the following first-order (s=1) exponential mean Bézier curve as an example.Take theU-direction as an example; the discrete point array is represented as a set of data points:(29)Pii=0,1,…,m.Obtain an exponential menial Bézier curve(30)Ln1t=∑i=0nBi,ntVi,0≤t≤1,n<m;these data points are fitted, and the control vertex Vi is to be determined. The curve is obtained by using the least-squares approximation method.First,Pi(i=0,1,…,m) is parameterized. The parameter sequence is determined by using the specification accumulation chord length parameterization: 0=t0<t1<⋯<tm=1, so we have(31)Ln1ti=∑i=0nBi,ntiVi=Pi,i=0,1,…,m.The problem is transformed into solving the least-squares solution of the equation set. The problem can be solved by solving the following regularization equation:(32)ΦTΦV0V1⋮Vn=ΦTP0P1⋮Pn,where(33)Φ=B0,nt0B1,nt0⋯Bn,nt0B0,nt1B1,nt1⋯Bn,nt1⋮⋮⋱⋮B0,ntnB1,ntn⋯Bn,ntn.In practical problems, we often hope that V0=P0, Vn=Pm. 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:(34)∑j=1n-1Bj,ntiVi=Pi-B0,ntiP0+Bn,ntiPm,i=1,2,…,m-1;then its least-squares solution Vj(i=1,2,…,n-1) together with the two endpoints P0,Pm 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 ofL-(t) is {Vi-}i=0n, the control vertex of the curve on the right of L+(t) is {Vi+}i=0m. 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: (35)L+0=L-1,L+′0=β1L-′1,L+′′0=β2L-′1+β12L-′′1.By solving the derivative of L(t), the above condition can be transformed into(36)Vo+=Vn-,mΔVo+=β1nΔVn-1-.Then(37)ΔV1+=nmm-1β2ΔVn-1-+nn-1mm-1β12Δ2Vn-2-.At 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 Section2, 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 vectorp(t) at a point (x,y,h(x,y)) on the surface can be expressed as fs(p(t),x,y)u(t), where fs(p(t),x,y) is the spray painting trajectory and u(t) is the paint flow which u(t) changes with the movement of the end effector. The spray painting trajectory fs(p(t),x,y) 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 p(t), the expression of spray painting trajectory is(38)fspt,x,y=cos⁡θimpΘθ,γζθimpr2,where r denotes the vector of the end effector to point (x,y), θimp denotes the angle between r and the normal vector ns of point (x,y), 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 r 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:(39)Θθ,γ=γ2-π21+cos⁡πθ/γ2π2γ2-π2+π2cos⁡γ.Through a large number of spray painting experiments, it can be found that γ=0.32rad 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 ζ(θimp). The expression of sticking efficiency ζ(θimp) is(40)ζθimp=ζ01-αθimp21-2θimp2π2,where ζ(0) represents the paint efficiency, α represents the fitting parameters in usual case ζ(0)=0.67, and α=0.04. 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.Figure 3
Spray painting model of the system.Assuming that the paint thickness distribution on the curved surface ism(x,y), one of the objectives of the spray painting operation is to achieve the desired paint thickness distribution m(x,y). In practice, the paint thickness distribution m(x,y) 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 p(t) of the locus and position of the nozzle as well as the flow rate u(t), the minimum difference between the actual paint distribution and the actual paint thickness distribution can be selected as the optimization objective function. That is,(41)minpt,ut∬Smx,y-∫0Tfspt,x,yutdt2dxdy,where S represents a paint curved surface and T 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 h(x,y) 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 is(42)fspt,x,y=fx-xαt,y-yαt,where f(x-xα(t),y-yα(t)) 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 into(43)minxα,yα,ut∬Smx,y-∫0Tfx-xαt,y-yαtutdt2dxdy.Here, 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 Figure4.Figure 4
The spraying path for part of car body.According to the actual spray painting requirements in the production process of the car, the ideal paint thicknessqd = 50 um, the error of the maximum paint thickness qw = 10 um, painting radius R=60 mm, painting distance h = 80 mm, and painting speed V = 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.Figure 5
Material thickness of random chosen points on the car body.


### 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 Figures6, 7, and 8.Figure 6
Spray painting path (x-axis direction).Figure 7
Spray painting path (y-axis direction).Figure 8
Spray painting path (z-axis direction).The spray painting experiment will be carried out along the specified painting path. Before the experiment, the following two points need to be explained:(
1
) In the literature [12], the experimental results show that the spray painting effect is better with the path planning scheme along the U-direction path, and it is not easy to further improve the effect with the prior technology. As the spray painting effect along the V-direction path is not ideal, we just generate the V-direction path here in order to form a contrast between the two.(
2
) 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 V-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.Figure9 shows the robotic spray painting experiment of V-direction path planning for FANUC robot. Because the shape of the workpiece is symmetrical, half of the workpiece is sprayed in the experiment.Figure 9
Spray painting experiment ofV-direction path planning for FANUC robot.In the spray experiment, the ideal paint thickness isqd = 50 um, maximum allowable error qw = 10 um, painting radius R = 50 mm, painting distance h = 100 mm, and painting speed V = 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.Table 1
Comparison of spray painting experiment.
Data forthis paper
Data forliterature [12]
Average (μm)
51.8
52.2
Maximum (μm)
58.1
58.3
Minimum (μm)
44.2
43.1
Painting time (s)
136
99Figure 10
Material thickness of random chosen points forV-direction trajectory.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:(
1
) 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.(
2
) 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.


## 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 Figure4.Figure 4
The spraying path for part of car body.According to the actual spray painting requirements in the production process of the car, the ideal paint thicknessqd = 50 um, the error of the maximum paint thickness qw = 10 um, painting radius R=60 mm, painting distance h = 80 mm, and painting speed V = 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.Figure 5
Material thickness of random chosen points on the car body.


## 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 Figures6, 7, and 8.Figure 6
Spray painting path (x-axis direction).Figure 7
Spray painting path (y-axis direction).Figure 8
Spray painting path (z-axis direction).The spray painting experiment will be carried out along the specified painting path. Before the experiment, the following two points need to be explained:(
1
) In the literature [12], the experimental results show that the spray painting effect is better with the path planning scheme along the U-direction path, and it is not easy to further improve the effect with the prior technology. As the spray painting effect along the V-direction path is not ideal, we just generate the V-direction path here in order to form a contrast between the two.(
2
) 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 V-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.Figure9 shows the robotic spray painting experiment of V-direction path planning for FANUC robot. Because the shape of the workpiece is symmetrical, half of the workpiece is sprayed in the experiment.Figure 9
Spray painting experiment ofV-direction path planning for FANUC robot.In the spray experiment, the ideal paint thickness isqd = 50 um, maximum allowable error qw = 10 um, painting radius R = 50 mm, painting distance h = 100 mm, and painting speed V = 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.Table 1
Comparison of spray painting experiment.
Data forthis paper
Data forliterature [12]
Average (μm)
51.8
52.2
Maximum (μm)
58.1
58.3
Minimum (μm)
44.2
43.1
Painting time (s)
136
99Figure 10
Material thickness of random chosen points forV-direction trajectory.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:(
1
) 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.(
2
) 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.



---

*Source: 4259869-2017-11-20.xml*