Simulating Gear Meshing and Kinematics in FreeCAD
Simulating gear meshing and kinematics in FreeCAD allows you to verify gear ratios, check tooth clearances, and visualize rotational movement before manufacturing. This guide walks through generating geometrically accurate gears with the FCGear workbench, positioning them precisely using pitch circle calculations, and configuring a dynamic kinematic simulation using the Assembly4 workbench and mathematical expressions.
Step 1: Install Required Workbenches
FreeCAD uses add-on workbenches to handle specialized tasks like parametric gear generation and kinematic assembly.
- Open FreeCAD and navigate to Tools > Addon Manager.
- Locate and install FCGear (for generating accurate involute gear profiles).
- Locate and install Assembly4 (for coordinate systems, assemblies, and kinematic animation).
- Restart FreeCAD to load the new workbenches.
Step 2: Generate Compatible Gears
Proper meshing requires both gears to share identical tooth profile parameters.
- Switch to the FCGear workbench.
- Click Involute Gear to create the driver gear (Gear 1).
- In the Property panel, define the parameters:
- module: Set a standard value (e.g.,
2.0). - teeth: Set the number of teeth (e.g.,
20). - pressure_angle: Keep the standard
20 deg. - height: Set your desired gear thickness.
- module: Set a standard value (e.g.,
- Repeat the process to generate the driven gear (Gear 2), keeping the
module (
2.0) and pressure_angle (20 deg) identical, while altering the tooth count (e.g.,40).
Step 3: Calculate the Center Distance
Gears will only mesh correctly if their rotational axes are placed at the exact pitch diameter distance.
Use the center-distance formula:
Distance (\(a\)) = \(\frac{m \times (z_1 +
z_2)}{2}\)
- \(m\) = module
- \(z_1\) = teeth on Gear 1
- \(z_2\) = teeth on Gear 2
For a module of 2.0 with 20 and 40 teeth:
\(a = \frac{2.0 \times (20 + 40)}{2} =
60\text{ mm}\)
Step 4: Create the Kinematic Assembly
- Create a new document and switch to the Assembly4 workbench.
- Click New Model to initialize an Assembly4 container.
- Add a variable to drive the animation:
- In the tree view, select Variables.
- Right-click and choose Add variable. Name it
Angleand set its type toFloat.
- Create the attachment points:
- Select the Model and click New Coordinate System
(LCS). Name it
LCS_Gear1and place it at(0, 0, 0). - Create a second LCS named
LCS_Gear2. Set its X translation to the calculated center distance (e.g.,60 mm).
- Select the Model and click New Coordinate System
(LCS). Name it
Step 5: Link Gears and Apply Kinematic Expressions
- Insert Gear 1 into the assembly using Insert Part.
- Attach Gear 1 to
LCS_Gear1. - In the properties of Gear 1's placement or coordinate attachment,
locate the Z-axis rotation field and enter the expression:
Variables.Angle - Insert Gear 2 and attach it to
LCS_Gear2. - For Gear 2, external spur gears rotate in opposite directions
proportional to the gear ratio (\(z_1 /
z_2\)). Set the Z-axis rotation expression to:
-Variables.Angle * (20 / 40) + Offset
(ReplaceOffsetwith a manual angle value, such as9 deg, to align tooth valleys and peaks so the teeth do not overlap).
Step 6: Run the Kinematic Simulation
- Click the Animate Assembly button on the Assembly4 toolbar.
- Set the target variable to
Angle. - Configure the range:
- Start:
0 - End:
360(or multiples of 360 for longer simulations) - Step:
2
- Start:
- Click Run.
FreeCAD will cycle through the values of the variable, rotating the driver gear and mechanically driving the driven gear according to your kinematic expression, allowing you to visually inspect meshing performance and tooth engagement.