Robot flexible detection method and system for complex configuration gear surface defects
Patent Information
- Application Number
- CN202611165291.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-20
AI Technical Summary
[0011]有鉴于此,本发明的目的在于提供一种复杂构型齿轮表面缺陷的机器人柔性检测方法及系统,通过构建齿轮智能检测知识图谱驱动检测全过程,实现基于齿轮构型识别的机器人轨迹自适应规划、多模态相机按需切换、以及不确定性驱动的主动复检,最终形成“知识组织-对象识别-任务规划-执行检测-主动复检-结果更新”的一体化智能闭环,以解决现有齿轮检测中换型依赖人工、轨迹固定、模态单一、缺乏主动决策能力的问题,大幅提升复杂构型齿轮表面缺陷检测的柔性、精度和智能化水平
本发明复杂构型齿轮表面缺陷的机器人柔性检测方法,通过包括知识图谱构建、类型识别、轨迹规划、动态切换、多模态检测、主动复检和知识更新的七个步骤的协同作用,形成了一个完整的智能检测闭环,取得了以下技术效果。
Smart Images

Figure REF-OBJ-1785741288165-000001 
Figure REF-OBJ-1785741288165-000002 
Figure REF-OBJ-1785741288165-000003
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of intelligent manufacturing, industrial robots, machine vision, knowledge graphs and gear quality inspection technology, and specifically relates to a robot flexible inspection method and system for surface defects of gears with complex configurations; The complex configuration gears referred to in this invention are gears to be inspected that belong to a pre-defined set of gear configurations. These gear configurations are determined based on characteristics such as tooth distribution, tooth line direction, tooth surface spatial morphology, helical direction, helical angle, local curvature, and tooth assembly structure. They include, but are not limited to, spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. Different configuration gears differ in tooth surface spatial distribution, tooth line direction, local curvature, observable direction, and the space accessible to robot detection. Background Technology
[0002] Gears, as crucial transmission components in automotive transmissions, reducers, industrial robot joints, aerospace transmission systems, construction machinery, CNC machine tools, and precision instruments, directly impact their meshing accuracy, load-bearing capacity, transmission smoothness, and service life due to their surface finish. During processes such as turning, hobbing, shaping, shaving, grinding, heat treatment, shot peening, cleaning, transportation, and assembly, gears may develop various defects, including black scale, scratches, dents, missing material, burrs, tool marks, rust spots, color differences, unfinished parts, and visible surface cracks. These defects alter the geometry and contact state of the tooth surface, causing localized stress concentration, increased vibration and noise, and reduced fatigue life. In severe cases, they can lead to premature gear failure or even major equipment safety accidents. Therefore, implementing efficient and accurate surface defect detection during gear manufacturing and service is of paramount importance for ensuring the reliability and safety of transmission systems.
[0003] Currently, gear surface defect detection mainly employs methods such as manual visual inspection, fixed camera vision inspection, line scan camera scanning, 3D contour measurement, and deep learning-based image recognition. Manual visual inspection relies on the experience, fatigue level, and subjective judgment of the inspectors, resulting in low efficiency and consistency, making it difficult to meet the automated quality control requirements of multi-variety, high-volume gear production lines. Especially in scenarios involving the identification of minute defects and long-term continuous inspection, the missed detection rate and false positive rate of manual inspection increase significantly.
[0004] Fixed vision inspection systems typically have pre-set camera positions, lens focal lengths, working distances, exposure parameters, and lighting methods for a specific gear specification. However, when switching between different configurations such as spur / helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears, significant changes occur in tooth distribution, tooth line direction, tooth surface spatial morphology, and local curvature. This often renders the original inspection field of view, spatial resolution, and shooting angle unsuitable, requiring manual readjustment of camera positions, light source directions, and inspection programs. This results in lengthy changeover times and a severe lack of inspection flexibility. This limitation is particularly pronounced in multi-variety, small-batch production models, severely restricting production efficiency and equipment utilization.
[0005] Gears with different configurations exhibit significant differences in tooth distribution, tooth line direction, tooth surface spatial morphology, local curvature, pressure angle, helix angle, and the detectable space. Spur and helical cylindrical gears have teeth primarily distributed on the cylindrical surface. Helical cylindrical gears have an angle between their tooth line and the gear axis, requiring the robot's scanning direction to be adjusted based on the helix angle and tooth line direction. Bevel gears have teeth distributed on a conical base surface. Spiral bevel gears have spatially curved tooth lines and continuously changing tooth surface normals, requiring continuous adjustment of the robot's observation posture during inspection. Face gears have teeth primarily distributed on the end face region, with differences in tooth surface posture at different radial positions. Herringbone gears have a tooth line structure with opposite left and right helical directions arranged symmetrically, requiring separate planning of scanning directions and robot postures for the left and right tooth surfaces. Helical gears have teeth distributed along the helical direction, requiring the generation of continuous scanning trajectories based on the tooth line direction. Worm gears have helical tooth surfaces and complex spatial meshing structures, making some areas to be inspected susceptible to occlusion by adjacent tooth surfaces and their own structure. The diversity of gear configurations places higher demands on the robot accessibility, observation posture, detection trajectory, camera working distance, and illumination direction of the detection system, which traditional fixed-configuration detection solutions cannot effectively address.
[0006] Most existing robot vision inspection systems employ pre-taught fixed motion trajectories. The robot photographs the gear surface from a fixed position and in a fixed sequence, without fully considering gear configuration type, tooth surface curvature, local normals, occlusion degree, camera depth of field, and defect risk distribution. When gear size or tooth structure changes, fixed trajectories are prone to problems such as inappropriate detection distance, target area defocusing, tooth root occlusion, missed local surfaces, and collisions between the robot and gears or fixtures, seriously affecting the versatility and reliability of the inspection system.
[0007] Gear surfaces are characterized by periodic tooth profiles, complex curvature, and strong metallic reflectivity. Different defects exhibit significantly different appearances in imaging. Black spots, rust, and color differences primarily manifest as variations in color, brightness, and reflectivity; scratches and knife marks mainly appear as directional, elongated textures; dents and missing material primarily appear as missing tooth boundaries or localized depressions; burrs mainly appear as localized protrusions at the tooth tip, root, or chamfered area. Relying solely on ordinary two-dimensional images makes it difficult to accurately identify defects with different physical properties simultaneously. For example, metallic highlights may be misidentified as burrs, tooth root shadows as black spots, normal grinding textures as scratches, and two-dimensional bright spots are difficult to determine whether they are surface reflections or localized protrusions. Single-modal detection methods lack sufficient information dimensions when dealing with multi-type, multi-morphological defects, making it difficult to guarantee identification reliability.
[0008] While some existing systems are equipped with multiple cameras or sensors, they typically collect all modal data in a fixed order, regardless of the current gear configuration, the detection area, or whether suspected defects require measurement. This approach increases robot movement distance, camera switching frequency, data processing volume, and detection cycle time. For scratch defects that can be identified using only 2D textures, acquiring complete 3D point clouds wastes detection resources. For burrs, missing parts, and dents that cannot be identified using 2D images, failure to switch to a 3D contour camera for precise measurement can easily lead to misjudgments and missed detections. The lack of an intelligent decision-making mechanism for on-demand allocation of detection resources makes it difficult to reconcile the conflict between detection efficiency and accuracy.
[0009] Furthermore, gear surface inspection involves a wealth of process knowledge and expert experience. For example, different machining processes are prone to producing various defects; different types of defects typically appear in which tooth surface areas; which cameras and light sources are suitable for a particular type of defect; from what angle should the robot observe the tooth tip, tooth surface, and tooth root; and what inspection accuracy and quality standards correspond to different gear specifications. This knowledge is usually scattered across gear machining manuals, process specifications, quality inspection standards, equipment manuals, historical inspection records, and the experience of technical personnel. The lack of a unified, structured organization and convenient access methods makes it difficult for the inspection system to effectively utilize this valuable experience.
[0010] Existing inspection systems typically set up gear configuration recognition, robot trajectory planning, camera parameter configuration, and defect recognition models independently. They fail to leverage existing process knowledge to automatically generate inspection plans based on gear configuration types, and struggle to proactively adjust robot actions and inspection modalities according to image quality and defect uncertainties during the inspection process. Therefore, there is an urgent need for a flexible robotic inspection method that can structure expert experience and process knowledge, determine gear configuration types and inspection requirements through initial visual assessment, adaptively generate robot inspection trajectories and camera configurations based on gear structure, and integrate multimodal information to complete defect recognition and proactive re-inspection. This would achieve an integrated intelligent closed loop in the process of detecting surface defects in complex gear configurations, encompassing "knowledge organization - object recognition - task planning - robot execution - multimodal detection - proactive re-inspection - result updating," thereby effectively improving the flexibility, intelligence, and high reliability of gear inspection. Summary of the Invention
[0011] In view of this, the purpose of this invention is to provide a robotic flexible inspection method and system for surface defects of complex gear configurations. By constructing a gear intelligent inspection knowledge graph to drive the entire inspection process, it realizes adaptive robot trajectory planning based on gear configuration recognition, on-demand switching of multimodal cameras, and proactive re-inspection driven by uncertainty. Ultimately, it forms an integrated intelligent closed loop of "knowledge organization - object recognition - task planning - execution inspection - proactive re-inspection - result update", which solves the problems of manual change, fixed trajectory, single modality, and lack of proactive decision-making ability in existing gear inspection, and significantly improves the flexibility, accuracy and intelligence level of surface defect inspection of complex gear configurations.
[0012] To achieve the above objectives, the present invention provides the following technical solution: This invention first proposes a robotic flexible detection method for surface defects of gears with complex configurations, comprising the following steps: S1: Construct a knowledge graph for intelligent gear detection. The knowledge graph includes entities, attributes, and their relationships among gear configuration categories, configuration features, gear specifications, processing procedures, tooth surface areas, defect types, detection modes, cameras, light sources, and robot observation postures. S2: Acquire the initial visual image of the gear to be inspected, extract the gear structure features, match the extracted visual features with the knowledge graph, identify the configuration type and specification parameters of the gear to be inspected, and generate a flexible inspection task according to the detection area, observation method and detection accuracy requirements corresponding to different gear configurations. S3: Based on the gear configuration type, configuration features, specification parameters, the area of the tooth surface to be inspected, and the correlation in the knowledge graph, generate candidate observation postures for the robot. After screening by kinematic constraints and imaging quality constraints, plan the robot detection trajectory and select the initial camera and light source configuration according to the detection task. S4: During the execution of the inspection task, the imaging quality and defect judgment confidence are evaluated in real time. When it is determined that the current camera cannot meet the inspection requirements or there is uncertainty in the inspection, the camera mode is adaptively switched and the local re-inspection trajectory is replanned. S5: Collect multimodal detection data of the gear surface according to the planned trajectory, including at least two of the following: two-dimensional images, polarized images and three-dimensional contour data, and perform defect detection on each area of the tooth surface; S6: Fusion of detection results from different modalities, outputting defect category, location, size and quality judgment results. When the fusion confidence is lower than the preset threshold or there is a conflict between modal results, active re-inspection is triggered. S7: Write the confirmed detection results back to the knowledge graph and update the association weights between entities.
[0013] Furthermore, in step S1, the gear intelligent detection knowledge graph is represented as follows:
[0014] in: This represents a knowledge graph for intelligent gear detection. Represents the set of entity nodes in a knowledge graph; Represents a set of relations in a knowledge graph; Represents the set of entity attributes and relationship attributes; Collect gear design data, machining processes, quality specifications, and historical testing data; extract entities, attributes, and relationships to form a gear testing knowledge triplet, represented as follows:
[0015] in: Indicates the head entity; Indicates the tail entity; This indicates the relationship between the head entity and the tail entity; The entities include at least: gear configuration type, tooth surface area, defect type, detection mode, camera, light source, and robot observation posture; the relationships include at least: belonging to, including, possibly occurring, suitable for detection, recommended for use, corresponding posture, and requiring re-inspection; The gear configuration category includes at least spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears; the gear configuration features include at least one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure features; the gear configuration category is determined based on one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure features.
[0016] Furthermore, step S1 also includes updating the knowledge association weights, the method of which is as follows: Update the entity based on historical monitoring data. With entity Relationship weights between the two:
[0017] in: Indicates the updated entity With entity Relationship weights between them; For the entity before the update With entity Relationship weights between them; Representing entities In entity The number of times it appears in the corresponding detection record; Representing entities The total number of corresponding detection records; This represents the knowledge update coefficient.
[0018] Furthermore, in step S2, a gear configuration feature vector is constructed based on the gear structure features, represented as:
[0019] in: Indicates the overall dimensional characteristics of the gear; Indicates the inner diameter of the gear or the dimensional characteristics of the shaft; Indicates the number of teeth; Indicates tooth width characteristics; Indicates the characteristics of tooth line inclination or helix angle and helix direction; It represents the tooth distribution pattern and the spatial structure characteristics of the tooth surface, and is used to characterize the structural differences of different tooth carrier surfaces such as cylindrical surfaces, conical surfaces, end faces or helical surfaces; This refers to the auxiliary structural features, including the hub, keyway, reference hole, and the left and right helical combination structure of the herringbone gear; The candidate gear selected for testing is the one with the highest matching score that is higher than the configuration category determination threshold.
[0020]
[0021] in: To match the obtained gear configuration category; Candidate gear configuration categories Match score; Represents the first visual acquisition. Individual gear features; Represents the candidate gear configuration categories in the knowledge graph. The corresponding number One attribute; A similarity function representing the relationship between visual features and knowledge attributes; Represents the weight of each visual feature; This indicates the priori gear configuration category provided by production batch, workstation information, or historical records; Represents prior knowledge weights; The method for generating flexible detection tasks is as follows: for the first... The first tooth of the gear Establish detection task nodes in each region:
[0022] in: Indicates the gear tooth number; This indicates the tooth tip, tooth root, left tooth surface, right tooth surface, end face, or chamfered area; This indicates the position of the detection area in the gear coordinate system; Indicates the local surface normal of the detection area; This represents the set of defects that may occur in the area; This represents the set of cameras recommended by the knowledge graph. This represents the set of recommended light sources and lighting methods.
[0023] Furthermore, in step S3, the observation quality function of the robot's candidate observation pose is:
[0024] in: Indicates the pixel resolution of the target area; Indicates whether the target area is within the camera's depth of field; Indicates the visibility of the area to be inspected; This indicates the degree of matching between the camera's optical axis and the surface normal of the target area; Indicates the degree of metallic reflection and overexposure; This indicates the risk of collisions during robot movement; to Indicates the weight of each evaluation item; The robot detection trajectory and trajectory optimization objective function are expressed as follows:
[0025]
[0026] in: Optimize the objective function for robot trajectory detection; For robot trajectory detection; For the first The robot detects the trajectory; This represents the total length of the robot's trajectory; Indicates the risk of trajectory collision; This indicates the cost of switching between the camera and the light source; Indicates the detection time; Indicates the coverage of the detection area; Indicates the overall observation quality along the entire trajectory; to This indicates the weight of each objective item.
[0027] Furthermore, in step S4, the triggering conditions for adaptive switching of camera modes include at least one of the following: image clarity is lower than a preset threshold; pixel resolution of the target area is insufficient; there is local overexposure or reflective saturation on the tooth surface; the tooth root or inner tooth surface area is occluded; the current two-dimensional image cannot distinguish between metal reflection and burr protrusion; the confidence level of defect determination is lower than a preset threshold; there is a conflict between the detection results of different modes. The method for adaptively switching camera modes is as follows: select the camera with the highest applicable score and perform the switch.
[0028]
[0029] in: The initial camera selected; For candidate cameras Applicable score; Indicates camera For suspected defect types The degree of applicability; Indicates camera For the current detection area The expected image quality; Indicates the use of a camera The expected information gain to be obtained later; Representing cameras in a knowledge graph The association weight between the current detection task and the current detection task; This indicates the cost of camera switching and robot movement; to Indicates the weights of each item; The robot's end-effector pose and local detection trajectory were replanned based on the new camera parameters.
[0030] Furthermore, in step S5, the multimodal detection data of the complex configuration gear surface includes: two-dimensional texture images and color images acquired by a large field-of-view camera or a macro camera; surface reflection images at different polarization angles acquired by a polarization camera; and tooth surface height data acquired by a three-dimensional contour camera. The method for defect detection in various areas of the tooth surface is as follows: Register the actual measured three-dimensional tooth surface with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface, and calculate the local height residual.
[0031] in: The local height residual is obtained by registering the actual measured three-dimensional tooth surface with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface; This indicates the actual measured tooth surface height; Indicates the reference height of the theoretical tooth surface, standard tooth surface, or normal tooth surface; when When the value is greater than the first preset residual threshold, it indicates that there is a risk of protrusions, burrs, or foreign objects in a local area; when When the residual value is less than the second preset residual threshold, it indicates that there is a risk of local damage, missing material, dents, or missed processing.
[0032] Furthermore, the criterion for triggering active re-inspection in step S6 is: defining the uncertainty of the suspected defect area:
[0033]
[0034] in: Uncertainty regarding the suspected defect area; Indicates that the candidate region belongs to the first The overall probability of class defects; Indicates the number of candidate defect categories; Indicates the first Various detection modes for defect categories The detection confidence level; Indicates the first The current data quality for each detection modality; Representing detection modalities in knowledge graphs With defect category The adaptation weights between them; This indicates the prior defects obtained based on the gear configuration type, machining process, and tooth surface area. This represents the influence coefficient of the prior defect. When the uncertainty of the suspected defect area When the uncertainty exceeds the preset threshold, an active re-examination is triggered. Based on the knowledge graph, a camera, light source, or observation posture with higher information gain is selected to re-collect data until the uncertainty is lower than the threshold or the maximum number of re-examinations is reached.
[0035] This invention also proposes a robotic flexible inspection system for surface defects of gears with complex configurations, used to implement the robotic flexible inspection method for surface defects of gears with complex configurations as described above, comprising: The gear loading and positioning device is used to transport the gear to be inspected to the inspection station, clamp, position and rotate it, and provide gear rotation angle information; Industrial robots are used to carry inspection devices and move along a planned trajectory, adjusting the position and orientation of the camera relative to the tooth surface to be inspected. An initial recognition camera is used to acquire a global image of the gear under inspection and obtain structural features such as gear configuration type and specification parameters; A multi-camera inspection device, including at least two of a wide field-of-view camera, a macro camera, a polarizing camera, and a 3D contour camera; A camera switching mechanism is used to switch between different cameras according to detection instructions; A programmable light source device for adjusting the illumination direction, brightness, incident angle, and polarization state according to the detection area and defect type; Edge servers are used to deploy a gear intelligent detection knowledge graph, a gear configuration recognition model, a robot flexible detection task planning module, an adaptive trajectory planning module, a camera switching decision module, a multimodal defect detection model, and a detection result fusion module. The quality traceability module is used to save inspection images, 3D contours, defect information, robot poses, and quality judgment results.
[0036] Furthermore, the gear configuration recognition model consists of a lightweight encoder-decoder segmentation network, a contour feature extraction algorithm, a periodic feature detection algorithm, a tooth line direction detection algorithm, a spatial structure feature analysis algorithm, and a knowledge graph similarity matching algorithm. It is used to complete gear contour extraction, tooth count calculation, tooth line direction recognition, tooth distribution form analysis, tooth surface spatial morphology discrimination, and configuration category recognition, size grade judgment, and configuration parameter estimation for spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. The camera switching decision model consists of an imaging quality evaluation algorithm, a target visibility evaluation algorithm, a robot reachability and collision constraint screening algorithm, an expected information gain calculation algorithm, and a next best viewpoint ranking algorithm, which are used to determine the target camera, light source mode, and local re-inspection pose. The multimodal defect detection model consists of a two-dimensional texture feature extraction algorithm, a polarization response analysis algorithm, a three-dimensional contour registration and height residual calculation algorithm, and a cross-modal fusion algorithm, which are used to output defect category, location, size, and quality judgment results. The camera switching mechanism is a multi-camera turret, an automatic end-effector switching device for robots, or a multi-camera integrated detection head. When an automatic end-effector switching device for robots is used, the industrial robot can move to the camera switching position to complete the unloading and loading of the camera, and automatically call the hand-eye calibration parameters of the corresponding camera. The programmable light source device includes at least two of the following: ring light source, bar light source, coaxial light source, oblique light source, and polarized light source. It can automatically adjust the light source parameters based on the correlation between defect type and illumination mode in the knowledge graph.
[0037] The beneficial effects of this invention are as follows: The present invention provides a robotic flexible detection method for surface defects of complex gear configurations. Through the synergistic effect of seven steps, including knowledge graph construction, type recognition, trajectory planning, dynamic switching, multimodal detection, active re-inspection, and knowledge updating, a complete intelligent detection closed loop is formed, achieving the following technical effects.
[0038] (1) Significant improvement in the adaptability and flexibility of gear inspection for complex configurations. By using a gear intelligent inspection knowledge graph to structure knowledge such as gear configuration categories, inspection areas, recommended cameras, and robot postures, the system can automatically generate suitable inspection strategies for different configuration objects such as spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. After initial visual recognition of the gear configuration category, the system adaptively plans the inspection trajectory and camera configuration according to the constraints of the knowledge graph, realizing a leap from "relying on manual changes" to "autonomous adaptation during changes," greatly shortening the debugging time during product switching and improving the flexibility of the production line.
[0039] (2) Effective enhancement of defect recognition accuracy. This invention integrates multimodal information such as two-dimensional texture, color image, polarization response, and three-dimensional contour to jointly identify defects, making full use of the differences in sensitivity of different modalities to different defect types, such as scratches depending on texture, black skin depending on color and polarization, and burrs depending on three-dimensional shape. The multimodal complementary mechanism effectively suppresses false detection and false negative detection of single visual modality under the interference of metal reflection, tooth surface shadow and texture, and significantly improves the defect recognition accuracy in complex industrial environments.
[0040] (3) Optimization of detection efficiency and resource utilization. Unlike schemes that collect all modal data in a fixed order, this invention uses online image quality evaluation and defect confidence determination to trigger camera switching and local trajectory replanning only when the current modality is insufficient to support accurate judgment. This "on-demand" active sensing strategy avoids unnecessary multimodal data acquisition and redundant calculations, optimizes the detection cycle while ensuring detection accuracy, and achieves a balance between accuracy and efficiency.
[0041] (4) The system’s ability to continuously evolve. After the detection is completed, the confirmed defect results and their associated information are written back to the knowledge graph to update the association weights between entities and the prior probability of defects. As the detection data continues to accumulate, the knowledge graph continuously optimizes the decision basis for strategy generation and camera selection, enabling the system to have the ability to learn and evolve continuously. The detection strategy becomes more and more perfect with the accumulation of experience. Attached Figure Description
[0042] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the following figures are provided for illustration: Figure 1 This is a flowchart of the robot-based flexible detection method for surface defects of complex gear configurations according to the present invention. Figure 2 A schematic diagram of the knowledge graph structure for intelligent detection of complex gear configurations; Figure 3 A schematic diagram of a robotic flexible inspection system for surface defects in complex gear configurations; Figure 4 A schematic diagram illustrating the principle of robot flexible detection trajectory planning and adaptive camera switching; Figure 5 This is a schematic diagram illustrating the principle of multimodal gear surface defect detection and fusion judgment. Detailed Implementation
[0043] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0044] This invention aims to propose a robotic flexible inspection method and system for surface defects in complex gear configurations. By establishing a knowledge graph for intelligent gear inspection, it organizes the relationships between gear configuration categories, processing steps, tooth surface areas, defect features, camera performance, lighting methods, robot posture, and quality standards. It uses initial visual images to identify the type, specifications, and structural features of the gear to be inspected. Based on the identification results, it generates a robot inspection trajectory, camera configuration, and lighting strategy adapted to the gear structure. During the inspection process, based on tooth surface visibility, image quality, and defect uncertainty, it adaptively adjusts the robot's observation posture, scanning path, and inspection camera. It integrates multimodal information such as 2D texture, color reflection, polarization response, and 3D morphology to complete the detection, location, re-inspection, and quality judgment of defects such as black spots, scratches, dents, missing material, burrs, knife marks, rust spots, color differences, and missed machining. This addresses the problems of traditional gear inspection, such as reliance on manual changes for gear replacement, fixed robot trajectories, limited camera configurations, numerous blind spots, and insufficient reliability in detecting complex defects.
[0045] This embodiment takes the surface defect detection scenario of spiral bevel gears and herringbone gears in a gear production line as an example to illustrate the specific implementation process of the method and system in detail. Those skilled in the art should understand that this embodiment is only an illustrative example and does not constitute a limitation on the scope of protection of the present invention.
[0046] like Figure 1 As shown, the flexible robot inspection system for gear surface defects used in this embodiment includes a gear loading and positioning device, an industrial robot, an initial recognition camera, a multi-camera inspection device, a camera switching mechanism, an edge server, a programmable light source device, and a quality traceability module.
[0047] The gear loading and positioning device is used to transport the gear to be inspected to the inspection station, clamp, position, and rotate it, and provide gear rotation angle information. Specifically, the gear loading and positioning device includes a conveying mechanism, a clamping mechanism, and a rotary table, which are used to transport the gear to be inspected to the inspection position and drive the gear to rotate at a specified angle.
[0048] Industrial robots are used to carry inspection devices along a planned trajectory, adjusting the position and orientation of the camera relative to the gear surface to be inspected, and completing the scanning, imaging, and partial re-inspection of different gear surfaces. Specifically, the end effector of the industrial robot is equipped with a multi-camera inspection device and an automatic camera switching interface, which drives the camera to move around the gear.
[0049] The initial recognition camera is used to acquire a global image of the gear to be inspected and obtain its structural features. Specifically, the initial recognition camera is positioned above the inspection station or at the end effector of the robot to acquire a global image and initial structural information of the gear to be inspected.
[0050] A multi-camera inspection device, including at least two of a wide field-of-view camera, a macro camera, a polarization camera, and a three-dimensional profile camera, is used to acquire gear surface information of different modes of the gear surface.
[0051] The camera switching mechanism is used to switch between different cameras according to detection instructions. Specifically, the camera switching mechanism is a multi-camera turret, a robot end effector automatic switching device, or a multi-camera integrated detection head. When a robot end effector automatic switching device is used, the industrial robot can move to the camera switching position to complete the unloading and loading of the camera, and automatically call the hand-eye calibration parameters of the corresponding camera.
[0052] The programmable light source device is used to adjust the illumination direction, brightness, incident angle, and polarization state according to the detection area and defect type. Specifically, the programmable light source device includes at least two of the following: ring light source, bar light source, coaxial light source, oblique light source, and polarized light source. It can automatically adjust the light source parameters based on the correlation between defect type and illumination mode in the knowledge graph. Specifically, it can adjust the illumination direction, brightness, incident angle, and polarization state according to the detection area, tooth surface direction, and defect type.
[0053] The edge server is used to deploy a knowledge graph for intelligent gear detection, a gear configuration recognition model, a robot flexible detection task planning module, an adaptive trajectory planning module, a camera switching decision module, a multimodal defect detection model, and a detection result fusion module.
[0054] The quality traceability module is used to save inspection images, 3D contours, defect categories, defect sizes, tooth positions, robot poses, camera parameters, production batches, and quality judgment results.
[0055] In this embodiment, the technical composition of each core model is clearly defined as follows.
[0056] The gear configuration recognition model consists of a lightweight encoder-decoder segmentation network, a contour feature extraction algorithm, a periodic feature detection algorithm, a tooth line direction detection algorithm, a spatial structure feature analysis algorithm, and a knowledge graph similarity matching algorithm. It is used to complete gear contour extraction, tooth count calculation, tooth distribution pattern recognition, tooth line direction extraction, tooth surface spatial morphology analysis, and configuration parameter estimation. Based on the above features, it identifies the categories of gears with different complex configurations. In this embodiment, the focus is on identifying the conical tooth distribution and spatially curved tooth line features of spiral bevel gears, as well as the symmetrical distribution of left and right helical tooth lines in herringbone gears.
[0057] The camera switching decision model consists of an imaging quality evaluation algorithm, a multi-category information entropy calculation algorithm, a target visibility evaluation algorithm, a robot reachability and collision constraint screening algorithm, an expected information gain calculation algorithm, and a next best viewpoint ranking algorithm. It is used to determine the target camera, light source mode, and robot local re-inspection pose.
[0058] The multimodal defect detection model consists of a two-dimensional texture feature extraction algorithm, a color and multi-directional illumination analysis algorithm, a polarization response analysis algorithm, a three-dimensional contour registration and height residual calculation algorithm, and a cross-modal Transformer fusion algorithm. It outputs defect category, defect location, defect size, detection confidence level, and quality assessment results. Gear configuration recognition results are used to generate flexible detection tasks and initial detection parameters.
[0059] The camera switching decision model adjusts the camera, light source, and robot observation pose based on real-time imaging status. The multimodal defect detection model fuses detection evidence from different modalities and feeds back uncertain areas to the camera switching decision model for re-inspection, thus forming a closed loop between detection decision and execution.
[0060] Specifically, such as Figure 2 As shown in the figure, the robot-based flexible detection method for surface defects of complex gear configurations in this embodiment includes the following steps.
[0061] S1: Construct a knowledge graph for intelligent gear inspection. The knowledge graph includes entities, attributes, and their relationships among gear configuration categories, configuration features, specifications, machining processes, tooth surface areas, defect types, inspection modes, cameras, light sources, and robot observation postures, such as... Figure 3 As shown.
[0062] This step aims to transform expert experience, process manuals, quality specifications, equipment parameters, and historical inspection data into structured knowledge that can be used by the robotic inspection system, providing a basis for gear configuration recognition, inspection task generation, robot trajectory planning, camera switching, and defect judgment.
[0063] (1) Knowledge collection and structured expression of gear inspection.
[0064] First, we collected gear design data, gear machining process manuals, quality inspection specifications, defect judgment standards, camera equipment manuals, robot motion parameters, historical inspection data, and expert experience. Gear design data includes CAD models of the gears, dimensional tolerance zones, tooth profile modification parameters, and material heat treatment specifications. The machining process manual covers the process parameters and common quality problems for each step of turning, hobbing, shaping, shaving, and grinding. The quality inspection specifications include definitions, judgment standards, and acceptable limits for various defects. The defect judgment standards clearly define the characteristic descriptions and grading methods for different defect types.
[0065] Then, the collected information is categorized into entities, attributes, and relationships. Entities include at least gear configuration type, gear specifications, machining processes, tooth surface areas, defect types, defect characteristics, detection modes, camera, light source, robot observation posture, scanning trajectory, and quality grade. Gear configuration types include spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. Gear configuration characteristics include tooth distribution, tooth line direction, tooth surface spatial morphology, helix direction, helix angle, local curvature, and tooth assembly structure. Gear size grades are characterized as gear specification attributes, including micro, medium, and large. Gear specifications include outer diameter, inner diameter, module, number of teeth, tooth width, pressure angle, helix angle, addendum circle diameter, dedendum circle diameter, and accuracy grade. Tooth surface areas include tooth tip, tooth root, left tooth surface, right tooth surface, end face, chamfer, tooth groove, and other configuration-specific inspection areas. Defect types include black skin, scratches, dents, missing material, burrs, knife marks, rust spots, color differences, unfinished parts, steps, and visible surface cracks. Inspection modalities include large field-of-view 2D imaging, macro texture imaging, color imaging, polarization imaging, multi-directional lighting imaging, line laser profilometry, and structured light 3D measurement.
[0066] (2) Establishment of knowledge association relationships.
[0067] Establish the relationships between gear configuration type and tooth surface area, gear specifications and inspection accuracy, machining process and potential defects, defect type and defect characteristics, defect type and applicable inspection mode, inspection area and recommended observation posture, as well as the relationship between camera and working distance, field of view, spatial resolution and inspection accuracy.
[0068] For example, for spiral bevel gears, the knowledge graph records "spiral bevel gear - scanning trajectory basis - spatial tooth line direction" and "spiral bevel gear - observation posture basis - local tooth surface normal"; for herringbone gears, it records "herringbone gear - detection area division - left-hand and right-hand tooth parts" and "herringbone gear - scanning direction basis - left and right tooth line directions"; for face gears, it records "face gear - main detection area - end face tooth area"; for worm gears, it records "worm gear - scanning trajectory basis - spiral tooth surface direction"; for burrs, it records "burrs - priority detection mode - three-dimensional contour"; for black skin, it records "black skin - priority detection mode - color imaging and polarization imaging"; for tooth surface scratches, it records "scratches - recommended lighting mode - single-sided oblique lighting". This knowledge is stored in the knowledge graph in the form of triplets.
[0069] (3) Construction of robot flexible detection rules.
[0070] Based on expert experience, equipment parameters, and quality standards, flexible robot inspection rules are established. When the object to be inspected is a spur gear, a tooth-by-tooth or zone-by-zone inspection trajectory is generated according to the gear axis and tooth periodic direction. When the object to be inspected is a helical gear or spiral gear, the robot scanning direction is adjusted according to the helix angle, helix direction, and local tooth line direction to extend the inspection trajectory along the tooth line direction. When the object to be inspected is a bevel gear, the robot end-effector posture is continuously adjusted according to the cone surface position and local tooth surface normal, with continuous scanning trajectories further generated based on the spatially curved tooth line for spiral bevel gears. When the object to be inspected is a face gear, the robot observation position and camera optical axis direction are adjusted according to the radial position of the end face teeth. When the object to be inspected is a herringbone gear, the left and right helical teeth are divided into different inspection areas, and robot scanning trajectories are generated according to the opposite tooth line directions on both sides. When the object to be inspected is a worm gear, the robot observation posture and scanning trajectory are generated according to the helical tooth surface direction, local curvature, and visible space. When a bright spot appears at the tooth tip edge in the 2D image and it is impossible to determine whether a protrusion exists, the 3D contour camera is switched. When there are large dark areas on the tooth surface that are affected by reflections or shadows, switch to a polarization camera and change the polarization angle and the direction of illumination.
[0071] (4) Construction of knowledge graph for intelligent gear detection.
[0072] To address the issue of relying on manual selection for inspection procedures when complex configurations and multi-specification gears enter the inspection station, an initial recognition camera is used to acquire a global image of the gear to be inspected, and features such as overall contour, tooth distribution position, number of teeth, tooth line direction, helix direction, size ratio, tooth surface spatial morphology, left and right helix combination relationship, hub structure, and reference features are extracted.
[0073] The extracted visual features are matched with gear configuration categories and specification attributes in the knowledge graph to obtain configuration features such as tooth distribution, tooth line direction, tooth surface spatial morphology, helical direction, and tooth assembly structure, thereby obtaining the configuration category and configuration parameters of the gear to be inspected. Based on the recognition results, the corresponding inspection area, defect priors, recommended camera, recommended light source, recommended robot observation direction, and quality judgment parameters are obtained from the knowledge graph, and a gear configuration recognition model is established.
[0074] In this embodiment, the knowledge graph for intelligent gear detection is represented as follows:
[0075] in: This represents a knowledge graph for intelligent gear detection. It represents the set of entity nodes in the knowledge graph, including gear configuration type, gear specifications, machining process, tooth surface area, defect type, detection mode, camera, light source, robot observation posture, scanning trajectory and quality standard; It represents a set of relationships in a knowledge graph, including relationships such as belonging, containing, possibly generated, suitable for detection, recommended for use, corresponding pose, corresponding trajectory, requiring re-examination, and meeting criteria; It represents the set of entity attributes and relation attributes, including gear size parameters, camera working distance, field of view, defect features, detection threshold, and relation weight.
[0076] Collect gear design data, machining processes, quality specifications, and historical testing data; extract entities, attributes, and relationships to form a gear testing knowledge triplet, represented as follows:
[0077] in: Indicates the head entity; Indicates the tail entity; This indicates the relationship between the head entity and the tail entity.
[0078] The entities mentioned include at least: gear configuration type, tooth surface area, defect type, detection mode, camera, light source, and robot observation posture; the relationships include at least: belonging to, including, possibly occurring, suitable for detection, recommended for use, corresponding posture, and requiring re-inspection. For example: (spiral bevel gear, corresponding to scanning direction, spatial tooth line direction), (spiral bevel gear, corresponding to observation posture, local tooth surface normal), (herringbone gear, including, left-hand tooth portion), (herringbone gear, including, right-hand tooth portion), (herringbone gear, corresponding to scanning direction, left and right tooth line directions), (black skin, suitable for detection, polarization imaging), (scratches, suitable for detection, macro texture imaging), (burrs, suitable for detection, three-dimensional contour). Specifically, the gear configuration categories include at least spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears; the gear configuration characteristics include at least one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure characteristics; the gear configuration category is determined based on one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure characteristics.
[0079] (5) Knowledge graph update.
[0080] Confirmed defect results, corresponding processing steps, camera used, lighting method, robot observation posture, and re-inspection results are written into the knowledge graph. As inspection data increases, the association weights between gear configuration type, processing step, tooth surface area, and defect type are updated, enabling the knowledge graph to continuously improve inspection task generation and camera selection strategies based on historical inspection results. For example, when multiple gears processed by a certain gear grinding machine show scratches distributed along a specific direction, the association weight between the grinding step, the corresponding tooth surface area, and the scratch defect is increased, and the inspection priority of that area is increased in subsequent inspections.
[0081] In this embodiment, the entity is updated based on the correlation strength between gear configuration type, processing procedure, inspection area, and defect type according to historical inspection data. With entity Relationship weights between the two:
[0082] in: Indicates the updated entity With entity Relationship weights between them; For the entity before the update With entity Relationship weights between them; Representing entities In entity The number of times it appears in the corresponding detection record; Representing entities The total number of corresponding detection records; This represents the knowledge update coefficient.
[0083] When the same type of defect occurs consecutively in a certain processing step, the relationship weight between the processing step and the defect type is increased, and the priority of the corresponding area and detection mode in subsequent detection tasks is increased.
[0084] S2: Generation of requirements for complex gear identification and detection based on initial vision and knowledge graph. Initial visual images of the gear to be inspected are acquired, gear structural features are extracted, and the extracted visual features are matched with the knowledge graph to identify the configuration type and specifications of the gear. Flexible detection tasks are then generated based on the detection area, observation method, and detection accuracy requirements corresponding to different gear configurations.
[0085] This step matches the gear structure features extracted from the initial vision with the gear configuration categories and specification attributes in the knowledge graph to determine the gear configuration category to be inspected and generate the corresponding flexible inspection task.
[0086] (1) Global image acquisition of gears.
[0087] After the gear loading and positioning device transports the gear to be inspected to the inspection station, the initial recognition camera captures front and side images of the gear. For gears with complex structures or partially obscured areas, an industrial robot drives the initial recognition camera to take supplementary images from different directions. The acquired images undergo background separation, contour extraction, and geometric feature calculation to obtain gear structural features such as overall dimensions, number of teeth, tooth width ratio, tooth distribution pattern, tooth line direction, helical direction, tooth surface spatial morphology, left-right helical combination relationship, hub shape, and reference position. For example, when the object to be inspected is a spiral bevel gear, the distribution area of the bevel teeth, the tooth line curvature direction, and the helical direction are extracted from images viewed from different directions; when the object to be inspected is a herringbone gear, the features of the two sets of helical teeth with opposite directions and their central intersection area are extracted, thus forming visual features for configuration recognition.
[0088] In this embodiment, a gear feature vector is constructed based on the gear structure features obtained from the initial vision, and is represented as follows:
[0089] in: Indicates the overall dimensional characteristics of the gear; Indicates the inner diameter of the gear or the dimensional characteristics of the shaft; Indicates the number of teeth; Indicates tooth width characteristics; Indicates the characteristics of tooth line inclination or helix angle and helix direction; It represents the tooth distribution pattern and the spatial structure characteristics of the tooth surface, and is used to characterize the structural differences in the surfaces of different tooth carriers, such as cylindrical surfaces, conical surfaces, end faces, or helical surfaces. It represents the auxiliary structural features including the hub, keyway, reference hole, and the left and right helical combination structure of the herringbone gear.
[0090] (2) Generation of candidate gear configuration categories.
[0091] The extracted visual features are compared with the attributes of different gear configuration categories in the knowledge graph to generate a set of candidate gear configuration categories. When the teeth are distributed on a cylindrical surface and the tooth line direction is basically parallel to the gear axis, it is considered a candidate for a spur cylindrical gear; when the teeth are distributed on a cylindrical surface and the tooth line has a stable tilt angle relative to the gear axis, it is considered a candidate for a helical cylindrical gear; when the teeth are distributed on a conical surface, it is considered a candidate for a bevel gear, and when obvious spatial curvature tooth lines are detected, it is further considered a candidate for a spiral bevel gear; when the teeth are mainly distributed in the end face area, it is considered a candidate for a face gear; when two sets of helical tooth structures with opposite directions and symmetrical distribution are detected, it is considered a candidate for a herringbone gear; when the teeth are distributed along an obvious continuous helical direction, it is considered a candidate for a spiral gear; when the helical tooth surface of a worm or its corresponding worm wheel structure features are detected, it is considered a candidate for a worm and worm wheel.
[0092] (3) Matching and confirmation of gear configuration type.
[0093] Based on the matching results of visual features and knowledge graph attributes, a matching score is calculated for each candidate gear configuration category. If the highest matching score exceeds a preset threshold, the gear configuration category is determined. If multiple candidate type scores are close, key features that can distinguish candidate types are queried from the knowledge graph, and the industrial robot is controlled to adjust the shooting direction of the initial recognition camera to obtain supplementary images. When the frontal image cannot determine whether the gear is a spur gear or a small helix angle helical gear, the industrial robot adjusts the camera to a side viewing position, acquires images of the tooth line direction, and confirms the gear configuration category based on the degree of tooth line inclination. When the visual recognition result can correspond to the production batch number, workpiece QR code, or product information in the manufacturing execution system, the production information is used as an auxiliary prior to improve the reliability of identifying the gear configuration category.
[0094] Candidate gear configuration categories The matching score is expressed as:
[0095] in: Represents the first visual acquisition. Individual gear features; Represents the candidate gear configuration categories in the knowledge graph. The corresponding number One attribute; A similarity function representing the relationship between visual features and knowledge attributes; Represents the weight of each visual feature; This indicates the priori gear configuration category provided by production batch, workstation information, or historical records; This represents the prior knowledge weight.
[0096] The candidate gear with the highest matching score that is above the configuration category determination threshold is selected as the recognition result:
[0097] in: To match the obtained gear configuration category; Candidate gear configuration categories The matching score. When the difference between the highest and second-highest scores is less than a preset threshold, the system generates a supplementary shooting task based on the attribute differences between the candidate gear configuration categories.
[0098] (4) Establish the gear coordinate system and gear number.
[0099] After confirming the gear configuration type, establish a gear workpiece coordinate system based on the gear center, reference hole, keyway, or other positioning features. Using the direction corresponding to the reference hole or keyway as the zero tooth direction, number all teeth according to the gear rotation direction, dividing each tooth into inspection sub-regions such as tooth tip, tooth root, left tooth surface, right tooth surface, end face, and chamfer. Each inspection sub-region is associated with at least the tooth number, spatial position, local surface normal, curvature, observable direction, potential defect type, and recommended inspection mode.
[0100] (5) Generating flexible detection tasks.
[0101] The edge server reads corresponding potential defects, recommended cameras, recommended light sources, observation postures, and quality standards from the knowledge graph based on gear configuration type, specifications, and tooth surface areas, generating a list of inspection tasks. For the spiral bevel gear in this embodiment, the system divides the area to be inspected into multiple continuous inspection sub-regions based on the distribution of the bevel teeth, the direction of the spatial tooth lines, and the local tooth surface normal, generating inspection tasks that scan along the direction of the spatial tooth lines and adjust the robot posture according to the local tooth surface normal. For the herringbone gear, the system establishes inspection tasks for the left-hand tooth section, the right-hand tooth section, and the central intersection area, generates corresponding scanning paths based on the opposite tooth line directions on both sides, and sets key inspection or local re-inspection tasks for the central intersection area.
[0102] Specifically, regarding the first The first tooth of the gear Establish detection task nodes in each region:
[0103] in: Indicates the gear tooth number; This indicates the tooth tip, tooth root, left tooth surface, right tooth surface, end face, or chamfered area; This indicates the position of the detection area in the gear coordinate system; Indicates the local surface normal of the detection area; This represents the set of defects that may occur in the area; This represents the set of cameras recommended by the knowledge graph. This represents the set of recommended light sources and lighting methods.
[0104] All detection task nodes together constitute the current gear's flexible detection task set, as shown in Table 1, which is a schematic table of flexible detection task generation content.
[0105] Table 1. Schematic diagram of content generated by flexible detection task
[0106] S3: Knowledge-driven flexible robot trajectory planning and camera switching. Based on the gear configuration type, configuration features, specification parameters, the area of the tooth surface to be inspected, and the relationships in the knowledge graph, candidate robot observation postures are generated. After screening by kinematic constraints and imaging quality constraints, the robot detection trajectory is planned, and the initial camera and light source configuration is selected according to the detection task, such as... Figure 4 As shown.
[0107] This step generates the robot inspection trajectory based on the gear configuration type, the area to be inspected, robot motion constraints, and camera performance, and selects the initial camera and light source configuration according to the inspection task.
[0108] (1) Generation of candidate observation poses for robots.
[0109] Based on the gear coordinate system, the location of the area to be inspected, and the local tooth surface normal, candidate robot observation postures are generated around each inspection area. Each candidate observation posture includes the robot end-effector position, robot end-effector posture, camera optical axis direction, working distance between the camera and the tooth surface, light source incident direction, and corresponding inspection area. For the tooth tip and end face, candidate postures are preferentially generated along the surface normal direction. For the tooth root region, candidate postures are generated within the visible space between adjacent teeth, and the minimum safe distance between the camera and light source and adjacent tooth surfaces is limited. For spiral bevel gears, candidate postures are generated based on the cone surface position, spatial tooth line direction, and local tooth surface normal, and the camera optical axis direction is continuously adjusted as the inspection position changes along the tooth line direction. For herringbone gears, candidate postures are generated for the left-hand and right-hand helical teeth according to the corresponding tooth line directions, and candidate postures with different observation directions are added in the central intersection area to reduce the impact of adjacent tooth surface occlusion on inspection.
[0110] (2) Screening of candidate observation postures.
[0111] The system performs robot reachability assessment, joint constraint assessment, self-collision assessment, robot-gear collision assessment, robot-gripper collision assessment, target area occlusion assessment, camera working distance assessment, and depth of field assessment on candidate poses. Candidate poses that are inaccessible to the robot, pose a collision risk, have an occluded target area, have an unsuitable working distance, or have a target area exceeding the depth of field or insufficient imaging resolution are eliminated, resulting in a set of usable detectable poses. When a tooth root region is occluded by an adjacent tooth from the current direction, the system regenerates candidate poses within the observation angle range recommended by the knowledge graph and selects the observation direction with lower occlusion through visibility calculation.
[0112] In this embodiment, the observation quality function for the robot's candidate observation pose is:
[0113] in: Indicates the pixel resolution of the target area; Indicates whether the target area is within the camera's depth of field; Indicates the visibility of the area to be inspected; This indicates the degree of matching between the camera's optical axis and the surface normal of the target area; Indicates the degree of metallic reflection and overexposure; This indicates the risk of collisions during robot movement; to This indicates the weight of each evaluation item.
[0114] Candidate poses that meet the observation quality threshold and are feasible under robot motion constraints are selected as available detection poses.
[0115] (3) Robot detection trajectory generation.
[0116] The selected detection poses are combined according to the gear region sequence, robot movement distance, camera switching times, and detection cycle to generate a robot detection trajectory. For the spiral bevel gear in this embodiment, the industrial robot divides the tooth surface to be inspected into continuous detection areas according to the gear circumference and spatial tooth line distribution, and performs scanning along the spiral tooth line direction. During the scanning process, the robot end-effector posture is continuously adjusted according to the cone position and local tooth surface normal to keep the angle between the camera optical axis and the local tooth surface normal within the allowable range, while maintaining the camera working distance to meet the depth of field requirements; after completing the detection of the current gear tooth, the rotary table rotates the next gear tooth into the detection area according to the preset rotation angle. For herringbone gears, two sets of detection pose sequences are first established according to the left-hand and right-hand tooth sections, and the industrial robot performs scanning along the corresponding tooth line directions on both sides respectively; for the middle area where the left and right tooth lines intersect, the system generates a local supplementary detection trajectory based on visibility and defect risk, and adjusts the camera observation direction to reduce tooth surface occlusion and strong reflection. When a suspected defect area is found during the rough inspection, a local re-inspection trajectory is generated only for the corresponding tooth number and tooth surface area.
[0117] In this embodiment, the robot detection trajectory and trajectory optimization objective function are expressed as follows:
[0118] in: For robot trajectory detection; For the first A robot detection trajectory.
[0119] The objective function for trajectory optimization is:
[0120] in: Optimize the objective function for robot trajectory detection; This represents the total length of the robot's trajectory; Indicates the risk of trajectory collision; This indicates the cost of switching between the camera and the light source; Indicates the detection time; Indicates the coverage of the detection area; Indicates the overall observation quality along the entire trajectory; to This indicates the weight of each objective item.
[0121] Under the conditions that all key detection areas are covered, the camera working distance meets the requirements, the robot does not collide, and the image resolution meets the requirements, the detection trajectory with the minimum objective function value is selected.
[0122] (4) Initial camera and light source selection.
[0123] Based on the relationship between gear configuration type, inspection area, defect priors, and inspection accuracy in the knowledge graph, initial cameras and light sources are selected for each inspection task. For spiral bevel gears, the initial inspection camera is selected between a large field-of-view camera and a macro camera based on the cone surface curvature, tooth line direction, and current inspection area size. An oblique light source or multi-directional illumination is configured according to the local tooth surface normal. For herringbone gears, the camera working distance and illumination direction are determined based on the visible range of the left and right helical teeth and the central intersection area. When there is occlusion or reflection in the central intersection area, the robot's observation posture is adjusted first, and multi-directional illumination is used. Color cameras and adjustable polarized light sources are prioritized for high-risk areas of black skin, rust spots, and color difference. Macro cameras and single-sided oblique light sources are prioritized for high-risk areas of tooth surface scratches and knife marks. A three-dimensional contour re-inspection scheme is reserved for high-risk areas of tooth tip, tooth root, and chamfer burrs.
[0124] (5) Online evaluation of imaging quality.
[0125] During the robot's execution of the inspection trajectory, the edge server evaluates the current image's sharpness, brightness, contrast, target area pixel resolution, reflectivity saturation ratio, occlusion level, tooth surface integrity visibility rate, and defect identification confidence level in real time. When image sharpness is insufficient, the camera's working distance, focal length, or robot posture is adjusted. When local reflectivity is saturated, exposure is reduced, the light source direction is changed, or a polarizing camera is switched. When the target area pixel resolution is insufficient, a macro camera is switched and the working distance is shortened. When the tooth root area is occluded, the robot's observation posture or gear rotation is prioritized; if adjusting the posture still cannot meet the inspection requirements, a camera with a smaller size or a more suitable field of view is switched. When the two-dimensional image cannot determine whether a local area is convex or concave, a three-dimensional contour camera is switched.
[0126] S4: Adaptive camera switching and local re-inspection trajectory replanning. During the execution of the inspection task, the imaging quality and defect judgment confidence are evaluated in real time. When it is determined that the current camera cannot meet the inspection requirements or there is uncertainty in the inspection, the camera mode is adaptively switched and the local re-inspection trajectory is replanned.
[0127] During the detection task, this step dynamically adjusts the camera mode and replans the local detection trajectory based on the current imaging problem, suspected defect type, and knowledge graph recommendation relationship.
[0128] (1) Adaptive camera switching trigger conditions.
[0129] The triggering conditions for adaptive switching of camera modes include at least one of the following: image clarity is lower than a preset threshold; insufficient pixel resolution in the target area; local overexposure or reflective saturation on the tooth surface; occlusion of the tooth root or inner tooth surface area; inability of the current two-dimensional image to distinguish between metal reflection and burr protrusion; defect judgment confidence is lower than a preset threshold; conflicting detection results of different modes.
[0130] (2) Adaptive camera switching decision.
[0131] Based on the current detection area, imaging problems, suspected defect types, and knowledge graph recommendations, the applicability of each candidate camera is calculated, and the camera that can improve the confidence of defect judgment and has a lower switching cost is selected. When a large field-of-view camera detects a thin, elongated linear anomaly on a tooth surface, but due to insufficient spatial resolution, it cannot distinguish between normal grinding texture and scratches, the edge server queries the knowledge graph to obtain the relationship chain of "tooth surface linear anomaly - suspected scratch or knife mark - recommended macro camera - recommended single-sided oblique lighting," and controls the industrial robot to switch to the macro camera and change the lighting direction. When an irregular bright spot is found on the tooth tip edge in a 2D image, but it cannot be determined whether it is a metallic highlight or a burr, the system switches to a 3D contour camera to measure local height changes. When a large dark area appears on the tooth surface, and it is impossible to distinguish between black skin, rust spots, or shadows, the system switches to a polarization camera and changes the polarization direction and lighting angle to analyze the reflection changes of the area under different polarization states.
[0132] In this embodiment, the candidate camera The applicable score is expressed as:
[0133] in: For candidate cameras Applicable score; Indicates camera For suspected defect types The degree of applicability; Indicates camera For the current detection area The expected image quality; Indicates the use of a camera The expected information gain to be obtained later; Representing cameras in a knowledge graph The association weight between the current detection task and the current detection task; This indicates the cost of camera switching and robot movement; to This indicates the weight of each item.
[0134] Select the candidate camera with the highest applicable score.
[0135] in: The initial camera selected.
[0136] When the current camera's imaging quality is lower than a preset threshold, or the current defect confidence level is lower than a judgment threshold, camera switching and local trajectory replanning are performed.
[0137] (3) Local re-inspection trajectory replanning.
[0138] After camera switching is completed, the robot's end-effector pose is recalculated based on the new camera's working distance, field of view, installation offset, and detection direction, generating a local re-inspection trajectory for the suspected area. If the camera is replaced via an automatic end-effector switching device, the industrial robot first moves to the camera replacement position, unloads the original camera and loads the target camera, then calls the hand-eye calibration parameters corresponding to the target camera and moves to the suspected area for re-inspection. If multiple cameras are integrated into the same end-effector detection head, the edge server directly activates the target camera and compensates for the robot's end-effector pose based on the installation positions of different cameras.
[0139] S5: Gear surface defect detection based on multimodal perception. Collect multimodal detection data of the gear surface according to the planned trajectory, including at least two of the following: two-dimensional images, polarization images, and three-dimensional contour data, and perform defect detection on each region of the tooth surface.
[0140] This step involves collecting multimodal detection data of the gear surface according to the planned trajectory, and performing defect detection on areas such as the tooth tip, tooth root, left and right tooth surfaces, end face, and chamfer.
[0141] (1) Multimodal detection data acquisition.
[0142] The industrial robot acquires 2D texture images, color images, polarized images, multi-directional lighting images, and 3D contour data based on the robot trajectory generated in step S3 and the camera switching scheme determined in step S4. During data acquisition, the robot end-effector pose, gear rotation angle, camera number, lens magnification, exposure parameters, light source status, and acquisition time are recorded simultaneously, and different modal data are mapped to a unified gear coordinate system.
[0143] (2) The tooth surface area is divided and the tooth number corresponds.
[0144] The gear region in the acquired image is segmented, and each tooth is identified based on the gear periodic topology. The detection data is then mapped to specific tooth number, tooth tip, tooth root, left tooth surface, right tooth surface, end face, and chamfer. A spatial correspondence is established between the 2D image, polarization image, and 3D contour data based on the robot pose and gear rotation angle, ensuring that different modal data describe the same actual tooth surface region.
[0145] (3) Two-dimensional texture and color defect detection.
[0146] Two-dimensional images are used to extract features such as color, grayscale, texture direction, edge shape, area, length, width, aspect ratio, and grayscale gradient of candidate defect regions. For black spots, rust spots, and color differences, the focus is on analyzing regional color differences, grayscale stability, boundary shape, and reflection consistency. For scratches and tool marks, the focus is on analyzing elongated edges, texture direction, continuity, and the angle between the scratches and the normal machining texture. For dents and missing material, the focus is on analyzing whether there are local missing parts, abrupt changes, and discontinuities at the tooth tip, tooth surface, and chamfer boundaries. For missed machining, the focus is on comparing the differences between the target area and the standard tooth surface texture, contour, and color.
[0147] (4) Polarization and multi-directional illumination detection.
[0148] For suspected areas affected by metallic reflection, images were acquired under different polarization angles and illumination directions, and the response of the suspected areas to changes in polarization angle and illumination direction was analyzed. When dark areas significantly shift, shrink, or disappear with the illumination direction, the probability of them being black spots, rust spots, or color difference defects is reduced. When dark areas maintain a stable shape under different illumination directions and polarization angles, the probability of them being black spots, rust spots, or surface contamination defects is increased. When bright spots significantly change with the illumination direction, the probability of them being identified as metallic highlights is increased. When the position of a bright spot remains unchanged and it has a stable boundary under multiple viewing directions, it is considered a candidate area for burrs or local morphological anomalies.
[0149] (5) Three-dimensional contour defect detection.
[0150] Height data of candidate regions is acquired using a 3D contour camera. The actual measured tooth surface is then registered with the contours of the theoretical tooth surface model, a qualified sample model, or adjacent normal tooth surfaces. The actual measured 3D tooth surface is then registered with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface, and the local height residual is calculated.
[0151] in: The local height residual is obtained by registering the actual measured three-dimensional tooth surface with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface; This indicates the actual measured tooth surface height; This indicates the reference height for the theoretical tooth surface, standard tooth surface, or normal tooth surface. When When the residual value is greater than the first preset residual threshold, it indicates the presence of local bumps, burrs, or foreign objects; when When the residual value is less than the second preset residual threshold, it indicates that there is a risk of local damage, missing material, dents, or missed processing.
[0152] The maximum height, maximum depth, projected area, defect volume, boundary change rate, and surface normal change of the candidate region are calculated and compared with the quality standards in the knowledge graph.
[0153] S6: Multimodal Detection Result Fusion and Active Re-inspection. The detection results from different modalities are fused to output defect category, location, size, and quality assessment results. When the fusion confidence level is lower than a preset threshold or when there is a conflict between modal results, an active re-inspection is triggered.
[0154] This step fuses multimodal detection results based on data quality, defect sensitivity, and knowledge graph priors from different detection modalities, and triggers proactive re-inspection when confidence is insufficient or results conflict. Figure 5 As shown.
[0155] (1) Fusion of multimodal detection results.
[0156] Based on the data quality, defect sensitivity, and prior knowledge graph of different detection modalities, the results of 2D texture detection, color detection, polarization detection, multi-directional lighting, and 3D contour detection are fused. For scratches and knife marks, macro texture images and multi-directional lighting results are mainly used. For black spots, rust spots, and color differences, color images and polarization images are mainly used. For burrs, 2D edge information and 3D positive height residuals are mainly used. For chips and missing material, tooth surface boundary missing information and 3D negative height residuals are mainly used. For missed machining, texture missing, contour deviation, and regional height difference are comprehensively used for judgment.
[0157] (2) Active re-inspection trigger criteria.
[0158] Define the uncertainty of the suspected defect region:
[0159] in: Uncertainty regarding the suspected defect area; Indicates that the candidate region belongs to the first The overall probability of class defects; Indicates the number of candidate defect categories. This represents the uncertainty of the suspected defect region. When the uncertainty exceeds the preset threshold, an active re-examination is triggered. Based on the knowledge graph, a camera, light source, or observation posture with higher information gain is selected to re-collect data until the uncertainty is lower than the threshold or the maximum number of re-examinations is reached.
[0160] Specifically, the candidate region belongs to the first Comprehensive probability of class defects for:
[0161] in: Indicates the first Various detection modes for defect categories The detection confidence level; represents the current data quality of the detection modality; represents the detection modality in the knowledge graph and the defect category the adaptation weight therebetween; represents the defect prior obtained according to the gear configuration category, the machining process and the tooth surface area; represents the influence coefficient of the defect prior.
[0162] When the highest defect confidence is lower than a preset threshold, or there is a significant conflict between detection results of different modalities, the suspected region, current detection result and uncertainty reason are fed back to step S3. In step S3, the robot observation posture, camera and light source are reselected according to the knowledge graph, so as to generate a supplementary detection action. When a two-dimensional image determines that a certain region may have burrs, but the three-dimensional contour data is of low quality due to the influence of reflection, the robot changes the incident direction and working distance of the three-dimensional camera, and collects contour data again. When a linear region is judged as a scratch under a single illumination, but is not obvious under illumination from another direction, the robot adds a third observation angle, and collects a high-magnification texture image for re-inspection. When the re-inspection result reaches the defect judgment threshold, the corresponding defect category is output; when the defect still cannot be confirmed after the preset maximum number of re-inspections is reached, the region is marked as a manual review region.
[0163] S7: Detection result output and knowledge backwriting. The confirmed detection result is backwritten to the knowledge graph, and the association weight between entities is updated.
[0164] In this step, a defect detection result is output, and the confirmed detection result is backwritten to the knowledge graph, so as to realize continuous accumulation of detection experience and self-optimization of the detection strategy.
[0165] (1) Detection result output.
[0166] The defect category, the tooth number where the defect is located, the tooth surface area, the defect length, the defect area, the maximum height, the maximum depth, the detection confidence and the quality judgment result are output. If no defect exceeding the allowable range is found in all key detection regions, the gear is judged to be qualified. If the defect size or severity of any key region exceeds the quality standard, the gear is judged to be unqualified, and the defect position, defect type and corresponding detection evidence are output.
[0167] (2) Knowledge backwriting and association weight update.
[0168] The confirmed defect result, the used camera, the light source mode, the robot observation posture and the re-inspection process are written into a quality traceability database, and the association weights among the corresponding gear configuration category, machining process, tooth surface area and defect type in the knowledge graph are updated. The relationship weight update manner is as follows:
[0169] in: Indicates the updated entity With entity Relationship weights between them; For the entity before the update With entity Relationship weights between them; Representing entities In entity The number of times it appears in the corresponding detection record; Representing entities The total number of corresponding detection records; This represents the knowledge update coefficient.
[0170] When the same type of defect occurs consecutively in a certain processing step, the relationship weight between the processing step and the defect type is increased, and the priority of the corresponding area and detection mode in subsequent detection tasks is increased.
[0171] The beneficial effects of this invention are fully demonstrated through the specific embodiments described above. This invention constructs a closed-loop intelligent detection system covering the entire process, from knowledge graph modeling for intelligent gear detection, initial visual perception and gear configuration recognition, flexible detection task generation, robot trajectory planning and camera adaptive switching, to multimodal defect detection and proactive re-inspection. Through a continuous intelligent link of "knowledge graph-driven decision-making mechanism - multimodal perception fusion - robot flexible execution - uncertainty-triggered re-inspection," the system achieves autonomous perception, autonomous decision-making, and autonomous optimization in the gear detection process. This upgrades the traditional detection process, which relies on manual configuration, into a closed-loop detection control system, effectively solving the technical challenges of manual changeover, fixed trajectories, single modality, and lack of proactive decision-making capabilities in the detection of surface defects in complex gear configurations.
[0172] Specifically, compared with the prior art, the beneficial effects of the present invention are as follows: This invention constructs a closed-loop intelligent detection system covering the entire process, from knowledge graph modeling for intelligent gear detection, initial visual perception and gear configuration recognition, flexible detection task generation, robot trajectory planning and adaptive camera switching, to multimodal defect detection and proactive re-inspection. Through a continuous intelligent link of "knowledge graph-driven decision-making mechanism - multimodal perception fusion - robot flexible execution - uncertainty-triggered re-inspection," the system achieves autonomous perception, autonomous decision-making, and autonomous optimization in the gear detection process, upgrading the traditional manually configured detection process into a closed-loop detection and control system.
[0173] Enhanced adaptability and stability of robot-based flexible inspection across multiple operating conditions: Based on gear configuration recognition results and knowledge graph constraints, the system can adaptively generate inspection area division schemes, robot observation postures, and trajectory paths for different configurations such as spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. It also dynamically matches various camera types, including those with large field of view, macro capabilities, polarization, and 3D contouring, enabling on-demand configuration and effective utilization of inspection resources. Even under complex occlusion, strong reflection, and mixed complex configuration conditions, it maintains stable spatial coverage and inspection consistency, improving the system's adaptability in various gear production scenarios.
[0174] High-reliability defect identification capability under multimodal fusion perception: This invention integrates two-dimensional texture information, color reflection features, polarization response differences, and three-dimensional morphology data to jointly identify typical gear surface defects such as black spots, scratches, dents, missing parts, burrs, and unfinished parts. It also incorporates prior information from a knowledge graph to perform probabilistic constraints and optimized fusion of defect types. Through a multimodal complementary mechanism, it effectively suppresses false detections and false negatives caused by single visual modalities under conditions of metal reflection, tooth surface shadows, and texture interference, improving the accuracy and detection stability of defect identification in complex industrial environments.
[0175] Adaptive camera switching and local replanning dynamic optimization capabilities: This invention introduces an active re-inspection mechanism based on detection uncertainty. When the confidence of the detection result is insufficient or there is a conflict in the multimodal judgment, the system can automatically trigger camera switching and robot local trajectory replanning. Based on the defect type and observation quality, the system selects the observation mode and posture combination that meets the preset evaluation conditions, thereby realizing dynamic correction of the detection process and maximizing information gain, thus reducing the risk of misjudgment in complex defect scenarios.
[0176] Continuous updating of detection knowledge and self-updating capability of system detection strategy: This invention writes back the detection results, robot execution trajectory, camera selection strategy and defect judgment results to the knowledge graph to realize the structured accumulation and continuous updating of detection experience. This enables the system to continuously optimize the gear configuration recognition strategy, detection task generation method and camera switching decision mechanism based on historical detection data, thereby having the ability to continuously update and optimize the detection strategy in the long term.
[0177] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.
Claims
1. A robotic flexible inspection method for surface defects of gears with complex configurations, characterized in that: Includes the following steps: S1: Construct a knowledge graph for intelligent detection of gears with complex configurations. The knowledge graph includes entities, attributes, and their relationships among gear configuration categories, configuration features, specification parameters, processing procedures, tooth surface areas, defect types, detection modes, cameras, light sources, and robot observation postures. S2: Acquire the initial visual image of the gear to be inspected, extract the gear structure features, match the extracted visual features with the knowledge graph, identify the configuration type and specification parameters of the gear to be inspected, and generate a flexible inspection task according to the detection area, observation method and detection accuracy requirements corresponding to different gear configurations. S3: Based on the gear configuration type, configuration features, specification parameters, the area of the tooth surface to be inspected, and the correlation in the knowledge graph, generate candidate observation postures for the robot. After screening by kinematic constraints and imaging quality constraints, plan the robot detection trajectory and select the initial camera and light source configuration according to the detection task. S4: During the execution of the inspection task, the imaging quality and defect judgment confidence are evaluated in real time. When it is determined that the current camera cannot meet the inspection requirements or there is uncertainty in the inspection, the camera mode is adaptively switched and the local re-inspection trajectory is replanned. S5: Collect multimodal detection data of the gear surface according to the planned trajectory, including at least two of the following: two-dimensional images, polarized images and three-dimensional contour data, and perform defect detection on each area of the tooth surface; S6: Fusion of detection results from different modalities, outputting defect category, location, size and quality judgment results. When the fusion confidence is lower than the preset threshold or there is a conflict between modal results, active re-inspection is triggered. S7: Write the confirmed detection results back to the knowledge graph and update the association weights between entities.
2. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 1, characterized in that: In step S1, the gear intelligent detection knowledge graph is represented as follows: in: This represents a knowledge graph for intelligent gear detection. Represents the set of entity nodes in a knowledge graph; Represents a set of relations in a knowledge graph; Represents the set of entity attributes and relation attributes; Collect gear design data, machining processes, quality specifications, and historical testing data; extract entities, attributes, and relationships to form a gear testing knowledge triplet, represented as follows: in: Indicates the head entity; Indicates the tail entity; This indicates the relationship between the head entity and the tail entity; The entities include at least: gear configuration type, tooth surface area, defect type, detection mode, camera, light source, and robot observation posture; the relationships include at least: belonging to, including, possibly occurring, suitable for detection, recommended for use, corresponding posture, and requiring re-inspection; The gear configuration category includes at least spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears; the gear configuration features include at least one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure features; the gear configuration category is determined based on one or more of the following: tooth distribution pattern, tooth line direction, tooth surface spatial shape, axial relationship, helical direction, helical angle, and tooth structure features.
3. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 2, characterized in that: Step S1 also includes updating the knowledge association weights, the method of which is as follows: Update the entity based on historical monitoring data. With entity Relationship weights between the two: in: Indicates the updated entity With entity Relationship weights between them; For the entity before the update With entity Relationship weights between them; Representing entities In entity The number of times it appears in the corresponding detection record; Representing entities The total number of corresponding detection records; This represents the knowledge update coefficient.
4. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 2, characterized in that: In step S2, a gear configuration feature vector is constructed based on the gear structure features, which is represented as: in: Indicates the overall dimensional characteristics of the gear; Indicates the inner diameter of the gear or the dimensional characteristics of the shaft; Indicates the number of teeth; Indicates tooth width characteristics; Indicates the characteristics of tooth line inclination or helix angle and helix direction; It represents the tooth distribution pattern and the spatial structure characteristics of the tooth surface, and is used to characterize the structural differences of different tooth carrier surfaces such as cylindrical surfaces, conical surfaces, end faces or helical surfaces; This refers to the auxiliary structural features, including the hub, keyway, reference hole, and the left and right helical combination structure of the herringbone gear; The candidate gear selected for testing is the one with the highest matching score that is higher than the configuration category determination threshold. in: To match the obtained gear configuration category; Candidate gear configuration categories Match score; Represents the first visual acquisition. Individual gear features; Represents the candidate gear configuration categories in the knowledge graph. The corresponding number One attribute; A similarity function representing the relationship between visual features and knowledge attributes; Represents the weight of each visual feature; This indicates the priori gear configuration category provided by production batch, workstation information, or historical records; Represents prior knowledge weights; The method for generating flexible detection tasks is as follows: for the first... The first tooth of the gear Establish detection task nodes in each region: in: Indicates the gear tooth number; This indicates the tooth tip, tooth root, left tooth surface, right tooth surface, end face, or chamfered area; This indicates the position of the detection area in the gear coordinate system; Indicates the local surface normal of the detection area; This represents the set of defects that may occur in the area; This represents the set of cameras recommended by the knowledge graph. This represents the set of recommended light sources and lighting methods.
5. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 1, characterized in that: In step S3, the observation quality function of the robot's candidate observation pose is: in: Indicates the pixel resolution of the target area; Indicates whether the target area is within the camera's depth of field; Indicates the visibility of the area to be inspected; This indicates the degree of matching between the camera's optical axis and the surface normal of the target area; Indicates the degree of metallic reflection and overexposure; This indicates the risk of collisions during robot movement; to Indicates the weight of each evaluation item; The robot detection trajectory and trajectory optimization objective function are expressed as follows: in: Optimize the objective function for robot trajectory detection; For robot trajectory detection; For the first The robot detects the trajectory; This represents the total length of the robot's trajectory; Indicates the risk of trajectory collision; This indicates the cost of switching between the camera and the light source; Indicates the detection time; Indicates the coverage of the detection area; Indicates the overall observation quality along the entire trajectory; to This indicates the weight of each objective item.
6. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 1, characterized in that: In step S4, the triggering conditions for adaptive switching of camera modes include at least one of the following: image clarity is lower than a preset threshold; pixel resolution of the target area is insufficient; there is local overexposure or reflective saturation on the tooth surface; the tooth root or inner tooth surface area is occluded; the current two-dimensional image cannot distinguish between metal reflection and burr protrusion; the confidence level of defect judgment is lower than a preset threshold; there is a conflict between the detection results of different modes. The method for adaptively switching camera modes is as follows: select the camera with the highest applicable score and perform the switch. in: The initial camera selected; For candidate cameras Applicable score; Indicates camera For suspected defect types The degree of applicability; Indicates camera For the current detection area The expected image quality; Indicates the use of a camera The expected information gain to be obtained later; Representing cameras in a knowledge graph The association weight between the current detection task and the current detection task; This indicates the cost of camera switching and robot movement; to Indicates the weights of each item; The robot's end-effector pose and local detection trajectory were replanned based on the new camera parameters.
7. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 1, characterized in that: In step S5, the multimodal detection data of the complex gear surface includes: two-dimensional texture images and color images acquired by a large field-of-view camera or a macro camera; surface reflection images at different polarization angles acquired by a polarization camera; and tooth surface height data acquired by a three-dimensional contour camera. The method for defect detection in various areas of the tooth surface is as follows: Register the actual measured three-dimensional tooth surface with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface, and calculate the local height residual. in: The local height residual is obtained by registering the actual measured three-dimensional tooth surface with the theoretical tooth surface, standard tooth surface, or adjacent normal tooth surface; This indicates the actual measured tooth surface height; Indicates the reference height of the theoretical tooth surface, standard tooth surface, or normal tooth surface; when When the value is greater than the first preset residual threshold, it indicates that there is a risk of protrusions, burrs, or foreign objects in a local area; when When the residual value is less than the second preset residual threshold, it indicates that there is a risk of local damage, missing material, dents, or missed processing.
8. The robot-based flexible inspection method for surface defects of complex gear configurations according to claim 1, characterized in that: The criterion for triggering active re-inspection in step S6 is: defining the uncertainty of the suspected defect area: in: Uncertainty regarding the suspected defect area; Indicates that the candidate region belongs to the first The overall probability of class defects; Indicates the number of candidate defect categories; Indicates the first Various detection modes for defect categories The detection confidence level; Indicates the first The current data quality for each detection modality; Representing detection modalities in knowledge graphs With defect category The adaptation weights between them; This indicates the prior defects obtained based on the gear configuration type, machining process, and tooth surface area. This represents the influence coefficient of the prior defect. When the uncertainty of the suspected defect area When the uncertainty exceeds the preset threshold, an active re-examination is triggered. Based on the knowledge graph, a camera, light source, or observation posture with higher information gain is selected to re-collect data until the uncertainty is lower than the threshold or the maximum number of re-examinations is reached.
9. A robotic flexible inspection system for surface defects of complex-configuration gears, used to implement the robotic flexible inspection method for surface defects of complex-configuration gears as described in any one of claims 1-8, characterized in that: include: The gear loading and positioning device is used to transport the gear to be inspected to the inspection station, clamp, position and rotate it, and provide gear rotation angle information; Industrial robots are used to carry inspection devices and move along a planned trajectory, adjusting the position and orientation of the camera relative to the tooth surface to be inspected. An initial recognition camera is used to acquire a global image of the gear under inspection and obtain structural features such as gear configuration type and specification parameters; A multi-camera inspection device, including at least two of a wide field-of-view camera, a macro camera, a polarizing camera, and a 3D contour camera; A camera switching mechanism is used to switch between different cameras according to detection instructions; A programmable light source device for adjusting the illumination direction, brightness, incident angle, and polarization state according to the detection area and defect type; Edge servers are used to deploy a gear intelligent detection knowledge graph, a gear configuration recognition model, a robot flexible detection task planning module, an adaptive trajectory planning module, a camera switching decision module, a multimodal defect detection model, and a detection result fusion module. The quality traceability module is used to save inspection images, 3D contours, defect information, robot poses, and quality judgment results.
10. The robotic flexible inspection system for surface defects of complex gear configurations according to claim 9, characterized in that: The gear configuration recognition model consists of a lightweight encoder-decoder segmentation network, a contour feature extraction algorithm, a periodic feature detection algorithm, a tooth line direction detection algorithm, a spatial structure feature analysis algorithm, and a knowledge graph similarity matching algorithm. It is used to complete gear contour extraction, tooth number calculation, tooth line direction recognition, tooth distribution form analysis, tooth surface spatial morphology discrimination, and configuration category recognition, size grade judgment, and configuration parameter estimation for spur gears, helical gears, bevel gears, face gears, herringbone gears, spiral gears, and worm gears. The camera switching decision model consists of an imaging quality evaluation algorithm, a target visibility evaluation algorithm, a robot reachability and collision constraint screening algorithm, an expected information gain calculation algorithm, and a next best viewpoint ranking algorithm, which are used to determine the target camera, light source mode, and local re-inspection pose. The multimodal defect detection model consists of a two-dimensional texture feature extraction algorithm, a polarization response analysis algorithm, a three-dimensional contour registration and height residual calculation algorithm, and a cross-modal fusion algorithm, which are used to output defect category, location, size, and quality judgment results. The camera switching mechanism is a multi-camera turret, an automatic end-effector switching device for robots, or a multi-camera integrated detection head. When an automatic end-effector switching device for robots is used, the industrial robot can move to the camera switching position to complete the unloading and loading of the camera, and automatically call the hand-eye calibration parameters of the corresponding camera. The programmable light source device includes at least two of the following: ring light source, bar light source, coaxial light source, oblique light source, and polarized light source. It can automatically adjust the light source parameters based on the correlation between defect type and illumination mode in the knowledge graph.