Measurement of Straight Spur Gear Tooth Pitch Deviation Using Machine Vision

This research focuses on an automatic measurement method for tooth pitch deviation of involute cylindrical straight spur gears based on machine vision. The approach utilizes an image measurement system to capture end-face images of the straight spur gear under test. According to the definition of tooth pitch deviation, an automatic measurement program is designed and implemented. The program automatically collects gear images, performs image preprocessing, circle fitting algorithms, constructs the pitch circle, extracts measurement points, and finally calculates each pitch deviation, from which the single pitch deviation, cumulative pitch deviation, and total cumulative pitch deviation are derived. An experimental imaging system is built to validate the method. The experimental results are compared and analyzed, showing that the repeatability accuracy of the pitch deviation measurement is better than 6 µm. The proposed method and system can effectively detect the tooth pitch deviation of a straight spur gear.

Machine vision technology integrates artificial intelligence, geometric optics, electronics, computer graphics, information processing, and machine learning. It offers advantages such as high precision, strong reliability, fast speed, and non-contact operation. With the advancement of industrial automation, especially smart manufacturing, machine vision inspection has replaced manual inspection in numerous fields including transportation, medical care, agriculture, and industrial production. Since the birth of machine vision in the 1950s and the theoretical framework established by David Marr, significant progress has been made worldwide. In China, research on machine vision began in the mid‑1980s and gained momentum in the 1990s. The 21st century witnessed explosive growth in the machine vision market, with widespread applications in the internet and industrial sectors. However, a gap still exists between China and the world’s advanced level in this domain.

In the 1960s, the United States started applying machine vision image measurement technology in manufacturing. Subsequently, Germany, Canada, Japan, and other countries also began research on related theories and technologies. In China, relevant research started in the 1980s and gained attention in the 1990s. Although many achievements have been made in theoretical models, experimental analysis, and system establishment, the overall level remains relatively behind. Currently, image measurement technology is mainly applied in areas such as steel surface defect detection, automotive quality inspection, printing quality control, and gear parameter measurement.

Conventional contact‑based measurement equipment, such as coordinate measuring machines and special gauges, are still widely used for gear parameter measurement. These devices are often complicated to operate, require high labor and management costs, have low measurement efficiency, and do not always achieve the required accuracy. To realize high‑precision and automated measurement of gear geometric parameters, this study investigates a machine‑vision‑based method for the automatic measurement of tooth pitch deviation of a straight spur gear.

Measurement Principle

The basic principle of the image measurement method is illustrated as follows. The imaging system projects the object surface onto a photoelectric detection unit (camera sensor), which converts the optical signal into an electrical signal (digital image). The electrical signal is then transmitted to the host computer. After acquiring the image, image processing software extracts the required geometric features. Based on the mathematical model of the imaging system, the geometric quantities of interest are calculated, thereby realizing the measurement of product geometry.

Taking the measurement of point‑to‑point distance as an example, the fundamental mathematical concept of image measurement is described. The acquired image has dimensions a × b in pixels. In the detection image, points A and B are intersections of the gear profile with the pitch circle. The arc length AB on the pitch circle is to be calculated. Let the pixel coordinates of A be (uₐ, vₐ) and those of B be (u_b, v_b). The actual geometric length of arc AB is the product of the system’s pixel equivalent τ (mm/pixel) and the pixel arc length AB, expressed as:

$$AB = \tau \sqrt{(u_a – u_b)^2 + (v_a – v_b)^2}$$

Here, τ is the pixel equivalent, representing the real distance corresponding to one pixel. It reflects the magnification of the imaging system and is usually calibrated using a standard checkerboard or scale.

Measurement Algorithm Design

After obtaining the detection image using the imaging system and industrial camera, a series of image processing algorithms are applied to extract the tooth pitch. These algorithms include: image preprocessing, imaging system calibration, gear profile and feature extraction, pitch circle construction, and tooth pitch parameter calculation.

Image Preprocessing

The preprocessing steps denoise the image, perform binarization, edge detection, and highlight the gear profile to facilitate subsequent processing. The flowchart of the algorithm is depicted below.

Image Preprocessing Steps
Step Description
1. Gaussian Filtering Removes noise caused by lighting variations and ambient stray light.
2. Threshold Binarization Separates foreground (gear profile) from background based on pixel intensity differences.
3. Morphological Operations Dilation and erosion to enhance profile continuity and suppress small artifacts.
4. Edge Detection Extracts the gear contour using Sobel operator.

Gaussian filtering effectively suppresses noise. Proper thresholding highlights the gear profile while removing irrelevant information, thus reducing data dimensionality.

Imaging System Calibration

Calibration is performed following the method proposed by Zhengyou Zhang (1998) using a planar checkerboard. Two main aspects are addressed: distortion correction and pixel equivalent determination.

Distortion and Correction

Due to lens manufacturing and mounting uncertainties, radial and tangential distortions appear, especially near the image periphery. Radial distortion is modeled by a Taylor series expansion:

$$
\begin{aligned}
x_r &= x_p \left(1 + k_1 r^2 + k_2 r^4 + k_3 r^6\right)\\
y_r &= y_p \left(1 + k_1 r^2 + k_2 r^4 + k_3 r^6\right)
\end{aligned}
$$

where (x_r, y_r) are corrected coordinates, (x_p, y_p) are distorted coordinates, r is the distance to the optical center, and k₁, k₂, k₃ are radial distortion coefficients.

Tangential distortion arises from non‑parallelism between the lens and the image plane. It is modeled as:

$$
\begin{aligned}
x_r &= x_p \left[1 + 2p_1 r^2 + p_2 (r^2 + 2x^2)\right]\\
y_r &= y_p \left[1 + p_1 (r^2 + 2y^2) + 2p_2 x\right]
\end{aligned}
$$

where p₁, p₂ are tangential distortion coefficients. In total, five distortion parameters (k₁, k₂, k₃, p₁, p₂) are estimated and used to correct the images.

Pixel Equivalent Calibration

From the checkerboard calibration, the intrinsic matrix M is obtained:

$$
M = \begin{bmatrix}
f_x & 0 & u_0\\
0 & f_y & v_0\\
0 & 0 & 1
\end{bmatrix}
= \begin{bmatrix}
f/dx & 0 & u_0\\
0 & f/dy & v_0\\
0 & 0 & 1
\end{bmatrix}
$$

Here, (u₀, v₀) is the pixel coordinate of the principal point; dx and dy are the physical sizes of one pixel along the x and y axes; f is the focal length. The pixel equivalent τ is derived as τ = dx = f / f_x, and similarly for dy. The calibrated pixel equivalent for our system is τ = 0.00504 mm/pixel.

Gear Profile and Feature Extraction

After binarization and morphological operations, the gear profile is extracted using the Sobel edge detector. The Sobel operator calculates the gradient approximation of the image intensity function. For a pixel P₅ with its 3×3 neighborhood, the horizontal and vertical derivatives are:

$$
G_x = \begin{bmatrix}
-1 & 0 & 1\\
-2 & 0 & 2\\
-1 & 0 & 1
\end{bmatrix} \cdot
\begin{bmatrix}
P_1 & P_2 & P_3\\
P_4 & P_5 & P_6\\
P_7 & P_8 & P_9
\end{bmatrix}
$$

$$
G_y = \begin{bmatrix}
-1 & -2 & -1\\
0 & 0 & 0\\
1 & 2 & 1
\end{bmatrix} \cdot
\begin{bmatrix}
P_1 & P_2 & P_3\\
P_4 & P_5 & P_6\\
P_7 & P_8 & P_9
\end{bmatrix}
$$

The actual derivatives at P₅ are:

$$
P_{5x} = (P_3 – P_1) + 2\cdot(P_6 – P_4) + (P_9 – P_7)
$$
$$
P_{5y} = (P_7 – P_1) + 2\cdot(P_8 – P_2) + (P_9 – P_3)
$$

This operator is efficient and provides satisfactory edge localization for a straight spur gear profile.

Pitch Circle Construction

The pitch circle requires its center and radius. The center coincides with the gear center. The pitch circle radius is given by:

$$d = m z / 2$$

where m is the module and z is the number of teeth. The necessary gear parameters are extracted from the image.

Steps for Constructing the Pitch Circle
Parameter Method
Gear Center (x₀, y₀) Take the average of centers obtained from fitting the outer and inner contours using the least‑squares circle.
Addendum Circle Radius rₐ Build the convex hull of the outer contour; find intersection points of hull with the contour; average distances of these points to the gear center.
Dedendum Circle Radius r_f Find the minimum distance from contour points to center; select points within a small interval; average their distances.
Number of Teeth z Draw a circle with radius (rₐ + r_f)/2; count the intersections with the profile; half the count gives z.
Module m Calculate m’ = 2rₐ/(z+2); choose the nearest standard module from the series table.

The pitch circle radius is then r = mz/2. For the test straight spur gear, z = 14 and m = 0.6, so the pitch circle radius is 4.2 mm.

Tooth Pitch Parameter Calculation

After constructing the pitch circle, its intersections with the gear profile are extracted and sorted clockwise. For a straight spur gear with z teeth, there are 2z intersection points (one on each flank). Let these points be P₁, P₂, …, P_{2z} with angles θ₁, θ₂, …, θ_{2z} measured from the positive x‑axis. The theoretical pitch (arc length) is:

$$p = \pi m$$

The i‑th actual pitch can be computed as:

$$p_i = \frac{m z}{2} (\theta_{i+2} – \theta_i) \quad \text{or} \quad p_i = \frac{m z}{2} (\theta_{i+1} – \theta_{i-1})$$

Angle differences must be wrapped to the range [0, 2π). The i‑th pitch deviation is:

$$f_{pi} = p_i – p$$

The single pitch deviation is the maximum absolute value:

$$f_{pt} = \max_i |f_{pi}|$$

The cumulative pitch deviation over k consecutive pitches (k is the largest integer less than z/8 or z/6 as per standard) is:

$$F_{pi} = \max_j \sum_{j=i}^{i+k-1} f_{pj}$$

The total cumulative pitch deviation over one revolution is:

$$F_{pk} = \sum_{j=1}^{k} f_{pj}$$
$$F_p = \max(F_{pk}) – \min(F_{pk})$$

These definitions follow the national standard GB 10095‑88 for straight spur gear accuracy.

Experimental System and Measurement Results

An experimental image measurement system was built to validate the proposed method. The system comprises:

Components of the Vision‑Based Measurement System
Component Specification
Industrial Camera Model VMS14M33C, CMOS, 1/2.33″ optical size, 4320 × 2430 pixels, pixel size 1.43 µm × 1.43 µm
Lens Model CW‑FM1614‑8MP, f=16 mm, FOV 21.8° × 16.8°, distortion <0.05%
Lighting LED ring light
Stage Adjustable platform with height‑adjustable support
Host Computer Performs image processing and measurement algorithms

The image measurement system is shown in the following figure. The system, combined with OpenCV‑based image processing, can accurately measure the tooth pitch deviation of a straight spur gear.

A user‑friendly software interface was designed using PyQt5. The interface allows image acquisition, image processing, system calibration, and gear measurement. The processed results are displayed in real time.

Measurement of Straight Spur Gear Tooth Pitch Deviation

Multiple images of the test straight spur gear were captured from different orientations, and the deviations were measured for each image. The gear profile was extracted as two contours (outer and inner). The convex hull, addendum circle, and dedendum circle points were identified. The measured gear parameters matched the actual values: number of teeth z = 14, module m = 0.6, pitch circle radius = 4.2 mm.

Table below presents the measured pitch deviations for one specific straight spur gear. The deviations are given for both left and right flanks.

Measured Pitch Deviations for a Straight Spur Gear (Unit: µm)
Tooth Number Deviation (Left Flank) Deviation (Right Flank)
1 -0.131 -2.787
2 -7.395 -0.111
3 0.411 -1.295
4 -22.115 5.829
5 21.317 -10.414
6 5.620 -29.053
7 10.261 39.830
8 -3.565 -2.425
9 -7.979 4.367
10 2.071 -10.471
11 3.391 -16.315
12 -35.055 11.500
13 23.137 -14.961
14 10.032 26.304

The maximum absolute deviation on the left flank is 35.055 µm, and on the right flank it is 39.830 µm. The total cumulative pitch deviation (F_p) for this gear was 41.137 µm (left) and 41.771 µm (right), showing good consistency.

Repeatability Analysis

To assess repeatability, the same straight spur gear was measured ten times. For each measurement, the single pitch deviation of tooth No. 1 (fₚ₁), the cumulative pitch deviation over the first two teeth (Fₚ₂), and the total cumulative pitch deviation (Fₚ) were recorded. Results are summarized below.

Repeatability Measurement Results for a Straight Spur Gear (Unit: µm)
Measurement No. Single Pitch Deviation (Tooth 1) Cumulative Deviation (Teeth 1‑2) Total Cumulative Deviation
1 -13.008 -24.929 41.162
2 -2.293 -16.271 37.407
3 -5.422 -19.124 30.106
4 -2.149 -15.767 35.282
5 -2.308 -12.294 39.482
6 -5.468 -19.219 35.579
7 -13.031 -23.790 41.883
8 -14.740 -25.566 40.874
9 -8.755 -17.944 38.465
10 -0.130 -7.526 41.137
Standard Deviation 5.317 5.688 3.671

The standard deviations were calculated using the Bessel formula:

$$s = \sqrt{\frac{\sum_{i=1}^{n}(x_i – \bar{x})^2}{n-1}}$$

where n = 10. The repeatability (standard deviation) for single pitch deviation was 5.317 µm, for cumulative deviation 5.688 µm, and for total cumulative deviation 3.671 µm. All values are below 6 µm, confirming excellent repeatability for the straight spur gear measurement.

Further verification was performed on three groups of gears (10 identical straight spur gears per group). For each gear, the total cumulative deviation was measured ten times and the standard deviation computed. The results are shown in the bar chart below.

Maximum Standard Deviations of Total Cumulative Deviation for Three Gear Groups
Group Max Standard Deviation (µm)
1 5.014
2 5.314
3 5.302

All groups exhibit maximum standard deviations below 5.5 µm, demonstrating that the system provides reliable and repeatable measurements for straight spur gear pitch deviations.

Conclusion

This study presents a machine‑vision‑based method for measuring the tooth pitch deviation of an involute cylindrical straight spur gear. The method captures an image of the gear end face, performs image preprocessing, edge detection, feature extraction, and constructs the pitch circle using the calibrated system. The computed pitch deviations follow the standard definitions. Compared with conventional contact‑based methods, the proposed technique offers advantages such as high speed, simple operation, full automation, non‑contact nature, and high accuracy. Experimental results show that the repeatability of the pitch deviation measurement is better than 6 µm, confirming the effectiveness of the system for the inspection of straight spur gears. This method can be readily integrated into industrial production lines for quality control of straight spur gear manufacturing.

Scroll to Top