Thread: Tyzack lathe
View Single Post
  #7   Report Post  
Posted to rec.crafts.metalworking
James Waldby[_3_] James Waldby[_3_] is offline
external usenet poster
 
Posts: 257
Default Tyzack lathe

On Tue, 03 Mar 2020 12:34:41 -0500, Jim Wilkins wrote:
"James Waldby" wrote ...
Target is 25.4 tpi = 0.0394" = 1.0 mm
tpi: 25.422 = 0.9991 mm ABCD: 45 55 50 65
tpi: 25.455 = 0.9979 mm ABCD: 20 35 55 50
tpi: 25.333 = 1.0026 mm ABCD: 40 50 45 57
tpi: 25.319 = 1.0032 mm ABCD: 35 45 65 80


37 and 47 tooth gears fastened together give an almost exact metric
conversion ratio, and are smaller than the correct 127 tooth gear
which may not clear.


Yes, that has about 1/4 as much error as 45 55 50 65 has. Re the gear
size, I think the 80 tooth gears are the largest usable on a standard
mini-lathe, ie a 127 tooth gear won't fit it or similar lathes, so
that's an important point.

I've slightly modified the program (as below) so it's possible to tell it
extra gears one has, and also changed it to use nested for-loops, instead
of the combinations() calls that weren't saving any statements or time.

Command ./gearset.py 1000 1 16 8 37 47 32 127 now produces:

Target is 25.4 tpi = 0.0394" = 1.0 mm
tpi: 25.400 = 1.000000 mm ABCD: 20 20 80 127
tpi: 25.400 = 1.000000 mm ABCD: 32 20 50 127
tpi: 25.405 = 0.999787 mm ABCD: 32 40 37 47
tpi: 25.405 = 0.999787 mm ABCD: 37 47 40 50
tpi: 25.392 = 1.000307 mm ABCD: 35 47 55 65
tpi: 25.385 = 1.000606 mm ABCD: 32 55 65 60
tpi: 25.422 = 0.999126 mm ABCD: 45 55 50 65
tpi: 25.371 = 1.001126 mm ABCD: 35 37 40 60


#!/usr/bin/env python3
gears = [20,20,35,40,45,50,55,57,60,65,80,80]
from sys import argv
rn = 0; pre = (-1,-1); candi = []; nargs = len(argv)
# Metric thread pitch gets entered times 1000, eg 500 means 0.5 mm
rn+=1; tpi = float(argv[rn]) if nargsrn else 16 # Desired threads per inch
rn+=1; eps = float(argv[rn]) if nargsrn else 1 # Allowed error in %
rn+=1; Lead = float(argv[rn]) if nargsrn else 16 # Effective Lead Screw ratio
rn+=1; topN = int(argv[rn]) if nargsrn else 4 # Max number of candidates to show
while rn nargs-1: rn+=1; gears.append(int(argv[rn]))
gears.sort()
target = tpi if tpi150 else 25400/tpi
ftpi, itpi, mtpm = round(target,4), round(1/target,4), round(25.4/target,4)
print (f'Target is {ftpi} tpi = {itpi}" = {mtpm} mm')
errmax = target*eps/100 # Convert % error to tpi error
dexes = range(len(gears))
for da in dexes:
for dc in dexes[1+da:]:
for db in dexes:
if db==da or db==dc: continue
for dd in dexes[1+db:]:
if dd==da or dd==dc: continue
a,b,c,d = gears[da], gears[db], gears[dc], gears[dd]
t = Lead*(b/a)*(d/c); err = abs(t-target)
if errerrmax: candi.append((err, t, a,b,c,d))
for item in sorted(candi): # Remove duplicate candidates
if item==p candi.remove(item)
pre = item
for err,t,a,b,c,d in sorted(candi)[:topN]: # Print top candidates, if any
print (f' tpi: {t:0.3f} = {25.4/t:0.6f} mm ABCD: {a:3} {b:3} {c:3} {d:3}')

--
jiw