Micro-cutting motion control method and device based on end-effector adaptive calibration
Patent Information
- Application Number
- CN202610814921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-08-14
- Estimated Expiration
- 2046-06-08
AI Technical Summary
第一,多源几何与传动误差耦合,难以实现统一补偿
第一,本发明通过单应性映射模型将机械传动比例误差、相机安装偏角误差、运动轴系非正交误差及透视畸变等多源耦合误差整合为一次矩阵求解,无需对单项误差单独标定与调试,简化控制逻辑与参数配置流程,大幅提升精密机电视觉系统的工程适配性与可操作性。
Smart Images

Figure CN122346001B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mechanical motion and micro-cutting technology, specifically relating to a micro-cutting motion control method and device based on adaptive calibration of the execution end. Background Technology
[0002] In precision micro-cutting operations, accurately mapping the target position in an image to the mechanical execution coordinate system is the core foundation for achieving high-precision control. However, in practical engineering applications, the calibration process is affected by the coupling of various complex factors, and the system generally suffers from the following problems, as detailed below: First, the coupling of multi-source geometric and transmission errors makes unified compensation difficult. In actual system operation, mechanical transmission mechanisms suffer from wear, backlash, and transmission ratio fluctuations, leading to a mismatch between theoretical drive pulses and actual mechanical displacements, resulting in transmission ratio errors. Furthermore, the camera's mounting orientation cannot maintain absolute perpendicularity to the mechanical platform, resulting in angular deviations between the camera coordinate system and the mechanical coordinate system. The assembly of multi-axis motion mechanisms is difficult to achieve strict orthogonality, causing non-orthogonal shear distortion of the axis system. These various types of errors are coupled with each other, and existing technologies cannot achieve unified compensation through a single model.
[0003] Second, visual scale consistency drift error. Affected by factors such as focal length adjustment, object distance changes, optical distortion, and changes in system installation status, the actual physical size corresponding to a unit pixel in the image will dynamically drift, resulting in uncertainty in the correspondence between pixel scale and true physical scale.
[0004] Third, changing the execution end tool can cause the mapping relationship to fail. In practical applications, the execution end tool needs to be changed frequently. Different tools have inherent differences in installation position and posture, which can cause changes in the pixel displacement corresponding to the same driving pulse. This can directly invalidate the visual and mechanical mapping relationship that the system has established, and recalibration is required.
[0005] Fourth, calibration media introduce parallax and operational limitations. Traditional calibration methods rely on external calibration plates, checkerboards, or other media. In precision micro-cutting scenarios, the physical thickness of the calibration plate itself can cause the calibration plane to not coincide with the actual working plane, resulting in significant parallax effects and projection deviations. Consequently, the calibration results cannot accurately reflect the motion of the execution end on the actual focal plane.
[0006] Fifth, the calibration process relies excessively on human experience, resulting in poor consistency. Existing calibration technologies require manual selection of feature points and completion of tedious physical alignment, making calibration results susceptible to the influence of operators' subjective judgment, visual fatigue, and experience level. This leads to significant differences in calibration results between different batches and different personnel, failing to meet the requirements of automated production lines for high repeatability and high reliability.
[0007] Sixth, the cumulative error of the execution path affects positioning accuracy. Existing control systems mostly adopt incremental control strategies. During the continuous execution of multiple path segments, errors caused by factors such as mechanical backlash, control delay, and numerical rounding will gradually accumulate with the number of iterations, resulting in a significant deviation between the final execution position and the target position, thus reducing trajectory accuracy and endpoint positioning accuracy. Summary of the Invention
[0008] To address the aforementioned technical problems, this invention proposes a micro-cutting motion control method and apparatus based on adaptive calibration of the execution end.
[0009] To achieve the above objectives, the technical solution of the present invention is as follows: In a first aspect, the present invention discloses a micro-cutting motion control method based on adaptive calibration of the execution end, comprising: a calibration stage, a calculation stage, and an application stage; The calibration phase includes: Step S1: Place a scale reference piece with known physical dimensions within the camera's field of view and establish a scale conversion factor between pixel scale and physical scale; Step S2: Using the execution end as the calibration feature point, control the mechanical system to drive the execution end to move along a preset trajectory, collect images of the execution end at at least four non-collinear position points and identify their pixel coordinates, use one of the position points as a reference point, calculate the pixel deviation of the other position points relative to the reference point, and synchronously record the mechanical drive pulse increment of each position point relative to the reference point to construct a calibration dataset. Step S3: Based on the at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained in step S2, establish a homography mapping model between the image coordinate system and the mechanical coordinate system, and obtain the mapping matrix through a first-order matrix solution; The accounting phase includes: Step C1: Based on the scale conversion factor, convert the target area of the microscopic cutting into the real physical area, and verify the real physical area. After confirming that it is correct, proceed to the application stage. The application phase includes: based on the pixel deviation between the execution end and the target point in the real-time image, it is converted into mechanical drive pulse increments through a mapping matrix and superimposed on the current mechanical absolute coordinates to generate absolute execution commands, driving the cutting motion until the target area is cut.
[0010] Based on the above technical solution, the following improvements can be made: As a preferred embodiment, step S1 includes: Step S1.1: Acquire images of a dimensional reference piece with known physical dimensions and preprocess them; Step S1.2: Extract features from the preprocessed image based on the geometric structure of the scale reference piece to obtain the real scale region corresponding to the known physical size; Step S1.3: Calculate the pixel distance of the actual scale region and obtain the scale conversion factor using the following formula. ; ; in: Given physical dimensions; This is the pixel distance corresponding to a known physical size.
[0011] As a preferred approach, for each image acquired at a location point, the pixel coordinates at the end of the process are obtained by following these steps: Step S2.a: Extract the low-brightness region at the end of the execution based on the color space as a candidate mask; Step S2.b: Through median filtering for noise reduction and connected component analysis, the candidate region where the execution endpoint is located is locked from the candidate mask; Step S2.c: On the contour of the candidate region, locate the maximum point of the horizontal coordinate as the initial vertex, and use the initial vertex as the candidate execution end pixel coordinate; Step S2.d: Perform a reverse column scan from the initially selected vertices to the root of the execution end to obtain the upper edge point set and the lower edge point set on the scan path; Step S2.e: Perform univariate linear regression on the upper edge point set and the lower edge point set respectively to obtain the upper edge fitting line and the lower edge fitting line, and determine whether the initially selected vertices meet the geometric edge characteristics of the execution end based on this. Verify whether the initially selected vertex is located within the central neighborhood of the upper and lower edge fitting lines; If the verification passes, the initially selected vertex will be determined as the pixel coordinates of the execution end.
[0012] As a preferred approach, the application phase includes: Step E1: Based on the real-time acquired target image, identify the current pixel coordinates of the execution end in the target image; Step E2: Calculate the pixel deviation between the pixel coordinates of the target point corresponding to the microscopically cut target region in the target image and the current pixel coordinates at the end of the execution; Step E3: Use the mapping matrix obtained in step S3 to convert the pixel deviation into the corresponding mechanical drive pulse increment; Step E4: Read the absolute position register of the physical encoder or driver in real time to obtain the current mechanical drive pulse coordinates, and add the mechanical drive pulse increment to the current mechanical drive pulse coordinates to generate the absolute execution instruction corresponding to the target point; Step E5: Perform micro-cutting motion according to the absolute execution command generated in step E4; Step E6: Repeat steps E1-E5 until all target points corresponding to the micro-cutting target area have been cut.
[0013] As a preferred option, in step S3... Construct a homography mapping model as follows; ; in: In the image coordinate system, denoted as the pixel deviation of the i-th position point relative to the reference position point; In the mechanical coordinate system, the increment of the mechanical drive pulse at the i-th position point relative to the reference position point; is the homogeneous coordinate normalization factor for the i-th position point; The reference point is any one of at least four non-collinear points; The parameters in the homography mapping model are solved once using calibration data from at least four sets of corresponding location points to obtain the mapping matrix H.
[0014] As a preferred embodiment, steps E2, E3, and E4 specifically include: In step E2, let the pixel coordinates of the current execution endpoint in the image coordinate system be... The pixel coordinates of the target point corresponding to the micro-cutting target area are: Pixel deviation as follows: ; ; In step E3, the homography mapping matrix obtained in step S3 is used. Calculate the homogeneous coordinate normalization factor of the current target point. The mechanical drive pulse increment is obtained by perspective division. ; ; ; In step E4, the absolute position register of the driver is read in real time to obtain the mechanical drive pulse coordinates of the current execution end in the machine coordinate system. ; The mechanical drive pulse increment obtained in step E3 Superimposed on the current mechanical drive pulse coordinates, generating the absolute execution command corresponding to the target point. .
[0015] As a preferred option, step C1 specifically includes: Calculate the total number of pixels occupied by the microscopically cut target region in the target image using image processing algorithms. ; The true physical area of the target region in micro-cutting is calculated using the following formula. ; ; in: This is the scale conversion factor.
[0016] Secondly, this invention discloses a micro-cutting motion control device based on adaptive calibration of the execution end, comprising: The scale calibration module is used to place scale reference pieces with known physical dimensions within the camera's field of view and establish the scale conversion factor between pixel scale and physical scale. The calibration dataset construction module is used to take the execution end as the calibration feature point and control the mechanical system to drive the execution end to move along a preset trajectory. It collects images of the execution end at at least four non-collinear position points and identifies their pixel coordinates. Taking one of the position points as a reference point, it calculates the pixel deviation of the other position points relative to the reference point and synchronously records the mechanical drive pulse increment of each position point relative to the reference point to construct the calibration dataset. The mapping modeling module is used to build a homography mapping model between the image coordinate system and the mechanical coordinate system based on at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained by the calibration dataset construction module, and obtain the mapping matrix through a first-order matrix solution. The calculation module is used to convert the microscopic cutting target area into the real physical area based on the scale conversion factor, and to verify the real physical area. After confirming that there is no error, the methods in the real-time recognition module, pixel deviation calculation module, mapping conversion module, instruction generation module, motion execution module, and loop control module are executed in sequence. The application module is used to convert the pixel deviation between the execution end and the target point in the real-time image into mechanical drive pulse increments through a mapping matrix, and superimpose them onto the current mechanical absolute coordinates to generate absolute execution commands, driving the cutting motion until the target area is cut.
[0017] Thirdly, the present invention discloses a computing device, comprising: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in memory and configured to be executed by one or more processors, and the one or more programs include instructions for any of the aforementioned micro-cutting motion control methods based on end-effector adaptive calibration.
[0018] Fourthly, the present invention discloses a storage medium storing one or more computer-readable programs, the one or more programs including instructions adapted to be loaded by a memory and executed any of the above-described micro-cutting motion control methods based on adaptive calibration of the execution end.
[0019] This invention discloses a micro-cutting motion control method and apparatus based on adaptive calibration of the execution end, which has the following beneficial effects: First, this invention integrates multiple coupled errors, such as mechanical transmission proportional error, camera mounting angle error, motion axis non-orthogonal error, and perspective distortion, into a single matrix solution through a homography mapping model. This eliminates the need for separate calibration and debugging of individual errors, simplifies the control logic and parameter configuration process, and significantly improves the engineering adaptability and operability of precision electromechanical vision systems.
[0020] Second, this invention relies on a scale reference component with known physical dimensions to complete the quantitative calibration of pixels and physical dimensions, establish a stable scale conversion factor, and provide a reliable quantitative basis for the measurement of physical dimensions of the target area in microscopic cutting.
[0021] Third, this invention uses the real-time position of the execution end as a reference benchmark, eliminating the need for recalibration after the execution end is replaced, effectively solving the problem of installation position and attitude deviations caused by execution end replacement. Simultaneously, the mapping matrix can be persistently stored after calibration, allowing for direct reuse under conditions where the camera and mechanical structure remain unchanged, avoiding repeated calibration operations. This ensures mapping accuracy, shortens debugging time, and improves the efficiency of continuous equipment operation.
[0022] Fourth, the present invention adopts an end-of-line self-calibration mode, which does not require external auxiliary media such as checkerboard or calibration board. The calibration process is completely on the same focal plane as the actual operation, which completely eliminates parallax deviation and projection distortion caused by the thickness of the calibration object and the difference in installation height. This ensures that the calibration state and motion model are highly consistent with the actual working scene, thereby improving the accuracy of calibration and the stability of long-term operation.
[0023] Fifth, the entire process of this invention is unmanned, avoiding fluctuations in calibration results caused by manual point selection, visual alignment, and subjective judgment, ensuring the consistency of calibration parameters across different batches and time periods, and meeting the high repeatability requirements of automated precision production lines.
[0024] Sixth, this invention employs a command generation method based on mechanical absolute coordinates. For each step, the target position is determined by real-time reading of the driver's absolute position register to obtain the current mechanical drive pulse coordinates. The incremental mechanical drive pulse is then superimposed onto these current coordinates to generate the absolute execution command, rather than relying on recursive accumulation of previous execution results. This method eliminates the propagation and accumulation paths of errors such as mechanical backlash, control delay, and numerical rounding, significantly improving endpoint positioning accuracy and trajectory repeatability in multi-path, high-density trajectory execution. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart of a micro-cutting motion control method provided in an embodiment of the present invention.
[0027] Figure 2 This is a schematic diagram of a microscopic scale acquired by a camera according to an embodiment of the present invention.
[0028] Figure 3 This is a schematic diagram of the actual scale area and corresponding pixel distance of the microscopic scale provided in an embodiment of the present invention.
[0029] Figure 4 This is a schematic diagram showing the needle tip in the upper left corner position captured by the camera according to an embodiment of the present invention.
[0030] Figure 5 This is a schematic diagram showing the needle tip in the upper right corner position captured by the camera according to an embodiment of the present invention.
[0031] Figure 6 This is a schematic diagram showing the needle tip in the lower right corner position captured by the camera according to an embodiment of the present invention.
[0032] Figure 7 This is a schematic diagram showing the needle tip in the lower left corner position captured by the camera according to an embodiment of the present invention.
[0033] Figure 8 This is a schematic diagram showing the actual physical area of the target region for micro-cutting provided in an embodiment of the present invention.
[0034] Figure 9 This is a schematic diagram of the result after micro-cutting provided in an embodiment of the present invention. Detailed Implementation
[0035] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0037] Using ordinal numbers such as “first,” “second,” “third,” etc. to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, sequence, or any other way.
[0038] Furthermore, the expression "includes" is an "open-ended" expression, which means only that there is a corresponding component or step, and should not be interpreted as excluding additional components or steps.
[0039] This embodiment provides a micro-cutting motion control method based on adaptive calibration of the execution end, such as... Figure 1 As shown, the whole process includes calibration, calculation and application stages. Through adaptive calibration, mechanical assembly errors, optical distortion, dimensional drift and cumulative errors are eliminated, achieving micron-level precision micro-cutting.
[0040] The calibration phase includes: Step S101: Place a scale reference piece with known physical size within the camera's field of view and establish a scale conversion factor between pixel scale and physical scale; Step S102: Using the execution end as the calibration feature point, and controlling the mechanical system to drive the execution end to move along a preset trajectory, images of the execution end are collected at at least four non-collinear position points and their pixel coordinates are identified. Using one of the position points as a reference point, the pixel deviation of the remaining position points relative to the reference point is calculated. The mechanical drive pulse increment of each position point relative to the reference point is recorded synchronously to construct a calibration dataset. Step S103: Based on the at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained in step S102, establish a homography mapping model between the image coordinate system and the mechanical coordinate system, and obtain the mapping matrix through a first-order matrix solution; The accounting phase includes: Step C101: Based on the scale conversion factor, convert the target area of the microscopic cutting into the real physical area, and verify the real physical area. After confirming that it is correct, proceed to the application stage. The application phase includes: Step E101: Based on the real-time acquired target image, identify the current pixel coordinates of the execution end in the target image; Step E102: Calculate the pixel deviation between the pixel coordinates of the target point corresponding to the microscopically cut target region in the target image and the current pixel coordinates at the end of the execution; Step E103: Use the mapping matrix obtained in step S103 to convert the pixel deviation into the corresponding mechanical drive pulse increment; Step E104: Read the absolute position register of the physical encoder or driver in real time, obtain the current mechanical drive pulse coordinates, and add the mechanical drive pulse increment to the current mechanical drive pulse coordinates to generate the absolute execution instruction corresponding to the target point; Step E105: Perform micro-cutting motion according to the absolute execution command generated in step E104; Step E106: Repeat steps E101-E105 until all target points corresponding to the micro-cutting target area have been cut.
[0041] The steps described above will be explained in detail below.
[0042] First, in the calibration phase.
[0043] Step S101 is used to establish the scale transformation factor, specifically including: Step S101.1: Acquire images of a dimensional reference piece with known physical dimensions and preprocess them; Step S101.2: Extract features from the preprocessed image based on the geometric structure of the scale reference piece to obtain the real scale region corresponding to the known physical size; Step S101.3: Calculate the pixel distance of the real scale region and obtain the scale conversion factor using the following formula. ; ; in: Given physical dimensions; This is the pixel distance corresponding to a known physical size.
[0044] Specifically, in this embodiment, a microscopic ruler is used as the dimensional reference.
[0045] Step S101.1 specifically involves collecting data of a known length. Images of microscopic scales, such as Figure 2 As shown, the scale is preprocessed, such as by using grayscale and adaptive Gaussian binarization algorithms to dynamically compensate the threshold using local illumination characteristics, thereby accurately extracting the vertical scale line features of the scale from the complex slide background.
[0046] Step S101.2 specifically involves traversing all detected line segments and calculating their overlap height in the vertical direction (Y-axis). If there is substantial vertical overlap between line segments, they are grouped into the same feature candidate group. This step aims to initially associate all graphic elements (including ruler scales, labeled numbers, and neighboring artifacts) in the same horizontal dimension.
[0047] Within each feature candidate group, line segments are sorted by their horizontal x-axis (X-axis), and the span between adjacent line segments is calculated. If the distance between two adjacent lines exceeds a set dynamic threshold (e.g., the image width), the line segment is considered the span. If a feature is not found at a certain point, it is considered discontinuous, and a logical truncation is performed at that point. This operation can precisely separate the scale area from the annotation text and graphic symbols on the left or right side, such as... Figure 3 As shown. Figure 3 The blue line in the image is the superposition effect of the scale line features extracted according to the above steps and the original image.
[0048] Step S101.3 specifically involves, after locking the actual scale region, extracting the center x-coordinates of the leftmost tick mark (starting tick mark) and the rightmost tick mark (ending tick mark) in the set, and calculating their pixel distance in the image. .
[0049] Figure 3 The green line in the middle specifically marks the pixel information between the leftmost and rightmost tick marks. The scale conversion factor is calculated based on this. (unit: ), Scale conversion factor Absolute scale constraints between pixel space and physical space were established and persistently stored for subsequent physical area calculations.
[0050] Step S102 is used to construct the calibration dataset.
[0051] In this embodiment, the tip of a micro-cutting needle is selected as the execution end. Using the needle tip as the calibration feature point eliminates the need for external calibration objects.
[0052] Constructing an image coordinate system The coordinate system is used to describe the pixel position in the image plane and is defined in a two-dimensional real space.
[0053] The control system drives the needle tip to move along a preset rectangular trajectory. Images are acquired and the pixel coordinates of the needle tip are identified at the four vertices (top left, top right, bottom right, and bottom left). The mechanical drive pulse coordinates corresponding to each position are recorded simultaneously.
[0054] Specifically, the mechanical drive pulse quantity is determined based on the mechanical system's step angle, transmission ratio, and scale conversion factor. The calculations ensure that the needle tip remains within the camera's field of view after its movement. In this embodiment, a reference pulse N=16000 pulses is sent to the X-axis motor, and a reference pulse M=8000 pulses are sent to the Y-axis motor.
[0055] The data acquisition process for the four locations is as follows: (1) The position of the needle tip in the upper left corner The robotic arm is driven to move the needle tip to the upper left corner of the camera's field of view, acquire an image, and identify the needle tip's coordinates. ,like Figure 4 As shown.
[0056] (2) The position of the needle tip in the upper right corner Send a fixed reference pulse N=16000 pulses to the X-axis motor, wait for the machine to reach its position, and then acquire an image to identify the needle tip coordinates. ,like Figure 5 As shown.
[0057] (3) The position of the needle tip in the lower right corner Maintaining the X-axis position, send a fixed reference pulse M=8000 pulses to the Y-axis motor, acquire images, and identify the needle tip coordinates. ,like Figure 6 As shown. Acquiring this point is crucial for resolving lens edge distortion and XY-axis linkage offset.
[0058] (4) The position of the needle tip in the lower left corner : Retract 16000 pulses along the X-axis, acquire images, and identify the needle tip coordinates. ,like Figure 7 As shown. Acquiring this point is crucial for resolving lens edge distortion and XY-axis linkage offset. The Y-axis is returned to its original position without further operations.
[0059] At each location point, obtain the pin tip pixel coordinates using the following steps: Step S102.a: Extract the low-brightness region of the needle tip as a candidate mask based on the color space and a preset low brightness threshold (e.g., B, G, R < 90); Step S102.b: Use a 5×5 median filter to remove salt and pepper noise and smooth the needle tip contour while preserving edge integrity; By filtering out small areas of non-target noise through connected component analysis and eliminating interference from slide impurities, the candidate region where the needle tip is located can be locked from the candidate mask. Step S102.c: On the contour of the candidate region, locate the maximum point of the horizontal coordinate as the initial vertex, and use the initial vertex as the candidate execution end pixel coordinate; Step S102.d: Perform a reverse column scan from the initially selected vertices to the root of the execution end to obtain the upper edge point set and the lower edge point set on the scan path; Step S102.e: Perform univariate linear regression on the upper edge point set and the lower edge point set respectively to obtain the upper edge fitting line and the lower edge fitting line, and determine whether the initially selected vertices meet the geometric edge characteristics of the execution end. Verify whether the initially selected vertex is located within the center neighborhood of the upper and lower edge fitting lines to eliminate vertical positioning deviation caused by needle tip wear; If the verification passes, the initial vertex will be determined as the pixel coordinates of the needle tip.
[0060] Finally, the calibration dataset is constructed as follows: Pixel deviation of each location point relative to the starting point: ; Mechanical drive pulse increments at each position point relative to the starting point: .
[0061] Step S103 is used to establish and solve the homography mapping model.
[0062] Based on the four sets of pixel deviations and corresponding mechanical drive pulse increments obtained in step S102, a homography mapping model between the image coordinate system and the mechanical coordinate system is established, as shown in the following formula; ; in: In the image coordinate system, the position of the i-th position point relative to the reference position point (in this embodiment, the top left corner) is... Pixel deviation (using the reference point); In the mechanical coordinate system, the increment of the mechanical drive pulse at the i-th position point relative to the reference position point; is the homogeneous coordinate normalization factor for the i-th position point; The reference point is any one of at least four non-collinear points; The parameters in the homography mapping model are solved once using the calibration data of four sets of corresponding position points to obtain the mapping matrix H and persist it.
[0063] This invention solves the mapping matrix using only four location points, reducing calibration complexity and improving system deployment efficiency. The mapping matrix can simultaneously compensate for mechanical transmission proportional errors, camera mounting angle errors, motion axis non-orthogonality errors, and perspective distortion.
[0064] Secondly, in the accounting stage.
[0065] Step C101 is used for the calculation and verification of the target area.
[0066] Before the application phase, the target area of the microscopic cutting is converted into the real physical area based on the scale conversion factor, and the area is verified.
[0067] Specifically, image processing algorithms (such as polygon region filling algorithms or connected component pixel statistics) are used to calculate the total number of pixels occupied by the microscopically cut target region (such as the tumor lesion area selected by the doctor) in the target image. .
[0068] Retrieve the scale conversion factor stored in step S101 The true physical area of the target region for micro-cutting is calculated using the following formula. ; .
[0069] like Figure 8 As shown, the area value is displayed on the user interface and verified by the operator or the system automatically (e.g., to determine whether it is within a preset reasonable range). Once confirmed to be correct, the application phase begins.
[0070] Finally, in the application phase.
[0071] Step E101 is used to identify the current pixel coordinates at the end of the execution.
[0072] Based on the real-time acquired target image (containing the tumor tissue region to be cut and the needle tip), the same needle tip recognition algorithm as in step S102 is used to identify the current pixel coordinates of the needle tip in the target image. .
[0073] Step E102 is used to calculate pixel deviation.
[0074] Let the pixel coordinates of a target point within the region of interest (ROI) selected by the surgeon for microsurgical dissection be... Pixel deviation as follows: ; ; Step E103 is used to convert to mechanical drive pulse increments.
[0075] Using the homography mapping matrix obtained in step S103 Calculate the homogeneous coordinate normalization factor of the current target point. The mechanical drive pulse increment is obtained by perspective division. ; ; ; Step E104 is used to generate absolute execution instructions.
[0076] The absolute position register of the stepper motor driver is read in real time to obtain the mechanical drive pulse coordinates of the current execution end in the machine coordinate system. , serving as a baseline reference for generating execution instructions.
[0077] The mechanical drive pulse increment obtained in step E103 Superimposed on the current mechanical drive pulse coordinates ,get: ; ; Finally, the absolute execution instructions corresponding to the target point are generated. This absolute execution command uses the current physically measured position as a reference and does not depend on the theoretical endpoint of the previous motion command. It fundamentally cuts off the error transmission chain caused by mechanical backlash, transmission step loss, or numerical rounding, thereby achieving self-correction during motion execution.
[0078] Step E105 is used to perform micro-cutting motion.
[0079] The absolute execution command generated in step E104 controls the movement of the actuator, so that the movement trajectory of the needle tip in physical space is consistent with the visual planning path, thereby achieving high-precision positioning and cutting control.
[0080] Step E106 is used to implement cyclic execution.
[0081] Repeat steps E101-E105. The motor drives the needle tip at the end of the robotic arm to move continuously along the set cutting path of the micro-cutting target area according to the absolute execution command, until all target points within the micro-cutting target area have been cut. The result after cutting is as follows: Figure 9 As shown, due to the introduction of parameter compensation of the homography mapping matrix, the actual motion trajectory of the robotic arm in physical space can strictly match the visual contour planned by the doctor on the image interface, effectively suppressing the execution displacement deviation caused by traditional mechanical assembly errors (such as non-orthogonal error of motion axis system and mechanical transmission proportional error).
[0082] Through the complete process described above, this invention not only achieves distortion-free, high-precision absolute execution command-driven cutting execution, but also transforms the abstract image region on the visual interface into real physical area data at the micrometer or millimeter level by multiplying the total number of pixels in the microscopic cutting target area by the square of the scale conversion factor. This calculation result can be displayed in real time on the system user interface, providing a high-confidence physical quantitative indicator for medical surgical evaluation, subsequent pathological analysis, and quantitative drug administration.
[0083] In other embodiments, the present invention discloses a micro-cutting motion control device based on adaptive calibration of the execution end, comprising: The scale calibration module is used to place scale reference pieces with known physical dimensions within the camera's field of view and establish the scale conversion factor between pixel scale and physical scale. The calibration dataset construction module is used to take the execution end as the calibration feature point and control the mechanical system to drive the execution end to move along a preset trajectory. It collects images of the execution end at at least four non-collinear position points and identifies their pixel coordinates. Taking one of the position points as a reference point, it calculates the pixel deviation of the other position points relative to the reference point and synchronously records the mechanical drive pulse increment of each position point relative to the reference point to construct the calibration dataset. The mapping modeling module is used to build a homography mapping model between the image coordinate system and the mechanical coordinate system based on at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained by the calibration dataset construction module, and obtain the mapping matrix through a first-order matrix solution. The calculation module is used to convert the microscopic cutting target area into the real physical area based on the scale conversion factor, and to verify the real physical area. After confirming that there is no error, the methods in the real-time recognition module, pixel deviation calculation module, mapping conversion module, instruction generation module, motion execution module, and loop control module are executed in sequence. The application module is used to convert the pixel deviation between the execution end and the target point in the real-time image into mechanical drive pulse increments through a mapping matrix, and superimpose them onto the current mechanical absolute coordinates to generate absolute execution commands, driving the cutting motion until the target area is cut.
[0084] Furthermore, it should be noted that the micro-cutting motion control device based on adaptive calibration of the execution end provided in the above embodiments is only illustrated by the division of the above functional modules when performing motion control. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the micro-cutting motion control device based on adaptive calibration of the execution end is divided into different functional modules to complete all or part of the functions described above.
[0085] Furthermore, the embodiments of the micro-cutting motion control device based on adaptive calibration of the execution end provided above belong to the same concept as the embodiments of the micro-cutting motion control method based on adaptive calibration of the execution end. The specific implementation process can be found in the method embodiments, and will not be repeated here.
[0086] In other embodiments, the present invention discloses a computing device comprising: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in memory and configured to be executed by one or more processors, and the one or more programs include instructions for any of the aforementioned micro-cutting motion control methods based on end-effector adaptive calibration.
[0087] In other embodiments, the present invention discloses a storage medium storing one or more computer-readable programs, the programs including instructions adapted to be loaded by memory and executed any of the above-described micro-cutting motion control methods based on end-of-execution adaptive calibration.
[0088] This invention discloses a micro-cutting motion control method and apparatus based on adaptive calibration of the execution end, which has the following beneficial effects: First, this invention integrates multiple coupled errors, such as mechanical transmission proportional error, camera mounting angle error, motion axis non-orthogonal error, and perspective distortion, into a single matrix solution through a homography mapping model. This eliminates the need for separate calibration and debugging of individual errors, simplifies the control logic and parameter configuration process, and significantly improves the engineering adaptability and operability of precision electromechanical vision systems.
[0089] Second, this invention relies on a scale reference component with known physical dimensions to complete the quantitative calibration of pixels and physical dimensions, establish a stable scale conversion factor, and provide a reliable quantitative basis for the measurement of physical dimensions of the target area in microscopic cutting.
[0090] Third, this invention uses the real-time position of the execution end as a reference benchmark, eliminating the need for recalibration after the execution end is replaced, effectively solving the problem of installation position and attitude deviations caused by execution end replacement. Simultaneously, the mapping matrix can be persistently stored after calibration, allowing for direct reuse under conditions where the camera and mechanical structure remain unchanged, avoiding repeated calibration operations. This ensures mapping accuracy, shortens debugging time, and improves the efficiency of continuous equipment operation.
[0091] Fourth, the present invention adopts an end-of-line self-calibration mode, which does not require external auxiliary media such as checkerboard or calibration board. The calibration process is completely on the same focal plane as the actual operation, which completely eliminates parallax deviation and projection distortion caused by the thickness of the calibration object and the difference in installation height. This ensures that the calibration state and motion model are highly consistent with the actual working scene, thereby improving the accuracy of calibration and the stability of long-term operation.
[0092] Fifth, the entire process of this invention is unmanned, avoiding fluctuations in calibration results caused by manual point selection, visual alignment, and subjective judgment, ensuring the consistency of calibration parameters across different batches and time periods, and meeting the high repeatability requirements of automated precision production lines.
[0093] Sixth, this invention employs a command generation method based on mechanical absolute coordinates. For each step, the target position is determined by real-time reading of the driver's absolute position register to obtain the current mechanical drive pulse coordinates. The incremental mechanical drive pulse is then superimposed onto these current coordinates to generate the absolute execution command, rather than relying on recursive accumulation of previous execution results. This method eliminates the propagation and accumulation paths of errors such as mechanical backlash, control delay, and numerical rounding, significantly improving endpoint positioning accuracy and trajectory repeatability in multi-path, high-density trajectory execution.
[0094] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the present invention. Various changes and modifications can be made to the present invention without departing from its spirit and scope. All such changes and modifications fall within the scope of the present invention as claimed, which is defined by the appended claims and their equivalents.
Claims
1. A micro-cutting motion control method based on end-effector adaptive calibration, characterized in that, include: The calibration phase, the accounting phase, and the application phase; The calibration phase includes: Step S1: Place a scale reference piece with known physical dimensions within the camera's field of view and establish a scale conversion factor between pixel scale and physical scale; Step S2: Using the execution end as the calibration feature point, control the mechanical system to drive the execution end to move along a preset trajectory, collect images of the execution end at at least four non-collinear position points and identify their pixel coordinates, use one of the position points as a reference point, calculate the pixel deviation of the other position points relative to the reference point, and synchronously record the mechanical drive pulse increment of each position point relative to the reference point to construct a calibration dataset. Step S3: Based on the at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained in step S2, establish a homography mapping model between the image coordinate system and the mechanical coordinate system, and obtain the mapping matrix through a first-order matrix solution; The accounting phase includes: Step C1: Based on the scale conversion factor, convert the microscopic cutting target area into the real physical area, verify the real physical area, and proceed to the application stage after confirming that it is correct; The application phase includes: Based on the pixel deviation between the execution end and the target point in the real-time image, the mapping matrix is converted into mechanical drive pulse increments, which are then superimposed on the current mechanical absolute coordinates to generate absolute execution commands, driving the cutting motion until the target area is completely cut. In step S2, for each image acquired at a location point, the pixel coordinates at the end of the process are obtained according to the following steps: Step S2.a: Extract the low-brightness region at the end of the execution based on the color space as a candidate mask; Step S2.b: Through median filtering for noise reduction and connected component analysis, the candidate region where the execution endpoint is located is locked from the candidate mask; Step S2.c: On the contour of the candidate region, locate the maximum point of the horizontal coordinate as the initial vertex, and use the initial vertex as the candidate execution end pixel coordinate; Step S2.d: Perform a reverse column scan from the initially selected vertex to the root of the execution end to obtain the upper edge point set and the lower edge point set on the scan path; Step S2.e: Perform univariate linear regression on the upper edge point set and the lower edge point set respectively to obtain the upper edge fitting line and the lower edge fitting line, and determine whether the initially selected vertex conforms to the geometric edge characteristics of the execution end. Verify whether the initially selected vertex is located within the central neighborhood of the upper edge fitting line and the lower edge fitting line; If the verification is successful, the initially selected vertex will be determined as the pixel coordinates of the execution end.
2. The method according to claim 1, characterized in that, Step S1 includes: Step S1.1: Acquire images of a dimensional reference piece with known physical dimensions and preprocess them; Step S1.2: Extract features from the preprocessed image based on the geometric structure of the scale reference piece to obtain the real scale region corresponding to the known physical size; Step S1.3: Calculate the pixel distance of the actual scale region and obtain the scale conversion factor using the following formula. ; ; in: Given physical dimensions; This is the pixel distance corresponding to a known physical size.
3. The method according to claim 1, characterized in that, The application phase includes: Step E1: Based on the target image acquired in real time, identify the current pixel coordinates of the execution end in the target image; Step E2: Calculate the pixel deviation between the pixel coordinates of the target point corresponding to the microscopic cutting target area in the target image and the current pixel coordinates at the end of the execution process; Step E3: Use the mapping matrix obtained in step S3 to convert the pixel deviation into the corresponding mechanical drive pulse increment; Step E4: Read the absolute position register of the physical encoder or driver in real time to obtain the current mechanical drive pulse coordinates, and add the mechanical drive pulse increment to the current mechanical drive pulse coordinates to generate the absolute execution instruction corresponding to the target point; Step E5: Perform micro-cutting motion according to the absolute execution command generated in step E4; Step E6: Repeat steps E1-E5 until all target points corresponding to the micro-cutting target area have been cut.
4. The method according to claim 3, characterized in that, In step S3 Construct a homography mapping model as follows; ; in: In the image coordinate system, denoted as the pixel deviation of the i-th position point relative to the reference position point; In the mechanical coordinate system, the increment of the mechanical drive pulse at the i-th position point relative to the reference position point; is the homogeneous coordinate normalization factor for the i-th position point; The reference position point is any one of the at least four non-collinear position points; The parameters in the homography mapping model are solved once using calibration data from at least four sets of corresponding location points to obtain the mapping matrix H.
5. The method according to claim 4, characterized in that, Steps E2, E3, and E4 specifically include: In step E2, let the pixel coordinates of the current execution endpoint in the image coordinate system be... The pixel coordinates of the target point corresponding to the micro-cutting target area are: Pixel deviation as follows: ; ; In step E3, the homography mapping matrix obtained in step S3 is used. Calculate the homogeneous coordinate normalization factor of the current target point. The mechanical drive pulse increment is obtained by perspective division. ; ; ; In step E4, the absolute position register of the driver is read in real time to obtain the mechanical drive pulse coordinates of the current execution end in the mechanical coordinate system. ; The mechanical drive pulse increment obtained in step E3 Superimposed on the current mechanical drive pulse coordinates, generating the absolute execution command corresponding to the target point. .
6. The method according to claim 1, characterized in that, Step C1 specifically includes: Calculate the total number of pixels occupied by the microscopically cut target region in the target image using image processing algorithms. ; The true physical area of the target region in micro-cutting is calculated using the following formula. ; ; in: This is the scale conversion factor.
7. A micro-cutting motion control device based on adaptive calibration of the execution end, characterized in that, A method for performing micro-cutting motion control based on adaptive calibration of the execution end as described in any one of claims 1-6, comprising: The scale calibration module is used to place scale reference pieces with known physical dimensions within the camera's field of view and establish the scale conversion factor between pixel scale and physical scale. The calibration dataset construction module is used to take the execution end as the calibration feature point and control the mechanical system to drive the execution end to move along a preset trajectory. It collects images of the execution end at at least four non-collinear position points and identifies their pixel coordinates. Taking one of the position points as a reference point, it calculates the pixel deviation of the other position points relative to the reference point and synchronously records the mechanical drive pulse increment of each position point relative to the reference point to construct the calibration dataset. The mapping modeling module is used to build a homography mapping model between the image coordinate system and the mechanical coordinate system based on at least four sets of pixel deviations and corresponding mechanical drive pulse increments obtained by the calibration dataset construction module, and obtain the mapping matrix through a first-order matrix solution. The calculation module is used to convert the microscopic cutting target area into the real physical area based on the scale conversion factor, and to verify the real physical area. After confirming that there is no error, the methods in the real-time recognition module, pixel deviation calculation module, mapping conversion module, instruction generation module, motion execution module, and loop control module are executed in sequence. The application module is used to convert the pixel deviation between the execution end and the target point in the real-time image into a mechanical drive pulse increment through the mapping matrix, and superimpose it onto the current mechanical absolute coordinates to generate an absolute execution command to drive the cutting motion until the target area is cut.
8. A computing device, characterized in that, include: One or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include instructions for the micro-cutting motion control method based on adaptive calibration of the execution end as described in any of claims 1-6.
9. A storage medium, characterized in that, The storage medium stores one or more computer-readable programs, the programs including instructions adapted to be loaded by memory and executed as described in any of claims 1-6, the micro-cutting motion control method based on adaptive calibration of the execution end.
Citation Information
Patent Citations
Laser scanning control system suitable for microsurgery adapter
CN111803208A
MARK point high-precision PCB positioning and mechanical mapping method based on multi-coordinate system fusion
CN121600069A