Calculation method for offset of coordinate system in numerical control machining
By determining the bias position of the workpiece coordinate system in the computer automation in CNC processing, the problem of cumbersome measurement and calculation methods of manual measurement and computing is solved, and high -precision and low cost processing effects are achieved.
Patent Information
- Application Number
- CN202411321772.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-21
AI Technical Summary
In CNC machining, the method of manually measuring and calculating the workpiece coordinate system is cumbersome and has large errors, resulting in the first piece processing being unqualified, the debugging scrap rate is high, and the cost is increased.
Provide a calculation method for the bias of the coordinate system in CNC processing. By establishing a machine tool coordinate system, collecting the B -axis rotation center, determining the coordinates of the benchmark point P of the shell part, selecting the offset value of the benchmark point P, and according to the benchmark point according to the benchmark point The coordinates and rotation angle values of p are calculated to calculate the coordinates of multiple new positions of the benchmark point P.
This method can automatically calculate the offset value of the workpiece zero point, establish the workpiece coordinate system, reduce human operating errors, improve processing accuracy and reliability, shorten debugging time, and reduce costs.
Smart Images

Figure CN119335947A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of parts processing, and in particular, to a method for calculating a coordinate system offset in numerical control processing. Background Art
[0002] For parts, one clamping on a horizontal machining center can process features at multiple angles and orientations, that is, features in all directions except the top and bottom surfaces, to avoid errors caused by multiple clampings. However, for multi-angle and multi-orientation machining with rotating axes, in order to be intuitive and convenient during programming and calculation, the method of manually measuring and calculating simulation at different machining angles is usually used to establish the workpiece coordinate system. Before machining, calibrate the fixture (the process size of the part is parallel to the moving axis of the machine tool), then find the reference point on the workpiece, and then calculate the zero offset value of the workpiece coordinate system at the corresponding B-axis angle according to the drawing size. The coordinate systems obtained in this way are independent of each other and have no correlation. Manual alignment is caused by errors in measuring the blank or indirect measurement, which often leads to unqualified coaxiality and position of the first piece during debugging of a new product, resulting in the first piece being scrapped.
[0003] The workpiece rotates around the B-axis of the machine tool. For the convenience of programming and versatility, it is often necessary to establish independent workpiece coordinate systems at different angles of the B-axis in actual processing. When debugging new products or changing production lines, manually measuring and establishing multiple coordinate systems is cumbersome, with long standby time and low efficiency. In addition, the error is large due to human operation. After the first piece is processed, the coordinate system is adjusted according to the measurement report, which introduces measurement errors, resulting in repeated adjustments, high debugging scrap rate, and increased costs.
[0004] Regarding the problem of processing multiple surfaces simultaneously with only one manual alignment, it is common that the part design datum (workpiece coordinate system) and the rotation center position of the worktable do not coincide. When the turntable is indexed at any angle, the position of the workpiece coordinate origin relative to the machine tool coordinate system changes. Finding the workpiece origin requires calculating the non-right angle of the coordinate system in space after the transfer. There is a lack of direct or indirect reference datum, making it difficult to find the coordinate system.
[0005] At present, the method of finding points by computer-aided drawing is as follows: taking the horizontal machining center as an example, first use the test mandrel or marble square to find the rotation center of the B axis of the machine tool; select the reference datum and find the specific value of the reference datum in the machine tool coordinate system (need to process the position feature or pin position), use the CAD software to virtualize a machine tool coordinate space model, and in the model, according to the above two sets of position data, infer the mechanical zero point of the machine tool. The inferred mechanical zero point is regarded as the zero point of the virtual machine tool coordinate system model of the CAD software. In the virtual coordinate space of the software, the workpiece is rotated with the rotation center of the machine tool. The part that needs to be processed only needs to rotate the part to the position where the processing content is coaxial with the spindle, and the software is used to capture the position data (workpiece coordinate offset) of the zero point of the working coordinate system that needs to be set in the model coordinate, and the required workpiece coordinate data is recorded in sequence, and finally input into the machine tool workpiece offset. The above method has the following disadvantages: it must rely on CAD / CAM software, data transfer is prone to errors, the process is cumbersome and has poor versatility, and is not suitable for shell part processing. Summary of the invention
[0006] In order to overcome at least one deficiency in the prior art, the present application provides a method for calculating coordinate system offset in CNC machining.
[0007] In a first aspect, a method for calculating a coordinate system offset in numerical control machining is provided, comprising:
[0008] Establish the machine tool coordinate system, collect the B-axis rotation center, determine the coordinates of the reference point P of the shell part, and select the offset value of the reference point P;
[0009] When processing the shell part, it is necessary to rotate around the B axis of the machine tool table at different angles. According to the offset value of the reference point P, the reference point P is rotated around the B axis rotation center to multiple new positions; determine the different angle values of the shell part rotation;
[0010] According to the coordinates of the reference point P of the shell part and different angle values of the rotation of the shell part, the coordinates of multiple new positions of the reference point P are determined.
[0011] In one embodiment, according to the coordinates of the reference point P of the shell part and different angle values of the shell part rotation, the coordinates of multiple new positions of the reference point P are determined using the following formula:
[0012] X2=X1cosa-Z1sina
[0013] Y2=Y1
[0014] Z2=X1sina+Z1cosa
[0015] Among them, X1, Y1, and Z1 are the coordinate values of the X, Y, and Z axes in the coordinates of the reference point P, respectively; X2, Y2, and Z2 are the coordinate values of the X, Y, and Z axes in the coordinates of the new position, respectively; and a is the angle value of the rotation of the shell part.
[0016] In a second aspect, a device for calculating coordinate system offset in numerical control machining is provided, comprising:
[0017] The reference point coordinate determination module establishes the machine tool coordinate system, collects the B-axis rotation center, determines the coordinates of the reference point P of the shell part, and selects the offset value of the reference point P;
[0018] The rotation angle determination module is used for the case parts that need to be rotated at different angles around the B axis of the machine tool table during processing. According to the offset value of the reference point P, the reference point P is rotated around the B axis rotation center to multiple new positions; the different angle values of the case parts rotation are determined;
[0019] The new position coordinate determination module is used to determine the coordinates of multiple new positions of the reference point P according to the coordinates of the reference point P of the shell part and different angle values of the rotation of the shell part.
[0020] In one embodiment, according to the coordinates of the reference point P of the shell part and different angle values of the shell part rotation, the coordinates of multiple new positions of the reference point P are determined using the following formula:
[0021] X2=X1cosa-Z1sina
[0022] Y2=Y1
[0023] Z2=X1sina+Z1cosa
[0024] Among them, X1, Y1, and Z1 are the coordinate values of the X, Y, and Z axes in the coordinates of the reference point P, respectively; X2, Y2, and Z2 are the coordinate values of the X, Y, and Z axes in the coordinates of the new position, respectively; and a is the angle value of the rotation of the shell part.
[0025] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for calculating the coordinate system offset in numerical control machining is implemented.
[0026] In a fourth aspect, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the above-mentioned method for calculating the coordinate system offset in CNC machining.
[0027] Compared with the prior art, this application has the following beneficial effects:
[0028] 1. This application provides a method for positioning parts at different angles of a rotating axis; by collecting machine tool data and running the developed macro program, the machine tool will automatically write the offset value of the workpiece zero point required at different angles of the B axis and establish a workpiece coordinate system. The macro program automatically converts, shortens the debugging time, and the theoretical calculation is error-free, which can reduce the debugging scrap rate and save costs; improves the accuracy and reliability of shell part processing.
[0029] 2. This application does not need to clamp the workpiece reference point on the rotation center of the worktable, and can realize the automatic offset of the coordinate origin during multi-directional processing. After the worktable rotates, the workpiece coordinate system automatically compensates, which can not only avoid human operation errors, accurately set the processing origin of each surface, and reduce the debugging scrap rate. It can also improve efficiency and shorten the debugging time of new products. In addition, the user macro program logic is clear, clear at a glance, easy to modify, and highly versatile. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present application may be better understood by referring to the following description given in conjunction with the accompanying drawings, which together with the following detailed description are included in this specification and form a part of this specification. In the drawings:
[0031] Figure 1 A flowchart of a method for calculating a coordinate system offset in numerical control machining according to an embodiment of the present application is shown;
[0032] Figure 2 A schematic diagram showing the rotation from point A to point B is shown;
[0033] Figure 3 A structural block diagram of a coordinate system offset calculation device in numerical control machining according to an embodiment of the present application is shown;
[0034] Figure 4 A schematic diagram of setting a difference value / vector between a set origin and a reference origin in the direction, a difference value / vector between a set origin and a reference origin in the Y direction, and a difference value / vector between a set origin and a reference origin in the Z direction in one embodiment is shown;
[0035] Figure 5 A schematic diagram of setting a difference value / vector between a set origin and a reference origin in the direction, a difference value / vector between a set origin and a reference origin in the Y direction, and a difference value / vector between a set origin and a reference origin in the Z direction in another embodiment is shown;
[0036] Figure 6 A schematic diagram showing a difference value / vector between a set origin and a reference origin in the direction, a difference value / vector between a set origin and a reference origin in the Y direction, and a difference value / vector between a set origin and a reference origin in the Z direction in another embodiment is shown;
[0037] Figure 7A schematic diagram showing a difference value / vector between a set origin and a reference origin in the direction, a difference value / vector between a set origin and a reference origin in the Y direction, and a difference value / vector between a set origin and a reference origin in the Z direction in another embodiment is shown; DETAILED DESCRIPTION
[0038] The exemplary embodiments of the present application will be described below in conjunction with the accompanying drawings. For the sake of clarity and conciseness, not all features of the actual embodiments are described in the specification. However, it should be understood that many implementation-specific decisions can be made in the process of developing any such actual embodiments in order to achieve the specific goals of the developer, and these decisions may vary from embodiment to embodiment.
[0039] It is also necessary to explain here that, in order to avoid obscuring the present application due to unnecessary details, only the device structure closely related to the scheme according to the present application is shown in the drawings, while other details that are not closely related to the present application are omitted.
[0040] It should be understood that the present application is not limited to the described implementation forms due to the following description with reference to the accompanying drawings. In this article, where feasible, the embodiments can be combined with each other, features between different embodiments can be replaced or borrowed, and one or more features can be omitted in one embodiment.
[0041] The housing parts processed by the present invention include transmission housings, clutch housings, side cover housings and other parts that need to be processed in the direction of a rotation angle. The housing parts are fixed on the machine tool by a fixture, and a specific blank surface on the fixture is the reference point of the housing part. The rotation center point of the machine tool worktable is theoretically the exact center position of the machine tool worktable, and there will be some deviation in actual measurement. The calculation method of the coordinate system offset in the CNC machining of the present application is intended to determine the clamping position of the housing part on the machine tool worktable after the worktable rotates, that is, to obtain the coordinates of the reference point of the housing part in the machine tool coordinate system.
[0042] The present application provides a method for calculating a coordinate system offset in numerical control machining. Figure 1 A flowchart of a method for calculating a coordinate system offset in numerical control machining according to an embodiment of the present application is shown. Figure 1 , methods include:
[0043] Step S1, establish a machine tool coordinate system, collect the B-axis rotation center, determine the coordinates of the reference point P of the housing part, and select the offset value of the reference point P;
[0044] Here, the housing part is positioned at an arbitrary position on the machine tool table by a fixture, a machine tool coordinate system is established, and the coordinates of the reference point P of the housing part are determined.
[0045] Step S2, when processing the shell part, it is necessary to rotate around the B axis of the machine tool worktable at different angles. According to the offset value of the reference point P, the reference point P is rotated around the B axis rotation center to multiple new positions; and the different angle values of the shell part rotation are determined.
[0046] Step S3, determining the coordinates of multiple new positions of the reference point P according to the coordinates of the reference point P of the shell part and different angle values of the rotation of the shell part.
[0047] Specifically, the coordinates of multiple new positions of the reference point P may be determined using the following formula:
[0048] X2=X1cosa-Z1sina
[0049] Y2=Y1
[0050] Z2=X1sina+Z1cosa
[0051] Among them, X1, Y1, and Z1 are the coordinate values of the X, Y, and Z axes in the coordinates of the reference point P, respectively; X2, Y2, and Z2 are the coordinate values of the X, Y, and Z axes in the coordinates of the new position, respectively; and a is the angle value of the rotation of the shell part.
[0052] Figure 2 A schematic diagram showing the rotation from point A to point B is shown in FIG. Figure 2 , the specific derivation process of the above formula is as follows:
[0053] When 0≤β≤180°
[0054] Point A Z1=Lsinβ(1)
[0055] X1= Lcosβ (2)
[0056] Point B Z2 = Lsin(a+β)(3)
[0057] X2=Lcos(a+β) (4)
[0058] When 180°<β<360°
[0059] have: have: Similarly, there are:
[0060]
[0061] Known formula:
[0062] sin(a+β)=sina cosβ+cos asinβ (5)
[0063] cos(a+β)=cosa cosβ-sina sinβ (6)
[0064] Substituting formula (5)(6) into formula (3)(4) we get:
[0065] Z2= Lsina cosβ+Lcos asinβ (7)
[0066] X2= Lcos acosβ - Lsinasinβ (8)
[0067] Substituting formula (1)(2) into formula (7)(8) we get:
[0068] Z2=X1 sin a+Z1 cos a
[0069] X2=X1cos a-Z1sin a
[0070] Among them, β represents the angle between the line connecting the reference point of the shell part and the rotation center O of the B axis and the X axis of the machine tool coordinate system; X1 and Z1 are the coordinate values of the X and Z axes in the coordinates of point A, respectively, and L is the distance between point A or point B and the rotation center O. a is the angle value of point A rotating around the rotation center O to point B. X2 and Z2 are the coordinate values of the X and Z axes in the coordinates of the new position, respectively.
[0071] Here, the specific implementation process of step S3 can be implemented by using a written subroutine, which is called by a main program. The main program can be, for example:
[0072] #104 = -524.88 (X direction value of the rotation center of the workbench)
[0073] #105=0 (Y direction value of the rotation center of the worktable)
[0074] #106 = -1065.15 (Z direction value of the rotation center of the workbench)
[0075] (A: Difference / vector between the set origin and the reference origin)
[0076] (B: Difference / vector in the Y direction between the set origin and the reference origin)
[0077] (C: Difference / vector between the set origin and the reference origin in the Z direction)
[0078] (I: angle of the origin, absolute value)
[0079] (J: Angle with reference to the origin)
[0080] (K: origin number)
[0081] (D: Fine-tune X value)
[0082] (E: Fine-tune Y value)
[0083] (F: Fine-tune Z value)
[0084] (X: Refer to the center X value)
[0085] (Y: Refer to the center Y value)
[0086] (Z: Refer to the center Z value)
[0087] #100 = -0.001; (Offset value in the direction of reference point B)
[0088] #101 = -513.3; (Offset value in the X direction of the reference point)
[0089] #102 = -612.4; (Offset value in the Y direction of the reference point)
[0090] #103 = -827.45; (Offset value in Z direction of reference point)
[0091] G65P3333 A0.B0.C0.I180.J180.K51 X#101Y#102Z#103D0E0 F0; (refer to Figure 4 )
[0092] G65P3333 A-5.B-38.C-393.I0.J180.K53 X#101Y#102Z#103D-0.7E-2.F-0.35; (refer to Figure 5 , Figure 6 )
[0093] G65P3333 A-251.3B[-100.+138.]C-214.I90.J180.K54 X#101Y#102Z#103D0 E-1.F0;
[0094] G65P3333 A-97.878B0.C[-228.956+87.]I0.J180.K55 X#101Y#102Z#103D0 E0F0(D130); (Refer to Figure 5 , Figure 6 )
[0095] #101=#107
[0096] #102=#108
[0097] #103=#109
[0098] G65P3333A-95.37*COS[17.]B[-100.+295.1-42.6]C-95.37*SIN[17.]I253.J0.K52 X#101Y#102Z#103D-0.1E0 F0.17; (refer to Figure 7 )
[0099] M30;
[0100] O3333 subroutine (underlying algorithm)
[0101] O3333;
[0102] #107=#104+[#24-#104+#1]*COS[#4-#5]-[#26-#106+#3]*SIN[#4-#5];
[0103] #108=#105+[#25-#105+#2];
[0104] #109=#106+[#24-#104+#1]*SIN[#4-#5]+[#26-#106+#3]*COS[#4-#5];
[0105] G90G10L20P[#6]X[#107+#7]Y[#108+#8]Z[#109+#9]B[#100];
[0106] M99;
[0107] When calling a subroutine through the main program, it is also necessary to determine the coordinates of the rotation center point A of the machine tool worktable and the distance vectors between multiple new positions and the reference point P, and input the determined coordinates of the rotation center point A and the distance vector into the main program to achieve the purpose of calling the subroutine.
[0108] Based on the same inventive concept as the method for calculating the coordinate system offset in numerical control machining, this embodiment also provides a corresponding device for calculating the coordinate system offset in numerical control machining. Figure 3 A structural block diagram of a coordinate system offset calculation device in numerical control machining according to an embodiment of the present application is shown, see Figure 3 , the device comprises:
[0109] The reference point coordinate determination module 31 is used to establish the machine tool coordinate system, collect the B-axis rotation center, determine the coordinates of the reference point P of the housing part, and select the offset value of the reference point P;
[0110] The rotation angle determination module 32 is used for determining different angle values of the rotation of the shell part when the shell part needs to be rotated around the B axis of the machine tool worktable at different angles during processing. According to the offset value of the reference point P, the reference point P is rotated around the B axis rotation center to multiple new positions;
[0111] The new position coordinate determination module 33 is used to determine the coordinates of multiple new positions of the reference point P according to the coordinates of the reference point P of the shell part and different angle values of the rotation of the shell part.
[0112] The device for calculating the coordinate system offset in CNC machining of this embodiment has the same inventive concept as the method for calculating the coordinate system offset in CNC machining mentioned above, so the specific implementation method of the device can be seen in the implementation example part of the method for calculating the coordinate system offset in CNC machining mentioned above, and its technical effect corresponds to the technical effect of the above method, which will not be repeated here.
[0113] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned method for calculating the coordinate system offset in CNC machining.
[0114] An embodiment of the present application provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the above-mentioned method for calculating the coordinate system offset in CNC machining is implemented.
[0115] In summary, this application has the following technical effects:
[0116] 1. This application provides a method for positioning parts at different angles of a rotating axis; by collecting machine tool data and running the developed macro program, the machine tool will automatically write the offset value of the workpiece zero point required at different angles of the B axis and establish a workpiece coordinate system. The macro program automatically converts, shortens the debugging time, and the theoretical calculation is error-free, which can reduce the debugging scrap rate and save costs; improves the accuracy and reliability of shell part processing.
[0117] 2. This application does not need to clamp the workpiece reference point on the rotation center of the worktable, and can realize the automatic offset of the coordinate origin during multi-directional processing. After the worktable rotates, the workpiece coordinate system automatically compensates, which can not only avoid human operation errors, accurately set the processing origin of each surface, and reduce the debugging scrap rate. It can also improve efficiency and shorten the debugging time of new products. In addition, the user macro program logic is clear, clear at a glance, easy to modify, and highly versatile.
[0118] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for calculating coordinate system offset in numerical control machining, characterized in that: include: Establish a machine tool coordinate system, collect the B-axis rotation center, determine the coordinates of the reference point P of the housing part, and select the offset value of the reference point P; When processing the shell part, it is necessary to rotate around the B axis of the machine tool table at different angles. According to the offset value of the reference point P, the reference point P is rotated around the rotation center of the B axis to multiple new positions; and different angle values of the rotation of the shell part are determined; According to the coordinates of the reference point P of the shell part and different angle values of the rotation of the shell part, the coordinates of multiple new positions of the reference point P are determined.
2. The method according to claim 1, characterized in that in, According to the coordinates of the reference point P of the shell part and the different angle values of the rotation of the shell part, the coordinates of multiple new positions of the reference point P are determined using the following formula: X2=X1cosa-Z1sina Y2=Y1 Z2=X1sina+Z1cosa Among them, X1, Y1, and Z1 are the coordinate values of the X, Y, and Z axes in the coordinates of the reference point P, respectively; X2, Y2, and Z2 are the coordinate values of the X, Y, and Z axes in the coordinates of the new position, respectively; and a is the angle value of the rotation of the shell part.
3. A device for calculating coordinate system offset in numerical control machining, characterized in that: include: The reference point coordinate determination module establishes the machine tool coordinate system, collects the B-axis rotation center, determines the coordinates of the reference point P of the housing part, and selects the offset value of the reference point P; A rotation angle determination module is used for determining different angle values of rotation of the shell part when the shell part needs to be rotated around the B axis of the machine tool worktable at different angles during processing, and according to the offset value of the reference point P, the reference point P is rotated around the B axis rotation center to multiple new positions; The new position coordinate determination module is used to determine the coordinates of multiple new positions of the reference point P according to the coordinates of the reference point P of the shell part and different angle values of rotation of the shell part.
4. The device according to claim 3, characterized in that in, According to the coordinates of the reference point P of the shell part and the different angle values of the rotation of the shell part, the coordinates of multiple new positions of the reference point P are determined using the following formula: X2=X1cosa-Z1sina Y2=Y1 Z2=X1sina+Z1cosa Among them, X1, Y1, and Z1 are the coordinate values of the X, Y, and Z axes in the coordinates of the reference point P, respectively; X2, Y2, and Z2 are the coordinate values of the X, Y, and Z axes in the coordinates of the new position, respectively; and a is the angle value of the rotation of the shell part.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method for calculating the coordinate system offset in CNC machining as described in any one of claims 1-2.
6. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the method for calculating the coordinate system offset in CNC machining as described in any one of claims 1-2.
Citation Information
Cited By
Compensation method of multi-head engraving and milling machine and related equipment
CN120503050A