Five-axis g-code defect tool position recognition and correction method

By fitting the Fourier series and Hilbert-Huang transform of the five-axis G code interpolation instructions, the defective tool position points are identified and corrected, solving the problems of misjudgment and insufficient automation processing in the existing technology and achieving a more efficient and precise machining process.

CN119882613BActive Publication Date: 2025-10-21XI AN JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510066851.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-10-21
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

The existing technology has problems of misjudgment and inability to automatically process when identifying and correcting defective tool positions in five-axis G code, which affects machining accuracy and efficiency.

Method used

By performing Fourier series fitting and Hilbert-Huang transform on the interpolation instructions, the defective tool locations are identified, and feature analysis and correction are performed according to the defect type, including specific judgment and correction methods for linear axes and rotary axes.

Benefits of technology

The recognition accuracy of defective tool positions is improved, the stability and surface quality of the machining process are improved, and the machining speed and efficiency are increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882613B_ABST
    Figure CN119882613B_ABST
Patent Text Reader

Abstract

A five-axis numerical control machining G code defect tool position recognition and correction method, first, the G code is obtained by numerical control system interpolation interpolation instruction, the non-stable part in the interpolation instruction is extracted by using the Fourier series fitting method, then the interpolation instruction non-stable part is Hilbert-Huang transform, finally, the method of box chart is used to identify the straight line axis defect tool position and the rotating axis defect tool position; through the analysis of the characteristics of the defect tool position, the straight line axis defect is classified as dense defect point and uneven distribution of tool position defect tool position, the rotating axis defect is classified as multiple solution selection error tool position, singular tool position and tool axis vector mutation defect tool position; finally, the characteristics of each type of defect tool position are analyzed, and the corresponding correction method is determined; the present application can accurately identify the defect tool position in the G code, realize the intelligent diagnosis and optimization of the defect coordinate position of the G code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of numerically controlled machine tools, and in particular relates to a method for identifying and correcting defective tool position points of a five-axis G code. Background Art

[0002] The five-axis CNC machining process includes CAD modeling, CAM processing, CNC interpolation, and servo control. The primary function of the CAM processing phase is to convert the CAD-generated geometric model into G-code, which can direct machine tool processing. G-code is the source of CNC machining data, but due to algorithmic flaws in CAM post-processors, many different types of defective tool locations can be found in G-code, impacting the quality of downstream data flows and affecting the accuracy and efficiency of part machining.

[0003] Currently, the methods for identifying defective tool locations are divided into two categories: visualization software and feature parameter identification. Siemens AWMT software (SIEMENS SINUMERIK Analyze My Workpiece / Toolpath Operating Manual) analyzes the distribution of tool locations and the actual processing data of the machine tool to study the causes of surface defects and correct defective tool locations. However, this visualization software requires manual identification and correction of defective points. Its actual application relies on the experience of engineers and is not suitable for automated production. The feature parameter method (Song Yanhong. A coarse and fine step-by-step screening method for defective coordinates in G code for three-axis CNC machining: China, 202110758550.X[P].2021-10-08.) identifies defective tool locations in linear axes by setting parameter thresholds and judging the continuity of segmented processing trajectories, while ignoring the presence of defective tool locations in rotary axes. At the same time, these identification methods mainly focus on identifying defects at the G-code level, ignoring the CNC system's correction of G-code defective tool locations, and are prone to misjudging defective tool locations. The correction method for defective tool location points (Huang J, Du X, Zhu LM. Real-time local smoothing for five-axis linear toolpath considering smoothing error constraints [J]. International Journal of Machine Tools and Manufacture, 2018, 124: 67-79.) mainly uses spline curves to plan the motion of the linear axis and the rotary axis respectively, forms a smoothing algorithm and integrates the CNC system. However, the smoothing algorithm can optimize the interpolation trajectory but cannot optimize the tool location point itself. Summary of the Invention

[0004] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a five-axis G-code defective tool location point identification and correction method, which identifies the defective tool location point by analyzing the interpolation instructions, determines the defect type according to the characteristics of different types of defective tool location points, and proposes a corresponding correction method to realize intelligent diagnosis and analysis of the G-code defect coordinate position.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A five-axis G code defective tool position point identification and correction method includes the following steps:

[0007] 1) Interpolation instruction collection;

[0008] 2) Identification of defective tool locations;

[0009] 3) Determination and correction of defective tool position type.

[0010] Step 1) specifically involves inputting the G-code into the CNC system and using the system's built-in data acquisition function to collect the generated interpolation instructions according to the CNC system's interpolation cycle. Six columns of data are collected, of which the first three columns contain linear axis interpolation instructions, the fourth and fifth columns contain rotary axis interpolation instructions, and the sixth column contains the G-code line number.

[0011] The step 2) is specifically as follows:

[0012] 2.1) Extracting the unstable part of the interpolation instruction: Assume that the G code of a test piece is interpolated by the CNC system and the interpolation instruction in the machine tool coordinate system is recorded as p(t). Its n-order Fourier series fitting and the unstable part of the interpolation instruction can be expressed as:

[0013]

[0014] Where F(t) is the sum of multiple sine and cosine signals and a DC component, a0 is a constant term, and a m and b m is the expansion coefficient of the mth harmonic of the Fourier series, w is the fundamental frequency, t is the time, R(t) is the unstable part of the interpolation instruction, and p(t) is the interpolation instruction;

[0015] 2.2) Hilbert-Huang transform of the unstable part of interpolation instruction: decompose the unstable part of interpolation instruction R(t) into n r Components, that is

[0016]

[0017] For the component h i Hilbert transform of (t) The analytical signal is defined as:

[0018]

[0019] Construct the component h i The analytical function of (t) is defined as:

[0020]

[0021] Where, h i (t) is the decomposed component, r(t) is the remainder, is the component h i The analytical signal of (t), z i (t) is the analytical function of the i-th component; A i (t) is the instantaneous amplitude function; Φx(t) is the instantaneous phase function;

[0022] Frequency is the rate of change of phase with time, so the instantaneous frequency of the i-th component is:

[0023]

[0024] Further obtain the Hilbert spectrum H(w,t):

[0025]

[0026] Where, ω i (t) is the frequency function, H(w,t) represents the Hilbert spectrum, and Re represents the real part;

[0027] 2.3) Determine the defective tool location: Analyze the amplitude of the Hilbert transform of each axis using the box plot method, output the axis and G code line number corresponding to the abnormal amplitude, and record it as: N X ,N Y ,N Z ,N A ,N C ; Take the common row number N of the linear axis l , the common row number of the rotation axis is N r , where N l =N X ∩N Y ∩N Z , N r =N A ∩N C and number the row as N l The G code tool position is recorded as the linear axis defect tool position, and the line number is N r The G code tool position point is recorded as the rotation axis defect tool position point.

[0028] The step 3) specifically involves determining and correcting the defective tool location type based on the characteristics of the defective tool location:

[0029] 3.1) Determination and correction method of the type of defective tool point of the linear axis: The coordinate data of the X-axis, Y-axis, and Z-axis are separated and extracted from the G-code file and connected into a trajectory. First, the length of the adjacent tool point segments is calculated according to formula (8), and the MAD method is used to identify the abnormal value of the segment length. Then, it is determined whether it is a continuous tool point on the G-code tool path trajectory. If it is not a continuous point on the G-code tool path trajectory, it is determined to be a dense defect point. If it is a continuous point on the G-code tool path trajectory, the difference in the length of the adjacent tool point segments is calculated according to formula (9), and the abnormal value is identified by the MAD method. The tool point where the abnormal value is located is determined as a defect point with uneven tool point distribution.

[0030]

[0031] di=d n+1 -d n (9)

[0032] Where x n ,y n ,z n Represents the coordinate data of the X-axis, Y-axis, and Z-axis respectively, d n Represents the length of the line segment, and di represents the difference in length of the line segment;

[0033] The correction method is as follows: dense defects are corrected by directly deleting the defective tool points, and uneven tool point distribution is corrected by reconstructing the tool points at the defective position so that the tool point density at the defective position is small and uniform;

[0034] 3.2) Determination and correction method of defective tool location point type of rotary axis:

[0035] 3.2.1) Method for determining and correcting incorrect tool position points in multiple solutions:

[0036] The determination method is as follows: the tool axis vector is calculated by the screw theory, as shown in formula (10), and the rotation axis coordinates are inversely calculated according to the screw theory, as shown in formulas (11) and (12); when the C-axis coordinate value of the defective tool position is When , use formula (13) to determine whether the defective tool location is a multi-solution selection error tool location; when the C-axis coordinate value of the defective tool location Formula (14) is used to determine whether the defective tool location is a wrong tool location selected by multiple solutions;

[0037]

[0038] Where, (O x ,O y ,O z ) is the tool axis vector, The A-axis rotation angle value obtained by inverse transformation of the tool axis vector is is the C-axis rotation angle value obtained by inverse transformation of the tool axis vector. They are the A-axis and C-axis coordinate values ​​of the abnormal feed tool position of the rotary axis respectively; The A-axis coordinate value of the point before the abnormal feed position of the rotary axis. The C-axis coordinate value of the point before the abnormal feed position of the rotary axis;

[0039] The correction method is: when the C-axis coordinate value of the defective tool position When the C-axis coordinate value of the defective tool position is Formula (16) is used to correct the multiple solutions that select the wrong tool location.

[0040]

[0041] Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values;

[0042] 3.2.2) Determination and correction method of singular knife point:

[0043] The judgment method is as follows: analyze the tool axis vector calculation from the differential angle, as shown in formula (17); when the A-axis rotation angle is 0°, the movement of the C-axis will not cause the tool axis direction to change. At this time, the tool axis is in a singular state, as shown in formula (18); calculate the expression of the tool axis vector at this time according to formula (19) to determine whether it is a singular tool position point;

[0044]

[0045] Where θ A ,θ C is the angle between the A axis and the C axis, dO x ,dO y ,dO z is the differential representation of the X, Y, and Z tool axis vectors, dθ A ,dθ C To differentiate the angle value, J(θ A ,θ C ) is the simplified Jacobian matrix;

[0046] The correction method is as follows: extract the coordinate information of the singular tool position point and calculate the theoretical feed time between adjacent tool positions, as shown in formula (20); calculate the C-axis feed amount of adjacent rows and reconstruct the C-axis coordinate of the singular tool position point, as shown in formula (21);

[0047]

[0048] Where, t k is the theoretical feed time between adjacent tool positions, Fk The preset feed rate for the kth tool position, Δs k is the extension line displacement between the kth tool position point and the previous point, is the correct C-axis feed between the kth tool position and the previous point, is the C-axis coordinate value of the corrected singular tool position point, is the C-axis coordinate value of the singular tool position before correction;

[0049] 3.2.3) Determination and correction method of tool position of tool axis vector mutation defect:

[0050] The determination method is as follows: calculate the tool axis vector at the defective tool position by formula (10), calculate the angle between adjacent tool axis vectors by formula (22), use the MAD method to identify the abnormal value of the tool axis vector angle, and determine the tool position corresponding to the abnormal value as the tool axis vector mutation defect tool position;

[0051] The correction method is: fit the sudden change position trajectory of the tool axis vector, and calculate the angular acceleration of the rotation axis of the fitted trajectory by formula (23) and formula (24), bring the rotation angular acceleration of the fitted trajectory into the objective function of formula (25), and judge whether it satisfies the objective function. If it satisfies the objective function, it is determined as the reconstructed tool axis vector.

[0052]

[0053] Where, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, F is the tool axis vector angle between adjacent tool positions, Feed rate at is the length of the line segment between adjacent tool positions, A and C axis rotation angles respectively, and The tool position Move to the knife position The rotational angular velocity of the A and C axes of the machine tool, and The tool position Move to the knife position The rotational angular acceleration of the A and C axes of the machine tool; E(O x ,O y ,O z ) represents the tool axis vector objective function.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] By analyzing interpolation instructions, the present invention addresses the problem of prior art misidentifying defective tool locations in G-codes as defective, potentially correctable tool locations. This approach offers the advantage of accurately identifying defective tool locations that impact the actual surface quality and accuracy of machining. The present invention determines the type of defective tool locations identified, categorizing them into two types: linear axis defective tool locations and three types: rotary axis defective tool locations. The present invention then analyzes the characteristics of each defective tool location type and identifies a corresponding correction method. This correction method improves the smoothness of speed and acceleration during machining, enhancing workpiece surface quality and the smoothness of the machining process. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is the Hilbert transform of the unstable part of the interpolation instruction in Example 1.

[0057] Figure 2 This is the position of the defective tool point in Example 1.

[0058] Figure 3 Comparison of the rotating shaft speed before and after correction of Example 1.

[0059] Figure 4 This is the Hilbert transform comparison before and after the correction of Example 1.

[0060] Figure 5 Comparison of tool feed speed before and after correction in Example 1.

[0061] Figure 6 Comparison of tool feed acceleration before and after correction in Example 1.

[0062] Figure 7 Comparison of line segment lengths before and after correction in Example 2.

[0063] Figure 8 Comparison of interpolation instruction speed before and after correction of Example 2.

[0064] Figure 9 Comparison of feed speed before and after correction of Example 2.

[0065] Figure 10 Comparison of tool axis vector change values ​​before and after correction in Example 3.

[0066] Figure 11 Comparison of feed speed before and after correction of Example 3.

[0067] Figure 12 Comparison of interpolation instruction speed before and after correction of Example 3. DETAILED DESCRIPTION

[0068] The present invention is described in detail below with reference to the embodiments and accompanying drawings.

[0069] Example 1, taking the S specimen as an example, a method for identifying and correcting defective tool location points in a five-axis CNC machining G code comprises the following steps:

[0070] 1) Interpolation instruction acquisition: Specifically, the G code of the S-shaped specimen is input into the CNC system, and the data acquisition function of the CNC system is used to acquire the generated interpolation instructions according to the interpolation cycle of the CNC system. Six columns of data are acquired through acquisition, of which the first three columns are linear axis interpolation instructions, the fourth and fifth columns are rotary axis interpolation instructions, and the sixth column is the G code line number.

[0071] 2) Identification of defective tool locations; specifically:

[0072] 2.1) Extracting the unstable part of the interpolation instruction: Assume that the G code of the S-shaped specimen is interpolated by the CNC system and the interpolation instruction in the machine tool coordinate system is recorded as p(t). Its n-order Fourier series fitting and the unstable part of the interpolation instruction can be expressed as:

[0073]

[0074] Where F(t) is the sum of multiple sine and cosine signals and a DC component, a0 is a constant term, and a m and b m is the expansion coefficient of the mth harmonic of the Fourier series, w is the fundamental frequency, t is the time, R(t) is the unstable part of the interpolation instruction, and p(t) is the interpolation instruction.

[0075] 2.2) Hilbert-Huang transform of the unstable part of interpolation instruction: decompose the unstable part of interpolation instruction R(t) into n r Components, that is

[0076]

[0077] For the component h i Hilbert transform of (t) The analytical signal is defined as:

[0078]

[0079] Construct the component h i The analytical function of (t) is defined as:

[0080]

[0081]

[0082] Where, h i (t) is the decomposed component, r(t) is the remainder, is the component h iThe analytical signal of (t), z i (t) is the analytical function of the i-th component; A i (t) is the instantaneous amplitude function; Φ i (t) is the instantaneous phase function.

[0083] Frequency is the rate of change of phase with time, so the instantaneous frequency of the i-th component is:

[0084]

[0085] Further obtain the Hilbert spectrum H(w,t):

[0086]

[0087] Where, ω i (t) is the frequency function, H(w,t) represents the Hilbert spectrum, and Re represents the real part.

[0088] 2.3) Determine the defective tool location: Analyze the amplitude of the Hilbert transform of each axis using the box plot method, output the axis and G code line number corresponding to the abnormal amplitude, and record it as: N X ,N Y ,N Z ,N A ,N C ; Take the common row number N of the linear axis l , the common row number of the rotation axis is N r , where N l =N X ∩N Y ∩N Z , N r =N A ∩N C and number the row as N l The G code tool position is recorded as the linear axis defect tool position, and the line number is N r The G code tool position point is recorded as the rotation axis defect tool position point.

[0089] For the S-shaped specimen in the embodiment, after analysis, the tool locations of rows 137, 138, 348, and 358 are defined as defective tool locations of the rotating axis. The defective tool location information is shown in Table 1 below. The Hilbert spectrum of the S-shaped specimen is as follows: Figure 1 As shown, it can be seen that at the defective tool point, the Hilbert spectrum amplitude has obvious anomalies.

[0090] 3) Determining and correcting the defective tool location type: Specifically, the defective tool location type is determined and corrected based on its characteristics. Since this embodiment only identified defective tool locations on the rotary axis in step 2), the determination and correction of the defective tool location type on the rotary axis is performed directly in step 3).

[0091] Table 1. Results of G code defect tool position recognition for S-shaped specimens

[0092]

[0093] 3.2) Determination and correction method of defective tool location point type of rotary axis:

[0094] 3.2.1) Method for determining and correcting incorrect tool position points in multiple solutions:

[0095] The maximum stroke of the A axis of the dual-turret five-axis machine tool is [-π,π], and the maximum stroke of the C axis is [0,2π]. The kinematic model of the dual-turret five-axis machine tool is established based on the screw theory, and the conversion formula between the machine tool coordinate system and the workpiece coordinate system is obtained. The tool axis vector is calculated as shown in formula (8). The coordinates of the rotary axis are inversely calculated based on the screw theory, as shown in formulas (9) and (10). When the C axis coordinate value of the tool position point of the rotary axis is abnormally fed When the abnormal tool position is , use formula (11) to determine whether the abnormal tool position is the wrong tool position selected by multiple solutions; when the C-axis coordinate value of the abnormal feed tool position of the rotary axis is Formula (12) is used to determine whether the abnormal feed tool position of the rotary axis is an incorrect tool position selected by multiple solutions.

[0096]

[0097]

[0098] Where, (O x ,O y ,O z ) is the tool axis vector, These are the two A-axis rotation angle values ​​obtained by inverse transformation of the tool axis vector. These are the two C-axis rotation angle values ​​obtained by inverse transformation of the tool axis vector. They are the A-axis and C-axis coordinate values ​​of the abnormal feed tool position of the rotary axis respectively; The A-axis coordinate value of the point before the abnormal feed position of the rotary axis. It is the C-axis coordinate value of the point before the abnormal feed position of the rotary axis.

[0099] After determination, there are two multiple-solution selected incorrect tool locations in the Example S specimen. The information of the multiple-solution selected incorrect tool locations is shown in Table 2 below.

[0100] Table 2 Defect G codes of incorrect tool position selection in multiple solutions of S-shaped specimen

[0101]

[0102] The correction method is: when the C-axis coordinate value of the defective tool position When the C-axis coordinate value of the defective tool position is Formula (14) is used to correct the multiple solutions that select the wrong tool location.

[0103]

[0104] Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values.

[0105] In the discretized machining trajectory of the Example S specimen, each tool position point corresponds to two sets of rotation axis coordinate solutions, among which the correct solution is the solution closest to the rotation axis coordinate value of the adjacent tool position point; according to the judgment method of selecting the wrong tool position point from multiple solutions, the A-axis coordinate is inverted and the C-axis coordinate jump is 180°. The corrected G code is shown in Table 3 below.

[0106] Table 3 G code after correction of incorrect tool position points selected by multiple solutions for S-shaped specimen

[0107]

[0108] 3.2.2) Determination and correction method of singular knife point:

[0109] The singular point of the dual-turret five-axis machine tool is mainly reflected in the rotation axis. It can be obtained from the kinematic model of the machine tool that the tool axis vector at the singular point of the dual-turret five-axis machine tool is (0,0,1). When the tool axis vector is in a singular position, the inverse kinematic transformation equation of the machine tool has countless solutions. When solving the angle inversely from the tool axis vector, for the tool axis vector in a singular position, there are infinitely many groups of solutions corresponding to the two rotation axes. Therefore, an extremely small swing of the tool axis vector will cause a large rotation of the two rotation axes. The calculation formula of the tool axis vector is analyzed by differential angle, as shown in formula (15), and the Jacobian matrix is ​​simplified. When the A-axis angle is 0°, as shown in formula (16), when the C-axis angle changes, the change of the tool axis vector under the differential angle is 0. At this time, the movement of the C-axis will not cause the direction of the tool axis to change, and the tool axis is in a singular state. At this time, the tool axis vector (O x ,O y ,O z )=(0,0,1); Therefore, the expression of the tool axis vector at this time can be calculated according to formula (17) to determine whether it is a singular tool position point;

[0110]

[0111] Where θ A ,θ C is the angle between the A axis and the C axis, dO x ,dO y ,dOz is the differential representation of the X, Y, and Z tool axis vectors, dθ A ,dθ C To differentiate the angle value, J(θ A ,θ C ) is the simplified Jacobian matrix.

[0112] The position of the singular tool point of the test piece of Example S is as follows: Figure 2 The figure shows the locations of the incorrect tool locations in the tool path for the multiple solution selection errors. The tool location corresponding to G code line 348 is a singular tool location. The G code coordinate values ​​indicate that the tool locations corresponding to lines 344-347 are in the singular region. The A-axis and C-axis feed rates are 0. In this machining section, the logical position of the C-axis changes from 26.567 degrees to 14.032 degrees. The information for the singular tool location is shown in Table 4.

[0113] Table 4 Defect G codes of the singular tool position of the S-shaped specimen

[0114]

[0115] At the singular tool position, the rotation speed of the rotary axis will exceed the upper limit of the servo drive system, and the tool feed speed will also be in an unstable state. Therefore, for the correction of the singular point, on the one hand, the rotation speed of the rotary axis should be controlled within the range of the servo drive capability, and on the other hand, the stability of the tool feed should be guaranteed as much as possible, and the instantaneous acceleration of the tool should be controlled; according to the identification conditions of the singular tool position, it can be known that in the tool position file, several tool positions before the singular tool position are singular points; according to the differential motion formula of the tool axis vector, it can be known that at the singular point, the tool axis direction is not affected by the C-axis coordinates. Therefore, according to the C-axis of the singular area, The total feed amount and the C-axis coordinate value of the singular point are reconstructed. This can improve the abnormal feeding of the rotary axis without changing the direction of the tool axis. The G code of the singular area of ​​the S specimen is corrected. First, the extension line displacement is calculated. Then, the theoretical feed time between adjacent tool positions is calculated, as shown in formula (18). Since the correction goal is to make the C-axis feed speed change small, that is, the C-axis feeds at a constant speed under ideal conditions, the C-axis is assumed to rotate at a constant speed. The total feed amount of the C-axis of the n+1 row is calculated, as shown in formula (19). The C-axis coordinates of the singular tool position are reconstructed. The corrected G code coordinate information is shown in Table 5.

[0116]

[0117] Where, t k is the theoretical feed time between adjacent tool positions, F k The preset feed rate for the kth tool position, Δs k is the extension line displacement between the kth tool position point and the previous point, is the correct C-axis feed between the kth tool position and the previous point, is the C-axis coordinate value of the corrected singular tool position point, is the C-axis coordinate value of the singular tool position before correction.

[0118] Table 5 G code after correction of singular tool position of S-shaped specimen

[0119]

[0120] 3.2.3) Determination and correction method of tool position of tool axis vector mutation defect:

[0121] The tool axis vector at the defect position is calculated by formula (8), and the angle between adjacent tool axis vectors is calculated by formula (20). The MAD method is used to identify the abnormal value of the tool axis vector angle, and the tool position without tool axis vector mutation defect is determined by screening.

[0122]

[0123] Where, O i represents the tool axis vector, is the included angle of tool axis vectors between adjacent tool positions.

[0124] For the S specimen in Example 1, there were 15,883 interpolation instructions before correction and 13,688 interpolation instructions after correction. The acquisition cycle of the machine tool interpolation instructions was 2ms. Based on the number of interpolation instruction lines and the interpolation cycle, the processing time before and after correction was calculated. After correction, the processing efficiency was improved by 13.8%. Figure 3 It can be seen that in this embodiment, at the defective tool position, the rotation speed of the rotating shaft increases sharply before correction, and the maximum speed reaches the limit speed. After correction, the fluctuation of the rotation speed of the rotating shaft at the defective tool position decreases, the rotation speed of the rotating shaft no longer approaches the limit speed, and the speed curve becomes smoother. Figure 4 It can be seen that after the correction of this embodiment, the abnormal amplitude of the Hilbert transform of each logical axis at the defective tool position is reduced, and the frequency component of the interpolation instruction is more concentrated in the low-frequency part; Figure 5 It can be seen that before the correction of this embodiment, the tool feed was limited by the rotation axis speed limit, and was greatly decelerated, and in some positions it was decelerated to 0. After the correction, the feed speed was freed from the limit of the rotation axis speed limit, and the tool feed speed was significantly improved; Figure 6 It can be seen that after correction in this embodiment, the feed acceleration at the defective tool position is greatly reduced, and the tool feed is more stable.

[0125] Table 6 Processing time of S-shaped specimens before and after correction

[0126]

[0127] Example 2, taking a certain wheel hub as an example, compared with Example 1, a five-axis G code defective tool position point identification and correction method has the following differences: Step 2) By using a box plot to screen the abnormal values ​​of the Hilbert transform amplitude of the unstable part of the interpolation instruction in the machine tool coordinate system, it is identified that there are 23 linear axis defective tool positions in a certain wheel hub part of Example 2; Step 3) Specifically, according to the characteristics of the defective tool position points, the type of the defective tool position points is determined and corrected: 3.1) Method for determining and correcting the type of defective tool position points of the linear axis: Separate and extract the coordinate data of the X-axis, Y-axis, and Z-axis from the G code file and connect them into a trajectory. First, the length of the adjacent tool position line segments is calculated by formula (21), and the MAD method is used to identify abnormal values ​​of the line segment length. Then, it is determined whether it is a continuous tool position on the G code tool path trajectory. If it is not a continuous point on the G code tool path trajectory, it is determined to be a dense defect point. If it is a continuous point on the G code tool path trajectory, the difference in the length of the adjacent tool position line segments is calculated by formula (22), and the abnormal value is identified by the MAD method. The tool position where the abnormal value is located is determined to be a defect point with uneven tool position distribution. It is determined that the 323rd and 1597th lines are dense defect points. The length of the line segments between their tool positions and the adjacent tool positions is extremely small, resulting in a significant sudden change in the linear axis interpolation instruction speed and the phenomenon of deceleration to zero. This can be corrected by deleting the defective tool positions. The distribution density of the remaining 21 defective tool positions is uneven, which can be corrected by reconstructing the defect position G code to make the tool position distribution uniform.

[0128]

[0129] di=d n+1 -d n (twenty two)

[0130] Where x n ,y n ,z n Represents the coordinate data of the X-axis, Y-axis, and Z-axis respectively, d n Represents the length of the line segment, and di represents the difference in length of the line segment.

[0131] Depend on Figure 7 It can be seen that the uniformity of the length of each line segment of the G code after the correction of this embodiment is increased, and the tool position point distribution is more uniform; Figure 8 It can be seen that after the correction of this embodiment, the interpolation instruction speed obviously disappears, there is no obvious deceleration behavior, and the speed curve is smoother. Figure 9 It can be seen that in this embodiment, at the defective tool position after correction, the feed speed of the tool is increased and the processing efficiency is improved.

[0132] Example 3, taking a certain casing part as an example, compared with Example 1 and Example 2, a five-axis G code defective tool position point identification and correction method has the following differences: Step 2) By using a box diagram to screen the Hilbert transform amplitude abnormal values ​​of the unstable part of the interpolation instruction in the machine tool coordinate system, it is identified that there are 15 rotating axis defective tool positions in a certain casing part of Example 3; Step 3) Specifically, according to the characteristics of the defective tool position points, the type of defective tool position points is determined and corrected: 3.2.3) Method for determining and correcting tool axis vector mutation defective tool positions: The tool axis vector at the defective position is calculated by formula (8), the angle between adjacent tool axis vectors is calculated by formula (23), and the MAD method is used to identify the abnormal values ​​of the tool axis vector angle. It is identified that the rotating axis defective tool positions in Example 15 are all tool axis vector mutation defective tool positions. By fitting the sudden change position trajectory of the tool axis vector and calculating the rotation axis angular acceleration of the fitted trajectory by formula (24) and formula (25), the rotation angular acceleration of the fitted trajectory is substituted into the objective function of formula (26) to determine whether the objective function is satisfied. If the objective function is satisfied, it is determined as the reconstructed tool axis vector.

[0133]

[0134] Where, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, F is the tool axis vector angle between adjacent tool positions, Feed rate at is the length of the line segment between adjacent tool positions, A and C axis rotation angles respectively, and The tool position Move to the knife position The rotational angular velocity of the A and C axes of the machine tool, and The tool position Move to the knife position The rotational angular acceleration of the A and C axes of the machine tool; E(O x ,O y ,O z ) represents the tool axis vector objective function.

[0135] Depend on Figure 10 It can be seen that after the correction of this embodiment, the sudden change of the tool axis vector disappears, and the change is smoother and continuous. Moreover, the corrected tool direction is obviously smoother than the original tool direction. Not only is the tool direction smooth in each row, but also the tool directions at adjacent tool positions are almost consistent between rows. Figure 11 It can be seen that after correction in this embodiment, the feed speed of the tool at the defective tool position is increased, and the processing efficiency is improved; Figure 12It can be seen that after the correction of this embodiment, the change in the interpolation instruction speed of the linear axis of the machine tool is significantly smaller than before the correction, and the change in the angular velocity of the two rotating axes of the machine tool is significantly smaller than before the correction, and the machining process is more stable.

Claims

1. A five-axis G code defective tool position identification and correction method, characterized in that: The following steps are involved: 1) Interpolation instruction collection; 2) Identification of defective tool locations; The step 2) is specifically as follows: 2.1) Extracting the unstable part of the interpolation instruction: Assume that the G code of a test piece is interpolated by the CNC system and the interpolation instruction in the machine tool coordinate system is recorded as p(t). The n-order Fourier series fitting and the unstable part of the interpolation instruction are expressed as: Where F(t) is the sum of multiple sine and cosine signals and a DC component, a0 is a constant term, and a m and b m is the expansion coefficient of the mth harmonic of the Fourier series, w is the fundamental frequency, t is the time, R(t) is the unstable part of the interpolation instruction, and p(t) is the interpolation instruction; 2.2) Hilbert-Huang transform of the unstable part of interpolation instruction: decompose the unstable part of interpolation instruction R(t) into n r Components, that is For the component h i Hilbert transform of (t) The analytical signal is defined as: Construct the component h i The analytical function of (t) is defined as: Where, h i (t) is the decomposed component, r(t) is the remainder, is the component h i The analytical signal of (t), z i (t) is the analytical function of the i-th component; A i (t) is the instantaneous amplitude function; Φ i (t) is the instantaneous phase function; Frequency is the rate of change of phase with time, so the instantaneous frequency of the i-th component is: Further obtain the Hilbert spectrum H(w,t): Where, ω i (t) is the frequency function, H(w,t) represents the Hilbert spectrum, and Re represents the real part; 2.3) Determine the defective tool location: Analyze the amplitude of the Hilbert transform of each axis using the box plot method, output the axis and G code line number corresponding to the abnormal amplitude, and record it as: N X ,N Y ,N Z ,N A ,N C ; Take the common row number N of the linear axis l , the common row number of the rotation axis is N r , where N l =N X ∩N Y ∩N Z , N r =N A ∩N C and number the row as N l The G code tool position is recorded as the linear axis defect tool position, and the line number is N r The G code tool position point is recorded as the defective tool position point of the rotary axis; 3) Determination and correction of defective tool position type.

2. A five-axis G code defective tool location point identification and correction method according to claim 1, characterized in that: The step 1) is specifically as follows: input the G code into the CNC system, use the data acquisition function of the CNC system, and collect the generated interpolation instructions according to the interpolation cycle of the CNC system; obtain six columns of data through the acquisition, wherein the first three columns of data are linear axis interpolation instructions, the fourth and fifth columns of data are rotary axis interpolation instructions, and the sixth column of data is the G code line number.

3. The method for identifying and correcting defective tool locations in a five-axis G code according to claim 1, wherein step 3) comprises determining and correcting the defective tool location type based on the characteristics of the defective tool location. 3.1) Determination and correction method of the type of defective tool point of the linear axis: The coordinate data of the X-axis, Y-axis, and Z-axis are separated and extracted from the G-code file and connected into a trajectory. First, the length of the adjacent tool point segments is calculated according to formula (8), and the MAD method is used to identify the abnormal value of the segment length. Then, it is determined whether it is a continuous tool point on the G-code tool path trajectory. If it is not a continuous point on the G-code tool path trajectory, it is determined to be a dense defect point. If it is a continuous point on the G-code tool path trajectory, the difference in the length of the adjacent tool point segments is calculated according to formula (9), and the abnormal value is identified by the MAD method. The tool point where the abnormal value is located is determined as a defect point with uneven tool point distribution. di=d n+1 -d n (9) In the formula, x n ,y n ,z n Represents the coordinate data of the X-axis, Y-axis, and Z-axis respectively, d n Represents the length of the line segment, and di represents the difference in length of the line segment; The correction method is as follows: dense defects are corrected by directly deleting the defective tool points, and uneven tool point distribution is corrected by reconstructing the tool points at the defective position so that the tool point density at the defective position is small and uniform; 3.2) Determination and correction method of defective tool location point type of rotary axis: 3.2.1) Method for determining and correcting incorrect tool position points in multiple solutions: The determination method is as follows: calculate the tool axis vector by the screw theory, as shown in formula (10), and inversely calculate the rotation axis coordinates according to the screw theory, as shown in formulas (11) and (12); When the C-axis coordinate value of the defective tool position When , use formula (13) to determine whether the defective tool location is a wrong tool location selected by multiple solutions; When the C-axis coordinate value of the defective tool position Formula (14) is used to determine whether the defective tool location is a wrong tool location selected by multiple solutions; Where, (O x ,O y ,O z ) is the tool axis vector, The A-axis rotation angle value obtained by inverse transformation of the tool axis vector is is the C-axis rotation angle value obtained by inverse transformation of the tool axis vector. They are the A-axis and C-axis coordinate values ​​of the abnormal feed tool position of the rotary axis respectively; The A-axis coordinate value of the point before the abnormal feed position of the rotary axis. The C-axis coordinate value of the point before the abnormal feed position of the rotary axis; The correction method is: when the C-axis coordinate value of the defective tool position When , use formula (15) to correct; When the C-axis coordinate value of the defective tool position Use formula (16) to correct the multiple solutions and select the wrong knife position; Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values; 3.2.2) Determination and correction method of singular knife point: The judgment method is as follows: analyze the tool axis vector calculation from the differential angle, as shown in formula (17); when the A-axis rotation angle is 0°, the movement of the C-axis will not cause the tool axis direction to change. At this time, the tool axis is in a singular state, as shown in formula (18); calculate the expression of the tool axis vector at this time according to formula (19) to determine whether it is a singular tool position point; Where θ A ,θ C is the angle between the A axis and the C axis, dO x ,dO y ,dO z is the differential representation of the X, Y, and Z tool axis vectors, dθ A ,dθ C To differentiate the angle value, J(θ A ,θ C ) is the simplified Jacobian matrix; The correction method is: extract the coordinate information of the singular tool position point and calculate the theoretical feed time between adjacent tool positions, as shown in formula (20); Calculate the C-axis feed of adjacent rows and reconstruct the C-axis coordinates of the singular tool position point, as shown in formula (21); Where, t k is the theoretical feed time between adjacent tool positions, F k The preset feed rate for the kth tool position, Δs k is the extension line displacement between the kth tool position point and the previous point, is the correct C-axis feed between the kth tool position and the previous point, is the C-axis coordinate value of the corrected singular tool position point, is the C-axis coordinate value of the singular tool position before correction; 3.2.3) Determination and correction method of tool position of tool axis vector mutation defect: The determination method is as follows: calculate the tool axis vector at the defective tool position by formula (10), calculate the angle between adjacent tool axis vectors by formula (22), use the MAD method to identify the abnormal value of the tool axis vector angle, and determine the tool position corresponding to the abnormal value as the tool axis vector mutation defect tool position; The correction method is as follows: fit the sudden change position trajectory of the tool axis vector, and calculate the rotation axis angular acceleration of the fitted trajectory by formula (23) and formula (24), bring the rotation angular acceleration of the fitted trajectory into the objective function of formula (25), and judge whether it satisfies the objective function. If it does, it is determined as the reconstructed tool axis vector. Where, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, F is the tool axis vector angle between adjacent tool positions, Feed rate at is the length of the line segment between adjacent tool positions, A and C axis rotation angles respectively, and The tool is from the tool position Move to the knife position The rotational angular velocity of the A and C axes of the machine tool, and The tool position Move to the knife position The rotational angular acceleration of the A and C axes of the machine tool; E(O x ,O y ,O z ) represents the tool axis vector objective function.

Citation Information

Patent Citations

  • Coarse and fine step-by-step screening method for G code defect coordinates in three-axis numerical control machining

    CN113485245A

  • Defect cutter location point identification method based on flaw type

    CN115016394A