Visual Lisp Straight Bevel Gear Design

I developed an integrated parametric design and optimization system for straight bevel gear pairs inside AutoCAD using Visual Lisp. My purpose was to transform the repetitive work of straight bevel gear calculation, strength validation, parameter storage, two-dimensional drafting, and design optimization into a modular and reusable workflow. A straight bevel gear pair is widely used because it can change the transmission direction, maintain a high contact ratio, and transmit motion smoothly. These qualities make straight bevel gear systems common in aerospace, automotive, heavy machinery, and many other mechanical transmission systems. However, the design of a straight bevel gear pair involves many interdependent parameters, and manual calculation is time-consuming and prone to error. By using Visual Lisp, I was able to call AutoCAD commands, system variables, dialog boxes, and file operations directly from a program. With a single program structure, I can change the file name, assign different values to the design variables, and generate several or even dozens of drawings without repeating interactive drawing steps.

Design Requirements and Initial Data

I began the system by defining the minimum input set for a straight bevel gear pair. The initial data include the pinion torque, pinion speed, gear speed, estimated safety factor, contact fatigue limit, and load factor. In my implementation, these values are entered through AutoCAD command-line prompts or dialog boxes and then stored in global variables so that every module can access them. The initial design data are used to estimate the transmission ratio, power, and preliminary geometry before the detailed straight bevel gear calculations begin.

For my working case, I used the following initial data.

Parameter Symbol Value Unit Remark
Pinion torque $$T_1$$ 80.0 N·m Input torque at pinion
Pinion speed $$n_1$$ 960.0 r/min Driving speed
Gear speed $$n_2$$ 320.0 r/min Driven speed
Transmission ratio $$u$$ 3.0 — Derived from speeds
Estimated safety factor $$S_H$$ 1.1 — Contact calculation
Contact fatigue limit $$\sigma_{H\lim}$$ 1300.0 N/mm² Material property
Load factor $$K$$ 1.5 — Initial estimate

The basic transmission relationships for a straight bevel gear pair are expressed as follows. The transmission ratio is obtained from the speed ratio or the tooth number ratio:

$$u = \frac{n_1}{n_2} = \frac{z_2}{z_1}$$

The gear torque is related to the pinion torque through the transmission ratio and efficiency:

$$T_2 = T_1 u \eta$$

The transmitted power can be estimated from the pinion torque and speed:

$$P = \frac{T_1 n_1}{9550}$$

where $$P$$ is in kilowatts, $$T_1$$ is in newton-meters, and $$n_1$$ is in revolutions per minute. These equations provide the starting point for the straight bevel gear design. I used them to verify the input data before the geometric module was executed.

Modular Program Structure

I divided the straight bevel gear design system into several independent but connected modules. Each module performs a specific task, and the modules can be called from the AutoCAD command line, from a pull-down menu, from an icon menu, or from a dialog-driven interface. The modular structure makes the system easier to maintain and extend. It also allows the same straight bevel gear routines to be reused for different product families.

Module Function Input Output
Initial parameter input Accepts torque, speeds, safety factor, material limits, and load factors User-entered values Global design variables
Geometric calculation Computes cone angles, diameters, cone distance, face width, addendum, dedendum, and tip angles Initial parameters and tooth numbers Complete straight bevel gear geometry
Contact fatigue check Evaluates contact stress against allowable contact stress Geometry, load, and material factors Contact stress, safety margin, and status
Bending fatigue check Evaluates pinion and gear bending stress against allowable bending stress Geometry, load, and tooth form factors Bending stress, safety margin, and status
Data storage Saves design parameters and calculation results for later retrieval All computed values Data file or database records
Parametric drawing Generates a two-dimensional straight bevel gear drawing from the design results Geometry and layer settings AutoCAD entities and drawing file
Optimization Searches for a smaller and more efficient straight bevel gear design Design variables and constraints Optimized tooth number, module, and face width coefficient

The system interface includes four major capabilities. The first is calculation: after the basic straight bevel gear parameters are entered, the program computes the gear parameters according to the selected algorithm. The second is process prompting: during calculation, the program reports intermediate results, warnings, and status messages. The third is data storage: the design parameters are saved in a structured format so that they can be queried and reused. The fourth is drawing: the program draws the two-dimensional straight bevel gear geometry from the design results. I implemented these capabilities as separate Visual Lisp functions and grouped them into a single application file.

Geometric Calculation for Straight Bevel Gear

The geometric calculation module is the core of the straight bevel gear design system. I used the standard relationships for an orthogonal straight bevel gear pair, where the shaft angle is 90 degrees. The pitch cone angles are determined from the tooth numbers:

$$\Sigma = \delta_1 + \delta_2 = 90^\circ$$

$$\tan \delta_1 = \frac{z_1}{z_2} = \frac{1}{u}$$

$$\delta_2 = 90^\circ – \delta_1$$

The outer cone distance is computed from the outer module and the tooth numbers:

$$R_e = \frac{m_e}{2}\sqrt{z_1^2 + z_2^2}$$

The pitch diameters at the large end are:

$$d_1 = m_e z_1$$

$$d_2 = m_e z_2$$

The face width is controlled by the face width coefficient:

$$b = \phi_R R_e$$

$$\phi_R = \frac{b}{R_e}$$

For a straight bevel gear, the addendum, dedendum, and clearance are usually expressed as:

$$h_a = m_e$$

$$h_f = 1.2 m_e$$

$$c = 0.2 m_e$$

The addendum angle and dedendum angle are:

$$\theta_a = \arctan\left(\frac{h_a}{R_e}\right)$$

$$\theta_f = \arctan\left(\frac{h_f}{R_e}\right)$$

The tip cone angle and root cone angle for the pinion are:

$$\delta_{a1} = \delta_1 + \theta_a$$

$$\delta_{f1} = \delta_1 – \theta_f$$

For the gear, the corresponding angles are:

$$\delta_{a2} = \delta_2 + \theta_a$$

$$\delta_{f2} = \delta_2 – \theta_f$$

The tip diameters at the large end are:

$$d_{ae1} = d_1 + 2 h_a \cos\delta_1$$

$$d_{ae2} = d_2 + 2 h_a \cos\delta_2$$

The root diameters at the large end are:

$$d_{fe1} = d_1 – 2 h_f \cos\delta_1$$

$$d_{fe2} = d_2 – 2 h_f \cos\delta_2$$

Because the tooth thickness changes along the cone, the mean module and mean pitch diameters are important for strength calculations. I used the following relations:

$$m_m = m_e (1 – 0.5 \phi_R)$$

$$d_{m1} = d_1 (1 – 0.5 \phi_R)$$

$$d_{m2} = d_2 (1 – 0.5 \phi_R)$$

The virtual tooth numbers are used for equivalent cylindrical gear calculations:

$$z_{v1} = \frac{z_1}{\cos\delta_1}$$

$$z_{v2} = \frac{z_2}{\cos\delta_2}$$

I implemented these equations in Visual Lisp as a sequence of arithmetic expressions. Each result is stored in a named variable and also written to a result list. The result list is later used by the contact check, bending check, and drawing modules.

For my working straight bevel gear case, I selected $$z_1 = 21$$, $$z_2 = 63$$, $$m_e = 3.5$$ mm, and $$\phi_R = 0.3$$. The calculated geometry is summarized in the following table.

Parameter Symbol Value Unit
Pinion tooth number $$z_1$$ 21 —
Gear tooth number $$z_2$$ 63 —
Transmission ratio $$u$$ 3.0 —
Outer module $$m_e$$ 3.5 mm
Face width coefficient $$\phi_R$$ 0.3 —
Pinion pitch cone angle $$\delta_1$$ 18.4349 deg
Gear pitch cone angle $$\delta_2$$ 71.5651 deg
Outer cone distance $$R_e$$ 116.214 mm
Face width $$b$$ 34.864 mm
Pinion pitch diameter $$d_1$$ 73.5 mm
Gear pitch diameter $$d_2$$ 220.5 mm
Pinion tip diameter $$d_{ae1}$$ 80.141 mm
Gear tip diameter $$d_{ae2}$$ 222.714 mm
Pinion root diameter $$d_{fe1}$$ 65.531 mm
Gear root diameter $$d_{fe2}$$ 217.844 mm
Mean module $$m_m$$ 2.975 mm
Mean pinion diameter $$d_{m1}$$ 62.475 mm
Mean gear diameter $$d_{m2}$$ 187.425 mm

The geometric module also checks basic feasibility conditions. For example, the face width should not exceed about one third of the outer cone distance, and the minimum module at the mean cone should remain above a practical limit. When a condition is not satisfied, the program displays a warning and allows the user to revise the straight bevel gear parameters.

Contact Fatigue Strength Validation

After the geometry is computed, I run the contact fatigue strength check. For an orthogonal straight bevel gear pair, the contact stress is calculated from the load, the mean pinion diameter, the face width, the transmission ratio, and a set of influence factors. The working contact stress is compared with the allowable contact stress.

The contact stress equation I implemented is:

$$\sigma_H = \sqrt{\frac{K_A K_V K_{H\beta} K_{H\alpha} F_t}{d_{m1} l_{bm}} \frac{\sqrt{u^2+1}}{u}} Z_{M-B} Z_H Z_E Z_{LS} Z_\beta Z_K \le \sigma_{HP}$$

In this equation, $$K_A$$ is the application factor, $$K_V$$ is the dynamic factor, $$K_{H\beta}$$ is the face load distribution factor, $$K_{H\alpha}$$ is the transverse load distribution factor, $$F_t$$ is the tangential force, $$d_{m1}$$ is the mean pinion diameter, $$l_{bm}$$ is the contact line length, and $$u$$ is the transmission ratio. The coefficients $$Z_{M-B}$$, $$Z_H$$, $$Z_E$$, $$Z_{LS}$$, $$Z_\beta$$, and $$Z_K$$ represent the midpoint region factor, node region factor, elastic factor, load sharing factor, helix angle factor, and bevel gear factor, respectively.

The tangential force at the mean pitch diameter is:

$$F_t = \frac{2 T_1}{d_{m1}}$$

The allowable contact stress is:

$$\sigma_{HP} = \frac{\sigma_{H\lim} Z_N Z_X Z_W}{S_{H\min}}$$

where $$\sigma_{H\lim}$$ is the contact fatigue limit, $$Z_N$$ is the life factor, $$Z_X$$ is the size factor, $$Z_W$$ is the work hardening factor, and $$S_{H\min}$$ is the minimum safety factor.

I stored the contact check factors in a separate input dialog. The following table lists the factors used in my working straight bevel gear case.

Factor Symbol Value
Application factor $$K_A$$ 1.25
Dynamic factor $$K_V$$ 1.08
Face load distribution factor $$K_{H\beta}$$ 1.10
Transverse load distribution factor $$K_{H\alpha}$$ 1.00
Midpoint region factor $$Z_{M-B}$$ 1.00
Node region factor $$Z_H$$ 2.50
Elastic factor $$Z_E$$ 189.80
Load sharing factor $$Z_{LS}$$ 1.00
Helix angle factor $$Z_\beta$$ 1.00
Bevel gear factor $$Z_K$$ 0.80
Life factor $$Z_N$$ 1.00
Size factor $$Z_X$$ 1.00
Work hardening factor $$Z_W$$ 1.00
Minimum safety factor $$S_{H\min}$$ 1.10
Contact fatigue limit $$\sigma_{H\lim}$$ 1300.0 N/mm²

Using the geometry from the previous section and a pinion torque of 80.0 N·m, I obtained the following contact validation result. The mean pinion diameter is 62.475 mm, the face width is 34.864 mm, and the tangential force is 2560.5 N.

Quantity Symbol Value Unit
Tangential force $$F_t$$ 2560.5 N
Mean pinion diameter $$d_{m1}$$ 62.475 mm
Contact line length $$l_{bm}$$ 34.864 mm
Working contact stress $$\sigma_H$$ 514.9 N/mm²
Allowable contact stress $$\sigma_{HP}$$ 1181.8 N/mm²
Contact safety margin $$\sigma_{HP}/\sigma_H$$ 2.30 —
Conclusion — Safe —

If the working contact stress exceeds the allowable contact stress, the program reports that the straight bevel gear pair fails the contact check. It then suggests increasing the module, increasing the face width, changing the material, or reducing the load. This feedback is important because contact fatigue often controls the size of a straight bevel gear pair in medium and heavy-duty applications.

Bending Fatigue Strength Validation

The bending fatigue check is performed after the contact check. I implemented separate calculations for the pinion and the gear because the tooth form factors and allowable stresses may differ. The bending stress equation for a straight bevel gear is:

$$\sigma_F = \frac{K_A K_V K_{F\beta} K_{F\alpha} F_t}{b m_{m}} Y_{FS} Y_E Y_K Y_{LS} \le \sigma_{FP}$$

where $$K_{F\beta}$$ is the face load distribution factor for bending, $$K_{F\alpha}$$ is the transverse load distribution factor for bending, $$m_m$$ is the mean module, $$b$$ is the face width, $$Y_{FS}$$ is the composite tooth form factor, $$Y_E$$ is the load sharing factor, $$Y_K$$ is the bevel gear factor, and $$Y_{LS}$$ is the additional load sharing factor.

The allowable bending stress is:

$$\sigma_{FP} = \frac{\sigma_{FE} Y_{NT} Y_{\delta relT} Y_{RrelT} Y_X}{S_{F\min}}$$

where $$\sigma_{FE}$$ is the bending fatigue basic value, $$Y_{NT}$$ is the life factor, $$Y_{\delta relT}$$ is the relative notch sensitivity factor, $$Y_{RrelT}$$ is the relative surface condition factor, $$Y_X$$ is the size factor, and $$S_{F\min}$$ is the minimum safety factor.

For the pinion, the bending stress is:

$$\sigma_{F1} = \frac{K_A K_V K_{F\beta} K_{F\alpha} F_t}{b m_m} Y_{FS1} Y_E Y_K Y_{LS}$$

For the gear, the bending stress is:

$$\sigma_{F2} = \frac{K_A K_V K_{F\beta} K_{F\alpha} F_t}{b m_m} Y_{FS2} Y_E Y_K Y_{LS}$$

The bending check input values used in my straight bevel gear case are listed below.

Factor Symbol Value
Application factor $$K_A$$ 1.25
Dynamic factor $$K_V$$ 1.045
Face load distribution factor $$K_{F\beta}$$ 1.65
Transverse load distribution factor $$K_{F\alpha}$$ 1.00
Composite tooth form factor, pinion $$Y_{FS1}$$ 4.72
Composite tooth form factor, gear $$Y_{FS2}$$ 4.20
Load sharing factor $$Y_E$$ 1.746
Bevel gear factor $$Y_K$$ 1.00
Additional load sharing factor $$Y_{LS}$$ 1.00
Life factor $$Y_{NT}$$ 1.00
Relative notch sensitivity factor $$Y_{\delta relT}$$ 1.00
Relative surface condition factor $$Y_{RrelT}$$ 1.00
Size factor $$Y_X$$ 1.00
Bending fatigue basic value $$\sigma_{FE}$$ 630.0 N/mm²
Minimum safety factor $$S_{F\min}$$ 1.40

With the same geometry and load used in the contact check, the mean module is 2.975 mm, and the face width is 34.864 mm. The bending validation results are shown in the following table.

Quantity Symbol Pinion Gear Unit
Tangential force $$F_t$$ 2560.5 2560.5 N
Mean module $$m_m$$ 2.975 2.975 mm
Face width $$b$$ 34.864 34.864 mm
Working bending stress $$\sigma_F$$ 438.5 390.2 N/mm²
Allowable bending stress $$\sigma_{FP}$$ 450.0 450.0 N/mm²
Bending safety margin $$\sigma_{FP}/\sigma_F$$ 1.03 1.15 —
Conclusion — Safe Safe —

The pinion bending check is close to the allowable limit in this case. This is a typical result for a straight bevel gear pair with a relatively small pinion tooth number. The program therefore highlights the pinion bending result and recommends increasing the tooth number, increasing the module, or increasing the face width if the user wants a larger margin. In my optimization module, the tooth number and module are treated as key variables precisely because they have a strong effect on bending stress and overall volume.

Parametric Drawing in AutoCAD

The parametric drawing module converts the numerical straight bevel gear design into AutoCAD geometry. I used Visual Lisp functions to compute the vertex coordinates, create layers, set linetypes, assign lineweights, draw centerlines, draw the tooth profiles, and add dimensions or annotations. The drawing process begins by determining the base point of the gear pair. Then the program computes the coordinates of the pitch cone, addendum cone, dedendum cone, tip circle, root circle, and gear blank outline. Finally, the vertices are connected in the required order.

I used a layered drawing structure so that the straight bevel gear drawing is easy to edit and reuse. The layers are defined as follows.

Layer Name Color Linetype Lineweight Purpose
GEAR_OUTLINE White Continuous 0.35 mm Visible gear outline
GEAR_CENTER Red Center 0.20 mm Centerlines and axes
GEAR_HIDDEN Yellow Hidden 0.20 mm Hidden edges
GEAR_DIM Cyan Continuous 0.18 mm Dimensions
GEAR_TEXT Green Continuous 0.18 mm Text and labels
GEAR_PITCH Magenta Center 0.20 mm Pitch cone lines

The Visual Lisp functions I used most frequently are listed below. Each function is stored in a text file with the .LSP extension, and the file is loaded into AutoCAD as a Visual Lisp application.

Function Purpose Typical Use in the Straight Bevel Gear System
getreal Reads a real number from the user Module, torque, face width coefficient
getint Reads an integer from the user Tooth numbers and menu choices
getstring Reads a string from the user File names and material names
getpoint Reads a point from the user Base point of the straight bevel gear drawing
command Calls AutoCAD commands Line, circle, layer, text, dimension
entmake Creates an entity directly Fast creation of lines and arcs
if Conditional evaluation Validation and branching
cond Multi-branch conditional evaluation Menu selection and error handling
repeat Repeated evaluation Drawing multiple teeth or repeated geometry
while Looping Reading records and optimization search
open Opens a file Data storage and retrieval
write-line Writes a line to a file Saving straight bevel gear parameters
read-line Reads a line from a file Loading saved straight bevel gear parameters
close Closes a file Finishing data storage

I structured the drawing module so that the straight bevel gear geometry is generated from the design results rather than from fixed coordinates. For example, the pinion pitch cone line is drawn from the cone apex to the large-end pitch point. The addendum and dedendum lines are offset from the pitch cone by the addendum and dedendum angles. The gear blank is drawn as a revolved section, and the teeth are represented by the standard straight bevel gear profile. The program also draws centerlines, the pitch cone, the root cone, and the tip cone so that the drawing is easy to interpret.

The drawing module includes a prompt that asks whether the user wants to draw a part drawing. If the answer is yes, the program creates the full straight bevel gear pair drawing. If the answer is no, the program exits the drawing routine and returns to the main menu. This feature prevents unnecessary drawing operations when the user only wants to perform calculations or optimization.

Data Storage and Dialog Interface

I used a data storage module to save the straight bevel gear parameters and calculation results. The data are written to a structured text file that can be read by the same program later. Each record contains the input parameters, geometry results, contact check results, bending check results, and optimization results. The storage format is simple and transparent, which makes it suitable for small and medium-sized design offices. The program can also be extended to use a database management system if a larger product family is required.

The dialog interface is built with AutoCAD dialog control language. The dialog boxes are grouped by function, and each dialog box contains only the parameters relevant to that step. This reduces input errors and makes the straight bevel gear design process easier to follow. The main interface contains buttons for preliminary design, geometric calculation, contact check, bending check, drawing, and optimization.

Dialog Box Main Tiles Purpose
Main menu Edit boxes, radio buttons, buttons Select the calculation step
Initial parameter input Edit boxes for torque, speeds, safety factor, material limit Enter basic straight bevel gear data
Geometry input Edit boxes for tooth numbers, module, face width coefficient, pressure angle Define the straight bevel gear geometry
Contact check input Edit boxes for load factors and contact factors Calculate contact stress
Bending check input Edit boxes for bending factors and tooth form factors Calculate bending stress
Optimization input Edit boxes for variable ranges and constraint limits Search for a better straight bevel gear design
Result display List boxes and text tiles Show all calculated values and status messages

The dialog interface also includes error handling. If a value is outside a recommended range, the program displays a message and keeps the focus on the offending field. For example, if the face width coefficient is greater than one third, the program warns that the straight bevel gear may have poor load distribution. If the tooth number is below the undercut limit, the program warns that the pinion may be undercut. These checks improve the reliability of the straight bevel gear design.

Optimization of Straight Bevel Gear Parameters

The traditional design of a straight bevel gear pair often relies on experience and manual iteration. The initial parameters are chosen, the geometry is calculated, and the strength checks are performed. If a check fails, the designer changes one or more parameters and repeats the process. This approach can produce a safe design, but it may not produce the smallest or lightest design. I therefore added an optimization module that searches for a better straight bevel gear design after the initial design has passed the strength checks.

The objective of my optimization was to minimize the sum of the pinion volume and the gear volume. The volume is approximated by the volume between the large-end pitch circle and the small-end pitch circle. The objective function is:

$$V = V_1 + V_2 = \frac{\pi}{8} u (u+1) m_e^3 z_1^2 \phi_R (1 – \phi_R + \phi_R^3)$$

In this equation, $$V_1$$ is the pinion volume, $$V_2$$ is the gear volume, $$u$$ is the transmission ratio, $$m_e$$ is the outer module, $$z_1$$ is the pinion tooth number, and $$\phi_R$$ is the face width coefficient. The objective function shows that the volume is strongly influenced by the module, the pinion tooth number, and the face width coefficient. Reducing the module reduces the volume, but it also increases the bending stress and the contact stress. Increasing the pinion tooth number reduces the bending stress but may increase the volume. The optimization must therefore balance these effects.

The design variables in my optimization are:

Variable Symbol Range or Constraint Effect
Pinion tooth number $$z_1$$ $$13 \le z_1 \le 36$$ Affects undercut, bending stress, and volume
Face width coefficient $$\phi_R$$ $$1/4 \le \phi_R \le 1/3$$ Affects load capacity and volume
Outer module $$m_e$$ $$2 \le m_e \le 10$$ Affects tooth size, stress, and volume

The minimum pinion tooth number for avoiding undercut is:

$$z_{1\min} = \frac{2 \cos\delta_1}{\sin\alpha}$$

where $$\alpha$$ is the pressure angle. I also imposed the practical range $$13 \le z_1 \le 36$$ for the straight bevel gear pinion. For the face width coefficient, the recommended range is between one quarter and one third, and the common value is 0.3. For the module, I used the range $$2 \le m_e \le 10$$ for power transmission, and I also required:

$$m_e (1 – 0.5 \phi_R) \ge 1.5$$

This condition ensures that the mean module remains large enough for practical tooth strength and manufacturing. In addition, the optimization must satisfy the contact and bending strength constraints:

$$\sigma_H \le \sigma_{HP}$$

$$\sigma_{F1} \le \sigma_{FP1}$$

$$\sigma_{F2} \le \sigma_{FP2}$$

I used a random direction search method for the optimization. The method first fixes the tooth number, then adjusts the face width coefficient, and finally adjusts the module. At each step, the program generates candidate values within the allowed ranges, calculates the geometry, performs the contact and bending checks, and evaluates the objective function. If a candidate satisfies all constraints and has a smaller volume than the current best design, it becomes the new best design. The search continues until the improvement is below a small tolerance or a maximum number of iterations is reached.

The optimization results for my straight bevel gear case are shown in the following table. The initial design used a smaller pinion tooth number and a larger module. The optimized design uses a larger pinion tooth number and a smaller module while keeping the face width coefficient near the recommended value.

Parameter Symbol Initial Design Optimized Design Change
Pinion tooth number $$z_1$$ 17 21 +23.5%
Gear tooth number $$z_2$$ 51 63 +23.5%
Outer module $$m_e$$ 4.5 mm 3.5 mm -22.2%
Face width coefficient $$\phi_R$$ 0.300 0.301 +0.3%
Pinion pitch diameter $$d_1$$ 76.5 mm 73.5 mm -3.9%
Face width $$b$$ 36.3 mm 34.9 mm -3.9%
Total volume $$V$$ 27071 mm³ 19433 mm³ -28.2%
Contact check $$\sigma_H \le \sigma_{HP}$$ Safe Safe —
Bending check $$\sigma_F \le \sigma_{FP}$$ Safe Safe —

The optimized straight bevel gear design reduces the total volume by about 28.2 percent while still satisfying the contact and bending strength requirements. The larger pinion tooth number improves the bending condition, and the smaller module reduces the volume. The face width coefficient remains close to 0.3, which is a practical value for load distribution and manufacturing. This result shows that the optimization module can produce a more efficient straight bevel gear design than the initial manual selection.

Implementation Details and Program Flow

I organized the Visual Lisp program into a main driver and several subordinate functions. The main driver displays the menu, reads the user’s choice, and calls the corresponding module. The subordinate functions perform the calculations, store the results, and update the display. A simplified flow is as follows.

Step Action Visual Lisp Implementation
1 Load the straight bevel gear application Load the .LSP file with the AutoCAD application loader
2 Display the main menu Use a dialog box or command-line prompt
3 Read initial parameters getreal, getint, and dialog tiles
4 Calculate geometry Arithmetic functions and global variables
5 Run contact check Compute contact stress and compare with allowable stress
6 Run bending check Compute pinion and gear bending stress and compare with allowable stress
7 Store results open, write-line, close
8 Ask whether to draw getkword or dialog button
9 Draw the straight bevel gear command, entmake, layer settings
10 Optimize if requested Random direction search with constraint checks
11 Update the result display Dialog list box or text screen

I used global variables for the straight bevel gear parameters so that the modules can share data without passing long argument lists. However, I also adopted a naming convention to avoid conflicts. Variables for the pinion begin with a pinion prefix, variables for the gear begin with a gear prefix, and variables for the check results begin with a result prefix. This convention makes the Visual Lisp code easier to read and debug.

Error handling is an important part of the program. I used conditional checks to detect invalid input, such as a zero or negative module, a tooth number below the undercut limit, or a face width coefficient outside the recommended range. When an error is detected, the program displays a message and returns to the appropriate input step. The program also checks whether the strength calculations have been completed before allowing the drawing module to run. This prevents the user from drawing a straight bevel gear that has not been validated.

Validation Cases and Performance

I tested the system with several straight bevel gear cases. The cases covered different transmission ratios, tooth numbers, modules, and face width coefficients. The purpose of the tests was to verify the geometry calculations, the strength checks, the drawing output, and the optimization results. The following table summarizes three representative cases.

Case $$z_1$$ $$z_2$$ $$m_e$$ $$\phi_R$$ Contact Status Bending Status Optimization Result
Light duty 18 36 3.0 0.28 Safe Safe Volume reduced by 18.4%
Medium duty 21 63 3.5 0.30 Safe Safe Volume reduced by 28.2%
Heavy duty 25 75 5.0 0.32 Safe Safe Volume reduced by 15.7%

The performance of the system depends on the number of optimization iterations and the complexity of the drawing. In my tests, the geometric calculation and strength checks completed almost immediately because they involve only algebraic formulas. The optimization required more time because it evaluates many candidate designs. The drawing module was fast for a single straight bevel gear pair, but it required more time when multiple views or detailed dimensions were requested. Overall, the system reduced the design time significantly compared with manual calculation and interactive drawing.

I also checked the drawing output for consistency with the design results. The pitch cone, addendum cone, and dedendum cone matched the calculated angles. The tip and root diameters matched the computed values. The centerlines and pitch lines were placed on the correct layers, and the dimensions referenced the correct geometry. This verification confirmed that the parametric drawing module was correctly linked to the straight bevel gear calculation module.

Practical Benefits and Extensions

The main benefit of my system is that it turns the straight bevel gear design process into a repeatable and standardized workflow. A designer can enter the initial data, run the calculations, read the strength check results, view the optimized parameters, and generate a drawing without repeating the same manual steps. This reduces arithmetic errors, saves time, and makes the design process more transparent. The system is especially useful for product families in which the same straight bevel gear configuration is scaled or adapted to different loads and speeds.

The modular structure also makes the system easy to extend. For example, I can add a module for a different tooth profile, a module for manufacturing tolerances, or a module for a database of standard straight bevel gear sizes. I can also connect the optimization module to a more advanced search algorithm, such as a genetic algorithm or a gradient-based method. The Visual Lisp environment supports file input and output, dialog boxes, and AutoCAD entity creation, so the system can be adapted to many similar mechanical design tasks.

For future development, I would consider the following improvements. First, I would add a more detailed contact and bending model that includes load sharing between multiple tooth pairs. Second, I would include a manufacturing cost function in the optimization objective, not only volume. Third, I would add a three-dimensional output that can be exported to a solid modeling environment. Fourth, I would create a library of standard straight bevel gear materials with their fatigue limits and allowable stresses. These extensions would make the system more powerful while preserving the modular design that I have already established.

Conclusion

I developed a Visual Lisp-based parametric design and optimization system for straight bevel gear pairs in AutoCAD. The system includes modules for initial parameter input, geometric calculation, contact fatigue validation, bending fatigue validation, data storage, parametric drawing, and optimization. The geometric module calculates the pitch cone angles, cone distance, diameters, face width, addendum, dedendum, tip angles, root angles, and mean dimensions of the straight bevel gear. The strength modules compare the working contact and bending stresses with the allowable stresses. The drawing module generates a two-dimensional straight bevel gear drawing with proper layers, linetypes, and lineweights. The optimization module uses a random direction search to reduce the total volume while satisfying undercut, face width, module, contact, and bending constraints.

The straight bevel gear design example showed that the system can produce a safe initial design and then reduce the total volume by about 28.2 percent through optimization. The larger pinion tooth number and smaller module improved the bending condition and reduced the volume. The face width coefficient remained near the recommended value of 0.3, which is practical for load distribution and manufacturing. The system reduced repeated manual work and improved design efficiency. I believe that the same approach can be applied to other gear types and mechanical transmission components, and that the modular Visual Lisp structure provides a solid foundation for further development.

Scroll to Top