A visual hole deviation correction method based on adaptive multi-mode rigid transformation
By generating target images and performing hole position detection and center estimation in laser cutting equipment, usable hole points are screened, and rigid transformation mode is adaptively selected. This solves the problem of error accumulation in the visual recognition process and achieves stable hole position deviation correction and improved processing accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KAIDE INFORMATION TECH (DONGGUAN) CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing laser cutting equipment suffers from error accumulation during visual recognition, leading to processing deviations. This is especially true in the case of mirror-symmetric, equidistantly repeating hole arrays, where the visual inspection unit cannot accurately obtain the hole position correspondence, resulting in unstable compensation values and affecting processing accuracy.
The target image is generated through the human-machine interface, hole position detection and center estimation are performed, usable hole points are screened, hole position matching relationship is established, abnormal points are eliminated, rigid transformation mode is adaptively selected, pose correction amount is solved, and overall compensation is performed on the motion controller side to form a closed-loop correction process.
It reduces the cumulative error of hole position deviation, improves machining accuracy and batch consistency, reduces compensation fluctuations and trajectory execution inconsistencies, and achieves stable hole position alignment correction.
Smart Images

Figure CN122156294A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, specifically to a visual aperture deviation correction method based on adaptive multi-mode rigid transformation. Background Technology
[0002] When existing laser cutting equipment executes a CNC program, after the program reaches the preset visual recognition trigger command, the controller first initiates a visual recognition request and enters a waiting-to-position control state. This keeps the machine tool's motion axis or workpiece platform in a stable position required for recognition, ensuring that the camera is near the center of the target circular hole during visual recognition before image acquisition and calculation. Subsequently, the equipment's interactive terminal calls the visual algorithm to acquire the circular hole image and extract the hole edge, fitting the measured coordinates of one or more hole centers. A correspondence is established between these measured hole positions and the theoretical hole positions in the program or process file, and based on available... The number of holes, geometric distribution, and recognition quality are adaptively selected based on different rigid transformation modes, such as translation only and translation plus rotation. The pose correction amount that makes the theoretical hole position set fit the measured hole position set best after the rigid transformation is solved, and the fitting residual is checked for threshold. When the check passes, the pose correction amount or equivalent coordinate compensation amount is sent back to the controller, which updates the workpiece coordinate system or performs overall compensation on the subsequent cutting trajectory and continues to execute the CNC program. If the check fails, it falls back to a low-order mode (e.g., translation compensation only) or determines that the recognition has failed and enters the abnormal handling process such as reshoot / manual confirmation.
[0003] As can be seen from the above technical solutions, the existing "alignment first, then processing" model is prone to creating a chain of progressively amplified errors, which accumulate through three core stages. First, when the vision inspection unit performs hole pairing, it can only acquire hole images within a local field of view and fit coordinates before establishing a correspondence with the ideal hole position. If the workpiece hole array has features such as mirror symmetry or equidistant repetition, and based on the existing technology's reliance on local adjacency relationships and a single minimum error criterion for pairing, multiple sets of reasonably interpretable correspondences can easily emerge when there are few local hole groups and repetitive spacing relationships. This leads to ambiguity in the output hole position correspondence, laying the groundwork for initial errors in subsequent rigid transformation solutions.
[0004] Continuing with the initial error, the computational control unit enters the rigid transformation calculation stage. Although the transformation mode can be adaptively selected, the available hole points are limited by the field of view, often resulting in situations where the quantity meets the standard but the geometric constraints are weak (e.g., the distance between two holes is too short, or multiple points are approximately collinear). In this case, the rotation parameters are extremely sensitive to slight fluctuations in the hole center measurement. Coupled with the ambiguity of the previous pairing, the rotation compensation results are prone to fluctuations between batches or repeated triggering under the same conditions. Although the final compensation value is numerically determined, its stability is insufficient, leading to further accumulation of errors.
[0005] The instability accumulated in the early stages will be amplified during the compensation execution phase of the CNC machining equipment, resulting in the final machining deviation. After the compensation value generated by the calculation and control unit is sent back, it will interact with the pre-read cache, trajectory generation, and coordinate system update timing of the equipment's CNC program. If the compensation effective segment, whether the cached trajectory needs to be recalculated, and the rules for multiple compensation superposition are not clearly defined, problems such as inconsistent trajectory execution and compensation superposition drift may easily occur during equipment operation, ultimately leading to defects such as overall contour offset, batch alignment inconsistency, and abrupt changes in trajectory before and after the compensation point. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a visual aperture deviation correction method based on adaptive multi-mode rigid transformation, which can effectively solve the problems mentioned in the background technology.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a visual hole position deviation correction method based on adaptive multi-mode rigid transformation, comprising: S1. On the human-machine interface side, based on the established waiting position state and stable window state, the industrial camera is controlled to acquire hole position images, and the imaging stability of the hole position images is determined, and a target image is generated based on the determination result; S2. By performing hole position detection and center estimation on the target image, the visual detection coordinates of each hole center are obtained, and quality information is generated for each hole center. Based on the quality information, usable hole points are selected from the visual detection coordinates to form a set of usable hole points; S3. The theoretical hole position coordinates and the set of usable hole points of the workpiece are extracted. S4. Establish hole position matching relationships and perform outlier removal to obtain a set of internal point hole position pairs for rigid transformation solution, and determine the stable solvability of rigid transformation parameters for the internal point hole position pairs; S5. Based on the number of holes in the internal point hole position pairs and the stable solvability determination result, adaptively select the mode for solving rigid transformation parameters and solve the pose correction amount, and perform consistency check and residual evaluation on the pose correction amount, outputting hole position deviation compensation parameters; S6. The human-machine interface side transmits the hole position deviation compensation parameters back to the motion controller, which performs overall compensation on the cutting trajectory of the cutting equipment, and feeds back the compensation and correction to the human-machine interface side in a transactional manner to complete the hole position deviation correction.
[0008] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects: (1) This invention provides a visual hole position deviation correction method based on adaptive multi-mode rigid transformation. First, the target image is generated on the human-machine interface side, so that the subsequent recognition is based on the premise that the mechanical posture and imaging conditions are consistent and the risk of center drift caused by jitter and blur is reduced. Then, hole position detection and center estimation are performed on the target image to obtain the visual detection coordinates of each hole center, and quality information is generated for the hole center at the same time. Based on the quality information, a set of usable hole points is formed, thereby eliminating falsely detected holes, occluded holes or low-resolution holes at the source and improving the input reliability of subsequent pairing and solution. Then, the theoretical hole position coordinates of the workpiece are extracted and a hole position matching relationship is established with the set of usable hole points. Anomaly point elimination is performed to obtain a set of inner point hole position pairs. At the same time, the stability of the rigid transformation parameters of the inner point hole position pair set is determined, thereby eliminating the symmetrical hole array or local anomaly. The system avoids non-unique pairing and outlier point traction, and prevents unstable rotation compensation under geometric degradation conditions. Then, based on the number of holes in the set of internal hole positions and the result of stable solvability judgment, it adaptively selects a low-order, two-point, or multi-point solution mode and solves the pose correction amount. After performing consistency check and residual evaluation on the pose correction amount, it outputs the hole position deviation compensation parameter. This allows for stable estimation of translation and rotation under the conditions of observability and ambiguity passage, and actively reduces the order or triggers recalculation to suppress compensation fluctuations when these conditions are not met. Finally, the human-machine interface sends the hole position deviation compensation parameter back to the motion controller, which performs overall compensation on the subsequent cutting trajectory of the cutting equipment. The motion controller then atomically takes effect in a transactional manner at the safety program segment and sends back the submission result, thereby avoiding compensation half-effect and compound drift. After compensation confirmation, the CNC program continues to be executed, completing the hole position deviation correction closed loop.
[0009] (2) This invention adaptively selects a low-order solution mode, a two-point solution mode or a multi-point solution mode based on the number of holes in the set and the result of the stability determination of the internal hole position. When the number of holes is insufficient or the rotation cannot be stably estimated, it automatically limits the translation compensation to ensure that the output is repeatable. When the two-point condition is met and the baseline is sufficient, it solves quickly while taking into account the processing cycle. When the multi-point condition is met and the hole distribution is good, it uses redundant constraints to improve the stability of rotation and translation estimation, thereby reducing the risk of computable but unstable compensation fluctuations and improving batch consistency.
[0010] (3) This invention reuses the imaging stability conclusion, hole center quality information, matching ambiguity passing status and residual evaluation conclusion in the process, so that the same evidence forms a consistent closed loop constraint in multiple links such as available hole point screening, outlier point elimination, stable solution gating, mode selection and consistency verification, thereby reducing the contradictions caused by independent judgment between each step, improving the traceability of the anomaly cause location, and reducing the parameter configuration and joint debugging costs.
[0011] (4) Compared with the existing technology process, the advantages of this process are that it moves the risk from being exposed after the compensation application to four checkpoints: input screening, matching disambiguation, stable solvability gating, and consistency verification. Furthermore, it adopts a transactional atomic activation mechanism on the controller side to constrain the compensation activation boundary. Therefore, it not only reduces the probability of hidden failures that may still exceed the threshold under symmetric aperture arrays, but also suppresses batch inconsistencies caused by rotation compensation jitter under geometrically ill point sets. Moreover, it avoids the semi-activation and compound drift caused by pre-read cache and segmented trajectory from a mechanism perspective. Attached Figure Description
[0012] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of the system connection for visual recognition interaction.
[0014] Figure 2 This is a schematic diagram of the method flow of the present invention.
[0015] Figure 3 A diagram showing the center of the hole after image capture for visual recognition.
[0016] Figure 4 Two images showing the center of the hole after image capture for visual recognition.
[0017] Figure 5 This is a schematic diagram of the two-point mode correction effect.
[0018] Figure 6 The diagram shows the alignment relationship before and after solving for the pose correction.
[0019] Figure 7 A schematic diagram of the interface when visual correction compensation is in effect.
[0020] Figure 8 A schematic diagram of the interface for confirming the cutting process. Detailed Implementation
[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0022] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0023] Specifically, this invention is based on a laser cutting device with visual recognition and positioning capabilities. During the execution of a CNC program, a visual trigger command is set, and the motion controller and the human-machine interface work together to complete the hole alignment correction. When the CNC program reaches the visual trigger command, the motion controller controls the machine tool's motion axis or the workpiece platform to reach the preset recognition position and enter a waiting and stable holding state. The human-machine interface controls the industrial camera to capture images and extract the hole center coordinates within the stable window. Then, a matching relationship is established between the visually detected hole points and the theoretical hole positions in the process document, abnormal hole position pairs are eliminated, and a rigid transformation solution mode is adaptively selected to obtain the pose correction amount. After consistency verification, hole position deviation compensation parameters are generated and sent back to the motion controller. The motion controller performs overall compensation on the positioning reference or subsequent cutting trajectory in an atomic submission manner at a safe program segment where it is allowed to take effect, and continues to execute the subsequent whole segment of processing. Thus, stable alignment of the workpiece hole position and consistency of trajectory processing are achieved under conditions such as loading offset, clamping angle, or zero-point drift.
[0024] In one specific embodiment, visual hole position deviation correction can be interactively implemented based on a laser cutting CNC platform. The human-machine interface (HMI) can be deployed on the laser cutting CNC platform to realize information interaction between humans and equipment in industrial production. Through a display and input module, it provides operators with interactive functions such as process parameter configuration, visual recognition triggering, and result display. At the same time, it integrates visual image acquisition control and hole position recognition algorithms at the software layer to process the hole position images captured by the industrial camera in the visual recognition process and generate hole center coordinates, matching relationships, and correction results.
[0025] The cutting equipment can be a laser cutting machine with visual recognition and positioning function under the CNC platform of laser cutting. The laser cutting equipment includes a machine tool body, motion axes and actuators, and a motion controller for executing CNC programs and driving servo motion. In this embodiment, the motion controller can be implemented by Beckhoff's TwinCAT CNC controller system based on an industrial PC, and is referred to as PLC in this document. It is used to parse the CNC program, drive the machine tool motion axes or workpiece platform to the preset recognition position and enter the waiting position control state when visually triggered. At the same time, it receives the correction results returned from the human-machine interface and compensates and updates the subsequent cutting trajectory or positioning reference.
[0026] The aforementioned human-machine interface (HMI) and the PLC exchange data and control commands via the Beckhoff TwinCAT ADS communication protocol to complete interactive processes such as visual recognition requests, position status feedback, recognition result transmission, and compensation activation confirmation; their relationship is as follows: Figure 1 As shown, Figure 1This is a schematic diagram of the system connection for visual recognition interaction. It shows that one end of the human-machine interface communicates with the PLC through the ADS channel to achieve collaborative control of numerical control and vision. At the same time, the human-machine interface establishes an image data transmission link with the industrial camera through the network interface to complete the acquisition of hole position images and visual recognition processing. This forms a collaborative relationship in which the human-machine interface is responsible for image acquisition and recognition calculation, and the PLC is responsible for motion control and compensation execution.
[0027] Example 1: Refer to Figure 2 As shown, the present invention provides a visual aperture position deviation correction method based on adaptive multi-mode rigid transformation, including: S1. The human-machine interface side controls the industrial camera to acquire aperture position images based on the established waiting position state and stable window state, and determines the imaging stability of the aperture position images, and generates a target image based on the determination result.
[0028] The waiting-to-be-positioned state is specifically achieved when the motion controller generates a visual recognition request after detecting a preset visual trigger command, switches the CNC execution to the waiting-to-be-positioned control state, and drives the workpiece platform to position itself at the preset recognition location.
[0029] The stable window state is defined as follows: after the workpiece platform moves to the preset recognition position, it confirms that it has reached the preset stable window position according to the positioning judgment condition, and then the stable window state is determined to be established.
[0030] The above-mentioned positioning determination conditions include at least the following quantitative constraints: on each participating axis corresponding to the preset identification position, the position following error is not greater than the first error threshold, the actual speed of the axis is not greater than the first speed threshold, and the servo drive is in an enabled and alarm-free ready state; after the positioning determination conditions are met simultaneously for the first time, the motion controller enters the stabilization window timing stage. The stabilization window requires that the above-mentioned position following error constraints and speed constraints remain valid for a continuous stabilization duration, and the stabilization duration is not less than the preset stabilization duration threshold.
[0031] To ensure consistency in the mechanical conditions for image acquisition and recognition, the motion controller pauses the subsequent interpolation segment and prohibits control mode switching during the stabilization window. Control mode switching includes at least switching from positioning mode to machining interpolation mode, switching from automatic operation to manual jogging or homing mode, and re-issuing the target position of the relevant axis. This ensures that the machine tool motion axis or workpiece platform maintains a speed of zero or near zero and the position error is controlled within the stabilization window, thereby enabling the subsequent image acquisition process, hole position detection, and center estimation process to be executed under consistent mechanical posture conditions.
[0032] The aforementioned imaging stability is specifically achieved by acquiring several consecutive frames of hole position images using an industrial camera. For each frame, the human-machine interface calculates a sharpness index within a preset hole position candidate region. This sharpness index can be implemented using gradient energy, Laplacian response intensity, or edge sharpness statistics. The sharpness consistency is determined by the condition that the difference between the maximum and minimum values of the sharpness index in the consecutive frame sequence is no greater than a preset sharpness fluctuation threshold, and the minimum value of the sharpness index is no less than a preset sharpness lower limit threshold. This results in a consistent sharpness result for the hole position images. Simultaneously, the human-machine interface locates the center position of the same hole position pre-candidate region in two adjacent frames, calculates the displacement change amplitude between adjacent frames, and determines the inter-frame displacement consistency by the condition that the displacement change amplitude in adjacent frames is no greater than a preset displacement threshold. This yields an inter-frame displacement consistency result.
[0033] The pre-candidate region for hole location is a preset local area of the image surrounding the hole location to be identified in each frame of the image. It can be obtained by one of the following methods: a local window formed by projecting the theoretical hole location in the process document onto the image coordinates through the camera calibration relationship, or a local window determined based on the coarse positioning result of the hole location in the first frame of the image. The boundary of the local window is limited by the configured and fixed window size.
[0034] When both the sharpness consistency judgment condition and the inter-frame displacement consistency judgment condition are met, the imaging stability condition is determined to be met, and the frame with the highest sharpness index in the continuous frame sequence is selected as the target image; when either judgment condition is not met, the imaging stability condition is determined to be not met, and a new continuous frame sequence is acquired or the motion controller is requested to re-establish a stable window before image acquisition and target image generation are performed.
[0035] S2. By performing hole location detection and center estimation on the target image, the visual detection coordinates of each hole center are obtained. At the same time, quality information is generated for each hole center. Based on the quality information, usable hole points are selected from the visual detection coordinates to form a set of usable hole points.
[0036] Hole location detection specifically involves the human-machine interface first determining candidate regions containing target holes in the target image. These candidate regions can be obtained by projecting theoretical hole locations onto image coordinates using calibration relationships and then cropping a preset window around them. The length and width of the window are fixed by configuration and must at least cover the nominal hole location allowable deviation range. Within the candidate region, pixels are normalized, scaled, and standardized in brightness before being used as input to a convolutional neural network. The convolutional neural network includes at least an edge extraction subnetwork and a center estimation subnetwork. The edge extraction subnetwork outputs a hole edge probability map for the candidate region. Subsequently, the human-machine interface uses an edge probability not lower than a preset edge threshold as the condition for edge pixel determination and extracts edge pixel positions from the edge probability map using non-maximum suppression or thinning processing to form a hole edge point set. At the same time, the availability of the edge point set is determined by the number of edge points not being lower than a preset minimum point threshold and the circumferential distribution of edge points in the candidate region not being lower than a preset coverage threshold.
[0037] Center estimation, specifically, involves the center estimation sub-network receiving the aperture edge point set as input when the edge point set meets the availability condition, performing a fitting inference of a circular or equivalent aperture shape, and directly outputting the aperture center position coordinates.
[0038] Specifically, such as Figure 3 , Figure 4 As shown, Figure 3 A diagram showing the center of the hole after image capture for visual recognition. Figure 4 Two images are shown to represent the hole center after visual recognition image acquisition. After the motion controller enters the waiting position and maintains a stable window, the human-machine interface triggers the industrial camera to acquire an image of the target circular hole. The right screen displays the currently acquired circular hole image, with a crosshair indicating the current alignment position. Simultaneously, the hole opening fitting contour is overlaid to represent the hole edge extraction and hole shape fitting results. The left screen simultaneously displays the theoretical hole position and diameter information read from the process document. After completing the hole center estimation, it provides the recognition position coordinates and the deviation from the theoretical position, further outputting the overall offset and angle of the recognition results. This interface is used to intuitively present the complete chain of image acquisition, hole position detection, center estimation, comparison with the theoretical hole position, and deviation output during the visual recognition stage. On the one hand, it verifies the reliability of the current imaging conditions and hole center extraction; on the other hand, it uses the obtained deviation results as input for subsequent hole position matching, rigidity transformation parameter solving, and compensation parameter feedback to the motion controller for overall correction of the subsequent cutting trajectory.
[0039] Meanwhile, the convolutional neural network also outputs quality information corresponding to the hole center. The quality information includes at least the hole center confidence field, edge integrity field, edge sharpness field, hole shape consistency deviation field, and center uncertainty field.
[0040] In one specific embodiment, the convolutional neural network adopts a multi-task structure, including a shared feature extraction backbone network and connected branches for hole edge, hole center, and quality fields. The network takes candidate hole location images as input. After feature extraction by the backbone network, the hole edge branch outputs the hole edge probability result, and the hole center branch outputs the hole center location coordinates and simultaneously outputs the hole center confidence field. The hole center confidence field is output as a continuous score, with a value range fixed to zero to one during model training. The quality field branch outputs the edge integrity field, edge sharpness field, hole shape consistency deviation field, and center uncertainty field corresponding to the hole center. Furthermore, these are output in discrete grade form, with at least three grades divided into pass, critical, and fail grades. The grade meaning of each field is defined by a fixed grade mapping table.
[0041] After obtaining the hole center coordinates and corresponding quality information from the output of the convolutional neural network, the human-machine interface first performs a usability determination on each hole center result. The usability determination includes at least the following: (a) Hole center confidence determination: The hole center confidence field is compared with the hole center confidence threshold. If the hole center confidence is not lower than the threshold, it is determined to pass; otherwise, it is determined to fail and the hole center result is removed.
[0042] (ii) Edge integrity determination: Read the discrete level of the edge integrity field. When it is in the pass level, it is determined to pass. When it is in the fail level, it is determined to fail and the hole center result is removed. When it is in the critical level, the hole center result is marked as a candidate to be reduced in weight.
[0043] (iii) Edge sharpness determination: Read the discrete level of the edge sharpness field. When it is in the pass level, it is determined to pass. When it is in the fail level, it is determined to fail and the hole center result is removed. When it is in the critical level, the hole center result is marked as a candidate to be downgraded.
[0044] (iv) Hole shape consistency determination: Read the discrete level of the hole shape consistency deviation field. When it is in the pass level, it is determined to be pass. When it is in the fail level, it is determined to be fail and the hole center result is removed. When it is in the critical level, the hole center result is marked as a candidate to be reduced in weight.
[0045] (v) Determination of central uncertainty: Read the discrete level of the central uncertainty field. When it is in the pass level, it is determined to be pass. When it is in the fail level, it is determined to be fail and the hole center result is removed. When it is in the critical level, the hole center result is marked as a low-weight hole point.
[0046] After completing the above determination, if the confidence level of the hole center is passed and there are no failure levels in the three items of edge integrity, edge clarity, and hole shape consistency, and the center uncertainty is not a failure level, the hole center result is determined as a usable hole point and included in the usable hole point set; if any failure level exists, the hole center result is removed; if there is a critical level but no failure level is included, the hole center result is included in the low-weight hole point set for subsequent supplementary acquisition triggering, matching ambiguity elimination, anomaly cause determination, or process recording.
[0047] The above-mentioned hole center position coordinates are first output in the form of image coordinates, and then converted into visual inspection coordinates in the device coordinate system or workpiece coordinate system according to the pre-calibrated distortion correction and pixel-to-device coordinate conversion relationship.
[0048] S3. Extract the theoretical hole coordinates of the workpiece and establish a hole matching relationship with the set of available hole points. Perform outlier removal to obtain the set of internal point hole pairs for rigid transformation solution, and determine the stable solvability of the rigid transformation parameters for the set of internal point hole pairs.
[0049] It should be explained that before executing hole matching and compensation effectiveness control, it is necessary to first obtain the theoretical hole position coordinate information of the workpiece, and then solidify the hole position identification information corresponding to the theoretical hole position coordinate information and the set of safety program segments that allow compensation to take effect in the configuration, so as to serve as the common basis for subsequent hole matching and compensation effectiveness control.
[0050] Establishing hole position matching relationships involves the human-machine interface (HMI) obtaining a set of available hole points, reading the theoretical hole position coordinates and their corresponding hole position identifiers, and determining several candidate theoretical hole positions for each available hole point within a preset matching limit area. The preset matching limit area is jointly defined by the nominal position of the theoretical hole position, the allowable deviation range of the equipment, and the field of view coverage of the camera. The HMI then combines the candidate theoretical hole positions to form multiple candidate matching schemes, where each candidate matching scheme contains several pairs of correspondences between available hole points and theoretical hole positions.
[0051] It needs to be explained that the reason why multiple candidate matching schemes are generated in the practical application of visual aperture deviation correction is that the visual detection unit usually only obtains a portion of the measured aperture points within the field of view at the preset recognition position. However, the theoretical aperture positions in the process document are often in a mirror-symmetric, equidistantly repeated, or locally similar aperture shape array structure, which makes it possible for multiple seemingly reasonable one-to-one correspondences between the same set of measured aperture points and theoretical aperture positions. At the same time, false detections or missed detections caused by imaging noise, local occlusion, and aperture burr reflections will further reduce the uniqueness of the pairing, making it difficult to directly eliminate incorrect correspondences by relying solely on local adjacency relationships or a single minimum error criterion. Therefore, it is necessary to construct multiple candidate matching schemes and select the preferred matching relationship that meets the passing conditions and can be uniquely determined through global consistency checks and disambiguation mechanisms such as distance relationship, orientation relationship, and aperture group topology.
[0052] For each candidate matching scheme, a global consistency check is performed on the human-machine interface side. The global consistency check includes at least a distance relationship consistency check, an orientation relationship consistency check, and a hole group topology consistency check.
[0053] The distance relationship consistency check is performed by selecting several pairs of hole positions within the same hole group or covered by the same candidate scheme according to preset rules (e.g., selecting adjacent hole positions, selecting the shortest distance pairs, or selecting pairs containing boundary holes). The distances between these hole positions on the measured side and the theoretical side are compared to see if they fall within the allowable deviation threshold of the configuration. When the number of hole relationships that meet the distance deviation threshold reaches the pass condition of the configuration, and the number of hole relationships that do not meet the threshold does not exceed the conflict condition of the configuration, the candidate matching scheme is determined to pass the distance relationship check; otherwise, it is determined to fail or be suspicious, and the failure of the hole relationships is recorded as a conflict detail item.
[0054] The azimuth relationship consistency check is performed by using a certain borehole pair in the candidate scheme as a reference borehole pair. The azimuth distribution of other borehole pairs relative to the reference borehole pair is determined on both the measured and theoretical sides. The azimuth relationship is discretized into a comparable sequential relationship or quadrant relationship, such as the category relationship on the left, right, upper, and lower sides of the reference borehole pair, or the adjacent relationship ordered clockwise as the azimuth description. Then, the azimuth descriptions on the measured side and the azimuth descriptions on the theoretical side are compared item by item to see if they are consistent. The pass condition is determined by the number of consistent items reaching the configuration fixed pass condition and the number of conflict details not exceeding the configuration fixed conflict condition. When the azimuth relationship shows a systematic flip or order inconsistency on multiple borehole pairs, the azimuth relationship check of the candidate scheme is determined to be unsuccessful, and it is marked as a candidate scheme that may have mirror symmetry ambiguity to trigger subsequent anchor hole re-mining or constraint adjustment.
[0055] The borehole group topology consistency check is performed by determining the adjacency relationships within the borehole group according to the theoretical definition, such as the preset set of nearest neighbor boreholes for each borehole location or the adjacent connectivity relationships within the borehole group. In the candidate matching scheme, the adjacency relationships of the theoretical borehole locations are mapped to the measured borehole points to obtain the set of adjacency relationships that the measured side should satisfy. Then, it is checked whether there are spatial proximity relationships between the corresponding borehole points on the measured side that are consistent with the above adjacency relationships, and the number of items that satisfy the adjacency relationships and the number of conflict details are counted. When the proportion of adjacency relationships that satisfy the consistency verification within the borehole group is not less than the preset consistency proportion threshold, and the number of conflict details does not exceed the configured fixed threshold, the borehole group adjacency topology consistency check is judged to pass. Otherwise, it is judged to fail, and the borehole groups that fail are marked as objects that need to be sampled again for disambiguation or re-established for matching relationships.
[0056] Based on the verification results, candidate matching schemes are divided into three levels: pass, suspicious, and fail. The pass / fail status of a verification item is determined by whether the number of conflict details exceeds the configured allowable limit. When the number of conflict details corresponding to a verification item does not exceed the allowable limit, the verification item is considered pass; when it exceeds the allowable limit, the verification item is considered fail and counted as a conflict verification item. After completing the distance relationship consistency verification, orientation relationship consistency verification, and hole group topology consistency verification, the number of conflict verification items corresponding to the candidate matching scheme is counted, and the pass status of the candidate matching scheme is determined based on the number of conflict verification items. Specifically, when the number of conflict verification items is zero, the candidate matching scheme is considered pass; when the number of conflict verification items is one, the candidate matching scheme is considered suspicious; and when the number of conflict verification items is two or three, the candidate matching scheme is considered fail.
[0057] When a passable scheme exists, the candidate matching scheme with the largest number of hole position pairs is selected as the preferred matching relationship. When two or more candidate matching schemes simultaneously satisfy the condition of having the largest number of hole position pairs, the matching relationship is determined to be non-unique and disambiguation is triggered. After disambiguation, the hole position matching relationship establishment and passable scheme determination are re-executed until the preferred matching relationship can be uniquely determined, at which point the matching ambiguity is determined to be passed.
[0058] It should be explained that, assuming all global consistency checks pass, a larger number of hole position pairs means that the candidate matching scheme can simultaneously align and explain more measured hole points and theoretical hole positions, thereby providing more sufficient geometric constraints and higher redundancy for subsequent rigid transformation solutions. Compared to candidate schemes with fewer hole position pairs, the candidate scheme with the most hole position pairs is less likely to be misled by local hole point false detections, missed detections, or local structural symmetry. Moreover, after the outlier is removed, it is more likely to retain a sufficient number and more dispersed interior points for stable estimation of translation and rotation compensation. Therefore, when there are multiple passing schemes, using the largest number of hole position pairs as the selection principle can improve the uniqueness and verifiability of the matching relationship and reduce the risk of subsequent compensation fluctuations and overall processing deviations.
[0059] When no solution exists, the matching ambiguity is determined to be unsuccessful and disambiguation is triggered. After disambiguation, the hole position matching relationship establishment and solution determination are re-executed.
[0060] The disambiguation process first identifies the type of cause of ambiguity through the human-machine interface and generates a disambiguation strategy. The specific types of ambiguity causes include the following determination process: First, if the set of differential aperture pairs between parallel passing schemes can be matched with the configured fixed symmetrical or repetitive structure disambiguation template, the source of ambiguity is determined to be mirror symmetry of aperture array, equidistant repetition, or high similarity of local structures. The set of differential aperture pairs refers to the set of aperture pairs with inconsistent correspondence in two parallel passing schemes. Template matching means that the set of differential aperture pairs can correspond one-to-one under the template constraint and the number of aperture pairs covering the set of differential aperture pairs is not less than the preset minimum coverage threshold.
[0061] Secondly, if the stability solvability determination result for the set of interior point hole pairs is that it can be solved by translation only, or although it can be solved by rotation but the number of interior point hole pairs is not greater than the preset minimum number of rotation points and the two-point baseline does not meet the preset minimum baseline threshold, or the geometric distribution quality check of the set of interior point hole pairs fails and the number of failed items is not less than the preset minimum number of failed items threshold, then the source of the ambiguity is insufficient number of holes or degraded geometric distribution of holes; Thirdly, if the quality field of the available hole set is at the unpass level... If the number of points is not less than the preset threshold for the number of low-quality points, or the proportion of low-quality points to the number of available points is not less than the preset threshold for the proportion of low-quality points, or the total number of conflict details generated by the global consistency check is not less than the preset threshold for the number of conflict details and the conflict details are highly concentrated in a few hole pairs (i.e., the number of hole pairs that contribute the most conflict details does not exceed the preset threshold for the number of the largest concentrated hole pairs and the proportion of conflict details they contribute is not less than the preset threshold for the proportion of concentrated points), then the source of ambiguity is determined to be a falsely detected or missed hole point.
[0062] When ambiguity arises from mirror symmetry of the aperture array, equidistant repetition, or high similarity of local structures, anchor hole targets that can break the symmetry relationship are selected first from the theoretical aperture positions, and a supplementary acquisition command is issued to the motion controller. The motion controller moves to the preset recognition position corresponding to the anchor hole and enters the stabilization window under the condition of safe movement. Then, the human-machine interface re-acquires images and obtains the hole center results of the newly added hole points and incorporates them into the set of available hole points. When ambiguity arises from insufficient number of hole points or degradation of the geometric distribution of hole points, the disambiguation strategy includes supplementary acquisition to expand the hole point baseline. When ambiguity arises from falsely detected or missed hole points, the disambiguation strategy includes adjusting the candidate limitation area, imaging stability gating threshold, or hole point screening threshold to re-extract the hole center results.
[0063] It should be explained that if any of the above-mentioned source type determination conditions are not met, it is judged as other types of ambiguity and enters the fallback processing procedure. The fallback processing procedure is for other types of ambiguity, triggering an exception reason record for manual confirmation, and then entering a conservative waiting phase for disambiguation execution.
[0064] After completing the supplementary data collection or parameter adjustment, the human-machine interface side regenerates the candidate matching scheme and performs a global consistency check. If the preferred matching relationship can be uniquely determined in the scheme, the matching ambiguity is determined to be cleared and the matching relationship is output for subsequent anomaly point elimination and rigid transformation solution. Otherwise, the above disambiguation process continues until the preset retry limit is reached and the exception handling is initiated.
[0065] The outlier removal process involves the human-machine interface side determining the optimal hole position matching relationship, combining available hole points with their corresponding theoretical hole positions to form a hole position pair set, and then performing alignment error filtering on the hole position pair set. An initial alignment result for error assessment is generated on the human-machine interface side. The initial alignment result is a set of temporary alignment compensations obtained on the current hole position pair set, which is used to align the theoretical hole position as a whole to the measured hole point. The generation method is as follows: when the hole position pair set contains three or more hole position pairs, the principle of minimum deviation is used to obtain temporary translation and temporary rotation alignment compensations that can make most hole position pairs fit at the same time; when the hole position pair set contains only two hole position pairs, temporary rotation alignment compensation is obtained based on the consistency of the direction of the line connecting the two hole position pairs, and temporary translation alignment compensation is obtained by combining any hole position alignment; when the hole position pair set contains only one hole position pair, only temporary translation alignment compensation that makes the theoretical hole position coincide with the corresponding measured hole point is generated.
[0066] After applying temporary alignment compensation to the theoretical hole positions on the human-machine interface side, the alignment error is calculated for each hole position pair in the hole position pair set. The alignment error is the planar distance between the theoretical hole position and the corresponding measured hole point after alignment. Hole position pairs with alignment errors greater than a first error threshold are identified as abnormal and removed. Hole position pairs with alignment errors between the first and second error thresholds are identified as suspicious and are prioritized for verification in subsequent iterations. On the human-machine interface side, after removing abnormal hole position pairs, the initial alignment result is regenerated based on the remaining hole position pairs, and the alignment error is recalculated. The above process is iterated, with the verification specifically prioritizing the threshold determination based on the alignment error of suspicious hole position pairs, until no more hole position pairs with alignment errors exceeding the first error threshold appear or the preset maximum number of iterations is reached.
[0067] During the aforementioned elimination iteration process, the human-machine interface simultaneously applies quantitative constraints on both quantity and distribution to ensure the feasibility of subsequent solutions. The quantity constraint ensures that the number of remaining hole pairs is not less than a preset minimum quantity threshold. The distribution constraint includes at least the following: the maximum distance between the two remaining hole points is not less than a preset minimum baseline threshold, and the shorter side of the minimum enclosing rectangle of the remaining hole points is not less than the size threshold corresponding to the preset coverage threshold, thereby avoiding near-collinearity of hole points. At the same time, the area of the minimum enclosing rectangle of the remaining hole points is not less than a preset minimum coverage area threshold, thereby avoiding local concentration of hole points. When any quantity constraint or distribution constraint is not met, the elimination of abnormal points is stopped and supplementary acquisition is triggered. When the above constraints are met and the iteration ends, the remaining hole pairs are determined as the set of interior hole pairs, and the set of interior hole pairs is used for subsequent adaptive selection of solution mode and rigid transformation parameter solution.
[0068] The rigid transformation parameters include translation parameters and rotation parameters.
[0069] It should be explained that translation and rotation are used to characterize the overall pose deviation of the workpiece relative to the theoretical hole position datum. The motion controller applies the pose deviation to the subsequent CNC interpolation calculation by means of coordinate system update or overall trajectory compensation, so as to achieve alignment between the machining trajectory and the actual position of the workpiece.
[0070] The stability of the rigid transformation parameters is determined by counting the number of available holes in the set of available holes, and then making a preliminary judgment on the solvability at the point count level. When there is only one hole, it is determined that translation alone is a stable solution. When there are two holes, the distance between the two holes is calculated and compared with the configured minimum baseline threshold. If the distance between the two holes is not less than the minimum baseline threshold and the quality fields of both holes are at the pass level, it is determined that rotation is included and the solution is possible. Otherwise, it is determined that translation alone is possible or supplementary data collection is triggered. When there are multiple holes (three or more), in addition to meeting the point count condition, a geometric distribution quality check is also performed.
[0071] The aforementioned geometric distribution quality check includes at least coverage check and degradation distribution check. Coverage check is used to determine whether the spatial expansion of the aperture points within the field of view meets the minimum coverage threshold of the configuration. Degradation distribution check is used to determine whether the aperture points are in a state of near collinearity or local concentration. Specifically, this can be achieved by checking whether the short side of the minimum enclosing rectangle formed by the aperture points is not less than the degradation exclusion threshold of the configuration and whether the area of the minimum enclosing rectangle is not less than the minimum coverage area threshold of the configuration. When the coverage check passes and the degradation distribution check does not indicate near collinearity or local concentration, it is determined that rotation is included and the solution is stable. Otherwise, it is determined that translation alone is sufficient for a stable solution or triggers supplementary acquisition.
[0072] S4. Based on the number of holes in the set of internal hole positions and the results of the stability determination, adaptively select the mode for solving the rigid transformation parameters and solve the pose correction amount. Perform consistency check and residual evaluation on the pose correction amount and output the hole position deviation compensation parameters.
[0073] The modes include low-order solution mode, two-point solution mode, and multi-point solution mode.
[0074] The human-machine interface first counts the number of hole pairs corresponding to the set of internal point hole pairs, and determines the set of candidate solution modes accordingly. When there is only one hole pair, the entry condition of the low-order solution mode is met. When there are two hole pairs, the candidate entry condition of the two-point solution mode is met. When there are multiple hole pairs (three or more), the candidate entry condition of the multi-point solution mode is met.
[0075] Subsequently, the human-machine interface reads the stable solvability determination result formed for the set of internal point hole positions. The stable solvability determination result includes at least the rotationally solvable state and the matching ambiguity pass state, and uses the rotationally solvable state and the matching ambiguity pass state as the gating condition for including the rotational solution mode: When there is only one hole pair, the low-order solution mode is directly selected and only translation compensation is output. When there are two hole pairs and the rotation solvability status is solvable and the matching ambiguity clearance status is cleared, the two-point solution mode is selected to output translation and rotation compensation. When there are two hole pairs but the rotation solvability status is unsolvable or the matching ambiguity clearance status is not cleared, the solution mode is downgraded to the low-order solution mode or supplementary acquisition is triggered to enhance geometric constraints or to re-form the set of interior point hole pairs after disambiguation and then select the mode.
[0076] When there are multiple hole pairs (three or more) and the rotation is solvable and the matching ambiguity is cleared, the multi-point solution mode is selected to output translation and rotation compensation. When there are multiple hole pairs (three or more) but the rotation is not solvable, the solution mode is restricted to a low-order solution mode or supplementary acquisition is triggered to improve the hole distribution before re-judging. When there are multiple hole pairs (three or more) but the matching ambiguity is not cleared, disambiguation is triggered and the hole matching relationship is re-established before abnormal point elimination and mode selection are performed. Thus, under the common constraints of the number of hole pairs, rotation solvability and matching ambiguity, the solution mode used to solve the rigid transformation parameters is adaptively determined.
[0077] Pose corrections include translation corrections, rotation corrections, and solution mode markings.
[0078] The essence of solving the pose correction is to find a set of overall translations and, within permissible limits, an overall rotation, under the premise that the set of in-point hole pairs is already determined and the coordinates of the measured hole points and the coordinates of the theoretical hole points are on the same coordinate datum, so that the set of theoretical hole points, after this overall correction, fits the set of measured hole points as closely as possible.
[0079] The specific solution process for different solution modes is as follows: In the low-order solution mode, only the translation correction is solved. The human-machine interface side calculates the translation difference from the theoretical hole position to the corresponding measured hole position for each group of hole positions, and calculates the representative value of each translation difference as the final translation compensation (a robust representative method such as taking the average or the median can be used), without outputting the rotation compensation.
[0080] In the two-point solution mode, the human-machine interface uses two sets of hole position pairs to form theoretical and measured lines connecting the two holes, respectively. The direction difference between the two lines determines the overall rotation compensation direction and angle. Then, the theoretical hole position set is corrected overall according to this rotation compensation, and the overall translation compensation is determined by the alignment result of any hole position pair, ensuring that the rotated theoretical hole position coincides with the corresponding measured hole position. A detailed illustration is shown below. Figure 5 As shown, Figure 5This is a schematic diagram of the two-point mode correction effect, used to illustrate the process and result of quickly estimating the pose correction amount using the direction of the line formed by the two holes in the two-point solution mode. Sub-figure (a) compares and displays two sets of theoretical hole positions and detected hole positions, and uses the line formed by the two holes to represent the difference between the theoretical direction and the detected direction. It also gives the center point of the theoretical hole group and the center point of the detected hole group to reflect the overall offset. Sub-figure (b) aligns the two sets of hole positions to the same reference position with the center point of the hole group, and uses the angle relationship between the theoretical direction vector and the detected direction vector to represent the amount of rotation that needs to be compensated, which is used to quickly obtain the rotation correction direction without introducing multi-point redundancy. Sub-figure (c) shows the corrected hole position and the corrected line after applying the rotation and translation correction obtained by the two-point mode, so that the corrected hole position is aligned with the theoretical hole position and the direction is consistent. This is used to verify that the two-point mode can still output usable pose correction amount when the number of hole points is limited, thereby supporting the subsequent compensation parameter output and the overall trajectory compensation.
[0081] In the multi-point solution mode, the human-machine interface first centers the theoretical and measured hole position sets separately, translating the two sets until their respective center points coincide to eliminate the influence of overall translation. Then, the overall rotation relationship is solved based on this. This ensures that subsequent solutions only reflect differences in shape and orientation, unaffected by overall offset. Next, a relationship matrix representing directional correlation is constructed based on the correspondence between the two sets, and singular value decomposition is performed on this matrix to obtain the rotation compensation relationship that best conforms to overall consistency. This rotation compensation is then applied to the theoretical hole position set, and translation compensation is determined based on the difference in center positions between the two sets, thus obtaining an overall rotation and overall translation correction that simultaneously considers all interior hole position pairs. After obtaining the correction, the human-machine interface applies it to all interior hole position pairs, calculates the aligned residuals, and performs consistency checks and residual evaluations accordingly. If successful, the pose correction is output; otherwise, a reduced-order solution, supplementary data acquisition, or re-disambiguation is triggered.
[0082] Specifically, such as Figure 6 As shown, Figure 6The diagram illustrates the alignment relationship before and after solving the pose correction, serving to explain the process and results of solving the pose correction based on multiple sets of interior point hole positions in multi-point mode. Sub-figure (d) compares the distribution differences between theoretical hole positions and visually detected hole positions in the same coordinate system, and uses a Varinon quadrilateral formed by connecting the midpoints of the four hole sides in sequence and its corresponding center point to reflect the overall translation and rotation deviation of the hole group. Sub-figure (e) centers and aligns the theoretical hole positions and detected hole positions with the center point of the hole group as the reference, so that the two sets of points are aligned at the center point of the hole group, eliminating the influence of overall translation and highlighting the rotation difference, providing stable directional constraints for subsequent multi-point rigid registration solution. Sub-figure (f) shows the correction effect after applying the obtained pose correction to the detected hole positions or equivalently to the theoretical hole positions. After correction, the hole positions coincide with the theoretical hole positions in space, which is used to verify that the pose correction obtained by multi-point mode can achieve overall alignment of the hole position set, and provides a basis for subsequent generation of hole position deviation compensation parameters and guidance of overall compensation of cutting trajectory.
[0083] Consistency checks and residual assessments are performed. First, the pose correction is applied to the theoretical hole set to generate a corrected theoretical hole set. Then, the corrected theoretical hole set is aligned one by one with the corresponding measured hole points in the interior point hole pair set to obtain the alignment residual for each interior point hole pair. The alignment residual is defined as the planar distance between the corrected theoretical hole and the corresponding measured hole point of the hole pair. Subsequently, the human-machine interface generates at least three statistics for all alignment residuals. These statistics include at least the maximum residual, the representative residual value, and the number of out-of-limit residuals. The maximum residual is the total number of out-of-limit residuals. The maximum value in the alignment residuals, the representative value of the residuals is the residual value at the preset quantile position after all alignment residuals are sorted by size, or the median of all alignment residuals, and the number of out-of-limit residuals is the number of hole pairs whose alignment residuals are greater than the first residual threshold. The human-machine interface compares the statistics with the configured residuals through a threshold table, and determines that the residual evaluation is passed when the maximum residual is not greater than the maximum residual limit, the representative value of the residual is not greater than the upper limit of the representative value of the residual, and the number of out-of-limit residuals does not exceed the upper limit of the number of out-of-limit residuals. If any condition is not met, the residual evaluation is determined to be unsuccessful.
[0084] Simultaneously, the human-machine interface reads the matching ambiguity clearance status output during the hole matching stage. When the matching ambiguity clearance status is "passed," compensation output judgment is allowed. When the matching ambiguity clearance status is "failed," the consistency check is directly judged as failed, and disambiguation and reconstruction of the matching relationship are triggered. After the residual evaluation conclusion is formed on the human-machine interface and the matching ambiguity clearance status is "passed," the process rationality constraint judgment is further performed on the pose correction amount. The process rationality constraint judgment includes whether the translation compensation corresponding to the pose correction amount falls within the configured and fixed allowable translation range, whether the rotation compensation corresponding to the pose correction amount falls within the configured and fixed allowable rotation range, and whether the compensation mode is consistent with the stable solvability judgment result. When the residual evaluation conclusion is passed, the matching ambiguity clearance status is "passed," and the process rationality constraint judgment is passed, the consistency check is judged as passed, and the hole position deviation compensation parameter is output. When any condition is not met, the consistency check is judged as failed, and anomaly handling is initiated. Anomaly handling includes at least one of triggering supplementary acquisition, recalculating to translation compensation only, or prompting manual confirmation.
[0085] The hole position deviation compensation parameters are determined first through the human-machine interface (HMI). The compensation execution caliber is configured and fixed as either updating the positioning reference or making an overall correction to the subsequent cutting trajectory. Then, the pose correction amount is converted into coordinate correction data items that can be directly applied by the motion controller according to the compensation execution caliber. When the positioning reference is updated, the pose correction amount is converted into positioning reference correction data for updating the origin and direction of the workpiece coordinate system. When the trajectory is corrected as a whole, the pose correction amount is converted into trajectory correction data for uniformly correcting the coordinates of the subsequent interpolation trajectory. While generating the coordinate correction data items, the HMI writes the compensation mode mark into the hole position deviation compensation parameters to indicate whether this is translational compensation only or includes rotational compensation. The compensation effective start program segment is selected from the preset safe program segment set and written into the hole position deviation compensation parameters to limit the compensation effective boundary.
[0086] Finally, the human-machine interface encapsulates the coordinate correction data items, compensation mode flags, compensation effective start program segment, session identifier, version identifier, and other necessary control fields into hole position deviation compensation parameters and sends them back to the motion controller. The motion controller then applies the compensation atomically at the safe program segment where it is allowed to take effect.
[0087] In one specific embodiment, the process of writing visual accuracy correction compensation into the CNC side for effect is as follows: After the motion controller reaches the preset recognition position and completes image acquisition, the human-machine interface (HMI) side recognizes the hole position image to obtain the hole center position, and compares the recognized hole center coordinates with the theoretical coordinates of the equipment to generate a correction amount for compensating for hole position deviation; subsequently, the HMI side sends this correction amount through the communication interface and writes it into the CNC side configuration, so that subsequent hole position recognition, hole position alignment, and cutting trajectory reference are uniformly corrected according to the updated offset. Figure 7 As shown, Figure 7 This is a schematic diagram of the interface when visual correction compensation is in effect. The right area of the diagram displays the current machine tool coordinates and the center coordinates of the circle, and the recognition alignment status is presented in the image window with crosshairs and the outline of the circle. The left area provides parameters such as material type, processing conditions and cutting conditions, and provides operation items for setting visual compensation parameters, restoring default parameters, and writing compensation parameters into the CNC system. This is used to convert recognition errors into effective correction parameters and complete the writing, thereby achieving calibration and stable implementation of visual positioning accuracy.
[0088] S5. The human-machine interface side transmits the hole position deviation compensation parameters back to the motion controller, which then performs overall compensation on the cutting trajectory of the cutting equipment. After compensation and correction, the parameters are fed back to the human-machine interface side in a transactional manner to complete the hole position deviation correction.
[0089] The cutting trajectory of the cutting equipment is compensated as a whole. Specifically, when the motion controller reaches the safe program segment that is allowed to take effect, the pre-read cache / trajectory queue is overwritten and then the hole position deviation compensation parameters are applied atomically in one go to update the positioning coordinates of the cutting trajectory.
[0090] The transaction method specifically involves the motion controller generating a compensation transaction identifier and establishing a compensation transaction record after receiving the hole position deviation compensation parameters. The compensation transaction record is associated with and stores the compensation transaction identifier, coordinate system version identifier, and trajectory cache version identifier.
[0091] In one specific embodiment, before the CNC program officially executes the cutting, the human-machine interface needs to confirm the process parameters for this machining operation and configure the reference hole rules for visual recognition of the hole positions. This ensures that when the CNC program triggers visual recognition, it can capture images according to preset rules, extract the hole center, and form usable alignment input constraints. Specifically, as follows... Figure 8 As shown, Figure 8The diagram illustrates the interface for confirming cutting processes. It includes a setting area for confirming processing parameters such as sheet material type, cutting conditions, and default gas. The parameter list displays cutting parameters corresponding to the selected cutting conditions, such as speed, nozzle height, focal point, gas, and air pressure. Simultaneously, the circular hole rule area in the diagram is used to configure the number of reference holes and the recognition method for visual recognition. For example, two circular holes can be specified as recognition reference holes, or a rectangle can be constructed with two circular holes for four-hole recognition. The diagram displays recognition-related information such as the coordinates of the center point of the circular holes and the hole diameter. This enables the confirmation of processing parameters, the determination of reference hole rules, and provides input constraints for subsequent visual alignment and compensation. Example 2
[0092] Based on the premise that other conditions remain unchanged in Example 1, the above-mentioned hole location detection and center estimation process can also be implemented through traditional image processing and geometric fitting, specifically as follows: After acquiring the image and obtaining the hole position image on the human-machine interface side, a pre-candidate region containing the target hole position is first determined in the image. The pre-candidate region can be obtained by cropping a preset window from the theoretical hole position projection position. Then, denoising and contrast enhancement are performed on the pre-candidate region, and threshold segmentation combined with morphological opening and closing operations are used to remove isolated noise points and fill local gaps to obtain the binary result of the hole opening region. On this basis, the hole opening boundary is extracted and the edge pixel point set is obtained. Circle detection or circle fitting operation is performed on the edge pixel point set to obtain the hole center position coordinates. The circle detection can use Hough circle detection, and the circle fitting can use least squares circle fitting. At the same time, the number of edge points, the circumferential coverage of edge points, and whether the fitting residual falls into the configured fixed threshold are used as quality criteria. When the quality criteria are passed, the hole center position coordinates are output as the visual detection hole position coordinates. If they are not passed, a re-image is triggered or the pre-candidate region is adjusted and the above processing flow is re-executed.
[0093] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.
Claims
1. A visual aperture deviation correction method based on adaptive multi-mode rigid transformation, characterized in that, include: S1. Based on the established waiting state and stable window state, the human-machine interface controls the industrial camera to acquire hole position images, and determines the imaging stability of the hole position images, and generates target images based on the determination results. S2. By performing hole location detection and center estimation on the target image, the visual detection coordinates of each hole center are obtained. At the same time, quality information is generated for each hole center. Based on the quality information, usable hole points are selected from the visual detection coordinates and a set of usable hole points is formed. S3. Extract the theoretical hole position coordinates of the workpiece and establish a hole position matching relationship with the set of available hole points. Perform outlier point elimination to obtain the set of internal point hole position pairs for rigid transformation solution, and determine the stable solvability of rigid transformation parameters for the set of internal point hole position pairs. S4. Based on the number of holes in the set of internal hole positions and the results of the stability determination, adaptively select the mode for solving the rigid transformation parameters and solve the pose correction amount, and perform consistency check and residual evaluation on the pose correction amount, and output the hole position deviation compensation parameters. S5. The human-machine interface side transmits the hole position deviation compensation parameters back to the motion controller, which then performs overall compensation on the cutting trajectory of the cutting equipment. After compensation and correction, the parameters are fed back to the human-machine interface side in a transactional manner to complete the hole position deviation correction.
2. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 1, characterized in that, Includes the following steps: The waiting-to-be-in-position state is specifically defined as follows: after the motion controller detects a preset visual trigger command, it generates a visual recognition request and switches the CNC execution to the waiting-to-be-in-position control state. In the waiting-to-be-in-position control state, the workpiece platform is driven to position itself to the preset recognition position, and then the waiting-to-be-in-position state is established. The stable window state is specifically defined as follows: after the workpiece platform moves to the preset recognition position, it confirms that it has reached the preset stable window based on the positioning judgment condition and maintains the preset stable window. In this case, the stable window state is determined to be established. The imaging stability is specifically determined by constructing the sharpness consistency result and inter-frame displacement consistency result of the aperture image to determine the imaging stability of the aperture image, and the target image is generated when the imaging stability condition is met.
3. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 1, characterized in that, Includes the following steps: The hole location detection specifically involves identifying candidate regions containing target hole locations in the target image, and then using a convolutional neural network to extract edges from the candidate regions and obtain a set of edge points for the hole opening. The center estimation specifically involves a convolutional neural network performing a circular or equivalent hole shape fitting operation based on the hole edge point set to obtain the hole center position coordinates, and outputting the quality information corresponding to the hole center, which is collectively recorded as the hole center result. Based on the pre-defined pixel-to-device coordinate conversion relationship, the center position coordinates of the hole are converted into the visual inspection hole position coordinates in the workpiece coordinate system.
4. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 3, characterized in that, Includes the following steps: The quality information includes a hole center confidence field, an edge integrity field, an edge sharpness field, a hole shape consistency deviation field, and a center uncertainty field; The set of available holes is specifically filtered by performing an availability determination on the hole center results. The availability determination includes threshold comparison of the hole center confidence field, and level determination of the edge integrity field, edge clarity field, hole shape consistency deviation field, and center uncertainty field, respectively, to form a set of available holes.
5. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 1, characterized in that, Includes the following steps: The establishment of the hole position matching relationship specifically involves determining several candidate theoretical hole positions for each available hole point within a preset matching limit area to form a candidate matching scheme. The candidate matching scheme includes several pairs of correspondences between available hole points and theoretical hole positions. The human-machine interface side performs a global consistency check on the candidate matching scheme to obtain the hole position matching relationship. The process of removing abnormal points involves forming a set of hole pairs based on the hole position matching relationship, performing alignment error screening on the set of hole pairs, and removing a hole pair from the set of hole pairs when it is determined to be unacceptable in the alignment error screening. After eliminating abnormal hole pairs, the remaining hole pairs are identified as the set of internal point hole pairs, and the number of hole pairs in the set of internal point hole pairs is obtained.
6. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 5, characterized in that: The establishment of the hole position matching relationship also includes: For each candidate matching scheme, the candidate matching scheme that passes all global consistency check constraints is determined as the passing scheme; When there is a passable solution, the candidate matching solution with the most hole position pairs is selected as the preferred matching relationship. When there are two or more candidate matching solutions that simultaneously satisfy the condition of having the most hole position pairs, the matching relationship is determined to be not unique and disambiguation is triggered. After disambiguation, the hole position matching relationship establishment and passable solution determination are re-executed until the preferred matching relationship can be uniquely determined, and the matching ambiguity is determined to be passed. When no solution exists, the matching ambiguity is determined to be unsuccessful and disambiguation is triggered. After disambiguation, the hole position matching relationship establishment and solution determination are re-executed.
7. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to any one of claims 4-5, characterized in that, Includes the following steps: The rigid transformation parameters include translation parameters and rotation parameters; The determination of the stable solvability of the rigid transformation parameters is specifically carried out by counting the number of holes in the available hole point set and performing a geometric distribution quality check. Based on the number of holes and the geometric distribution quality check results, the stable solvability is determined to be solvable by translation only or by rotation. Then, the number of holes and the geometric distribution quality check are performed again on the set of interior hole point pairs to confirm that the two stable solvability determination results are consistent.
8. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 7, characterized in that, Includes the following steps: The modes include low-order solution mode, two-point solution mode, and multi-point solution mode; The adaptive selection specifically uses the number of hole pairs and the stable solvability determination result formed for the set of internal hole pairs to jointly adaptively select the solution mode. The stable solvability determination result includes at least the rotationally solvable and matching ambiguity pass states; The pose correction includes translation correction, rotation correction, and solution mode marking.
9. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 1, characterized in that, Includes the following steps: The consistency check and residual evaluation include at least the statistical evaluation of alignment residuals, the pass determination of matching ambiguities, and the process rationality constraint determination of pose correction amount. When the pass is achieved, hole position deviation compensation parameters are output, and when the pass is failed, anomaly handling is performed. The hole position deviation compensation parameters include coordinate correction data items, compensation mode flags, compensation effective start program segment, trajectory cache consistency processing indication, and compensation transaction identifier.
10. The visual aperture deviation correction method based on adaptive multi-mode rigid transformation according to claim 9, characterized in that, Includes the following steps: The overall compensation of the cutting trajectory of the cutting equipment is specifically performed by overwriting the pre-read cache / trajectory queue when the motion controller reaches the safe program segment that is allowed to take effect, and then applying the hole position deviation compensation parameters in an atomic manner to update the positioning coordinates of the cutting trajectory in one go. Specifically, when the motion controller receives the hole position deviation compensation parameters, it generates a compensation transaction identifier and establishes a compensation transaction record. The compensation transaction record stores the compensation transaction identifier, coordinate system version identifier, and trajectory cache version identifier in association.