Next Article in Journal
Performance and Wear of Diamond Honing Stones
Next Article in Special Issue
Construction Method of Digital Twin System for Thin-Walled Workpiece Machining Error Control Based on Analysis of Machine Tool Dynamic Characteristics
Previous Article in Journal
Analysis of Time-Varying Mesh Stiffness and Dynamic Response of Gear Transmission System with Pitting and Cracking Coupling Faults
Previous Article in Special Issue
Development of Pneumatic Force-Controlled Actuator for Automatic Robot Polishing Complex Curved Plexiglass Parts
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

PSO-Based Feedrate Optimization Algorithm for Five-Axis Machining with Constraint of Contour Error

State Key Laboratory of High-Performance Precision Manufacturing, School of Mechanical Engineering, Dalian University of Technology, Dalian 116024, China
*
Author to whom correspondence should be addressed.
Machines 2023, 11(4), 501; https://doi.org/10.3390/machines11040501
Submission received: 16 March 2023 / Revised: 18 April 2023 / Accepted: 19 April 2023 / Published: 21 April 2023
(This article belongs to the Special Issue Recent Progress of Thin Wall Machining)

Abstract

:
Feedrate has a great influence on contour error in five-axis machining. Accordingly, it is of great significance to plan the time-optimal feedrate curve considering the contour error constraint to achieve high-accuracy and high-efficiency machining. Aiming at improving the error control accuracy of model linearization loss and optimizing the machining time, the PSO-based feedrate optimization algorithm for five-axis machining with constraint of contour error is proposed in this paper. Firstly, the relationship between parametric feedrate and contour error constraint is clarified that provides a model basis for accurately controlling contour error by optimizing the feedrate curve. Then, the feedrate optimization model, which takes the control vertices of the feedrate curve expressed by B-spline as the decision variables and minimizes the machining time as the optimization objective, is established. Subsequently, to overcome the shortcomings of low accuracy and low efficiency caused by single optimization of global control vertices, the group search particle swarm optimization (GSPSO) algorithm based on window movement is adopted to optimize the feedrate curve in segments. Finally, the effectiveness of the proposed feedrate optimization algorithm is validated by three typical test toolpaths on an open double-turntable five-axis machine tool. In light of the experiment, the proposed algorithm is able to fully release the potential of the machine tools while accurately controlling the contour error of the cutter tip and cutter orientation.

1. Introduction

With the rapid increase in the demand for complex surface parts in aerospace and energy fields, five-axis machine tools, with the features of good obstacle avoidance and high motion flexibility, have been widely used. To achieve high-precision and high-efficiency machining on the five-axis machine tools, it is necessary to explore the contour error control method with optimal machining time. At present, the control of contour error is mainly realized by redesigning the servo controller structure [1,2,3,4], pre-compensation [5,6,7,8] and feedrate optimization. However, users usually are not capable of implementing these advanced control strategies to improve contour accuracy due to the confidentiality of the built-in controller structure of most commercial machine tools. In addition, the pre-compensation technology also has the problem that the contour control effect in the high-curvature area of the path deteriorates due to the decrease in path smoothness. By comparison, contour accuracy is improved by optimizing the feedrate curve, which can not only overcome the limitations of the above two methods, but also has higher flexibility and stronger robustness. Therefore, how to plan the time-optimal feedrate curve under the premise of ensuring contour accuracy is worthy of in-depth study.
In the initial research, in order to reduce the influence of curve interpolation error, the adaptive feedrate planning algorithm considering chord error was proposed [9,10]. Subsequently, some studies [11] have shown that limiting the kinematic characteristics of the cutter tip velocity, acceleration and jump in the process of machining can improve the forming quality of the parts and the service life of the cutters. Thus, the linear [12], exponential [13], s-curve [14] and sine-curve [15] acceleration and deceleration strategies that limit the kinematics characteristics of the cutter tip have been proposed successively. Notice that the abovementioned feedrate planning methods mainly focus on controlling the chord error and the kinematic features of the feed cutter, while ignoring the driving property of the machine tool feed axis. Especially in five-axis machining, due to the complex nonlinear mapping relationship between the motion of the feed cutter and the motion of the feed axis, even if the feedrate of the cutter is set to a constant value, the motion state of the feed axis may exceed its own driving capacity, resulting in the reduction in machining accuracy. Consequently, it is necessary to consider the drive constraints in the process of planning the feedrate curve. For instance, Sun [16] proposed a curve evolution strategy to iteratively adjust the initial feedrate curve to meet the jerk constraint requirements. Sencer [17] proposed a feedrate optimization method considering the Bang-Bang control of drive constraints, which realized the control of the motion state of the feed axis. Since then, the linear programming algorithm [18], bidirectional scanning algorithm [19], heuristic search algorithm [20] and greedy idea algorithm [21] have been proposed to control the driving performance of the feed axis.
It should be pointed out that although the above feedrate optimization algorithm is able to improve the contour accuracy, it does not directly consider the contour error constraint. To achieve the goal of accurately controlling the contour error by optimizing the feedrate curve, Lin [22] first established a nonlinear function model with the feedrate and the contour error respectively regarded as the independent variable and the dependent variable, and obtained the approximate value of the maximum feasible feedrate satisfying the preset contour error constraint. Jia [23] approximated the whole position closed-loop control system to a typical second-order under-damped system and deduced the explicit functional relationship of contour error in regard to the cutter feedrate, the curvature of the toolpath and the damping ratio of the system. On the basis of revealing the potential linear relationship between feed axis tracking error, feed axis velocity and feed axis acceleration, Wang [24] clarified the relationship between feedrate and the contour error constraint. According to the established feed servo system model, Chen [25] deduced the analytical equation between feedrate and contour error constraint. In addition, Erwinski [26] proposed a method to control contour error by optimizing feedrate curve with PSO combined with enhanced Lagrange constraint processing technology, based on the prediction of contour error using an artificial neural network. It is noteworthy that the above methods are difficult to effectively apply to five-axis machining in consideration of the complex nonlinear coupling property of five-axis kinematics transformation. For five-axis machining, Chen [27] clarified the linearization relationship between the contour of the cutter tip and cutter orientation with respect to feedrate by simplifying the tracking error prediction model and contour error estimation model.
To sum up, the current research on controlling the contour error of the cutter tip and cutter orientation by optimizing the feedrate curve is still very limited, and the linearization of the model will inevitably lead to the decline in error control accuracy. Aiming at handling the above problem, this paper proposes the PSO-based feedrate optimization algorithm for five-axis machining with constraint of contour error considering the advantages of PSO in solving nonlinear optimization problems in the fields of environmental sensing [28], space science [29], the design of time-delay equalizers [30] and spatial phase shifters [31]. Firstly, a nonlinear and high-precision feedrate optimization model with constraint of contour error is established on the basis of the dynamic prediction of tracking error and the iterative estimation of contour error. After that, for obtaining the target feedrate curve accurately and efficiently, the GSPSO algorithm based on window movement is applied to plan the feedrate curve in segments. The rest of the organization structure of the paper is as follows: The NURBS toolpath and interpolation algorithm are introduced in Section 2. Section 3 illustrates the details of the proposed feedrate optimization algorithm. The experimental results and analysis are presented in Section 4. The paper is summarized in Section 4

2. NURBS Toolpath and Interpolation Algorithm

In the workpiece coordinate system (WCS), the five-axis parametric toolpath is usually made up of the cutter tip position vector p ( u ) and the unit cutter orientation vector o ( u ) . NURBS is often used to express the five-axis parametric toolpath due to its accurate analytical expression and flexible local readjustment capability. The NURBS toolpath usually adopts normalized arc length parameterization. Therefore, the expression of the cutter tip position vector and the unit cutter orientation of the five-axis trajectory defined on the normalized arc length parameter u   ϵ   0 , 1 is
p u o u T = p x u , p y u , p z u , o x u , o u , o x u
The G 2 continuous dual NURBS are adopted to express the following five-axis parametric trajectory:
p u = i = 0 n N i , 3 u ω i p i / N i , 3 u ω i q u = i = 0 n N i , 3 u ω i q i / N i , 3 u ω i
where p ( u ) and q ( u ) , respectively, represent the cutter tip trace and the trace of a point on the cutter axis that is different from the cutter tip. p i and q i are the control vertices, n + 1 is the number of control vertices and ω i is the weight factor of the NURBS. N i , 3 u is the function defined on the following uniform node vector U :
U = 0 , , 0 4 , 1 n 2 , , n 1 n 2 , 1 , , 1 4
After that, the unit cutter orientation vector o ( u ) is calculated as
o u = p u q u p u q u o u = 1
Taking the A–C double-turntable five-axis machine tool shown in Figure 1 as an example, the toolpath p u , o ( u ) T in the WCS can be converted to the following motion trajectory m u of the feed axis in the machine coordinate system (MCS) by using the inverse kinematics transformation formula shown in Equation (6):
m u = X u , Y u , Z u , A u , C u T
where X , Y , Z and A , C , respectively, represent linear axes and rotary axes in the MCS. The inverse kinematics transformation formula shown in Figure 1 is as follows:
A = arccos O z C = arctan ( O x / O y ) X = cos C p x sin ( C ) p y Y = cos A sin C p x cos A cos C p y sin A p z sin ( A ) L a c , z Z = sin A sin C p x sin A cos C p y + cos A p z + cos A L a c , z + L T y a , z
where L T y a , z and L a c , z are turntable offsets. Correspondingly, the forward kinematics transformation formula shown in Figure 1 is as follows:
o x = sin ( A ) sin ( C ) o y = sin ( A ) cos ( C ) o z = cos ( A ) p x = cos C X + cos A sin C Y + sin A sin C Z sin ( C ) sin ( A ) L T y a , z p y = sin C X cos A cos C Y sin A cos C Z + cos ( C ) sin ( A ) L T y a , z p z = sin A Y + cos A Z cos A L T y a , z L a c , z
In order to interpolate the NURBS toolpath, it is necessary to clarify the relationship between arc length increment and parameter increment; however, the relationship is nonlinear due to its dependence on the shape of the toolpath. Therefore, the parameter increment corresponding to each step of interpolation is usually determined by Taylor approximation based on the current known feedrate. This paper adopts the following second-order Taylor formula:
u k + 1 = u k + f u k P u u k T s + a u k P u u k P u u k · P u u u k P u u k 4 f u q 2 T s 2 2
where f u k and a u k are the feedrate and acceleration of the cutter at the interpolation sampling parameter u k , respectively, and T s is the interpolation sampling period.

3. The Proposed Feedrate Optimization Algorithm

In this section, the prediction method of contour error of the cutter tip and cutter orientation is first introduced. Then, the feedrate optimization model aiming at the minimum machining time is established and the PSO algorithm for control vertices optimization is proposed. Finally, the implementation details of the feedrate optimization are clarified.

3.1. Contour Error Prediction

In five-axis machining, the tracking error caused by the response delay of the feed servo system will be delivered to the cutter through five-axis kinematics transformation, resulting in the contour error of the actual machining trajectory. In addition, the contour error is often obtained by estimation due to the complexity of solving the foot point parameter. Thus, the establishment of high-precision tracking error prediction and contour error estimation is the basis of accurate contour error prediction.

3.1.1. Tracking Error Prediction

For high-performance complex surface parts in CNC machining, to guarantee the surface processing quality of parts, the feed servo system usually does not allow overshoot. Therefore, technicians commonly adopt parameter coordination methods to make the entire CNC machining system run under over-damped conditions. At this time, the feed servo system is capable of being reasonably simplified to the typical first-order inertia system [32] shown in Equation (9).
G s = τ a s τ r s = 1 T s + 1
where τ r s and τ a s , respectively, represent the desired input position and actual output position of the servo system in the complex frequency domain, and T is the system time constant. It should be pointed out that the time constant T of the servo system is usually several times that of the interpolation sampling cycle T s of the CNC system. Moreover, the adjustment time for the servo system to reach the approximate steady-state condition is about ( 3 ~ 4 ) T , due to the limitation of the response bandwidth of the servo system, which also means that it is actually difficult for the servo system to reach a steady state in one interpolation sampling period. Therefore, it is very difficult to achieve high-precision tracking error prediction based on the assumption of steady-state response of the system. For the accurate prediction of contour error, we will use a dynamic prediction method based on an interpolation sampling position sequence to establish a tracking error prediction model with higher accuracy.
In actual CNC machining, to satisfy the requirements of various geometry, drive and process constraints, along the predefined toolpath, the feedrate usually takes the form of a step change with the interpolation sampling period T s as the time interval. Accordingly, it is also easy to find that the velocity of the servo system is also a fixed value within the same sampling period. In this case, ignoring the influence of filtering denoising inside the system, the position signals received by the servo system are essentially a set of variable ramp input signals. In order to analyze the tracking error under the variable ramp input signals, it is assumed that the current sampling moment is the end of the k th sampling period, and in addition to the ramp signal of the ( k + 1 ) th sampling period sent by the hose computer, the residual servo lag error of the k th sampling period will also be a part of the system input signal to drive feed axis movement [6]. At this moment, the linear superposition of the step signal and the ramp signal can be approximated as the input signal of the system. For the feed servo system with a single input and single output, the output of the system is also the linear superposition of the output response of the above the two typical signals based on the principle of linear superposition. Therefore, the feed axis tracking error e τ ( k T s ) at the k th sampling moment is calculated as
e τ k T s = e τ r a m p k T s + e τ s t e p k 1 T s e ^ T s T
with
e τ r a m p k T s = τ r k τ r k 1 T s T ( 1 e ^ T s T ) e τ s t e p ( ( k 1 ) T s ) = e τ k 1 T s   1 k N
where τ = ( X , Y , Z , A , C ) represents the machine tool feed axis, e ^ and N , respectively, indicate the natural constant and the number of reference interpolation sampling position sequences. τ r k donates the discrete position of the feed axis, and e τ s t e p ( ( k 1 ) T s ) and e τ r a m p k T s , respectively, represent the servo lag error of the system at the ( k 1 ) th sampling moment and the tracking error introduced by the ramp signal ( τ r k τ r k 1 ) / T s . Correspondingly, the actual position of the feed axis at the k th sampling moment is calculated as
τ a k = τ r k e k T s
Equations (10) and (12) show that the output position of the feed axis at the k th sampling moment is not only related to the input signal at the current moment but is also affected by the previous input signal. For a given feed servo system, e ^ , T and T s in Equation (10) are fixed constants. Therefore, Equations (10) and (11) essentially reveal the potential linear relationship between the system reference position sequence and the feed axis tracking error, which also provides a model basis for the subsequent precise prediction of contour error.

3.1.2. Contour Error Estimation

On the five-axis toolpath as shown in Figure 2, ( p a , o a ) is the actual cutter position, ( p r , o r ) is the reference cutter position, and the cutter position deviation between ( p a , o a ) and ( p r , o r ) is the tracking error ( e p , e o ) , where e p is the tracking error of the cutter tip, and e o is the tracking error of the cutter orientation, as shown by the green solid line in Figure 2. The cutter tip position p n is the point closest to the actual cutter tip position p a on the toolpath, also known as the station point. The deviation of the cutter position between ( p a , o a ) and ( p n , o n ) is the contour error ( ε p , ε o ) , where ε p and ε o , respectively, represent the contour error of the cutter tip and cutter orientation, as shown by the red solid line in Figure 2.
Accordingly, calculating the parameter u n corresponding to the station point p n is a prerequisite for obtaining the contour error of the cutter tip and cutter orientation. However, due to the fact that p ( u ) is a free curve equation, the parameter u n corresponding to the equation is the nonlinear equation, making it difficult to obtain an accurate analytical solution. To handle this problem, the initial value regeneration Newton method [33] is used to efficiently and accurately obtain an approximate numerical solution for the parameter u n . The numerical solution u f is calculated as
u f = u b p u b 2 p u b p a · p u b T p u b 4 + p u b 2 p u b p a · p u b T p u b p a · p u b T p u b · p u b T
where u b is the initial value of regeneration and it is calculated as
u b = u r p u r p a · p u r T p u r
where u r represents the corresponding parameter for the cutter tip position p r .
According to the convergence of Newton’s algorithm, the parameter u n corresponding to the station point p n is calculated as
u n = u f , | d t u f | < | d t u b | u b p u b p a · p u b T p u b , | d t u f | | d t u b |
On the basis of the abovementioned concept of contour error, the cutter tip error ε p and the cutter orientation error ε o can be calculated as
ε p = p u n p a
ε o = o u n o a

3.2. Feedrate Optimization Model

According to the known five-axis parameter trajectory p u , o ( u ) T , the feedrate curve f ( u ) can be expressed by the G 2 continuous B-spline defined in the same parameter u
f u = i = 0 M d i N i , 3 u
where d i and M + 1 , respectively, represent the control vertices and the number of control vertices of the B-spline, and N i , 3 u here is set as Equation (2).
Along the given toolpath, the goal of feedrate optimization is to acquire the shortest machining time T o b j by adjusting the feedrate curve f ( u ) shape while meeting the preset contour error constraint. Therefore, the feedrate optimization model can be established as follows:
m i n T o b j = m i n 0 1 d t d u d u
s . t . ε p ( u ) ε p m a x ε o ( u ) ε o m a x , u   ϵ 0,1
where ε p m a x and ε o m a x , respectively, indicate the upper bound of the contour error constraints of the cutter tip and cutter orientation. According to the analysis of the feedrate optimization model, the model has the characteristic of a strong coupling nonlinearity. To accurately and efficiently solve the optimization model and gain the optimal target feedrate curve, this paper proposes a general solution with PSO combined with a novel constraint processing technology. Furthermore, it is worth noting that the optimized machining time is paid more attention than the calculation time for the off-line feedrate optimization algorithm.

3.3. Control Vertices Optimization Based on PSO Algorithm

In light of the definition of feedrate curve f ( u ) , the feedrate curve shape is completely controlled by the control vertices on the premise that the knot vector U remains unchanged. As a consequence, the control vertices d i i = 0 M can be selected as the decision variables of the feedrate optimization model. The PSO algorithm is used for solving the feedrate optimization model in this paper and it determines the optimal solution step by step through the exchange of information between an individual and a population. Different from other optimization algorithms, the PSO algorithm not only has few parameters and is easy to implement, but also has a fast solving speed and a strong global parallel search ability. Additionally, it has small restrictions on population size and is capable of recording population information [34]. The mathematical model considering contour error constraints and taking control vertices as decision variables is first established in this section. After that, the process of using the GSPSO algorithm based on window movement to solve the decision variables is introduced at great length.

3.3.1. Mathematical Model

Consider the convex hull property of the spline curve, the search boundary condition of the control vertices is set as 0 d i i = 0 M f m a x , where f m a x is the maximum programmed feedrate, whose value is usually determined by surface quality, cutter life, the removal rate of material, cutting force and other factors. Obtaining the time-optimal feedrate curve means seeking the maximum feasible solution of the feedrate under the contour error constraints. Consequently, the objective function shown in Equation (19) T o b j is converted into the new objective function F o b j as follows:
m i n F o b j = k = 0 N i = 0 M d i N i , 3 u k ( u k u k 1 )
s . t . g 1 u k = ε p ε p m a x 1 0 g 1 u k = ε o ε o m a x 1 0 , 0 k N
where g 1 u k and g 1 u k , respectively, denote the inequality constraints at the interpolation sampling parameter u k . The normalization of the constraints and objective function is performed to avoid the optimization process being affected by their order of magnitude differences.
Accordingly, the constraint violation degree c k at the sampling parameter u k is calculated as
c k = i = 1 2 max 0 , g i u k , 0 k N
According to the analysis of Equation (23), c k = 0 means that the motion state at the sampling parameter u k meets all constraints, otherwise one of the contour error constraints of cutter tip and cutter orientation is violated. Hence, when the objective function F o b j is minimum and there is no violation of constraints, the corresponding control vertices d i i = 0 M can be used to generate the target optimal feedrate curve.

3.3.2. GSPSO Algorithm Based on Window Movement

Note that if all control vertices are simultaneously optimized, it has not only a problem in determining the optimal solution, but also needs to take a long time to calculate. To consider the accuracy and efficiency of the solution, the moving window planning method is adopted to attain the solution of the feedrate optimization model on the basis of the flexible local readjustment capability of the feedrate curve, as shown in Figure 3. Each time the window is moved, a group of control vertices are optimized until all control vertices are optimized. To ensure that the feedrate curve between the two adjacent windows can smoothly transition without violating the constraints of contour error in the optimization process, a certain width overlap region R should be reserved between adjacent windows, as shown in Figure 4. Taking the control vertices contained in a single window as the optimization unit, the specific implementation process of GSPSO algorithm is introduced. According to the analysis results in Section 3.3.1, the search interval of control vertices in the GSPSO algorithm can be determined as 0 , f m a x . To achieve the goal of optimizing the global search capability and convergence time, both the infeasible solutions of the optimization model should be sufficiently utilized, and the method of population initialization also needs to be optimized. The detailed implementation process of the GSPSO algorithm is described as follows:
Step 1. Set the initial and maximum values of the iteration times to 0 and l m a x , respectively. The population velocity of random initialization is defined as v l = v 1 l , v 2 l , , v s l , where s is the population size. Making the best of the boundary value f m a x of control vertices d i i = 0 M is beneficial to obtaining good initialization results. In view of the above, the initial position x m l = d r , m l , d r , m l , , d t , m l of the m th h -dimensional particle can be calculated as
x m l = r a n d 1 , h f m a x , m = 1 , 2 , , s
with
h = t r + 1
where r and t , respectively, represent the sequence numbers of control vertices d r and d t , and r a n d 1 , h indicates a 1 × h dimensional belonging to the range of 0,1 uniform random number matrix.
Step 2. According to B-spline definition, the sampling parameter interval u r * , u t * that needs to detect the constraint violation degree c k can be determined by the particle x m l , and the corresponding total constraint violation degree C m l is calculated as C m l = r = r * t * c k l . After that, the objective function corresponding to the particle x m l is F o b j , m l , which can be calculated by Equation (21). Set the initial individual best position P m l = x m l , the individual best value P b e s t . m l = F o b j , m l , and the corresponding total constraint violation degree P c o n s t , m l = C m l of the particle x m l . The initialization results of the global optimal position G l , the global optimal value G b e s t l and the corresponding total constraint violation degree G c o n s t l can be acquired from Algorithm 1.
Step 3. The linear weight reduction strategy [34] is adopted to determine the new position and velocity per particle. The updated process is as follows:
v m l + 1 = φ v m l + c 1 r 1 P m l x m l + c 2 r 2 G l x m l
x m l + 1 = x m l + v m l + 1
φ = φ m a x φ m a x φ m i n L m a x l
where x m l and v m l are the position and velocity of the m th particle in the l th iterations, respectively, x m l + 1 and v m l + 1 are the position and velocity of the ( m + 1 ) th particle in the ( l + 1 ) th iterations, respectively. c 1 and c 2 are the acceleration constant, also known as the learning factor, φ m i n and φ m a x are the upper and lower bounds of the inertia weight, respectively, r 1 and r 2 represent belonging to the range of 0,1 uniform random number.
Step 4. Handle boundary conditions and calculate the total constraint violation degree C m l and the objective function value F o b j , m l of the particle x m l , and let l = l + 1 . Considering that infeasible solutions should be sufficiently utilized, the updated strategy [35] and Algorithm 1 are adopted to update the individual best position P m l and global optimal position G l .
Step 5. If l < l m a x , return to step 3. Otherwise, the global optimal position G b e s t l m a x and corresponding total constraint violation degree G c o n s t l m a x should be output.
Algorithm 1. Algorithm of global optimal position.
Input: P m l   P b e s t , m l   P c o n s t , m l   ( m = 1,2 , , s )   G l 1   G b e s t l 1   G c o n s t l 1   ( l 1 )
G l = P 1 l   G b e s t l = P b e s t , 1 l   G c o n s t l = P c o n s t , 1 l   ( l = 0 )   / Initialization
Output: G l   G b e s t l   G c o n s t l
01:for  m = 1 : s  do
02:  if  G c o n s t l 1 = 0 & P c o n s t , m l = 0   / Both positions are feasible solutions
03:    if  P b e s t l < G b e s t l 1
04:       G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
05:     end if
06:  elseif G c o n s t l 1 = 0 & P c o n s t , m l > 0   / One of the two solutions is feasible and the other is not.
07:    if P b e s t l < G b e s t l 1
08:      if  r 3 < ( 0.5 l / ( 2 l m a x ) )   / Randomly generate r 3 0,1
09:         G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
10:       end if
11:     end if
12:  elseif  G c o n s t l 1 > 0 & P c o n s t , m l = 0
13:    if  P b e s t l < G b e s t l 1
14:       G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
15:     else
16:      if  r 3 > ( 0.5 l / ( 2 l m a x ) )   / Randomly generate r 3 0,1
17:         G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
18:       end if
19:     end if
20:  elseif  G c o n s t l 1 > 0 & P c o n s t , m l > 0   / Both positions are infeasible solutions
21:    if  P b e s t l < G b e s t l 1   P c o n s t , m l < G c o n s t l 1
22:       G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
23:    elseif  P b e s t . m l > G b e s t l 1 & P c o n s t , m l < G c o n s t l 1
24:      if  G c o n s t l 1 / P c o n s t , m l > P b e s t . m l / G b e s t l 1
25:         G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
26:       end if
27:    elseif P b e s t l < G b e s t l 1 & P c o n s t , m l > G c o n s t l 1
28:       if G c o n s t l 1 / P c o n s t , m l < P b e s t . m l / G b e s t l 1
29:         G l = P m l   G b e s t l = P b e s t . m l   G c o n s t l = P c o n s t , m l
30:       end if
31:     end if
32:   else
33:     G l = P m l 1   G b e s t l = P b e s t . m l 1   G c o n s t l = P c o n s t , m l 1
34:   end if
35:end for

3.4. Implementation Details of Feedrate Optimization

In light of the above modeling process and the proposed algorithm, detailed optimization steps of the feedrate curve are described as follows:
Step 1. The interpolation sampling parameter sequence u k k = 0 N is determined by Equation (2), on the basis of the given toolpath and the initial feedrate curve is generated by a random initialization of the GSPSO algorithm.
Step 2. For the sequence u k k = 0 N , the corresponding reference command sequence p r ( u k ) , o r ( u k ) T | 0 k N and m r ( u k ) | 0 k N can be respectively obtained from Equations (3) and (4).
Step 3. According to the contour error prediction model in Section 3.1, the cutter tip contour error sequence ε p ( u k ) | 0 k N and the cutter orientation contour error sequence ε 0 ( u k ) | 0 k N are gained by the reference command sequence.
Step 4. If l < l m a x , use the proposed GSPSO algorithm to optimize the previous feedrate curve and return to Step 1. Otherwise, output the final feedrate curve of the current window.
Step 5. Repeat the above process as the window moves until the optimization of the global feedrate curve is completed.
Figure 4 and Figure 5, respectively, present a flow chart of feedrate curve optimization in the current window and a diagram of the window moving method to better understand the optimization process of the global feedrate curve.

4. Experimental Verification

The effectiveness of the proposed feedrate optimization algorithm is validated by three typical toolpaths in this section. The A–C double-turntable open five-axis machine tool for experimental verification is shown in Figure 6. During actual processing, the actual position information of the linear axes and rotary axes of the machine tool can be acquired from the optical encoder with a resolution of 500 × 256 pulses/rev. The motor and driver driving linear axes and rotary axes are of the YASKAWA brand. The time constants of the feed axes of the machine tool were determined using the method proposed by Dong [32], which were approximated as T X = 0.0231 , T Y = 0.0231 , T Z = 0.0271 , T A = 0.0262 and T Y = 0.0215 , respectively. The interpolation sampling period T s is 4 mms. To consider the calculation efficiency and optimization result accuracy, the total number of control vertices of the feedrate curve M is 120, the interval window interval h is 25, and the window overlap region R is 5. Parameters of GSPSO algorithm are shown in Table 1. Moreover, considering the driving capacity limitation of the YASKAWA servo driver used in the experiment, the maximum programmed feedrate f m a x of the cutter tip was set to 20   m m / s during the actual experiment.

4.1. Example 1

The total length of the butterfly trajectory expressed by NURBS is 338.68 mm in Experiment 1, as shown in Figure 7a. According to the analysis of trajectory characteristics, many high-curvature areas on the toolpath are conducive to verifying the excellent performance of the algorithm. In this example, the maximum limit value of the cutter tip contour error ε p m a x is 0.05 mm. Figure 7b shows the feedrate curve with a cutter contour error constraint generated by the proposed method. The actual cutter tip contour error during the experiment is shown in Figure 7c. Analysis of this picture reveals that the cutter tip contour error at each point on the toolpath does not go beyond the set constraint limit, which proves that the algorithm is effective. Further study of the experimental results is able to find that the cutter tip error almost reaches the set maximum error limit in multiple processing time intervals, which also reflects the excellent performance of the algorithm to some extent.

4.2. Example 2

Unlike three-axis machining, the nonlinear coupling motion peculiarity of five-axis machining makes it more difficult to accurately control the cutter tip contour error. In Experiment 2, take the five-axis end milling trajectory expressed by NURBS as shown in Figure 8a as an example for experimental verification, and the toolpath length is 128.45 mm. Figure 8b,c, respectively, represent the corresponding reference position curves of the translational axes ( X , Y , Z ) and the rotational axes ( A , C ) in the MCS. The maximum limit value of the cutter tip contour error ε p m a x is 0.04 mm in this example. The five-axis milling process and the machined part with the optimized feedrate are shown in Figure 8d,e. Figure 8f presents the feedrate curve with cutter contour error constraint generated by the proposed method. Figure 8g displays the experimental measurement results of cutter tip contour error for five-axis end milling. According to the analysis of the experimental results, the cutter contour error does not exceed the preset error constraint range and fluctuates around the limit value of the constraint in most of the processing time, which further exhibits the superiority of the algorithm.

4.3. Example 3

Compared with end milling, flank milling needs to bound the contour error of cutter tip and cutter orientation. To guarantee the contour accuracy of flank milling, the contour error of cutter tip and cutter orientation should be constrained simultaneously. Figure 9a exhibits the five-axis flank milling trajectory expressed by dual NURBS that is taken as the test object for experimental verification, and the toolpath length is 329.44 mm. Figure 9b,c indicate the corresponding reference position curves of the translational axes ( X , Y , Z ) and the rotational axes ( A , C ) in the MCS, respectively. To further validate that the proposed feedrate optimization algorithm is effective and excellent, the contour accuracy and processing time of the constant feedrate process of machine tools and the new method are compared. In this comparative experiment, the limit value of the contour error of the cutter tip ε p m a x is 0.04 mm and the limit value of the contour error of cutter orientation ε o m a x is 3 × 10 4 rad, and the constant feedrate process parameter is 10mm/s. Based on the established feedrate optimization model, the feedrate curve is determined under the constraint of contour error, including the cutter tip (colored in pink), the cutter orientation (colored in cyan) and the final blue feedrate curve, as shown in Figure 9d.
Figure 9e,f present the comparative experimental results of the contour error of cutter tip and cutter orientation for using the above-mentioned two methods. On the basis of the analysis of experimental data, the maximum values of the contour error cutter tip and cutter orientation are 0.0692 mm and 6.019 × 10 4 rad for using constant feedrate processing, respectively, which are out of limits and do not meet the requirements of machining accuracy. In contrast, the paper proposes a feedrate optimization algorithm that can not only effectively control the contour error cutter tip and cutter orientation within the preset range but can also greatly improve the maximum feasible feedrate. According to the calculation of specific experimental data, the maximum values of the contour error cutter tip and cutter orientation have decreased by 42.2% and 50.16%, respectively, and the machining time has shortened by 11.42%. In addition, further analysis of Figure 9e,f demonstrates that at least one out of the cutter tip contour error and cutter orientation contour error has reached its upper bound in the whole machining process, which reflects the optimization of the proposed algorithm in great measure.
Note that the interpolation sampling position sequence of each servo feed axis of the machine tool is generated without going against the drive constraints in all experiments. Therefore, the influence of other factors besides contour error can be minimized or ignored in the process of experimental verification. As a matter of fact, based on the process of solving the feedrate optimization model with the proposed GSPSO algorithm, it is easy and reliable to introduce more constraints related to machining into the existing optimization model. The analysis of the contour error image indicates that although the relatively satisfactory experimental results have been achieved, there is still some optimization space to acquire more accurate control. It is speculated that this may be mainly caused by the loss of a certain accuracy of the tracking error prediction model due to the transfer function of the servo system being simplified. In the next work, the dynamic response, particularity of the servo system, will be further studied and a more accurate tracking error prediction model will also be established.

5. Conclusions

The heuristic feedrate optimization algorithm is proposed to optimize five-axis machining in this paper and is capable of achieving the accurate control of five-axis contour error. Firstly, according to the established tracking error dynamic prediction model and the contour error iterative estimation model, the relationship between the parametric feedrate and contour error constraint is clarified, which provides a model basis for the accurate control of contour error by optimizing the feedrate curve. After that, the feedrate optimization model aiming at minimizing the machining time and taking the control vertices of the feedrate curve expressed by cubic B-spline as decision variables is established. Subsequently, considering that B-spline has a flexible local readjustment capability, the GSPSO algorithm based on window movement is applied to optimize the feedrate curve in segments, which solves the problem of low accuracy and low efficiency caused by the single optimization of all control vertices. Finally, experimental tests on an open five-axis machine tool validate the excellent performance of the proposed feedrate optimization algorithm. Experimental results show that the proposed algorithm is capable of sufficiently releasing the potential of the machine tools while accurately controlling the contour error of the cutter tip and cutter orientation. Moreover, it is easy to implement and trustworthy, the size of contour error constraints can be adjusted with freedom and more constraints can be introduced in accordance with the actual machining requirements.

Author Contributions

Conceptualization, J.Y.; formal analysis, J.Y., X.Y. and Y.S.; funding acquisition, Y.S.; investigation, J.Y.; methodology, Y.S.; resources, Y.S.; writing—original draft, J.Y.; writing—review and editing, X.Y. and Y.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research is supported by the National Natural Science Foundation of China (Grant No. U22A20202 and 91948203).

Data Availability Statement

Not applicable.

Conflicts of Interest

There are no conflict of interest to declare.

References

  1. Altintas, Y.; Erkorkmaz, K.; Zhu, W.-H. Sliding Mode Controller Design for High Speed Feed Drives. CIRP Ann. 2000, 49, 265–270. [Google Scholar] [CrossRef]
  2. Erkorkmaz, K.; Altintas, Y. High Speed CNC System Design. Part III: High Speed Tracking and Contouring Control of Feed Drives. Int. J. Mach. Tools Manuf. 2001, 41, 1637–1658. [Google Scholar] [CrossRef]
  3. Sencer, B.; Altintas, Y.; Croft, E. Modeling and Control of Contouring Errors for Five-Axis Machine Tools—Part I: Modeling. J. Manuf. Sci. Eng. 2009, 131, 031006. [Google Scholar] [CrossRef]
  4. Altintas, Y.; Sencer, B. High Speed Contouring Control Strategy for Five-Axis Machine Tools. CIRP Ann. 2010, 59, 417–420. [Google Scholar] [CrossRef]
  5. Yang, S.; Ghasemi, A.H.; Lu, X.; Okwudire, C.E. Pre-Compensation of Servo Contour Errors Using a Model Predictive Control Framework. Int. J. Mach. Tools Manuf. 2015, 98, 50–60. [Google Scholar] [CrossRef]
  6. Chen, M.; Sun, Y.; Xu, J. A New Analytical Path-Reshaping Model and Solution Algorithm for Contour Error Pre-Compensation in Multi-Axis Computer Numerical Control Machining. J. Manuf. Sci. Eng. 2020, 142, 061006. [Google Scholar] [CrossRef]
  7. Liu, Y.; Chen, M.; Sun, Y. Global Toolpath Modulation–Based Contour Error Pre-Compensation for Multi-Axis CNC Machining. Int. J. Adv. Manuf. Technol. 2023, 125, 3171–3189. [Google Scholar] [CrossRef]
  8. Xiao, Q.-B.; Wan, M.; Yang, Y.; Zhang, W.-H. Pre-Compensation of Contour Errors for Five-Axis Machine Tools through Constructing a Model Reference Adaptive Control. Mech. Mach. Theory 2023, 183, 105258. [Google Scholar] [CrossRef]
  9. Yeh, S.S.; Hsu, P.L. Adaptive-Feedrate Interpolation for Parametric Curves with a Confined Chord Error. Comput.-Aided Des. 2002, 34, 229–237. [Google Scholar] [CrossRef]
  10. Du, X.; Huang, J.; Zhu, L.-M.; Ding, H. Third-Order Chord Error Estimation for Freeform Contour in Computer-Aided Manufacturing and Computer Numerical Control Systems. Inst. Mech. Eng. Part B J. Eng. Manuf. 2019, 233, 863–874. [Google Scholar] [CrossRef]
  11. Sun, Y.; Jia, J.; Xu, J.; Chen, M.; Niu, J. Path, Feedrate and Trajectory Planning for Free-Form Surface Machining: A State-of-the-Art Review. Chin. J. Aeronaut. 2022, 35, 12–29. [Google Scholar] [CrossRef]
  12. Hu, J.; Xiao, L.; Wang, Y.; Wu, Z. An Optimal Feedrate Model and Solution Algorithm for a High-Speed Machine of Small Line Blocks with Look-Ahead. Int. J. Adv. Manuf. Technol. 2006, 28, 930–935. [Google Scholar] [CrossRef]
  13. Zhang, Z.; Guo, S.; Wang, H.; Deng, S. A New Acceleration and Deceleration Algorithm and Applications. In Proceedings of the 2012 Second International Conference on Intelligent System Design and Engineering Application, Sanya, China, 6–7 January 2012; pp. 121–124. [Google Scholar]
  14. Wu, J.; Xu, K.; Ren, G.; Fan, D. Research on the S-Shaped Time-Rounding Series Feedrate Scheduling Based on NURBS Curve. Adv. Mech. Eng. 2022, 14, 168781322211214. [Google Scholar] [CrossRef]
  15. Huang, J.; Zhu, L.-M. Feedrate Scheduling for Interpolation of Parametric Tool Path Using the Sine Series Representation of Jerk Profile. Inst. Mech. Eng. Part B J. Eng. Manuf. 2017, 231, 2359–2371. [Google Scholar] [CrossRef]
  16. Sun, Y.; Zhao, Y.; Xu, J.; Guo, D. The Feedrate Scheduling of Parametric Interpolator with Geometry, Process and Drive Constraints for Multi-Axis CNC Machine Tools. Int. J. Mach. Tools Manuf. 2014, 85, 49–57. [Google Scholar] [CrossRef]
  17. Sencer, B.; Altintas, Y.; Croft, E. Feed Optimization for Five-Axis CNC Machine Tools with Drive Constraints. Int. J. Mach. Tools Manuf. 2008, 48, 733–745. [Google Scholar] [CrossRef]
  18. Petráček, P.; Vlk, B.; Švéda, J. Linear Programming Feedrate Optimization: Adaptive Path Sampling and Feedrate Override. Int. J. Adv. Manuf. Technol. 2022, 120, 3625–3646. [Google Scholar] [CrossRef]
  19. Ni, H.; Zhang, C.; Ji, S.; Hu, T.; Chen, Q.; Liu, Y.; Wang, G. A Bidirectional Adaptive Feedrate Scheduling Method of NURBS Interpolation Based on S-Shaped ACC/DEC Algorithm. IEEE Access 2018, 6, 63794–63812. [Google Scholar] [CrossRef]
  20. Xiao, J.; Liu, S.; Liu, H.; Wang, M.; Li, G.; Wang, Y. A Jerk-Limited Heuristic Feedrate Scheduling Method Based on Particle Swarm Optimization for a 5-DOF Hybrid Robot. Robot. Comput.-Integr. Manuf. 2022, 78, 102396. [Google Scholar] [CrossRef]
  21. Zhang, K.; Yuan, C.-M.; Gao, X.-S.; Li, H. A Greedy Algorithm for Feedrate Planning of CNC Machines along Curved Tool Paths with Confined Jerk. Robot. Comput.-Integr. Manuf. 2012, 28, 472–483. [Google Scholar] [CrossRef]
  22. Lin, M.-T.; Tsai, M.-S.; Yau, H.-T. Development of a Dynamics-Based NURBS Interpolator with Real-Time Look-Ahead Algorithm. Int. J. Mach. Tools Manuf. 2007, 47, 2246–2262. [Google Scholar] [CrossRef]
  23. Jia, Z.; Song, D.; Ma, J.; Hu, G.; Su, W. A NURBS Interpolator with Constant Speed at Feedrate-Sensitive Regions under Drive and Contour-Error Constraints. Int. J. Mach. Tools Manuf. 2017, 116, 1–17. [Google Scholar] [CrossRef]
  24. Wang, J.; Sui, Z.; Tian, Y.; Wang, X.; Fang, L. A Speed Optimization Algorithm Based on the Contour Error Model of Lag Synchronization for CNC Cam Grinding. Int. J. Adv. Manuf. Technol. 2015, 80, 1421–1432. [Google Scholar] [CrossRef]
  25. Chen, J.; Ren, F.; Sun, Y. Contouring Accuracy Improvement Using an Adaptive Feedrate Planning Method for CNC Machine Tools. Procedia CIRP 2016, 56, 299–305. [Google Scholar] [CrossRef]
  26. Erwinski, K.; Paprocki, M.; Wawrzak, A.; Grzesiak, L.M. PSO Based Feedrate Optimization with Contour Error Constraints for NURBS Toolpaths. In Proceedings of the 2016 21st International Conference on Methods and Models in Automation and Robotics (MMAR), Miedzyzdroje, Poland, 29 August–1 September 2016; pp. 1200–1205. [Google Scholar]
  27. Chen, M.; Sun, Y. Contour Error–Bounded Parametric Interpolator with Minimum Feedrate Fluctuation for Five-Axis CNC Machine Tools. Int. J. Adv. Manuf. Technol. 2019, 103, 567–584. [Google Scholar] [CrossRef]
  28. Lalbakhsh, A.; Simorangkir, R.B.V.B.; Bayat-Makou, N.; Kishk, A.A.; Esselle, K.P. Chapter 2—Advancements and artificial intelligence approaches in antennas for environmental sensing. In Artificial Intelligence and Data Science in Environmental Sensing; Asadnia, M., Razmjou, A., Beheshti, A., Eds.; Cognitive Data Science in Sustainable Computing; Academic Press: Cambridge, MA, USA, 2022; pp. 19–38. ISBN 978-0-323-90508-4. [Google Scholar]
  29. Lalbakhsh, A.; Pitcairn, A.; Mandal, K.; Alibakhshikenari, M.; Esselle, K.P.; Reisenfeld, S. Darkening Low-Earth Orbit Satellite Constellations: A Review. IEEE Access 2022, 10, 24383–24394. [Google Scholar] [CrossRef]
  30. Lalbakhsh, A.; Afzal, M.U.; Esselle, K.P. Multiobjective Particle Swarm Optimization to Design a Time-Delay Equalizer Metasurface for an Electromagnetic Band-Gap Resonator Antenna. IEEE Antennas Wirel. Propag. Lett. 2017, 16, 912–915. [Google Scholar] [CrossRef]
  31. Lalbakhsh, A.; Afzal, M.U.; Esselle, K. Simulation-Driven Particle Swarm Optimization of Spatial Phase Shifters. In Proceedings of the 2016 International Conference on Electromagnetics in Advanced Applications (ICEAA), Cairns, Australia, 19–23 September 2016; pp. 428–430. [Google Scholar]
  32. Dong, J.; Wang, T.; Li, B.; Ding, Y. Smooth Feedrate Planning for Continuous Short Line Tool Path with Contour Error Constraint. Int. J. Mach. Tools Manuf. 2014, 76, 1–12. [Google Scholar] [CrossRef]
  33. Jia, Z.; Song, D.; Ma, J.; Qin, F.; Wang, X. High-Precision Estimation and Double-Loop Compensation of Contouring Errors in Five-Axis Dual-NURBS Toolpath Following Tasks. Precis. Eng. 2018, 54, 243–253. [Google Scholar] [CrossRef]
  34. Shi, Y.; Eberhart, R.C. Empirical Study of Particle Swarm Optimization. In Proceedings of the 1999 Congress on Evolutionary Computation-CEC99 (Cat. No. 99TH8406), Washington, DC, USA, 6–9 July 1999; pp. 1945–1950. [Google Scholar]
  35. Sun, Y.; Gao, Y. An Efficient Modified Particle Swarm Optimization Algorithm for Solving Mixed-Integer Nonlinear Programming Problems. Int. J. Comput. Intell. Syst. 2019, 12, 530. [Google Scholar] [CrossRef]
Figure 1. A–C double-turntable five-axis machine tool.
Figure 1. A–C double-turntable five-axis machine tool.
Machines 11 00501 g001
Figure 2. Five-axis tracking error and contour error.
Figure 2. Five-axis tracking error and contour error.
Machines 11 00501 g002
Figure 3. Local readjustment capability of feedrate curve.
Figure 3. Local readjustment capability of feedrate curve.
Machines 11 00501 g003
Figure 4. Flow chart of feedrate curve optimization in the current window.
Figure 4. Flow chart of feedrate curve optimization in the current window.
Machines 11 00501 g004
Figure 5. Diagram of the window moving method.
Figure 5. Diagram of the window moving method.
Machines 11 00501 g005
Figure 6. A–C double-turntable open five-axis machine tool for experimental verification.
Figure 6. A–C double-turntable open five-axis machine tool for experimental verification.
Machines 11 00501 g006
Figure 7. Experimental verification of butterfly trajectory: (a) butterfly trajectory; (b) feedrate curve generated by the proposed optimization algorithm; (c) experimental measurement results of cutter tip contour error.
Figure 7. Experimental verification of butterfly trajectory: (a) butterfly trajectory; (b) feedrate curve generated by the proposed optimization algorithm; (c) experimental measurement results of cutter tip contour error.
Machines 11 00501 g007
Figure 8. Experimental results of five-axis end milling: (a) toolpath is expressed by dual NURBS; (b) position curve of linear axes; (c) position curve of rotary axes; (d) five-axis milling process; (e) machined part with the optimized feedrate; (f) optimized feedrate curve with the constraint of cutter tip contour error; (g) experimental measurement results of cutter tip contour error.
Figure 8. Experimental results of five-axis end milling: (a) toolpath is expressed by dual NURBS; (b) position curve of linear axes; (c) position curve of rotary axes; (d) five-axis milling process; (e) machined part with the optimized feedrate; (f) optimized feedrate curve with the constraint of cutter tip contour error; (g) experimental measurement results of cutter tip contour error.
Machines 11 00501 g008
Figure 9. Comparative experimental results of five-axis flank milling: (a) toolpath is expressed by dual NUBRS; (b) position curve of linear axes; (c) position curve of rotary axes; (d) feedrate curve considering the contour error of cutter tip and cutter orientation constraint; (e) comparative experimental results of cutter tip contour accuracy; (f) comparative experimental results of cutter orientation contour accuracy.
Figure 9. Comparative experimental results of five-axis flank milling: (a) toolpath is expressed by dual NUBRS; (b) position curve of linear axes; (c) position curve of rotary axes; (d) feedrate curve considering the contour error of cutter tip and cutter orientation constraint; (e) comparative experimental results of cutter tip contour accuracy; (f) comparative experimental results of cutter orientation contour accuracy.
Machines 11 00501 g009
Table 1. Parameters of GSPSO algorithm.
Table 1. Parameters of GSPSO algorithm.
c 1 c 2 φ m a x φ m i n s l m a x
1.49621.49620.80.410030
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yang, J.; Yin, X.; Sun, Y. PSO-Based Feedrate Optimization Algorithm for Five-Axis Machining with Constraint of Contour Error. Machines 2023, 11, 501. https://doi.org/10.3390/machines11040501

AMA Style

Yang J, Yin X, Sun Y. PSO-Based Feedrate Optimization Algorithm for Five-Axis Machining with Constraint of Contour Error. Machines. 2023; 11(4):501. https://doi.org/10.3390/machines11040501

Chicago/Turabian Style

Yang, Jingwei, Xiaolong Yin, and Yuwen Sun. 2023. "PSO-Based Feedrate Optimization Algorithm for Five-Axis Machining with Constraint of Contour Error" Machines 11, no. 4: 501. https://doi.org/10.3390/machines11040501

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop