I did then what I knew how to do. Now that I know better, I do better.
— Maya Angelou

A bit of a 'howto'…​

The download contains the following:

  • lathe_data_example, example data file, all parameters for lathe_gears.py are defined here; edit this to meet your needs.

  • lathe_gears.py, the program that does the work.

  • README, a very concise and incomplete version of this 'howto'.

  • TPI_box.scad, an OpenSCAD proof of concept of…​

  • tpi_box_gears.py, a program to calculate a 'gearbox' to translate your 'metric' spindle gear into an 'inch-gear', enabling you to cut inch threads with zero-error on a lathe with a metric leadscrew.

The data (input) file.

The lathe_data_example file contains all parameters needed to run lathe_gears.py. In addition to the data from the input file, lathe_gears.py accepts a number of command line options which are treated in the next section.

The parameters.

lathe_gears.py expects a default data file named lathe_data, so you should edit and rename lathe_data_example.

After a small intro, the data file contains these parameters:

gears_available

A comma separated list of all the gears you have, or want to use. The example below yields about 9000 combinations with over 90 million permutations, and takes about 40 seconds on my 2017 Lenovo ThinkCentre, and a few minutes on my 2014 Acer Aspire laptop. Processing time varies exponentially with available gear numbers, so be considerate…​

gears_available=20,24,33,35,40,48,50,52,60,60,66,70,72,75,80,80,84

pitches

A comma separated list of all pitches, or feed-rates, you wish to achieve. These don’t influence processing time much, but physical constraints will keep you between roughly 0.1 mm (4 thou) and 19 mm (3/4 inch or 1.3 tpi), and standards only allow for so many pitches and rates between those numbers.

pitches=40,32,28,24,20,18,16,14,13,12,11,10,9,8,7,6

pitch_unit

The unit of the desired pitches/feed-rates, you have the choice between 'mm' and 'tpi'.

pitch_unit=tpi

spindle_teeth

The number of teeth on your spindle gear, i.e., the fixed gear mounted on the spindle of your lathe.

spindle_teeth=56
Note Metric gears (like the ones on your Chinese lathe) have a diameter of Z + addendum x 2 mm. 'Z' is the number of teeth of the gear, and your gears are 1M or 'module 1' gears, so their diameter per tooth, as well as their 'addendum', is 1 mm, so a 56 tooth gear like the one on my spindle has an OD of 56 + 2 = 58 mm. If my spindle itself has an OD of 52 mm, I could say it has the OD of a 50 tooth gear because 52 minus 2 for the two addenda leaves 50.

spindle_diameter

The effective diameter of the spindle, expressed as the number of teeth a gear of the equivalent diameter would have—​see the note above. This is a physical constraint, to ensure that the 'B' gear does not foul the spindle.

spindle_diameter=56

           80   75 <-- This is the 'B' gear.
  1.7500    H   66
            H   60

leadscrew_pitch

The pitch of your leadscrew. My MW210V has a 2 mm pitch leadscrew, I’m betting so does yours.

leadscrew_pitch=2

leadscrew_unit

The unit of your leadscrew’s pitch. I’m guessing you haven’t changed yours, so 'mm' it is…​

leadscrew_unit=mm

leadscrew_diameter

Like spindle_diameter, the effective diameter of the leadscrew shaft. This is a physical constraint to ensure the 'D' gear doesn’t foul the leadscrew in the 5-gear configuration.

leadscrew_diameter=23

           70   60
  1.0000   50   80 <-- This is the 'D' gear.
           60    H

max_centers

The maximum distance between the gear mounting posts on the mounting arm. Physical constraint.

max_centers=135

min_out_dim

The minimum outside dimension of the gear-train to ensure the gear diameters are sufficient to reach from the spindle gear to the leadscrew. Physical constraint.

min_out_dim=115

gear_clearance

The minimum distance between two non-meshing gears that won’t keep you awake at night. It’s the effective diameter of an equivalently toothed gear, i.e., in the example it’s 4 mm (1M gears) minus the two addenda, so actual clearance will be 2 mm.

gear_clearance=4

gears_output_file

The name of the log-file in which results are stored. Call it whatever you like.

gears_output_file=gears_result

output_format

lathe_gears.py can format it’s output in one of two ways. Perhaps most conveniently, and therefore considered the default, is 'layout', which prints the resulting gear sets like they appear on the chart on the lathe itself. The second option, 'list', lists all zero-error gear sets, as well as the nearest smaller and nearest larger results for pitches where zero-error can not be achieved. In the 'list' format, the gear sets are printed in 'shorthand', like [A, B, C, D, E, F], see below. Notice how the 4.5 mm pitch could not be achieved with zero-error; the two options given are the nearest possible, smaller and greater, allowing you to choose the 'best' for your application.

output_format=layout

           52    1
  5.0000   48   75  Error: 0.000% or 0.00 mm per thread
            1   35
-- 5.0 MM --------------
           80   72
  5.0400    1   84  Error: 0.800% or 0.04 mm per thread
            1   20

output_format=list

[4.0, 50, 1, 35, 60, 1, 48, 10.275375094532235]
[4.0, 50, 1, 48, 60, 1, 35, 10.275375094532235]
[4.487179487179487, 60, 1, 24, 50, 1, 52, 15.609825965290794], 0.285 % error.
[4.523076923076923, 33, 1, 40, 84, 1, 52, 22.573952541221782], -0.513 % error.
[5.0, 33, 1, 20, 75, 1, 84, 31.272991542223778]
[5.0, 84, 75, 1, 33, 1, 20, 31.272991542223778]

check_set_output_file

When checking an individual proposed gear set, the results are written to a different log-file from the regular gear results. Successive individual check results are appended to this file, so you can go back and compare them. Call this file whatever you like.

check_set_output_file=check_set_results

Command line options.

lathe_gears.py accepts a number of command line options, convenient for quick and one-off checks.

Help

lathe_gears.py -h, or --help will print the following help messages to the terminal.

bill@office:~/Work/Docs_General/Computing/Programming/Lathe$ ./lathe_gears.py -h
usage: lathe_gears.py [-h] [-g 84,72,60 ...] [-p 28,20,19 ...] [-u {mm,tpi}]
                      [-c 60,40,H,80,H,70 [target-pitch ...]] [-i file_name]
                      [-e [file_name]] [-o file_name] [-f {list,layout}]

Determine gear sets for feed-rates on a lathe, written with the MW210V in
mind.

options:
  -h, --help            show this help message and exit
  -g, --gears 84,72,60 ...
                        Comma separated list of available gears.
  -p, --pitches 28,20,19 ...
                        Comma separated list of feedrate(s) of interest.
  -u, --unit {mm,tpi}   Pitch unit.
  -c, --check 60,40,H,80,H,70 [target-pitch ...]
                        Check a gear set--given as a comma separated list of
                        6(!) gear positions A,B,C,D,E,F--for fit and resulting
                        pitch. Target-pitch is optional, if specified, an
                        error percentage is also calculated; you _must_ use
                        'H' for empty gear positions as per the example.
  -i, --input file_name
                        Data file name when not using the default
                        'lathe_data'; provide full path if it's not located in
                        the program directory.
  -e, --example [file_name]
                        Create an example lathe data file and exit. The file
                        name is optional and defaults to 'gear_data_example'.
  -o, --output file_name
                        Non-default output file name; defaults are set in the
                        data file.
  -f, --format {list,layout}
                        Output format, 'list' lists ALL working sets in a
                        simple format, 'layout' only gives the best* sets in a
                        pretty layout. (*see README)

Zero-error TPI threads.

Even with a lot of gears, as long as you’ve got a metric leadscrew, you’re going to struggle (read: fail) to get zero-error inch-threads. There is, however, a solution. By adding a free-spooling gear to your spindle, next and to the inside of your spindle gear, and driving this gear from the spindle gear via a four-gear reduction box that has a 'metric to inch' ratio, and then using this (no longer) free-spooling gear as if it was the spindle gear, you can achieve perfect TPI pitches.

Your gear sets will now begin at the inboard side, and effectively have to be installed in 'mirror image' (A and B gears switch places, so do C and D, and E and F), and the original spindle gear will be out of a job until you cut metric threads again.

I’m still in the design process, but essentially, the free-spooling gear will run on a recess cut on the bushing between the spindle gear and the outboard spindle bearing. The reduction gears will 'hang' behind the spindle; there will have to be some adaptations, but it’s all well within the realm of possibilities for someone with a mill, dividing head and some M1 gear cutters. Or you can 3D print the gears…​ Or order them online, whatever, it’s very doable, that’s what matters.

I’ve written a routine tpi_box_gears.py which will give you the perfect combination of gears, and I’ve checked—​they will fit on my MW210V. The reduction box will turn the 'free-spooling' gear, let’s call that the 'inch gear', with an effective teeth count of Z=44.45 teeth, so in lathe_data that’s what you enter as your spindle_gear, you also increase the spindle_diameter to 60 to provide clearance for the original spindle gear with the gear in the original 'A' position (now 'B'). If you cut metric gears with the inch gear in place, the diameter of the inch gear has now become the 'dimension of the spindle', so you must make sure to enter that in lathe_data under spindle_diameter.

Like I said, I’m in the early stages; I’ll update this regularly as I go along, but I’ve included what I have for now in the download, so you can take it from there, or check back in a while for more info here.