A machining tool setting and in-machine measurement method and device based on machine vision

CN122606397APending Publication Date: 2026-08-21SHENZHEN JUNCHENG PRECISION MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611048390.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0004]综上,现有技术存在以下不足:视觉对刀系统与视觉在机测量系统通常分离部署,硬件冗余、标定复杂;对刀偏差与数控系统刀补参数之间缺乏自动对接,依赖人工转换输入;单套视觉装置上同步实现高精度对刀和加工中在机尺寸测量,并针对不同表面光学特性进行自适应光源调控,尚未见成熟的解决方案

Benefits of technology

[0016]本发明公开的一种基于机器视觉的加工对刀与在机测量方法及装置,通过一套工业相机和可控光源模块在加工前执行对刀校准、在加工过程中执行在机尺寸测量,两个功能共享同一硬件平台,降低了系统部署成本和空间占用;将对刀偏差和尺寸误差通过数控系统接口直接传输至数控系统进行自动修正,实现了从测量到修正的全闭环自动化;通过分级阈值判断实现偏差的差异化响应处理;通过自适应光源调控解决了不同表面光学特性下的图像质量问题;通过刀补参数的自动转换和写入消除了人工转换和手动输入的环节。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122606397A_ABST
    Figure CN122606397A_ABST
Patent Text Reader

Abstract

The application provides a machining tool setting and in-process measurement method and device based on machine vision, in the tool setting stage before machining, a controllable light source is controlled to irradiate a tool with preset illumination parameters, an industrial camera is triggered to collect an image of the end of the tool, contour feature parameters of the tool are extracted by an image processing unit and compared with preset standard values, tool setting deviation is calculated and transmitted to a numerical control system to correct tool compensation parameters; in-process measurement in the machining process, a light source is controlled to irradiate a part machining surface, a camera is triggered to collect a part machining surface image, part size feature parameters are extracted and compared with theoretical size values, size errors are calculated and fed back to the numerical control system to correct machining parameters. The application can simultaneously realize tool setting and in-process measurement on a set of visual hardware platform, through adaptive light source, hierarchical threshold judgment and automatic tool compensation writing, the machining detection efficiency and precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machining inspection technology, and more specifically, to a machining tool setting and in-machine measurement method and apparatus based on machine vision. Background Technology

[0002] In the field of CNC machining, tool setting and part dimension inspection are crucial steps in ensuring machining quality. Traditional trial-cutting methods rely on operators repeatedly performing trial cuts, measurements, and adjustments, resulting in accuracy heavily influenced by experience. Furthermore, micro-tools are prone to breakage during contact-based tool setting. Offline coordinate measuring machine (CMM) requires removing the workpiece from the machine tool, and the positioning errors introduced by the secondary clamping prevent the inspection results from accurately reflecting the machining status. Moreover, the delay in inspection often leads to batch scrapping.

[0003] Chinese invention patent CN111774930A discloses a vision-based on-machine tool setting device, but its data processing controller lacks parameter-level interaction with the CNC system, and tool setting deviation cannot be automatically converted into tool compensation parameters and directly written. Chinese invention patent CN114800034B discloses a machine vision-based intelligent tool setting system, but it also only focuses on the tool setting function and does not integrate on-machine measurement.

[0004] In summary, the existing technologies have the following shortcomings: vision tool setting systems and vision on-machine measurement systems are usually deployed separately, resulting in hardware redundancy and complex calibration; there is a lack of automatic docking between tool setting deviation and CNC system tool compensation parameters, relying on manual conversion input; and there is no mature solution yet for simultaneously achieving high-precision tool setting and on-machine dimension measurement during processing on a single vision device, and for adaptive light source control for different surface optical properties. Summary of the Invention

[0005] In view of the above problems, the purpose of this invention is to provide a machine vision-based machining tool setting and in-machine measurement method and device, which realizes tool setting calibration and in-machine dimension measurement simultaneously with a single vision hardware platform, and achieves closed-loop automation from measurement to correction through adaptive light source control and automatic tool compensation writing.

[0006] The first aspect of this invention provides a machine vision-based method for machining tool setting and in-machine measurement, comprising: Pre-machining tool setting stage: The controllable light source module illuminates the tool with a first preset illumination parameter; the industrial camera module is triggered to acquire an image of the tool tip; the image processing unit extracts tool contour feature parameters from the tool tip image, the tool contour feature parameters including at least one of tool tip position, tool radius, and tool length; the tool contour feature parameters are compared with preset tool standard values ​​to calculate the tool setting deviation; the tool setting deviation is transmitted to the CNC system, and the CNC system corrects the tool compensation parameters based on the tool setting deviation; In-machine measurement during processing: During processing pauses or processing, the controllable light source module is controlled to illuminate the surface of the workpiece with a second preset illumination parameter; the industrial camera module is triggered to acquire an image of the workpiece surface; the image processing unit extracts the workpiece size feature parameters from the workpiece surface image, the workpiece size feature parameters including at least one of the workpiece surface boundary, hole diameter, groove width, and step height; the workpiece size feature parameters are compared with preset theoretical size values ​​to calculate the size error; the size error is transmitted to the CNC system, and the CNC system corrects the processing parameters based on the size error.

[0007] In this scheme, after calculating the tool setting deviation, the method further includes: setting a first tool setting deviation threshold T1 and a second tool setting deviation threshold T2, wherein T2 is greater than T1; when the tool setting deviation is less than T1, only the deviation data is recorded without correction; when the tool setting deviation is greater than or equal to T1 and less than T2, the step of correcting the tool compensation parameters is executed; when the tool setting deviation is greater than or equal to T2, an alarm signal is triggered and a manual inspection is prompted.

[0008] In this solution, before the controllable light source module illuminates the tool with the first preset illumination parameters, it further includes: detecting the reflectivity of the tool surface; when the reflectivity exceeds the preset reflectivity threshold, automatically switching the controllable light source module to polarized light source mode and configuring a cross polarizer to eliminate specular reflection interference; and then triggering the industrial camera module to acquire the image of the tool end.

[0009] In this solution, the step of the CNC system correcting the tool compensation parameters based on the tool setting deviation specifically includes: automatically converting the tool setting deviation into a tool length compensation value and / or a tool radius compensation value through the CNC system interface; and directly writing the tool length compensation value and / or tool radius compensation value into the tool compensation register of the CNC system.

[0010] This solution also includes: statistically analyzing the dimensional error data obtained from on-machine measurement of multiple continuously processed parts; performing trend analysis on the dimensional error data to extract systematic deviation patterns; back-mapping based on the systematic deviation patterns to deduce the systematic deviations existing in the tool setting system; and automatically adjusting the preset tool standard values ​​or compensation parameters based on the derived systematic deviations.

[0011] In this scheme, the calculation of tool setting deviation also includes: simultaneously obtaining laser measurement values ​​of tool parameters through laser measurement; when the difference between the tool setting deviation obtained by vision method and the laser measurement value is within a preset allowable range, the average or weighted average of the two is output as the final tool setting deviation; when the difference between the tool setting deviation obtained by vision method and the laser measurement value exceeds the preset allowable range, the first confidence level of vision method and the second confidence level of laser measurement method are calculated respectively, and the measurement value corresponding to the one with higher confidence level is selected as the final tool setting deviation.

[0012] A second aspect of the present invention provides a machine vision-based tool setting and in-machine measurement device, comprising: An industrial camera module is fixedly installed in the spindle or worktable area of ​​a processing equipment and is configured to acquire images of the tool tip and the machined surface of the part. A controllable light source module is disposed adjacent to the industrial camera module, such that its illumination area covers the field of view of the industrial camera module. The controllable light source module is configured to provide at least one adjustable illumination of brightness, angle, and wavelength to the cutting tool and the part. An image processing unit is electrically connected to the industrial camera module and the controllable light source module, respectively. The image processing unit is configured to: extract tool contour feature parameters from the tool tip image during the tool setting stage before machining, compare the tool contour feature parameters with a preset tool standard value, and calculate the tool setting deviation; and extract part size feature parameters from the part machining surface image during on-machine measurement during machining, compare the part size feature parameters with a preset theoretical size value, and calculate the size error. A CNC system interface connects the image processing unit to the CNC system of the machining equipment, and is used to transmit at least one of the tool setting deviation and the dimensional error to the CNC system.

[0013] In this scheme, the image processing unit further includes a graded judgment module, which includes: a first threshold comparator for comparing the tool setting deviation with a first tool setting deviation threshold T1; a second threshold comparator for comparing the tool setting deviation with a second tool setting deviation threshold T2, wherein T2 is greater than T1; and an alarm unit connected to the first threshold comparator and the second threshold comparator for triggering an alarm signal when the tool setting deviation is greater than or equal to T2.

[0014] In this solution, the controllable light source module includes: multiple light-emitting sub-units with different wavelengths; a surface reflectivity detection sensor for detecting the reflectivity of the tool surface or the machined surface of the part; and a light source switching controller, which is connected to the surface reflectivity detection sensor and each of the light-emitting sub-units respectively, for selecting the light-emitting sub-unit with the best contrast wavelength for illumination based on the reflectivity detection result, or switching to a polarized light source mode.

[0015] In this solution, the CNC system interface includes: a parameter conversion unit, used to convert the tool setting deviation into a tool length compensation value and / or a tool radius compensation value; and a tool compensation register writing module, connected to the parameter conversion unit, used to directly write the tool length compensation value and / or tool radius compensation value into the tool compensation register of the CNC system.

[0016] This invention discloses a machine vision-based machining tool setting and in-machine measurement method and apparatus. It utilizes an industrial camera and a controllable light source module to perform tool setting calibration before machining and in-machine dimensional measurement during machining. Both functions share the same hardware platform, reducing system deployment costs and space requirements. Tool setting deviations and dimensional errors are directly transmitted to the CNC system via the CNC system interface for automatic correction, achieving full closed-loop automation from measurement to correction. Differential response processing of deviations is achieved through graded threshold judgment. Adaptive light source control solves image quality issues under different surface optical properties. Automatic conversion and writing of tool compensation parameters eliminates the need for manual conversion and input. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described 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.

[0018] Figure 1 A flowchart of a machine vision-based machining tool setting and in-machine measurement method according to the present invention is shown; Figure 2 A flowchart of a tool deviation graded response processing method provided in an embodiment of the present invention is shown; Figure 3 A flowchart of an adaptive light source control method provided by an embodiment of the present invention is shown; Figure 4 A block diagram of a machine vision-based machining tool setting and in-machine measurement device of the present invention is shown; Figure 5 This diagram illustrates a process of tool setting and in-machine measurement based on machine vision according to the present invention. The components include: industrial camera module 1; controllable light source module 2; image processing unit 3; CNC system interface 4; machining equipment spindle 5; cutting tool 6; workpiece 7; and worktable 8. Detailed Implementation

[0019] 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.

[0020] Unless otherwise defined, all terms (including technical and scientific terms) used in embodiments of this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in a common dictionary should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as being interpreted in an idealized or highly formalized sense, unless expressly defined in this embodiment of the invention.

[0021] The terms "first," "second," and similar words used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "a," "one," or "the" do not indicate a quantity limitation, but rather indicate the presence of at least one. Likewise, the terms "including" or "comprising" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. The terms "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The steps preceding or following the steps in the method of the embodiments of this invention are not necessarily performed precisely in sequence. Instead, various steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0022] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0023] Figure 1 A flowchart of a machine vision-based machining tool setting and in-machine measurement method according to the present invention is shown.

[0024] like Figure 1 As shown, the first aspect of the present invention discloses a machine vision-based machining tool setting and in-machine measurement method, comprising: Tool setting stage before machining: S101, control the controllable light source module to illuminate the tool with the first preset illumination parameters; S102 triggers the industrial camera module to acquire an image of the tool tip; S103, the image processing unit extracts tool contour feature parameters from the tool tip image, the tool contour feature parameters including at least one of tool tip position, tool radius and tool length; S104, compare the tool profile feature parameters with the preset tool standard values ​​to calculate the tool setting deviation; S105 transmits the tool setting deviation to the CNC system, which then corrects the tool compensation parameters based on the tool setting deviation. In-machine measurement during processing: S106, During processing pause or processing, control the controllable light source module to illuminate the surface of the part being processed with the second preset lighting parameters; S107 triggers the industrial camera module to acquire images of the machined surface of the part; S108, the image processing unit extracts part size feature parameters from the part machining surface image, the part size feature parameters include at least one of machining surface boundary, hole diameter, groove width and step height; S109, compare the part's dimensional characteristic parameters with the preset theoretical dimensional values ​​to calculate the dimensional error; S110 transmits the dimensional error to the CNC system, which then corrects the machining parameters based on the dimensional error.

[0025] The core idea of ​​this solution is to integrate tool setting and in-machine measurement into a single vision hardware unit. In practical applications, the industrial camera module is rigidly fixed to the side of the spindle housing, and the camera's field of view always follows the spindle's movement, capturing the tool regardless of its position. In engineering, a CMOS camera with at least 5 megapixels and a frame rate of no less than 30fps is typically selected, with pixel sizes reaching the micrometer level after calibration. During calibration, the proportional relationship between image pixels and machine tool physical coordinates is established using the CNC machine tool's own coordinate movement, eliminating the need for an additional calibration board and preventing the introduction of manufacturing errors from the calibration board itself. Regarding the light source, a ring LED is the default configuration, but when encountering mirror-finished tools or polished parts, the ring light directly reflects, producing a large bright spot that makes the outline unrecognizable. In this case, switching to polarization mode, adding a linear polarizer at the light source's emission end, and placing an orthogonal polarizer in front of the lens filters out the direct reflection component, retaining only the diffuse reflection component, and immediately revealing the cutting edge outline clearly.

[0026] The image processing flow during the tool setting stage is as follows: first, grayscale conversion; then, median filtering to remove salt-and-pepper noise; next, histogram equalization to enhance contrast; and finally, the Canny operator to extract edges. The Canny operator's dual-threshold mechanism achieves a good balance between the completeness of edge detection and positioning accuracy. Then, the edge position is improved to sub-pixel accuracy using the grayscale centroid method. Different strategies are used for tool tip position extraction depending on the tool type: for flat end mills, the corner points of the tool tip plane are detected; for ball end mills, the lowest point is obtained by fitting the tool tip arc contour; and for drills, the intersection of the chisel edges is detected. The tool radius is obtained by identifying the edges of the two parallel generatrices of the cylindrical section of the tool shank and calculating the distance, then halving the result. The tool length is calculated by converting the pixel distance from the tool tip to the tool shank reference plane after completing the calibration mapping between the camera pixel size and the machine tool physical coordinates. The calculated tool setting deviation is decomposed into three axial components (X, Y, and Z) and transmitted to the CNC system.

[0027] The in-machine measurement process is similar to the tool setting stage, but the triggering timing is more flexible. It can be triggered automatically after each machining step, or as an intermediate inspection node after roughing and before finishing. Operators can also perform spot checks at any time via panel buttons. When extracting part dimensional features, different algorithm templates are called according to the feature type: circular holes use Hough circle transform or least squares circle fitting, rectangular grooves use straight line detection to calculate the vertical distance between two parallel edges, and step height is directly calculated by analyzing fringe offset under the condition of auxiliary structured light projection.

[0028] Figure 2 A flowchart of a tool deviation graded response processing method provided by an embodiment of the present invention is shown.

[0029] According to an embodiment of the present invention, after calculating the tool setting deviation, the method further includes: S201, set the first tool setting deviation threshold T1 and the second tool setting deviation threshold T2, where T2 is greater than T1; S202, when the tool setting deviation is less than T1, only the deviation data is recorded without correction; S203, when the tool setting deviation is greater than or equal to T1 and less than T2, execute the step of correcting the tool compensation parameters; S204: When the tool setting deviation is greater than or equal to T2, an alarm signal is triggered and a manual inspection is prompted.

[0030] The deviation grading mechanism originates from practical experience in production. In precision milling, T1 is typically set to 0.005mm and T2 to 0.02mm; these thresholds were determined after statistical analysis of a large amount of measured data. When the tool setting deviation is within 5μm, it falls within the normal fluctuation range of measurement noise. Frequent corrections at this point can cause tool compensation parameter jitter, which is detrimental to machining stability; therefore, only recording is performed without action. When the deviation is between 5μm and 20μm, it indicates that the tool position has actually drifted, but is still within a reasonable range that can be automatically compensated for, and the system automatically executes the correction process. Once the deviation exceeds 20μm, it usually means that the tool holder is not properly clamped, foreign objects are attached to the tapered surface of the tool holder, or the tool has been damaged. In this case, automatic compensation cannot fundamentally solve the problem, and the operator must be prompted to check and confirm through audible and visual alarms and pop-up windows on the operation panel. The dimensional error of in-machine measurement also adopts a similar grading logic: for rough machining, an additional compensation allowance is automatically added for deviations; for finish machining, a stop alarm is triggered. According to statistics from actual production lines, the false alarm rate after introducing grading judgment was reduced by about 70% compared to the solution without grading.

[0031] Figure 3 A flowchart of an adaptive light source control method provided by an embodiment of the present invention is shown.

[0032] According to an embodiment of the present invention, before controlling the controllable light source module to irradiate the tool with a first preset illumination parameter, the method further includes: Detect the reflectivity of the tool surface; When the reflectivity exceeds the preset reflectivity threshold, the controllable light source module is automatically switched to polarized light source mode, and a cross polarizer is configured to eliminate specular reflection interference. Then the industrial camera module is triggered to capture images of the tool tip.

[0033] The core of adaptive light sources lies in the pre-detection mechanism. Before formal image acquisition, a pre-detection image is captured with extremely low exposure, or a photodiode is integrated into the light source module to measure surface reflectivity. If the reflectivity exceeds a preset threshold (usually 60% is used as the dividing line; anything above this value is considered a highly reflective surface), the system automatically switches the optical path to orthogonal polarization mode. The principle is as follows: the polarization direction of specular reflected light remains unchanged, while diffuse reflected light is depolarized after surface scattering; the orthogonal polarizer filters out the specular reflection component with unchanged polarization direction and retains the depolarized diffuse reflection component, thus extracting the tool outline from the overexposed area. Furthermore, different materials exhibit varying wavelength sensitivities: copper alloys show higher contrast under blue light, aluminum alloys are clearer under red light, and blackened steel parts perform best when using infrared backlight. The light source module integrates four wavelength bands: white light, red light (625nm), blue light (470nm), and infrared light (850nm). Band switching is driven by reflectivity detection results. If the cutting fluid film or oil mist adheres to the surface of the part during the machining process, first start the compressed air nozzle to blow the target area online. After the surface is clean, then perform image acquisition to avoid false contours caused by liquid film refraction.

[0034] According to an embodiment of the present invention, the CNC system corrects the tool compensation parameters based on the tool setting deviation, specifically including: automatically converting the tool setting deviation into a tool length compensation value and / or a tool radius compensation value through the CNC system interface; and directly writing the tool length compensation value and / or tool radius compensation value into the tool compensation register of the CNC system.

[0035] This step eliminates the last manual step between vision measurement and CNC control. In traditional vision-based tool setting solutions, the deviation value calculated by the image processing unit is only displayed on the screen. Operators must manually read the value and input the tool compensation parameters on the CNC control panel, which is inefficient and prone to errors. This solution fully automates this process through the CNC interface. The interface layer supports three mainstream communication protocols: FANUC FOCAS, Siemens OPC UA, and Heidenhain RemoTools. After receiving the deviation value, the parameter conversion unit converts it into a compensation value format recognizable by the CNC system according to the current tool type (flat end mill, ball end mill, or drill). For example, for a 10mm diameter flat end mill, if the X-direction deviation is +0.008mm, the parameter conversion unit outputs an X-axis offset correction of +0.008 and the corresponding H-code tool length compensation increment. The tool compensation register writing module directly writes these values ​​to the corresponding data address in the PMC via the FOCAS protocol. Throughout the process, no manual intervention is required from the operator; the CNC system automatically references the updated compensation value when executing the next machining program. Actual tests show that the entire process from image acquisition to blade compensation taking effect takes no more than two seconds, which is more than an order of magnitude more efficient than manual operation.

[0036] According to an embodiment of the present invention, the method further includes: statistically analyzing the dimensional error data obtained from on-machine measurement calculations of multiple continuously processed parts; performing trend analysis on the dimensional error data to extract systematic deviation patterns; back-mapping based on the systematic deviation patterns to deduce the systematic deviations existing in the tool setting system; and automatically adjusting preset tool standard values ​​or compensation parameters based on the derived systematic deviations.

[0037] This solution reverses the traditional cause-and-effect logic. In conventional thinking, tool setting deviation is the cause, and machining dimensional error is the effect, with the cause-and-effect relationship proceeding unidirectionally. However, if the dimensional errors of multiple continuously machined parts all drift in the same direction, and the drift pattern does not conform to the physical laws of tool wear (e.g., the outer and inner diameters shift to the same side simultaneously, wear only leads to unidirectional dimensional changes), then the root cause is not the tool itself, but a systematic deviation in the tool setting reference. After accumulating more than 20 pieces of in-machine measurement data, the system analyzes the operational trend, calculating the mean error and drift slope of each detection feature. If the drift direction is inconsistent with the normal tool wear pattern, the identified systematic offset is written back into the tool standard value or compensation parameter used in the tool setting stage, essentially using the machining results to self-calibrate the tool setting reference. In a practical application at a certain company, after adopting this solution, the outer diameter process capability index Cp value for continuously machining 300 parts increased from 1.12 to 1.41.

[0038] According to an embodiment of the present invention, the calculation of the tool setting deviation further includes: simultaneously acquiring laser measurement values ​​of tool parameters through laser measurement; when the difference between the tool setting deviation obtained by the vision method and the laser measurement value is within a preset allowable range, the average value or weighted average value of the two is output as the final tool setting deviation; when the difference between the tool setting deviation obtained by the vision method and the laser measurement value exceeds the preset allowable range, the first confidence level of the vision method and the second confidence level of the laser measurement method are calculated respectively, and the measurement value corresponding to the one with higher confidence level is selected as the final tool setting deviation.

[0039] The vision channel and laser channel have complementary weaknesses: the vision channel is significantly affected by dirt and reflections, while the laser channel is significantly affected by cutting fluid atomization obscuring the beam. The two channels operate in parallel, providing redundancy for tool setting measurements. Under normal operating conditions, the difference between the two channel measurements is within ±0.003mm. In this case, the arithmetic mean of the two measurements or a weighted average based on their respective historical measurement stability is taken as the final output. When the difference exceeds this tolerance range, it indicates an anomaly in at least one channel, and the system evaluates the confidence level of both the vision and laser channels under the current measurement conditions. The confidence level of the vision channel is evaluated based on image sharpness scoring and edge detection integrity indicators, while the confidence level of the laser channel is evaluated based on the stability and repeatability of the beam intensity signal. In actual debugging, it was found that the laser channel has slightly better accuracy than the vision channel under stable beam conditions, but the signal attenuates instantly once cutting fluid mist drifts across the measurement optical path; although the absolute accuracy of the vision channel is slightly lower, it has stronger resistance to environmental interference. Therefore, under normal operating conditions, the fusion module favors the weight of the laser channel, but automatically switches to a weight allocation dominated by the vision channel when it detects beam signal jitter.

[0040] The following describes other optional implementations of this technical solution in conjunction with several extended embodiments. These extended embodiments can be implemented individually or in combination with the foregoing embodiments, and all fall within the protection scope of this invention.

[0041] Furthermore, according to an embodiment of the present invention, the device can be equipped with two or more industrial cameras to form a multi-view measurement array. Each camera is arranged around the feature area of ​​the tool or workpiece from different angles. The image processing unit performs feature matching and stereo triangulation calculation on the multi-view images synchronously acquired by each camera to reconstruct the three-dimensional point cloud data of the feature area.

[0042] It should be noted that monocular cameras are limited by field-of-view occlusion and perspective projection distortion, resulting in a significant decrease in measurement accuracy for the bottom of deep holes and the inner side of grooves. Two-dimensional images can only measure planar dimensions and cannot acquire depth information. The multi-view solution addresses this limitation: two cameras are positioned at an angle of 30° to 45° on either side of the feature being measured. The image processing unit uses SIFT or ORB feature point matching algorithms to find corresponding point pairs in the left and right views. Combined with pre-calibrated camera intrinsic parameters and relative pose, triangulation is performed to reconstruct the three-dimensional coordinates of the feature region in the machine tool coordinate system. With two 5-megapixel cameras at a 40° angle, the Z-axis measurement accuracy can reach within ±3μm. Furthermore, the multi-view solution offers an additional advantage: consistency checks are performed on independently calculated measurements from multiple perspectives. After removing outliers with significant deviations from the majority of perspective results, a weighted average is taken, significantly reducing the probability of single-shot misjudgment.

[0043] Furthermore, according to an embodiment of the present invention, the device also integrates a structured light projection module, which works with an industrial camera to achieve fusion measurement of 2D grayscale images and 3D structured light point clouds. The structured light projection module projects an coded stripe pattern onto the surface being measured. After the camera acquires the deformed stripe image, it reconstructs the three-dimensional topography of the surface through phase unwrapping and triangulation principles. The image processing unit performs pixel-level registration and fusion of the high-resolution edge information provided by the 2D grayscale image and the depth contour information provided by the 3D point cloud, outputting a composite measurement result that combines edge sharpness and depth accuracy.

[0044] Furthermore, according to embodiments of the present invention, the device of the present invention deployed on multiple processing equipment in the same workshop can achieve data interconnection with the upper-level manufacturing execution system or tool management system through the workshop industrial Ethernet, thereby constructing a workshop-level processing quality collaborative network.

[0045] Tool setting and measurement data on a single machine are often isolated, serving only that machine. However, in a production line environment, multiple machines typically process the same batch of parts in parallel. Aggregating data from all machines enables more advanced analysis. For example, cross-referencing in-machine measurement data for parts processed in the same operation on different machines can reveal if the median dimensional error of a particular machine significantly deviates from other machines, indicating a potential deviation in its tool setting reference. Furthermore, throughout a tool's lifecycle, from initial setup to replacement, tool setting deviation data and in-machine measurement quality data are continuously uploaded to the tool management system. This historical data allows the system to build a data-driven tool life prediction model, taking into account the deterioration trend of tool setting deviation, the number of parts processed, and cutting time, and outputting the remaining effective cutting life. When the predicted life falls below a preset warning value, the system proactively notifies the user to prepare for tool replacement, achieving predictive maintenance. In a real-world automotive parts production line, this solution reduced the scrap rate due to tool failure from 1.7% to 0.3%.

[0046] Furthermore, according to an embodiment of the present invention, the device also receives temperature field data from the machine tool thermal compensation system and dynamically corrects the mapping relationship between the industrial camera coordinate system and the machine tool coordinate system based on the temperature gradient. Temperature sensors are arranged at key locations on the machine tool, and a mapping model of the temperature field to the offset of the camera coordinate system is established. In actual parameter tuning, it was found that multivariate linear regression can meet the accuracy requirements, and the RMS error can be controlled within 1μm. The compensation amount is written into the calibration parameters of the image pixels to the machine tool coordinates and updated in real time.

[0047] Furthermore, according to an embodiment of the present invention, for tool setting scenarios involving micro-tools with a diameter of less than 1 mm, the system automatically triggers a dedicated high-magnification image acquisition mode, coupled with annular low-angle dark-field illumination around the tool tip. Low-angle dark-field illumination ensures that light rays glide almost parallel to the tool surface, allowing only minute defects on the cutting edge and scattered light from the edges to enter the lens, resulting in a completely dark background. Even micro-drills with a diameter of 0.1 mm can be clearly imaged. Based on this, the image processing unit enables a sub-pixel edge positioning algorithm, achieving a tool setting accuracy of 0.5 μm.

[0048] Furthermore, according to an embodiment of the present invention, when it is detected that there is chip accumulation on the surface of the part or that the cutting fluid obscures the target measurement area by more than a preset area ratio, the system starts an online cleaning procedure: first, the target area is pulsedly purged through a compressed air nozzle to remove chips and most of the liquid film, and then multiple frames of images are acquired for quality assessment, and the frame with the highest clarity is automatically selected and sent to the subsequent processing flow; if the quality scores of three consecutive frames fail, the system records the abnormality and prompts manual cleaning, and does not output unreliable measurement results.

[0049] Furthermore, according to an embodiment of the present invention, when the vibration sensor detects that the amplitude of the processing vibration exceeds a preset threshold, the system switches to a short-exposure high-frequency continuous shooting mode, and after continuously shooting 5 to 10 frames of short-exposure images, it synthesizes an equivalent long-exposure clear image through multi-frame registration and pixel-level fusion algorithm, while eliminating random noise, performing a standard feature extraction process on the synthesized image, and the deviation of the output measurement result from that under static conditions is within ±1μm.

[0050] Furthermore, according to embodiments of the present invention, for transparent or dark low-contrast parts, the multi-band rotation strategy of the controllable light source module is further extended: for transparent materials, infrared backlighting is enabled, and the material's partial transmission and internal refraction of infrared light form a light-dark transition zone at the boundary; for dark parts, the infrared band is switched and combined with annular dark field lighting, and the contour contrast is enhanced by the difference in infrared light scattering caused by surface micro-texture.

[0051] Furthermore, according to an embodiment of the present invention, the cutting tool is provided with an optical marking pattern, and the image processing unit directly determines the position of the cutting tip and the cutting tool number by recognizing the optical marking pattern.

[0052] It's important to note that this solution directly integrates information encoding onto the tool itself. In traditional methods, the tool is the observed object, requiring extraction of the tool tip contour from an image. This process is computationally complex and susceptible to interference from surface reflections and contaminants. This solution transforms the tool from a passive object to an active information source by attaching high-contrast optical markings (e.g., laser-engraving micro-QR codes or coded color rings on the tool shank). The camera only needs to scan the marking pattern to quickly determine the tool tip position (the geometric offset between the marking and the tool tip is calibrated and stored in the encoding at the factory) and the tool number. It can even read the tool's nominal dimensions and material information. This method improves recognition speed by an order of magnitude, and the marking position can be selected in areas less prone to contamination, unaffected by surface reflections. In engineering implementation, the calibration of the relative position of the marking and the tool tip only needs to be performed once during the tool pre-adjustment stage, and remains effective throughout subsequent use.

[0053] Furthermore, according to an embodiment of the present invention, a preset reference mark point is provided on the workpiece blank or fixture. Before measuring the machining features, the system prioritizes detecting the position of the reference mark point to calibrate the measurement coordinate system. During long-term use, the tooling fixture may experience micron-level positional shifts due to impacts and thermal cycling. The reference mark point enables the system to perform a rapid coordinate origin self-calibration before each measurement: detecting the current position of the mark point, calculating the overall offset of the fixture, and using this offset to correct the reference coordinate system for all subsequent measurements.

[0054] Furthermore, according to an embodiment of the present invention, the image processing unit parses the machining intention identifier in the CNC machining program or machining task sheet and automatically matches the corresponding measurement strategy: in the roughing stage, a high-speed low-precision mode is enabled, the camera samples one frame every 2 to 3 frames, pixel-level edge detection is used, and the measurement frequency is reduced; in the finishing stage, the mode is automatically switched to low-speed high-precision mode, every frame is sampled, sub-pixel analysis and multi-frame averaging are started, and measurements are taken immediately after each step is completed.

[0055] It's important to note that intent-driven strategy switching essentially involves allocating computational resources and measurement time differently based on the actual needs of each processing stage. In the roughing stage, with its large allowance and high surface roughness, achieving sub-micron level measurement accuracy is impractical, as subsequent finishing processes haven't yet been executed. Conversely, slow measurement speeds in the finishing stage would slow down production. The system infers the current processing stage by reading M-codes or custom macro instructions from the NC program and searches for corresponding measurement parameter combinations in a predefined strategy table. These parameters include whether to downsample the camera resolution, whether edge detection uses pixel-level or sub-pixel-level methods, whether multi-frame averaging is required, and the measurement trigger frequency. The strategy table is accessible to process engineers and can be adjusted based on the batch size of specific products. After applying this solution on an aerospace structural component production line, the total processing time per piece did not increase, but the process capability index Cp value for the finishing dimensions improved from 1.05 to 1.38, achieving efficient on-demand allocation of measurement resources.

[0056] Furthermore, according to an embodiment of the present invention, the image processing unit constructs a mapping capability library of part type-feature-measurement scheme, automatically identifies the part type as shaft, disc, box or irregular part by analyzing the geometric shape of the part's machined surface, and then retrieves the feature extraction algorithm template and measurement path planning scheme corresponding to the type from the capability library.

[0057] Furthermore, according to an embodiment of the present invention, the system utilizes the characteristic peak value of machining vibration in the frequency domain as a confirmation signal of the cutting state of the tool. When the system detects a periodic image blurring pattern in a specific frequency band during continuous image acquisition, it uses this signal as a confirmation indication that the tool is cutting, automatically triggering the timer for on-machine measurement. After cutting ends and the vibration disappears, image acquisition is performed after a 0.5-second delay to allow the chips and cutting fluid to stabilize.

[0058] Furthermore, according to an embodiment of the present invention, while extracting the tool setting deviation parameters, the image processing unit performs texture analysis and edge morphology detection on the high-magnification image of the tool tip region, quantitatively extracts the feature parameters of the tool wear region, and outputs the wear feature parameters and the tool setting deviation together to the tool management system for correcting the input of the tool life prediction model.

[0059] Figure 4 A block diagram of a machine vision-based machining tool setting and in-machine measurement device according to the present invention is shown.

[0060] Figure 5 This diagram illustrates a machine vision-based machining tool setting and in-machine measurement process according to the present invention.

[0061] like Figure 4-5The present invention also provides a machine vision-based machining tool setting and in-machine measurement device, including an industrial camera module 1; a controllable light source module 2; an image processing unit 3; a CNC system interface 4; a machining equipment spindle 5; a cutting tool 6; a workpiece 7; and a worktable 8. An industrial camera module is fixedly installed on the spindle or worktable area of ​​the machining equipment, configured to acquire images of the tool tip and the machined surface of the part; a controllable light source module is arranged adjacent to the industrial camera module, with its illumination area covering the field of view of the industrial camera module, and the controllable light source module is configured to provide at least one adjustable illumination of brightness, angle, and wavelength to the tool and the part; an image processing unit is electrically connected to both the industrial camera module and the controllable light source module, and the image processing unit is configured to: extract tool contour feature parameters from the tool tip image during the tool setting stage before machining, compare the tool contour feature parameters with preset tool standard values, and calculate the tool setting deviation; and extract part size feature parameters from the machined surface image during on-machine measurement, compare the part size feature parameters with preset theoretical size values, and calculate the size error; and a CNC system interface connects the image processing unit to the CNC system of the machining equipment, used to transmit at least one of the tool setting deviation and size error to the CNC system.

[0062] It's important to note that the key to this device architecture lies in the closed-loop data channels between its four components. The industrial camera module connects to the image processing unit via USB 3.0 or Camera Link interfaces, the light source module interacts with the image processing unit via I / O control lines, and the image processing unit communicates with the machine tool control system via a CNC interface. The physical form of the image processing unit can be an embedded industrial computer or an FPGA plus DSP board, depending on the real-time requirements of the application scenario: FPGA solutions are typically used on high-cycle production lines, where image processing latency can be controlled within 100ms. The four components work collaboratively according to their respective roles: the camera is responsible for image acquisition, the light source ensures image quality, the processing unit performs feature extraction and deviation calculation, and the interface transmits the processing results to the machine tool for execution.

[0063] According to an embodiment of the present invention, the image processing unit further includes a grading judgment module, which includes: a first threshold comparator for comparing the tool setting deviation with a first tool setting deviation threshold T1; a second threshold comparator for comparing the tool setting deviation with a second tool setting deviation threshold T2, wherein T2 is greater than T1; and an alarm unit connected to the first threshold comparator and the second threshold comparator for triggering an alarm signal when the tool setting deviation is greater than or equal to T2.

[0064] It should be noted that the graded judgment module consists of two levels of comparators and an alarm trigger at the hardware level, with a simple structure but practical function. The first-level comparator determines whether correction is needed, and the second-level comparator determines whether the current deviation exceeds the reasonable range for automatic correction. The output of the alarm unit connects to the machine tool's audible and visual alarm and the pop-up interface of the operation panel. After being independently packaged, this module makes it easy to disable the alarm function in scenarios where only in-machine measurement is performed (without tool setting), or to directly modify the module parameters when temporary threshold adjustment is required, without changing the main program logic.

[0065] According to an embodiment of the present invention, the controllable light source module includes: multiple light-emitting sub-units of different wavelengths; a surface reflectivity detection sensor for detecting the reflectivity of the tool surface or the machined surface of the part; and a light source switching controller connected to the surface reflectivity detection sensor and each light-emitting sub-unit, for selecting the light-emitting sub-unit with the best contrast wavelength for illumination based on the reflectivity detection result, or switching to a polarized light source mode.

[0066] It should be noted that the four light-emitting sub-units (white light, 625nm red light, 470nm blue light, and 850nm infrared light) are integrated into a single ring-shaped lamp head. The corresponding LED driving channel is selected by the light source switching controller, with switching time on the order of milliseconds, which does not affect the production cycle. In a simplified implementation, the surface reflectivity detection sensor can be replaced by a pre-detection frame captured by an industrial camera under extremely low exposure conditions. The reflectivity is estimated by analyzing the grayscale mean of the region of interest, achieving comparable results and reducing the need for a separate sensor.

[0067] According to an embodiment of the present invention, the CNC system interface includes: a parameter conversion unit for converting tool setting deviation into tool length compensation value and / or tool radius compensation value; and a tool compensation register writing module connected to the parameter conversion unit for directly writing the tool length compensation value and / or tool radius compensation value into the tool compensation register of the CNC system.

[0068] It should be noted that the parameter conversion unit maintains a mapping table from tool type to compensation value format. Taking the FANUC CNC system as an example, the tool length compensation for flat end mills corresponds to the H code register, and the tool radius compensation corresponds to the D code register; ball end mills only have tool length compensation set; drills mainly focus on the Z-axis compensation value. The conversion unit automatically looks up the table based on the current tool number to determine the register type and value format to be written. The tool compensation register writing module performs read and write operations on the tool compensation table through the cnc_rdtofs and cnc_wrtofs functions of the FOCAS protocol, but the corresponding data address in the machine tool PMC must be confirmed in advance. The address allocation may differ between manufacturers, and an address mapping configuration needs to be completed according to the actual site conditions during deployment.

[0069] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A machine vision-based machining tool setting and on-machine measurement method, characterized in that, Includes the following steps: Pre-machining tool setting stage: The controllable light source module illuminates the tool with a first preset illumination parameter; the industrial camera module is triggered to acquire an image of the tool end; the tool contour feature parameters are extracted from the tool end image by the image processing unit; the tool contour feature parameters are compared with the preset tool standard value to calculate the tool setting deviation; the tool setting deviation is transmitted to the CNC system, and the CNC system corrects the tool compensation parameters according to the tool setting deviation. In-machine measurement during processing: During processing pause or processing, the controllable light source module is controlled to illuminate the surface of the part being processed with a second preset illumination parameter; the industrial camera module is triggered to acquire an image of the surface of the part being processed; and the image processing unit extracts the part size feature parameters from the image of the surface of the part being processed. The dimensional feature parameters of the part are compared with the preset theoretical dimensional values ​​to calculate the dimensional error; the dimensional error is transmitted to the CNC system, which then corrects the machining parameters based on the dimensional error.

2. The method according to claim 1, characterized in that, After calculating the tool setting deviation, the process also includes: Set a first tool setting deviation threshold T1 and a second tool setting deviation threshold T2, where T2 is greater than T1; When the tool setting deviation is less than T1, only the deviation data is recorded without correction; when the tool setting deviation is greater than or equal to T1 and less than T2, the step of correcting the tool compensation parameters is executed. When the tool setting deviation is greater than or equal to T2, an alarm signal is triggered and a manual inspection is prompted.

3. The method according to claim 1, characterized in that, Before the controllable light source module illuminates the tool with the first preset illumination parameters, it also includes: Detect the reflectivity of the tool surface; When the reflectivity exceeds a preset reflectivity threshold, the controllable light source module is automatically switched to polarized light source mode, and a cross polarizer is configured to eliminate specular reflection interference. Then the industrial camera module is triggered to acquire an image of the tool tip.

4. The method according to claim 1, characterized in that, The process of the CNC system correcting tool compensation parameters based on tool setting deviation specifically includes: The tool setting deviation is automatically converted into tool length compensation value and / or tool radius compensation value through the CNC system interface; The tool length compensation value and / or tool radius compensation value are directly written into the tool compensation register of the CNC system.

5. The method according to claim 1, characterized in that, Also includes: Dimensional error data obtained from in-machine measurement calculations of multiple parts processed continuously; Perform trend analysis on the dimensional error data to extract systematic deviation patterns; Based on the reverse mapping of the systematic deviation law, the systematic deviation existing in the tool setting system is derived; The preset tool standard value or compensation parameter is automatically adjusted based on the derived systematic deviation.

6. The method according to claim 1, characterized in that, The calculation of tool setting deviation also includes: Simultaneously, laser measurement values ​​of tool parameters are obtained through laser measurement. When the difference between the tool setting deviation obtained by the visual method and the laser measurement value is within a preset allowable range, the average or weighted average of the two is output as the final tool setting deviation. When the difference between the tool setting deviation obtained by the vision method and the laser measurement value exceeds the preset allowable range, the first confidence level of the vision method and the second confidence level of the laser measurement method are calculated respectively, and the measurement value corresponding to the one with higher confidence level is selected as the final tool setting deviation.

7. A machine vision-based machining tool setting and in-machine measurement device, characterized in that, include: An industrial camera module is fixedly installed in the spindle or worktable area of ​​a processing equipment and is configured to acquire images of the tool tip and the machined surface of the part. A controllable light source module is disposed adjacent to the industrial camera module, such that its illumination area covers the field of view of the industrial camera module. The controllable light source module is configured to provide at least one adjustable illumination of brightness, angle, and wavelength to the cutting tool and the part. An image processing unit is electrically connected to the industrial camera module and the controllable light source module, respectively. The image processing unit is configured to: extract tool contour feature parameters from the tool tip image during the tool setting stage before machining, compare the tool contour feature parameters with a preset tool standard value, and calculate the tool setting deviation; and extract part size feature parameters from the part machining surface image during on-machine measurement during machining, compare the part size feature parameters with a preset theoretical size value, and calculate the size error. A CNC system interface connects the image processing unit to the CNC system of the machining equipment, and is used to transmit at least one of the tool setting deviation and the dimensional error to the CNC system.

8. The apparatus according to claim 7, characterized in that, The image processing unit further includes a hierarchical judgment module, which includes: A first threshold comparator is used to compare the tool setting deviation with a first tool setting deviation threshold T1; A second threshold comparator is used to compare the tool setting deviation with a second tool setting deviation threshold T2, wherein T2 is greater than T1; An alarm unit, connected to the first threshold comparator and the second threshold comparator, is used to trigger an alarm signal when the tool setting deviation is greater than or equal to T2.

9. The apparatus according to claim 7, characterized in that, The controllable light source module includes: Multiple luminescent subunits in different wavelength bands; Surface reflectivity detection sensor, used to detect the reflectivity of tool surface or machined part surface; The light source switching controller is connected to the surface reflectivity detection sensor and each of the light-emitting sub-units, respectively, and is used to select the light-emitting sub-unit with the best contrast band for illumination based on the reflectivity detection result, or switch to the polarized light source mode.

10. The apparatus according to claim 7, characterized in that, The CNC system interface includes: a parameter conversion unit for converting the tool setting deviation into a tool length compensation value and / or a tool radius compensation value; and a tool compensation register writing module connected to the parameter conversion unit for directly writing the tool length compensation value and / or tool radius compensation value into the tool compensation register of the CNC system.

Citation Information

Patent Citations

  • Vision-based tool monitor and tool monitoring method thereof

    CN111774930A

  • An intelligent tool setting system and method for CNC machine tools using machine vision

    CN114800034B