1. Introduction
With the development of intelligence, multi-intelligence systems have received extensive attention and application. It can be seen that intelligent automation is widely used in painting robots [
1,
2]. Surface modeling of the sprayed workpiece is the first step in the trajectory optimization of the spray painting robot and the key to designing the spray path of the spray painting robot. At present, there are two main types of surface modeling methods of sprayed workpiece for off-line programming system of spray painting robot: (1) Surface modeling method based on CAD (Computer Aided Design) model. The modeling method based on the CAD model is that the CAD model data of the workpiece have been obtained before the surface modeling, and the spraying path of the spray painting robot can be planned according to the CAD model of the workpiece. (2) Surface modeling method based on the workpiece scanning system. If there is no CAD model data for a workpiece, or if the surface shape of actual workpiece does not match the CAD model data, then the workpiece needs to be scanned to obtain its new CAD data. The surface of the workpiece is approximated by a simple plane, sphere, cylinder, or other parametric surface, allowing spray path planning on these parametric surfaces.
In the previous work, we focused on the trajectory optimization of complex curved surface. In the reference [
3], the Surface modeling method based on the CAD model is adopted. The CAD model data of the workpiece is obtained, and can plan the spraying path of the spraying robot according to the CAD model of the workpiece. The trajectory optimization of spray painting robot for complex curved surface based on the exponential mean Bézier method is proposed. The advantage is that it does not need to split the complex curved surface.
During the off-line programming operation for spray painting robot, after the surface modeling for the workpiece is finished, the following work is to optimize the trajectory of spray painting robot [
4,
5]. Since the point on the trajectory is a six-dimensional vector in the Cartesian coordinate system, it is very complicated to express it in mathematical expressions and the solving process is very difficult. Therefore, the general idea of trajectory optimization for spray painting robot is usually as follows: First, find the spatial path of the spray painting robot on the workpiece surface, and then find out the optimal time sequence along the specified spatial path. That is, the consistency of the paint thickness on the workpiece surface is the highest and the spray painting time is the shortest at what speed the end effector sprays along the specified spatial path. According to this idea, the optimized trajectory for spray painting consists of two parts: the spatial path of the spray painting operation and the moving speed of the end effector.
On the other hand, a large number of spray painting experiments have shown that the uniformity of the paint thickness can be significantly improved. That is, the spray painting effect can be improved by optimizing the initial trajectory of the spray painting robot in the initial stage of spray painting [
6,
7,
8]. In other words, finding the best initial trajectory for spray painting is critical to the further trajectory optimization. Therefore, the trajectory optimization for spray painting robot can be divided into the following four steps: (1) Finding the optimal initial trajectory of spray painting robots. (2) According to the geometric features of sprayed workpiece surface, establish a suitable spray painting model. (3) Plan an appropriate spatial path for spray painting. (4) Plan trajectory optimization along the specified painting path.
The initial trajectory selection, the establishment of spraying model and path planning are all the bases of trajectory optimization. This research is based on the assumption that the workpiece CAD model was not acquired in advance. The innovation is that the Bézier triangular surface modeling method is adopted under the CAD model data without the workpiece. Firstly, the Bézier surface is analyzed and the method for searching the optimal initial trajectory of the spray painting robot is given according to the features of the Bézier triangular surface. Subsequently, the spray painting model of Bézier surface is established, and the mathematic expression of paint thickness at a certain point on the Bézier surface is given. Finally, the optimized trajectory of Bézier surface is obtained by using the ideal point method in the mathematical programming with the uniformity of paint thickness and the shortest spray painting time as optimization objectives along the specified spray painting path. The advantage of this method is that a good initial path of automatic spraying is determined at the beginning of the spraying process, which can significantly provide uniformity of coating thickness, that is, improve the spraying effect.
2. Bézier Triangular Surface Modeling Method of Sprayed Workpiece
Since the Bernstein polynomial has many superior properties, it is widely used in parametric polynomial curve surfaces of many forms. Based on the features of the sprayed workpiece surface, the Bézier triangular surface is constructed by using the Bernstein polynomial as the basis function.
Definition 1. There is an arbitrary given triangle on the plane whose vertices , are in the counterclockwise direction. Point is any point in the plane where the triangle is located.
In the Equation (1),
represents the directed area of the triangle
; When
,
,
is counterclockwise,
represents the area of the triangle
, that is
; When
,
,
is clockwise,
represents the opposite number of the area of the triangle, that is,
. Afterwards, we call
as the area coordinate of Point
, recorded as
. Triangle
is also called as coordinate triangle, as shown in
Figure 1.
Definition 2. Suppose the area coordinate of point on the coordinate triangle is , and then we define: As the basis function ( in all), They have the following properties:
- (1)
Non-negative: ;
- (2)
Normative: ;
where, according to the triangular theorem we can have:
For any , . Let , we can have .
Use the any straight line parallel to one side of the triangle to equate the remaining two sides of the coordinate triangle
into
segments, then the three parallel lines will divide the triangle into
small congruent triangles, thus we can make the
-time subdivision of the coordinate triangle
, recorded as
. Subsequently, we call each small triangle is the sub-triangle of
. The vertices of the sub-triangle (
in all) are called as the node that subdivides
. The coordinates of the sub-nodes are as follows:
Definition 3. Suppose is any real number, we call As the -time Bézier facet on the coordinate triangle , () as the coefficient of the Bézier triangular surface, , as the control vertice of the Bézier triangular surface. We call the patch linear continuous function, which is linear on the sub-triangle of and is the value at node as the control grid of the Bézier triangular surface.
In particular, for any function
, the
coefficient is taken as:
Then we call
as the n-time
triangular polynomial of
on
.
Where, in order to simplify the derivation process, three shift operators
,
,
are introduced, which are defined as:
Subsequently,
, and we have:
With the trinomial expansion, Equation (12) can be expressed as:
Here, we call point , , the corner points of the triangular surface.
When
,
. Substituting into Equation (6), then we have:
The boundary of a triangular surface is the n-time Bézier curve with the boundary of triangular surface control grid as the control polygons.
According to the definition of Bézier triangular surface modeling, when
, the quadratic Bézier triangular surface generated by six control vertices is:
The above Equation (19) can be further expressed as a quadratic form:
The resulting quadratic Bézier triangular surface and its control network projection are shown in
Figure 2.
When
, the cubic Bézier triangular surface that was generated by ten control vertices is:
The resulting cubic Bézier triangular surface and its control network projection are shown in
Figure 3.
4. Automatic Spray Space Path Generation on Bézier Surfaces
Under normal circumstances, using the Bézier method to generate the surface is more complex. It is more complex if we perform optimization of spraying trajectory directly on Bézier surface. On the other hand, during the spraying operation, the distance between the end effector and the workpiece surface is always constant and perpendicular to the workpiece surface. In this case, the end effector of the spray equipment is essentially reciprocating on the isometric surface of the workpiece surface. Therefore, according to this idea, we can first find its isometric surface according to the shape of the surface and then perform optimization of spraying trajectory on the isometric surface. It should be noted that, strictly speaking, it is the discrete point array of the isometric surface of the Bézier surface but not the isometric surface of Bézier surface that we will find out according to this method. In the spatial path planning of the spray painting robot, we only need to find the discrete points on the path essentially and then fit out the spray path using the corresponding mathematical methods according to the accuracy requirements.
A U-direction or V-direction Bézier curve on the Bézier surface boundary is used as a benchmark and it is discretized under a certain precision. Subsequently, specify a constant painting distance h and find the equidistant point of the discrete points on the Bézier surface in the direction of the normal vectors of the discrete points along the curve. After connecting these equidistant points with a smooth curve, we can find an equidistant line of a Bézier curve on the boundary line of the Bézier surface. By the same token, the Bézier curves with the same distance are specified on the Bézier surface (which is the distance between two adjacent painting paths). In the same way, the same method can be used to find the discrete point array of the equidistant surfaces of the Bézier surface. Afterwards, we use the cubic Cardinal spline curves to connect each discrete point array. The adjacent two segments of cubic Cardinal spline curve segments are connected by a Hermite spline curve, so that the specified painting path can be obtained.
5. Trajectory Optimization on the Bézier Surface
In the actual off-line programming process of spray painting robot, the following factors should be taken into consideration when performing the trajectory optimization for spray painting robot on curved surface: (1) Mathematical model of surfaces. (2) Spray painting model on curved surface. (3) The expression of paint thickness at a point on the surface. (4) Mathematical expression of optimized trajectory on surface and its solution. In essence, the trajectory optimization for spray painting robot is actually a multi-objective optimization problem with constraints. There are many constraints in this problem, such as the error of paint thickness, the path of the end effector, the moving speed, the surface shape of the sprayed workpiece, parameters of the end effector, air pressure, paint viscosity, and so on. Accordingly, how to deal with the constraint function effectively in order to guide the algorithm searching is the key of trajectory optimization problem [
12,
13,
14,
15]. On the other hand, there are many optimization objectives, such as minimum spray painting time, smallest variance of paint thickness, minimum paint consumption, the highest paint utilization rate, the least inflexion of the robot path, and so on. In these spray painting optimization objectives, the objective function of the trajectory optimization is not independent of each other. They are often coupled with each other and in a state of competition. As a result, it is very difficult to obtain the exact solution of the multi-objective trajectory optimization problem of spray painting robot.
In order to obtain high-efficient painting path, the ideal method is to make certain assumptions. That is, in the case that the error is allowed, a number of parameters are assumed to remain unchanged in the process of spray painting. Only the main factors in the spray painting process are taken into account. Such kind of idea makes the trajectory optimization of spray painting robot greatly simplified and it also makes the multi-objective optimization of spray painting trajectory with constraints being easy to be solved.
When solving the optimization problem of spray painting trajectory on Bézier surfaces, we will simplify and solve the problem according to the ideal above. The specific idea is as follows: After the Bézier triangular surface modeling method is used to obtain the parametric surface, a simple paint deposition rate model is established. On this basis, a general spray painting model on the Bézier surface is derived and the mathematical expression of paint thickness at an arbitrary point is also derived. Finally, the optimal spray painting speed and spray painting time are selected as optimization objectives. After the multi-objective optimization function of the spray painting robot on Bézier surface is derived, the appropriate mathematical programming method is used to obtain the solution and the optimized trajectory of spray painting robot on Bézier surface can also be obtained.
The spatial distribution model of coating, the cumulative rate of coating function diagram and free surface trajectory optimization method have been described in the previous work [
3,
16]. After spraying a curved surface
S, assuming that the average thickness of the surface is
, the coating thickness at any point
is
, the deviation of the maximum coating thickness is
, and then we have:
Assuming that the maximum coating thickness is
and the minimum coating thickness is
, the maximum deviation angle between the normal vector of all sampling points and the normal vector of the surface is
, then the coating thickness at any point s can satisfy the following inequality:
The coating thickness at any point s satisfies the requirement (29), then we have:
then:
If Equation (32) can be satisfied, then the maximum deviation angle can be calculated with Equation (33). That is, for any surface, if the deviation angle satisfies , then the coating thickness at any point on the curved surface can satisfy Equation (29).