# Astronomical gear train/gear ratio calculation tool for linux?

Show 75 post(s) from this thread on one page
Page 1 of 5 123 ... Last
• May 11th, 2010
BastardNamban
Astronomical gear train/gear ratio calculation tool for linux?
I already searched through all the stickies and program database for anything I thought might help me, and found nothing I can figure will, so I'm asking here.

I am looking to plan out some special clocks, and while I know what ends I need to achieve, I don't know of any program for linux
that could help me calculate the special gear train ratios I need.

See, these are going to be astronomical clocks, for my own personal use. They involve some more complicated gear ratios that are non-standard,
and thus, not easy for me to calculate without software- I can, but it is arduous to say the least.

For example, I'm trying to make a new solar-sidereal gear train, and need to create a gear ratio of exactly 1:1.0027379.
I know others have done this with between 4-20 some odd gears, but I need to create something new.

Basically, what I need is something that can take a given final ratio, and show me what in whole numbers in the form of fractions
what numbers for a given number of gears can make the ratios I need.

For example, here's a version of what watchmaker Breguet came up with:

(51 teeth/82 teeth) x (79 teeth/49 teeth) = 1: 1.00273768 (solar:sideral ratio; the true ratio for the spacial relation is 1:1.0027379)

Using that kind of clockmaker's layout, I need something that can help me calculate for, given the number of fractions (each a gear and pinion combo)
I choose to use, and a final given ratio, whole numbers that will produce the result.

I'm sure this would be simple for some sort of existing software, probably some form of spreadsheet calculation, but I am a novice in such matters,
and am not sure what would work best for this.

Can anyone point me in the right direction for what can do this? Any sort of astronomical phenomena calculation program suggestions would be welcome too.
I just haven't been able to find much despite looking for a few years on and off now!
• May 20th, 2010
Re: Astronomical gear train/gear ratio calculation tool for linux?
Looks like some sort of constrained optimization problem...
Check here: http://wiki.cacr.caltech.edu/danse/i...ion_Algorithms
• June 8th, 2010
BastardNamban
Re: Astronomical gear train/gear ratio calculation tool for linux?
Thanks for the reply, but I have no idea whatsoever what anything on that page can do for me.

I understand what an optimization problem is, and I agree- but finding a way to implement such a layout in software is what confuses me.

Any mathematicians out there that can sugguest a simple solution for something like this? A program that solves for ratios with a simple fractional layout like that listed above would be a huge boon to clockmakers. That layout is needed for us to do whole number gears in proper ratios.
• June 10th, 2010
oldfred
Re: Astronomical gear train/gear ratio calculation tool for linux?
Attachment 159927I created a brute force try all combinations and only print out the ones with small error. It trys all gears in a range so for a set you get your answer 4 times as each gear can be 51, each gear can be 82 etc.

I print calculated ratio, error, and the four gears. You will see all those with exponent of 7 are the same four gears. I am trying to teach myself python so I do not expect this to be considered "good" code.

fred@fred-desktop:~/Projects/PyAssetTrakkr\$ python clockgear.py
1.00273768044 2.19561971271e-07 51.0 79.0 49.0 82.0
1.00273768044 2.19561971271e-07 51.0 79.0 82.0 49.0
1.00273972603 1.82602739729e-06 54.0 61.0 45.0 73.0
1.00273972603 1.82602739729e-06 54.0 61.0 73.0 45.0
1.00273972603 1.82602739729e-06 60.0 61.0 50.0 73.0
1.00273972603 1.82602739729e-06 60.0 61.0 73.0 50.0
1.00273972603 1.82602739729e-06 61.0 54.0 45.0 73.0
1.00273972603 1.82602739729e-06 61.0 54.0 73.0 45.0
1.00273972603 1.82602739729e-06 61.0 60.0 50.0 73.0
1.00273972603 1.82602739729e-06 61.0 60.0 73.0 50.0
1.00273972603 1.82602739729e-06 61.0 66.0 55.0 73.0
1.00273972603 1.82602739729e-06 61.0 66.0 73.0 55.0
1.00273972603 1.82602739729e-06 61.0 72.0 60.0 73.0
1.00273972603 1.82602739729e-06 61.0 72.0 73.0 60.0
1.00273972603 1.82602739729e-06 61.0 78.0 65.0 73.0
1.00273972603 1.82602739729e-06 61.0 78.0 73.0 65.0
1.00273972603 1.82602739729e-06 66.0 61.0 55.0 73.0
1.00273972603 1.82602739729e-06 66.0 61.0 73.0 55.0
1.00273972603 1.82602739729e-06 72.0 61.0 60.0 73.0
1.00273972603 1.82602739729e-06 72.0 61.0 73.0 60.0
1.00273972603 1.82602739729e-06 78.0 61.0 65.0 73.0
1.00273972603 1.82602739729e-06 78.0 61.0 73.0 65.0
1.00273768044 2.19561971271e-07 79.0 51.0 49.0 82.0
1.00273768044 2.19561971271e-07 79.0 51.0 82.0 49.0
done

Newer version info several posts down updated Jun16 2010
• June 11th, 2010
BastardNamban
Re: Astronomical gear train/gear ratio calculation tool for linux?
Oldfred, thank you very much! What program did you use to do this?

It looks like you found a way to use the same 4 numbers, in different orders, to come up with the first number, the ratio. Then what is the second decimal number
each time? (ie: in 1.00273768044 2.19561971271e-07 51.0 79.0 49.0 82.0, the 2.19561971271e-07 part.)

It's crucial that I use whole numbers only for the gears in the sequence.
Also, I need that exact end ratio, and I'm willing to not limit myself to 4 gears- up to 20, if need be. More accurate is better.

Finally, the 4 gears I used above aren't quite accurate- they were the ones Breguet used (I gave them only as an example, I would not use the same solution as he), and his train was off by 10 seconds or so a year, I believe.

Much higher levels of accuracy are obtainable, but more gears must be used.

I really appreciate you trying whatever you did, and I'd like to know what you used. I'd like to learn how to use it, and continue on my own with even more gears!

Finally, is there a way to make a gui program to calculate gear ratios in this way for clockmakers/watchmakers (ie: gear tooth numbers in whole numbers only for a desired result)? I would think linux can do it- I'd just need someone to make it for me. Can I pay someone to make a program to do this? I would!
• June 11th, 2010
oldfred
Re: Astronomical gear train/gear ratio calculation tool for linux?
The second value is error, you see it changed to exponential since it was so small. Whatever simple logic I used only gave errors to 6 or 7 decimals.

I attached the program, it is just python. copy it to your system and make it executeable. I had it in desktop so I changed to this:

fred@fred-desktop:~\$ python clockgear.py

This only uses 2 gears sets and when I had 0 to 100 on all 4 it took forever to run. It would be relatively easy to add more but may take too long to run. not sure how to add optimization to make it easier to run.

Look at program, it is short enough to understand I think for just about anyone as it is not complex.
• June 12th, 2010
BastardNamban
Re: Astronomical gear train/gear ratio calculation tool for linux?
Fred, I truly appreciate your help. Forgive me for 2 things, though-

1. I assume there is a way through terminal to assign a file transfer from a networked computer for your file- as nothing is attached as a file to your message in any normal sense to me as a downloadable link.

2. I've never used or see one, but I assume your file by the file name is a "Python script". I have no clue how scripts work or how to use them- it's been one of the key mysteries to me as to how/what linux is. It's like trying to understand a facet of God or something, you have no clue how to wrap your head around it until someone explains something about it to you. If it is one of these "scripts", where should I look to learn how to use it? I'm sorry, while I'm experienced for a few years now with linux, there are some areas I know nothing about- scripts are one of the biggest areas for me.

Thanks.
• June 12th, 2010
oldfred
Re: Astronomical gear train/gear ratio calculation tool for linux?
In post #4 at the bottom is clockgear.py which if you click on it you can download it. It is a simple python script. If you click on it it should open to edit so you can see it. If you right click you can change the property to executeable.
• June 12th, 2010
BastardNamban
Re: Astronomical gear train/gear ratio calculation tool for linux?
Ok, I have it and changed it's properties to run as an executable.

If this is a script, I think I see what they are now. It's preconfigured computer language to do something,
and you edit it to do what you want with certain values. Then terminal runs it and gives you useful output.

Ok, here goes:

1. Assuming I can indeed edit this, could I change the line of
Code:

`#calc_ratio = (wheel1 * wheel2 ) / (pinion1 * pinion2)`
Code:

`#calc_ratio = [(wheel1 / pinion1) * ( wheel2 / pinion2)]`
?

And if I can, could I add more wheels & pinions if I want to try, in this form:
Code:

`#calc_ratio = [(wheel1 / pinion1) * ( wheel2 / pinion2) * (wheel3 / pinion3) * -ETC-]`
?

2. I see "delta" must equal the error exponentially expressed you mentioned before. Could that, say, be made equal to ZERO,
or at least further out than it is now? This clock needs whatever ratio that gives the smallest error possible- I'll add as many gears
as needed to get that zero error. If it takes 20 gears, so be it. This is to help with an exceptionally precise astronomical clock.
More gears will be used if needed- error is being thought of in long term- 100 years and beyond cumulative.

3. Obviously we are specifying the gear tooth numbers, and then terminal calculates the results of their combination in different orders.
Could this be done without numbers specified, and the computer finds the lowest number of gear teeth to achieve it as variables
w,x,y,& z (and so on)? I'm sure if the answer is yes, I'm looking at LOOOOOONG calculation times.

Confusion:

It is enabled to run as an executable, which I have done with other things before. This however is not running. I tried
running in terminal, nothing happens. Run does nothing too. Display brings up the text to edit. I can't seem to do anything
to run it.

Why are the wheel & pinion numbers defined as 3 different things? Once in pink, again a different number in blue, and near the end as its value +1.

What are the purposes of the values endw and endp (end wheel and end pinion)?

Aside from those, I don't think I understand how it works. I know the values must be constraints, but it's hard to visualize.
And yes, I do have a decent math background (integral/differential engineering calculus, as a non-engineer, but an A- 5 years ago...)
• June 12th, 2010
oldfred
Re: Astronomical gear train/gear ratio calculation tool for linux?
Once you make it executeable you have to use python to run it. Change to what ever directory you saved it to and this will work.

fred@fred-desktop:~\$ python clockgear.py

1. From a calculation stand point there is no difference between your formula and mine.
2. The logic needs to change as right now it is hard coded with 2 wheels and pinions. I could make it 3 or 4 but as you add it becomes very unwieldy. Possibly a recursive subroutine.
3. I am just using the error to limit the number I print when I first ran it it tried to print 100*100*100*100 and scrolled by very fast. You still have to review the list to see what is best.
4. I have start and end points. I only created one end point for wheels and one for pinions. It runs from start to end of each . I originally had 1 to 100 of each and it was taking too long to calculate just for a test to see if it even worked.

My editor does not give same colors, so I am not sure of question. I have to reset start of each inner loop when I increment the outer loop. There are no constraints like it probably should have with a linear programing set of logic, just a brute force try every alternative from a start number to a end number for every gear.

There is no way with a brute force approach like this to do your desire for up to 20 gear sets.
Show 75 post(s) from this thread on one page
Page 1 of 5 123 ... Last