Some time ago, i needed to generate a spur gear profile that i code protrude in Solid Edge and later Laser Cut on Acrylic sheets for a product of mine. Since I was using some commercial gears alongwith my newly designed gears, I needed a solution that could generate DXF/EPS of the mating spur gear with specific number of teeth, addendum, dedendum and pressure angles.
One solution, which, unfortunately, wasn't free, but was extremely useful was to use the calculator on this site:
https://geargenerator.com/ (2USD / day)
So, I took a day out and wrote my own gear calculator.
The method is inspired from a graphical technique used by Soumitra Vadnerker on Youtube at https://www.youtube.com/watch?v=3bkw7C5z60E where he teaches how to make an involute spur gear in Autodesk AutoCad. I've converted the same steps to Matlab Code which outputs all the points in sequence to form a graphic path. Some work is still needed in order to use this code for prototypes but it can easily be done in applications like Autodesk AutoCAD, Adobe Illustrator, Freeware InkSpace etc.
Download and extract the files in a single directory and run DrawAll for an animated example.
The main function which does the math is MakeGear1 which asks for:
1: N = Number of teeth required
2: PA = Pressure Angle (in degrees)
3: Pitch = Teeth Pitch (in millimeters/inches or units of similar scale)
4: lRes = linear resolution of the output image (in same units as the Pitch)
5: ACDFac = (default = 2), Addendum Circle Dia factor (A. C. Dia = ToothThickness * 2 * (N + ACDFac) / pi)
6: DCDFac = (default = 2), Dedendum Circle Dia factor (D. C. Dia = ToothThickness * 2 * (N - DCDFac) / pi)
The function returns:
1: tcxAll = xCoordinates of the gear, centered on [0,0]
2: tcyAll = yCoordinates of the gear, centered on [0,0]
3: PCD = Pitch Circle DiaMeter
4: ACDFinal = Addendum Circle Diameter
umar hasan (2022). Involute Spur Gear Profile Calculator (https://www.mathworks.com/matlabcentral/fileexchange/72202-involute-spur-gear-profile-calculator), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!