CNC machining method and system based on dynamic error compensation

By using a three-axis CNC machine tool for preliminary machining and an online detection system to compensate for multi-axis CNC machine tools in real time, the problem of cross-process error compensation in high-precision manufacturing is solved. This method realizes dynamic error mapping and real-time compensation from the workpiece's external shape to its internal cavity, thereby improving machining accuracy and consistency.

CN122274752APending Publication Date: 2026-06-26GUANGDONG EVERWIN PRECISION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG EVERWIN PRECISION TECH CO LTD
Filing Date
2026-05-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies are insufficient to achieve cross-process, real-time adaptive error compensation in high-precision manufacturing. This results in irregular tool marks caused by vibrations when machining the surface of a three-axis CNC machine tool, and misalignment between processes when machining a multi-axis CNC machine tool, failing to meet the requirements for A-grade appearance quality and machining dimensional stability.

Method used

The workpiece's shape and reference surface are initially machined using a three-axis CNC machine tool. The reference surface error is detected by an online detection system and converted into a macro variable of the multi-axis CNC machine tool for real-time compensation, thereby realizing dynamic error mapping and real-time compensation from the workpiece's shape to its internal cavity.

Benefits of technology

It eliminates the misalignment defects of internal and external features of workpieces, improves the assembly accuracy of workpieces and the consistency of batch processing of multiple processes, ensures A-level appearance quality, reduces reliance on manual debugging, and improves the level of automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122274752A_ABST
    Figure CN122274752A_ABST
Patent Text Reader

Abstract

This invention discloses a CNC machining method and system based on dynamic error compensation. The machining method includes: machining the workpiece blank's shape and reference surfaces using a first CNC machine tool to obtain an intermediate workpiece blank; removing the intermediate workpiece blank from the first CNC machine tool and fixing it on a second CNC machine tool; detecting and positioning each reference surface of the intermediate workpiece blank, and compensating the coordinates of the machining points on the second CNC machine tool based on the detection results; and the second CNC machine tool completing the machining of the workpiece's internal features based on the compensated coordinates. This invention achieves dynamic error mapping and real-time compensation from the workpiece's shape to its internal features, thereby correcting the machining trajectory in real time based on the actual shape of the intermediate workpiece blank, eliminating large and small side misalignment defects, improving workpiece assembly accuracy, and enhancing the dimensional consistency and product yield of multi-process batch processing. It can be applied to CNC machining scenarios for 3C structural parts and aerospace precision components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CNC machining, and in particular relates to a CNC machining method and system based on dynamic error compensation. Background Technology

[0002] In the field of high-end precision manufacturing, the structures of products such as 3C electronic product structural components and aerospace precision parts are becoming increasingly complex. The cutting and machining of their complex features such as internal cavities, irregular shapes and side holes requires the use of four-axis CNC machine tools or multi-axis CNC machine tools with more than four axes. As the requirements for appearance quality and dimensional accuracy control continue to increase, if the A-grade appearance surface of the workpiece is processed in a multi-axis machine tool process, the rotation axis of the multi-axis equipment is prone to vibration during operation, which will form messy tool marks and vibration marks on the appearance surface, seriously reducing the surface finish and failing to meet the stringent standards of high flatness, uniform tool marks and no defects for the A-grade appearance surface. On the other hand, if a three-axis CNC machine tool is used to process the appearance of the workpiece and a multi-axis CNC machine tool is used to process the internal cavity of the workpiece, the cumulative effects of fixture clamping errors, machine tool geometric errors, and processing thermal deformation will cause inconsistent benchmarks and misalignment between the preceding and following processes, which will easily lead to problems such as misalignment of internal and external features of the workpiece and out-of-tolerance of large and small edges. Although some solutions use error compensation methods, they are mostly limited to single-machine single-process compensation or offline compensation, and have not yet formed a complete solution for cross-process, real-time adaptive, and systematic compensation, making it difficult to simultaneously meet the requirements of high A-grade appearance quality, processing dimensional stability and automated mass production. Summary of the Invention

[0003] In view of the shortcomings of the prior art, the technical problem to be solved by the present invention is to provide a CNC machining method and system based on dynamic error compensation.

[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solution: A CNC machining method based on dynamic error compensation includes the following steps: S1. Take a workpiece blank and use a first CNC machine tool to process the workpiece blank in terms of shape and reference surface to obtain an intermediate workpiece blank. S2. Remove the intermediate workpiece blank from the first CNC machine tool and fix it on the second CNC machine tool; S3. Detect and locate each reference surface of the workpiece intermediate blank, and compensate the coordinates of the machining points of the second CNC machine tool according to the detection results; S4. The second CNC machine tool completes the machining of the internal features of the workpiece based on the compensated coordinates.

[0005] Furthermore, step S3 includes the following sub-steps: S310. Detect and locate each reference surface of the intermediate blank of the workpiece, and compare it with the corresponding reference surface in the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. S320: Convert the error value into a macro variable of the second CNC machine tool and inject it into the machining program of the second CNC machine tool in real time; S330 and the second CNC machine tool compensate for the offset of the theoretical coordinates of each machining point in the workpiece machining program according to the injected macro variables, and obtain the actual machining coordinates.

[0006] Furthermore, the first CNC machine tool is a three-axis CNC machine tool, and the second CNC machine tool is a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes.

[0007] Furthermore, the workpiece has a side surface and a top surface and a bottom surface arranged opposite to each other. The top surface is the large surface of the workpiece, and the bottom surface forms a concave inner cavity. The non-concave portion of the bottom surface forms an annular step, and the lower end of the annular step forms a small plane.

[0008] Furthermore, in step S1, a three-axis CNC machine tool is used to form the outer contour of the workpiece's large surface and side surface, as well as the small plane of the workpiece; in step S4, a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes is used to form the internal cavity structure features and side holes of the workpiece.

[0009] Furthermore, the workpiece has four sides, namely a first side and a third side arranged opposite each other in a first horizontal direction, and a second side and a fourth side arranged opposite each other in a second horizontal direction. Each side includes an upper vertical plane and a lower arc-shaped surface. The vertical planes of the first and third sides serve as reference planes for positioning in the first horizontal direction, the vertical planes of the second and fourth sides serve as reference planes for positioning in the second horizontal direction, and the small plane serves as a reference plane for positioning in the vertical direction. In step S310, at least two side probes are configured on each of the four sides, and a bottom probe is configured on the small plane. Error data in the first and second horizontal directions are collected by probes at the side probes, and error data in the vertical direction is collected at the bottom probes to construct a three-dimensional error field.

[0010] Furthermore, in step S1, the cutting tool used by the first CNC machine tool includes a composite forming tool, which includes two levels of cutting edges. The cutting edge shape of the first level of cutting edge is adapted to the side shape of the workpiece and is used to process and form the side contour of the workpiece. The other level of cutting edge is a ring-shaped flat end face cutting edge perpendicular to the tool axis, and the cutting edge end face is a plane, used to process the small plane at the bottom of the workpiece.

[0011] Furthermore, it also includes the following steps: S5. Store the measured error data, compensation parameters, and processing results into the process database.

[0012] A CNC machining system based on dynamic error compensation, including The first CNC machine tool is used to machine the workpiece shape and reference surface on the workpiece blank to obtain the workpiece intermediate blank; The second CNC machine tool is used to machine the internal features of the workpiece on the intermediate blank. The online detection system is used to detect and locate each reference surface of the intermediate blank of the workpiece using probes, and compare it with the corresponding reference surface of the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. A compensation control system, comprising a macro-variable conversion module and a coordinate offset calculation module, wherein the coordinate offset calculation module is used to calculate the coordinate error values ​​of each machining point of the second CNC machine tool based on a three-dimensional error field; the macro-variable conversion module is used to convert the coordinate error values ​​into macro-variables of the second CNC machine tool to offset the theoretical coordinates of each machining point of the second CNC machine tool; and The storage unit is used to store the workpiece theoretical model, actual machining data, error compensation data, and process parameters. The online detection system outputs a three-dimensional error field to the compensation control system; the compensation control system injects macro variables into the second machine tool machining program; the storage unit interacts with each module.

[0013] Furthermore, the first CNC machine tool is a three-axis CNC machine tool, and the second CNC machine tool is a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes.

[0014] This invention breaks through the limitations of traditional single-machine, single-process compensation, realizing dynamic error mapping and real-time compensation from the workpiece's outer shape to its inner cavity. Without altering the existing machine tool structure or process sequence, it achieves adaptive centering through online detection and intelligent program correction. This allows for real-time correction of the machining trajectory based on the actual shape of the workpiece's intermediate blank, eliminating large and small edge misalignment defects and improving workpiece assembly accuracy. Simultaneously, while ensuring A-grade surface finish, it improves the dimensional consistency and product yield of multi-process batch processing, enhances automation, and reduces reliance on manual debugging and trial cutting. It is applicable to CNC machining scenarios for 3C structural components and aerospace precision parts. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1This is a flowchart of an embodiment of the CNC machining method based on dynamic error compensation according to the present invention.

[0016] Figure 2 This is a schematic diagram of the workpiece's structure.

[0017] Figure 3 This is a schematic diagram of the structure of a forged workpiece blank.

[0018] Figure 4 This is a schematic diagram of the structure of a composite forming tool.

[0019] Figure 5 This is a schematic diagram of machining the side surface using the upper cutting edge of a composite forming tool.

[0020] Figure 6 This is a schematic diagram of machining a small facet using the lower edge of a composite forming tool.

[0021] Figure 7 This is a schematic diagram of using a probe to inspect the reference surface of a workpiece intermediate blank.

[0022] Figure 8 This is a schematic cross-sectional view of the region containing the annular steps in the workpiece blank.

[0023] Figure 9 This is a schematic cross-sectional view of the area containing the annular step in the intermediate blank of the workpiece.

[0024] Figure 10 This is a cross-sectional schematic diagram of the area where the annular step is located in the workpiece.

[0025] The diagrams in the instruction manual are labeled as follows: Large surface 110; Small surface 120; Side surface 130; First side surface 131; Second side surface 132; Third side surface 133; Fourth side surface 134; Vertical plane 135; Arc surface 136; Inner cavity 140; Annular notch 141; Rotating shaft notch 150; Annular step 160; Flange 161; Side hole 162; Composite forming tool 200; Tool holder 210; Tool neck 220; Upper cutting edge 231; Lower cutting edge 232; Probe 300. Detailed Implementation

[0026] The following specific examples illustrate the implementation of the present invention. The illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0027] Please see Figure 1 , Figure 1 This is a flowchart of an embodiment of the CNC machining method based on dynamic error compensation according to the present invention. The CNC machining method based on dynamic error compensation in this embodiment includes the following steps: S1. Take a rough workpiece blank and use a first CNC machine tool to machine the workpiece blank's shape and reference surfaces to obtain an intermediate workpiece blank. Since the contour surfaces and reference surfaces of the workpiece have high precision and appearance requirements, most surfaces are required to meet Grade A surface standards; therefore, the first CNC machine tool is generally a three-axis CNC machine tool. Three-axis CNC machine tools have low rotational axis vibration, high tool mark quality, and most machined surfaces can meet Grade A surface standards without grinding.

[0028] Grade A surfaces are the main appearance surfaces that users see first when viewing the product from the front after assembly. They represent the highest quality control surfaces and are the highest-grade appearance surfaces for 3C structural components, aerospace parts, and other workpieces. They have extremely high requirements for flatness, smoothness, dimensional accuracy, and surface shape precision. They must have a delicate feel, be free of bumps or unevenness, tool marks, straight contours, and smooth, stepless rounded corners. Grade A surfaces have zero tolerance for appearance defects. Obvious scratches, dents, burrs, chipped edges, color differences, uneven gloss, dirt, bright or dark spots, shrinkage, deformation, localized collapse, disordered machining patterns, and localized bright or dark areas are strictly prohibited. "Small edges" or "asymmetry" due to process misalignment or clamping errors are not allowed.

[0029] Therefore, Grade A surfaces have strict requirements for blade marks, allowing no joining marks, vibration marks, ripples, or random blade marks. The blade marks must be uniform, consistent in direction, and have a delicate matte or high-gloss texture. However, the messy blade marks generated by multi-axis rotation and vibration cannot directly meet the requirements for Grade A surfaces and require subsequent polishing to achieve the desired finish.

[0030] Therefore, Grade A surfaces require strict control over the grain, gloss, and dimensions. In contrast, Grade B surfaces allow for extremely slight and inconspicuous fine lines, while Grade C surfaces are generally hidden internal surfaces, ensuring only functionality and having virtually no control over appearance.

[0031] The following explanation uses the machining of an electronic device housing as an example. Please refer to [link / reference]. Figure 2 The workpiece has side surfaces 130 and oppositely arranged top and bottom surfaces. The top surface is the large surface 110 of the workpiece. The bottom surface forms a concave cavity 140, and the non-concave portion of the bottom surface forms an annular step 160. The lower end of the annular step 160 forms a small plane 120. The workpiece has four side surfaces 130, which are respectively located in the first horizontal direction (i.e.: Figure 2 and Figure 3 The first side surface 131 and the third side surface 133 are arranged opposite each other in the y-axis direction and in the second horizontal direction (i.e.: Figure 2 and Figure 3The second side surface 132 and the fourth side surface 134 are arranged opposite each other on the x-axis direction. Each side surface 130 includes an upper vertical plane 135 and a lower arcuate surface 136. A pivot notch 150 is also formed on the first side surface 131 to provide installation space for the pivot. The vertical plane 135 of the first side surface 131 and the third side surface 133 serves as a reference plane for positioning in the first horizontal direction, and the vertical plane 135 of the second side surface 132 and the fourth side surface 134 serves as a reference plane for positioning in the second horizontal direction. The small plane 120 serves as a reference plane for positioning in the vertical direction (i.e.: Figure 2 and Figure 3 The reference plane is located on the z-axis direction.

[0032] The workpiece blank used for this project can be formed by forging. Please refer to [link / reference]. Figure 3 The overall shape of the workpiece blank is similar to that of the workpiece, but its four sides 130 (including the first side 131, the second side 132, the third side 133, and the fourth side 134) are all flat. In this step, a three-axis CNC machine tool is used to form the large surface 110 on the top of the workpiece, the outer contours of the four sides 130, and the small surface 120 on the bottom of the workpiece. This allows for the machining of an arc-shaped surface 136 on the lower part of the side 130, ensuring that the large surface 110, the four sides 130, and the small surface 120 all meet the Class A surface standard. This gives the exposed surfaces of the workpiece (including the large surface 110 and the four sides 130) a good texture and ensures the accuracy of subsequent inspection when the vertical plane 135 of the four sides 130 and the small surface 120 are used as reference surfaces.

[0033] In this step, when performing CNC machining on the workpiece blank, a composite forming tool 200 can also be used, allowing the machining of the outer contours of the four sides 130 and the small plane 120 at the bottom to be completed with a single tool. Please refer to [link / reference]. Figure 4 The composite forming tool 200 includes two-stage cutting edges. It also includes a tool holder 210 and a cutting neck 220. The tool holder 210 can be a cylindrical straight shank structure for clamping and fixing with the CNC machine tool spindle, transmitting torque and axial feed. The cutting neck 220 can be a tapered transition structure for connecting the tool holder 210 and the cutting edges, providing rigid support and clearance space. The two-stage cutting edges are an upper cutting edge 231 and a lower cutting edge 232 arranged coaxially. The cutting edges of the two stages are distributed along the tool axial direction and have different radial profiles.

[0034] The upper cutting edge 231, located immediately adjacent to the neck 220, is the first-stage cutting edge of the tool. The upper cutting edge 231 employs a large-diameter cutting edge, and its radial profile perfectly matches the theoretical dimensions and angles of the workpiece side surface 130, used to machine the profile forming the workpiece side surface 130. Please refer to [link / reference]. Figure 5The main cutting edge of the upper cutting edge 231 is a continuous forming contour cutting edge, designed according to the machining depth of the contour of the workpiece side 130. It corresponds 1:1 to the shape of the 3D surface and sidewall of the workpiece side 130 contour, without segmented tool joint structure. The large-diameter cutting edge has high cutting efficiency and can directly machine the contour of the workpiece side 130, completing the machining of the workpiece side 130 contour in one pass, reducing the number of tool passes, avoiding the problem of inconsistent tool marks caused by multiple cuts, and realizing the forming of the contour of all four sides 130 of the workpiece in one pass. The continuous forming design of the cutting edge can ensure that the tool marks of the workpiece side 130 are free of tool marks, meeting the A-level surface appearance quality requirements of the four sides 130.

[0035] The lower cutting edge 232 is the second-stage cutting edge, located at the bottom of the composite forming tool 200, and coaxially arranged with the upper cutting edge 231. Please refer to [link / reference]. Figure 6 The lower cutting edge 232 adopts a ring-shaped straight end face cutting edge, and the cutting edge end face is flat, used to machine the small plane 120 at the bottom of the workpiece. The lower cutting edge 232 adopts a small diameter cutting edge, and its flat forming cutting edge is straight and perpendicular to the tool axis. The cutting load of the small diameter cutting edge is small, and it is not easy to deform when machining the reference surface, which can ensure the flatness and perpendicularity accuracy of the reference surface; thus ensuring that the reference flatness of the machined small plane 120 is high, providing a unified and high-precision positioning reference for subsequent multi-axis machining processes.

[0036] The composite forming tool 200, through its coaxial design of two-stage cutting edges, can complete the machining of the contour of the side 130 and the bottom small plane 120 of the workpiece in one clamping, which can eliminate the reference error caused by multi-process clamping, while ensuring the machining quality of the appearance surface.

[0037] S2. Remove the intermediate workpiece blank from the first CNC machine tool and fix it on the second CNC machine tool. The second CNC machine tool is generally a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes. Although three-axis CNC machine tools have the advantages of low rotary axis vibration and high tool mark quality, they have fewer axes and cannot process some internal features. Therefore, a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes is required to complete the processing.

[0038] Because the intermediate workpiece blank is transferred across equipment in this step, misalignment between processes can occur. The main causes of this misalignment generally include fixture errors, machine tool geometric errors, and the cumulative effect of thermal deformation. This leads to misalignment of the workpiece's internal and external features (large and small edges), affecting assembly and appearance. Traditional alignment methods rely on high-precision fixtures and manual trial cutting, resulting in low efficiency and poor consistency. While some error compensation methods are currently used, they are mostly limited to single-machine, single-process, or offline compensation, and a complete solution for cross-process, real-time adaptive, and systematic compensation has not yet been formed.

[0039] S3. Detect and locate each reference surface of the workpiece intermediate blank, and compensate the coordinates of the machining points on the second CNC machine tool based on the detection results. This step may include the following sub-steps: S310, please refer to Figure 7 The system detects and positions each reference surface of the intermediate blank of the workpiece, and compares it with the corresponding reference surfaces in the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. In this embodiment, an online detection system is installed on the second CNC machine tool. Taking the processing of the electronic device housing workpiece as an example, at least two side probes are configured on each of the four sides 130 of the workpiece. For example, two side probes can be configured on one side 130, or three or more side probes can be configured. Bottom probes are configured on the small plane 120. One bottom probe can be configured on the small plane 120 for each side probe. Of course, other methods can also be used to configure the bottom probes, as long as the position of the small plane 120 can be accurately detected. At each side probe point and bottom probe point, a probe 300 is used for detection. The probe 300 can be a ruby ​​probe 300. Error data in the first and second horizontal directions are collected at the side probe points, and error data in the vertical direction is collected at the bottom probe point, constructing a three-dimensional error field containing ΔX, ΔY, and ΔZ. Here, ΔX, ΔY, and ΔZ represent the error values ​​in the x-axis, y-axis, and z-axis directions of the three-dimensional error field, respectively.

[0040] S320. Convert the error value into a macro variable (such as R parameter, variable) of the second CNC machine tool and inject it into the machining program of the second CNC machine tool in real time, so as to compensate for the offset of each machining point in the machining program of the workpiece.

[0041] The S330 and the second CNC machine tool compensate for the offset of the theoretical coordinates of each machining point in the workpiece's machining program based on the injected macro variables, thus obtaining accurate actual machining coordinates. The compensation formula for the theoretical coordinates of the machining points is: X_actual = X_program + ΔX Y_actual = Y_program + ΔY Z_actual = Z_program + ΔZ Wherein, X_program, Y_program, and Z_program are the theoretical machining coordinates of the machining points on the x-axis, y-axis, and z-axis in the machining program of the second CNC machine tool, respectively, and X_actual, Y_actual, and Z_actual are the actual machining coordinates of the machining points on the x-axis, y-axis, and z-axis after machining point compensation.

[0042] S4. The second CNC machine tool completes the machining of the internal features of the workpiece based on the compensated coordinates. This allows for collaborative machining using the actual workpiece shape formed by the three-axis CNC machine tool as a unified benchmark, effectively avoiding problems such as workpiece misalignment, shape variations, and substandard finished product appearance and dimensions caused by inter-process alignment deviations. Due to the complex internal cavity structure and high degree of feature irregularity of the workpiece, ordinary three-axis CNC machine tools cannot complete the cutting and forming of complex internal cavities 140, side holes, and other special structures. Therefore, depending on the complexity of the internal features, a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes is required for machining. Taking the electronic device housing as an example, in this step, a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes is needed to machine the internal cavity 140 structural features and the side holes 162 of the workpiece.

[0043] Please see Figure 8 The figure shows a cross-sectional view of the region containing the annular step 160 in the workpiece blank. As can be seen, the thickness of the annular step 160 is uniform throughout, resulting in a relatively wide facet 120. Please refer to [link / reference]. Figure 9 This is a cross-sectional view of the area containing the annular step 160 in the intermediate blank of the workpiece after the contour of the side 130 has been formed (i.e., after machining using a three-axis CNC machine tool). At this time, because an arc-shaped surface 136 is formed at the lower part of the side 130, the thickness of the lower end of the annular step 160 becomes thinner, and the small plane 120 becomes narrower. At this time, the small plane 120 is difficult to grind, and grinding can easily cause the lower end of the annular step 160 to collapse. However, in this embodiment, because the small plane is CNC machined using a three-axis CNC machine tool, the small plane 120 that meets the A-grade surface standard can be directly formed, thereby eliminating the grinding step and avoiding the collapse phenomenon.

[0044] Please see Figure 10 This is a cross-sectional view of the area where the annular step 160 is located after the workpiece has been machined (i.e., after machining using a four-axis CNC machine tool or a multi-axis CNC machine tool with more than four axes). At this time, an annular notch 141 is formed on the inner side of the lower end of the annular step 160, thus forming a very thin flange 161 at the lower end of the annular step 160. The small plane 120 is formed at the lower end of the flange 161, and its width has become very narrow, only about 0.2-0.3mm. If there is a machining error in the workpiece, the flange 161 will become thinner or even break, thus making the support strength of the flange 161 not meet the design requirements.

[0045] To facilitate analysis of the workpiece's machining process and thus improve the workflow, the following steps can also be performed: S5. Store the measured error data, compensation parameters, and processing results into the process database for subsequent process optimization and error trend analysis.

[0046] This embodiment has the following beneficial effects: (1) In this embodiment, by detecting and positioning the reference surface of the workpiece intermediate blank, dynamic error mapping and real-time compensation across the workpiece outer shape machining to the inner cavity 140 machining can be realized. This breaks the technical limitation of traditional error compensation being limited to single machine, single process and offline compensation, and solves the problem of inter-process deviation caused by the accumulation of multiple factors such as fixture assembly error, machine tool geometric error and machining thermal deformation.

[0047] (2) This embodiment does not require modification of the existing CNC machine tool hardware structure and the original process sequence of the workpiece. By relying on online detection and acquisition of measured data and intelligent correction of the processing program, the adaptive and precise alignment of the internal and external structural features of the workpiece can be achieved, eliminating defects such as large and small sides, misalignment and displacement of the workpiece from the root, and greatly improving the structural symmetry of the workpiece and the subsequent assembly and fitting accuracy of the whole machine.

[0048] (3) In this embodiment, a three-axis machine tool is used to complete the A-level appearance surface machining of the workpiece, and a multi-axis machine tool is used to complete the 140 structure machining of the inner cavity. This can avoid the tool marks and vibration marks caused by the vibration of the rotating axis of the multi-axis machine tool. While ensuring the surface quality and smoothness of the A-level appearance surface to a high standard, it can significantly improve the dimensional consistency, product yield and overall automation level of multi-process batch processing, and reduce the reliance on manual debugging and trial cutting.

[0049] This invention also discloses a CNC machining system based on dynamic error compensation. A preferred embodiment of the CNC machining system based on dynamic error compensation includes a first CNC machine tool, a second CNC machine tool, an online detection system, a compensation control system, and a storage unit. The first CNC machine tool is used to machine the workpiece shape and reference surface on the workpiece blank. Since the workpiece shape and reference surface have extremely high requirements for flatness, smoothness, dimensional accuracy, and surface shape accuracy, the first CNC machine tool is preferably a three-axis CNC machine tool with relatively small rotary axis vibration.

[0050] The three-axis CNC machine tool can use a composite forming tool 200 to facilitate the processing of... Figure 2The rough blank of the electronic device housing is CNC machined. The composite forming tool 200 may include a tool holder 210, a tool neck 220, and two-stage cutting edges, which may be an upper cutting edge 231 and a lower cutting edge 232 arranged coaxially. The upper cutting edge 231 adopts a large-diameter cutting edge, and its radial profile is perfectly matched with the theoretical dimensions and angles of the profile of the workpiece side 130, and is used to machine the profile of the workpiece side 130. The large-diameter cutting edge has high cutting efficiency and can directly machine the profile of the workpiece side 130, completing the machining of the profile of the workpiece side 130 in one pass, reducing the number of tool passes, avoiding the problem of inconsistent tool marks caused by multiple cuts, and realizing the forming of the profile of the four side 130s of the workpiece in one pass. The continuous forming design of the cutting edge can ensure that the tool marks of the workpiece side 130 are seamless, meeting the A-level surface appearance quality requirements of the four side 130s.

[0051] The lower cutting edge 232 is coaxially arranged with the upper cutting edge 231, and adopts a ring-shaped straight end face cutting edge with a flat end face. It is used to machine the small plane 120 at the bottom of the workpiece. The lower cutting edge 232 adopts a small diameter cutting edge, and its flat forming cutting edge is straight and perpendicular to the tool axis. The cutting load of the small diameter cutting edge is small, and it is not easy to deform when machining the reference surface, which can ensure the flatness and perpendicularity accuracy of the reference surface. This ensures that the reference flatness of the machined small plane 120 is high, providing a unified and high-precision positioning reference for subsequent multi-axis machining processes.

[0052] By using a composite forming tool 200 with a two-stage coaxial cutting edge design, a three-axis CNC machine tool can complete the machining of the contour of the side 130 and the bottom small plane 120 of the workpiece in one clamping, which can eliminate the reference error caused by multi-process clamping, while ensuring the machining quality of the appearance surface.

[0053] The second CNC machine tool is used to process the internal features of the workpiece on the intermediate blank of the workpiece. Since the processing of the internal features of the workpiece requires multi-axis coordination, it cannot be completed by a three-axis CNC machine tool. Therefore, the second CNC machine tool can be a four-axis CNC machine tool or a multi-axis CNC machine tool with more than four axes, depending on the requirements.

[0054] The online detection system is used to detect and locate each reference surface of the workpiece intermediate blank through probes 300, and compare it with the corresponding reference surface of the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. Taking the processing of the above-mentioned electronic device housing workpiece as an example, at least two side probes are configured on each of the four sides 130 of the workpiece. For example, two side probes can be configured on one side 130, or three or more side probes can be configured. Bottom probes are configured on the small plane 120. One bottom probe can be configured on the small plane 120 for each side probe. Of course, other methods can also be used to configure the bottom probes. The online detection system is equipped with multiple probes 300, which can be ruby ​​probes 300. At each side probe and bottom probe, a probe 300 is used for detection, thereby collecting error data in the first and second horizontal directions at the side probes and collecting error data in the vertical direction at the bottom probes, constructing a three-dimensional error field including ΔX, ΔY, and ΔZ.

[0055] The compensation control system includes a macro-variable conversion module and a coordinate offset calculation module. The coordinate offset calculation module calculates the coordinate error value (i.e., theoretical coordinate offset) of each machining point of the second CNC machine tool based on the three-dimensional error field and outputs it to the macro-variable conversion module. The macro-variable conversion module converts the coordinate error value into macro variables (such as R parameters, variables) of the second CNC machine tool and injects them into the machining program of the second CNC machine tool in real time. This allows the second CNC machine tool to perform offset compensation on the theoretical coordinates of each machining point in the workpiece machining program based on the injected macro variables, thereby obtaining accurate actual machining coordinates.

[0056] The storage unit is used to store the workpiece theoretical model, actual machining data, error compensation data, and process parameters to facilitate subsequent process optimization and error trend analysis.

[0057] The online detection system outputs a three-dimensional error field to the compensation control system; the compensation control system injects macro variables into the second machine tool machining program; the storage unit interacts with each module.

[0058] This embodiment breaks through the limitations of traditional single-machine, single-process compensation, realizing dynamic error mapping and real-time compensation from the workpiece's outer shape to its inner cavity (140°). Without changing the existing machine tool structure and original process sequence, it can rely on online detection and intelligent program correction to form an adaptive centering mechanism, correcting the machining trajectory in real time based on the actual machining shape, thereby eliminating the problem of misalignment of large and small edges and effectively improving the workpiece assembly accuracy. While strictly ensuring A-grade surface machining quality, it improves the dimensional consistency, product yield, and overall automation level of multi-process batch processing, reducing reliance on manual debugging and trial cutting. It can be used for CNC machining of structural parts for 3C electronic products and precision components for aerospace.

[0059] The above embodiments merely illustrate preferred implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention should be determined by the appended claims.

Claims

1. A CNC machining method based on dynamic error compensation, characterized in that, Includes the following steps: S1. Take a workpiece blank and use a first CNC machine tool to process the workpiece blank in terms of shape and reference surface to obtain an intermediate workpiece blank. S2. Remove the intermediate workpiece blank from the first CNC machine tool and fix it on the second CNC machine tool; S3. Detect and locate each reference surface of the workpiece intermediate blank, and compensate the coordinates of the machining points of the second CNC machine tool according to the detection results; S4. The second CNC machine tool completes the machining of the internal features of the workpiece based on the compensated coordinates.

2. The CNC machining method based on dynamic error compensation as described in claim 1, characterized in that, Step S3 includes the following sub-steps: S310. Detect and locate each reference surface of the intermediate blank of the workpiece, and compare it with the corresponding reference surface in the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. S320: Convert the error value into a macro variable of the second CNC machine tool and inject it into the machining program of the second CNC machine tool in real time; S330 and the second CNC machine tool compensate for the offset of the theoretical coordinates of each machining point in the workpiece machining program according to the injected macro variables, and obtain the actual machining coordinates.

3. The CNC machining method based on dynamic error compensation as described in claim 2, characterized in that: The first CNC machine tool is a three-axis CNC machine tool, and the second CNC machine tool is a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes.

4. The CNC machining method based on dynamic error compensation as described in claim 3, characterized in that: The workpiece has a side surface and a top surface and a bottom surface arranged opposite to each other. The top surface is the large surface of the workpiece. The bottom surface forms a concave inner cavity. The non-concave part of the bottom surface forms an annular step. The lower end of the annular step forms a small plane.

5. The CNC machining method based on dynamic error compensation as described in claim 4, characterized in that: In step S1, a three-axis CNC machine tool is used to form the outer contour of the workpiece's large surface and side surface, as well as the small plane of the workpiece; in step S4, a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes is used to form the internal cavity structure features and side holes of the workpiece.

6. The CNC machining method based on dynamic error compensation as described in claim 4, characterized in that: The workpiece has four sides, namely, a first side and a third side arranged opposite each other in a first horizontal direction, and a second side and a fourth side arranged opposite each other in a second horizontal direction. Each side includes an upper vertical plane and a lower arc-shaped surface. The vertical planes of the first and third sides serve as reference planes for positioning in the first horizontal direction, the vertical planes of the second and fourth sides serve as reference planes for positioning in the second horizontal direction, and the small plane serves as a reference plane for positioning in the vertical direction. In step S310, at least two side probes are configured on each of the four sides, and a bottom probe is configured on the small plane. Error data in the first and second horizontal directions are collected by probes at the side probes, and error data in the vertical direction is collected at the bottom probes to construct a three-dimensional error field.

7. The CNC machining method based on dynamic error compensation as described in claim 4, characterized in that: In step S1, the cutting tool used by the first CNC machine tool includes a composite forming tool. The composite forming tool includes two levels of cutting edges. The cutting edge shape of the first level of cutting edge is adapted to the side shape of the workpiece and is used to process and form the side contour of the workpiece. The other level of cutting edge is a ring-shaped flat end face cutting edge perpendicular to the tool axis. The cutting edge end face is a plane and is used to process the small plane at the bottom of the workpiece.

8. The CNC machining method based on dynamic error compensation as described in any one of claims 1 to 7, characterized in that, It also includes the following steps: S5. Store the measured error data, compensation parameters, and processing results into the process database.

9. A CNC machining system based on dynamic error compensation, characterized in that: include The first CNC machine tool is used to machine the workpiece shape and reference surface on the workpiece blank to obtain the workpiece intermediate blank; The second CNC machine tool is used to machine the internal features of the workpiece on the intermediate blank. The online detection system is used to detect and locate each reference surface of the intermediate blank of the workpiece using probes, and compare it with the corresponding reference surface of the pre-stored theoretical model of the workpiece to calculate the three-dimensional error field. A compensation control system, comprising a macro-variable conversion module and a coordinate offset calculation module, wherein the coordinate offset calculation module is used to calculate the coordinate error values ​​of each machining point of the second CNC machine tool based on a three-dimensional error field; the macro-variable conversion module is used to convert the coordinate error values ​​into macro-variables of the second CNC machine tool to offset the theoretical coordinates of each machining point of the second CNC machine tool; and The storage unit is used to store the workpiece theoretical model, actual machining data, error compensation data, and process parameters. The online detection system outputs a three-dimensional error field to the compensation control system; the compensation control system injects macro variables into the second machine tool machining program; the storage unit interacts with each module.

10. The CNC machining system based on dynamic error compensation as described in claim 9, characterized in that: The first CNC machine tool is a three-axis CNC machine tool, and the second CNC machine tool is a four-axis CNC machine tool or a multi-axis CNC machine tool with four or more axes.