Mechanical Engineering Calculator

Spur Gear Mesh Calculator

Design a mating pair of involute spur gears. Calculate the exact center distance required for assembly, along with base diameters dictated by the pressure angle.

Gear Mesh Geometry

Center distance (a) between pinion and gear pitch circles

Pinion (z1)Gear (z2)Center Distance (a)

Mesh Parameters

mm

Metric tooth size. Both gears must match.

teeth

Number of teeth on the smaller gear.

teeth

Number of teeth on the larger gear.

deg

Defines the base circle (Standard is 20°).

Center Distance (a)

108.00mm

Gear Ratio = 3.000 : 1

Pinion (z1)

Pitch Dia. (d1)54.00
Base Dia. (db1)50.74

Gear (z2)

Pitch Dia. (d2)162.00
Base Dia. (db2)152.23

Governing Kinematic Formulas

Center Distance (a)mm

(d₁ + d₂) / 2

Pitch Diameter (d)mm

m × z

Base Diameter (db)mm

d × cos(α)

Gear Ratio (i)-

z₂ / z₁

Engineering Code

Solve for gear mesh geometry in your backend.

Python
import math

def calculate_gear_mesh(m, z1, z2, alpha_deg=20):
    """
    Calculate properties of a meshing spur gear pair.
    
    m: Module (mm)
    z1: Pinion teeth
    z2: Gear teeth
    alpha_deg: Pressure angle (degrees)
    """
    if m <= 0 or z1 < 1 or z2 < 1:
        raise ValueError("Invalid gear inputs")

    d1 = m * z1
    d2 = m * z2
    a = (d1 + d2) / 2
    i = z2 / z1
    
    alpha_rad = math.radians(alpha_deg)
    db1 = d1 * math.cos(alpha_rad)
    db2 = d2 * math.cos(alpha_rad)

    return {
        "center_distance": a,
        "ratio": i,
        "pinion_pitch": d1,
        "gear_pitch": d2,
        "pinion_base": db1,
        "gear_base": db2
    }

# Example
mesh = calculate_gear_mesh(3.0, 18, 54, 20)
print(f"Center Distance: {mesh['center_distance']:.2f} mm")
print(f"Pinion Base Dia: {mesh['pinion_base']:.2f} mm")
MATLAB
function mesh = spur_gear_mesh(m, z1, z2, alpha_deg)
    % Calculate properties of meshing spur gear pair
    
    if m <= 0 || z1 < 1 || z2 < 1
        error('Invalid gear inputs');
    end

    mesh.d1 = m * z1;
    mesh.d2 = m * z2;
    mesh.a = (mesh.d1 + mesh.d2) / 2;
    mesh.ratio = z2 / z1;
    
    alpha_rad = alpha_deg * (pi / 180);
    mesh.db1 = mesh.d1 * cos(alpha_rad);
    mesh.db2 = mesh.d2 * cos(alpha_rad);
end

% Example
mesh = spur_gear_mesh(3.0, 18, 54, 20);
fprintf('Center Distance: %.2f mm\n', mesh.a);
fprintf('Pinion Base Dia: %.2f mm\n', mesh.db1);
Excel Formulas
Center Distance: =(m*(z1+z2))/2
Pinion Base Dia: =(m*z1)*COS(RADIANS(alpha))
Gear Base Dia: =(m*z2)*COS(RADIANS(alpha))

Example Calculation

Consider a gearbox with a Module 3.0 system. The driving pinion has 18 teethand the driven gear has 54 teeth. The pressure angle is the standard 20°.

Center Distance (a)
a = 3.0 × (18 + 54) / 2
108.0 mm
Pinion Base Diameter (db1)
db1 = (3.0 × 18) × cos(20°)
50.74 mm

Understanding Gear Mesh and Involute Geometry

When two gears are mounted in a gearbox, the exact distance between their rotational axes is critical. This is known as the Center Distance. If this distance is too small, the gears will bind and jam. If it is too large, excessive clearance (backlash) will cause impact loads and premature failure.

Center Distance Formula

For standard spur gears operating without profile shifting, the theoretical center distance ($a$) is simply the sum of their pitch radii. Because pitch diameter is $d = m \times z$, the formula for center distance becomes:

a = m × (z₁ + z₂) / 2

The Base Circle and Pressure Angle

Modern gears use an involute tooth profile. Imagine unwinding a taut string from a cylinder; the end of the string traces an involute curve. The cylinder from which this string is unwound is called the Base Circle.

The size of the base circle is dictated by the Pressure Angle ($\alpha$). The standard pressure angle today is 20°, which provides a good balance between tooth strength and smooth power transmission. Older machinery often used 14.5°. The base diameter ($d_b$) is calculated as: d_b = d × cos(α). No gear action can occur below the base circle.

Real-World Engineering Cases

Thermal Expansion in Hot Environments

A steel gear pump handling hot oil failed catastrophically. The engineers machined the aluminum housing perfectly to the theoretical 85.0 mm center distance at room temperature. At 150°C, the aluminum housing expanded more than the steel gears, pulling the gears apart, increasing backlash, and stripping the teeth.

Engineering Lesson

The theoretical center distance assumes rigid mounting. In environments with significant temperature changes, differential thermal expansion must be calculated and compensated for in the initial center distance design.

Improper Pressure Angle Matching

A technician replaced a damaged 24-tooth pinion. The old system was from 1940 and used a 14.5° pressure angle. The new replacement part was a modern 20° gear. Though they had the same module and teeth, the gears ground against each other aggressively, destroying the gearbox in hours.

Engineering Lesson

Two gears can only mesh if they share both the exact same Module AND the exact same Pressure Angle. The base circles must align perfectly for involute action to work.

Frequently Asked Questions

What happens if I increase the center distance slightly?

Thanks to the geometry of the involute curve, gears will technically still transmit uniform rotary motion even if pulled slightly apart. However, the operating pressure angle increases, backlash increases, and the contact ratio drops, which can lead to noisy operation and higher tooth stress.

What is the Pinion?

In a meshing pair, the pinion is simply the gear with the fewer number of teeth, regardless of whether it is driving or being driven. The larger one is just called the 'gear' or 'wheel'.

Can I use an undercut gear?

If your pinion has fewer than 17 teeth (for a 20° pressure angle), the cutting tool removes material from the base of the tooth (undercutting). This weakens the tooth. In such cases, positive profile shifting (increasing the center distance purposefully) is required.

Calculations are for theoretical (zero backlash) standard involute spur gears. Practical gearboxes require a specified center distance tolerance and built-in backlash to accommodate lubrication film thickness and manufacturing variances.