Full-automatic online detection device for lens appearance defects based on diamond single-point lathe
By designing a fully automated online inspection device on a diamond single-point lathe, the problem of delayed defect detection in lens processing was solved, enabling real-time defect identification and classification, and improving production efficiency and intelligence.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOUYI INTELLIGENT TECHNOLOGY (HANGZHOU) CO LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-05-29
Smart Images

Figure CN122109102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of turning or machining methods that essentially require the use of a lathe, specifically to a fully automated online detection device for lens appearance defects based on a diamond single-point lathe. Background Technology
[0002] Ultra-precision optical lenses, especially optical components used in high-end imaging, lasers, and semiconductors, directly impact the performance of the final system due to their surface quality. Diamond single-point turning technology has become a key process in the manufacturing of such lenses because it can directly produce optical surfaces with nanoscale surface roughness. However, during processing, the workpiece surface may still develop appearance defects such as scratches, chipping, and impurities due to tool wear, environmental particles, material inhomogeneity, or fluctuations in process parameters. Currently, the detection of appearance defects and process quality control of the processed lenses are core aspects of ensuring the yield of the final product.
[0003] Currently, in the field of ultra-precision optical processing, the common practice is to remove the workpiece after processing and have operators visually inspect it under a microscope or use equipment such as profilometers and interferometers for offline detection to identify and determine surface defects of the lens. However, this method suffers from problems such as detection lag, low efficiency, strong subjectivity, and the inability to intervene in the processing in real time. This is mainly because the detection and processing stages are completely separated in time and space, lacking an effective online feedback and control mechanism. As a result, defects cannot be detected and dealt with in a timely manner from the outset, which may lead to defect accumulation, batch scrap, and heavy reliance on human experience, thus hindering the improvement of production automation and intelligence.
[0004] Therefore, a fully automated online inspection device for lens appearance defects based on a diamond single-point lathe is provided. Summary of the Invention
[0005] To address the problems mentioned in the background art, the present invention provides the following technical solution: a fully automated online inspection device for lens appearance defects based on a diamond single-point lathe, including an SPDT machine tool. A mounting assembly is detachably mounted on the Z-axis slide of the SPDT machine tool. The mounting assembly is equipped with a multi-directional adjustable mounting bracket, on which a data acquisition assembly is mounted. The optical axis of the data acquisition assembly faces the workpiece machining area on the end face of the SPDT machine tool spindle. It also includes a detection component, which is electrically connected to the acquisition component and to the CNC system of the SPDT machine tool. The detection component has a built-in appearance defect recognition model, a corresponding image classification unit, and an alarm unit; The appearance defect recognition model is trained based on the appearance defect data of lenses processed by a diamond single-point lathe, and is used to identify and classify defects in images acquired by the acquisition component. The alarm unit is configured to trigger an alarm immediately when a valid defect is detected; The image classification unit is configured to classify the acquired images according to their physical positions on the lens based on the image acquisition time sequence and the main axis rotation angle, forming a time-series array image set corresponding to different position areas.
[0006] Furthermore, the mounting components include T-shaped clips, support rods, vertical hinge rods, horizontal hinge rods, universal swivel rods, and mounting brackets; The T-shaped block is provided with a protrusion that matches the T-slot on the Z-axis slide, and a detachable connection is achieved by inserting the protrusion into the T-slot; The lower end of the support rod is fixedly connected to the T-shaped locking block, and its upper end is connected to one end of the vertical hinge rod through the first hinge shaft, so that the vertical hinge rod can rotate in the vertical plane. The other end of the vertical hinge rod is connected to one end of the horizontal hinge rod through the second hinge shaft, so that the horizontal hinge rod can rotate in the horizontal plane. The other end of the transverse hinge rod is provided with a ball socket, and one end of the universal rotating rod is provided with a ball head that mates with the ball socket, forming a ball hinge connection; The other end of the universal joint is fixedly connected to the mounting bracket.
[0007] Furthermore, the corresponding image classification unit is configured to perform the following classification operations: the lens workpiece is rotated 360° and divided into N equally divided angle intervals, where N is an integer greater than 1; for each input image, the cumulative rotation angle of the spindle from the set reference start time to the time stamp t is calculated based on its acquisition timestamp and the real-time rotation speed of the spindle during acquisition; the fixed angle interval number k to which it belongs is determined based on the cumulative rotation angle; the image is classified into the time-series array image set numbered k and arranged in order of timestamp t.
[0008] Furthermore, the appearance defect recognition model can identify and classify defect types including scratches, chipped edges, surface impurities, edge gaps, and micro-pits.
[0009] Furthermore, the appearance defect recognition model is obtained in the following way: a YOLO object detection network architecture based on pre-trained weights is used as the basic model; image data of defect types generated during the processing of lenses on a diamond single-point lathe are collected to form a training dataset, and the defect locations and categories in the images are labeled with standard bounding boxes; the basic model is fine-tuned using the training dataset, and the model weights are adapted to the lens appearance defect recognition task through iterative optimization, and finally the appearance defect recognition model is obtained.
[0010] Furthermore, the acquisition components include an industrial camera and a coaxial light source. The image sensor of the industrial camera has a resolution of no less than 5 million pixels. The light beam emitted by the coaxial light source is aligned with the optical axis of the industrial camera after passing through a beam splitter, and is vertically irradiated onto the lens surface of the workpiece processing area.
[0011] Furthermore, during the fine-tuning training process, data augmentation processing, including random rotation, brightness adjustment, and the addition of Gaussian noise, is applied to the images in the training dataset.
[0012] Furthermore, the electrical signal connection between the alarm unit and the CNC system of the SPDT machine tool is a hard-wired connection; the alarm unit is configured to output an emergency stop signal, a feed hold signal, or a fine-tuning compensation signal to the CNC system when an alarm is triggered.
[0013] Furthermore, the fine-tuning compensation signal is jointly generated by the defect identification result output by the detection component based on the appearance defect identification model and the time-series array image set generated by the co-position image classification unit; When the detected defect is a tiny pit or surface impurity, the detection component calculates the corresponding tool path offset based on the physical location of the defect on the processed lens, and sends a fine-tuning compensation signal containing the tool path offset to the CNC system of the SPDT machine tool.
[0014] Beneficial effects The present invention has the following beneficial effects: (1) This invention enables the rapid assembly and disassembly of the acquisition component through a detachable mounting assembly to adapt to different processing and inspection task requirements. Based on the collaborative work of the acquisition component, the inspection component, and their built-in appearance defect recognition model, the same-position image classification unit, and the alarm unit, the surface image of the workpiece can be acquired in real time during the processing of lenses on a diamond single-point lathe, and the online identification and classification of defects can be completed based on the appearance defect recognition model. When a valid defect is identified, the alarm unit sends an emergency stop signal, a feed hold signal, or a fine-tuning compensation signal to the CNC system of the SPDT machine tool through a hard-wired connection according to a preset strategy, thereby realizing real-time intervention and hierarchical control of the processing process.
[0015] (2) The image classification unit of this invention divides a 360° rotation of the lens into N equally divided angular intervals, and classifies the acquired images into specific intervals according to their corresponding principal axis rotation angles, thereby constructing a time-series array image set corresponding to different physical positions. This design completely solves the problem of chaotic correspondence between continuously acquired images and the physical position of the workpiece under high-speed rotation, ensuring that each frame of image can be accurately associated with a unique position on the lens surface. By integrating all images of the same position in the order of processing time, the defect generation and evolution trajectory of that position from the beginning to the end of processing can be completely restored, realizing the traceability of the dynamic process of defects, and providing a key data structure foundation for process optimization and quality analysis.
[0016] (3) By setting up a multi-degree-of-freedom adjustable mounting component, the present invention enables the acquisition component to flexibly adapt to the slide structure of different SPDT machine tools, the lens workpieces of different sizes, and the different observation angle requirements. The T-slot connection method ensures the stability of the installation and the repeatability of disassembly and assembly. The hinge and ball joint structure makes the optical path alignment operation simple and accurate, providing a reliable mechanical support mechanism for obtaining stable and high-quality detection images.
[0017] (4) This invention, through the setting of a corresponding image classification unit, reorganizes the continuous image stream acquired in chronological order into 120 image sequences arranged in an orderly manner along the circumference based on the corresponding physical angle position of the workpiece. This mechanism enables all images acquired multiple times at different times for the same local area on the lens to be concentrated in the same image set for correlation analysis. This not only facilitates direct observation of the dynamic extension process of defects at this location with processing time, but also provides a structured data foundation for improving the confidence of defect identification and assessment in this area through multi-frame image fusion or sequence analysis, thereby realizing the effective conversion and mapping of detection information from a single time dimension to a two-dimensional dimension that fits time and space.
[0018] (5) This invention clearly defines the types of defects that the model needs to identify, providing a unified standard for the labeling of the training dataset and ensuring the consistency of the model output results. It covers a wide range of defects, from linear defects such as scratches and surface defects such as chipping and gaps, to point defects such as impurities and pits, enabling the detection device to handle most of the appearance quality problems that may occur in lens processing, with comprehensive detection coverage.
[0019] (6) This invention realizes a closed loop from detection, decision-making, and compensation. For repairable or avoidable local defects, the system can automatically and accurately adjust the processing parameters, avoiding the scrapping of the entire part due to minor defects, or allowing targeted treatment of the location in subsequent processes, improving process adaptability and material utilization, which is a concrete manifestation of intelligent manufacturing.
[0020] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0021] Figure 1 This is an isometric view of the entire invention.
[0022] Figure 2 This is an isometric view of the mounting assembly of the present invention.
[0023] In the diagram: SPDT machine tool 1, mounting assembly 2, T-shaped clamp 21, support rod 22, vertical hinge rod 23, horizontal hinge rod 24, universal rotating rod 25, mounting frame 26, acquisition assembly 3, detection assembly 4. Detailed Implementation
[0024] 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.
[0025] Please see Figures 1 to 2 This invention provides a fully automated online inspection device for lens appearance defects based on a diamond single-point lathe, including an SPDT machine tool 1. A mounting assembly 2 is detachably mounted on the Z-axis slide of the SPDT machine tool 1. The mounting assembly 2 is equipped with a multi-directional adjustable mounting bracket 26. A data acquisition assembly 3 is mounted on the mounting bracket 26. The optical axis of the data acquisition assembly 3 faces the workpiece processing area on the spindle end face of the SPDT machine tool 1. It also includes a detection component 4, which is electrically connected to the acquisition component 3 and to the CNC system of the SPDT machine tool 1. Detection component 4 has a built-in appearance defect recognition model, a corresponding image classification unit, and an alarm unit; The appearance defect recognition model is trained based on the appearance defect data of lenses processed by a diamond single-point lathe, and is used to identify and classify defects in the images acquired by the acquisition component 3. The alarm unit is configured to trigger an alarm immediately when a valid defect is detected; The image classification unit is configured to classify the acquired images according to their physical positions on the lens based on the image acquisition time sequence and the main axis rotation angle, forming a time-series array image set corresponding to different position areas.
[0026] In practical implementation, the SPDT machine tool 1 uses a diamond single-point lathe as the main machining body, with its Z-axis slide moving along the bed guide rail. The mounting assembly 2 quickly connects to the standard T-slot on the Z-axis slide (the standard slot on the Z-axis slide) via a T-shaped latch 21 at its bottom, enabling the entire detection device to be detachably installed on the machine tool. The acquisition assembly 3 is fixed to the end of the mounting assembly 2 via a mounting bracket 26. The detection assembly 4 is typically configured as a separate industrial control computer or embedded system chassis, placed near the machine tool housing, and operated and observed via a touch screen display.
[0027] Mounting component 2 is mechanically fixed to the Z-axis slide.
[0028] The acquisition component 3 is connected to the detection component 4 via a cable (such as a GigE or USB 3.0 data cable and a power cable).
[0029] The detection component 4 is connected to the CNC system of the SPDT machine tool 1 via another communication line (such as an Ethernet cable) and / or a hard-wired I / O interface.
[0030] During lens processing or specific inspection steps, the acquisition component 3 continuously or periodically captures images of the rotating lens workpiece surface; the acquired image data is transmitted to the inspection component 4 in real time; the built-in appearance defect recognition model of the inspection component 4 processes each frame of image and outputs whether a defect exists, the defect type, and its location in the image; the corresponding image classification unit operates synchronously, classifying the images into the corresponding lens position area set based on the acquisition sequence and spindle angle information; if a valid defect is identified, the alarm unit is triggered. According to the preset strategy, the alarm unit sends an emergency stop signal (immediately stops all movement), a feed hold signal (pauses feed, spindle may continue to rotate), or a fine-tuning compensation signal to the CNC system via a hard-wired connection; all images, recognition results, classification information, and alarm events are recorded in the storage unit of the inspection component 4 for traceability and analysis;
[0031] The detachable mounting component 2 enables rapid assembly and disassembly of the acquisition component 3 to adapt to different processing and inspection task requirements. Based on the collaborative work of the acquisition component 3, the inspection component 4, and their built-in appearance defect recognition model, corresponding image classification unit, and alarm unit, real-time acquisition of workpiece surface images can be performed during the processing of lenses on a diamond single-point lathe, and online identification and classification of defects can be completed based on the appearance defect recognition model.
[0032] When a valid defect is detected, the alarm unit sends an emergency stop signal, a feed hold signal, or a fine-tuning compensation signal to the CNC system of the SPDT machine tool 1 via a hard-wired connection, according to a preset strategy, so as to realize real-time intervention and hierarchical control of the machining process.
[0033] The software system of detection component 4 has a pre-set hierarchical control logic. It compares the information such as defect category, size, quantity and confidence level output by the appearance defect recognition model with the preset process quality threshold to determine the control level to be triggered.
[0034] Emergency Stop Signal: The highest level alarm signal, instructing the CNC system to immediately execute an emergency stop procedure that cuts off power to all motion axis servos.
[0035] Feed hold signal: A medium-level alarm signal that instructs the CNC system to pause the movement of all feed axes (such as X and Z axes), but usually maintains the spindle rotation.
[0036] Fine-tuning compensation enable signal: A specific alarm signal that instructs the CNC system to prepare to receive compensation parameters from detection component 4 and to start the preset toolpath dynamic modification macro program.
[0037] Scenario 1: Emergency Stop Control—Addressing Irreversible Defects Triggering defects: When severe material loss defects such as “edge chipping” or large “edge gaps” are identified, and their size exceeds the safety process limit, they are judged to be irreparable catastrophic defects.
[0038] During the processing, the acquisition component 3 captures an image and transmits it to the detection component 4.
[0039] The appearance defect recognition model analyzed the image and identified a "chipped edge" defect that exceeded the size limit, with a confidence level higher than 95%. Based on this, the software's grading logic determined it to be the highest level of risk.
[0040] The alarm unit immediately closes the physical relay corresponding to the "emergency stop signal," and the hard-wired signal is transmitted to the emergency stop input port of the CNC system within milliseconds.
[0041] The CNC system interrupts the current machining program and immediately cuts off the power to the servo motors of each axis, causing all movements of the SPDT machine tool 1 to stop instantly.
[0042] This avoids further ineffective processing on workpieces with serious defects, prevents secondary damage to the cutting tool that may be caused by hitting the edge of the defect, ensures equipment safety, and minimizes scrap loss.
[0043] Scenario 2: Feed Holding Control – Addressing Defects Requiring Manual Verification Triggering Defect: Suspicious "scratches" or atypical defects are identified, with a severity between acceptable and scrapping requirements, requiring on-site intervention by operators for judgment.
[0044] The appearance defect recognition model identified a continuous "scratch," but its width or contrast was within the process warning threshold.
[0045] The hierarchical logic determines that the defect requires pausing processing for manual inspection, but does not necessitate an emergency shutdown. The alarm unit closes the relay corresponding to the "feed hold signal".
[0046] Upon receiving this signal, the CNC system immediately suspends the execution of all feed movement commands (G01, G02 / G03, etc.), and the tool remains in its current position. The spindle typically continues to rotate to maintain observation conditions.
[0047] The inspection component 4 can alert the operator via an audible and visual alarm. The operator can view the images of the categorized defects and their location information on the display screen of the inspection component 4, and make a decision on whether to continue processing, compensate for and repair, or discard the workpiece.
[0048] It provides a buffer for quality assessment without shutting down the machine, reduces unnecessary downtime, improves the flexibility of the production process, and ensures that key quality points are under control.
[0049] Scenario 3: Fine-tuning compensation control—addressing localized defects that can be automatically avoided. Triggering defects: Identifies isolated localized point defects such as "micro-pits" or "surface impurities".
[0050] The appearance defect recognition model identifies a "micro-dimple" and outputs its pixel coordinates in the frame image.
[0051] Detection component 4 synchronously calls the corresponding image classification unit. Based on the image acquisition timestamp and the real-time spindle speed read from the CNC system, the cumulative rotation angle θ of the lens corresponding to the frame image is calculated, thereby determining which fixed angle interval (e.g., the 45th interval) of the lens circumference the "micro-dimple" is located in.
[0052] By combining the camera calibration parameters (already completed), the pixel coordinates of the defect are converted into the precise physical location (radius R and angle α) in the lens workpiece coordinate system.
[0053] The hierarchical logic determines that this type of defect is suitable for online compensation. The alarm unit first closes the "fine-tuning compensation enable signal" to notify the CNC system to prepare to receive compensation data.
[0054] The detection component 4 sends the calculated "toolpath offset" data packet (including defect location α, avoidance radius r, etc.) to the CNC system via the Ethernet communication port.
[0055] The preset macro program in the CNC system is triggered, dynamically modifying the subsequent finishing toolpath. When the tool moves to near angle α, it automatically adds an offset in the radial direction to avoid the circular area with radius r centered on the defect point.
[0056] It achieves true closed-loop control of "detection, decision-making, and compensation". For localized, avoidable defects, the system can automatically and accurately adjust the machining trajectory, avoiding the scrapping of the entire workpiece due to minor defects, and improving material utilization and first-pass yield.
[0057] The alarm unit is also connected to the audible and visual alarm of the SPDT machine tool 1 to control its alarm.
[0058] The image classification unit divides a 360° rotation of the lens into N equally spaced angular intervals, categorizing acquired images into specific intervals based on their corresponding principal axis rotation angles. This constructs a time-series array of images corresponding to different physical locations. This design completely solves the problem of inconsistent correspondence between continuously acquired images and workpiece physical positions under high-speed rotation, ensuring that each frame is accurately associated with a unique position on the lens surface. By integrating all images of the same location in chronological order of processing time, the defect generation and evolution trajectory at that location from the start to the end of processing can be completely reconstructed, achieving traceability of the dynamic defect process and providing a crucial data structure foundation for process optimization and quality analysis.
[0059] Furthermore, the mounting assembly 2 includes a T-shaped locking block 21, a support rod 22, a vertical hinge rod 23, a horizontal hinge rod 24, a universal swivel rod 25, and a mounting bracket 26; The T-shaped block 21 is provided with a protrusion that matches the T-shaped groove on the Z-axis slide, and a detachable connection is achieved by inserting the protrusion into the T-shaped groove; The lower end of the support rod 22 is fixedly connected to the T-shaped locking block 21, and its upper end is connected to one end of the vertical hinge rod 23 through the first hinge shaft, so that the vertical hinge rod 23 can rotate in the vertical plane. The other end of the vertical hinge rod 23 is connected to one end of the horizontal hinge rod 24 through the second hinge shaft, so that the horizontal hinge rod 24 can rotate in the horizontal plane; The other end of the transverse hinge rod 24 is provided with a ball socket, and one end of the universal rotating rod 25 is provided with a ball head that mates with the ball socket, forming a ball hinge connection; The other end of the universal swivel rod 25 is fixedly connected to the mounting bracket 26.
[0060] In practice, the protrusion of the T-shaped locking block 21 is aligned with and inserted into the T-slot (the standard slot on the Z-axis slide) of the SPDT machine tool 1, so that the vertical hinge rod 23 is perpendicular to the T-slot. Since the outer wall of the T-shaped locking block 21 fits the inner wall of the T-slot and the vertical hinge rod 23 is perpendicular to the T-slot, the T-shaped locking block 21 can be fixed inside the T-slot. At the same time, bolts can be added for locking to prevent it from loosening during processing vibration.
[0061] Loosen the locking nuts on the first and second hinge shafts (not shown in the figure, this is a conventional design), and manually adjust the pitch angle of the vertical hinge rod 23 in the vertical plane and the swing angle of the horizontal hinge rod 24 in the horizontal plane so that the mounting frame 26 and the acquisition component 3 above it are roughly facing the workpiece processing area.
[0062] By utilizing the ball joint connection of the universal rotating rod 25, fine-tuning of the angle in any direction within a small range can be performed to ensure that the optical axis of the acquisition component 3 is precisely perpendicular to the target area on the surface of the lens under test, or to achieve a specific tilt observation angle. Ball joints can be fixed by friction or by adding locking bolts; After all angles have been adjusted, tighten the locking nuts of the first hinge shaft and the second hinge shaft in sequence, as well as the locking bolts at the ball joint (not shown in the figure), to completely fix the posture of the entire mounting assembly 2.
[0063] By incorporating a multi-degree-of-freedom adjustable mounting component 2, the acquisition component 3 can flexibly adapt to the slide structure of different SPDT machine tools, the size of lens workpieces, and the requirements of different observation angles. The T-slot connection ensures the stability and repeatability of the installation, while the hinge and ball joint structure makes the optical path alignment operation simple and precise, providing a reliable mechanical support mechanism for obtaining stable and high-quality inspection images.
[0064] Furthermore, the image classification unit is configured to perform the following classification operations: the lens workpiece is rotated 360° and divided into N equally divided angle intervals, where N is an integer greater than 1; for each input image, based on its acquisition timestamp t and the real-time rotational speed ω of the spindle at the time of acquisition, the cumulative rotation angle θ = ω * t of the spindle from the set reference start time to timestamp t is calculated; the fixed angle interval number k to which it belongs is determined based on the cumulative rotation angle θ, k = floor(θ / (360° / N)) + 1; the image is classified into the time-series array image set numbered k and arranged in order of timestamp t.
[0065] The parameter N is set to 120, which means that the 360° rotation of the lens is evenly divided into 120 angular intervals, each interval corresponding to a 3° arc segment. When the system starts or begins detection, the zero-position signal of the spindle encoder or the moment when a specific instruction is received from the CNC system is used as the reference start time.
[0066] Whenever the acquisition component (3) acquires an image frame, the image and its corresponding timestamp t (the number of milliseconds from the reference start time) are sent to the corresponding image classification unit. At the same time, this unit reads the spindle speed ω (unit: revolutions per second) from the CNC system in real time through the communication interface.
[0067] For each input image, process it according to the following steps: Calculate the cumulative rotation angle: Calculate the cumulative angle θ (unit: degrees) of the spindle from the reference start time to the acquisition time using the formula θ=ω×t×360. For example, if an image frame is acquired 0.25 seconds after the reference start time, and the spindle speed ω=10 revolutions / second at this time, then the cumulative angle θ=10×0.25×360=900°.
[0068] Determine the assigned range: Due to the periodic rotation of the workpiece, the cumulative angle θ needs to be normalized to the range of [0°, 360°), i.e., calculation. In the example above, Next, calculate the fixed angle interval number k to which the image belongs:
[0069] .
[0070] for ,but , function To round down (in Python, you need to import the math module first; math.floor() returns an integer), This indicates that the image belongs to the 61st angular interval (corresponding to an arc range of 178°-181°).
[0071] Classification and Sorting: The system maintains 120 independent time-series array image sets in memory, each set corresponding to a fixed angular interval. The above images are added to the image set numbered k=61, and inserted into the set in chronological order according to their timestamp t, maintaining the temporal arrangement.
[0072] In Python, the timestamp is obtained using `time.time()`, which is the `time()` function of the `time` module.
[0073] Through the aforementioned operation of the image classification unit, the continuous image stream acquired in chronological order is reorganized into 120 image sequences arranged in an orderly manner along the circumference, based on their corresponding physical angular positions on the workpiece. This mechanism allows all images acquired multiple times at different times for the same local area (same angular range) on the lens to be grouped into a single image set for correlation analysis. This not only facilitates direct observation of the dynamic extension process of defects (such as scratches) at that location over processing time, but also provides a structured data foundation for improving the confidence of defect identification and assessment in that area through multi-frame image fusion or sequence analysis, thereby realizing the effective conversion and mapping of detection information from a single time dimension to a two-dimensional "time and space" dimension.
[0074] Furthermore, the appearance defect recognition model can identify and classify defect types including scratches, chipped edges, surface impurities, edge gaps, and micro-pits.
[0075] In practical implementation, the appearance defect recognition model is trained to identify and distinguish the following five typical defects, which are represented in the image as follows: Scratches: appear as thin, continuous lines of dark or bright lines with a clear directionality, usually caused by tool wear or environmental particles.
[0076] Edge chipping: appears at the edge of the lens, manifested as a gap or fragmented shadow formed by the local loss of material at the edge, and is relatively large in size.
[0077] Surface impurities: These appear as isolated dots or small clumps of discolored areas attached to the lens surface, such as dust, oil, or coolant residue.
[0078] Edge notch: Specifically refers to a more regular or smaller shape defect located at the edge of the lens than a chipped edge, which may be caused by the material itself or clamping stress.
[0079] Micro-dimples: These are small, round or near-circular dark spots scattered on the surface of the lens, usually caused by micropores inside the material or extremely small impacts during processing.
[0080] The clearly defined defect types that the model needs to identify provide a unified standard for labeling the training dataset, ensuring the consistency of the model's output results. Covering a wide range of defects, from linear defects (scratches) and surface defects (chips, gaps) to point defects (impurities, pits), this inspection device can handle most of the appearance quality problems that may occur in lens processing, providing comprehensive inspection coverage.
[0081] Furthermore, the appearance defect recognition model is obtained in the following way: a YOLO object detection network architecture based on pre-trained weights is used as the basic model; image data of defect types generated during the processing of lenses on a diamond single-point lathe are collected to form a training dataset, and the defect locations and categories in the images are labeled with standard bounding boxes; the basic model is fine-tuned using the training dataset, and the model weights are adapted to the lens appearance defect recognition task through iterative optimization, and finally the appearance defect recognition model is obtained.
[0082] In practice, select a specific YOLO object detection network architecture (such as YOLOv5s) as the base model. Download the model weight file pre-trained on a large general dataset (such as COCO) from the open source community, and set up the model pre-training environment based on the development documentation of the open source community.
[0083] Lenses are processed on multiple SPDT machine tools 1 under different working conditions (different materials, tools, and speeds), and a large number of images of the lens surface during or after processing are acquired using the installed acquisition components 3.
[0084] Using an image annotation tool (such as LabelImg), manually annotate all defect instances in each image according to the defect types defined in Example 4. The annotation information includes the defect category (such as "scratch") and its precise bounding box coordinates (standard box annotation).
[0085] The labeled image dataset is randomly divided into training, validation, and test sets, typically in a ratio of 7:2:1.
[0086] Load the pre-trained weights into the YOLO base model.
[0087] The model is trained using training set images and labeled information. During training, the model iteratively updates its network weights through backpropagation, learning to map lens image features to specific defect categories and locations.
[0088] During training, use a validation set to monitor model performance and prevent overfitting.
[0089] After training, the model's performance metrics (such as mean accuracy, mAP) are evaluated using a test set. Once the preset accuracy requirements are met, the final model weights and structure file are exported and deployed to the software environment of detection component 4, thus becoming a usable appearance defect recognition model.
[0090] By employing a pre-training + fine-tuning approach, the need for massive amounts of labeled data and training time required for specific industrial scenarios (lens defect detection) is significantly reduced. Pre-training weights endow the model with general feature extraction capabilities, while fine-tuning enables it to quickly focus on learning the subtle features of lens defects, thus achieving a high-precision and robust recognition model even with limited specialized data.
[0091] Furthermore, the acquisition component 3 includes an industrial camera and a coaxial light source. The image sensor of the industrial camera has a resolution of no less than 5 million pixels. The light beam emitted by the coaxial light source is aligned with the optical axis of the industrial camera after passing through a beam splitter, and is vertically irradiated onto the lens surface of the workpiece processing area.
[0092] In practical implementation, the acquisition component 3 consists of an industrial camera and a coaxial light source integrated into a compact housing.
[0093] Industrial camera: A CMOS area array industrial camera with a resolution of 5 megapixels (e.g., 2448x2048) is selected, equipped with a fixed-focus lens suitable for detail resolution. The high resolution ensures that minute defects such as "micro-dimples" as defined in claim 4 can be distinguished.
[0094] Coaxial light source: An LED coaxial light source is used. Its internal optical path is designed as follows: the light emitted by the LED passes through a light diffuser and then illuminates a beam splitter (a semi-transparent, semi-reflective mirror). The beam splitter is placed at a 45° angle to the optical axis of the industrial camera lens.
[0095] Optical path principle: After being reflected by the beam splitter, the light changes direction by 90°, becoming a beam that is completely aligned with the optical axis of the industrial camera (coaxial), and then shines perpendicularly onto the surface of the workpiece on the lens. The reflected light from the lens surface (carrying surface topography information) returns perpendicularly along the original path, passes through the beam splitter, and finally enters the industrial camera lens to form an image.
[0096] Installation and alignment: Fix the entire acquisition component 3 on the mounting bracket 26, and adjust the mounting component 2 to ensure that the coaxial beam is perpendicular to the center of the area to be measured on the lens.
[0097] Coaxial illumination effectively suppresses direct reflection glare from mirror-like workpieces due to curvature or tilt, causing surface scratches, pits, and other defects to appear as clear dark features in the image due to light scattering, creating high contrast with the bright background. The 5-megapixel resolution provides the detection system with sufficient pixels to characterize the geometric features of minute defects. This hardware configuration is crucial for obtaining stable, high-contrast defect images.
[0098] Furthermore, during the fine-tuning training process, data augmentation processing, including random rotation, brightness adjustment, and the addition of Gaussian noise, is applied to the images in the training dataset.
[0099] In practice, random rotation is employed: with the image center as the origin, the image and its corresponding annotation box are randomly rotated within an angle range of [-5°, +5°]. This simulates the minute angular deviations that occur during workpiece installation or image acquisition.
[0100] Brightness adjustment: Multiply the image pixel brightness value by a coefficient randomly generated in the range of [0.9, 1.1] to simulate the small fluctuations in ambient light intensity or light source aging.
[0101] Add Gaussian noise: Add Gaussian noise with a mean of 0 and a standard deviation of [0,5] (for 8-bit images, pixel values range 0-255) to the image to simulate the noise characteristics of the camera sensor in low light or high gain.
[0102] These data augmentations effectively expand the size and diversity of the training dataset without actually collecting new data. They force the model to learn the essential features of defects, rather than memorizing specific angles, brightness, or noise patterns, thereby significantly improving the generalization ability and robustness of appearance defect recognition models under real-world, variable conditions, and reducing false positives or false negatives caused by minor environmental changes.
[0103] Furthermore, the electrical signal connection between the alarm unit and the CNC system of the SPDT machine tool 1 is a hard-wired connection; the alarm unit is configured to output an emergency stop signal, a feed hold signal, or a fine-tuning compensation signal to the CNC system when an alarm is triggered.
[0104] In practical implementation, multiple signal lines are led out from the alarm unit (usually a digital output module) of detection component 4 and directly connected to the general-purpose digital input interface reserved in the CNC system of SPDT machine tool 1. For example, three lines are used to correspond to the "emergency stop", "feed hold", and "compensation enable" signals, respectively. The signal ground wire is shared.
[0105] Signal definition and output: When the alarm unit decides to trigger the highest level alarm based on the identification result, it closes the relay corresponding to the "emergency stop" signal. This signal is identified by the CNC system as an external emergency stop input, and the safety procedure of powering off all axis servos is immediately executed.
[0106] When a defect is deemed necessary to pause for inspection but not for an emergency shutdown, closing the "feed hold" signal stops the feed motion of each axis in the CNC system, but the spindle may continue to rotate.
[0107] Once a specific type of defect is identified and the compensation parameters are calculated, the alarm unit first closes the "compensation enable" signal, and then sends the specific "fine-tuning compensation signal" (such as the compensation value) to the CNC system through another communication channel (such as Ethernet) or analog output.
[0108] Priority logic: In the internal software of detection component 4, a clear signal output priority is set, such as "emergency stop" taking precedence over "feed hold".
[0109] Hard-wired connections offer extremely low signal transmission delay and strong resistance to electrical interference, ensuring the real-time performance and reliability of alarm signals and meeting industrial safety control requirements. Different signal types provide the CNC system with a tiered response strategy, enabling flexible process control from complete shutdown and pause to online compensation, thus improving the intelligence level of production response to abnormal situations.
[0110] Furthermore, the fine-tuning compensation signal is generated collaboratively by the defect recognition result output by the detection component 4 based on the appearance defect recognition model and the time-series array image set generated by the co-position image classification unit; When the detected defect is a tiny pit or surface impurity, the detection component 4 calculates the corresponding tool path offset based on the physical location of the defect on the processed lens, and sends a fine-tuning compensation signal containing the tool path offset to the CNC system of the SPDT machine tool 1.
[0111] In practical implementation, taking triggering toolpath offset compensation as an example: Triggering condition: The appearance defect recognition model identifies a "micro-dimple" defect in the current frame image and outputs its category and pixel coordinates. This recognition result is marked as a valid defect.
[0112] Location association: Detection component 4 calls the corresponding image classification unit. Based on the image acquisition timestamp and spindle speed, the cumulative rotation angle θ of the lens corresponding to the image is calculated, thereby determining which angle interval the defect is located in (e.g., the 120th interval, corresponding to the 119°-120° ring).
[0113] Coordinate transformation: Combining camera calibration parameters (pixel to physical size conversion), the installation position of acquisition component 3, and the pixel coordinates of the defect in the image, the precise physical position (radius R and angle α) of the "micro-dimple" in the lens workpiece coordinate system is calculated.
[0114] Compensation Calculation: The preset compensation strategy is activated. For example, the strategy specifies that for a "micro-dimple," the tool should avoid a circular area centered on that point with a radius of r (slightly larger than the radius of the dimple) in the subsequent finishing toolpath. Based on this, the detection component 4 calculates that the tool needs to make a radial avoidance offset near angle α on the original programmed path, generating a "toolpath offset" data packet.
[0115] Signal transmission and execution: The alarm unit sends a "fine-tuning compensation signal" to the CNC system. This signal contains the instruction type (path offset) and the aforementioned offset data packet. After receiving this signal, the CNC system's macro program or specific loop dynamically modifies the toolpath that is being executed or about to be executed, so that the tool automatically avoids the defect location when machining near angle α.
[0116] It achieves a true closed loop of "detection, decision-making, and compensation". For repairable or avoidable local defects, the system can automatically and accurately adjust processing parameters, avoiding the scrapping of the entire part due to minor defects, or allowing targeted treatment of the location in subsequent processes, improving process adaptability and material utilization, which is a concrete manifestation of intelligent manufacturing.
Claims
1. A fully automated online inspection device for lens appearance defects based on a diamond single-point lathe, comprising an SPDT machine tool (1), characterized in that: A mounting assembly (2) is detachably mounted on the Z-axis slide of the SPDT machine tool (1). The mounting assembly (2) is provided with a multi-directional adjustable mounting bracket (26). A data acquisition assembly (3) is mounted on the mounting bracket (26). The optical axis of the data acquisition assembly (3) faces the workpiece processing area of the spindle end face of the SPDT machine tool (1). The system also includes a detection component (4), which is electrically connected to the acquisition component (3) and electrically connected to the CNC system of the SPDT machine tool (1). The detection component (4) has a built-in appearance defect recognition model, a corresponding image classification unit, and an alarm unit; The appearance defect recognition model is trained based on the appearance defect data of the lens processed by the diamond single-point lathe, and is used to identify and classify defects in the images acquired by the acquisition component (3). The alarm unit is configured to trigger an alarm immediately when a valid defect is detected; The image classification unit is configured to classify the acquired images according to their physical positions on the lens based on the image acquisition time sequence and the main axis rotation angle, forming a time-series array image set corresponding to different position areas.
2. The full-automatic online detection device for lens cosmetic defects based on diamond single-point lathe according to claim 1, characterized in that: The mounting assembly (2) includes a T-shaped locking block (21), a support rod (22), a vertical hinge rod (23), a horizontal hinge rod (24), a universal rotating rod (25), and a mounting bracket (26). The T-shaped block (21) is provided with a protrusion that matches the T-shaped groove on the Z-axis slide, and a detachable connection is achieved by inserting the protrusion into the T-shaped groove; The lower end of the support rod (22) is fixedly connected to the T-shaped block (21), and its upper end is connected to one end of the vertical hinge rod (23) through the first hinge shaft, so that the vertical hinge rod (23) can rotate in the vertical plane. The other end of the vertical hinge rod (23) is connected to one end of the horizontal hinge rod (24) through a second hinge shaft, so that the horizontal hinge rod (24) can rotate in the horizontal plane; The other end of the transverse hinge rod (24) is provided with a ball socket, and one end of the universal rotating rod (25) is provided with a ball head that mates with the ball socket, forming a ball hinge connection; The other end of the universal rotating rod (25) is fixedly connected to the mounting bracket (26).
3. The fully automated online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 1, characterized in that: The corresponding image classification unit is configured to perform the following classification operations: The lens workpiece is rotated 360° and divided into N equally divided angle intervals, where N is an integer greater than 1; for each input image, the cumulative rotation angle of the spindle from the set reference start time to the time stamp t is calculated based on its acquisition timestamp and the real-time rotation speed of the spindle during acquisition; the fixed angle interval number k to which it belongs is determined based on the cumulative rotation angle; the image is classified into the time-series array image set numbered k and arranged in order of timestamp t.
4. The fully automated online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 1, characterized in that: The appearance defect recognition model can identify and classify defect types including scratches, chipped edges, surface impurities, edge gaps, and micro-pits.
5. The fully automated online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 4, characterized in that: The appearance defect recognition model is obtained in the following way: a YOLO object detection network architecture based on pre-trained weights is used as the basic model; image data of defect types generated during the processing of lenses by a diamond single-point lathe are collected to form a training dataset, and the defect locations and categories in the images are labeled with standard bounding boxes; the basic model is fine-tuned using the training dataset, and the model weights are adapted to the lens appearance defect recognition task through iterative optimization, and finally the appearance defect recognition model is obtained.
6. The fully automatic online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 1, characterized in that: The acquisition component (3) includes an industrial camera and a coaxial light source. The image sensor of the industrial camera has a resolution of no less than 5 million pixels. The light beam emitted by the coaxial light source is aligned with the optical axis of the industrial camera after passing through a beam splitter and is perpendicularly irradiated onto the lens surface of the workpiece processing area.
7. The fully automatic online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 1, characterized in that: During the fine-tuning training process, data augmentation processing, including random rotation, brightness adjustment, and addition of Gaussian noise, is applied to the images in the training dataset.
8. The fully automatic online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 1, characterized in that: The electrical signal connection between the alarm unit and the CNC system of the SPDT machine tool (1) is a hard wire connection; the alarm unit is configured to output an emergency stop signal, a feed hold signal or a fine adjustment compensation signal to the CNC system when the alarm is triggered.
9. The fully automatic online inspection device for lens appearance defects based on a diamond single-point lathe according to claim 8, characterized in that: The fine-tuning compensation signal is generated collaboratively by the defect recognition result output by the detection component (4) based on the appearance defect recognition model and the time-series array image set generated by the co-position image classification unit; When the detected defect is a small pit or surface impurity, the detection component (4) calculates the corresponding tool path offset based on the physical position of the defect on the processed lens, and sends the fine-tuning compensation signal containing the tool path offset to the CNC system of the SPDT machine tool (1).