Adam kindly emailed me a copy of hobnail last night and I looked at the code.
I was hoping to find it written in a way making it easy to modify the calculation to accommodate a 6 gear rather than 4 gear compound, and then allow me to patch in some timing statements to measure performance. Unfortunately, more work than I care to do out of curiosity:
- the VBA code is event driven by changing various cells in the spreadsheet, so there isn’t a single simple interface to a number-crunching function.
- the number-crunching is done by ‘for’ looping through a deep list of nested if statements, ending in the 4 gear calculation. Not obvious to me what new ‘if’ blocks would be needed to do 6 gears, or how the ‘for’ loops should be modified.
By default the program arrives set up on the assumption that the hobber has 71 change gears available in increments of 1 tooth, from 30 teeth to 100 teeth. Having the full range available makes it much easier to find a close match, but real hobbers are likely to come with a much smaller gear selection. The user is expected to delete gears he doesn’t have from hobnail’s “Preferred Gears” table. Begs the question, “what’s the smallest range of change gears needed to hob most gears?” My gut reaction is that this is more difficult than identifying the minimum set of change gears needed by a lathe to produce most pitches/TPI.
To reiterate what Adam and others have said, hobnail isn’t a lathe pitch calculator. Instead it calculates change gears and other parameters for a hobbing machine, possibly one model in particular. (I don’t know enough about hobbing to confirm that the code is suitable for all machines.) Two compounds are needed, one for the indexer, the other for the feed.
Helpful to see what hobnail looks like:
Note that the program isn’t entirely deterministic – the operator is invited to play with the F starting value to get a better match. Also, not shown for space reasons, it calculates different ratios for the other hand. This is beyond my understanding of hobbing!
Although hobnail is implemented with VBA inside an Excel spreadsheet, implying it will only run on MS-Windows with Excel installed, I tried it first on Linux and LibreOffice Calc (also available free for Windows). Pleased to report hobnail appears to work correctly without needing Microsoft.
Dave