Identification and correction method of abnormal feed tool position of rotary axis in G code of five-axis CNC machining
By extracting coordinate data from the G code and calculating the rotation speed and extended line displacement of the rotary axis, the abnormal feed tool position of the rotary axis in five-axis CNC machining is identified and corrected, solving the problem that the existing technology cannot effectively identify and correct, improving the machining accuracy and efficiency, and ensuring the smoothness of the machining process and the surface quality of the workpiece.
Patent Information
- Application Number
- CN202411646835.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-18
AI Technical Summary
Existing technologies fail to effectively identify and correct defective tool positions caused by abnormal feed of the rotary axis in five-axis CNC machining, resulting in increased nonlinear errors, affecting machining accuracy and efficiency, and failing to perform effective preprocessing before machining.
By extracting the coordinate data of the X-axis, Y-axis, Z-axis, A-axis, and C-axis from the G code, calculating the rotation speed and extension line displacement of the rotary axis, the abnormal feed tool position of the rotary axis is determined, and classified and judged according to its characteristics. Different correction methods are used to correct abnormal feed tool position points such as multiple solution selection errors, machine tool singularities, and rotary axis speed exceeding the limit.
It realizes accurate identification and correction of abnormal feed tool positions of the rotating axis before processing, improves processing accuracy and efficiency, and ensures the stability of the processing process and the surface quality of the workpiece.
Smart Images

Figure CN119511939B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of numerical control machine tools, and in particular relates to a method for identifying and correcting abnormal feed tool position points of a G-code rotary axis in five-axis numerical control machining. Background Art
[0002] CNC machining requires CAD 3D modeling, CAM post-processing to generate G-code, and then inputting the G-code into the CNC system for machining. During CAM processing, complex surface models are discretized into a large number of tiny straight line segments to approximate the original curve, thereby forming a G-code composed of tiny straight line segments in the G1 format, i.e., the tool machining path. For five-axis machine tools, G-code coordinates include linear and rotary axis coordinates. The linear and rotary axis feeds are coordinated and mutually constrained, and the ratio of linear and rotary axis feeds affects part machining efficiency and quality. However, in the CAM post-processing process, only the stroke and feed direction of the rotary axis are constrained, and the ratio of the feed amount of the rotary axis and the linear axis is not considered, which will cause defective tool positions where the rotary axis feeds abnormally, resulting in increased nonlinear errors and affecting machining accuracy; abnormal feed G code segments of the rotary axis will also cause uneven feed of the rotary axis, drastic changes in acceleration and jerk, and induce vibration of the mechanical structure of the machine tool, affecting machining accuracy and efficiency; sometimes there is an excessive feed amount and excessive tool feed speed at the defective tool position, causing the rotation speed of the rotary axis to exceed the capability of the servo drive, and the various feed axes of the machine tool are in an unstable operating state.
[0003] At present, there have been many relatively mature studies on the fitting of small line segments in tool paths, smoothing of G code trajectories and tool axis vectors. However, there is a lack of accurate and effective identification and correction methods for tool position points of kinematic feature defects. Some foreign CNC companies use visual integrated software identification methods (SIEMENS SINUMERIK Analyze My Workpiece / Toolpath Operating Manual) or can identify geometric feature defects based on defect feature parameter identification (Li Zhenhan, Jiang Haiqing, Hui Enming, etc. A method for obtaining machining feature points in tool paths and its application: China, 104656558B
[0004] [P].2015-05-27), but it can only be simulated and analyzed after processing, and it is impossible to identify all defective tool locations, which cannot meet the purpose of effective preprocessing of G code micro-segment spline fitting. Summary of the Invention
[0005] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a method for identifying and correcting abnormal feed tool positions of the G-code rotary axis in five-axis CNC machining, which can effectively solve the problem of identifying defective tool positions before machining, and at the same time screen the abnormal tool positions of the rotary axis and make corrections, thereby realizing intelligent diagnosis and analysis of the defective coordinate positions of the G-code.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] A method for identifying and correcting abnormal feed tool position points of a five-axis CNC machining G-code rotary axis includes the following steps:
[0008] 1) Extract the coordinate data of the X-axis, Y-axis, Z-axis, A-axis, and C-axis from the G code;
[0009] 2) Determination of abnormal feed tool position of rotary axis;
[0010] 3) Determination of the abnormal feed tool position type of the rotary axis;
[0011] 4) Correction of abnormal feed tool position of rotary axis.
[0012] The step 1) is specifically as follows: removing the address characters in the dimension characters from the G code .nc format file, and separating and extracting the coordinate data of the X axis, Y axis, Z axis, A axis, and C axis.
[0013] The step 2) is specifically as follows: calculate the feed rate of each axis by using the coordinate data extracted in step 1), and then calculate the rotation speed and extension line displacement of the rotating axis during the processing; suppose a series of consecutive adjacent tool positions in the G code are P1, P2, P3...P i ,P n-1 ,P n , the i-th point is Its previous point, i-1th point, is The i+1th point is Calculate the motion speed according to formula (1), calculate the extension line displacement according to formula (2), combine the above formulas (1) and (2), and establish the relationship formula (3) between the rotation axis speed, G code coordinates, and preset feed speed. Evaluate the feed state of the tool position point according to formula (4). If formula (4) is not satisfied, the tool position point P is determined to be i Abnormal feed tool position of the rotary axis;
[0014]
[0015] Where, t i is the processing time, F0 is the feed speed, v Ai , v Ci is the rotational speed of the rotating shaft, ΔX i , ΔYi , ΔZ i , is the feed amount of each feed axis, Δs is the expansion line displacement, a1 and a2 are the coefficients for converting angle into displacement length, and v Amax The maximum rotation speed of the rotating shaft allowed by the servo drive system. is the A-axis coordinate value at the tool position point, is the C-axis coordinate value of the tool position point, and Δθ is the angle change between two adjacent tool position points.
[0016] The step 3) is specifically as follows: classify and judge based on the characteristics of the three types of abnormal feed tool positions of the rotary axis:
[0017] 3.1) Determine whether the wrong tool position point is selected due to multiple solutions: The tool axis vector is calculated by the screw theory, as shown in formula (5). When the rotation axis coordinates are inversely calculated according to the screw theory, there are two solutions corresponding to the range of the A-axis and C-axis travel, as shown in formula (6) and formula (7). i , need to be consistent with the previous row of tool positions The rotation axis coordinates are compared; first identify the interval of the C axis coordinate value of the abnormal feed tool position of the rotation axis, and when the C axis coordinate value of the abnormal feed tool position of the rotation axis is When the abnormal tool position is selected, the formula (8) is used 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 (9) is used to determine whether the abnormal feed tool position of the rotary axis is a multi-solution selection error tool position. When formula (8) or formula (9) is satisfied, the abnormal feed tool position P i That is, multiple solutions select the wrong tool position point. If both formulas are not satisfied, the abnormal feed tool position point P i It does not belong to the wrong knife point selection in multiple solutions;
[0018]
[0019] Where, (O x ,O y ,O z ) is the tool axis vector, O x is the coordinate value of the tool axis vector on the X axis, O y is the coordinate value of the tool axis vector on the Y axis, O z is the coordinate value of the tool axis vector on the Z axis, are two A-axis rotation angle values calculated based on the inverse transformation of the tool axis vector. are two C-axis rotation angle values calculated based on the 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;
[0020] 3.2) Determine whether it is a singular tool position of the machine tool: For the tool axis vector in a singular position, there are infinitely many groups of solutions corresponding to the two rotating axes. The extremely small swing of the tool axis vector will cause the two rotating axes to rotate in a large range. The tool axis vector calculation is analyzed from the differential angle, as shown in formula (10). 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 (11). The expression of the tool axis vector at this time is calculated according to formula (12). Select the abnormal tool position P with an A-axis rotation angle of 0°. i , calculate the tool axis vector to determine whether it is a machine tool singularity point; in addition, the front and back of this tool position point must be determined;
[0021]
[0022] 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;
[0023] 3.3) Determine whether the rotation axis speed exceeds the limit of the tool position: To determine whether the speed exceeds the limit of the tool position, it is necessary to first calculate the nonlinear deviation. The nonlinear error is coupled with the chord height error to obtain the contour error. To calculate the nonlinear error, it is first necessary to calculate the abnormal feed tool position P of the rotation axis. i , and the previous knife position P i-1 Extract the coordinate information and calculate the tool axis vectors of the two tool positions respectively, as shown in formula (13). According to formula (14), calculate the tool axis vector of the middle position of the surface under ideal conditions. In addition, according to the linear interpolation principle, calculate the tool axis vector of the middle position of the two tool positions, as shown in formula (15). Then, calculate the nonlinear error according to formula (16) and compare the allowable value of nonlinear deviation of the machining surface [H3] to determine whether it is a tool position where the rotation axis speed exceeds the limit due to nonlinear deviation.
[0024]
[0025] Where K1 is the tool axis vector of the abnormal feed tool position of the rotary axis, K2 is the tool axis vector of the line before the abnormal feed tool position of the rotary axis, K3 is the tool axis vector of the middle position of the ideal surface, K4 is the tool axis vector of the middle position between the two tool positions, H3 is the nonlinear deviation, L is the tool length, and α is the angle between K3 and K4.
[0026] The step 4) is specifically as follows: different correction methods are adopted according to the identification features of the three types of abnormal feed tool positions of the rotary axis:
[0027] 4.1) Correction of incorrect knife point selection by multiple solutions: For incorrect knife point selection P i , when the C-axis coordinate value of the defective tool position When , use formula (17) to correct; when the C-axis coordinate value of the defective tool position Formula (18) is used to correct the multiple solutions and select the wrong knife position;
[0028]
[0029] Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values;
[0030] 4.2) Correction of singular tool position of machine tool: Extract coordinate information of singular tool position And the coordinate information of the singular points in the first n lines of G code The extension line displacement is calculated according to formula (2), as shown in formula (19); then, the theoretical feed time between adjacent tool positions is calculated, as shown in formula (20); finally, assuming that the C axis rotates at a constant speed, the total C axis feed of the n+1 rows is calculated, and the C axis coordinates of the singular tool position of the machine tool are reconstructed, as shown in formula (21);
[0031]
[0032] 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 corrected C-axis coordinate value of the machine tool singular point;
[0033] 4.3) Correction of tool position when the rotation axis speed exceeds the limit: Based on the expression for determining whether the nonlinear error exceeds the tolerance, the nonlinear error formula is a function of the coordinates of the two tool positions of the rotation axis, A axis and C axis, as shown in formula (22); calculate the tool position P when the speed exceeds the limit i With Pi-1 The tool axis vector between the planes is formed, as shown in formula (23). On this basis, the intermediate tool axis vector is reconstructed according to formula (24), and the reconstructed tool position point tool axis vector is obtained as a function of the characteristic parameter m, as shown in formula (25); the reconstructed tool axis vector is used as the final tool axis vector and substituted into formula (22), and the nonlinear error is obtained as a function of the characteristic parameter m, as shown in formula (26); then, according to the relationship between the nonlinear error and the contour error, the allowable value of the nonlinear error is calculated, and the characteristic parameter m is inversely calculated, as shown in formula (27); then, the coordinate value of the reconstructed rotation axis is calculated according to formula (28); since the feed ratio of each axis between adjacent tool positions is approximately a constant, as shown in formula (29); therefore, the coordinate value of the reconstructed linear axis is calculated according to formula (30); finally, the tool feed speed is corrected according to formula (31);
[0034]
[0035] [H1]=[H3]+[H2] (27)
[0036]
[0037] In the formula, the initial tool axis vector is set to The final tool axis vector is set to H3 is the nonlinear error, H2 is the chord height error, H1 is the profile error, It is expressed as a function of the coordinate values of the rotation axis of the two tool positions, m is the characteristic parameter, is the tool axis vector after reconstruction of the intermediate tool position, x 重构 ,y 重构 ,z 重构 , It is represented by the coordinate value of each axis after the tool position is reconstructed, k is the approximate value of the feed rate of each axis, F 重构 is the reconstructed tool feed rate.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] By analyzing abnormal feed tool locations of rotary axes, the present invention proposes a method for determining and correcting multiple solution selection errors, singular machine tool tool locations, and tool locations with excessive rotary axis speed. This method provides an effective and accurate method for improving five-axis G-code tool locations with kinematically defective characteristics. Because the present invention corrects kinematically abnormal tool locations in the G-code tool locations before machining, it has the advantage of preemptively correcting abnormal feed tool locations, thereby obtaining high-quality five-axis CNC machining G-code tool locations and improving machining efficiency. Furthermore, the present invention analyzes the rotational speed and tool feed rate during machining, and further classifies abnormal feed tool locations of rotary axes based on their characteristics. Three types of abnormal feed tool locations are then identified and corrected, improving the smoothness of speed and acceleration during machining. This improves workpiece surface quality and enhances machining stability. Therefore, the present invention meets the requirements for effective pre-processing of G-code micro-segment spline fitting, enabling intelligent diagnosis and analysis of G-code rotary axis coordinate locations with defective coordinates. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a diagram showing the C-axis speed change at the abnormal feed tool position of the rotating axis in Example 1.
[0041] Figure 2 This is a diagram showing the tool feed speed change at the abnormal feed tool position of the rotating axis in Example 1.
[0042] Figure 3 Schematic diagram of the G code trajectory and tool axis sweep surface of Example 1.
[0043] Figure 4 This is the incorrect tool location mark diagram selected for multiple solutions in Example 1.
[0044] Figure 5 This is a marking diagram of the singular tool position of the machine tool in Example 1.
[0045] Figure 6 This is a schematic diagram of nonlinear error fitting in Example 1.
[0046] Figure 7 Schematic diagram of the middle tool axis vector in two cases of Example 1.
[0047] Figure 8 This is a diagram showing the tool position where the rotation shaft speed exceeds the limit in Example 1.
[0048] Figure 9 This is a diagram showing the tool feed speed change before and after correction of the abnormal feed tool position of the rotating axis in Example 1.
[0049] Figure 10 This is a diagram showing the tool feed speed change before and after correction of the abnormal feed tool position of the rotating axis in Example 1.
[0050] Figure 11 Comparison diagram of tool axis sweep surfaces before and after correction of erroneous outlier points selected in multiple solutions of Example 1.
[0051] Figure 12 Schematic diagram of the deviation of the sweeping surface of the tool axis in Example 2.
[0052] Figure 13 This is a diagram showing the change in tool feed speed before and after correction of the tool position where the rotational speed of the rotating shaft of a hub component exceeds the limit in Example 2. DETAILED DESCRIPTION
[0053] The present invention is described in detail below with reference to the embodiments and accompanying drawings.
[0054] Example 1, taking the S specimen as an example, a method for identifying and correcting abnormal feed tool position points of a five-axis CNC machining G code rotary axis includes the following steps:
[0055] 1) Extract the coordinate data of the X-axis, Y-axis, Z-axis, A-axis, and C-axis from the G code:
[0056] The .nc format G code includes dimension words, preparation function words, auxiliary function words, spindle speed function words, and tool function words. To extract the coordinate information of the tool path in the G code, the address symbols such as X, Y, and Z in the dimension words are removed from the .nc format file. The preparation function words G..., auxiliary function words M..., feed function words F..., spindle speed function words S..., and tool function words T... in the file are removed to separate and extract the coordinate data of the X-axis, Y-axis, Z-axis, A-axis, and C-axis.
[0057] 2) Determination of abnormal feed tool position of rotary axis: Calculate the feed amount of adjacent tool positions of each axis through the coordinate data extracted in step 1), and then calculate the rotation speed and expansion line displacement of the rotary axis during the processing; suppose a series of consecutive adjacent tool positions in the G code are P1, P2, P3...P i ,P n-1 ,P n , the i-th point is Its previous point, i-1th point, is The i+1th point is Since the machining path between adjacent tool positions is very short and the machining time is usually 2ms, the motion between adjacent tool positions can be approximated as uniform motion. Therefore, the average speed calculation formula is used here to approximate the instantaneous speed at the equivalent tool position. Therefore, the motion speed is calculated according to formula (1), and the extended line displacement is calculated according to formula (2). By combining the above formulas (1) and (2), the relationship formula (3) between the rotation speed of the rotary axis and the G code coordinates and the preset feed speed is established. At the same time, the feed state of the tool position is evaluated according to formula (4). The ratio of the rotation angle of the rotary axis to the extended line displacement is defined as the rotary axis feed state evaluation parameter. When the rotary axis is in a stable running state, the rotation speed of the rotary axis should be less than the maximum speed allowed by the servo drive system. Therefore, the ratio of the rotary axis feed amount to the extended line displacement at any tool position should be less than the ratio between the maximum speed allowed by the servo system and the tool feed speed. If formula (4) is not satisfied, the tool position P is determined to be i Abnormal feed tool position of the rotary axis;
[0058] The S specimen was used as an example to determine the abnormal feed tool position of the rotary axis. After calculation, the S specimen had a total of 461 tool positions, the upper limit of the speed of the A axis was 6.4r / min, the upper limit of the speed of the C axis was 13.8r / min, and there were 22 abnormal feed tool positions of the rotary axis. The G code coordinate information of the defective points is shown in Table 1 below. The preset tool feed speed of each tool position is 5000mm / min; at the abnormal feed tool position of the rotary axis, the rotary axis speed and the tool feed speed changed dramatically, as shown in Table 1. Figure 1 and Figure 2 As shown in the figure, tool positions 1-19 are tool positions where the rotary axis speed exceeds the limit; tool positions 20 and 22 are tool positions where multiple solutions select errors; and 21 is a singular tool position of the machine tool. As can be seen from the figure, the rotary axis speed and tool feed rate fluctuate violently at the tool positions where multiple solutions select errors and the singular tool positions of the machine tool, and the rotary axis speed approaches the limit speed, which seriously affects the machining stability and the coordination of the five-axis linkage. At the tool position where the rotary axis speed exceeds the limit, since the tool feed rate preset in the G code is too large, the speed is constrained by the boundary of the servo system, resulting in violent fluctuations in the C-axis speed, a sudden drop in the tool feed rate, and machining at a speed far lower than the preset feed rate value, seriously affecting the machining efficiency and quality.
[0059]
[0060]
[0061] Where, t i is the processing time, F0 is the feed speed, v Ai ,v Ci is the rotational speed of the rotating shaft, ΔX i , ΔY i, ΔZ i , is the feed amount of each feed axis, Δs is the expansion line displacement, a1 and a2 are the coefficients for converting angle into displacement length, and v Amax The maximum rotation speed of the rotating shaft allowed by the servo drive system. is the A-axis coordinate value at the tool position point, is the C-axis coordinate value of the tool position point, Δθ is the angle change between two adjacent tool position points;
[0062] Table 1 G code defect recognition results of S-shaped specimen
[0063]
[0064]
[0065] 3) Determination of the type of abnormal feed tool position of the rotary axis: Classify and judge based on the characteristics of the three types of abnormal feed tool positions of the rotary axis:
[0066] 3.1) Determine whether the wrong tool position point is selected for multiple solutions: The maximum travel of the A axis of the dual-rotary five-axis machine tool is [-π,π], and the maximum travel of the C axis is [0,2π]. The kinematic model of the dual-rotary five-axis machine tool is established by the screw theory, and the conversion formula between the machine tool coordinate system and the workpiece coordinate system is obtained, thereby obtaining the kinematic transformation formula of the rotary axis, as shown in formula (5), and calculating the tool axis vector; and when the rotary axis coordinates are inversely calculated according to the screw theory, there are two solutions corresponding to the travel range of the A axis and the C axis, as shown in formula (6) and formula (7). Although the tool axis vectors corresponding to different solutions are the same, different solutions correspond to different nonlinear errors and different sweep surfaces. Therefore, selecting the wrong rotary axis coordinate value will cause the surface quality to deteriorate; if the wrong A and C axis coordinates are selected, the A axis coordinate value in the two adjacent lines of G code may be reversed, and the C axis coordinate may jump by about 180 degrees. Ideally, the rotary axis coordinates of adjacent G codes are continuous. Therefore, an abnormal rotary axis feed tool position point P occurs. i , need to be consistent with the previous row of tool positions The rotation axis coordinates are compared; first identify the interval of the C axis coordinate value of the abnormal feed tool position of the rotation axis, then calculate the rotation axis coordinate change value between the abnormal feed tool position of the rotation axis and the previous tool position, and determine whether the wrong tool position is selected by multiple solutions by comparing the correct angle change value; the C axis coordinate value When the abnormal tool position is selected, the formula (8) is used 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 (9) is used to determine whether the abnormal feed tool position of the rotary axis is a multi-solution selection error tool position. When formula (8) or formula (9) is satisfied, the abnormal feed tool position P iThat is, the multiple solution selection error tool location point. If both formulas are not satisfied, then the abnormal feed tool location point does not belong to the multiple solution selection error tool location point;
[0067]
[0068] Where, (O x ,O y ,O z ) is the tool axis vector, O x is the coordinate value of the tool axis vector on the X axis, O y is the coordinate value of the tool axis vector on the Y axis, O z is the coordinate value of the tool axis vector on the Z axis, are two A-axis rotation angle values calculated based on the inverse transformation of the tool axis vector. are two C-axis rotation angle values calculated based on the 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;
[0069] In the S specimen, there are multiple solutions and wrong tool position selection. The tool axis sweep surface is as follows Figure 3 As shown in the partial enlarged figure, the rotation axis feeds abnormally greatly. Due to the wrong selection of the rotation axis coordinate value, the nonlinear error becomes larger, and the actual processing trajectory deviates greatly from the theoretical tool path trajectory, which leads to obvious cutting marks on the workpiece surface, affecting the processing quality. For the 22nd row of the rotation axis abnormal feed tool position of the example S specimen, two multi-solution incorrect tool position locations are identified. The tool position locations are as follows: Figure 4 As shown, the information of the wrong tool position selected by multiple solutions is shown in Table 2 below;
[0070] Table 2 G codes for the defect of incorrect tool position selection in multiple solutions of S-shaped specimen
[0071]
[0072]
[0073] 3.2) Determine whether it is a singular tool position of the machine tool: 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 at a singular position, the inverse kinematic transformation equation of the machine tool has countless solutions. According to formulas (6) and (7), when solving the rotation angle in reverse from the tool axis vector, for the tool axis vector at a singular position, there are infinite sets of solutions corresponding to the two rotation axes. Therefore, The extremely small swing of the tool axis vector will cause a large rotation of the two rotating axes; the calculation formula of the tool axis vector is analyzed by differential angle, as shown in formula (10), and the Jacobian matrix is simplified; when the A-axis angle is 0°, as shown in formula (11), 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, that is, the tool axis is in a singular state. At this time, the expression of the tool axis vector is calculated using formula (12), and the tool axis vector (O x ,O y ,O z )=(0,0,1);
[0074] For the S specimen, the identified singular tool location of the machine tool is as follows Figure 5 As shown in the figure, the tool position corresponding to the G code on line 348 belongs to the singular point of the machine tool. From the G code coordinate value, the tool position corresponding to the code on lines 344-347 belongs to the singular area. The feed of the A axis and the C axis is 0. In this processing section, the logical position of the C axis changes from 26.567 degrees to 14.032 degrees. The G code coordinate information is as follows:
[0075] N343 G1 X160.064 Y82.171 Z.007A-.039 C26.567 F5000.
[0076] N344 G1 X158.186 Y89.486 Z0.0 A0.0F5000.
[0077] N345 G1 X156.474 Y96.335 F5000.
[0078] N346 G1 X155.371 Y100.746 F5000.
[0079] N347 G1 X154.013 Y106.181 F5000.
[0080] N348 G1 X153.32 Y108.952 Z.004A.025 C14.032 F5000.
[0081]
[0082] 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;
[0083] 3.3) Determine whether it is the rotating shaft speed exceeding the cutter position: At the rotating shaft speed exceeding the cutter position, the rotating shaft speed exceeds the maximum speed allowed by the servo drive, and the cutter shaft nonlinear error exceeds the accuracy requirement; to determine the speed exceeding the cutter position, it is necessary to first calculate the nonlinear deviation, and the nonlinear error is coupled with the chord height error to obtain the contour error. The relationship between the nonlinear error and the contour error is as follows: Figure 6 As shown in the figure, it can be seen that to calculate the nonlinear error, it is necessary to find out the distance between the machining path of two adjacent G code tool positions in theory and the actual tool path. Therefore, according to the tool axis vectors at the first and last tool positions, the tool axis vectors at the intermediate positions of theory and reality are calculated. The distance between the tool axis vectors at the two intermediate positions is the nonlinear error. Then, according to the comparison between the nonlinear error and the allowable value, it can be judged whether the abnormal feed tool position of the rotary axis is the tool position where the rotary axis speed exceeds the limit. The specific calculation process is as follows: first, the abnormal feed tool position P of the rotary axis is calculated. i , and the previous knife position P i-1 , calculate the tool axis vector, as shown in formula (13), specifically calculate according to formula (14) to obtain the tool axis vector at the middle position of the surface under ideal conditions, in addition, according to the linear interpolation principle, calculate the tool axis vector at the middle position of the two tool positions, as shown in formula (15), then, according to the geometric relationship between the height of the nonlinear error and the tool length, use formula (16) to calculate the nonlinear error, and finally compare it with the allowable value of the nonlinear deviation of the machining surface [H3], and then judge whether it is a nonlinear rotation axis speed exceeding the tool position; Figure 7 The two intermediate position tool axis vectors and the process of calculating the nonlinear error using the intermediate position tool axis vector are described. For the S specimen, after characteristic analysis, 19 tool position locations where the rotation axis speed exceeds the limit are found. The tool position locations are as follows: Figure 8 The tool position coordinate information is shown in Table 3 below;
[0084]
[0085] Where K1 is the tool axis vector of the abnormal feed tool position of the rotary axis, K2 is the tool axis vector of the line before the abnormal feed tool position of the rotary axis, K3 is the tool axis vector of the middle position of the ideal surface, K4 is the tool axis vector of the middle position between the two tool positions, H3 is the nonlinear deviation, L is the tool length, and α is the angle between K3 and K4.
[0086] Table 3 G codes for the tool position where the rotation axis speed exceeds the limit for the S-shaped specimen
[0087]
[0088]
[0089] 4) Correction of abnormal feed tool position of rotary axis: Based on the three identification methods of abnormal feed tool position of rotary axis, different correction methods are proposed:
[0090] 4.1) Correction of incorrect tool position points selected by multiple solutions: In the discretized machining trajectory, each tool position point corresponds to two sets of rotation axis coordinate solutions, where 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 incorrect tool position points by multiple solutions, the A-axis coordinate is inverted and the C-axis coordinate jump is 180°. The specific embodiment correction process is as follows: two incorrect tool position points selected by multiple solutions are corrected. The first one is corrected by formula (18) and the second one is corrected by formula (17), so that the rotation axis feed amount between the two adjacent tool position points is reduced after correction. The corrected G code is shown in Table 4 below. The rotation axis speed and tool feed speed are improved after correction, as shown in Table 4. Figure 9 and Figure 10 As shown in the figure, from the comparison of the speed before and after correction, the correction method can effectively reduce the speed fluctuation, the speed no longer approaches the limit speed, and the speed curve of the adjacent processing section is smoother. From the perspective of the change in tool feed speed, the feed speed of the wrong tool position selected by the multiple solutions will be sharply reduced to 0 before correction. After correction, the tool feed speed is significantly improved, the tool feed fluctuation of the adjacent processing section is reduced, and the feed stability is effectively improved. In addition, from Figure 11 Comparison of the tool axis swept surface before and after correction shows that there are two obvious bulges on the tool axis swept surface before optimization. After optimization, the bulges on the tool axis swept surface disappear, the machining trajectory becomes smoother, and the surface quality of the workpiece is improved.
[0091]
[0092] Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values;
[0093] Table 4 G code after correction of incorrect tool position points selected by multiple solutions for S-shaped specimen
[0094]
[0095] 4.2) Correction of singular tool position of machine tool: Figure 1 and Figure 2 The rotation speed and tool feed speed change diagram show that at the singular tool position of the machine tool, 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 of the machine tool, 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 seen that in the tool position file, several tool positions before the singular tool position are singular points. According to the differential motion formula (11) of the tool axis vector, at the singular point, the tool axis direction is not affected by the C-axis coordinate. Therefore, according to the total feed amount of the C-axis in the singular area, the C-axis coordinate value of the singular point is reconstructed, which can improve the abnormal situation of the rotary axis feed without changing the tool axis direction. The G code of the singular area of the S specimen is corrected and the expansion is calculated according to formula (2). Linear displacement, as shown in formula (19); then, the theoretical feed time between adjacent tool positions is calculated, as shown in formula (20); since the correction target is to make the C-axis feed speed change small, that is, the C-axis feeds at a uniform speed under ideal conditions, the C-axis is assumed to rotate at a uniform speed, and the total feed amount of the n+1 rows of C-axis is calculated to reconstruct the C-axis coordinates of the singular tool position of the machine tool, as shown in formula (21). The corrected G code coordinate information is shown in Table 5. After changing the C-axis coordinates, the abnormal tool position is effectively optimized. Comparing the speed and tool feed speed changes before and after the correction, the speed of the rotating axis in the singular area before the correction will change sharply, close to the limit speed. After the C-axis coordinate correction, the speed is significantly optimized, and the speed fluctuation of the tool position in the singular area is reduced. From the perspective of tool feed speed, the correction can reduce the change of tool feed speed, and even maintain the specified feed speed for processing, as shown in Figure 9 and Figure 10 As shown;
[0096]
[0097] 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 corrected C-axis coordinate value of the machine tool singular point;
[0098] Table 5 G code after correction of the singular tool position of the S-shaped specimen machine tool
[0099]
[0100] 4.3) Correction of tool position where the rotation axis speed exceeds the limit: According to the determination method of tool position where the rotation axis speed exceeds the limit, when the tool position where the speed exceeds the limit appears, not only the rotation axis speed reaches the upper limit, but it may even cause a bias in the machining process, and the nonlinear error exceeds the allowable value. Therefore, the tool position where the speed exceeds the limit must be corrected. On the one hand, the maximum allowable nonlinear error of the workpiece must be calculated, and then the coordinate values of each axis of the tool position must be reconstructed to correct the tool position where the rotation axis speed exceeds the limit. According to the expression for determining whether the nonlinear error exceeds the tolerance, it can be obtained that the nonlinear error formula is a function of the coordinates of the A-axis and C-axis of the two tool positions of the rotation axis, as shown in formula (22). Calculate the tool position where the speed exceeds the limit P i With P i-1 The tool axis vector between the planes is formed, as shown in formula (23). On this basis, the intermediate tool axis vector is reconstructed according to formula (24), and the reconstructed tool position point tool axis vector is a function of the characteristic parameter m, as shown in formula (25). The reconstructed tool axis vector is used as the final tool axis vector and substituted into formula (22). The nonlinear error is a function of the characteristic parameter m, as shown in formula (26). Then, according to the relationship between the nonlinear error and the contour error, the allowable value of the nonlinear error is calculated, and the characteristic parameter m is inversely calculated, as shown in formula (27). The coordinate value of the reconstructed rotation axis is calculated according to formula (28). Since the feed ratio of each axis between adjacent tool positions is approximately a constant, as shown in formula (29), the coordinate value of the reconstructed linear axis is calculated according to formula (30). Finally, the tool feed speed is corrected according to formula (31).
[0101]
[0102] [H1]=[H3]+[H2] (27)
[0103]
[0104] In the formula, the initial tool axis vector is set to The final tool axis vector is set to H3 is the nonlinear error, H2 is the chord height error, H1 is the profile error, It is expressed as a function of the coordinate values of the rotation axis of the two tool positions, m is the characteristic parameter, is the tool axis vector after reconstruction of the intermediate tool position, x 重构 ,y 重构 ,z 重构 , It is represented by the coordinate value of each axis after the tool position is reconstructed, k is the approximate value of the feed rate of each axis, F 重构 is the reconstructed tool feed rate.
[0105] Example 2, taking a certain wheel hub as an example, compared with Example 1, a five-axis CNC machining G code rotary axis abnormal feed tool position identification and correction method has the following differences: Step 2) When the rotary axis abnormal tool position is determined, 5 rotary axis abnormal feed tool positions appear, all of which belong to the rotary axis speed exceeding the tool position; Step 3.3) When judging whether it is the rotary axis speed exceeding the tool position, the G code is as follows. In this processing area, the feed amount of the rotary axis is large. The G code has a total of 5 lines. The A axis changes from -11.8495 degrees to -7.5925 degrees, and then changes to -13.6960 degrees. The C axis changes from 272.2918 degrees to 170.2152 degrees. The total length of the processing trajectory is 1.033 mm. According to the G code coordinates, the processing trajectory and the tool axis sweep surface are extracted, as shown Figure 12 As shown in the figure, during linear interpolation, the coordinates of the command points are linearly distributed, and the nonlinear error of the actual surface is approximately symmetrically distributed. Between adjacent tool positions, the actual machining surface is an approximately symmetrical arched surface. When the rotary axis speed exceeds the tool position limit, there is an offset in the tool axis sweep surface between adjacent tool positions. The essence of the offset is the nonlinear deviation of the tool axis vector. In the defect-free machining section, the feed rate of the rotary axis is small, and the nonlinear deviation is only on the order of tens of microns.
[0106] N55 G1 X7.7872 Y.7391 Z-29.9787 A-11.8495 C272.2918
[0107] N56 G1 X7.6641 Y.6248 Z-29.9864 A-9.4556 C259.9482
[0108] N57 G1 X7.4231 Y.3949 Z-29.9912 A-7.5925 C215.3108
[0109] N58 G1 X7.1857 Y.1606 Z-29.9815 A-11.0285 C178.9434
[0110] N59 G1 X7.0677 Y.0409 Z-29.9716 A-13.6960 C170.2152;
[0111] Step 4.3) When correcting the tool position where the rotation axis speed exceeds the limit, the abnormal tool position where the rotation axis speed exceeds the limit in a hub component in the above embodiment 2 is corrected. The allowable value of nonlinear error is 60 μm, and the maximum nonlinear error of the tool axis of the original tool position is 1.748 mm. After optimization, the G code coordinates of the 5 tool positions where the rotation axis speed exceeds the limit are reconstructed to obtain 126 new tool positions. Some tool position information is shown in Table 6 below. At this time, the nonlinear error is distributed in the range of 50-57 μm, which meets the accuracy requirements of the part surface, and the tool axis sweep surface is smoother. Figure 13 As shown in the figure, before the correction, the tool feed speed was low. Although the feed process of each processing section was smooth, the feed speed would drop sharply to 0 and then change sharply to the set tool feed speed. After correcting the tool position where the rotary axis speed exceeded the limit, the tool feed speed of each processing section was significantly optimized and greatly improved, with a maximum increase of 70mm / min. At the same time, the speed fluctuation was significantly reduced, and the processing process was smoother.
[0112] Table 6 G code after correction of the tool position of the hub component's rotating shaft speed exceeding the limit
[0113]
[0114]
Claims
1. A method for identifying and correcting abnormal feed tool position points of a five-axis CNC machining G-code rotary axis, characterized in that: The following steps are involved: 1) Extract the coordinate data of the X-axis, Y-axis, Z-axis, A-axis, and C-axis from the G code; 2) Determination of abnormal feed tool position of rotary axis; The step 2) is specifically as follows: calculate the feed rate of each axis by using the coordinate data extracted in step 1), and then calculate the rotation speed and extension line displacement of the rotating axis during the processing; suppose a series of consecutive adjacent tool positions in the G code are P1, P2, P3...P i ,P n-1 ,P n , the i-th point is Its previous point, i-1th point, is The i+1th point is Calculate the motion speed according to formula (1), calculate the extension line displacement according to formula (2), combine the above formulas (1) and (2), and establish the relationship formula (3) between the rotation axis speed, G code coordinates, and preset feed speed. Evaluate the feed state of the tool position point according to formula (4). If formula (4) is not satisfied, the tool position point P is determined to be i Abnormal feed tool position of the rotary axis; Where, t i is the processing time, F0 is the feed speed, v Ai , v Ci is the rotational speed of the rotating shaft, ΔX i , ΔY i , ΔZ i , is the feed amount of each feed axis, Δs is the expansion line displacement, a1 and a2 are the coefficients for converting angle into displacement length, and v Amax The maximum rotation speed of the rotating shaft allowed by the servo drive system. is the A-axis coordinate value at the tool position point, is the C-axis coordinate value of the tool position point, Δθ is the angle change between two adjacent tool position points; 3) Determination of the abnormal feed tool position type of the rotary axis; 4) Correction of abnormal feed tool position of rotary axis.
2. The method according to claim 1, characterized in that The step 1) is specifically as follows: removing the address characters in the dimension characters from the G code .nc format file, and separating and extracting the coordinate data of the X axis, Y axis, Z axis, A axis, and C axis.
3. The method according to claim 1, characterized in that The step 3) is specifically as follows: classify and judge based on the characteristics of the three types of abnormal feed tool positions of the rotary axis: 3.1) Determine whether the wrong tool position point is selected due to multiple solutions: The tool axis vector is calculated by the screw theory, as shown in formula (5). When the rotation axis coordinates are inversely calculated according to the screw theory, there are two solutions corresponding to the range of the A-axis and C-axis travel, as shown in formula (6) and formula (7). i , need to be consistent with the previous row of tool positions The rotation axis coordinates are compared; first identify the interval of the C axis coordinate value of the abnormal feed tool position of the rotation axis, and when the C axis coordinate value of the abnormal feed tool position of the rotation axis is When , use formula (8) to determine whether the abnormal knife point is a wrong knife point selected by multiple solutions; When the rotary axis feeds the tool position abnormally, the C-axis coordinate value Formula (9) is used to determine whether the abnormal feed tool position of the rotary axis is a multi-solution selection error tool position. When formula (8) or formula (9) is satisfied, the abnormal feed tool position P i That is, multiple solutions select the wrong tool position point. If both formulas are not satisfied, the abnormal feed tool position point P i It does not belong to the wrong knife point selection in multiple solutions; Where, (O x ,O y ,O z ) is the tool axis vector, O x is the coordinate value of the tool axis vector on the X axis, O y is the coordinate value of the tool axis vector on the Y axis, O z is the coordinate value of the tool axis vector on the Z axis, are two A-axis rotation angle values calculated based on the inverse transformation of the tool axis vector. are two C-axis rotation angle values calculated based on the 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; 3.2) Determine whether it is a singular tool position of the machine tool: For the tool axis vector in a singular position, there are infinitely many groups of solutions corresponding to the two rotating axes. The extremely small swing of the tool axis vector will cause the two rotating axes to rotate in a large range. The tool axis vector calculation is analyzed from the differential angle, as shown in formula (10). 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 (11). The expression of the tool axis vector at this time is calculated according to formula (12). Select the abnormal tool position P with an A-axis rotation angle of 0°. i , calculate the tool axis vector to determine whether it is a machine tool singularity point; in addition, the front and back of this tool position point must be determined; 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; 3.3) Determine whether the rotation axis speed exceeds the limit of the tool position: To determine whether the speed exceeds the limit of the tool position, it is necessary to first calculate the nonlinear deviation. The nonlinear error is coupled with the chord height error to obtain the contour error. To calculate the nonlinear error, it is first necessary to calculate the abnormal feed tool position P of the rotation axis. i , and the previous knife position P i-1 Extract the coordinate information and calculate the tool axis vectors of the two tool positions respectively, as shown in formula (13). According to formula (14), calculate the tool axis vector of the middle position of the surface under ideal conditions. In addition, according to the linear interpolation principle, calculate the tool axis vector of the middle position of the two tool positions, as shown in formula (15). Then, calculate the nonlinear error according to formula (16) and compare the allowable value of nonlinear deviation of the machining surface [H3] to determine whether it is a tool position where the rotation axis speed exceeds the limit due to nonlinear deviation. Where K1 is the tool axis vector of the abnormal feed tool position of the rotary axis, K2 is the tool axis vector of the line before the abnormal feed tool position of the rotary axis, K3 is the tool axis vector of the middle position of the ideal surface, K4 is the tool axis vector of the middle position between the two tool positions, H3 is the nonlinear deviation, L is the tool length, and α is the angle between K3 and K4.
4. The method according to claim 1, wherein step 4) specifically comprises: using different correction methods according to the identification characteristics of the three abnormal feed positions of the rotary axis: 4.1) Correction of incorrect knife point selection by multiple solutions: For incorrect knife point selection P i , when the C-axis coordinate value of the defective tool position When , use formula (17) to correct; when the C-axis coordinate value of the defective tool position Formula (18) is used to correct the multiple solutions and select the wrong knife position; Where θ A修正 ,θ C修正 are the corrected A-axis and C-axis coordinate values; 4.2) Correction of singular tool position of machine tool: Extract coordinate information of singular tool position And the coordinate information of the singular points in the first n lines of G code The extension line displacement is calculated according to formula (2), as shown in formula (19); then, the theoretical feed time between adjacent tool positions is calculated, as shown in formula (20); finally, assuming that the C axis rotates at a constant speed, the total C axis feed of the n+1 rows is calculated, and the C axis coordinates of the singular tool position of the machine tool are reconstructed, 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 corrected C-axis coordinate value of the machine tool singular point; 4.3) Correction of tool position when the rotation axis speed exceeds the limit: Based on the expression for determining whether the nonlinear error exceeds the tolerance, the nonlinear error formula is a function of the coordinates of the two tool positions of the rotation axis, A axis and C axis, as shown in formula (22); calculate the tool position P when the speed exceeds the limit i With P i-1 The tool axis vector between the planes is formed, as shown in formula (23). On this basis, the intermediate tool axis vector is reconstructed according to formula (24), and the reconstructed tool position point tool axis vector is obtained as a function of the characteristic parameter m, as shown in formula (25); the reconstructed tool axis vector is used as the final tool axis vector and substituted into formula (22), and the nonlinear error is obtained as a function of the characteristic parameter m, as shown in formula (26); then, according to the relationship between the nonlinear error and the contour error, the allowable value of the nonlinear error is calculated, and the characteristic parameter m is inversely calculated, as shown in formula (27); then, the coordinate value of the reconstructed rotation axis is calculated according to formula (28); since the feed ratio of each axis between adjacent tool positions is approximately a constant, as shown in formula (29); therefore, the coordinate value of the reconstructed linear axis is calculated according to formula (30); finally, the tool feed speed is corrected according to formula (31); In the formula, the initial tool axis vector is set to The final tool axis vector is set to H3 is the nonlinear error, H2 is the chord height error, H1 is the profile error, It is expressed as a function of the coordinate values of the rotation axis of the two tool positions, m is the characteristic parameter, is the tool axis vector after reconstruction of the intermediate tool position, x 重构 ,y 重构 ,z 重构 , It is represented by the coordinate value of each axis after the tool position is reconstructed, k is the approximate value of the feed rate of each axis, F 重构 is the reconstructed tool feed rate.
Citation Information
Patent Citations
A Method and Its Application of Obtaining Machining Feature Points in Tool Trajectory
CN104656558B
Defect cutter location point identification method based on flaw type
CN115016394A