Skip to content

Measurement of Type-C Connector Pin Step Difference

Project Introduction

Project Background

By accurately measuring the pin step difference, defective products can be detected and eliminated in a timely manner, reducing the defective rate.

本地图片

Camera Selection

LMI laser line scan camera Gocator2510

Detection Requirements

  • Measurement accuracy ≤ 0.02mm
  • Measurement repeatability ≤ 0.015mm
  • Measurement cycle ≤ 200ms

Solution

AI-Vision software processes 3D point clouds. After product positioning, a reference plane is fitted. The step difference is measured by cyclically measuring the heights of the upper and lower ends and then taking the difference. Compared with the method of converting to 2D, this project greatly simplifies the process and improves both processing speed and accuracy.

Design Idea

本地图片

Execution Effect Display

  • Project Result Display:

    本地图片

  • HMI Result Display:

    本地图片

Project Process

1. Initialization

  1. Set the initial box coordinates and overall result parameters

本地图片

  1. Initialize the count

  2. Use the Load Point Cloud tool to load the point cloud image to be processed.

2. Preprocessing

本地图片

Position Adjustment

  1. Use the 3D Square Probe tool to obtain two edges of the workpiece.

    本地图片

  2. Use the 3D Geometric Intersection tool, bind the two edges output by the operator variables in the previous step as input geometries, and output the intersection point of the two straight lines.

  3. Use the 3D Position Adjustment tool, bind the straight line intersection point output by the operator in the previous step as the new origin to adjust the XY position of the point cloud.

Plane Fitting

  1. Use the 3D Region tool to select the region for plane fitting.

    本地图片

  2. Use the 3D Plane tool, bind the variable region output by the operator in the previous step as the input region, fit the plane and set it as the zero plane.

Crop the Region to be Tested

Select the 3D Crop tool to crop the part to be measured into IM1.

本地图片

Image Preprocessing

Select the 3D Outlier Filter tool to filter the point cloud in IM1 and remove interference points.

本地图片

3. Cyclic Calculation of Pin Step Difference

本地图片

  1. Select the 3D Square Probe tool to find the starting points of the upper and lower parts respectively.

    本地图片

  2. Use the Marker tool to set startLoop for loop jump.

  3. Select the Variable Setting tool

  • Bind the midpoint of the output variable of the 3D Square Probe tool as the starting point for measuring the upper and lower edges.

  • Calculate the position of the next point to be measured, and output the measurement box of the point to be measured to the operator output variable.

  • Increase the loop count by 1.

    本地图片

    本地图片

  1. Select the 3D Height tool, bind the operator output variable (current measurement box of the point to be measured) of the Variable Setting tool, and measure the height value.

  2. Select the Variable Setting tool to calculate the height difference

本地图片

  • Use the Variable Setting tool to save the pin height data to the array global variable, and splice the pin height data into a string

本地图片

  • And judge whether to loop.

本地图片

  • Judge whether there is NG data, if so, the whole is NG.
  1. Use the Marker tool to set stopLoop for end jump.

4. Save Results to Database and CSV File

Select the Conditional Branch tool to judge whether it is NG. If it is OK, use the 3D Data Display tool to display OK, otherwise display NG.

本地图片

Use the Lua Script tool to extract data from the string.

lua
local numTable = {}
for num_str in string.gmatch(str, "%d+%.?%d*") do
    table.insert(numTable, tonumber(num_str)) 
end

for i = 1, #numTable do
    local varName = "num" .. i  
    local value = numTable[i]   
    SetFloatVariable(varName, value)  
end

Use the Write to CSV tool to save data.

本地图片

Use the Write to Data Table tool to save data.

本地图片

AI-Vision, Making 3D Measurement Easier