Optimization of redundant degree of freedom in robotic milling considering chatter stability

Aiming at the redundant degree of freedom problem of six-axis industrial robot performing five-axis milling task, a new optimization method of robotic milling redundant degrees of freedom considering chatter stability was proposed. Firstly, based on the zero-order approximation method, the limit cutting depth of robotic milling regenerative chatter is established as a function of redundant degrees of freedom. Then, taking the limit cutting depth of robotic milling regenerative chatter as the optimization objective, and combined with the constraints of robot motion performance (avoiding joint limit, singular posture, and collision), an optimization model of redundant degrees of freedom considering chatter stability was established. Finally, the discrete optimization search algorithm is used to solve the optimization model to determine the optimal redundant degree of freedom. The milling experimental results showed that the new optimization method of robotic milling redundant degrees of freedom considering chatter stability proposed in this paper can effectively avoid robotic milling regenerative chatter and improve machining quality and efficiency.


Introduction
With the advantages of large working space, high flexibility and low cost, industrial robots have been gradually applied in the field of milling, such as the machining of automobile inspection tools, ship hulls, and large aircraft parts [1]. However, the development of CAM systems for robot machining is far behind that for machine tool machining.
In recent years, some mainstream commercial offline programming software such as RobotStudio and KUKA-Sim have successively launched robot machining modules, which can convert the G code generated by five-axis milling modules in CAD/CAM software into robot program, realizing automatic programming of complex parts machining [2]. Series industrial robots used for milling usually have 6 degrees of freedom, while the tool tip posture information in G code only contains positions X, Y, and Z and orientations A and B. Therefore, the six-axis industrial robot performing five-axis milling tasks will lead to one redundant degree of freedom, namely the degree of freedom rotating around the axis of the tool [3]. At present, the commercial offline programming software needs to be manually set by users to complete the transformation of robot program. However, there is a lack of theoretical basis for setting and optimizing the redundant degrees of freedom.
The optimization of redundant degrees of freedom in robot machining has become an important research content in recent years. Scholars have put forward different optimization objectives, such as joint limit, flexibility, and Cartesian stiffness. Zhu et al. [4] proposed the joint limit performance index and took it as the optimization objective to make each joint axis of the robot away from the joint limit angle through the optimal selection of redundant degrees of freedom. Zargarbashi et al. [5] took Jacobian condition number as the optimization objective of flexibility, aiming to make 1 3 better use of redundant degrees of freedom to avoid robot singularity. Guo et al. [6] established a posture optimization model by using the reciprocal of compliance ellipsoid volume as stiffness performance index, and the effectiveness of the posture optimization method was verified by drilling experiments. Lin et al. [7] proposed a main body stiffness index to optimize the end position of the robot end-effector, and a deformation evaluation index to optimize the posture of robot end-effector, so as to achieve the optimal comprehensive machining performance. In order to improve the robotic milling accuracy, Chen et al. [8] took the normal stiffness as the optimization objective and the joint limit as the constraint condition to optimize the redundant degrees of freedom and feed direction. In order to improve the production efficiency of robotic milling, Xiong et al. [9] took the feed direction stiffness as the optimization objective and the joint limit and singularity as the constraints to optimize the redundant degrees of freedom of the five-axis milling industrial robot. Lu et al. [10] proposed a joint motion planning algorithm based on redundant degree of freedom optimization to realize smooth and collision free machining. Xiao and Huan [11] established a multi-objective optimization model of joint limit, flexibility and collision to determine the redundant degrees of freedom of a six-axis industrial robot in five-axis milling applications.
Aiming at the optimization of redundant degrees of freedom in robot machining, the optimization objectives proposed in the existing literature mainly focus on improving the kinematics of the robot, avoiding collision and improving the Cartesian stiffness of the robot end effector, ignoring the chatter stability of robot machining. However, some researchers [12][13][14] found through experimental research that the chatter in high-speed robotic milling is mainly regenerative chatter rather than mode coupling chatter. Chatter will not only affect the machining quality, reduce the tool life, and even damage the robot. Celikag et al. [15] also confirmed the view that regenerative chatter plays a dominant role in robotic milling from two aspects of theoretical analysis and experimental research. Mejri et al. [16] found through experimental modal analysis that the change of robot posture will cause the dynamic change of tool tip, and then affect the stability of machining process. On this basis, Mousavi et al. [17][18][19][20] studied the influence of redundant degrees of freedom on milling stability based on the robot dynamics model. The results show that the transition from unstable zone to stable zone can be realized by controlling redundant degrees of freedom without modifying cutting parameters. Therefore, it is very necessary to consider the chatter stability when setting the redundant degrees of freedom in the robot machining CAM system. However, the optimization of redundant degrees of freedom with the ultimate cutting depth of robotic milling regenerative chatter as the optimization objective has not been published.
Taking the limit cutting depth of regenerative chatter in robotic milling as the optimization objective and the motion performance of the robot as the constraint condition, this paper establishes an optimization model of redundant degrees of freedom in robotic milling considering chatter stability, which provides a theoretical basis for the setting of redundant degrees of freedom in robot machining CAM system. The feasibility and effectiveness of the model are verified by milling experiments.

Problem description of redundant degrees of freedom in robotic milling
A serial robot has redundant degrees of freedom when the operational space dimension (n) is larger than the degree of the task performed (t). The redundant degrees of freedom (r n ) is determined as follows. Figure 1a shows the process of G code conversion robot program in the robot machining module of commercial offline programming software.
First, generate G code: use CAD/CAM software for geometric modeling, tool path planning, and generate G code.
Then, reverse the Euler angle: the cutter location CL(x, y, z, i, j, k) data described in the workpiece coordinate system can be obtained from the G code, where (x, y, z) is the coordinate of the tool tip point and (i, j, k) is the unit vector of the tool axis direction. The posture of the robot tool coordinate system T relative to the workpiece coordinate system W is represented by a six-dimensional vector (x, y, z, α, β, γ), where(α, β, γ) is a Z-Y-Z Euler angle. The homogeneous transformation matrix of the tool coordinate system relative to the workpiece coordinate system is where trans and rot are translation matrix and rotation matrix, respectively. Therefore, when executing the robot program converted by G code for milling, the cutter location data and matrix  From Eq. (4), it can be seen that for a given CL(x, y, z, i, j, k), only the former five components of the six-dimensional vector (x, y, z, α, β, γ) can be determined, while the Euler angle γ is arbitrary. Therefore, when a six-axis industrial robot performs a five-axis milling task, a redundant degree of freedom will be generated, which is quantified by the Euler angle γ.
Thirdly, remove redundancy: the Euler angle γ needs to be set when solving the robot inverse kinematics, that is, the process of removing redundancy. This value should be given by the optimization process.
Finally, conversion code: the transformed robot program is processed and simulated, and the executable optimized robot program is output.

Redundant degree of freedom optimization model considering chatter stability
As shown in Fig. 1, the traditional method takes joint limit, flexibility, and Cartesian stiffness as the optimization objectives to determine the redundant degrees of freedom γ. However, the chatter stability of robotic machining has not been considered. Therefore, a new redundant degree of freedom optimization method considering chatter stability is proposed in this paper. The optimal redundant degree of freedom γ is determined by maximizing the limit cutting depth a plim (γ) of the regenerative chatter in the robotic milling to avoid the occurrence of regenerative chatter. In addition, it is necessary to avoid the joint angles of the robot from approaching the limit position, being in singular posture and collision. The redundant degree of freedom optimization model considering chatter stability was established where a plim (γ) is the regeneration chatter limit cutting depth; K(J) is the reciprocal of the conditional number of the normalized Jacobian matrix of the robot; η is a user-defined flexibility value; T is the distance between two bounding boxes; L is the detection axis; r a and r b are the projections of radius of bounding boxes A and B on the detection axis; θ i is the joint angle of the robot; f −1 () represents inverse kinematics; and θ min and θ max are joint limit.

Dynamic model of robotic milling system
As shown in Fig. 2, the dynamic model of the robotic milling system can be simplified into a 2-DOF vibration system in the x-axis and y-axis directions. For a given configuration p 0 in Cartesian space, the dynamic model of the tool tip can be expressed by Eq. (6):  where M x , M y , K x , K y , C x , C y are the modal mass, modal stiffness, and modal damping of the system along the two directions(x, y), respectively; (t) is vibration displacement of tool point; F(t) is the cutting force.

Regenerative chatter dynamic model
According to the milling theory proposed in [21], the dynamic cutting force in the milling process is where K c is the cutting force coefficient; τ is the delay time between two cutter teeth; a p is the cutting depth; δ is the vibration displacement of the tool tip; D(t) is time-varying directional dynamic milling force coefficient. D(t) can be extended into a Fourier series, which is approximately expressed as its average component D 0 .
where N is the number of tool teeth. Time-varying directional dynamic milling force coefficient is where is the tool's rotational angle; r is the ratio of radial and tangential cutting force coefficients; st is the entry angle; ex is the exit angle. Substitute the harmonic solution (t) ∶ (t) = Δe i t into Eq. (7)

The limit cutting depth of the regenerative chatter
The frequency response function of the tool tip is By substituting the frequency response function into Eq. (10), If the determinant below is zero, then Eq. (12) has a nontrivial solution.
Since the frequency response function is complex, the characteristic Eq. (13) has real and imaginary parts, and the eigenvalue at chatter frequency is given by It can be obtained by solving Eq. (14).
where the imaginary part of a p must be equal to zero because a p is a real number.
The real part of a p gives the limit cutting depth (a plim ) in chatter frequency (ω c ), which separates the stable and instable zone. If κ is defined as Therefore, limit cutting depth of the regenerative chatter (a plim ) can be written as

The influence of redundant degree of freedom γ on the limit cutting depth a plim (γ)
As shown in Fig. 3, it is a block diagram of the regenerative chatter in the robotic milling. It can be seen from the figure that the change of the robot's posture will cause the dynamic changes of the tool tip point, which will affect the stability of the processing. Therefore, for each robot posture with the same cutting parameters, the limit cutting depth a plim (γ) is determined according to Eq. (18), a plim (γ) is a function of the redundant degree of freedom γ.

The robotic flexibility index
The condition number of the normalized Jacobian matrix of the robot is used to measure the closeness of the robot to the singularity [22], which is expressed as where J is the Jacobian matrix, C(J) ∈ [1, +∞).
The robotic flexibility index is expressed as inner modulation:δ(t) inverse kinematics-Joint angle θ j forward kinematics-posture p i 1 3 The closer the K(J) value is to 1, the better the flexibility. The K(J) value is close to 0, indicating that the joint angle of the robot at this time is close to the singularity position. η is a userdefined flexibility value. Theoretically, η is a number greater than 0 and less than 1. In this paper, the value of η is set to 0.1.

Robot collision free condition
The OBB bounding box intersection detection is used to determine whether there is a collision between the detected robot link and the detected object [23]. To test whether the bounding boxes intersect, it is necessary to project the center and radius of the bounding boxes onto the detection axis L. If the distance between the centers of the bounding boxes on the axis is greater than the sum of the radius, the bounding boxes are separated. T is the distance between two bounding boxes, L is the detection axis which is one of the 15 separation axes, a i and b i are half the side lengths of bounding boxes A and B, respectively, and A i and B i as the side direction vectors of bounding boxes A and B, r a and r b are the projections of radius of bounding boxes A and B on the detection axis, as shown in Fig. 4.
The detection axis and the projections of the radius of the bounding box on the detection axis are respectively The projection distance between the center points of the boxes is |T·L|, so the condition that the bounding boxes do not intersect is if and only if

Algorithm for solving redundant degree of freedom optimization model
After obtaining the parameters of the redundant degree of freedom optimization model, the discrete optimization search algorithm is used to solve the optimization model to determine the optimal redundant degree of freedom γ.
The algorithm flowchart is shown in Fig. 5. Firstly, the redundant degree of freedom interval of the robot is selected as 5°, and the limit cutting depth a plim (γ) corresponding to γ is determined according to Sect. 4.1.4. Then, all Euler angles γ are traversed. Finally, the maximum limit cutting depth a plimmax (γ) and its corresponding optimal redundant degree of freedom are output. Inc., USA), and an acceleration sensor (Model: 356A24, PCB Inc., USA) were used for data collection from the milling system.

Construction of simulation platform RobotYY
RobotYY is an offline programming simulation software for six-axis industrial robotic milling developed by the author on python, QT, and OpenGL platforms. It mainly has modules such as offline programming, postprocessing, machining simulation, and collision detection. The software interface is shown in Fig. 7.
The postprocessor interface is shown in Fig. 8. G code (NC format) is converted into robot program through postprocessing algorithms such as motion instruction conversion, coordinate calculation, and posture calculation. In addition, the postprocessing module can also predict FRF of other estimated posture according to the imported FRF (TXT format) of measured posture.
As shown in Fig. 9, the machining simulation module can perform real-time milling processing simulation based on the robot program generated by the post-processing module, which can more intuitively check whether the robot program is correct.
The collision detection module can avoid the situation that a collision is not found in the machining simulation due to the viewing angle limitation, while a collision occurs in the actual machining. As shown in Fig. 10, when there is no collision, the bounding box is green. When the collision occurs, that is, when the bounding boxes intersect, the bounding box will change from green to red.

Prediction of frequency response function
In recent years, two methods have been used to predict the frequency response function of the tool tip of the robot: (1) data modeling based on experiment [24][25][26]; (2) theoretical modeling based on finite element method [19].
Due to the complexity of the robot structure, material properties, transmission system layout, etc., it is difficult to establish an accurate and reliable theoretical model to describe the dynamic characteristics of the robot tool tip. In practical applications, the modal hammering experiment is usually used to obtain the frequency response function of the robot tool tip, and the experimental results are more reliable. Note that there are an infinite number of robot postures in the robot workspace. It is very time-consuming to obtain the frequency response function of the tool tip point in each robot posture through experiments. Therefore, this paper uses the frequency response function of the measured postures to accurately and efficiently predict the frequency response function of other estimated postures, based on the inverse distance weighting method. This method is simple and efficient, and has good interpolation effect for uniformly distributed sample points [26]. Firstly, establish the set of frequency response functions of measured postures. The influence of rotating axis 1 on the FRF of the tool tip is negligible, so the angle of axis 1 in all measured tool position is 0°. In the base coordinate system, the tool positions are equally spaced at 100 mm intervals on the XZ plane, as shown in Fig. 11. The same tool position corresponds to 5 redundant postures, as shown in Fig. 12, a total of 100 test postures.
Then, determine the number of samples m. Since the influence of the measured posture FRF on the estimated posture decreases with the increase of distance d i , the measured posture is sorted according to distance d i , and the frequency response function of the nearest m measured postures is selected to predict the frequency response function of the estimated posture. In this paper, m is determined as 10.
where d i is the Euclidean distance between the estimated posture(q j ) and the measured posture(q i ) in the joint space.
After that, the weight λ i of each test point is calculated. The weight λ i is a function of the reciprocal of the distance, and satisfies the following relationship: Finally, predict the frequency response function. The frequency response function H j (ω) of any estimated posture in the robot workspace can be predicted based on the frequency response function H i (ω) of the m measured postures, which is determined by In this paper, only the first dominant mode of the tool tip point of the robot is considered, and the contribution of other additional modes is ignored, because the dominant mode has the greatest contribution to the tool point vibration in the robotic milling process. As shown in Fig. 13, it is the frequency response function curve of the tool position (400 mm, 0 mm, 100 mm) corresponding to the posture 1. The peak picking method is used to identify the modal parameters. Table 1 shows the comparison between the predicted parameter and identified parameter of any three postures. It is concluded from Table 1 that the relative error of most of the data is less than 20%, which proves that the inverse distance weighting method can meet the prediction accuracy of the frequency response function. In addition, it can be seen from Fig. 14 that the predicted FRF matches well with the experimental FRF. As shown in Fig. 15, the comparison between the stability lobe diagram drawn according to the predicted frequency response function and the stability lobe diagram according to the experimental frequency response function can better verify that the results

Stability circle diagram
In order to study the influence of the redundant degree of freedom on the stability of the robotic milling, the position of the tool tip point (445.2, 369.9, 102.4) remains unchanged, and the redundant degree of freedom γ is changed, that is, it rotates around the z-axis of the tool coordinate system. At each change of 5°, the frequency response function of tool point was predicted, and a total of 38 groups of frequency response curves were predicted. The peak picking method was used to identify modal parameters, drawing the stability lobe diagram, as shown in Fig. 16a. The cutting force coefficient K C is selected as K C = 750 N/mm 2 according to the Schmitz and Smith [27].
In Fig. 16a, the limit cutting depth of the same spindle speed (12,000 RPM as an example) and its corresponding redundant degrees of freedom were taken to draw the stability circle diagram a plim (γ), as shown in Fig. 17a. The radius of the circle represents the limit cutting depth, and the radian of the circle represents the redundant degree of freedom. The discrete optimization search algorithm in Sect. 4.4 is used to solve the redundant degree of freedom optimization model Eq. (5) to determine the optimal redundant degree of  freedom γ opt = 115°, and the maximum limit cutting depth a plimmax = 1.345 mm.
In order to explore the applicability of the above redundancy optimization method to different tool tip positions, the position of the tool tip point was changed and the redundant degree of freedom optimization process was carried out again, as shown in Fig. 17b. The optimal redundant degree of freedom γ opt = 50°, and the maximum limit cutting depth a plimmax = 1.373 mm corresponding to the tool tip position (525.0, 0.7, 104.6) was determined.

Experimental verification
In order to verify the influence of redundant degrees of freedom on the milling stability of the robot, the full slot milling experiment of 6061-T6 aluminum alloy is carried out  Table 2. The sampling frequency of vibration signal is set to 6400 Hz. Figure 19 presents the acceleration signal measured during robotic milling. In Fig. 19a, it can be observed that the  acceleration signal variations grow suddenly at 1.8 s with γ = 0°, which means instability in the machining operation (chatter). However, the acceleration signal changes steadily with γ opt = 115°, which means that the machining is stable.
The two experiments show that the machining stability can be changed by changing the redundant degree of freedom of the robot under the condition of constant cutting parameters. Similarly, in Fig. 19b, according to the time-domain waveform of vibration, it can be found that the machining is unstable with γ = 120°, while the machining is stable with γ opt = 50°. These two experiments verify that the redundancy optimization method can be applied to different tool tip positions. Figure 20 shows the acceleration signal spectrum at different tool tip positions and different redundant degrees of freedom, and the frequencies 201 Hz and 402 Hz are the rotating frequency and cutter tooth passing frequency, respectively. It is noteworthy that, in addition to the rotating frequency and cutter tooth passing frequency, there is also a competitive peak of 341 Hz near the cutter tooth passing frequency of 402 Hz in the acceleration signal spectrum with γ = 0°. Even if the amplitude of the competitive peak is less than that of the cutter tooth passing frequency, it can be interpreted as the regenerative chatter frequency, because the frequency is not the cutter tooth passing frequency or its harmonic. Moreover, the chatter frequency is also observed in the acceleration signal spectrum with γ = 120°. The experimental results are consistent with the predicted results, as shown in Table 2.
Another indicator to measure the stability of robotic milling is the surface quality of the machining parts. When chatter occurs, obvious chatter marks will be left on the surface of parts. The surface roughness of machining parts was measured by OLYMPUS-OLS4100 3D measuring laser microscope (minimum resolution 0.12 μm). As shown in Fig. 21a, the surface quality of the optimal redundant degree of freedom of 115° (Ra = 2.5 μm) is significantly better than that of the redundant degree of freedom of 0° (Ra = 9.2 μm), which also shows that the stability of the optimal redundant degree of freedom 115° is significantly better than that of the redundant degree of freedom 0°. In Fig. 21b, it can observe similar results that the stability of the optimal redundant degree of freedom 50° is significantly better than that of the redundant degree of freedom 120°.   A new optimization method of redundant degrees of freedom in robotic milling considering chatter stability is proposed. Taking the limit cutting depth of robotic milling regenerative chatter as the optimization objective, and combined with the constraints of robot motion performance, an optimization model of redundant degrees of freedom considering chatter stability was established to determine the optimal redundant degrees of freedom when a six-axis industrial robot performs a five-axis milling task. 2. Experimental results show that the optimal redundant degree of freedom determined by this method significantly improves the chatter stability of highspeed robotic milling, avoids regenerative chatter, and improves machining quality and efficiency. In addition, experiments also verify that this method can be applied to different tool tip positions of machining trajectory, which provides a theoretical basis for the setting of redundant degrees of freedom in robotic machining CAM system.