# Roller Chain Sprockets OpenSCAD Module

by kresty Dec 7, 2013

### Please Login to Comment

I am completely new to Openscad. I am not sure where to enter the Fudge factors. I bought some #25 roller and I am trying to make 32 teeth sprockets but I am having trouble with the roller catching. If I knew where or how to enter the fudge_roller=1 I think I could get it. Any help would be appreciated.

New to openscad here, how would I make the bore a 5 mil hexagon? Looks like I could use circle(5,\$fn=6) to get the hex (although 5 doesn't give me 5 mil).

Figured it out! edited your file to include \$fn=6 at the end of the bore code.

if (bore != 0)
{
translate([0,0,-1])
cylinder(h=2+hub_height_mm+inches2mm(get_thickness(size)), r=bore_radius_mm+FUDGE_BORE, \$fn=6);

Yea, that would work, didn't want to dig into the guts of the script though, it's been a while :) Probably that should be an optional parameter passed down.

It looks like it worked, I'll see when I get back to my main computer and can look at the STL in depth. Thanks for putting this together, it makes it way easier to get these done.

OH and thank you for responding so quickly. Made life easy. :-)

Sure, hope it works.

Yea, math :) And geometry even! Ack.

A search for hexagon dimension calculator (https://www.bing.com/search?q=hexagon+dimension+calculator) finds this site, which looks helpful: https://www.calculatorsoup.com/calculators/geometry-plane/polygon.php

First of all, it wants radius, not diameter, so circle(r=2.5,\$fn=6) might work better. OpenScad's R is the circumradius, so if you want 5mm between flats, then using the calculator above to solve for r given R=2.5. Circles are 2D, so you want cylinder, which gives you cylinder(r=2.89,h=10,\$fn=6); Cylinder also has d that could be used instead of r, but the calculator gave me r.

Anyway, to subtract things, openscad has "difference()" so something like this should work, moving the cylinder "down" with translate so that it intersects the socket completely.

difference()
{
sprocket(25, 9, 0, 0, 0);
translate([0,0,-5])
cylinder(r=2.89,h=10,\$fn=6);
}

To debug things sometimes I change difference to union, then you can "see" both parts.

I've successfully printed various #40 and #35 chain and tested them in a couple of different assemblies. Reducing the thickness of each in the table by about a thousandth of an inch (0.001) or 0.0254mm delivers enough tolerance for the chain to move freely over the sprocket teeth. I've also added 06B (British standard) chain to my tables as I have quite a bit of this chain and wanted to use it.

I'm about to mill some 06B sprockets out of aluminum in the coming weeks and will post how they turn out.

I like the layout of the .scad file as your tables are easy to edit and add profiles. If anyone is interested in my modified tables I'd be happy to upload.

Thanks,

Pierre

how does the R2-D2 and the dalek have anything to do with these gears?

They were originally used to work out L3-G0's foot drive for his motors. It ends up that now he's using steel gears, however that is the project I created these for!

Hey! OpenSCAD and 3D modeling noob here! I'm wondering if you could give me a hint on how I could make the hub come out equally from both sides of the sprocket. That is to say that I want a sprocket where the hub protrudes, say, 2mm from each side of the sprocket surface. Please and thanks!

It won't print right on both sides (you have to print it flat usually). Maybe make a bigger hole and then glue in a cylinder? Or a keyed hole and appropriate hub piece?

You could try importing it into something like sketchup and manipulating it there.

Hahaha. Of course. Thanks for straightening me out!

You could use supports. Not sure if it'd print cleanly enough.

I printed a #40 to go with a bicycle chain. The chain fits pretty tight and when you move it, it just come's off the sprocket unfortunately :(

Sample pics: http://imgur.com/a/d9Dkd

There're some variables in the scad that fudge some of the parameters, you might try tweaking those (FUDGE_TEETH is more likely, or FUDGE_ROLLER?). I used #25 chain for L3-G0 (http://L3-G0.com) it was a bit tight.

The sprocket is sort of a "perfect" match, but mine came out with squarer teeth than they should. That's what I added FUDGE_TEETH for, to make the teeth rounder. Yours look pretty square. Try making FUDGE_TEETH a bigger number. Might be something wrong with my math, but I attributed it to the printer not "cornering" as well as I wanted :)

I also didn't round the gears in from the sides as many bicycle teeth are, maybe file them a little? You could also try to print it a bit thinner.

Thanks for the reply. I'll have a play with those settings this weekend and let you know how it goes. I'll also hit this one with my files and see how much difference that makes first. The original version exported from openscad was much fatter but I made it thinner in sketchup. Thanks again!

Ack. If you had to make it skinnier, maybe I messed up the measurements? As I said, I only used smaller chain, so the rest of the numbers are copied from some table somewhere and not tested. Let us know how it goes.

Thanks! This is precisely what I was looking for. Just yesterday I installed OpenSCAD and I'm still not very sure how to visualize the pieces I have in mind. I will have a look at the code, I'm sure I will learn something :)

kresty - in reply to Makerto

Hope it helps. Note that at my printer's resolution, what I end up with isn't exactly what I put in, so I had to wear these in & stuff. Depending on the project you may need different "fudge" factors.