A high-precision calibration method and storage medium
By acquiring the three-dimensional coordinates of multiple points under the rotation of a five-axis machine tool, establishing personalized condition constraints and performing linear programming, the problem of the influence of calibration ball wear error was solved, and higher precision and stable rotary axis calibration was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HUAHAN WEIYE TECH
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-30
AI Technical Summary
The existing rotation center calibration method for five-axis machine tools fails to effectively identify and isolate the wear error of the calibration ball, resulting in low calibration accuracy and affecting the machining accuracy of the five-axis machine tool.
By collecting the three-dimensional coordinates of multiple points at each rotation, personalized condition constraints are established, the maximum deviation is optimized to reduce the interference of wear points, and a linear programming method is used to fit the sphere center, thereby achieving high-precision calibration of the rotation axis.
It improves the calibration accuracy and stability of the five-axis machine tool's rotary axes, reduces the interference of outliers on the calibration results, and achieves higher precision and more flexible calibration.
Smart Images

Figure CN122305914A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automation equipment technology, and specifically to a high-precision calibration method and storage medium. Background Technology
[0002] Existing five-axis machine tool rotation center calibration typically employs a two-step method based on a calibration ball and a trigger probe. First, under multiple rotation axis poses, spatial point coordinates on the surface of the calibration ball are acquired using instruments such as probes. Based on the obtained spatial point coordinates, the coordinates of the calibration ball's center in each pose are fitted. Finally, these center coordinates are fitted with a circular trajectory in space, and the solved center position is used as the rotation center coordinates of the corresponding rotation axis.
[0003] However, in actual working conditions, the calibration ball itself has manufacturing tolerances, and long-term use inevitably leads to wear or impacts, causing its actual radius to deviate from the nominal value. That is, the radius of the calibration ball is not absolutely accurate and constant, and its surface is not a perfect geometric sphere. However, existing methods often assume that all measurement points come from an ideal standard sphere, without identifying or isolating the wear error of the calibration ball during the calculation process, but instead treating it as real geometric information for calibration. In addition, the small deviation caused by wear will be distributed to the sphere center coordinates through least squares fitting. The sphere center data with errors continues to be used as the input for the second step of circle center fitting. Its error is further transmitted through nonlinear geometric relationships and may be amplified, ultimately resulting in a significant deviation between the calculated rotation center and the actual position, thus affecting the calibration accuracy of the five-axis machine tool. Summary of the Invention
[0004] The main technical problem this invention addresses is how to more accurately and reliably calibrate the rotation center of a five-axis machine tool.
[0005] According to the first aspect, one embodiment provides a high-precision calibration method, comprising:
[0006] For any rotation axis that needs to be calibrated: obtain the three-dimensional coordinates of multiple points on the surface of the calibration sphere with an unknown radius under different rotation amounts, and obtain the first set of spatial points corresponding to different rotation amounts; establish condition constraints based on the three-dimensional coordinates of each point in the first set of spatial points corresponding to each rotation amount, and obtain the actual sphere center coordinates corresponding to that rotation amount;
[0007] The second set of spatial points is obtained based on the actual sphere center coordinates corresponding to all rotation amounts. Conditional constraints are established based on the actual sphere center coordinates corresponding to each rotation amount in the second set of spatial points to obtain the axis center coordinates corresponding to the rotation axis.
[0008] In some embodiments, the step of establishing conditional constraints based on the three-dimensional coordinates of each point in the first spatial point set corresponding to each rotation amount, and obtaining the actual sphere center coordinates corresponding to that rotation amount, includes:
[0009] For any rotation amount: obtain the initial sphere center coordinates and initial radius based on the first spatial point set corresponding to the rotation amount, and obtain the initial first parameter vector;
[0010] Based on the three-dimensional coordinates of each point in the first spatial point set and the initial first parameter vector, the first parameter vector is iteratively updated to obtain the actual sphere center coordinates corresponding to the rotation amount;
[0011] In any iteration update: based on the three-dimensional coordinates of each point in the first spatial point set and the first parameter vector corresponding to the iteration number, the deviation metric of each point at the current iteration number is obtained; based on the deviation metric of each point at the current iteration number, the condition constraints corresponding to that point are established; if each point satisfies its corresponding condition constraints, the first parameter vector is updated; based on the updated first parameter vector, the next iteration update is performed, or the actual sphere center coordinates corresponding to the rotation amount are obtained.
[0012] According to a second aspect, one embodiment provides a storage medium storing a computer program that can be executed by a processor to implement the above-described high-precision calibration method.
[0013] According to the high-precision calibration method and storage medium of the above embodiment, corresponding condition constraints are established based on the deviations between multiple points collected at different rotation amounts of each rotation axis and the surface of a calibration sphere with an unknown radius. On the basis that each point satisfies its corresponding condition constraints, the maximum absolute deviation (i.e., the maximum deviation auxiliary variable) is minimized, thereby transforming each step of the nonlinear process of minimizing the maximum deviation auxiliary variable into a linear programming problem. Compared with the traditional method of undifferentiatedly weighting all data points, by applying personalized condition constraints to each point, differentiated weight control can be implemented for points in different regions of the sphere (such as wear points and effective points), thereby significantly reducing the interference of outliers on the sphere center fitting. Finally, the actual sphere center coordinates or the axis center coordinates of the rotation axis corresponding to each rotation amount are obtained, thereby achieving higher precision and more flexible calibration of the five-axis machine tool rotation axis and obtaining more reliable and stable calibration results. Attached Figure Description
[0014] Figure 1 This is a flowchart of a calibration method for a five-axis machine tool;
[0015] Figure 2 This is a schematic diagram of the preset image marker points;
[0016] Figure 3 This is a flowchart of a composite guidance method based on two-dimensional and three-dimensional vision;
[0017] Figure 4 This is a flowchart of a high-precision calibration method.
[0018] Figure 5 This is a flowchart of the method for obtaining the actual center coordinates of the sphere corresponding to the current rotation amount;
[0019] Figure 6 This is a flowchart of an adaptive guided trajectory generation method. Detailed Implementation
[0020] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0021] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0022] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).
[0023] With the development of VR / AR technologies and the rapid advancement of smart glasses, a large number of irregular curved surface structures exist in the manufacturing process. While 3D vision guidance based on 3D vision sensors can acquire the 3D information of the workpiece and obtain the pose of each point on the workpiece through normal vector fitting, making it easier to distinguish overlapping areas of objects and handle complex curved surfaces and irregular workpieces, it is costly, has a more complex calibration process, and requires a large amount of computation. On the other hand, while existing 2D vision guidance is cheaper, simpler to operate, and faster, it still has many significant shortcomings, especially in complex scenarios such as the processing of irregular curved surfaces. Its core limitation lies in the fact that it can only acquire two-dimensional planar information (X, Y coordinates) and cannot perceive the depth dimension (Z-axis height). In the machining of irregular curved surfaces, the workpiece surface is an irregular curved surface with complex height fluctuations and spatial posture changes. Two-dimensional vision cannot capture the height deviation and spatial tilt state of each point on the curved surface, and therefore cannot provide precise guidance signals for the Z-axis lifting and A-axis tilting of the five-axis machine tool. Therefore, the method of guidance by two-dimensional vision sensors can only be applied to workpieces with flat machining paths, which has great limitations. Moreover, the height at both ends of the straight line segment in the measurement trajectory of the point laser sensor can only estimate the height of the middle points, which is not suitable for complex 3D curved surfaces. In other words, the traditional two-dimensional vision guidance method is difficult to meet the high-precision machining and manufacturing requirements of irregular curved surfaces.
[0024] In five-axis linkage vision guidance, the calibration of the rotary axis and the generation of the vision trajectory are key technical challenges and the foundation of guidance. Taking the A-axis as an example, theoretically, the A-axis is parallel to the X-axis. However, due to manufacturing and assembly errors, the A-axis vector has an uncertain angle with the X-axis, thus requiring the calibration of the rotary axis. By calibrating the rotary axis, the center coordinates and direction vector of the rotary axis are obtained, thereby realizing the RTCP (Rotated Tool Center Point) function.
[0025] In some embodiments, the rotation axis is calibrated by combining manual measurement with a high-precision sphere. In this process, a high-precision standard sphere (i.e., calibration sphere) is placed on a rotating platform, and the coordinates of multiple points on the sphere are measured using measuring instruments such as a high-precision lever dial indicator or an electronic probe. The coordinates of the sphere center are then fitted to obtain the coordinates of the sphere center. The rotation axis to be calibrated is then rotated to different angles to obtain multiple sphere center coordinates. The rotation center and rotation vector of the calibration axis are then calculated using the sphere center coordinates.
[0026] In some embodiments, the rotation axis is calibrated by combining a three-dimensional vision sensor with a high-precision standard sphere. Specifically, the high-precision standard sphere is scanned by a three-dimensional vision sensor (such as a line laser) to directly obtain the XYZ coordinates of multiple point cloud points on the sphere surface. These coordinates are then fitted to the center coordinates of the sphere corresponding to the current pose. Subsequently, the rotation axis of the machine tool is determined to drive the standard sphere to rotate to different angles. The corresponding center coordinates of the sphere are repeatedly scanned and fitted at each angle, thereby obtaining the center coordinates of the sphere at multiple angles. Finally, the axis coordinates and rotation vector of the rotation axis are calculated.
[0027] However, calibration methods combining manual measurement with a high-precision standard sphere are cumbersome, dependent on operator skill, prone to various uncertainties, error-prone, and lack timeliness. While calibration methods combining a 3D vision sensor with a high-precision standard sphere are simpler and can quickly fit the sphere's center, the core objective of existing sphere fitting methods is to solve for the optimal geometric parameters of the fitted sphere, including the center coordinates and radius, based on a set of spatially discrete point clouds. In practice, the least squares method is typically used to construct the objective function, followed by numerical iteration using the Gauss-Newton iteration method or the Levenberg-Marquardt (LM) optimization algorithm to minimize the distance error from the point cloud to the sphere surface, thereby stably and accurately outputting the sphere parameters. The resulting calibration accuracy is highly dependent on the geometric accuracy and surface quality of the calibration sphere. Because high-precision standard spheres have inherent manufacturing tolerances, their radius is not absolutely precise and constant. Algorithms such as least squares fitting essentially still assume that the object being fitted is an ideal sphere, and cannot distinguish between "sphere center displacement" and "local wear deformation". Local shape distortions caused by wear (such as bumps or scratches) will still be partially converted into small calculation errors of the sphere center position through the mathematical process of minimizing the residuals, thus affecting the accuracy of the rotation axis calibration and making it difficult to guarantee the stability and reliability of the calibration results.
[0028] In some embodiments, a high-precision planar calibration plate is used as a reference. Feature points on the calibration plate are collected by a two-dimensional vision sensor to determine the corresponding XY coordinates of the machine tool. Then, a point laser sensor is moved to the corresponding XY coordinate position to measure the height and obtain the Z height. Then, based on the coordinate transformation relationship between the two-dimensional vision sensor and the point laser sensor, the two-dimensional position and one-dimensional height are fused into three-dimensional spatial coordinates. The rotation axis is driven to rotate the calibration plate by multiple angles in sequence. Under different postures, the positions of the two-dimensional vision sensor and the point laser sensor are controlled to collect multiple sets of three-dimensional coordinate points. Then, these spatial points are used to fit a spatial circle. The calculated center coordinates and the normal of the circle surface are used as the center coordinates and rotation vector of the rotation axis, thereby completing the calibration of the rotation axis.
[0029] This invention addresses the issue of center offset caused by manufacturing tolerances and wear during use in existing calibration methods that rely on standard calibration balls. Instead of considering these factors, existing methods establish corresponding constraints based on the deviations between multiple points collected at different rotational speeds on each axis and the surface of a calibration ball with an unknown radius. By minimizing the maximum absolute deviation (i.e., the maximum deviation auxiliary variable) at each point while ensuring these constraints are met, the nonlinear optimization process of minimizing the maximum deviation auxiliary variable is transformed into a linear programming problem. Compared to traditional methods that indiscriminately weight all data points, this invention applies personalized constraints to each point, allowing for differentiated weighting of points in different regions of the sphere (e.g., wear points and valid points). This significantly reduces the interference of outliers on center fitting, ultimately yielding the actual center coordinates or axis coordinates for each rotational speed. This results in higher precision and more flexible calibration of the five-axis machine tool's rotational axes, leading to more reliable and stable calibration results.
[0030] Please refer to Figure 1 Some embodiments provide a calibration method for a five-axis machine tool. The five-axis machine tool is equipped with a two-dimensional vision sensor and a point laser sensor, wherein the two-dimensional vision sensor and the point laser sensor are mounted in parallel. The five-axis machine tool includes a first rotation axis and a second rotation axis. The rotation center line of the first rotation axis is parallel to the Z-axis, and the rotation center line of the second rotation axis is parallel to either the X-axis or the Y-axis. The calibration method for the five-axis machine tool includes the following steps:
[0031] Step S100: The two-dimensional vision sensor is calibrated according to the first rotation axis to obtain the camera tool transformation relationship, which is used to determine the horizontal and vertical coordinates of the corresponding positions in the machine coordinate system based on the pixel coordinates in the image.
[0032] By acquiring images from different positions on the same plane of preset image markers placed on the platform, and recording the three-dimensional position coordinates of the platform at this time as the reference position, and setting the rotation amount corresponding to the A-axis or B-axis to 0, a first mapping matrix is obtained. This first mapping matrix represents the coordinate transformation relationship between the Cartesian coordinates in the machine coordinate system and the pixel coordinates in the sensor coordinate system when the platform is at the current reference position, without considering the rotation of the first rotation axis. Then, the first rotation axis is rotated by multiple rotation angles, and the center of the circle is fitted based on the pixel coordinates of the image markers during the rotation process to obtain the Cartesian coordinates of the rotation center corresponding to the first rotation axis, and a second mapping matrix is obtained. Thus, combined with the first mapping matrix, the coordinate transformation relationship between the Cartesian coordinates and pixel coordinates is obtained when the platform is at the current reference position, considering the rotation of the first rotation axis. Finally, the camera calibration algorithm is called to obtain the camera tool transformation relationship, thereby calibrating the two-dimensional vision sensor and determining the Cartesian coordinates of any point in the image acquired by the two-dimensional vision sensor at its corresponding position in the machine coordinate system.
[0033] In this embodiment, firstly, a two-dimensional vision sensor is used to acquire images of preset image markers placed on a platform at multiple locations, obtaining Cartesian coordinates corresponding to multiple acquisition locations, as well as pixel coordinates of the image markers at those acquisition locations; wherein the Cartesian coordinates are two-dimensional coordinates that include the horizontal and vertical coordinates.
[0034] It should be noted that the preset image markers involved in this embodiment are cross-shaped positioning marks on the calibration piece, or other image markers containing a cross symbol, such as... Figure 2 As shown.
[0035] In this process, preset image markers are placed on a platform, and the platform position remains unchanged. A two-dimensional vision sensor is moved to acquire images of the preset image markers, and the image markers are made to be clearly imaged within the field of view of the two-dimensional vision sensor. The acquisition position of the two-dimensional vision sensor at this time is obtained. The acquisition position corresponding to the first time the two-dimensional vision sensor makes the image markers clearly imaged is recorded as the initial acquisition position.
[0036] Then, within the plane where the initial acquisition position is located, the Cartesian coordinates corresponding to each acquisition position and the pixel coordinates of the image marker at that acquisition position are obtained when the two-dimensional vision sensor acquires images of the image marker at multiple different acquisition positions. At this time, each acquisition position corresponds to one Cartesian coordinate and one pixel coordinate. In this embodiment, the motion control two-dimensional vision sensor moves within the Z plane where the initial acquisition position is located and acquires images of the image marker at multiple different acquisition positions, obtaining multiple sets of Cartesian coordinates and corresponding pixel coordinates of the acquisition positions. For example, 9 or 16 sets of Cartesian coordinate and pixel coordinate combinations are obtained. Based on the Cartesian coordinates and pixel coordinates corresponding to multiple acquisition positions to the first mapping matrix, the coordinate transformation relationship between the Cartesian coordinates in the machine coordinate system and the pixel coordinates in the sensor coordinate system when the first rotation axis is in the initial state (unrotated state) is obtained, that is, the coordinate transformation relationship between the Cartesian coordinates and pixel coordinates without considering the rotation of the first rotation axis.
[0037] The Cartesian coordinates of the rotation center corresponding to the first rotation axis are obtained based on the first mapping matrix and the first rotation axis. For example, the 2D vision sensor is adjusted back to its initial acquisition position. At the initial acquisition position, the 3D position coordinates of the platform and the rotation amount (both 0) of the A-axis or B-axis remain unchanged. The first rotation axis is rotated at multiple angles (more than 3 angles) to obtain the pixel coordinates corresponding to the image marker points at different rotation angles. Then, a circle center fitting is performed based on the pixel coordinates corresponding to each rotation angle to obtain the pixel coordinates of the rotation center corresponding to the first rotation axis. At this time, since the first rotation axis rotates around the Z-axis, the base... After fitting the pixel coordinates corresponding to the first rotation axis at different rotation angles to the center of the circle, the resulting pixel coordinates of the center of the circle are the projection points of the rotation center corresponding to the first rotation axis in the imaging plane. Then, based on the first mapping matrix and the pixel coordinates corresponding to the rotation center, the Cartesian coordinates of the rotation center corresponding to the first rotation axis are obtained. The pixel coordinates corresponding to the rotation center of the first rotation axis are transformed to the machine coordinate system through the first mapping matrix to obtain its corresponding Cartesian coordinates. The horizontal and vertical coordinates corresponding to the rotation center of the first rotation axis (C-axis) are obtained. Subsequently, the calibration process of the calibration ball is used to further determine whether there is a tilt in the C-axis direction.
[0038] Furthermore, based on the pixel coordinates corresponding to different rotation angles of the first rotation axis, the correspondence between each rotation angle and the pixel coordinates can be obtained to obtain a second mapping matrix; in this embodiment, the second mapping matrix F can be expressed as:
[0039]
[0040] Where θ represents the rotation angle of the first rotation axis, u x uy u z Let u represent the components of the unit direction vector of the first rotation axis in the X, Y, and Z directions, respectively. x 2 +u y 2 +u z 2 =1.
[0041] By combining the obtained second mapping matrix with the first mapping matrix, the Cartesian coordinates of the pixels in the acquired image corresponding to the rotation angle of the first rotation axis can be determined in the machine coordinate system when the platform is at the current reference position.
[0042] The camera tool transformation relationship is obtained based on the Cartesian coordinates of the rotation center corresponding to the first rotation axis and the Cartesian coordinates of the initial acquisition position. In this embodiment, the pixel coordinates corresponding to the image center point in the image acquired by the two-dimensional vision sensor at the initial acquisition position are obtained, and the Cartesian coordinates corresponding to the image center point are obtained based on the pixel coordinates corresponding to the image center point and the first mapping matrix.
[0043] It should be noted that, in the embodiments of the present invention, when converting pixel coordinates to machine coordinates through the first mapping matrix, the first rotation axis is assumed to be in the initial state, that is, the first rotation axis has no rotation amount. At this time, the pixel coordinates in the image can be directly converted to Cartesian coordinates in the machine coordinate system according to the first mapping matrix. However, if the first rotation axis has a rotation amount, it is necessary to determine its corresponding second mapping matrix based on the rotation amount of the first rotation axis relative to the initial state, and then determine the Cartesian coordinates of the pixel coordinates corresponding to the center point of the image in the machine coordinate system when the current loading platform is in the reference position according to the first mapping matrix and the second mapping matrix.
[0044] Next, obtain the distance between the surface of the platform and the rotation center corresponding to the second rotation axis; based on the Cartesian coordinates of the rotation center corresponding to the first rotation axis, the Cartesian coordinates of the image center point, the Cartesian coordinates of the initial acquisition position, and the distance between the platform and the rotation center corresponding to the second rotation axis, obtain the camera tool transformation relationship.
[0045] This embodiment calls a camera calibration algorithm, taking the Cartesian coordinates of the rotation center corresponding to the first rotation axis, the Cartesian coordinates of the image center point, the Cartesian coordinates of the initial acquisition position, and the distance between the platform and the rotation center corresponding to the second rotation axis as inputs to the camera calibration algorithm. This yields the camera tool transformation relationship output by the algorithm. Based on the camera tool transformation relationship, the Cartesian coordinates of any point in the image acquired by the two-dimensional vision sensor are determined according to its pixel coordinates in the machine coordinate system.
[0046] Step S110: Perform position calibration on the two-dimensional vision sensor and the point laser sensor to obtain the position offset relationship between the two-dimensional vision sensor and the point laser sensor.
[0047] In this embodiment, the three-dimensional coordinates of the two-dimensional vision sensor in the machine coordinate system are obtained when the image center of the two-dimensional vision sensor is aligned with the preset image marker point, thus obtaining the first machine coordinates. Here, the image center of the two-dimensional vision sensor being aligned with the preset image marker point means that the center of the cross fork of the two-dimensional vision sensor is aligned with the image marker point (cross-shaped image marker), and the cross edge of its cross fork is aligned with the corresponding edge of the cross-shaped image marker.
[0048] When the point laser sensor is aligned with the image marker point, the three-dimensional coordinates of the point laser sensor in the machine coordinate system are obtained to obtain the second machine coordinates, and the measurement value of the point laser sensor at this time is obtained; based on the first machine coordinate, the second machine coordinate, and the measurement value of the point laser sensor, the positional offset relationship between the two-dimensional vision sensor and the point laser sensor is obtained.
[0049] Since the relative positions of the point laser sensor and the two-dimensional vision sensor remain unchanged after they are fixed, the Z coordinates in the first and second machine coordinates are actually the same value. Therefore, the positional deviations of the point laser sensor and the two-dimensional vision sensor in the horizontal and vertical directions can be obtained based on the first and second machine coordinates.
[0050] At this point, the measured value Z0 of the point laser sensor can be regarded as the "Z coordinate zero point" of the two-dimensional vision sensor, and the measured value Z0 obtained at this time is recorded as the reference height value. When measuring other positions by point laser, such as measuring the coordinates of the laser point generated by the point laser sensor at the dot position on the calibration ball surface, the deviation between the measured value Z1 corresponding to the new measurement position and the reference height value, that is, Z1-Z0, is the Z coordinate of the two-dimensional vision sensor relative to the above "Z coordinate zero point". Combined with the positional deviation of the two in the horizontal and vertical directions, the position of the two-dimensional vision sensor is automatically adjusted so that the distance from the lens to the object surface of the two-dimensional vision sensor during the actual measurement process is consistent with that during the calibration. At this time, the image center of the two-dimensional vision sensor will automatically fall to the actual measurement position corresponding to the laser point, thereby realizing the automatic focusing of the two-dimensional vision sensor and obtaining the accurate Cartesian coordinates of each dot position.
[0051] Therefore, in this embodiment, the positional offset relationship between the two-dimensional vision sensor and the point laser sensor includes the lateral positional deviation, the longitudinal positional deviation, and the reference height value Z0. The lateral positional deviation is the difference between the horizontal coordinate in the second machine coordinate system and the horizontal coordinate in the first machine coordinate system, and the longitudinal positional deviation is the difference between the vertical coordinate in the second machine coordinate system and the vertical coordinate in the first machine coordinate system.
[0052] Step S120: For any rotation axis: Based on the camera tool transformation relationship and position offset relationship, obtain the three-dimensional coordinates of multiple points on the surface of the calibration sphere at different rotation angles through a two-dimensional vision sensor and a point laser sensor.
[0053] For any rotation angle: the point laser sensor marks multiple points on the surface of the calibration ball at the current rotation angle, thereby obtaining multiple laser points generated by the point laser sensor on the surface of the calibration ball. At this time, each marking position will generate a corresponding laser point.
[0054] In this process, the machine coordinates and corresponding measurement values corresponding to each laser point generated by the point laser sensor are obtained. Based on the positional offset relationship between the point laser sensor and the 2D vision sensor and the measurement value corresponding to each laser point, the positional adjustment amount corresponding to each laser point is obtained. Since the positional offset relationship obtained during the calibration process of the 2D vision sensor and the point laser sensor includes the positional deviations of the two in the horizontal and vertical directions, for any laser point generated at a given marking position: the positional adjustment amount of the 2D vision sensor in the horizontal and vertical directions can be determined based on the machine coordinates and positional offset relationship corresponding to the point laser sensor at that marking position. In order to ensure that the distance of the 2D vision sensor to the surface of the object (calibration ball) during the actual measurement process is consistent with the distance to the image marker point during calibration, it is necessary to continue to combine the measurement value corresponding to the laser point with the reference height value in the positional offset relationship to determine the vertical coordinate of the 2D vision sensor relative to its "Z coordinate zero point".
[0055] The position of the 2D vision sensor is adjusted according to the position adjustment amount corresponding to each laser point, and the pixel coordinates of each laser point in the corresponding image of the 2D vision sensor are obtained. Since the 2D vision sensor is adjusted according to the position adjustment amount corresponding to the current laser point, the image center of the 2D vision sensor can fall on the actual position of the corresponding laser point. Therefore, the pixel coordinates of the laser point in the corresponding image of the 2D vision sensor are actually the coordinates of the image center. Then, the horizontal and vertical coordinates of the laser point in the machine coordinate system are determined according to the pixel coordinates of each laser point and the camera tool transformation relationship, so as to obtain the Cartesian coordinates of the current laser point in the machine coordinate system. Then, the vertical coordinate of the laser point in the machine coordinate system is obtained according to the machine coordinates of each laser point and the measurement value. Finally, the three-dimensional coordinates of the corresponding point on the calibration sphere surface are obtained according to the horizontal, vertical and vertical coordinates of each laser point.
[0056] Similarly, the three-dimensional coordinates of multiple points on the calibration ball surface at each rotation angle are obtained. In this embodiment, based on the positional offset relationship between the point laser sensor and the two-dimensional vision sensor, the position of the two-dimensional vision sensor is automatically adjusted and automatically focused according to the machine coordinates and measurement values corresponding to each dot position of the point laser sensor. The XY coordinates of the laser point corresponding to the current dot position are obtained by combining the camera tool transformation relationship. The height of the laser point on the calibration ball surface relative to the Z zero plane of the machine is determined according to the difference between the machine coordinates and measurement values corresponding to the current dot position. That is, the Z coordinate of the laser point in the machine coordinate system is obtained. Thus, the three-dimensional coordinates of multiple laser points generated by the point laser sensor on the calibration ball surface at each rotation angle are obtained.
[0057] Step S130: Obtain the coordinates of the center of the sphere corresponding to each rotation angle based on the three-dimensional coordinates of multiple points corresponding to each rotation angle, and obtain the coordinates of the rotation center of the current rotation axis based on the coordinates of the center of the sphere corresponding to each rotation angle.
[0058] In some embodiments, the rotation center coordinates of the current rotation axis are obtained by fitting the three-dimensional coordinates of multiple points corresponding to each rotation angle using the least squares method, Gauss-Newton iteration method, or LM (Levenberg-Marquardt) optimization algorithm, and then fitting the center of the circle based on the obtained sphere coordinates.
[0059] However, due to the inherent manufacturing tolerances of the calibration ball, its radius is not absolutely precise and constant. Algorithms such as least squares fitting essentially still assume that the object being fitted is an ideal sphere, and cannot distinguish between "ball center displacement" and "local wear deformation". Furthermore, local shape distortion caused by wear (such as bumps or scratches) will still be partially transformed into a small calculation error of the ball center position through the mathematical process of minimizing the residual, thus affecting the accuracy of the rotation axis calibration and making it difficult to guarantee the stability and reliability of the calibration results.
[0060] This invention proposes a high-precision calibration method based on existing calibration methods that do not consider the ball center offset caused by manufacturing tolerances of the calibration ball itself and wear during use. Figure 4 As shown, this method establishes personalized condition constraints for each point corresponding to each rotation angle (or rotation amount) of the current rotation axis. It iteratively updates the constraints at each point to minimize the maximum absolute deviation between each point and the virtual sphere of unknown radius. This allows for differentiated weighting of points in different regions (such as wear points and effective points), resulting in more accurate and reliable calibration sphere information. Therefore, in this embodiment, the processes of fitting the sphere center to the three-dimensional coordinates of multiple points corresponding to each rotation angle, and fitting the circle center based on the sphere center coordinates corresponding to each rotation angle, can all be achieved using this high-precision calibration method. This allows for obtaining more accurate calibration results at a lower cost.
[0061] This embodiment acquires images of image markers at multiple locations using a 2D vision sensor to obtain the camera-tool transformation relationship. This allows the Cartesian coordinates of any pixel in the 2D vision sensor to be determined in the machine coordinate system. By pre-calibrating the positional offset relationship between the laser sensor and the 2D vision sensor, during the actual measurement of the calibration sphere surface points, based on this positional offset relationship, the measured values of the laser sensor, and the machine coordinates, the vertical coordinates of the laser point are automatically acquired, and the 2D vision sensor automatically focuses. Combined with the camera-tool transformation relationship, the XY coordinates of the laser point on the machine are automatically determined. This enables the rapid acquisition of spatial points on the calibration sphere surface and makes the obtained calibration results robust, thereby achieving low-cost, high-precision rapid calibration of the rotating axis.
[0062] Please refer to Figure 3Some embodiments provide a composite guidance method based on two-dimensional vision and three-dimensional vision. The five-axis machine tool is calibrated using the aforementioned calibration method, and a first mapping matrix and camera tool transformation relationship are obtained. The five-axis machine tool is equipped with a two-dimensional vision sensor, a three-dimensional vision sensor, and an actuator. The actuator is calibrated according to the camera tool transformation relationship and the first mapping matrix to obtain the execution tool transformation relationship, which is used to convert pixel coordinates to the execution position coordinates of the actuator. The three-dimensional vision sensor and the two-dimensional vision sensor are calibrated to align the image centers of the two-dimensional and three-dimensional vision sensors.
[0063] Specifically, the three-dimensional position coordinates of the platform and the rotation amount corresponding to the A-axis or B-axis are set as the position (i.e., reference position) in the process of obtaining the camera tool transformation relationship. The actuator is calibrated according to the camera tool transformation relationship and the first mapping matrix to obtain the actuator transformation relationship, including: obtaining the Cartesian coordinates (i.e., the XY coordinates of the machine) corresponding to the execution position of the actuator. For example, when the actuator is a dispensing head, the dispensing head is moved to any point on the platform to dispense glue, and the Cartesian coordinates of the dispensing position (corresponding to the execution position) are obtained.
[0064] Then, the execution position is image acquired by a two-dimensional vision sensor to obtain the pixel coordinates corresponding to the execution center of the execution position and the Cartesian coordinates corresponding to the acquisition position of the two-dimensional vision sensor. Based on the pixel coordinates of the execution center and the first mapping matrix, the Cartesian coordinates of the execution center are obtained. The distance between the surface of the platform and the rotation center corresponding to the second rotation axis is obtained. Based on the Cartesian coordinates of the execution position, the Cartesian coordinates corresponding to the acquisition position, the Cartesian coordinates of the execution center, the distance between the platform and the rotation center of the second rotation axis, and the camera tool transformation relationship, the execution tool transformation relationship is obtained.
[0065] For example, the Cartesian coordinates of the dispensing position are recorded when the two-dimensional vision sensor can clearly capture the dispensing position, and the dispensing area is extracted from the acquired image using image segmentation and other processing methods, thereby obtaining the pixel coordinates corresponding to the center point (i.e., the execution center) of the dispensing position.
[0066] Then, the eruption calibration algorithm is invoked, taking the Cartesian coordinates corresponding to the execution position, the Cartesian coordinates corresponding to the 2D vision sensor when the execution position can be clearly captured, the Cartesian coordinates corresponding to the execution center, the distance between the rotation center of the platform and the second rotation axis, and the camera tool transformation relationship as inputs to the algorithm, thereby obtaining the execution tool coordinate system output by the algorithm. Based on the execution tool coordinate system, the conversion between pixel coordinates and execution position coordinates of the actuator is realized, so that after the guidance trajectory is obtained based on 2D vision, it can be converted into the execution trajectory of the actuator.
[0067] Calibrate both the 3D and 2D vision sensors to align the image centers of the two-dimensional and 3D vision sensors, including:
[0068] The two-dimensional vision sensor acquires images of a calibration plate containing preset image markers. The two-dimensional vision sensor is continuously moved until the image center of the two-dimensional vision sensor is aligned with the preset image marker. At this time, the center of the cross of the two-dimensional vision sensor is aligned with the image marker (cross-shaped image marker), and the cross edge of the cross is aligned with the corresponding edge of the cross-shaped image marker.
[0069] When the image center of the two-dimensional vision sensor is aligned with the preset image marker point, the calibration piece is scanned line by line by the three-dimensional vision sensor (such as a line laser) to obtain the coordinates of the preset image marker point in the image acquired by the three-dimensional vision sensor, thus obtaining the first camera coordinates; then the coordinates of the center point of the image acquired by the three-dimensional vision sensor are obtained to obtain the second camera coordinates. By continuously adjusting the scanning starting position of the three-dimensional vision sensor, the image marker point can also be located at the image center of the three-dimensional vision sensor, so as to facilitate the subsequent detection of the edge trajectory corresponding to the current incoming material.
[0070] This embodiment obtains the offset values for each dimension based on the coordinates of the first camera and the second camera; for example, the offset values corresponding to each dimension can be expressed as:
[0071] △x=(X1-X2)×R x △y=Y1×R y -0.5s, Δz = Z2
[0072] Where △x represents the offset value in the X dimension; X1 represents the coordinate value of the first camera in the X dimension, X2 represents the coordinate value of the second camera in the X dimension, corresponding to 1 / 2 of the number of pixels in the X direction in the obtained 3D image; △y represents the offset value in the Y dimension; Y1 represents the coordinate value of the first camera in the Y dimension; S represents the scanning distance of the 3D vision sensor, corresponding to the number of pixels in the Y direction in the obtained 3D image; △z represents the offset value in the Z dimension, Z2 represents the coordinate value of the second camera in the Z dimension; R x R and Ry represent the spatial resolution corresponding to the X and Y dimensions, respectively.
[0073] The scanning start position of the 3D vision sensor is adjusted according to the offset values in each dimension, the coordinates of the second camera are updated, and the offset values of the updated second camera coordinates and the first camera coordinates in each dimension are recalculated until the offset values of the first camera coordinates and the second camera coordinates in each dimension are less than the preset threshold.
[0074] Then, based on the transformation relationship of the execution tool and the aligned 3D vision sensor, a composite guidance of 2D and 3D vision is performed. Specific vision guidance methods include:
[0075] Step S200: Obtain the initial trajectory obtained by scanning the standard workpiece with a two-dimensional vision sensor.
[0076] In some embodiments, images of a standard workpiece (template workpiece) are acquired using a two-dimensional vision sensor. By performing edge detection on the acquired images, the initial trajectory of the standard workpiece that needs to be processed (gluing or welding), i.e., the teaching trajectory, is extracted.
[0077] Step S210: Calibrate the current incoming material according to the camera tool transformation relationship and the first mapping matrix to obtain the workpiece user transformation relationship; obtain the basic trajectory corresponding to the current incoming material according to the workpiece user transformation relationship and the initial trajectory.
[0078] In this embodiment, the first preset feature point is captured by a two-dimensional vision sensor. The image is acquired by the sensor and the first preset feature point is placed on the workpiece (i.e., the current material) on the loading platform (at the reference position). For example, the first preset feature point can be extracted by a feature point extraction algorithm. When the two-dimensional vision sensor can clearly capture the first preset feature point, the Cartesian coordinates corresponding to the acquisition position of the two-dimensional vision sensor are recorded. Thus, the first acquisition position and the corresponding Cartesian coordinates and the pixel coordinates corresponding to the first preset feature point are obtained. The first preset feature point is used as the origin of the workpiece user coordinate system. The first machine coordinates corresponding to the first preset feature point are obtained according to the pixel coordinates corresponding to the first preset feature point and the first mapping matrix.
[0079] The image of the second preset feature point on the material currently being transported on the loading platform is acquired by a two-dimensional vision sensor. When the two-dimensional vision sensor can clearly capture the second preset feature point, the Cartesian coordinates corresponding to the acquisition position of the two-dimensional vision sensor are recorded. The second acquisition position and its corresponding Cartesian coordinates, as well as the pixel coordinates corresponding to the second preset feature point, are obtained. The second machine coordinates corresponding to the second preset feature point are obtained based on the pixel coordinates corresponding to the second preset feature point and the first mapping matrix.
[0080] The connection between the second preset feature point and the first preset feature point is obtained, and the theoretical angle between the obtained connection and the preset user coordinate X-axis is obtained. Based on the Cartesian coordinates corresponding to the first and second acquisition positions, the first machine coordinates, the second machine coordinates, the distance between the rotation center of the platform and the second rotation axis, and the camera-tool transformation relationship, the workpiece user transformation relationship is obtained. In this embodiment, a nine-point calibration algorithm (or other calibration algorithm) is called to obtain the machine coordinates corresponding to multiple other feature points in the current incoming material and the Cartesian coordinates of the corresponding acquisition positions. These coordinates, along with the Cartesian coordinates corresponding to the first and second acquisition positions, the first machine coordinates corresponding to the first preset feature point, the second machine coordinates corresponding to the second preset feature point, the distance between the rotation center of the platform and the second rotation axis, and the camera-tool transformation relationship, are used as input to the algorithm to obtain the workpiece user transformation relationship output by the algorithm. Based on the obtained workpiece user transformation relationship, the initial trajectory generated by the two-dimensional vision sensor is adjusted to obtain a basic trajectory that conforms to the current incoming material pose.
[0081] Step S220: Based on the basic trajectory, obtain the actual edge trajectory of the current incoming material and the offset corresponding to each actual trajectory point in the actual edge trajectory through a three-dimensional vision sensor; and compensate the basic trajectory according to the offset corresponding to each actual trajectory point in the actual edge trajectory to obtain the guiding trajectory.
[0082] In this embodiment, the offset of each actual trajectory point in the actual edge trajectory includes a first offset and a second offset. During the movement of the image center of the two-dimensional vision sensor according to the basic trajectory, the actual edge corresponding to the current incoming material in its field of view is detected by the three-dimensional vision sensor. Since the image centers of the two-dimensional vision sensor and the three-dimensional vision sensor are aligned, the three-dimensional vision sensor moves along the basic trajectory it generates. At this time, the image center of the three-dimensional vision sensor is the position corresponding to the trajectory point in the basic trajectory. That is, there is a one-to-one correspondence between the basic trajectory point in the basic trajectory and the actual trajectory point in the three-dimensional vision sensor. However, due to the complexity of the actual working conditions, there is a deviation between the basic trajectory generated by the two-dimensional vision sensor and the actual situation of the current incoming material surface. Therefore, it is necessary to obtain the offset of the basic trajectory point in the XY direction based on the deviation between the actual detected trajectory point and the corresponding image X center of the three-dimensional vision sensor. In this embodiment, the offset of the actual trajectory point relative to the image X center at this time is taken as the first offset.
[0083] Since irregular curved surfaces are arbitrary, without a unified mathematical equation, and are irregular three-dimensional surfaces, their surface heights are not consistent. Therefore, it is also necessary to consider the height of each actual trajectory point relative to the Z-zero plane of the machine tool to obtain the true height corresponding to the position that needs to be processed in the current incoming material. Therefore, in this embodiment, when the image center of the two-dimensional vision sensor moves to any basic trajectory point in the basic trajectory, the actual trajectory point detected by the three-dimensional vision sensor is obtained, and the offset of the obtained actual trajectory point relative to the Z-zero plane of the machine tool is used as the second offset.
[0084] Based on the first offset and the second offset corresponding to each actual trajectory point, compensation is performed on each basic trajectory point in the basic trajectory generated by the two-dimensional vision sensor. The pixel coordinates of each basic trajectory point are corrected by the first offset, and each basic trajectory point has its own depth information by the second offset. In this embodiment, the compensated basic trajectory is called the guiding trajectory suitable for the current incoming material.
[0085] Considering that for irregular curved surfaces, point cloud density is uneven and contour abrupt changes are obvious in complex regions such as edges and corners, detection algorithms are prone to misjudgment or deviation. While filtering and smoothing algorithms can only optimize the smoothness and continuity of the trajectory, they cannot correct edge points that are themselves falsely detected. Furthermore, a single filtering strategy struggles to simultaneously suppress noise and preserve true edges, further leading to instability in the trajectory in complex curved surfaces and corner areas. To further achieve flexible, stable, and accurate generation of guided trajectories in complex scenarios, this invention also provides an adaptive guided trajectory generation method, such as... Figure 6 As shown, the specific implementation method will be described below. This method involves online multi-segment registration of the actual edge trajectory detected by the 3D vision sensor in this embodiment with the standard trajectory point cloud in the template point cloud library. The actual edge trajectory (corresponding to the real-time trajectory point cloud) of the current incoming material is divided into multiple trajectory segments (real-time trajectory segments), and these segments are registered with multiple standard trajectory segments corresponding to the standard trajectory point cloud. Based on the registration result, the standard trajectory or the real-time trajectory (actual edge trajectory) is adaptively selected. The first offset is determined based on the coordinate deviation between the 3D coordinates of each trajectory point in the selection result and the center position of the 3D image. The base trajectory is then compensated, and finally, a guiding trajectory suitable for the current incoming material is obtained.
[0086] Step S230: Obtain the execution trajectory of the actuator based on the transformation relationship of the execution tool and the guide trajectory. The actuator processes the current incoming material according to the obtained execution trajectory.
[0087] This embodiment transforms the pixel coordinates of each point in the basic trajectory into the XY coordinates of the machine tool corresponding to the execution trajectory point by using the execution tool transformation relationship. Combined with the depth information corresponding to each basic trajectory point, the machine tool coordinates of each execution position in the execution trajectory of the execution mechanism can be determined. Then, the execution mechanism processes the current incoming material according to the obtained execution trajectory, thereby realizing the automated guided processing of irregular curved surfaces under the combined guidance of two-dimensional vision and three-dimensional vision.
[0088] This embodiment aligns the image centers of the two-dimensional vision sensor and the three-dimensional vision sensor by calibrating their positional offset relationship. As the image center of the two-dimensional vision sensor moves along its generated two-dimensional basic trajectory (a teaching trajectory suitable for the current incoming material), the three-dimensional vision sensor automatically detects the actual edge of the incoming material. The basic trajectory is compensated based on the first offset of the actual edge point relative to its image X center and the second offset relative to the machine's Z zero plane. This corrects the pixel coordinates of each basic trajectory point and gives each basic trajectory point its own depth information through the second offset. The compensated basic trajectory (guide trajectory) is then transformed into the execution trajectory of the actuator through the execution tool transformation relationship, thereby achieving adaptive guided processing of irregular curved surfaces based on the composite guidance of two-dimensional and three-dimensional vision.
[0089] Please refer to Figure 4 Some embodiments provide a high-precision calibration method, which includes the following steps:
[0090] Step S300: For any rotation axis that needs to be calibrated: obtain the three-dimensional coordinates of multiple points on the surface of the calibration sphere with unknown radius under different rotation amounts, and obtain the first spatial point set corresponding to different rotation amounts.
[0091] In this embodiment, the standard calibration ball is fixed on the calibration ball bracket and then placed on the platform. A fixing device or structure is used to prevent the calibration ball from shifting position when the five-axis machine moves. Then, for the rotation axis that needs to be calibrated, the three-dimensional coordinates of multiple points on the surface of the calibration ball are obtained under different rotation amounts. The number of points collected is no less than 4, and generally 9 to 36 points are used. The three-dimensional coordinates of all the points obtained constitute the spatial point set corresponding to the rotation amount. The spatial point set obtained at this time is called the first spatial point set. Each rotation amount corresponds to a first spatial point set. Subsequently, the ball center coordinates corresponding to the rotation amount are obtained based on the first spatial point set corresponding to the rotation amount.
[0092] For any rotation amount, the three-dimensional coordinates of multiple points on the surface of the calibration ball can be obtained by manual measurement, thereby obtaining the first spatial point set corresponding to the current rotation amount; alternatively, the three-dimensional coordinates of multiple points on the surface of the calibration ball can be obtained by scanning the surface of the calibration ball with a three-dimensional vision sensor, thereby obtaining the first spatial point set corresponding to the current rotation amount.
[0093] Step S310: Establish conditional constraints based on the three-dimensional coordinates of each point in the first spatial point set corresponding to each rotation amount, and obtain the actual sphere center coordinates corresponding to that rotation amount.
[0094] To improve the accuracy of the calibration sphere's center fitting and obtain better calibration results, this embodiment assumes that the points in the first spatial point set corresponding to each rotation amount are approximately distributed on an unknown sphere. That is, the radius of the calibration sphere is an unknown, and the actual center coordinates of the sphere corresponding to the current rotation amount are also unknown. This generates a "virtual" standard sphere. By establishing an objective function that minimizes the deviation between each point in the first spatial point set and the corresponding sphere of the virtual standard sphere, and by continuously iterating and updating the objective function, the actual center coordinates and radius of the calibration sphere with an unknown radius are finally obtained.
[0095] Assume the actual center coordinates of the calibration sphere with the unknown radius currently in use are (x... c y c , z c Its corresponding radius is r c Then the standard equation of the virtual standard sphere is (x - x c ) 2 +(y-y c ) 2 +(z-z c ) 2 =r c 2 At this point, for any point (x) in the first spatial point set... i y i , z i The directed distance d between the virtual sphere and the virtual surface of the virtual standard sphere. i It can be represented as:
[0096]
[0097] Then, by establishing corresponding constraints on the three-dimensional coordinates of each point in the first spatial point set corresponding to the current rotation, and under the condition that each point satisfies the corresponding constraints, the coordinates of the center of the virtual standard sphere and the radius are iteratively optimized until the "deviation" between all points and the virtual sphere is minimized, thus obtaining the actual center coordinates of the sphere corresponding to the current rotation. The problem of minimizing the "deviation" corresponding to all points can be transformed into finding a set of (x... c y c , z c r c This allows us to determine the maximum absolute deviation of all points from the virtual sphere, max|d. i The minimum, which is:
[0098]
[0099] Where arg min is the independent variable that minimizes the maximum absolute deviation.
[0100] Because the objective function (maximum absolute deviation max|d) i The problem is non-smooth and non-linear, and it is difficult and unstable to solve it directly using traditional non-linear optimization methods. Therefore, this embodiment introduces an auxiliary variable Γ (i.e., the maximum deviation auxiliary variable), which represents the upper bound of the current maximum absolute deviation, thereby reconstructing the problem into a constrained optimization problem to achieve an efficient and reliable solution.
[0101] In this embodiment, a relaxation condition is first introduced: let Γ = max|d i |, that is, for any point (such as the i-th point), |d i If |≤Γ all hold true, then the original problem is transformed into a problem of minimizing the auxiliary variable with the maximum deviation, i.e., finding a set of (x c y c , z c r c This minimizes the auxiliary variable for the maximum deviation, and satisfies that the deviation from any point to the virtual sphere is within the range [-Γ, Γ], that is:
[0102]
[0103] The original optimization problem, namely minimizing the deviation between each point in the first spatial point set corresponding to the current rotation and the virtual sphere, is transformed into:
[0104]
[0105] Since the above problem is a nonlinear function, it cannot be directly linearly programmed. In this embodiment, based on the three-dimensional coordinates of each point in the first spatial point set and the initial first parameter vector, the deviation metric corresponding to each point in the current iteration number is obtained. The deviation metric of each point is then locally linearly approximated by a local linear model, thereby iteratively updating the first parameter vector to obtain the actual sphere center coordinates corresponding to the rotation amount.
[0106] In this embodiment, the actual center coordinates (x, y) of the calibration sphere with an unknown radius currently in use are... c y c , z c and radius r c The corresponding first parameter vector a=[x c y c , z c r c ] T T represents the matrix transpose symbol; at this time, the deviation (i.e., deviation metric) of each point in the first spatial point set to the virtual sphere can be expressed as a function of the first parameter vector a. Taking the i-th point in the first spatial point set as an example, first obtain the distance between the point and the coordinates of the sphere's center, and then obtain the deviation between the point and the sphere's radius based on the obtained distance value. The obtained deviation is the deviation between the point and the virtual sphere, thus obtaining the deviation metric corresponding to the point:
[0107] f i (a)=||P i -P0||-r
[0108] Among them, f i (a) represents the deviation measure corresponding to the i-th point, P i Let P0 be the vector corresponding to the three-dimensional coordinates of the point, P0 be the vector corresponding to the center coordinates of the sphere in the first parameter vector a, and r be the radius in the first parameter vector a.
[0109] Subsequently, a first-order Taylor expansion is performed on the deviation metric corresponding to each point, with the first parameter vector being the specific parameter in each iteration, to construct a locally linear model. This allows for a locally linear approximation of the deviation metric at each point. Taking the k-th iteration as an example, the first parameter vector at this point is a. (k) The corresponding sphere center coordinate vector is P0. (k) The radius of the sphere is r (k) The deviation measure for the i-th point is in a = a (k) Performing a first-order Taylor expansion at the point, we get:
[0110] f i (a)=f i (a (k) )+▽f i (a(k) ) T Δa
[0111]
[0112] , , ,
[0113] Where Δa represents the increment (or offset) of the first parameter vector, Δa = a - a (k) , where a is the independent variable vector; ▽f i (a (k) ) T This represents the gradient vector.
[0114] Let the unit direction vector corresponding to the current k-th iteration be . Then the gradient vector can be expressed as [-u i (k) The corresponding local linear model is f[-1]. i (a)=f i (a (k) )+[-u i (k) ,-1]Δa; Combining the auxiliary variable of maximum deviation, the deviation measure corresponding to each point must be less than or equal to the auxiliary variable of maximum deviation, thus obtaining:
[0115] -Γ≤f i (a (k) )+[-u i (k) ,-1]Δa≤Γ
[0116] This leads to the linear inequality constraints for the i-th point corresponding to the set of variables relating the increment Δa and the maximum deviation auxiliary variable Γ, namely:
[0117] f i (a (k) )+[-u i (k) ,-1]Δa-Γ≤-f i (a (k) )
[0118] f i (a (k) )+[-u i (k) ,-1]Δa+Γ≥-f i (a (k) )
[0119] Based on the linear inequality constraint, each step of the optimization process of minimizing the maximum deviation auxiliary variable in a nonlinear manner is transformed into a linear programming problem. The first parameter vector and the maximum deviation auxiliary variable are iteratively updated under the condition that each point in the first spatial point set satisfies its corresponding condition constraint. Based on the final obtained first parameter vector, the actual center coordinates and radius of the calibration sphere with the unknown radius currently in use are determined.
[0120] In this embodiment, the specific process of establishing conditional constraints based on the three-dimensional coordinates of each point in the first spatial point set corresponding to each rotation amount, and then obtaining the actual sphere center coordinates corresponding to the current rotation amount, is as follows: Figure 5 As shown, it includes the following steps:
[0121] Step S311: For any rotation amount: Obtain the initial sphere center coordinates and initial radius based on the first spatial point set corresponding to the rotation amount, and obtain the initial first parameter vector.
[0122] The obtained initial center coordinates and initial radius are the initial center coordinates and initial radius of the calibration sphere whose current radius is unknown. For example, the initial center coordinates and initial radius can be obtained through the geometric center or the least squares method. Based on the initial center coordinates and initial radius, an initial first parameter vector is obtained, and based on this initial first parameter vector a... (1) For the first iteration update, let P0 be the vector corresponding to the current center coordinates (initial center coordinates). (1) The radius of the calibrated sphere is r. (1) .
[0123] Step S312: In any iteration update: Based on the three-dimensional coordinates of each point in the first spatial point set and the first parameter vector corresponding to the iteration number, obtain the deviation metric of each point in the current iteration number.
[0124] First, obtain the distance between each point in the first spatial point set and the coordinates of the sphere's center corresponding to the current iteration number. Then, based on the obtained distance values, calculate the deviation between each point and the sphere's radius corresponding to the current iteration number. This deviation is the deviation of the point relative to the virtual sphere (i.e., the deviation metric). Taking the i-th point in the first spatial point set as an example, the deviation metric corresponding to this point in the current k-th iteration can be expressed as:
[0125]
[0126] Among them, a (k) This represents the first parameter vector corresponding to the current k-th iteration, which includes the coordinates of the sphere's center and the radius corresponding to the current k-th iteration. Its value is obtained by the offset Δa of the first parameter vector obtained in the previous iteration. (k-1) We get, i.e., a (k) =a(k-1) +△a (k-1) ;P i P0 represents the vector corresponding to the three-dimensional coordinates of the i-th point in the first spatial point set; (k) r represents the vector corresponding to the coordinates of the sphere's center at the current k-th iteration; (k) f represents the radius corresponding to the k-th iteration; i (a (k) ) represents the deviation metric corresponding to the i-th point in the current k-th iteration.
[0127] Step S313: Establish the condition constraints for each point based on the deviation metric corresponding to the current iteration number.
[0128] In this embodiment, for the i-th point in the first spatial point set: obtain the first parameter vector of the current k-th iteration, which is a (k) And based on the deviation metric corresponding to the i-th point in the k-th iteration, the local linear model of that point is obtained, and the corresponding gradient vector is calculated to obtain the unit direction vector u corresponding to the current k-th iteration. i (k) .
[0129] Obtain the auxiliary variable with the maximum deviation corresponding to the previous iteration; establish the conditional constraints corresponding to the i-th point based on the local linear model corresponding to the i-th point and the auxiliary variable with the maximum deviation corresponding to the previous iteration:
[0130]
[0131] Where k represents the current iteration number as the k-th iteration, Γ (k-1) This represents the value of the auxiliary variable indicating the maximum deviation corresponding to the (k-1)th iteration; u i (k) This represents the unit direction vector corresponding to the i-th point in the k-th iteration. ;△a (k) This represents the offset of the first parameter vector corresponding to the k-th iteration; a (k) This represents the first parameter vector corresponding to the k-th iteration.
[0132] Step S314: Update the first parameter vector if each point satisfies its corresponding condition constraints.
[0133] In this embodiment, under the condition that each point satisfies its corresponding constraints, the maximum deviation auxiliary variable is minimized to obtain the offset Δa of the first parameter vector corresponding to the current k-th iteration. (k) At this time, △a (k) =aa (k)Let 'a' be the independent variable vector. The first parameter vector is updated based on the offset of the first parameter vector corresponding to the current k-th iteration. The updated first parameter vector 'a' is then... (k+1) =a (k) +△a (k) .
[0134] Step S315: Determine whether the iteration stopping condition is met, so as to perform the next iteration update based on the updated first parameter variable, or obtain the actual ball center coordinates corresponding to the current rotation amount.
[0135] After obtaining the updated first parameter vector, it is necessary to determine whether the iteration stopping condition is met to decide whether to continue updating. This allows for the next iteration based on the updated first parameter vector, or the acquisition of the actual sphere center coordinates corresponding to the rotation amount. For example, the iteration stopping condition is considered met when the number of iterations reaches the maximum, or when the value corresponding to the maximum deviation auxiliary variable is less than a preset threshold; otherwise, the iteration stopping condition is not met.
[0136] If the iteration stopping condition is met, the iteration stops, and the actual sphere center coordinates corresponding to the rotation amount are obtained based on the first parameter vector updated in the last iteration. If the iteration stopping condition is not met, the value of the auxiliary variable corresponding to the maximum deviation in the current k-th iteration, i.e., Γ, is obtained based on the updated first parameter vector. (k) Based on the updated first parameter vector, the deviation between each point and the virtual sphere is calculated, and the maximum value of all deviations is used as the value of the maximum deviation auxiliary variable corresponding to the current k-th iteration, thereby updating the maximum deviation auxiliary variable. The next iteration is updated based on the updated first parameter vector and the value of the maximum deviation auxiliary variable corresponding to the current k-th iteration. The condition constraints corresponding to each point in the next iteration are regenerated using the updated first parameter vector and the maximum deviation auxiliary variable, thereby continuing to update the first parameter vector and the maximum deviation auxiliary variable.
[0137] Similarly, the first set of spatial points corresponding to each rotation amount of the current rotation axis is processed to obtain the actual sphere center coordinates corresponding to that rotation amount.
[0138] Step S320: Obtain the second set of spatial points based on the actual sphere center coordinates corresponding to all rotations, establish condition constraints based on the actual sphere center coordinates corresponding to each rotation in the second set of spatial points, and obtain the axis center coordinates corresponding to the current rotation axis.
[0139] Obtain the initial axis center coordinates and initial radius corresponding to the second spatial point set to obtain the initial second parameter vector; based on the three-dimensional coordinates of each point in the second spatial point set and the initial second parameter vector, iteratively update the second parameter vector to obtain the axis center coordinates corresponding to the rotation axis;
[0140] In any iteration update: based on the actual sphere center coordinates of each actual sphere center in the second spatial point set and the second parameter vector corresponding to the iteration number, obtain the deviation metric of each actual sphere center coordinate at the current iteration number; establish the condition constraints corresponding to each actual sphere center coordinate based on the deviation metric of each actual sphere center coordinate at the current iteration number; update the second parameter vector if each actual sphere center coordinate satisfies its corresponding condition constraints; perform the next iteration update based on the updated second parameter vector, or obtain the axis center coordinates corresponding to the rotation axis.
[0141] It should be noted that the process of obtaining the rotation axis center based on the second spatial point set composed of all actual sphere center coordinates in this step is the same as the method of obtaining the actual sphere center coordinates corresponding to each rotation amount based on the three-dimensional coordinates of each point in the first spatial point set corresponding to each rotation amount in step S310, and will not be repeated here.
[0142] This embodiment establishes corresponding conditional constraints based on the deviations between multiple points collected at different rotational amounts of each rotation axis and a virtual sphere of unknown radius. It then minimizes the maximum absolute deviation (i.e., the maximum deviation auxiliary variable) at each point while ensuring all points meet these constraints. This transforms each step of the nonlinear process of minimizing the maximum deviation auxiliary variable into a linear programming problem. Compared to traditional methods that indiscriminately weight all data points, this embodiment applies personalized conditional constraints to each point, enabling differentiated weighting of points in different regions of the calibration sphere surface (such as wear points and effective points). This significantly reduces the interference of outliers on the sphere center fitting, ultimately obtaining the actual sphere center coordinates or the axis center coordinates corresponding to each rotational amount. This achieves higher precision and more flexible calibration of the five-axis machine tool's rotational axes, resulting in more reliable and stable calibration results.
[0143] Please refer to Figure 6 Some embodiments provide an adaptive guidance trajectory generation method, which includes the following steps:
[0144] Step S400: Obtain a template point cloud library, which includes standard trajectory point clouds and multiple standard trajectory segments.
[0145] In this embodiment, the standard trajectory point cloud in the template point cloud library is obtained by scanning the template workpiece with a three-dimensional vision sensor, and the standard trajectory segment is obtained by decomposing the standard trajectory point cloud.
[0146] The initial trajectory point cloud is obtained based on the template point cloud corresponding to the scanned template workpiece. For example, a three-dimensional vision sensor is used to scan the template workpiece, and the initial processing trajectory, which is the initial trajectory point cloud, is obtained by sampling and feature extraction of the obtained point cloud data. The obtained initial trajectory point cloud contains the coordinates of each trajectory point and its normal vector.
[0147] Then, a standard trajectory point cloud is obtained based on the initial trajectory point cloud. To suppress noise, burrs, and discrete anomalies generated during the scanning process and prevent noise from being misidentified as real edges, thus ensuring the accuracy and stability of contour extraction, the 3D vision sensor performs image processing operations such as smoothing on the template workpiece point cloud data collected before detecting the initial trajectory point cloud. After extracting the initial trajectory point cloud, to further eliminate residual local fluctuations in the detected initial trajectory, making the trajectory continuous and smooth, and avoiding phenomena such as impact, vibration, or excessive tracking errors during subsequent execution by the actuator due to sharp corners, abrupt changes, or jitter in the initial trajectory, the initial trajectory point cloud also needs to be smoothed to obtain a smoothed trajectory point cloud.
[0148] However, due to errors in image smoothing by the 3D vision sensor itself, errors in further smoothing the initial trajectory point cloud, and execution deviations of the actuator (such as a dispensing head or welding head), the actual execution result after the actuator executes according to the smoothed trajectory point cloud is not the theoretically required processing trajectory (i.e., the theoretical trajectory). For example, if two parallel lines with a theoretical distance of 'd' need to be welded, the actual distance between the two weld lines may deviate from the theoretical distance by several micrometers after welding, or there may be a slight angular deviation between the two straight lines. Therefore, it is necessary to compensate the smoothed trajectory according to the actual execution effect after the actuator executes based on the current smoothed trajectory, so that the execution... The actual execution trajectory of the actuator can fall on the theoretically required processing position; therefore, this embodiment obtains the preset theoretical trajectory and the actual execution trajectory of the actuator after execution based on the smooth trajectory point cloud; the theoretical trajectory can be obtained by parsing the CAD file, and the coordinates of the trajectory points in the obtained "theoretical trajectory" are based on the design coordinate system; a theoretical model is generated by the CAD file, and it is registered with the template workpiece point cloud collected by the three-dimensional vision sensor. The pose deviation between the two is calculated, and then the coordinates of each trajectory point in the "theoretical trajectory" are transformed according to the obtained pose deviation, mapping it from the design coordinate system to the sensor coordinate system, thereby obtaining a theoretical trajectory that can be compared with the actual execution trajectory of the actuator.
[0149] The compensation value is determined based on the theoretical trajectory and the actual execution trajectory. This compensation value is often a fixed angle adjustment and translation amount. The smoothed trajectory point cloud is then compensated based on this compensation value to obtain the standard trajectory point cloud, i.e., G. m =f(G)+G c Where G represents the initial trajectory point cloud, G m G represents a standard trajectory point cloud. c represents the compensation value, used to compensate the smoothed trajectory point cloud to the theoretical trajectory; f represents the filter, used to smooth the spatial coordinates, normal vectors, and curvature of the point cloud data, such as bilateral filtering.
[0150] After obtaining the standard trajectory point cloud, it is further decomposed according to the curve type in the standard trajectory point cloud to obtain multiple standard trajectory segments corresponding to the standard trajectory point cloud. For example, the theoretical trajectory can be divided according to the curve type at different positions (such as straight line segments, right-angled arcs, curved segments, etc.) based on CAD design drawings, thereby dividing the theoretical trajectory into multiple trajectory segments. The boundary points corresponding to these trajectory segments are mapped to the sensor coordinate system to determine the boundary points corresponding to the standard trajectory point cloud extracted based on the template workpiece. This achieves the division of the standard trajectory point cloud and obtains multiple standard trajectory segments. Finally, the standard trajectory point cloud and its corresponding multiple standard trajectory segments are stored in the template point cloud library B. m In, that is Among them, G m (k) represents the kth standard trajectory segment corresponding to the standard trajectory point cloud, and n represents the number of standard trajectory segments. Subsequently, the guide trajectory is adaptively generated based on the standard trajectory point cloud in the template point cloud library and the first real-time trajectory point cloud collected in the actual processing process.
[0151] Step S410: Obtain the first real-time trajectory point cloud of the current incoming material, and perform global registration between the first real-time trajectory point cloud and the standard trajectory point cloud to obtain the first transformation matrix between the first real-time trajectory point cloud and the standard trajectory point cloud.
[0152] In this embodiment, the edge points of the incoming material are first detected in real time by a three-dimensional vision sensor to obtain the initial trajectory point cloud of the incoming material; then, the initial trajectory point cloud of the incoming material is preprocessed (i.e., smoothed) to obtain the edge trajectory point cloud of the incoming material. It should be noted that the method for obtaining the edge trajectory point cloud of the incoming material is the same as the method for obtaining the smooth trajectory point cloud of the template workpiece in step S400, and will not be repeated here.
[0153] The edge trajectory point cloud of the current incoming material is then compensated based on the compensation value to obtain the first real-time trajectory point cloud of the current incoming material. The compensation value here is the compensation value obtained in step S400. The edge trajectory point cloud of the current incoming material is compensated based on the obtained compensation value to obtain the first real-time trajectory point cloud of the current incoming material.
[0154] However, due to the adaptability of filtering and other algorithms, the first real-time trajectory point cloud obtained at this time may not be the ideal trajectory suitable for the current incoming material. Therefore, it is necessary to further judge by combining the template point cloud library to obtain a guiding trajectory that can make the actual processing position of the current incoming material fall into the theoretical processing position.
[0155] In this embodiment, the first real-time trajectory point cloud is globally coarsely registered with the standard trajectory point cloud in the template point cloud library to obtain a first registration score. Based on the obtained first registration score and a first preset score threshold, it is determined whether there is an anomaly in the generation of the currently detected first real-time trajectory point cloud. The specific value of the first preset score threshold can be set by the user.
[0156] When the first registration score is greater than or equal to the first preset score threshold, it indicates that there is no anomaly in the first real-time trajectory. At this time, it is necessary to obtain the first transformation matrix between the first real-time trajectory point cloud and the standard trajectory point cloud. When the first registration score is less than the first preset score threshold, the registration fails, and the corresponding guide trajectory generation fails. This indicates that there is a large difference between the currently generated first real-time trajectory point cloud and the standard trajectory point cloud. At this time, it is necessary to check whether there is anomaly in the production equipment or testing equipment, such as the abnormality of the scanning result caused by the large difference in the incoming materials or the product deformation caused by the abnormality of the production equipment.
[0157] Step S420: Obtain multiple real-time trajectory segments corresponding to the current incoming material based on the first transformation matrix and the first real-time trajectory point cloud.
[0158] In this embodiment, the second real-time trajectory point cloud of the current incoming material is obtained based on the first transformation matrix and the first real-time trajectory point cloud; the second real-time trajectory point cloud is decomposed based on the standard trajectory point cloud to obtain multiple real-time trajectory segments corresponding to the current incoming material.
[0159] For example, when the first registration score is greater than or equal to the first preset score threshold, it indicates that the first real-time trajectory point cloud and the standard trajectory point cloud have been successfully registered. The first real-time trajectory point cloud is then transformed using a first transformation matrix to align with the standard trajectory point cloud, resulting in a second real-time trajectory point cloud. The segmentation position of the second real-time trajectory point cloud is then determined based on the segmentation position (i.e., the boundary point) of the standard trajectory point cloud, thereby achieving the segmentation operation for the real-time trajectory corresponding to the current incoming material. Specifically, the boundary points of the standard trajectory point cloud when it is decomposed into multiple standard trajectory segments are obtained; based on the point data corresponding to these boundary points in the second real-time trajectory point cloud, the second real-time trajectory point cloud is decomposed to obtain multiple real-time trajectory segments corresponding to the current incoming material. The number of real-time trajectory segments obtained is the same as the number of standard trajectory segments. Assuming the number of standard trajectory segments is n, the number of real-time trajectory segments obtained is also n.
[0160] Step S430: Perform local registration between each real-time trajectory segment and each standard trajectory segment to obtain the first trajectory point cloud dataset.
[0161] Considering that for irregular curved surface structures, the point cloud density is uneven and the contour changes are obvious in complex areas such as edges and corners, making it easy for detection algorithms to misjudge or deviate. Filtering and smoothing algorithms can only optimize the smoothness and continuity of the trajectory, but cannot correct edge points that are themselves falsely detected. Furthermore, a single filtering strategy is difficult to balance noise suppression and preservation of true edges, further leading to instability in the trajectory in complex curved surfaces and corner areas. Global coarse registration algorithms rely on global features, and can achieve effective global registration with the standard trajectory point cloud even if there are some abnormal areas in the first real-time trajectory point cloud. That is, the current first real-time trajectory point cloud may contain local abnormal segments. If this first real-time trajectory point cloud is directly used in the machining process of the actuator, it may directly damage the local machining accuracy and surface quality. Therefore, this embodiment performs online segmented multi-level registration during actual machining to determine whether there are local abnormal segments in the first real-time trajectory point cloud, and adaptively selects the best guiding trajectory suitable for the current incoming material from the standard trajectory point cloud and the first real-time trajectory point cloud.
[0162] In this embodiment, for any real-time trajectory segment: the real-time trajectory segment and its corresponding standard trajectory segment are locally finely registered to obtain a second registration score between the real-time trajectory segment and its corresponding standard trajectory segment. At this time, n real-time trajectory segments and n standard trajectory segments generate a total of n second registration scores. The trajectory point cloud dataset is divided according to all the second registration scores to obtain a first trajectory point cloud dataset. In this embodiment, the real-time trajectory segment and the standard trajectory segment are divided according to the second registration score corresponding to each real-time trajectory segment and a second preset score threshold to obtain a first trajectory point cloud dataset, a second trajectory point cloud dataset, and a third trajectory point cloud dataset.
[0163] It should be noted that in this embodiment, the first registration score and the second registration score can be used as indicators to measure the point cloud registration results, such as the root mean square error (RMSE) of the distance or the fit score.
[0164] The first trajectory point cloud dataset is used to store abnormal trajectory segments, so that the existence of local abnormal segments in the current first real-time trajectory point cloud can be determined by whether the first trajectory point cloud dataset is empty. The second trajectory point cloud dataset is used to store the real-time trajectory segments that have been successfully registered, and the third trajectory point cloud dataset is used to store the standard trajectory segments that have been successfully registered.
[0165] When there is an abnormal segment in the first real-time trajectory, it is necessary to call the standard trajectory point cloud to guide the processing of the current incoming material. However, since the global coarse registration process regards the local abnormal segment as a valid feature and participates in the overall calculation, after the first transformation matrix obtained by global coarse registration is used to transform the coordinates of the standard trajectory point cloud, there is still a deviation from the ideal trajectory of the current incoming material. Therefore, this embodiment further obtains the corresponding transformation matrix (i.e., the second transformation matrix) based on all successfully registered trajectory segments to continue to fine-tune the standard trajectory point cloud, thereby obtaining the most suitable guiding trajectory for the current incoming material.
[0166] For example, for any real-time trajectory segment: when the second registration score corresponding to the real-time trajectory segment is less than the second preset score threshold, the real-time trajectory segment is assigned to the first trajectory point cloud dataset. The specific value of the second preset score threshold can be set by the user. That is, if the second registration score corresponding to the real-time trajectory segment is less than the second preset score threshold, the real-time trajectory segment is considered to be an abnormal trajectory segment in the first real-time trajectory point cloud and is assigned to the first trajectory point cloud dataset. When the second registration score corresponding to the real-time trajectory segment is greater than or equal to the second preset score threshold, the real-time trajectory segment is assigned to the second trajectory point cloud dataset; and when the second registration score of the real-time trajectory segment is greater than or equal to the second preset score threshold, the standard trajectory segment corresponding to the real-time trajectory segment is assigned to the third trajectory point cloud dataset; and so on, processing each real-time trajectory segment sequentially. After all real-time trajectory segments are processed, the first trajectory point cloud dataset, the second trajectory point cloud dataset, and the third trajectory point cloud dataset are obtained.
[0167] Step S440: Determine the generation method of the guide trajectory based on the first trajectory point cloud dataset, and obtain the guide trajectory of the current incoming material based on the first real-time trajectory point cloud or standard trajectory point cloud.
[0168] In this embodiment, the generation method of the guiding trajectory is determined based on whether the first trajectory point cloud dataset is an empty set. That is, the guiding trajectory is generated based on the first real-time trajectory point cloud, or based on the standard real-time trajectory point cloud.
[0169] When the first trajectory point cloud dataset is empty, it means that all real-time trajectory segments corresponding to the current incoming material have been successfully registered with all standard trajectory segments of the standard trajectory point cloud. There are no local abnormal segments in the corresponding first real-time trajectory point cloud, so the first real-time trajectory point cloud can be directly used as the guiding trajectory of the current incoming material.
[0170] When the first trajectory point cloud dataset is not empty, it indicates that there are local abnormal trajectory segments among all real-time trajectory segments corresponding to the current incoming material. In this case, it is necessary to call the standard trajectory point cloud for guided processing. To ensure processing accuracy, this embodiment obtains the guided trajectory based on the second trajectory point cloud dataset, the third trajectory point cloud dataset, and the standard trajectory point cloud. Specifically, the first trajectory is obtained based on the second trajectory point cloud dataset; the second trajectory is obtained based on all standard trajectory segments in the third trajectory point cloud dataset; the second transformation matrix is obtained based on the first trajectory and the second trajectory; and the guided trajectory is obtained based on the first transformation matrix, the second transformation matrix, and the standard trajectory point cloud. That is, the guided trajectory obtained at this time can be represented as F1. -1 ×F2 -1 ×G m Where F1 represents the first transformation matrix and F2 represents the second transformation matrix. -1 F2 represents the inverse of the first transformation matrix. -1 This represents the inverse of the second transformation matrix.
[0171] By registering the real-time trajectory (corresponding to the first trajectory) after removing abnormal trajectory segments with the corresponding trajectory in the standard trajectory point cloud (i.e., the second trajectory), the standard trajectory point cloud is further fine-tuned on the basis of global adjustment so that the final guiding trajectory is suitable for the current incoming material; subsequently, based on the obtained guiding trajectory, the current incoming material is processed by the actuator to perform processing operations such as dispensing or welding.
[0172] This embodiment generates an ideal trajectory (i.e., a standard trajectory point cloud) offline and divides it into multiple standard trajectory segments according to its line segment type, thereby generating a template point cloud library. During actual processing, the incoming material is scanned to obtain the first real-time trajectory point cloud corresponding to the incoming material. By performing global coarse registration with the standard trajectory point cloud, it is determined whether there are any abnormalities in the generation of the first real-time trajectory point cloud, and thus whether the equipment is working properly. When there are no abnormalities in the generation of the first real-time trajectory point cloud, it is also divided into multiple trajectory segments to obtain real-time trajectory segments. Then, based on the registration effect between the real-time trajectory segments and the standard trajectory segments, the standard trajectory or the real-time trajectory is adaptively selected as the guiding trajectory, thereby realizing the adaptive generation of the guiding trajectory through online segmented registration. By combining traditional teaching trajectories and real-time trajectories, the generation of guidance trajectories can be achieved more flexibly and stably in actual processing based on the actual processing conditions. This solves the problem of insufficient adaptive adaptability to complex scenarios caused by the rigid "black and white" thinking of traditional methods. It provides a robust redundancy strategy. By combining offline trajectory generation with online multi-segment registration, it solves the shortcomings of 3D vision high-precision guidance based on five-axis machine tools in terms of "efficiency", "stability" and "robustness" in manufacturing industries such as consumer electronics and automotive electronics.
[0173] Some embodiments of the present invention also disclose a storage medium storing a computer program that can be executed by a processor to implement the methods described in any of the embodiments herein.
[0174] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0175] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A high-precision calibration method, characterized in that, include: For any rotation axis that needs to be calibrated: obtain the three-dimensional coordinates of multiple points on the surface of the calibration sphere with an unknown radius under different rotation amounts, and obtain the first set of spatial points corresponding to different rotation amounts; establish condition constraints based on the three-dimensional coordinates of each point in the first set of spatial points corresponding to each rotation amount, and obtain the actual sphere center coordinates corresponding to that rotation amount; The second set of spatial points is obtained based on the actual sphere center coordinates corresponding to all rotation amounts. Conditional constraints are established based on the actual sphere center coordinates corresponding to each rotation amount in the second set of spatial points to obtain the axis center coordinates corresponding to the rotation axis.
2. The high-precision calibration method as described in claim 1, characterized in that, The step of establishing conditional constraints based on the three-dimensional coordinates of each point in the first spatial point set corresponding to each rotation amount, and obtaining the actual sphere center coordinates corresponding to that rotation amount, includes: For any rotation amount: obtain the initial sphere center coordinates and initial radius based on the first spatial point set corresponding to the rotation amount, and obtain the initial first parameter vector; Based on the three-dimensional coordinates of each point in the first spatial point set and the initial first parameter vector, the first parameter vector is iteratively updated to obtain the actual sphere center coordinates corresponding to the rotation amount; In any iteration update: based on the three-dimensional coordinates of each point in the first spatial point set and the first parameter vector corresponding to the iteration number, the deviation metric of each point at the current iteration number is obtained; based on the deviation metric of each point at the current iteration number, the condition constraints corresponding to that point are established; if each point satisfies its corresponding condition constraints, the first parameter vector is updated; based on the updated first parameter vector, the next iteration update is performed, or the actual sphere center coordinates corresponding to the rotation amount are obtained.
3. The high-precision calibration method as described in claim 2, characterized in that, The deviation metric for each point at the current iteration number is obtained by using the three-dimensional coordinates of each point in the first spatial point set and the first parameter vector corresponding to the iteration number. include: Among them, a (k) This represents the first parameter vector corresponding to the current k-th iteration, which includes the coordinates of the sphere's center and the radius corresponding to the current k-th iteration; P i P0 represents the vector corresponding to the three-dimensional coordinates of the i-th point in the first spatial point set; (k) r represents the vector corresponding to the coordinates of the sphere's center at the current k-th iteration; (k) f represents the radius corresponding to the k-th iteration; i (a (k) ) represents the deviation metric corresponding to the i-th point in the current k-th iteration.
4. The high-precision calibration method as described in claim 3, characterized in that, The step of establishing the condition constraints corresponding to each point based on the deviation metric corresponding to the current iteration number includes: For the i-th point in the first spatial point set: obtain the first parameter vector of the current k-th iteration; obtain the local linear model of the i-th point based on the deviation metric corresponding to the k-th iteration; obtain the maximum deviation auxiliary variable corresponding to the previous iteration; establish the condition constraints corresponding to the i-th point based on the local linear model corresponding to the i-th point and the maximum deviation auxiliary variable corresponding to the previous iteration.
5. The high-precision calibration method as described in claim 4, characterized in that, The step of establishing the conditional constraints corresponding to the i-th point based on the local linear model corresponding to the i-th point and the maximum deviation auxiliary variable corresponding to the previous iteration includes: Where k represents the current iteration number as the k-th iteration, Γ (k-1) This represents the value of the auxiliary variable indicating the maximum deviation corresponding to the (k-1)th iteration; u i (k) This represents the unit direction vector corresponding to the i-th point in the k-th iteration. ;△a (k) Let a represent the offset of the first parameter vector corresponding to the k-th iteration. (k) This represents the first parameter vector corresponding to the k-th iteration.
6. The high-precision calibration method as described in claim 5, characterized in that, The step of updating the first parameter vector when each point satisfies its corresponding condition constraints includes: Under the condition that each point satisfies its corresponding constraints, the maximum deviation auxiliary variable is minimized to obtain the offset of the first parameter vector corresponding to the current k-th iteration. The first parameter vector is updated based on the offset of the first parameter vector corresponding to the current k-th iteration.
7. The high-precision calibration method as described in claim 6, characterized in that, The step of performing the next iteration update based on the updated first parameter vector, or obtaining the actual sphere center coordinates corresponding to the rotation amount, includes: After obtaining the updated first parameter vector, it is also necessary to determine whether the iteration stopping condition is met; If the iteration stopping condition is met, the iteration stops, and the actual sphere center coordinates corresponding to the rotation amount are obtained based on the first parameter vector updated after the last iteration. If the iteration stopping condition is not met, obtain the value of the auxiliary variable corresponding to the maximum deviation in the current k-th iteration based on the updated first parameter vector; perform the next iteration update based on the updated first parameter vector and the value of the auxiliary variable corresponding to the current k-th iteration.
8. The high-precision calibration method as described in claim 7, characterized in that, When the number of iterations reaches the maximum number of iterations, or when the value corresponding to the maximum deviation auxiliary variable is less than a preset threshold, the iteration stopping condition is considered to be met; otherwise, the iteration stopping condition is considered not met.
9. The high-precision calibration method as described in claim 1, characterized in that, The step of establishing conditional constraints based on the actual sphere center coordinates corresponding to each rotation amount in the second spatial point set to obtain the axis center coordinates corresponding to the rotation axis includes: Obtain the initial axis coordinates and initial radius corresponding to the second set of spatial points to obtain the initial second parameter vector; Based on the three-dimensional coordinates of each point in the second spatial point set and the initial second parameter vector, the second parameter vector is iteratively updated to obtain the axis center coordinates corresponding to the rotation axis; In any iteration update: based on the actual sphere center coordinates of each actual sphere center in the second spatial point set and the second parameter vector corresponding to the iteration number, the deviation metric of each actual sphere center coordinate at the current iteration number is obtained; based on the deviation metric of each actual sphere center coordinate at the current iteration number, the condition constraints corresponding to the actual sphere center coordinate are established; if each actual sphere center coordinate satisfies its corresponding condition constraints, the second parameter vector is updated; based on the updated second parameter vector, the next iteration update is performed, or the axis center coordinates corresponding to the rotation axis are obtained.
10. A storage medium, characterized in that, The storage medium stores a computer program that can be executed by a processor to implement the method as described in any one of claims 1-9.