In the most general terms, this invention relates to an approach to detect the hole orientation and its position on a part with a vision system mounted on the industrial robot.
In some industrial applications holes on a part need to be inspected after drilling process to control quality. This can be done with an industrial robot equipped with a vision system.
The vision system consists of a laser scanner and a camera. The laser scanner is used to scan a surface around the hole opening. The camera is used to detect the image position of the hole opening.
In the first step the orientation of the hole axis is determined by using alignment algorithm. Then the hole position is determined by intersecting the hole axis with the surface around the hole opening.
I. Determine the Hole Orientation in a Camera Coordinate System
The parameter to be determined is a straight line equation representing the hole axis: (nx, ny, nz, X, Y, Z) where (nx, ny, nz) represents the orientation and (X,Y,Z) represents any point on the line.
Step 1: Alignment of the Vision System with the Hole Axis
As shown in
Step 2: Determination of the Hole Orientation in the Camera Coordinate System
Detect the center position of the hole opening image (x,y). The hole orientation in the camera system will be determined by the following line equations (image project relation)
where (fx, fy) are the camera focal length in x and y directions; (tx,ty,tz) are translations, and (m11, m12, m13, m21, m22, m23, m31, m32, m33) are rotation matrix of the camera with respective to a reference coordinates. Those parameters are calibrated previously. Equation (1) actually represents a ray that connects the image center and the lens center.
Step 3: . Convert the Hole Orientation in a Part Coordinate System
It is more convenient to the hole orientation and position in a fixed coordinate system like the part itself.
Assume they are ( nx′, ny′, nz′, X′, Y′, Z′)
The transformation can be done with the following robot kinematics equation
Define
Twv=(Tbw)−1*T0*Ttv (2)
Where Tbw is the transformation from the part coordinates system to the robot base; Ttv is the transformation from vision system to robot tool mounting flange (tool0); and coordinate system T0 is the position matrix of the robot mounting flange coordinate system in the robot base. They are all calibrated parameters.
Then
(X′,Y′,Z′,1)′=Twv*(X,Y,Z,1)′; (3)
(nx′,ny′,nz′)′=Rwv*(nx,ny,nz)′; (4)
where Rwv is the rotation matrix of the transformation matrix Twv
II. Determination of the Hole Position
Step 1: Determination of the Surface (Plane) Around the Hole Opening
Use the laser scanner 9 to scan the surface of the part 2 that is around the hole opening. If a laser scanner is a laser pointer or laser displacement sensor that measures the single point 10, at least 5 points around the hole opening have to be measured. Do surface fitting to determine the surface equation. For simplicity we assume that the surface can be modeled as a plane as approximation. It can be described by the following plane equation
nx*X+ny*Y+nz*Z=d (5)
where (nx, ny, nz) is the normal of the plane and d is the plane offset that are determined by the least square plane fitting algorithm. If the reading of the laser scanner is based on the robot base coordinate system it has to be converted into a fixed reference coordinate system.
The plane equation can be converted into a fixed part coordinate system by using the following relation:
(X′,Y′,Z′,1)w′=(Tbw)−1*(X,Y,Z,1)b′; (6)
where Tbw is the transformation from the part coordinates system to the robot base;
Step 2. Calculation of the Hole Opening Position
The intersection of the hole axis orientation described by equations (1) to (4) and the surface plane described by equations (5) and (6) around the hole opening gives the hole opening position. That is the solution of eqs.(1) to (6) for (X′,Y′,Z′).