Loading

Roller Chain Sprockets OpenSCAD Module

by kresty, published

Roller Chain Sprockets OpenSCAD Module by kresty Dec 7, 2013

Contents

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Makes

Thing Statistics

20260Views 5976Downloads Found in Parts

Summary

I was playing with sprockets and chain for driving L3-G0's motors (http://L3-G0.blogspot.com - My full size Lego R2D2, video on Youtube). Having difficulty finding a sprocket supplier, I decided to print some, but I wasn't able to find an OpenSCAD type sprocket library.

This "knows" about many types of ANSI chain, Motorcycle Chain, and maybe Bicycle chain, but I've only tested with ANSI #25 roller chain because that's what L3-G0 uses.

Sizes are: #25, #35, #40, #41, #50, #60 & #80 roller chain, and 420, 425, 428, 520, 525, 530 & 630 motorcycle chain. You can comment if the other sizes work for you (& if you had to tweak the fudges).

L3-G0's complete now, so check out his blog & share with friends. Also please give a thumbs up on his video channel!

Instructions

Though I included a couple .stl files, Sprockets is intended for you make your own size sprocket using OpenSCAD. It's fairly easy to do your own thing, and if you forget, there're comments in the sprockets.scad file. Skip the first steps if you've played with OpenSCAD and know how libraries behave.

  1. Get OpenSCAD if you don't have it already, http://www.openscad.org/
  2. Copy sprockets.scad to some folder on your machine.
  3. Either use a real library location, or to KISS, just make a new document and save it in the same folder as sprockets.scad.
  4. Enter something like this into your OpenSCAD script (on the left)
    use <sprockets.scad>
    // #25 chain, 9 tooth, sprocket with 5/16" bore.
    sprocket(25, 9, 5/16);
  5. Press F5 (Design->Compile). You'll see a sprocket with 9 teeth for #25 chain
  6. To make OpenSCAD create an STL file, you have to render it first, press F6 (Design->Compile and Render)
  7. Design->Export the STL.

You may want to play with some of the fudge factors for your printer, or maybe for other chain sizes. The values I have hard-coded seem to work with my #25 chain, and replicator 1.

Sprockets.scad also seems to use a large # of elements. For 22 teeth, you'll probably have to bump up the preference for turn off rendering # of elements.

sprocket() takes a few parameters. First one is roller chain size, then # of teeth, then bore size (in inches). You can also add a hub

// size: ANSI Roller Chain Standard Sizes, default 25,
// or motorcycle sizes,
// or 1 for bike w/derailleur or 2 for bike w/o derailleur
// teeth: Number of teeth on the sprocket, default 9
// bore: Bore diameter, inches (Chain sizes seem to favor inches), default 5/16
// hub_diameter: Hub diameter, inches, default 0
// hub_height: Hub height TOTAL, default 0.

So, for an example with a hub look at Sprockets15_Hub.scad:

use <sprockets.scad>
sprocket(25, 15, 1/4, 3/4, 1/4);

That's #25 chain, 15 tooth, 1/4" bore, 3/4" hub, 1/4" from the plate.

There's a mm2inches(mm) function if you want to use mm instead:
// 608 bearings are 7mm wide, 8mm ID and 22mm OD
// Make a hub big enough for a 608 bearing
use <sprockets.scad>
bore=mm2inches(22);
hubwidth=mm2inches(30);
hubheight=mm2inches(7)-get_thickness(25);
sprocket(25, 19, bore, hubwidth, hubheight);

When openscad renders it, some info gets echo'd too. Add the "Thickness" to your hub height to get total thickness of the part.

ECHO: "Pitch=", 0.25
ECHO: "Pitch mm=", 6.35
ECHO: "Roller=", 0.065
ECHO: "Roller mm=", 1.651
ECHO: "Thickness=", 0.11
ECHO: "Thickness mm=", 2.794
ECHO: "Outside diameter=", 1.32616
ECHO: "Outside diameter mm=", 33.6844
ECHO: "Pitch Diameter=", 1.20243
ECHO: "Pitch Diameter mm=", 30.5418

The "fudge factors" I have built in, in case your parts are too tight follow. I'd try running the part back & forth in the chain a few times before tweaking these, just to rub off printing irregularities.

If your bores are too tight, you might try this. 0 works for me though, a bit stiff getting on a 5/16 rod with a 5/16 bore, but it fits with minimal wiggling. If not, bump this up (or down).
FUDGE_BORE=0; // mm to fudge the edges of the bore

If the rollers are stuck in the channels, try adjusting this. For my chain & printer, 0 seems to be fine. This is the bottom part of where the chain sits.
FUDGE_ROLLER=0; // mm to fudge the hole for the rollers

More likely, the printer doesn't want to print the tips of the teeth very round, at least I seem to have quite a bit of error here. This fudge factor decreases the diameter of the circle used to round the teeth. My printer seems to make them rather squarer than the image in OpenScad.
FUDGE_TEETH=1; // Additional rounding of the teeth (0 is theoretical, my rep 1 seems to need 1 on medium.)

Additionally, typically sprocket teeth are chopped off. If you want to keep the teeth, or use slightly different math for the distance they stick out, look at the lines following this comment:
// Trim outer points
Comment out all 3 lines to keep the teeth, or change to the other cylinder to have slightly shorter teeth, or do your own thing.

There're 3 functions that return some info about chain sizes:
get_pitch(size) returns the pitch of the chain in inches
get_roller_diameter(size) returns the roller diameter
get_thickness(size) returns the thickness of the sprocket (excluding any hub)

And don't forget to visit L3-G0 the Lego R2-D2's blog or Youtube channel. The gears I'm building are intended for his motorized feet....

More from Parts

view more

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

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 :)

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.

Top