Parametric 3D Design of Worm Gears Based on SolidWorks

In this paper, we present a comprehensive methodology for the parametric three-dimensional solid modeling of worm gears using SolidWorks as the platform and Visual Basic for Applications (VBA) for secondary development. Worm gears are widely used in engineering for transmitting motion and power between non-intersecting, perpendicular shafts. Their complex helical and involute surfaces make traditional manual drafting tedious and error-prone. By establishing precise mathematical models and automating the construction process, we enable rapid generation of accurate worm gear models that serve as a foundation for finite element analysis, kinematic simulation, and CNC machining. This work focuses on the most common type—Archimedean worm gears—and details the mathematical formulation, the parametric design workflow, and the implementation steps with code snippets. Extensive tables and equations are provided to summarize all key parameters and geometric relationships.

Introduction

Worm gear drives are essential components in many mechanical systems, including conveyors, elevators, and automotive steering mechanisms. The tooth profiles of worm gears are inherently three-dimensional and require precise geometric definition. Traditional CAD approaches often involve manually constructing splines or importing curves from external sources, which is inefficient when design parameters change. To address this challenge, we have developed a parametric design system that takes user-defined inputs such as module, pressure angle, number of threads, and gear ratio, and automatically generates the solid models in SolidWorks. The process relies on the mathematical descriptions of the worm thread and the gear tooth profiles, particularly the Archimedean spiral for the worm and the involute curve for the gear. Our implementation uses VBA to drive the SolidWorks API, creating sketches, extrusion, sweep cuts, and circular patterns. The resulting models are fully associative: updating any input parameter regenerates the geometry without manual intervention.

Mathematical Model of Worm Gears

Archimedean Worm Thread Geometry

The Archimedean worm, also known as the ZA worm, has a trapezoidal cross-section in the axial plane. The tooth space is formed by a straight-line generator sweeping along a cylindrical helix. The coordinates of the four vertices of the tooth space cross-section (see the figure below) are given by:

$$
\begin{aligned}
x_1 &= \frac{p_x}{4} – h_f \tan\alpha = \frac{\pi m}{4} – 1.2 m \tan\alpha \\
y_1 &= r – h_f = \frac{m q}{2} – 1.2 m \\
x_2 &= \frac{p_x}{4} + h_a \tan\alpha = \frac{\pi m}{4} + m \tan\alpha \\
y_2 &= r + h_a = \frac{m q}{2} + m \\
x_3 &= -x_2, \quad y_3 = y_2 \\
x_4 &= -x_1, \quad y_4 = y_1
\end{aligned}
$$

The base helix lies on the pitch cylinder of the worm. The lead of the helix is:

$$ T = Z_1 p_x = \pi m z_1 $$

where:

  • $m$ – module (mm)
  • $z_1$ – number of threads on the worm (worm head count)
  • $q$ – pitch diameter coefficient of the worm
  • $\alpha$ – pressure angle (typically 20°)
  • $h_a = h_a^* m$ – addendum height, with $h_a^* = 1$
  • $h_f = h_f^* m$ – dedendum height, with $h_f^* = 1.2$
  • $p_x = \pi m$ – axial pitch
  • $r = m q / 2$ – pitch radius of the worm

Involute Tooth Profile for the Worm Gear

For the worm gear, the tooth profile in the transverse plane is an involute curve. Since SolidWorks does not have a built-in involute generator, we compute discrete points on the involute and then fit a spline. The involute parametric equations in the gear coordinate system (origin at gear center) are:

$$
\begin{aligned}
x(r_k) &= r_k \sin(\phi + \theta_k) \\
y(r_k) &= r_k \cos(\phi + \theta_k)
\end{aligned}
$$

with:

$$
\theta_k = \tan\alpha_k – \alpha_k, \quad \alpha_k = \arccos\left(\frac{r_b}{r_k}\right), \quad \phi = \frac{\pi}{2 z_2} – \tan\alpha + \alpha
$$

where:

  • $r_k$ – radius of a point on the involute ($r_f \le r_k \le r_a$)
  • $r_b = r_2 \cos\alpha$ – base circle radius of the gear
  • $r_2 = m z_2 / 2$ – pitch radius of the gear
  • $z_2$ – number of teeth on the worm gear
  • $r_f$ – root circle radius, $r_a$ – addendum circle radius

To place the gear tooth space correctly, we perform a coordinate transformation that shifts the gear center to the location relative to the worm axis. For the typical assembly where the gear and worm axes are perpendicular and offset by the center distance $a = r_1 + r_2$, we transform the coordinates:

$$
x’ = -x(r_k), \quad y’ = r_1 + r_2 + y(r_k)
$$

Summary of Key Parameters

Table 1: Principal geometric parameters for worm gears
Symbol Description Formula / Value
$m$ Module Input
$z_1$ Number of worm threads Input
$z_2$ Number of gear teeth Input
$q$ Worm pitch diameter coefficient Input (standard values 8–20)
$\alpha$ Pressure angle Usually 20°
$h_a^*$ Addendum coefficient 1.0
$h_f^*$ Dedendum coefficient 1.2
$r_1$ Worm pitch radius $m q / 2$
$r_2$ Gear pitch radius $m z_2 / 2$
$a$ Center distance $r_1 + r_2$
$p_x$ Axial pitch of worm $\pi m$
$T$ Lead of worm $z_1 p_x = \pi m z_1$
$r_b$ Base circle radius of gear $r_2 \cos\alpha$
$r_f$ Root circle radius of gear $r_2 – h_f$
$r_a$ Addendum circle radius of gear $r_2 + h_a$
$L$ Length of threaded portion of worm Input (e.g., 5–10 $p_x$)
$b$ Face width of worm gear Input (usually 0.25–0.75 $r_2$)

Parametric Modeling Approach

We adopt a fully automated, user‑driven parametric design system. The overall programming steps are:

  1. Declare variables – define all necessary variables for SolidWorks objects, parameters, and intermediate geometry.
  2. Input parameters – present a dialog box (Figure 1 in the original paper) where users enter module, pressure angle, worm head count, gear teeth, diameter coefficient, gear face width, addendum and dedendum coefficients, and worm thread length.
  3. Calculate derived dimensions – compute pitch radii, center distance, base circle, root/addendum circles, lead, etc., using the formulas in Table 1.
  4. Create worm solid – extrude a cylinder of diameter $d_f$ and length $L$, then sketch the tooth space profile on a plane, generate the helical guide curve, and perform a cut sweep.
  5. Create gear solid – build the blank gear blank (a torus-like shape), sketch the involute tooth space profile on an offset plane, create a helical guide curve with half-turn, cut sweep a single tooth space, and then circular pattern for all teeth.

The code is written in Visual Basic for Applications (VBA) and runs inside SolidWorks. The user interface is a simple Form with text boxes and a “Generate” button. After entering the parameters and clicking the button, the entire geometry is built without further interaction. The key advantages are speed (a few seconds per model) and consistency (no manual sketching errors).

Creating the Worm Solid Model

Extruding the Blank

We start by creating a cylinder representing the worm blank. The code selects the “Right Plane” as sketch plane, draws a circle with diameter equal to the root diameter $d_f = m(q – 2.4)$ (since root diameter is slightly smaller than pitch diameter), and extrudes to length $L$. The corresponding VBA snippet (translated for clarity) is:

boolstatus = Part.Extension.SelectByID2("Right Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.CreateCircle 0, 0, 0, d_f / 2, 0, 0
Part.FeatureManager.FeatureExtrusion2 True, False, False, 0, 0, L, 0.01, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1, 0, 0, False

Sketching the Tooth Space Profile

We then create a new sketch on the “Top Plane” and draw the trapezoidal shape using the vertex coordinates from Equation (1). The code draws four line segments:

Part.CreateLine2 -x1, y1, 0, x1, y1, 0
Part.CreateLine2  x1, y1, 0, x2, y2, 0
Part.CreateLine2  x2, y2, 0, -x2, y2, 0
Part.CreateLine2 -x2, y2, 0, -x1, y1, 0

After closing the loop, the sketch is finished.

Generating the Helical Guide Curve

The guide curve for the sweep is a helix whose base circle is the worm pitch circle (diameter $d_1 = m q$). The helix parameters: pitch = axial pitch $p_x$, height = $L$, start angle = 0, and rotation direction (right‑hand or left‑hand). For example, to create a right‑hand helix with one full turn:

Part.CreateCircle 0, 0, 0, d1 / 2, 0, 0
Part.InsertHelix False, True, False, True, 2, L, p_x, 7.96178343949, 0, 0

The constant 7.96178343949 is a system‑dependent parameter (related to helix angle), but in our implementation we compute it automatically.

Performing the Cut Sweep

We select the tooth profile sketch as the profile and the helix as the path, and execute the cut sweep feature:

boolstatus = Part.Extension.SelectByID2("tooth_space", "SKETCH", 0, 0, 0, False, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("helix_guide", "REFERENCECURVES", 0, 0, 0, True, 4, Nothing, 0)
Dim SweepFeature As Object
Set SweepFeature = Part.FeatureManager.InsertCutSwept3(False, True, 0, False, False, 0, 0, False, 0, 0, 0, 0, 1, 1, 0, 1)

After the sweep, the worm has a single threaded groove. The rest of the worm (shaft ends, chamfers, etc.) can be added manually or through additional automated features. Figure 2 in the original paper shows the completed worm model.

Creating the Worm Gear Solid Model

The worm gear is more complex because its tooth profile is an involute curve. The construction steps are described below.

Creating the Gear Blank

We first create a cylindrical blank of diameter equal to the gear addendum circle $d_a = m(z_2 + 2)$ and width $b$. The blank is then positioned such that its axis is perpendicular to the worm axis and offset by the center distance $a$. Usually we revolve a rectangular cross-section about the gear axis, but here we simply extrude a cylinder and then cut the central bore later.

Defining the Sketch Plane for the Tooth Space

The tooth space profile must be drawn on a plane that passes through the worm axis and is parallel to the gear axis. This plane is offset from the “Top Plane” by a distance equal to the center distance $a = r_1 + r_2$. The code creates an offset plane:

boolstatus = Part.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.CreatePlaneAtOffset3 r1 + r2, False, True

Drawing the Involute Profile

On this offset plane, we compute the involute points using Equation (2) and then apply the coordinate transformation to place them correctly with respect to the gear blank. The involute is drawn as a spline through many points. The code loops over radii $r_k$ from $r_f$ to $r_a$ in small increments:

For K = 0 To N
    rk = r_b + dr * K
    alfk = Atn(Sqr(rk * rk - r_b * r_b) / r_b)
    ctak = Tan(alfk) - alfk
    x1 = rk * Sin(phi + ctak)
    y1 = rk * Cos(phi + ctak)
    x = -x1
    y = a - y1
    Part.SketchSpline N - I, x, y, 0
Next K

After the spline is drawn, we mirror it about a vertical construction line to obtain the symmetric flank of the tooth space. A tooth space is closed by two involute curves, an arc at the root and an arc at the tip (or straight lines in some approximations).

Generating the Helical Guide Curve for the Gear

The tooth space is created by sweeping the profile along a helix that corresponds to the worm thread. The gear tooth is generated by a single pass of the worm thread cutting through the gear blank. Therefore, the helix must have exactly half a turn to cut one tooth space entirely. The helix parameters: base circle diameter = worm pitch diameter $d_1$, pitch = worm axial pitch $p_x$, number of turns = 0.5. The direction must match the worm helix direction. The code:

Part.CreateCircle 0, r1 + r2, 0, r1, 0, 0
Part.InsertHelix False, False, False, True, 0, p_x / 2, p_x, 0.5, 0, 3.14159265359

Note that the circle center is at $(0, r_1+r_2)$ to position the helix coaxial with the worm axis.

Cut Sweep a Single Tooth Space

We select the tooth space profile and the helix guide curve (half‑turn) and perform a cut sweep as for the worm. This yields one helical groove in the gear blank.

Circular Pattern

Finally, the single tooth space is replicated about the gear axis using a circular pattern with $z_2$ instances. The axis of rotation is the gear axis (which is the line through the gear center perpendicular to the worm axis). After the pattern, the gear is complete. An example of the resulting gear model is shown below.




The figure illustrates a typical worm gear generated by our parametric system. All dimensions are driven by the input parameters, and the geometry updates automatically when any parameter is changed.

Key Implementation Details

Variable Handling and Error Checking

In the VBA code, all variables are explicitly declared to avoid type conflicts. We use `Double` for dimensions, `Boolean` for selection status, and `Object` for SolidWorks features. Input validation is performed to ensure non‑zero module, positive number of teeth, etc. If invalid data is entered, the program displays a message box and exits the subroutine.

Coordinate Systems and Transformations

For the worm, the sketch plane is the Y‑Z plane (Top Plane) and the helix axis is the X‑axis (Right Plane). For the gear, the sketch plane is offset along the Y‑axis. The involute points are computed in the gear’s local coordinate system (centered at the gear center) and then transformed to the global system by shifting $x \to -x$ and $y \to a + y$. This transformation aligns the tooth space with the gear blank positioned at the correct center distance.

Performance and Accuracy

Using 30–50 points per involute curve ensures smooth splines that accurately represent the true involute. The cut sweep operation in SolidWorks is robust, but we recommend using a small number of turns (0.5) to avoid self‑intersection in the gear. The circular pattern is computationally efficient; generating a gear with 60 teeth takes less than 10 seconds on a standard workstation.

Conclusion

We have developed a complete, automated parametric design system for worm gears based on SolidWorks and VBA. The system takes user‑defined parameters such as module, pressure angle, number of threads, and number of teeth, and generates accurate 3D solid models of both the worm and the worm gear. The mathematical models for the Archimedean worm thread and the involute gear tooth are implemented through explicit formulas, and the geometry is constructed using standard SolidWorks features (extrude, sweep cut, circular pattern). The resulting models are fully associative, enabling rapid design iterations. This work significantly simplifies the modeling process for worm gears, which are notoriously difficult to create manually. The generated solid models can be directly used for finite element analysis, motion simulation, and manufacturing data preparation. Future extensions could include support for other worm types (e.g., involute worm, ZK worm), automatic generation of assembly constraints, and integration with gear design optimization tools.

Scroll to Top