Gears

Microphone holders, especially American ones, tend to have a 5/8″ 27tpi (turns per inch) thread. I have no idea where to buy a tap or die to cut that. Threadcutting on the lathe, though, looked like a good exercise. I reckoned I could do the M12 threads I wanted, too. In fact, I may never have to buy another tap or die! I read up on how to do it, went to the lathe to practice, and hit a slight snag…

To quickly fill in for anyone who has neither done this before nor spent half the night reading up on it, cutting threads on a lathe is pretty simple in principle. All you have to do is contrive to get the saddle moving the tool along the workpiece at exactly the right rate relative to the spindle rotation. So if you want a 16tpi thread, for example, you just need the saddle to move an inch for every 16 turns of the workpiece. Then you skim along taking successively deeper cuts until you have your thread. There’s a bit more to it, the devil being in the detail as ever, but there’s loads on the web about that elsewhere. The saddle is driven along by the leadscrew. The leadscrew on my lathe has 16 threads per inch itself, so to cut a 16tpi thread, the leadscrew must turn at the same speed as the spindle. To cut a 32tpi thread, it must turn at half the speed. For normal power feed on this lathe, it runs at 1/16 the speed of the spindle – so the tool marks left by a sharp tool under power feed, then, are kind of a shallow thread of 256tpi.

To pick the speed of the leadscrew, you assemble a set of gears to get the required drive ratio. The gears needed for some common thread pitches are given in a table attached to the lathe, and it was here I hit my snag – no entry for 27tpi. I looked in the manual I’d downloaded. The table in there was the same. It also dawned on me that metric threads were going to be a problem, with an imperial leadscrew. Dave, who loaned me the lathe, had suggested that he has the optional metric leadscrew “somewhere”, but this has yet to surface.

So how to figure out what gears gave me 27tpi, and/or some “close enough” metric pitches? Here, I felt I was back on familiar turf, and quickly knocked up a little command-line program in C to generate all possible combinations of the set of change gears I had (ten, plus four others normally used just for power feed). Then I sorted and searched the results for the ratios I was after, and quickly found a plausible few combinations which got (surprisingly) close to 1.75mm pitch, and also exacty 27tpi – I have no idea why this handy pitch is left out of the official table (unless it’s ‘cos no-one outside of the US microphone stand industry uses it for anything?)

To try out my “metric” 1.75mm pitch gearing, I was very restrained – rather than diving in and carving up a 12mm bar, I chucked a length of standard M12 bolt, set the lathe up for thread-cutting (with the top slide at around 29 degrees) and edged the tool up close to the official M12 thread. Then I ran the lathe at low speed and watched the tool tip – it seemed to track the thread peak accurately. I returned the carriage to the start of the bolt, engaged the halfnuts again and edged the lathe forwards to take out the backlash, then moved the tool carefully into the V of the thread with a hair’s-breadth of light showing around the edges. Crossing my fingers, I ran the lathe slowly forwards. The tool tracked along in the thread trough without touching, for the entire length of the bolt (around 3 inches) – I was surprised it was that close, until I sat down with a calculator and worked out that it was only going to be a shade over a thousandth of an inch out after the length of bolt I compared against. The gears (from the standard set) I used for M12(x1.75) on an imperial leadscrew are:

1.75mm (12.51 tpi): A 40T, B 35T, C 55T, D 57T

I tried a similar exercise with my 27tpi gearing which was, as expected, bang on. The gears I used for that were:

27tpi: A 40T, B 45T, C 40T, D 60T

There are other combinations which will give the same results.

Emboldened by these minor triumphs, I decided to actually cut a thread, leading to my first Thing.

Fiddling around with my little gears program, I noticed that, while many metric threads can be closely approximated with the supplied gears and the imperial leadscrew, there are a number of integer imperial threads which can’t be done – fortunately, none of them are ones I have a use for right now.

Reading around, it’s clear that programs to work out gear combinations, being the obvious way to go, aren’t exactly uncommon. Various people have made them available in different forms. Some can be accessed simply via a browser, some need to be downloaded (and only run on windows). The browser ones seem to use CGI for the most part, running on the web server – the author of at least one of them implores the user not to re-calculate new sets of gears too often. I use either Macs or Linux machines, so the Windows/DOS programs didn’t appeal much, but I did want something a bit more user-friendly than grepping the output of a command line program, so I decided to turn my rather simple bit of combination-generating code into a Javascript version. I reasoned that the UI is taken care of by the browser, and everyone has prodigious amounts of spare CPU these days so the inefficiency of an interpreted language wouldn’t matter. Also, I prefer the idea of people running it on their spare CPU rather than my webserver via CGI.

The only snag with this brilliant idea was that I’m an embedded software engineer, not a web designer – I do C and C++ and assembly code on “bare metal” embedded systems, I don’t HTML and CSS much, and I’ve never used Javascript. Still, software in general is my thang, and it’s just another language… so here’s my initial effort for your delectation and amusement, written over a day or so as I taught myself some Javascript. Obviously I twigged as I went along that Javascript could be used in much more elegant ways, but a less hacky re-write can wait for a while. This ‘un works, more or less – usual disclaimers apply, naturally. I haven’t tested it on IE, and I wouldn’t expect it to work on any browser more than a couple of years out of date. Also, I’m sure it’s pretty easy to make it foul up by being unkind to it in some way – this isn’t mission-critical software designed for solidity, it’s a quick hack to get some handy info. (I couldn’t resist trying to draw little pictures of gears, mind 🙂 )

Advertisements

About lathenovice

Turning bits of metal into differently-shaped bits of metal.
This entry was posted in General. Bookmark the permalink.

16 Responses to Gears

  1. Pingback: My First Thing | lathe novice

  2. Bob Harvey says:

    Impressed by the JS application. That’s quite a bit of ‘first effort’.

    Here is a suggestion: over short distances small errors in pitch are not important (most microphone or camera sockets are only 3 turns deep). Over long distances they can accumulate alarmingly (think of making a leadscrew!). For a normal full nut (5 or 6 turns) there is a limiting error if you are only making one half of the set.

    How about sorting your gear results by error? and displaying the error in some form?

    • lathenovice says:

      It did occur to me to figure out or look up the amount of play typical for a standard nut/bolt and try to figure out if a particular thread would jam, but apparently tolerance differs between nuts and bolts – I gather that nuts (typically – except for long blind threaded holes) get made close to nominal dimensions, and bolts fractionally undersize, so it depends whether you’re cutting a male or female thread – my notion of putting out a message saying “will jam after X cm of thread” seemed more likely to mislead than to inform, so I stuck with saying how much out it’ll be after how far, so the user can decide if that’s good enough.

  3. lathenovice says:

    Hi Bob, yes, ’tis a good suggestion (though mic and camera socket threads I can get exactly, it’s the metric ones which are approximate on my lathe – imperial leadscrew as standard, a partial mismatch for my partially metric brain…).

    Sorting the “gears” results by error is a jolly good idea – at the moment, it plonks you on the one (or one of the ones) with the smallest error, but leaves them in the order it discovered ’em for reasons of relative laziness. There’s a bit in the code which removes poorer fits and replaces them with better fits as it finds them, if there are more than a hundred (arbitrarily chosen number) overall – it tracks the indices of the best and worst results externally to the table, in a wholly unprofessional manner, so sorting it is a pain because of that. Having now learned that Javascript will actually do all kinds of objecty stuff and allow greater cunningness than I suspected, “at some point” I’ll address results-sorting in a MKII version.

    I’d twigged that the errors I’m getting for e.g. 1.75mm are irrelevant in more or less any practical application, but, as you say, are unsuitable for leadscrews etc. The “lathegears” code is already supposed to give an impression of how far out a pitch is in practical terms – it *should* say “blah blah will be a 0.025mm/0.001″ short/long after Xcm/Y” – that’s about a thou in Z inches”, or something like that. (Aside: at some point it’d be interesting to try to measure the accuracy of the actual leadscrew, I was a bit suspicious of exactly how well my 1.75mm pitch tracked a long 1.75mm bolt, ’til I did the maths at least.) – I wouldn’t be surprised if that particicular bit failed to work on some browsers, though, it’s hidden and un-hidden by a mechanism which might possibly only work on Firefox and Safari. Again, “at some point” I’ll try it with IE, Opera, etc. Even without that bit, though, in the results table it should show the % error for tpi and the mm error per pitch for mm pitches, in the event that either is more than a gnat’s whisker off the target value.

  4. lathenovice says:

    I’ve updated the lathegears thing now to kind-of support Opera – Opera renders the table smaller, and there were a couple of other issues – it doesn’t like 3-digit colour specifications, and Opera 9.2 doesn’t know about the {array}.indexOf() method (so I had to add my own), also some little tweaks elsewhere (some z-index bits were wrong). Opera 9.2 changes the size of the table and leaves bits behind while doing so, opera 9.8 (as Opera 11.52 calls itself…) seems less confused about the size the table should be but makes it smaller than FF or Safari, and I’m not sure it returns the same position info for certain elements.

  5. Bob Harvey says:

    How fun.
    I added gears 11, 12,13,14 just to see what would happen
    Searching for a 1.778mm pitch gives “80 20 14 50” and
    “Thread will be 0.025mm (~ 0.001″) short of its proper place after about 20018500343661.85cm (7881299347898.37″)
    That’s about 0mm out after 1cm or 0″ out after an inch”

    Good luck with cutting a 200Gm thread on a minilathe!

    Going back to the wheels you really have, I got
    “Thread will be 0.025mm (~ 0.001″) short of its proper place after about 7.84cm (3.09″)
    That’s about 0.0032mm out after 1cm or 0.0003″ out after an inch”

    which is much more like it.

    • lathenovice says:

      Well, y’know, there is a hole right through the spindle, so with a steady, no tailstock and a long enough workshop…

      OK, perhaps I need to loosen up the “close enough to call it spot on” test a tad. (Actually, I thought I’d made it much more approximate than a thou per six microparsecs (or whatever it comes out as)).

  6. Miguel says:

    Awesome. JavaScript + HTML is like the best way to present a program it seems. I downloaded a few others but I hit the wall when I wanted to change something I didn’t like. This way the code is always visible and you can change anything and see the results immediately. I wrote a ballistics simulator back in 2003 myself and still runs.

    Back on topic, may I suggest a function to calculate threading tables automatically for the standard threads (both metric and imperial)? It’s a bit tiresome to try to find the missing gears by trying each teeth count and thread size manually to see when the set of gears is complete. I’ve got a Chinese BVB25L lathe which has a weird 7TPI lead screw and 4:1 gear reduction before the first gear(28 TPI equivalent) and I’ve been unable to identify the missing gear to cut an accurate 1.75mm thread. Maybe even a “solver” for new lathes that computes the minimum set of gears required to cut the standard threads given a lead screw pitch.

  7. gadjet says:

    Thanks very much for your efforts, I know it’s an old post but you hit the nail on the head with the program, brilliant.

    I’ve not had my mini lathe for long and just done “my first thing” with a thread. My lathe is metric and I want to cut a 1/2″ UNF 20 thread and I put together a spreadsheet to start working out the combinations but luckily found your post, I had bought a 63 tooth gear hoping I could cut imperial threads without changing the lead screw and 0.01% accuracy will be close enough i think.

    Thanks again

  8. gadjet says:

    Hi,
    I put a link on my blog but I also had another idea, I took the source code and made it into an android app for my phone, I can now use it offline. I modified it slightly to reduce the amount of gears and the default ones, mainly to fit it all one one screen. Would you like a copy of the app ?

  9. gadjet says:

    Here’s the link to the APK file https://dl.dropboxusercontent.com/u/2253850/Gears.apk
    It’s also on a post on my blog

    • lathenovice says:

      Thanks!

      Must get around to updating this blog sometime… I’ve a project in mind that will combine a few interests (machining, electronics and r/c flying models…) but seem to have the time for little besides work, eating and sleeping and of course looking after the wee oone, who’s still too small to introduce to machine tools…

      Cheers,

      – Carl

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s