In my experience as a mechanical design engineer, I have often encountered the challenge of creating accurate and efficient models for screw gear systems, which are crucial components in power transmission applications involving non-parallel, non-intersecting shafts. The traditional manual modeling approaches within CAD environments are notoriously tedious, time-consuming, and prone to human error, especially for complex geometries like those of worm gears and worm wheels. This inefficiency consumes significant human and material resources. To address this, I have explored the capabilities of AutoLISP, the embedded programming language within AutoCAD, to develop a parametric modeling paradigm. AutoLISP, stemming from the LISP family of languages known for symbolic processing, provides a powerful platform for customizing and automating design tasks in AutoCAD. This article details my methodology for achieving high-precision, high-quality, and highly efficient modeling of screw gears through geometric parameterization on the AutoLISP platform.
The screw gear drive, specifically the worm and worm wheel pair, transmits motion and torque between shafts positioned at 90 degrees in space. The worm is essentially a threaded shaft with a defined module, and its profile generation is analogous to that of a screw thread but with a specific tooth form. The worm wheel is the mating gear, designed to mesh precisely with the worm. Based on their geometry and manufacturing method, screw gear drives can be classified into several types, as summarized in Table 1. My modeling focus here is primarily on the cylindrical, Archimedean type, which is common and defined by a straight-sided tooth profile in the axial plane.
| Classification Basis | Types |
|---|---|
| By Shape | Cylindrical Worm, Cone Worm, Globoid Worm |
| By Manufacturing/Profile | Archimedean Worm, Involute Worm, Straight-Sided Normal Worm |
| By Tooth Surface Geometry | Standard Worm, Circular Arc Worm, Cylindrical Worm |
The core of parametric modeling lies in a comprehensive analysis of the geometric parameters. For a screw gear pair, the parameters are numerous and interdependent, governing every aspect of the worm, the worm wheel, and their assembly. A thorough breakdown is essential for algorithmic implementation. Table 2 provides a detailed list of these critical geometric parameters for both the worm and the worm wheel components. Successfully modeling a screw gear requires precise handling of all these parameters.
| Component | Geometric Parameters |
|---|---|
| Worm Structure | Module (m), Number of Threads/Starts (z1) |
| Axial Pitch (p_a), Pressure Angle (α) | |
| Addendum (h_a1), Dedendum (h_f1) | |
| Tip Diameter (d_a1), Root Diameter (d_f1) | |
| Axial Tooth Thickness (s_a1) | |
| Length of Threaded Portion (L1) | |
| Worm Wheel Structure | Number of Teeth (z2), Face Width (b2) |
| Tooth Thickness, Addendum (h_a2), Dedendum (h_f2) | |
| Throat Diameter (d_a2), Root Diameter (d_f2) | |
| Pitch Diameter (d_2), Wrap Angle (γ) | |
| Other dimensions like rim diameter, hub dimensions. | |
| Ancillary Structures | Worm shaft journal dimensions (d_j1, L_j1). Worm wheel hub, web, and rim dimensions (d_hub, L_hub, d_rim, t_web). |
The relationships between these parameters are defined by standard gear geometry formulas. For instance, the axial pitch of the worm is directly related to the module: $$p_a = \pi m$$. The pitch diameter of the worm (d1) is not standard but often related to a factor: $$d_1 = q m$$, where ‘q’ is the diameter factor. The addendum and dedendum are typically: $$h_a = m$$ and $$h_f = 1.2m$$ for the worm, and $$h_{a2} = m$$ and $$h_{f2} = 1.2m$$ for the worm wheel in the throat section. The center distance (a) between the worm and worm wheel axes is critical: $$a = \frac{d_1 + d_2}{2}$$, where $$d_2 = m z_2$$ is the pitch diameter of the worm wheel. These formulas are the bedrock of the parametric model for the screw gear system.
My implementation of the screw gear modeling paradigm in AutoLISP follows a structured, step-by-step approach, breaking down the complex task into manageable algorithms for the worm and the worm wheel separately, then combining them.
Worm Modeling Algorithm
The modeling of the Archimedean worm is analogous to cutting a thread on a cylinder. The conceptual method involves creating a cylindrical blank and a “cutting tool” in the form of a tooth profile (a trapezoid representing the worm thread space), then performing a helical Boolean subtraction. In AutoLISP, this is achieved through coordinate transformations, entity creation, and command automation.
First, the program interactively prompts for key input parameters or can read them from a data file. These define the specific screw gear to be modeled.
Step 1: Parameter Initialization and Base Cylinder Creation. The AutoLISP function begins by setting variables. For example:
(defun c:wormmodel () (setq m (getreal "\nEnter worm module (m): ")) (setq q (getreal "\nEnter diameter factor (q): ")) (setq z1 (getint "\nEnter number of worm starts (z1): ")) (setq L1 (getreal "\nEnter worm threaded length (L1): ")) (setq alpha (getreal "\nEnter pressure angle in degrees (α): ")) ; Calculate derived dimensions (setq d1 (* q m)) ; Worm pitch diameter (setq da1 (+ d1 (* 2 m))) ; Worm tip diameter (setq p01 (getpoint "\nSpecify base point for worm: ")) )
After calculating dimensions like the tip radius (`r_tip = da1 / 2`), the program creates the main cylindrical blank for the worm on a specific layer.
Step 2: Creating the Cutting Tool (Tooth Space Profile). This is the most critical geometric operation. The worm’s axial tooth profile is an isosceles trapezoid. For an Archimedean worm with pressure angle α, the tooth width at the pitch line is $$s_{a1} = \frac{p_a}{2} = \frac{\pi m}{2}$$. The half-angle of the tooth profile is equal to the pressure angle α. The coordinates of the trapezoid vertices are calculated based on the addendum, dedendum, and pressure angle. The profile is drawn in a plane normal to the worm axis, then extruded along a short path to create a 3D solid “tooth remover” or cutting tool. The following formulas govern the profile dimensions:
$$ h_{a1} = m $$
$$ h_{f1} = 1.2m $$
$$ \text{Tooth thickness at pitch line} = s_{a1} = \frac{\pi m}{2} $$
The side slope is determined by the pressure angle α, so the width at the tip and root can be calculated using trigonometry: $$ \text{Width offset} = h \times \tan(\alpha) $$, where h is the addendum or dedendum.
Step 3: Helical Subtraction Process. To simulate the thread, the cutting tool must be copied and moved along a helical path around the worm cylinder. This is achieved by a loop that repeatedly: (a) copies the cutting tool solid, (b) moves it a distance equal to the axial pitch divided by the number of steps per turn in the axial direction, (c) rotates it around the worm axis by a corresponding angle (e.g., 360°/steps per turn), and (d) performs a Boolean subtraction (`subtract` command) of the tool from the worm blank. The number of steps determines the smoothness of the generated screw gear thread. For a multi-start worm, the initial angular offset between starts must be considered (e.g., 360°/z1). The core algorithm snippet resembles:
(setq steps 36) ; Steps per full revolution (setq ang_inc (/ 360.0 steps)) (setq ax_inc (/ pa steps)) (setq tool (entlast)) ; The cutting tool solid (command "ucs" "world") (setq i 0) (while (< i (* z1 L1 pa)) ; Loop for full threaded length (command "copy" tool "" p_base p_base) ; Copy tool (setq tool_copy (entlast)) ; Move and rotate tool_copy (command "move" tool_copy "" '(0 0 0) (list 0 0 ax_inc)) (command "rotate" tool_copy "" p_axis ang_inc) ; Subtract from worm blank (command "subtract" worm_blank "" tool_copy "") (setq i (+ i ax_inc)) )
Step 4: Finishing the Worm Model. After the helical subtraction, the reference cutting tool is deleted. Then, the shaft journals (cylindrical extensions at both ends of the worm) are created based on input parameters for journal diameter and length. A final union operation yields the complete worm solid model. This automated process ensures that any change in the primary parameters (like module or number of starts) instantly regenerates a geometrically correct worm model for the screw gear assembly.

Worm Wheel Modeling Algorithm
Modeling the worm wheel is more complex due to its throated shape designed to envelope the worm. My approach uses the concept of a generating worm (similar to a hob) to cut the teeth into a wheel blank. The process involves creating a preliminary worm (with slightly enlarged tip diameter for clearance), a wheel blank, and then performing a series of Boolean operations.
Step 1: Parameter Input for Worm Wheel. The program collects worm wheel specific parameters: number of teeth (z2), face width (b2), throat diameter (da2), hub dimensions, rim dimensions, and the wrap angle (γ). Many dimensions are derived from the worm parameters and standard relations, such as: $$ d_2 = m z_2 $$, and the throat radius of the worm wheel is $$ r_{a2} = a – \frac{d_{a1}}{2} $$, where ‘a’ is the center distance.
Step 2: Creating the Wheel Blank and Throat Surface. The worm wheel blank starts as a simple cylinder with diameter equal to the outside diameter (da2 + 2m) and width b2. The next crucial step is to create the inner throat surface, which is a toroidal segment. This is achieved by subtracting a large cylinder or a torus section from the blank, forming the concave space that wraps around the worm. The geometry of this throat is defined by the worm’s tip diameter and the wrap angle γ (typically 90°-120°). The wrap angle determines the angular extent of the worm wheel teeth that are in contact with the worm, a key factor in the load capacity of the screw gear set.
Step 3: Simulating the Hobbing Process with Boolean Subtraction. This is the core of the worm wheel modeling algorithm. A “hob” model, identical to the finished worm but often with a slightly larger tip diameter (e.g., 1.2m addendum), is created or referenced. The worm wheel blank and the hob are positioned at the correct center distance. Then, a dual-loop process simulates the indexing and hobbing:
- The outer loop rotates the worm wheel blank incrementally (simulating indexing for each tooth space). The angular increment is $$ \theta_{index} = \frac{360^\circ}{z_2} $$.
- For each indexed position, an inner loop rotates the hob model through a full revolution (or the wrap angle) while keeping the wheel stationary. At each small angular step of the hob, a copy of the hob is subtracted from the wheel blank. This replicates the material removal as if a hob were rotating and feeding into the wheel.
Mathematically, if the hob rotates by an angle φ, its axial movement relative to the wheel is coupled for a single-start hob: $$ \text{Axial movement} = \frac{p_a \cdot \phi}{360^\circ} $$. The Boolean subtraction at each step gradually carves out the tooth spaces. The following formula relates the worm wheel tooth geometry to the hob motion: The generated tooth profile is the envelope of successive positions of the hob thread. This process, though computationally intensive in AutoLISP due to many Boolean operations, creates an accurate model of the worm wheel teeth. The code structure involves nested `while` loops for indexing and hobbing rotation.
(setq z2 40) ; Worm wheel teeth
(setq index_ang (/ 360.0 z2))
(setq hob_ang_inc 10) ; Degrees per hobbing step
(setq wheel_blank (entlast)) ; The wheel blank with throat
(setq hob (entlast)) ; The generating worm solid
(setq j 0)
(while (< j z2) ; Indexing loop
(setq phi 0)
(while (<= phi wrap_angle) ; Hobbing rotation loop
; Copy the hob
(command "copy" hob "" hob_base hob_base)
(setq hob_copy (entlast))
; Rotate the hob copy by phi around its axis
(command "rotate" hob_copy "" worm_axis phi)
; Position hob relative to wheel at center distance 'a'
; Subtract from wheel blank
(command "subtract" wheel_blank "" hob_copy "")
(setq phi (+ phi hob_ang_inc))
)
; Index the wheel blank for next tooth space
(command "rotate" wheel_blank "" wheel_axis index_ang)
(setq j (+ j 1))
)
Step 4: Adding Hub, Web, and Rim Features. After the teeth are generated, the model is completed by adding the central hub, any connecting web (spoke structure), and the outer rim. This involves creating additional cylinders and performing unions or subtractions. Finally, the shaft hole is created by subtracting a cylinder of the bore diameter from the hub. The generating hob model is then deleted, leaving a fully defined worm wheel solid, perfectly mated to the worm model for the screw gear assembly.
To illustrate the parameter relationships central to this screw gear modeling paradigm, Table 3 consolidates the fundamental design formulas used in the AutoLISP algorithms.
| Parameter | Formula | Description |
|---|---|---|
| Axial Pitch (p_a) | $$p_a = \pi m$$ | Distance between corresponding points on adjacent threads, measured axially. |
| Lead (L) | $$L = p_a \cdot z_1$$ | Axial distance the worm thread advances in one full revolution. |
| Worm Pitch Diameter (d1) | $$d_1 = q \cdot m$$ | q is the diameter quotient, a key design factor for the screw gear. |
| Worm Tip Diameter (d_{a1}) | $$d_{a1} = d_1 + 2m$$ | For standard addendum = m. |
| Worm Root Diameter (d_{f1}) | $$d_{f1} = d_1 – 2.4m$$ | For standard dedendum = 1.2m. |
| Wheel Pitch Diameter (d2) | $$d_2 = m \cdot z_2$$ | Standard gear relation for the worm wheel. |
| Center Distance (a) | $$a = \frac{d_1 + d_2}{2}$$ | Critical assembly dimension for the screw gear pair. |
| Wheel Throat Diameter (d_{a2}) | $$d_{a2} = d_2 + 2m$$ | Diameter at the root of the worm wheel teeth in the throat. |
| Wheel Throat Radius (r_{a2}) | $$r_{a2} = a – \frac{d_{a1}}{2}$$ | Radius of the toroidal throat surface. |
| Wrap Angle (γ) | Typically 90° to 120° | Angular contact length of the worm wheel around the worm. |
The AutoLISP implementation encapsulates these formulas into variables, allowing for dynamic recalculation. For instance, changing the module `m` triggers a cascade of updates to all dependent dimensions, enabling instant regeneration of the entire screw gear model. This parametric associativity is the cornerstone of the methodology’s efficiency.
In conclusion, developing this parametric modeling paradigm for screw gears using AutoLISP has proven to be a transformative approach in my design workflow. Compared to traditional manual CAD modeling, the AutoLISP-driven method offers unparalleled advantages: it drastically reduces modeling time from hours to minutes, eliminates repetitive manual steps and associated errors, ensures consistent geometric accuracy based on mathematical formulas, and facilitates easy design iteration by modifying a few key parameters. The ability to programmatically control every aspect of the worm and worm wheel geometry allows for the exploration of optimized screw gear designs that meet specific load, space, or efficiency requirements. For screw gear pairs with a high number of teeth, the algorithm can be optimized by adjusting the number of cutting steps (reducing face count in the Boolean operations) to balance model accuracy and computational performance. Future enhancements could involve integrating this AutoLISP routine with a graphical user interface (GUI) for easier parameter input, extending the library to include other screw gear types like globoid or double-enveloping worms, and incorporating stress analysis modules. Ultimately, this work demonstrates that leveraging the power of embedded scripting languages like AutoLISP for geometric parameterization is a highly effective strategy for advancing computer-aided design in mechanical engineering, particularly for complex components such as screw gears.
