Machine Vision-Based Detection of Pitch Deviation in Spur Gears

Spur gears are fundamental components in modern industrial systems, serving as critical elements in machinery for power transmission and motion control. The geometric complexity and numerous measurement parameters of spur gears directly influence their manufacturing precision and performance. Among these parameters, pitch deviation is a key geometric element for assessing gear accuracy. Traditional contact measurement methods for pitch deviation often face challenges such as high difficulty, low accuracy, and susceptibility to human error. To address these issues, non-contact measurement techniques based on machine vision have been introduced, offering advantages like automation, high speed, and improved reliability. This article presents a comprehensive approach for detecting pitch deviation in spur gears using machine vision technology, focusing on an enhanced sub-pixel edge detection algorithm and precise parameter measurement methods. The goal is to achieve effective and accurate detection of pitch deviation in spur gears, thereby contributing to quality control in gear manufacturing.

The measurement system for spur gears consists of several hardware components designed to capture high-quality images for processing. It includes a CCD industrial camera, a lens, a ring light source, a workbench, and a computer. The industrial camera is fixed on a bracket with adjustable height via a handwheel, allowing for optimal focus on the spur gear placed on the workbench. The ring light source provides uniform backlighting to enhance contrast and clarity in the images. During measurement, the spur gear is positioned on the workbench, and the camera height and light intensity are adjusted to obtain the clearest image. The captured image is then transmitted to the computer for processing and analysis. This setup ensures that the spur gear is accurately represented in digital form for subsequent algorithms.

The measurement process for spur gears follows a structured flowchart to ensure systematic analysis. It begins with image acquisition using the machine vision system, followed by camera calibration to correct distortions and determine the pixel equivalent. Image preprocessing steps include grayscale conversion and median filtering to reduce noise and improve quality. Then, an improved Zernike moment sub-pixel edge detection algorithm is applied to extract precise gear edges. Based on the detected edges, key parameters of the spur gear are measured, such as the geometric center, number of teeth, tip circle radius, root circle radius, modulus, and pitch circle radius. Finally, pitch deviation is calculated, and results are analyzed for accuracy. This workflow enables efficient and reliable measurement of spur gears.

Camera calibration is essential to minimize lens distortion and enhance measurement accuracy for spur gears. The Zhang’s calibration method is employed, which involves capturing multiple images of a planar checkerboard pattern. The camera’s intrinsic parameters, including radial and tangential distortion coefficients, are computed. Radial distortion is corrected using a Taylor series expansion up to the third term, as shown in the following equations:

$$x_r = x_p(1 + k_1 r^2 + k_2 r^4)$$

$$y_r = y_p(1 + k_1 r^2 + k_2 r^4)$$

where \(k_1\) and \(k_2\) are radial distortion coefficients, \((x_r, y_r)\) are normalized undistorted image point coordinates, \((x_p, y_p)\) are actual image point coordinates, and \(r\) is the distance from the undistorted point to the optical center. Tangential distortion is corrected similarly:

$$x_r = 2p_1 x_p y_p + p_2(r^2 + 2x_p^2)$$

$$y_r = 2p_2 x_p y_p + p_1(r^2 + 2y_p^2)$$

where \(p_1\) and \(p_2\) are tangential distortion coefficients. After calibration, the pixel equivalent is determined to convert pixel coordinates to physical dimensions. Using the Harris corner detection algorithm on the corrected checkerboard, adjacent corner points are identified, and the pixel equivalent \(K\) is calculated as:

$$K = \frac{\sum_{i=1}^n K_i}{n} = \frac{\sum_{i=1}^n \frac{S}{P_i}}{n}$$

where \(S\) is the designed physical distance between adjacent corners, \(P_i\) is the pixel count between them, and \(n\) is the number of measurements. For this system, \(K = 0.018 \, \text{mm/pixel}\). Image preprocessing for spur gears involves grayscale conversion to simplify processing and median filtering to reduce noise while preserving edge details, as noise can adversely affect subsequent measurements.

The improved Zernike moment sub-pixel edge detection algorithm is crucial for accurately locating gear edges in spur gears. Traditional Zernike moments involve computing orthogonal complex moments for all pixel points, which is computationally intensive. To enhance efficiency, Canny edge detection is first applied for coarse localization of potential edge points. Then, Zernike moments are computed only for these points using a 7×7 template. The Zernike moment for a discrete function \(f(x,y)\) is defined as:

$$Z_{n,m} = \frac{n+1}{\pi} \iint_{x^2+y^2 \leq 1} f(x,y) V^*_{n,m}(\rho, \theta) \, dx \, dy$$

where \(V^*_{n,m}(\rho, \theta)\) is the complex conjugate of the Zernike polynomial, \(\rho\) is the distance from the origin, and \(\theta\) is the angle. For an ideal step edge model rotated by angle \(\theta\), the edge parameters are derived as:

$$l = \frac{Z_{2,0}}{Z’_{1,1}}, \quad k = \frac{3Z’_{1,1}}{2(1-l^2)^{3/2}}, \quad h = \frac{Z_{0,0} – \frac{k\pi}{2} + k \arcsin l + kl\sqrt{1-l^2}}{\pi}, \quad \theta = \arctan\left(\frac{\text{Im}[Z_{1,1}]}{\text{Re}[Z_{1,1}]}\right)$$

where \(l\) is the perpendicular distance from the origin to the edge, \(k\) is the step height, \(h\) is the background gray level, and \(\theta\) is the edge angle. A pixel is considered an edge point if \(k \geq k_t\) and \(l \leq l_t\), where \(k_t\) is the optimal step threshold determined by Otsu’s method, and \(l_t = \frac{2\sqrt{2}}{N}\) with \(N=7\). The sub-pixel edge coordinates \((x_s, y_s)\) are then corrected as:

$$\begin{bmatrix} x_s \\ y_s \end{bmatrix} = \begin{bmatrix} x \\ y \end{bmatrix} + \frac{A}{2} l \begin{bmatrix} \cos \theta \\ \sin \theta \end{bmatrix}$$

where \(A=7\) is the template size. This approach significantly reduces computation time while achieving high precision for spur gear edges.

Measurement of basic parameters for spur gears is performed using the detected sub-pixel edges. The gear center \((x_0, y_0)\) is determined by the centroid method: the gear edge is filled to create a connected region, and its centroid is computed as the center. The tip circle radius \(r_a\) is obtained via the convex hull method, where a convex hull is constructed around the gear轮廓, and intersections with the hull are considered points on the tip circle; their average distance to the center gives \(r_a\). The root circle radius \(r_f\) is found by identifying the 40 points on the gear轮廓 closest to the center and averaging their distances. The number of teeth \(z\) is counted using the statistical connected region method: a mask is created with a circle of radius \((r_a + r_f)/2\) centered at the gear center, and connected regions within this mask represent teeth; counting these regions yields \(z\). The modulus \(m\) and pitch circle radius \(r\) are calculated using standard gear formulas:

$$m = \frac{2r_a}{z + 2h_a^*}, \quad \text{with } h_a^* = 1 \text{ as the addendum coefficient}$$

$$r = \frac{m z}{2}$$

These parameters form the foundation for pitch deviation measurement in spur gears.

Pitch deviation measurement for spur gears involves calculating deviations based on intersections between the pitch circle and gear轮廓. After obtaining the pitch circle radius \(r\), the pitch circle is superimposed on the gear edge image, and intersection points are identified. These points, denoted as \(p_1, p_2, \ldots, p_{2z}\) in clockwise order, correspond to left and right tooth flanks. The angle between two adjacent points on the same flank, such as \(p_i\) and \(p_{i+2}\), is computed using the law of cosines:

$$\angle p_i o p_{i+2} = \arccos\left(\frac{2r^2 – |p_i p_{i+2}|^2}{2r^2}\right)$$

where \(|p_i p_{i+2}|\) is the Euclidean distance between points. The theoretical pitch \(p\) is given by \(p = \pi m\). Three types of pitch deviation are then calculated: single pitch deviation \(\Delta f_{pt}\), k-pitch cumulative deviation \(\Delta f_{pk}\), and total cumulative pitch deviation \(\Delta F_{pk}\). The formulas are as follows:

Single pitch deviation for the i-th tooth: $$\Delta f_{pt_i} = \max |\angle p_i o p_{i+2} \cdot r – \pi m|, \quad i = 1, 2, \ldots, 2z-2$$

k-pitch cumulative deviation (with \(k = \lfloor z/8 \rfloor\)): $$\Delta f_{pk} = \max |\angle p_i o p_{i+2k} \cdot r – k \pi m|, \quad i = 1, 2, \ldots, 2z-2k$$

Total cumulative pitch deviation: $$F_{pk} = \angle p_k o p_{1+2i} \cdot r – i \pi m, \quad k = 1, 2; \quad i = 1, 2, \ldots, z$$ $$\Delta F_{pk} = \max(F_{pk}) – \min(F_{pk})$$

These deviations provide a comprehensive assessment of gear accuracy for spur gears.

Experiments were conducted to validate the proposed method for spur gears. A standard spur gear with a tip diameter of 120 mm, modulus \(m = 3 \, \text{mm}\), and tooth number \(z = 38\) was used as the test specimen. The measurement system was set up as described, and images were captured under controlled lighting conditions. After calibration and preprocessing, the improved Zernike algorithm was applied to detect edges, and parameters were measured. The results for basic gear parameters are summarized in the table below, comparing the proposed method with manual measurements using tools like vernier calipers and a gear pitch checker.

Gear Parameter Proposed Method Manual Measurement Standard Value
Number of Teeth \(z\) 38 38 38
Tip Circle Radius (mm) 60.009737 59.450 60.000
Root Circle Radius (mm) 53.148825 53.595 53.250

The proposed method shows high accuracy, with errors less than 0.02% for tip and root circle radii, demonstrating its reliability for spur gears. For pitch deviation, measurements were performed on both left and right flanks of the spur gear. The single pitch deviations are listed in the following table, with values in micrometers (µm). The pixel equivalent \(K = 18 \, \mu\text{m/pixel}\) was used for conversion.

Tooth Sequence Left Flank Pitch Deviation (µm) Right Flank Pitch Deviation (µm) Tooth Sequence Left Flank Pitch Deviation (µm) Right Flank Pitch Deviation (µm)
1 1.14 -4.81 20 -4.11 -0.81
2 -2.58 2.77 21 1.87 2.59
3 6.91 -6.94 22 -0.91 -6.94
4 0.64 4.53 23 -2.64 -5.57
5 -2.03 5.20 24 3.61 1.20
6 3.17 -3.34 25 -4.35 10.60
7 -9.61 8.29 26 2.64 -4.35
8 11.81 3.91 27 -7.29 -8.91
9 -2.03 -5.64 28 2.73 6.94
10 4.85 4.79 29 -2.59 -4.79
11 -5.81 -1.88 30 4.01 6.88
12 2.77 -2.91 31 5.89 -6.68
13 -6.94 -4.64 32 3.70 -1.64
14 -7.53 -2.52 33 -0.57 -2.83
15 5.28 10.14 34 6.28 -4.35
16 5.60 -5.34 35 -1.79 9.64
17 -6.50 2.81 36 -5.71 4.68
18 -1.34 -1.68 37 -7.13 -4.73
19 2.66 7.53 38 5.85 -1.31

The maximum single pitch deviation is 11.81 µm for the left flank and 10.60 µm for the right flank, indicating good precision for the spur gear. For k-pitch cumulative deviation, with \(k=4\) (since \(z/8 = 4.75\),取整数), the deviations were calculated for both flanks. The left flank showed a maximum cumulative deviation of 23 µm, and the right flank showed -17 µm. The total cumulative pitch deviation \(\Delta F_{pk}\) was 21.05 µm. All deviation values fall within acceptable ranges for spur gears with a 6-grade accuracy level, confirming the method’s effectiveness.

In conclusion, this study demonstrates a machine vision-based approach for detecting pitch deviation in spur gears. By integrating an improved Zernike moment sub-pixel edge detection algorithm with precise parameter measurement techniques, the method achieves high accuracy in measuring gear parameters and pitch deviations. Experimental results on a standard spur gear validate the algorithm’s rationality, with errors below 0.02% for basic dimensions and pitch deviations meeting industry standards. The use of non-contact measurement enhances efficiency and reduces human error, making it suitable for online inspection of spur gears. Future work could focus on extending this method to other gear types, such as helical or bevel gears, and improving algorithms for real-time processing. Additionally, exploring advanced machine learning techniques for defect detection in spur gears could further enhance applicability. Overall, this research contributes to the advancement of precision measurement in gear manufacturing, ensuring higher quality and performance for spur gears in industrial applications.

The methodology presented here highlights the importance of robust image processing and geometric analysis in metrology for spur gears. By leveraging machine vision, manufacturers can achieve faster and more reliable quality control, ultimately leading to better products. As technology evolves, continuous improvements in camera resolution, lighting systems, and algorithmic efficiency will further refine the detection of pitch deviation in spur gears, paving the way for smarter manufacturing environments.

Scroll to Top