Five-axis G code defect cutter location point identification and correction method
By performing Fourier series fitting and Hilbert-yellow transformation on the five-axis G code interpolation instruction, the defective tool site is identified and corrected, and the problem of misjudging the tool site in the prior art is solved, and the stability and surface quality of the processing process are improved.
Patent Information
- Application Number
- CN202510066851.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-16
AI Technical Summary
When identifying the five-axis G-code defective tool sites, it is easy to misjudgment that some of the tool sites that can be corrected by the CNC system are defective tool sites, which affects the quality and accuracy of the processing surface.
By performing Fourier series fitting and Hilbert-yellow transformation on the interpolation instruction, identify the non-stable part of the interpolation instruction, determine the defect knife site, and correct it according to the defect type, including specific correction methods for the linear axis and the rotation axis.
Accurate identification and correction of defective tool sites that actually affect the processing surface quality is achieved, and the stability of the processing process and the surface quality of the workpiece are improved.
Smart Images

Figure CN119882613A_ABST
Abstract
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, servo control and other links. The main function of the CAM processing link is to convert the geometric model generated by CAD into G code that can command machine tool processing. G code is the data source of CNC machining. However, due to algorithm defects in CAM post-processors, there are many different types of defective tool positions in G code, which affects the quality of downstream data flow and also affects the accuracy and efficiency of part processing.
[0003] At present, the identification methods for defective tool positions 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 positions and the actual processing data of the machine tool to study the causes of surface defects and correct the defective tool positions. However, this visualization software requires manual identification and correction of defective points. The actual application depends 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 of G code in three-axis CNC machining: China, 202110758550.X[P]. 2021-10-08.) identifies the defective tool positions of the linear axis by setting parameter thresholds and judging the continuity of the machining trajectory, while ignoring the defective tool positions of the rotary axis. At the same time, these identification methods mainly focus on identifying defects at the G code level, ignoring the correction of the G code defective tool positions by the CNC system, and are prone to misjudging the defective tool positions. The correction method for defective tool position 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 position 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 position point identification and correction method, which identifies the defective tool position point by analyzing the interpolation instructions, determines the defect type according to the characteristics of different types of defective tool position points and proposes a corresponding correction method, thereby realizing 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 comprises the following steps:
[0007] 1) Interpolation instruction collection;
[0008] 2) Identification of defective tool positions;
[0009] 3) Determination and correction of defective tool position type.
[0010] The step 1) is specifically as follows: input the G code into the numerical control system, use the data acquisition function of the numerical control system, and collect the generated interpolation instructions according to the interpolation cycle of the numerical control system. Six columns of data are obtained through the acquisition, of which 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.
[0011] The step 2) is specifically as follows:
[0012] 2.1) Extract 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 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] In the formula, 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, then the instantaneous frequency of the i-th component is:
[0023]
[0024] Further obtain the Hilbert spectrum H(w,t):
[0025]
[0026] In the formula, ω 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 position: 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 line number N of the linear axis l , common row number N of the rotation axis 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.
[0028] The step 3) specifically determines and corrects the defective tool position type according to the characteristics of the defective tool position:
[0029] 3.1) Determination and correction method of 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, calculate the length of the adjacent tool position line segment according to formula (8), and use the MAD method to identify the abnormal value of the line segment length; then determine whether it is a continuous tool position 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, calculate the difference between the lengths of the adjacent tool position line segments according to formula (9), identify the abnormal value by the MAD method, and determine the tool position where the abnormal value is located as a defect point with uneven tool position distribution;
[0030]
[0031] di=d n+1 -d n (9)
[0032] In the formula, x n ,y n ,z n Respectively represent the coordinate data of the X-axis, Y-axis, and Z-axis, d n represents the length of the line segment, and di represents the difference in the length of the line segment;
[0033] The correction method is as follows: dense defects are corrected by directly deleting the defective tool positions, and uneven tool position distribution is corrected by reconstructing the tool positions at the defective positions so that the tool position density at the defective positions changes little and is uniform;
[0034] 3.2) Determination and correction method of defective tool position point type of rotary axis:
[0035] 3.2.1) Multiple solution selection error tool position determination and correction method:
[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 position is a multi-solution selected wrong tool position; when the C-axis coordinate value of the defective tool position Formula (14) is used to determine whether the defective tool position point is a wrong tool position point selected by multiple solutions;
[0037]
[0038] In the formula, (O x ,O y ,O z ) is the knife axis vector, is the A-axis rotation angle value calculated by inverse transformation of the tool axis vector. is the C-axis rotation angle value calculated 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 tool position of the rotary axis;
[0039] 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 Formula (16) is used to correct the multiple solutions that select the wrong tool position.
[0040]
[0041] In the formula, θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values;
[0042] 3.2.2) Determination and correction method of singular tool position points:
[0043] The determination method is as follows: analyze the tool axis vector calculation from a differential perspective, 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] In the formula, θ 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 position points, 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 is 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 point 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: the tool axis vector at the defective tool position is calculated by formula (10), the angle between adjacent tool axis vectors is calculated by formula (22), the MAD method is used to identify the abnormal value of the tool axis vector angle, and the tool position corresponding to the abnormal value is determined as the tool position of the tool axis vector mutation defect;
[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), and bring the angular acceleration of the rotation axis of the fitted trajectory into the objective function of formula (25) to determine whether it satisfies the objective function. If it satisfies the objective function, it is determined as the reconstructed tool axis vector.
[0052]
[0053] In the formula, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, and 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] The present invention solves the problem that the prior art misjudges a part of the tool positions that can be corrected by the numerical control system as defective tool positions when identifying the defective tool positions of the G code by analyzing the interpolation instructions, and has the advantage of accurately identifying the defective tool positions that affect the actual machining surface quality and surface accuracy. The present invention determines the type of the identified defective tool positions, summarizes the types of defective tool positions into two types of linear axis defective tool positions and three types of rotary axis defective tool positions, and performs feature analysis on each type of defective tool position, and determines the corresponding correction method. The proposed correction method can improve the stability of speed and acceleration during the machining process, and has the advantages of improving the surface quality of the workpiece and improving the stability 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 rotational speed of the rotating shaft 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 of Example 1.
[0061] Figure 6 Comparison of tool feed acceleration before and after correction of 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] Fig. 9 Comparison of feed speed before and after correction of Example 2.
[0065] Fig.10 Comparison of tool axis vector change values before and after correction in Example 3.
[0066] Fig.11 Comparison of feed speed before and after correction of Example 3.
[0067] Fig.12 Comparison of interpolation instruction speed before and after correction of Example 3. DETAILED DESCRIPTION
[0068] The present invention is described in detail below in conjunction with embodiments and drawings.
[0069] Example 1, taking the S specimen as an example, a five-axis CNC machining G code defect tool position point identification and correction method includes the following steps:
[0070] 1) Interpolation instruction collection; specifically: input the G code of the S-shaped specimen into the CNC system, use the data collection 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 collection, of which 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;
[0071] 2) Identification of defective tool positions; specifically:
[0072] 2.1) Extract 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). The 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] In the formula, 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, then the instantaneous frequency of the i-th component is:
[0084]
[0085] Further obtain the Hilbert spectrum H(w,t):
[0086]
[0087] In the formula, ω 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 position: 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 line number N of the linear axis l , common row number N of the rotation axis 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.
[0089] For the S-shaped specimen of the embodiment, after analysis, the tool positions of rows 137, 138, 348, and 358 are defined as defective tool positions of the rotating axis. The defective tool position information is shown in Table 1. The Hilbert spectrum of the S-shaped specimen is shown in Figure 1 As shown, it can be seen that at the defective tool point, the Hilbert spectrum amplitude will have obvious anomalies.
[0090] 3) Determine and correct the defective tool location point type: Specifically, determine and correct the defective tool location point type according to the characteristics of the defective tool location point. Since this embodiment only identifies the defective tool location point of the rotary axis in step 2), the defective tool location point type of the rotary axis is directly determined and corrected in step 3).
[0091] Table 1. Results of G code defect tool position identification for S-shaped specimens
[0092]
[0093] 3.2) Determination and correction method of defective tool position point type of rotary axis:
[0094] 3.2.1) Multiple solution selection error tool position determination and correction method:
[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 rotary axis coordinates 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 , use formula (11) to determine whether the abnormal tool position point is a multi-solution selected wrong tool position point; when the C-axis coordinate value of the abnormal feed tool position point of the rotary axis Formula (12) is used to determine whether the abnormal feeding tool position of the rotary axis is an incorrect tool position selected by multiple solutions.
[0096]
[0097]
[0098] In the formula, (O x ,O y ,O z ) is the knife axis vector, These are the two A-axis rotation angle values calculated by inverse transformation of the tool axis vector. These are the two C-axis rotation angle values calculated 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 selection error tool location points in the example S specimen, and the information of the multiple solution selection error tool location points is shown in Table 2 below.
[0100] Table 2 Defect G codes of wrong 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 , use formula (13) to correct; when the C-axis coordinate value of the defective tool position Formula (14) is used to correct the multiple solutions that select the wrong tool position.
[0103]
[0104] In the formula, θ 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 that is 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 based on 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 wrong tool position point selected by multiple solutions for S-shaped specimen
[0107]
[0108] 3.2.2) Determination and correction method of singular tool position points:
[0109] The singularity of the dual-turret five-axis machine tool is mainly reflected in the rotation axis. From the kinematic model of the machine tool, it can be obtained that the tool axis vector at the singularity 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 of rotation from the tool axis vector in reverse, for the tool axis vector in a singular position, the two rotation axes have infinite sets of solutions corresponding to it. 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 rotation angle is 0°, as shown in formula (16), when the C-axis rotation 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. 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] In the formula, θ 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 As shown in the figure, the position of the wrong tool position selected by the multiple solutions in the tool path is marked accordingly. The tool position corresponding to the 348th line of G code belongs to the singular tool position, and from the G code coordinate value, the tool position corresponding to the 344-347 lines of code belongs to the singular area, the A-axis and C-axis feed are 0, and in this processing section, the logical position of the C-axis changes from 26.567 degrees to 14.032 degrees. The information of the singular tool position 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 rotating 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 rotating 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 to control the instantaneous acceleration of the tool; 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. The abnormal feeding of the rotating axis can be improved 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 coordinate of the singular tool position is 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 is 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), 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] In the formula, O i represents the tool axis vector, is the included angle of tool axis vectors between adjacent tool positions.
[0124] For the S sample of Example 1, there are 15883 interpolation instructions before correction, and 13688 interpolation instructions after correction. The collection cycle of the machine tool interpolation instructions is 2ms. According to the number of interpolation instruction lines and the interpolation cycle, the processing time before and after correction is calculated. After correction, the processing efficiency is 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 in this embodiment, the tool feed is limited by the rotation axis limit speed, and is greatly decelerated, and some positions are decelerated to 0. After the correction, the feed speed is freed from the limit of the rotation axis limit speed, and the tool feed speed is 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 feed of the tool 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 position points 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 defective tool position points is determined and corrected: 3.1) Type determination and correction method of linear axis defective tool position points: 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 segment is calculated by formula (21), and the MAD method is used to identify the abnormal value 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 of the length of the adjacent tool position line segment is calculated by formula (22), and the abnormal value is identified by the MAD method, and the tool position where the abnormal value is located is determined as a defect point with uneven tool position distribution. It is determined that the 323rd line and the 1597th line are dense defect points through judgment. The length of the line segment between the tool position and the adjacent tool position is extremely small, resulting in a significant sudden change in the speed of the linear axis interpolation instruction and the phenomenon of deceleration to zero. It can be corrected by deleting the defective tool position; the distribution density of the remaining 21 defective tool positions is uneven, which can be corrected by reconstructing the G code of the defect position to make the tool position distribution uniform.
[0128]
[0129] di=d n+1 -d n (twenty two)
[0130] In the formula, x n ,y n ,z n Respectively represent the coordinate data of the X-axis, Y-axis, and Z-axis, 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 in 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; Fig. 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 position points: 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 so, it is determined as the reconstructed tool axis vector.
[0133]
[0134] In the formula, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, and 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 Fig.10 It can be seen that after the correction of this embodiment, the sudden change of the tool axis vector disappears, the change is smoother and continuous, and 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 between rows are almost consistent. Fig.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; Fig.12It can be seen that after the correction of this embodiment, the change in the interpolation command 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 point identification and correction method, characterized in that: The following steps are involved: 1) Interpolation instruction collection; 2) Identification of defective tool positions; 3) Determination and correction of defective tool position type.
2. A five-axis G code defective tool position 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. A five-axis G code defective tool position point identification and correction method according to claim 1, characterized in that: The step 2) is specifically as follows: 2.1) Extract 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: In the formula, 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, then the instantaneous frequency of the i-th component is: Further obtain the Hilbert spectrum H(w,t): In the formula, ω 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 position: 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 line number N of the linear axis l , common row number N of the rotation axis 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.
4. A five-axis G code defective tool position point identification and correction method according to claim 1, characterized in that: The step 3) specifically determines and corrects the defective tool position type according to the characteristics of the defective tool position: 3.1) Determination and correction method of 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, calculate the length of the adjacent tool position line segment according to formula (8), and use the MAD method to identify the abnormal value of the line segment length; then determine whether it is a continuous tool position 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, calculate the difference between the lengths of the adjacent tool position line segments according to formula (9), identify the abnormal value by the MAD method, and determine the tool position where the abnormal value is located as a defect point with uneven tool position distribution; di=d n+1 -d n (9) In the formula, x n ,y n ,z n Respectively represent the coordinate data of the X-axis, Y-axis, and Z-axis, d n represents the length of the line segment, and di represents the difference in the length of the line segment; The correction method is as follows: dense defects are corrected by directly deleting the defective tool positions, and uneven tool position distribution is corrected by reconstructing the tool positions at the defective positions so that the tool position density at the defective positions changes little and is uniform; 3.2) Determination and correction method of defective tool position point type of rotary axis: 3.2.1) Multiple solution selection error tool position determination and correction method: The determination method is: 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 position point is a wrong tool position point 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 position point is a wrong tool position point selected by multiple solutions; In the formula, (O x ,O y ,O z ) is the knife axis vector, is the A-axis rotation angle value calculated by inverse transformation of the tool axis vector. is the C-axis rotation angle value calculated 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 tool 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 Formula (16) is used to correct the multiple solutions to select the wrong knife position; In the formula, θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values; 3.2.2) Determination and correction method of singular tool position points: The determination method is as follows: analyze the tool axis vector calculation from a differential perspective, 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; In the formula, θ 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 position points, 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); Where, t k is the theoretical feed time between adjacent tool positions, F k is 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 point before correction; 3.2.3) Determination and correction method of tool position of tool axis vector mutation defect: The determination method is as follows: the tool axis vector at the defective tool position is calculated by formula (10), the angle between adjacent tool axis vectors is calculated by formula (22), the MAD method is used to identify the abnormal value of the tool axis vector angle, and the tool position corresponding to the abnormal value is determined as the tool position of the tool axis vector mutation defect; 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 satisfies the objective function, it is determined as the reconstructed tool axis vector; In the formula, O i represents the tool axis vector, is the tool axis vector angle between adjacent tool positions, and 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.
Citation Information
Patent Citations
Error-control-based smooth interpolation method for five-axis NC (numerical control) system
CN103801982A
Coarse and fine step-by-step screening method for G code defect coordinates in three-axis numerical control machining
CN113485245A
Method and device for realizing synchronization of numerical control machining state monitoring data and learning data
CN114488949A
Defect cutter location point identification method based on flaw type
CN115016394A
Method for generating chatter-free tool axis vector in five-axis machining of ball-end cutter
WO2024222566A1