一, Industry demand for M8 connector plug-in status detection
M8 connectors are widely used in fields such as factory automation machinery, automotive electronics, and rail transit, and their plug-in status directly affects system stability. For example, in the connection of robot joint sensors, poor insertion of a single connector may result in a position feedback error exceeding 0.1mm, leading to uncontrolled movement of the robotic arm. Traditional manual visual inspection has the drawbacks of low efficiency and high false detection rate, while visual systems can detect several connectors per second with a false detection rate of less than 0.01%, significantly improving production quality.
二, Hardware Architecture and Selection of Visual Inspection System
1. Industrial camera and lens configuration
Resolution selection: To detect 0.1mm pin offset, a camera with a resolution of 5 million pixels or more is required. For example, the Basler Ace series cameras can achieve a detection accuracy of 0.05mm/pixel at 1080p resolution.
Lens parameters: Adopting a telecentric lens to eliminate perspective distortion, the working distance is controlled within the range of 50-100mm, ensuring that the field of view covers the entire connector insertion surface.
Light source design: Circular LED backlight paired with coaxial light, which can clearly distinguish the metal edges of pins and sockets. The experiment shows that 45 ° oblique light can enhance the contrast of the shadow at the root of the pin and improve the defect recognition rate.
2. Image processing unit
Embedded vision system: such as SICK IVP RangerC50 intelligent camera, with built-in FPGA preprocessing module, can complete edge detection, template matching and other algorithms in real time, with a processing speed of up to 120fps.
PC Base system: suitable for multi camera collaborative detection scenarios, using Basler Pylon SDK to achieve multi-threaded image acquisition and Halcon library for 3D point cloud reconstruction.
三, Core detection algorithm and implementation path
1. Jack positioning and edge extraction
Accumulated quantization gradient direction feature: Generate a template library for connector contours by calculating the gradient direction histogram of each pixel in the image. The experiment shows that the recognition accuracy of this method for M8 connectors reaches 99.7%, and it can still operate stably even in complex backgrounds.
Scanning line histogram analysis: Scan the connector image along the horizontal/vertical direction and count the positions of grayscale transition points. Taking a certain model of M8 connector as an example, the gray level mutation amplitude of its socket edge on the scanning line exceeds 50, which can accurately locate the center of the socket.
2. Classification model for plug-in status
Traditional image processing:
Geometric parameter measurement: Calculate parameters such as center distance deviation and tilt angle between pins and sockets. For example, when the offset of the pin center exceeds 0.2mm or the tilt angle is greater than 2 °, it is judged as poor insertion.
Grayscale threshold segmentation: The Otsu algorithm automatically determines the segmentation threshold between pins and sockets, detecting defects such as missing or bent pins.
Deep learning solutions:
YOLOv5 object detection: Train the model to recognize the insertion status (normal/half inserted/not inserted), achieving a mAP value of 98.2% on 1000 annotated images.
ResNet50 classification network: performs 224 × 224 pixel area segmentation on the plug-in surface, and outputs the plug-in quality level (excellent/good/poor) after inputting into the network, with an accuracy rate of 97.5%.
四, Optimization of Detection Process in Industrial Scenarios
1. Dynamic detection and real-time feedback
Application of high-speed linear array camera: On a continuous production line, a linear array camera is used to scan the connector at a line frequency of 10kHz and trigger motion compensation with an encoder. For example, a certain automotive electronics production line has increased the detection speed to 300 connectors per minute through this solution.
PLC collaborative control: The visual system transmits the detection results (OK/NG signals) in real time to the PLC through TCP/IP protocol, triggering the sorting mechanism to remove defective products. Experimental data shows that this scheme reduces the missed detection rate of defective products from 3% to 0.2%.
2. Enhanced environmental adaptability
Anti vibration design: Under vibration conditions, frequency domain filtering algorithm is used to suppress image blur caused by mechanical vibration. For example, retaining the 50-200Hz frequency band signal through a bandpass filter can effectively extract connector edge features.
Multispectral imaging technology: For pollution scenes such as oil stains and dust, combined with visible light and infrared imaging, anti-interference features are extracted through principal component analysis (PCA). Tests have shown that this method can still maintain a detection accuracy of over 95% in heavily polluted environments.
五, Typical application cases and performance verification
1. Robot joint sensor detection
In a certain six axis industrial robot project, the visual system detects the insertion status of the M8 connector:
Hardware configuration: 2 5-megapixel CMOS cameras, paired with a telephoto lens and circular LED light source.
Testing indicators: center to center deviation of pins ≤ 0.15mm, tilt angle ≤ 1.5 °, insertion depth error ≤ 0.3mm.
Implementation effect: After the system was launched, the robot positioning accuracy improved to ± 0.03mm, which is three times higher than manual detection, and the equipment failure rate decreased by 80%.
2. Testing of new energy vehicle battery management system
In a certain electric vehicle BMS production line, the visual system detects M8 connectors:
Testing content: Defects such as socket oxidation, pin bending, and insulation layer damage.
Algorithm optimization: U-Net semantic segmentation network is used to perform pixel level classification on the plug-in surface, with a detection speed of up to 20fps.
Achievement data: The system achieves 100% online detection, with a zero missed detection rate and a false detection rate of less than 0.5%, ensuring the reliable operation of the BMS system for 5 years.
