The script is written in Python (version 2.7), and is available on GitHub: https://github.com/mjlepper/coprime-clock
The principal of operation is to systematically search through all coprime pairs within user-specified ranges to find combinations that will result in an exact overall gear ratio.
For example (from the README):
Code: Select all
$ ./coprime.py --ratio 12 --stages 2 --mn_max 200 --n_min 13 -d
# r_target=3.464102
# m=12: [2, 2, 3]
# n=1: [1]
# testing 4711 out of 6115 coprimes
# ./coprime.py --ratio 12 --stages 2 --mn_max 200 --n_min 13 -d
r_dev, m_dev, m1, n1, m2, n2
# Testing 11094405 combinations
1.000740, 9, 52, 15, 45, 13
1.001342, 22, 111, 32, 128, 37
1.004087, 14, 80, 23, 69, 20
1.004589, 17, 87, 25, 100, 29
...
Looking at the first result: The wheels are 52 and 45 teeth, and the pinons are 15 and 13 teeth. 52 is coprime with 15, and 45 is coprime with 13. The overall ratio is 52 x 45 / (15 x 13) = 12. The ideal reduction ratio of a 12:1 reduction in two stages is sqrt(12), or 3.464..., 52/15 = 3.4666..., and 45/13 = 3.4615..., so this is a very compact geartrain.
The user can look through all the results provided to find a set that best suits the application. One set I found for a clock with seconds, minutes, and hours hands:
Code: Select all
60:1 Seconds:Minutes reduction:
130:23, 138:13
12:1 Minutes:Hours reduction:
112:41, 123:28
The program can search for gear trains with more stages, but the nature of combinatorial searching will result in impractically large runtimes to search through all the possibilities. In these cases, it's best to consider the results returned within the first 10 minutes or so.
This can also be used as a tool to assist searching for gear trains for large astronomic or calendar ratios. For example, a 400-year Gregorian calendar has a period of 146097 days. Using coprime.py:
Code: Select all
$ ./coprime.py --ratio 146097 --stages 4 --mn_max 2000 --n_min 13 -d
# r_target=19.550611
# m=146097: [3, 3, 3, 7, 773]
# n=1: [1]
Code: Select all
$ ./coprime.py --ratio 7560 --stages 3 --mn_max 400 --n_min 13 -d
# r_target=19.626398
# m=7560: [2, 2, 2, 3, 3, 3, 5, 7]
# n=1: [1]
# testing 21443 out of 24338 coprimes
# ./coprime.py --ratio 7560 --stages 3 --mn_max 400 --n_min 13 -d
r_dev, m_dev, m1, n1, m2, n2, m3, n3
# Testing 1643026710241 combinations
1.013041, 90, 255, 13, 252, 13, 338, 17
1.025030, 115, 255, 13, 364, 19, 342, 17
...
Searching for "coprime horology" I found a couple of threads on the NAWCC forum where the subject has come up, but there didn't seem to be much interest. Since modern software like Gearotic and tools like 3-D printing, laser cutting, and 4-th axis machining make it easier to make gears of arbitrary module, we can consider new possibilities.
--
Matthew