Coordinate system conversion method and device based on double rotation axes and computer equipment
Patent Information
- Application Number
- CN202610973232.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-10-16
AI Technical Summary
这种方法操作简单,但引入的误差较大
[0009] The aforementioned coordinate system transformation method, apparatus, and computer equipment based on dual rotation axes obtain the positions of the first and second rotation axes of the machine tool in the scanning coordinate system and the machine tool coordinate system, respectively. They then determine the common perpendicular line in both systems, and establish a common coordinate system with the intersection of the common perpendicular line and the rotation axis as the origin. The direction of the first common perpendicular line and the direction of the rotation axis are used as two coordinate axes. By using the common transformation matrix as a transition matrix, the target transformation matrix between the machine tool coordinate system and the scanning coordinate system can be quickly derived. Furthermore, establishing the common coordinate system only requires axis calibration in the machine tool, and the establishment of the origin does not depend on calibration dimensions or sphere center coordinates. Compared to traditional methods, this significantly reduces the error in establishing the common coordinate system, thereby improving the accuracy of the obtained target transformation matrix.
Smart Images

Figure CN122923974A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CNC machine tool technology, and in particular to a coordinate system transformation method, apparatus and computer equipment based on dual rotary axes. Background Technology
[0002] Five-axis CNC machine tools, with five motion axes, are capable of high-precision machining of complex curved surfaces and are widely used in aerospace, automotive manufacturing, mold making, and other fields. With the development of intelligent manufacturing, online inspection technology is becoming increasingly important in five-axis machine tools. 3D scanners, as efficient non-contact measurement devices, can quickly acquire three-dimensional point cloud data of workpiece surfaces, enabling real-time inspection and quality control during the machining process.
[0003] However, 3D scanners have an independent measurement coordinate system, which is inconsistent with the machine tool coordinate system. To correlate scanner measurement data with machine tool machining coordinates, coordinate system unification is necessary. Currently, the commonly used coordinate system unification method mainly uses standard gauge blocks or standard spheres for calibration. By measuring standard parts with known dimensions, a transformation relationship between the scanning coordinate system and the machine tool coordinate system is established. This method is simple to operate, but it introduces relatively large errors. Summary of the Invention
[0004] Therefore, it is necessary to provide a coordinate system transformation method, apparatus, and computer device based on dual rotation axes to address the above-mentioned technical problems, which can reduce the error in establishing a common coordinate system and improve the accuracy of the obtained target transformation matrix.
[0005] A coordinate system transformation method based on two rotation axes, the method comprising: The positions of the first and second rotation axes of the machine tool in the scanning coordinate system are obtained; the first and second rotation axes are two non-parallel rotation axes in the machine tool; the scanning coordinate system is the coordinate system of the scanner. Obtain the positions of the first and second rotary axes of the machine tool in the machine tool coordinate system; Based on the positions of the first and second rotation axes in the scanning coordinate system, a first common perpendicular line between the first and second rotation axes in the scanning coordinate system is determined. Using the intersection of the first common perpendicular line and the target rotation axis as the origin, the direction of the first common perpendicular line as one coordinate axis, and the direction of the target rotation axis as the other coordinate axis, the position of the common coordinate system in the scanning coordinate system is obtained; the target rotation axis is either the first or the second rotation axis. Based on the positions of the first and second rotation axes in the machine tool coordinate system, the second common perpendicular line of the first and second rotation axes in the machine tool coordinate system is determined. The position of the common coordinate system in the machine tool coordinate system is obtained by taking the intersection of the second common perpendicular line and the target rotation axis as the origin, the direction of the second common perpendicular line as one coordinate axis, and the direction of the target rotation axis as the other coordinate axis. The first transformation matrix between the scanning coordinate system and the common coordinate system is determined based on the position of the common coordinate system in the scanning coordinate system; Determine the second transformation matrix between the common coordinate system and the machine tool coordinate system based on the position of the common coordinate system in the machine tool coordinate system; The target transformation matrix between the machine tool coordinate system and the scanning coordinate system is determined based on the first transformation matrix and the second transformation matrix.
[0006] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of various embodiments of coordinate system transformation methods based on dual rotation axes.
[0007] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of various embodiments of coordinate system transformation methods based on dual rotation axes.
[0008] A computer program product includes a computer program that, when executed by a processor, implements the steps of various embodiments of coordinate system transformation methods based on dual rotation axes.
[0009] The aforementioned coordinate system transformation method, apparatus, and computer equipment based on dual rotation axes obtain the positions of the first and second rotation axes of the machine tool in the scanning coordinate system and the machine tool coordinate system, respectively. They then determine the common perpendicular line in both systems, and establish a common coordinate system with the intersection of the common perpendicular line and the rotation axis as the origin. The direction of the first common perpendicular line and the direction of the rotation axis are used as two coordinate axes. By using the common transformation matrix as a transition matrix, the target transformation matrix between the machine tool coordinate system and the scanning coordinate system can be quickly derived. Furthermore, establishing the common coordinate system only requires axis calibration in the machine tool, and the establishment of the origin does not depend on calibration dimensions or sphere center coordinates. Compared to traditional methods, this significantly reduces the error in establishing the common coordinate system, thereby improving the accuracy of the obtained target transformation matrix. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating a coordinate system transformation method based on two rotation axes in one embodiment; Figure 2 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0014] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly. The connection can be a direct connection or an indirect connection.
[0015] Furthermore, the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. If the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed in this application.
[0016] The terms "first," "second," etc., used in this application may be used herein to describe various data, but such data are not limited by these terms. These terms are only used to distinguish one data from another. For example, without departing from the scope of this application, a first rotation axis may be referred to as a second rotation axis, and similarly, a second rotation axis may be referred to as a first rotation axis. Both the first and second rotation axes are rotation axes, but they are not the same rotation axis.
[0017] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.
[0018] It is understood that the "data acquisition" operation in the embodiments of this application includes, but is not limited to, the following implementation methods: directly reading data pre-stored in the device; data received from external devices; or indirect acquisition methods after data collection, conversion and processing.
[0019] In some embodiments, such as Figure 1 The diagram illustrates a flowchart of a coordinate system transformation method for a machine tool in one embodiment. This method is applicable to an application environment including both a machine tool and a scanner. The scanner is a non-contact measuring device, such as a line laser scanner, speckle surface scanner, or projection scanner. This coordinate system transformation method can be executed by a computer device or by the machine tool itself. The computer device can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The method is illustrated using a machine tool as an example, and includes the following steps: Step 102: Obtain the positions of the first and second rotary axes of the machine tool in the scanning coordinate system; the first and second rotary axes are two non-parallel rotary axes in the machine tool; the scanning coordinate system is the coordinate system of the scanner.
[0020] In this context, the first and second rotation axes refer to rotatable mechanical axes in the machine tool, such as the A-axis (rotating around the X-axis), B-axis (rotating around the Y-axis), or C-axis (rotating around the Z-axis). The first and second rotation axes are two non-parallel rotation axes in the machine tool. The scanning coordinate system is the coordinate system calibrated by the scanner itself, such as a local coordinate system established with the scanner's measurement center as the origin.
[0021] Specifically, the positions of the first and second rotary axes in the scanning coordinate system can be pre-calibrated and stored in the machine tool or computer equipment.
[0022] Step 104: Obtain the positions of the first and second rotary axes of the machine tool in the machine tool coordinate system.
[0023] The machine tool coordinate system is the coordinate system calibrated and stored by the machine tool itself, referring to the O-XYZ coordinate system. The origin of different machine tools may be different, but this is not limited here.
[0024] Specifically, the positions of the first and second rotary axes in the machine tool coordinate system can be pre-calibrated and stored in the machine tool or computer equipment.
[0025] Step 106: Based on the positions of the first rotation axis and the second rotation axis in the scanning coordinate system, determine the first common perpendicular line of the first rotation axis and the second rotation axis in the scanning coordinate system. Take the intersection of the first common perpendicular line and the target rotation axis as the origin, the direction of the first common perpendicular line as one of the coordinate axes, and the direction of the target rotation axis as the other coordinate axis to obtain the position of the common coordinate system in the scanning coordinate system; the target rotation axis is either the first rotation axis or the second rotation axis.
[0026] In this context, a common perpendicular line is a line that is perpendicular to two skew lines and intersects both of them. The common coordinate system acts as an intermediary, connecting the scanning coordinate system and the machine tool coordinate system. The common coordinate system is the only geometric entity in the physical world; the coordinate values obtained under different coordinate systems differ, but they implicitly represent their respective transformation relationships. The target rotation axis is either the first rotation axis or the second rotation axis.
[0027] Specifically, the origin O is taken as the intersection of the first common perpendicular and the target rotation axis, the direction of the first common perpendicular is taken as one coordinate axis, the direction of the target rotation axis is taken as another coordinate axis, and the cross product direction of the first common perpendicular and the target rotation axis is taken as the third coordinate axis, so as to obtain the position of the common coordinate system in the scanning coordinate system.
[0028] Taking the first rotation axis as A-axis, the second rotation axis as C-axis, and the target rotation axis as C-axis as an example, the origin is the intersection of the cross product of A-axis and C-axis (i.e., the first common perpendicular) and the C-axis. The X-axis is the first common perpendicular, the Z-axis is the direction of the C-axis, and the Y-axis is the direction of the cross product of the C-axis and the first common perpendicular. Let the equation of the C-axis be P = Pc + t·Vc, and the equation of the A-axis be P = Pa + s·Va, and both the equations of the A-axis and C-axis are known. Here, Pc is a known fixed point on the C-axis line, t is a parameter of the C-axis equation, and Vc is the direction vector of the C-axis; Pa is a known fixed point on the A-axis line, s is a parameter of the A-axis equation, and Va is the direction vector of the A-axis.
[0029] The intersection point Oc of the common perpendicular and the C-axis is: Oc = Pc + tc·Vc Where tc = [(Pa - Pc)·(Va × (Vc × Va))] / |Vc × Va|² Oa is the intersection of the common perpendicular and the A-axis. Equivalently, Oc satisfies (Oc - Oa) ⊥ Vc and (Oc - Oa) ⊥ Va, and Oa is the intersection of the common perpendicular on the A-axis.
[0030] Step 108: Based on the positions of the first and second rotation axes in the machine tool coordinate system, determine the second common perpendicular line of the first and second rotation axes in the machine tool coordinate system. Take the intersection of the second common perpendicular line and the target rotation axis as the origin, the direction of the second common perpendicular line as one of the coordinate axes, and the direction of the target rotation axis as the other coordinate axis to obtain the position of the common coordinate system in the machine tool coordinate system.
[0031] Specifically, the origin O is taken as the intersection of the second common perpendicular and the target rotation axis. The direction of the second common perpendicular is taken as one coordinate axis, the direction of the target rotation axis as another coordinate axis, and the cross product of the second common perpendicular and the target rotation axis as a third coordinate axis. This yields the position of the common coordinate system within the machine tool coordinate system. Taking the second rotation axis as the A-axis, the second rotation axis as the C-axis, and the target rotation axis as the C-axis as an example, the origin is taken as the intersection of the cross product of the A-axis and the C-axis (i.e., the second common perpendicular) and the C-axis. The X-axis is the second common perpendicular, the Z-axis is the direction of the C-axis, and the Y-axis is the direction of the cross product of the second common perpendicular and the C-axis.
[0032] Step 110: Determine the first transformation matrix between the scanning coordinate system and the common coordinate system based on the position of the common coordinate system in the scanning coordinate system.
[0033] The first transformation matrix can be either a matrix from the scan coordinate system to the common coordinate system, or a matrix from the common coordinate system to the scan coordinate system. The first transformation matrix can be a 4×4 homogeneous transformation matrix, including rotation and translation components.
[0034] Specifically, the machine tool determines the translation matrix based on the origin of the common coordinate system and the rotation matrix based on the three coordinate axes of the common coordinate system, thus obtaining the first transformation matrix.
[0035] Step 112: Determine the second transformation matrix between the common coordinate system and the machine tool coordinate system based on the position of the common coordinate system in the machine tool coordinate system.
[0036] The second transformation matrix can be a matrix from the machine coordinate system to the common coordinate system, or a matrix from the common coordinate system to the machine coordinate system. This second transformation matrix can be a 4×4 homogeneous transformation matrix, including rotation and translation components.
[0037] Specifically, the machine tool determines the translation matrix based on the origin of the common coordinate system and the rotation matrix based on the three coordinate axes of the common coordinate system, thus obtaining the second transformation matrix.
[0038] Step 114: Determine the target transformation matrix between the machine tool coordinate system and the scanning coordinate system based on the first transformation matrix and the second transformation matrix.
[0039] Similarly, the target transformation matrix can be a transformation from the machine tool coordinate system to the scanning coordinate system, or a transformation from the scanning coordinate system to the machine tool coordinate system.
[0040] Specifically, the machine tool can determine the target transformation matrix based on the product of the first transformation matrix and the second transformation matrix.
[0041] In this embodiment, by obtaining the positions of the first and second rotation axes of the machine tool in the scanning coordinate system and the machine tool coordinate system, respectively, the common perpendicular lines in the scanning coordinate system and the machine tool coordinate system are determined. The intersection of the common perpendicular line and the rotation axis is taken as the origin, and the directions of the first common perpendicular line and the rotation axis are taken as two coordinate axes to establish a common coordinate system. Using a common transformation matrix as a transfer matrix, the target transformation matrix between the machine tool coordinate system and the scanning coordinate system can be quickly derived. Furthermore, the establishment of the common coordinate system only requires axis calibration in the machine tool; the establishment of the origin does not depend on calibration dimensions and sphere center coordinates. Compared with traditional methods, this significantly reduces the error in establishing the common coordinate system, thereby improving the accuracy of the obtained target transformation matrix. In addition, the method in this embodiment avoids the cumbersome multi-point measurement and iterative optimization process in traditional calibration, achieving fast and efficient calibration, significantly shortening calibration time, and reducing dependence on dedicated calibration equipment and complex operations, thus reducing hardware and labor costs.
[0042] In some embodiments, obtaining the positions of the first and second rotary axes of the machine tool in the scanning coordinate system includes: For each of the first and second rotation axes, the rotation axis is controlled to rotate by multiple angles so that the scanner scans the first calibration object at different angles, and the position of the calibration point of the first calibration object in the scanning coordinate system is obtained at each angle. By fitting the position of the calibration point of the first calibration object in the scanning coordinate system at various angles, the first motion trajectory of the calibration point of the first calibration object and the first normal vector of the plane in which it is located are obtained; The position of the rotation axis in the scanning coordinate system is determined based on the center point of the first motion trajectory and the first normal vector.
[0043] Specifically, a reasonable angle sequence is planned based on the range of motion and accuracy requirements of the rotary axis. Taking the first calibration object as a calibration plate with multiple calibration points as an example, for each of the first and second rotary axes, the machine tool rotates the first calibration object multiple angles via the rotary table's rotation axis, allowing the scanner to scan the calibration object at different angles and obtain the positions of the calibration points in the scanning coordinate system at each angle. Then, by fitting the positions of the calibration points of the first calibration object in the scanning coordinate system at each angle, the machine tool obtains the first motion trajectory of the calibration points, which is a circular motion trajectory, with the center of this circle being a point on the rotary axis. Since there are many calibration points, the machine tool can average the centers determined by each calibration point to obtain a point on the rotary axis. By determining the first normal vector of the plane containing this first motion trajectory, the machine tool can obtain the position of the rotary axis in the scanning coordinate system.
[0044] Optionally, the position (axis equation) of the rotation axis in the scanning coordinate system is solved with the optimization objective of minimizing the sum of the squares of the distances from each circle center to the axis of rotation and ensuring that each normal vector is parallel to the direction of the axis of rotation.
[0045] In this embodiment, the calibration object is rotated by the machine tool turntable at multiple angles to obtain the position of the calibration point in the scanning coordinate system at each angle. The position of the calibration point in the scanning coordinate system at each angle is fitted to obtain the first motion trajectory of the calibration point and the first normal vector of the plane in which it is located. Based on the center point of the first motion trajectory and the first normal vector, the obtained rotation axis position utilizes both the trajectory information of the calibration point and the direction information of the trajectory plane, which can effectively reduce the random error of measuring the axis at a single position and improve the axis calibration accuracy.
[0046] In some embodiments, obtaining the positions of the first and second rotary axes of the machine tool in the machine tool coordinate system includes: For each of the first and second rotary axes, the rotary axis is controlled to rotate by multiple angles. For each angle, the position of the calibration point of the second calibration object in the machine tool coordinate system is determined by touching the second calibration object with the probe. By fitting the position of the calibration point of the second calibration object in the machine tool coordinate system at various angles, the second motion trajectory of the calibration point of the second calibration object and the second normal vector of the plane in which it is located are obtained; The position of the rotation axis in the machine tool coordinate system is determined based on the center point of the second motion trajectory and the second normal vector.
[0047] The type of the second calibration object is not limited; it can be a square calibration object, a calibration plate, a standard ball, etc., with a standard ball being preferred.
[0048] Specifically, for each of the first and second rotation axes, the rotation axis is controlled to rotate at multiple angles, causing the second calibration object to rotate. For each angle, the calibration point of the second calibration object is determined by touching the second calibration object with a probe, such as the center of a cube, the center of a standard sphere, or the position of the vertex of a cone in the machine tool coordinate system. The machine tool fits the position of the calibration point of the second calibration object in the machine tool coordinate system at each angle, obtaining the second motion trajectory of the calibration point of the second calibration object, which is a circular motion trajectory. The center of this circle is a point on the rotation axis. The second normal vector of the plane containing the second motion trajectory is the direction of the rotation axis.
[0049] Optionally, the position (axis equation) of the rotary axis in the machine tool coordinate system is solved with the optimization objective of minimizing the sum of the squares of the distances from each circle center to the axis of rotation and ensuring that each normal vector is parallel to the direction of the axis of rotation.
[0050] In this embodiment, for each rotation axis, the rotation axis is controlled to rotate by multiple angles so that the position of the calibration point of the second calibration object in the machine tool coordinate system is controlled by the probe. The position at each angle is fitted to obtain the second motion trajectory of the calibration point and the second normal vector of the plane in which it is located. The obtained rotation axis position utilizes the trajectory information of the calibration point and the direction information of the trajectory plane, which can effectively reduce the random error of measuring the axis at a single position and improve the axis calibration accuracy.
[0051] In some embodiments, the second calibration object is a standard sphere, and the calibration point of the second calibration object is the center of the standard sphere; The position of the calibration point of the second calibration object in the machine tool coordinate system is determined by touching the second calibration object with the probe, including: By touching at least four points on the surface of a standard sphere with a probe, the position of the sphere's center in the machine tool coordinate system is obtained through fitting.
[0052] Specifically, since the distance between the center of the standard sphere and the point of contact of the probe is equal to the radius of the standard sphere, the coordinates of the sphere center can be uniquely determined by the least squares method based on at least four points touched by the probe.
[0053] In this embodiment, the standard sphere serves only as a target for the probe, providing a traceable sphere center at different rotation angles. The trajectory of the sphere center reveals the position of the rotation axis. The sphere center itself does not participate in the establishment of the common coordinate system. The sphere center error is averaged during the axis fitting process, and the origin of the common coordinate system is determined by the intersection of the two axes, without directly relying on a single sphere center measurement. This eliminates the sphere center fitting error introduced by directly using the sphere center to construct the common coordinate system in the traditional method, and improves the calibration accuracy of the target transformation matrix.
[0054] In some embodiments, determining the first transformation matrix between the scan coordinate system and the common coordinate system based on the position of the common coordinate system in the scan coordinate system includes: The column vectors of the rotation matrix are determined based on the three coordinate axes of the common coordinate system in the scan coordinate system; The translation matrix is determined based on the position of the origin in the scanning coordinate system to obtain the first transformation matrix between the scanning coordinate system and the common coordinate system.
[0055] Specifically, the column vectors of the rotation matrix are determined based on the three coordinate axes of the common coordinate system in the scan coordinate system. Let the unit vectors of the three coordinate axes of the common coordinate system in the scan coordinate system be Xb_s, Yb_s, and Zb_s, then the column vectors of the rotation matrix R_s2c are Xb_s, Yb_s, and Zb_s: Rotation matrix R_s2c = [Xb_s Yb_s Zb_s] This yields the first transformation matrix T_s2c between the scan coordinate system and the common coordinate system: T_s2c = [R_s2c t_s2c; 0 0 0 1] Similarly, the second transformation matrix T_m2c between the common coordinate system and the machine tool coordinate system can be obtained.
[0056] The translation matrix is determined based on the position of the origin in the scanning coordinate system. Let the position of the origin in the scanning coordinate system be Oc_s. Then the translation vector t_s2c is the vector from the origin to the origin of the scanning coordinate system, or it can be negative depending on the direction of the coordinate system transformation. When the first transformation matrix represents the transformation from the scanning coordinate system to the common coordinate system, the translation vector t_s2c = -R_s2c·Oc_s, where Oc_s is the position of the origin in the scanning coordinate system.
[0057] Furthermore, the target transformation matrix between the machine tool coordinate system and the scanning coordinate system is determined based on the first transformation matrix and the second transformation matrix:
[0058] In this embodiment, the position of the common coordinate system under the scanning coordinate system itself reflects the transformation matrix between the two. By constructing a common coordinate system to determine the target transformation matrix, the calculation is simple and the introduced error is small.
[0059] In some embodiments, the machine tool is a five-axis machine tool, the first rotary axis is the A-axis or the C-axis, and the second rotary axis is another axis other than the first rotary axis.
[0060] Five-axis CNC machine tools have five motion axes, enabling high-precision machining of complex curved surfaces. The A-axis is a rotational axis about the X-axis, and the C-axis is a rotational axis about the Z-axis. In a five-axis machine tool, the A-axis and C-axis are usually not parallel, satisfying the condition for establishing a common coordinate system.
[0061] Specifically, when the first rotation axis is the A-axis, the second rotation axis is the C-axis; when the first rotation axis is the C-axis, the second rotation axis is the A-axis. Using the A-axis and C-axis as the first and second rotation axes, a common coordinate system is established using the common perpendicular of the two axes. The Z-axis of the common coordinate system is aligned with the C-axis, and the X-axis is aligned with the common perpendicular of the A-axis and C-axis. The physical meaning is clear and it is easy to associate with the kinematic structure of the machine tool.
[0062] In this embodiment, the coordinate system transformation method of the machine tool can be applied to five-axis machine tools, especially suitable for five-axis machine tools with AC double rotary table structure, which can realize fast and accurate coordinate system transformation of five-axis machine tools.
[0063] In some embodiments, to determine the target transformation matrix T_s2m between the scanning coordinate system and the machine tool coordinate system, the traditional method requires precise measurement of the sphere center in both coordinate systems, which is an additional source of error. In this embodiment, a common coordinate system is established using the common perpendicular of the two rotation axes (A-axis and C-axis) of a five-axis machine tool. The standard sphere still serves as the target for axis calibration, but when establishing the common coordinate system, it is no longer necessary to scan to obtain the sphere center; it is directly determined by the geometry of the two axes, eliminating this error chain. The main steps include: Step 1: Dual-axis calibration (perform separately in both coordinate systems) Under the scanning coordinate system (scanner complete): Fix the calibration plate (first calibration object) on the machine tool table. C-axis calibration: Control the C-axis rotation by ≥3 angles, record the coordinates of the calibration points using the scanner, fit the trajectory circles of each calibration point, and optimize the solution of the C-axis axis equation in the scanning coordinate system. Lc_s: P = Pc_s + t·Vc_s A-axis calibration: Similarly, control the rotation of the A-axis by ≥3 angles, and fit and solve the equation of the A-axis in the scanning coordinate system: La_s: P = Pa_s + s·Va_s In machine coordinate system (probe + standard ball completed): Fix the standard ball on the worktable. C-axis calibration: Control the C-axis rotation by ≥3 angles, with the probe touching the surface of a standard sphere at each angle. Obtain the coordinates of the sphere's center at each angle by sphere fitting, fit the sphere's center trajectory circle, and solve for the C-axis equation in the machine coordinate system. Lc_m: P = Pc_m + t·Vc_m A-axis calibration: Similarly, control the A-axis rotation by ≥3 angles, until the probe touches the fitted trajectory circle of the standard ball, and solve for the axis equation of the A-axis in the machine tool coordinate system: La_m: P = Pa_m + s·Va_m Note: The standard sphere is used here only as a target for the probe to provide a traceable reference point (sphere center) at different rotation angles. The trajectory of the sphere center reveals the axis position. The sphere center itself does not participate in the establishment of the common coordinate system.
[0064] Step 2: Establish a common coordinate system Core geometry: Two non-parallel, non-intersecting spatial lines (A-axis and C-axis) have a unique common perpendicular.
[0065] Origin determination: Calculate the intersection point Oc of the common perpendiculars of the A-axis and the C-axis on the C-axis.
[0066] Let the equation of the C-axis be P = Pc + t·Vc, and the equation of the A-axis be P = Pa + s·Va. Then the intersection point Oc of the common perpendicular and the C-axis is: Oc = Pc + tc·Vc Where tc = [(Pa - Pc)·(Va × (Vc × Va))] / |Vc × Va|² Equivalently, Oc satisfies (Oc - Oa) ⊥ Vc and (Oc - Oa) ⊥ Va, where Oa is the intersection of the common perpendiculars on the A-axis.
[0067] Coordinate axis determination: Zb = Vc / |Vc| (C-axis direction) Xb = (Va × Vc) / |Va × Vc| (A-axis × C-axis = direction of the common perpendicular) Yb = Zb × Xb (Right-hand rule) Calculate the common coordinate system in both coordinate systems: In the scan coordinate system (_s): Oc_s, Xb_s, Yb_s, and Zb_s are calculated using Pc_s, Vc_s, Pa_s, and Va_s. In the machine tool coordinate system (_m): Oc_m, Xb_m, Yb_m, and Zb_m are calculated using Pc_m, Vc_m, Pa_m, and Va_m. Key point: The common coordinate system is the only geometric entity. The coordinate values obtained under different coordinate systems are different, but they implicitly contain the transformation relationship from each to the common coordinate system.
[0068] Step 3: Calculate the transformation matrix First transformation matrix T_s2c (scanning coordinate system → common coordinate system): R_s2c = [Xb_s Yb_s Zb_s] (3×3 rotation matrix, column vectors are the coordinates of the three axes of the common coordinate system in the scan system) t_s2c = -R_s2c·Oc_s (translation vector) T_s2c = [R_s2c t_s2c; 0 0 0 1] Second transformation matrix T_m2c (machine coordinate system → common coordinate system): R_m2c = [Xb_m Yb_m Zb_m] t_m2c = -R_m2c · Oc_m T_m2c = [R_m2c t_m2c; 0 0 0 1] Target transformation matrix T_s2m:
[0069] The beneficial effects of this embodiment are: 1. Eliminate the error in establishing the coordinate system by the sphere center: The traditional method requires fitting the sphere center to the sphere surface in the scanning coordinate system and fitting the sphere center to the probe in the machine tool coordinate system. Each of the two steps introduces independent errors, and the sphere center error directly affects the origin and X-axis of the common coordinate system. In this embodiment, the establishment of the coordinate system does not depend on the sphere center, thus eliminating this error chain.
[0070] 2. The definition of the common coordinate system is more robust: the origin is uniquely determined by the common perpendicular of the A and C axes, which is a purely geometric quantity and does not change with the placement of the calibration object; the origin of the traditional method changes with the position of the center of the sphere.
[0071] 3. Fewer calibration steps: The traditional method has 4 steps (axis calibration → sphere center scanning → sphere center probe → system establishment), while the new method has 3 steps (dual-axis calibration → system establishment → matrix calculation), eliminating the need to measure the two systems of the sphere center separately.
[0072] 4. Clearer physical meaning: The common coordinate system is directly related to the kinematic structure of the machine tool (determined by the A / C axis), rather than relying on external reference objects.
[0073] In some embodiments, a coordinate system transformation method based on two rotation axes includes: Step (a1): For each of the first and second rotation axes, control the rotation axis to rotate by multiple angles so that the scanner scans the first calibration object at different angles, and obtain the position of the calibration point of the first calibration object in the scanning coordinate system at each angle; the first rotation axis is the A-axis or the C-axis, and the second rotation axis is another axis other than the first rotation axis; the scanning coordinate system is the coordinate system of the scanner.
[0074] Step (a2): Fit the position of the calibration point of the first calibration object in the scanning coordinate system at each angle to obtain the first motion trajectory of the calibration point of the first calibration object and the first normal vector of the plane in which it is located.
[0075] Step (a3): Determine the position of the rotation axis in the scanning coordinate system based on the center point of the first motion trajectory and the first normal vector.
[0076] Step (a4): For each of the first and second rotation axes, control the rotation axis to rotate by multiple angles. For each angle, by touching at least four points on the surface of the standard ball with the probe, the position of the ball center in the machine tool coordinate system is obtained by fitting.
[0077] Step (a5): Fit the position of the calibration point of the second calibration object in the machine tool coordinate system at each angle to obtain the second motion trajectory of the calibration point of the second calibration object and the second normal vector of the plane in which it is located.
[0078] Step (a6): Determine the position of the rotation axis in the machine tool coordinate system based on the center point of the second motion trajectory and the second normal vector.
[0079] Step (a7): Based on the positions of the first rotation axis and the second rotation axis in the scanning coordinate system, determine the first common perpendicular line of the first rotation axis and the second rotation axis in the scanning coordinate system. Take the intersection of the first common perpendicular line and the target rotation axis as the origin, the direction of the first common perpendicular line as one of the coordinate axes, and the direction of the target rotation axis as the other coordinate axis to obtain the position of the common coordinate system in the scanning coordinate system; the target rotation axis is either the first rotation axis or the second rotation axis.
[0080] Step (a8): Based on the positions of the first and second rotation axes in the machine tool coordinate system, determine the second common perpendicular line of the first and second rotation axes in the machine tool coordinate system. Take the intersection of the second common perpendicular line and the target rotation axis as the origin, the direction of the second common perpendicular line as one of the coordinate axes, and the direction of the target rotation axis as the other coordinate axis to obtain the position of the common coordinate system in the machine tool coordinate system.
[0081] Step (a9): Determine the column vector of the rotation matrix based on the three coordinate axes of the common coordinate system under the scan coordinate system.
[0082] Step (a10): Determine the translation matrix based on the position of the origin in the scanning coordinate system to obtain the first transformation matrix between the scanning coordinate system and the common coordinate system.
[0083] Step (a11): Determine the second transformation matrix between the common coordinate system and the machine tool coordinate system based on the position of the common coordinate system in the machine tool coordinate system.
[0084] Step (a12): Determine the target transformation matrix between the machine tool coordinate system and the scanning coordinate system based on the first transformation matrix and the second transformation matrix.
[0085] In this embodiment, by obtaining the positions of the first and second rotation axes of the machine tool in the scanning coordinate system and the machine tool coordinate system, respectively, the common perpendicular line in the scanning coordinate system and the machine tool coordinate system is determined. The intersection of the common perpendicular line and the rotation axis is taken as the origin, and the direction of the first common perpendicular line and the direction of the rotation axis are taken as two coordinate axes to establish a common coordinate system. Using a common transformation matrix as an intermediate matrix, the target transformation matrix between the machine tool coordinate system and the scanning coordinate system can be quickly derived. Furthermore, the establishment of the common coordinate system only requires axis calibration in the machine tool, and the establishment of the origin does not depend on the sphere center coordinates. Compared with traditional methods, this greatly reduces the error in establishing the common coordinate system, thereby improving the accuracy of the obtained target transformation matrix. In addition, the method in this embodiment avoids the cumbersome multi-point measurement and iterative optimization process in traditional calibration, achieving fast and efficient calibration, significantly shortening the calibration time, and reducing dependence on dedicated calibration equipment and complex operations, thus reducing hardware and labor costs.
[0086] It should be understood that, although the above Figure 1 In the flowchart, the steps are shown sequentially according to the arrows, and the steps (a1) to (a12) are shown sequentially according to their numbers. However, these steps are not necessarily executed in the order indicated by the arrows or numbers. Unless explicitly stated herein, there is no strict order requirement for the execution of these steps; they can be executed in other orders. Figure 1 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0087] In some embodiments, a coordinate system transformation device based on a dual-rotation axis is provided, the device including a machine tool and a scanner; the machine tool is used to implement the steps of the above-described method embodiments. The 3D scanner can be installed inside the machine tool or configured as an external device.
[0088] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 2As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a coordinate system transformation method based on a dual-rotation axis. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the computer device casing, or an external keyboard, touchpad, or mouse, etc. Those skilled in the art will understand that... Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0089] Those skilled in the art will understand that Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0090] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method embodiments.
[0091] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method embodiments.
[0092] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method embodiments.
[0093] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0094] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A coordinate system transformation method based on two rotation axes, characterized in that, The method includes: The positions of the first and second rotation axes of the machine tool in the scanning coordinate system are obtained; the first and second rotation axes are two non-parallel rotation axes in the machine tool; the scanning coordinate system is the coordinate system of the scanner. Obtain the positions of the first and second rotary axes of the machine tool in the machine tool coordinate system; Based on the positions of the first and second rotation axes in the scanning coordinate system, a first common perpendicular line between the first and second rotation axes in the scanning coordinate system is determined. Using the intersection of the first common perpendicular line and the target rotation axis as the origin, the direction of the first common perpendicular line as one coordinate axis, and the direction of the target rotation axis as the other coordinate axis, the position of the common coordinate system in the scanning coordinate system is obtained; the target rotation axis is either the first or the second rotation axis. Based on the positions of the first and second rotation axes in the machine tool coordinate system, a second common perpendicular line between the first and second rotation axes in the machine tool coordinate system is determined. The intersection of the second common perpendicular line and the target rotation axis is taken as the origin, the direction of the second common perpendicular line is taken as one coordinate axis, and the direction of the target rotation axis is taken as the other coordinate axis. The position of the common coordinate system in the machine tool coordinate system is then obtained. The first transformation matrix between the scanning coordinate system and the common coordinate system is determined based on the position of the common coordinate system in the scanning coordinate system; Determine the second transformation matrix between the common coordinate system and the machine tool coordinate system based on the position of the common coordinate system in the machine tool coordinate system; The target transformation matrix between the machine tool coordinate system and the scanning coordinate system is determined based on the first transformation matrix and the second transformation matrix.
2. The method according to claim 1, characterized in that, The process of obtaining the positions of the first and second rotary axes of the machine tool in the scanning coordinate system includes: For each of the first and second rotation axes, the rotation axis is controlled to rotate by multiple angles so that the scanner scans the first calibration object at different angles, and obtains the position of the calibration point of the first calibration object in the scanning coordinate system at each angle; By fitting the position of the calibration point of the first calibration object in the scanning coordinate system at each angle, the first motion trajectory of the calibration point of the first calibration object and the first normal vector of the plane in which it is located are obtained; The position of the rotation axis in the scanning coordinate system is determined based on the center point of the first motion trajectory and the first normal vector.
3. The method according to claim 1, characterized in that, The process of obtaining the positions of the first and second rotary axes of the machine tool in the machine tool coordinate system includes: For each of the first and second rotary axes, the rotary axis is controlled to rotate by multiple angles. For each angle, the position of the calibration point of the second calibration object in the machine tool coordinate system is determined by touching the second calibration object with the probe. By fitting the position of the calibration point of the second calibration object in the machine tool coordinate system at various angles, the second motion trajectory of the calibration point of the second calibration object and the second normal vector of the plane in which it is located are obtained; The position of the rotation axis in the machine tool coordinate system is determined based on the center point of the second motion trajectory and the second normal vector.
4. The method according to claim 3, characterized in that, The second calibration object is a standard sphere, and the calibration point of the second calibration object is the center of the standard sphere; The step of determining the position of the calibration point of the second calibration object in the machine tool coordinate system by touching the second calibration object with the probe includes: By touching at least four points on the surface of the standard sphere with a probe, the position of the sphere's center in the machine tool coordinate system is obtained through fitting.
5. The method according to claim 1, characterized in that, Determining the first transformation matrix between the scanning coordinate system and the common coordinate system based on the position of the common coordinate system in the scanning coordinate system includes: The column vector of the rotation matrix is determined based on the three coordinate axes of the common coordinate system under the scan coordinate system; The translation matrix is determined based on the position of the origin in the scanning coordinate system to obtain the first transformation matrix between the scanning coordinate system and the common coordinate system.
6. The method according to any one of claims 1 to 5, characterized in that, The machine tool is a five-axis machine tool, the first rotary axis is either the A-axis or the C-axis, and the second rotary axis is another axis other than the first rotary axis.
7. A coordinate system transformation device based on two rotation axes, characterized in that, The apparatus includes a machine tool and a scanner; the machine tool is used to perform the steps of the method according to any one of claims 1 to 6.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.