Gear Tooth Geometry.

I feel like, with making the first two “Introduction to Digital Computers” videos I’ve gained a superpower. And I’ve used that power to help me visualize and solve another problem I was having, figuring out the shape of spur gears (and eventually, internal spur gears, the next major feature I’d like to add to the Kythera application).

Which led me to making this video.

As always, show notes give further details.

Let me know if you find any problems or have any questions.

And as always, thanks for watching.

A second pass at my earth/moon orrery.

I’ve come to realize making something from scratch winds up building a bunch of prototypes as you both perfect the plans and figure out how to make the parts.

And in my case, while the plans may be great–my ability to machine parts is… shall we say questionable?

At any rate, I have a second pass at the Earth/Moon orrery.

A few observations about my design.

First, the gears don’t quite have the axle holes dead center. It’s not that I don’t own a set of mill center drills, which are useful for starting a hole at the exact spot you want it at (rather than trying to use a drill bit and getting a hole wherever the damned bit bends to), it’s that I forgot to use them when I made the center holes of the gears.

So I have to remember when cutting a gear to use the following steps, which I document here because someone else may find these useful. (I’d make a video, but I’d need to license the Benny Hill Yakety Sax music.)

1. Measure and cut the blank for the gear from 1/8th or 1/16th thick sheet metal. (I’m using aluminum because it’s cheaper than ruing hundreds of dollars of brass.) The blanks should be slightly bigger than (N+2)/32 inches (for 32P gears, which is the size I’m cutting) in diameter. (I made the mistake once of thinking “radius.” That wasn’t good.) The blank should be drawn around a divot in the center made with a hand punch.

2. Set up an arbor for the gear. Take a piece of aluminum rod close in diameter to the gear we’re cutting, mount and center on the lathe, and face the arbor. This causes the end of the arbor to be flat relative to the cutting surface we’re cutting on.

Note that all of this is taking place on the little Sherline, because one of the steps will completely screw up the center otherwise.

3. Attach the blank to the arbor. Using a center on the tail stock and a dash of superglue, superglue the gear blank to the arbor. Use the tail stock center to help center and push the gear blank on the arbor, and allow five to ten minutes for the glue to set.

4. Cut the gear blank. On the lathe, turn the blank to the desired diameter. For 32P gears, this is the Outer Diameter of the gear, and is (N+2)/32 inches in diameter for a gear with N teeth.

5. Using a mill center drill bit, start a center for the axle. This is the step I kept missing, and that caused my gears to be slightly off center. The end result is a tiny little divot at the exact center of the gear blank, which then can be used to drill a hole without having the drill bit wander too far off center.

6. Drill the center hole the desired diameter. Enough said. In the case of the orrery, I have to remember one of the 52-teeth gears has a center hole of 9mm. (At some point once I’ve perfected the plans, I’ll upload the instructions for making this device.)

7. Re-mount the gear blank on the mill. I assume the mill has been set up for cutting gears, with the appropriate cutter mounted on the cutting arbor, and the rotary table set up at a 90 degree angle. At this point you’ll need to then verify the gear cutter is centered in the gear to be cut.

8. Start cutting gears. What I’ve been doing–to great effect–is to center the gear across the cutter, so turning the Y axis knob in front slides the gear into the cutter. The moment I hear the tell-tale sign of the gear cutter starting to cut the gear, I note the depth on the knob (all my mills and lathes are marked in inches), rotate the X axis to get the gear out of the cutter, and turn the knob into the cutter 0.0625 inches. This is the desired depth of the teeth.

(We get 0.0625 inches from the observation that if the outer diameter of a gear grows by 2/32″ for a 32P gear, this means the inner diameter must shrink by a corresponding 2/32″ as well. This means the diameter difference between the outer and inner diameter differs by 4/32″–and the tooth depth, the delta of the radius–must be half that, or 2/32″. That is, the tooth depth is 2/32″ = 0.0625″. By listening for the cutting, my guess is that I’m cutting the teeth a hair wider and a hair deeper than needed. On the other hand, this works out fairly well, given that the final mechanism I built, pictured above, rotates pretty freely with center holes precisely at the locations my Kythera program predicted.)

Once the gear depth is set, lock the Y axis, and start cutting gears by turning the rotary table the desired amount and sliding the gear blank through the cutter using the X axis.

I don’t have any CNC motors attached to my mill, only to the rotary table–so this gets pretty boring pretty fast.

9. If all goes well, separate the blank from the arbor. The technique I’ve seen which works well is to use a blowtorch and heat up the gear blank until the superglue releases. Try not to do this on cement, because you can cause the imperfections in the cement to pop, throwing small bits of cement at your face.

The different gears that are supposed to be attached to each other, by the way, I simply superglued together. This is probably not a great long-term solution, but in the short term it works very well.


I think with a little better technique I can cut the gears and mount them and have a functioning orrery. But the last gear, the thing that rotates around showing the position of the moon–that leaves a whole lot to be desired.

Originally I had built a 14 tooth gear using 1/8th inch thick aluminum, and then cutting a separate component:

Moon mount

This I then superglued to the 14-pin tooth, and I cut the 6mm end with a 6mm thread, which I then screwed a cap on top that holds the pin that will eventually support the moon.

And this went… poorly.

The stupid part is that in retrospect this should have been cut as a pinion:

Moon pinion

And the moon should have been mounted not by screwing the top piece on, but by using a grub screw.


Well, in a few days I’ll go back to cutting parts and seeing if I can’t machine something better. Meanwhile, version 2 of my orrery prototype.

Wire forms.

So if you’ve been watching my Quick Videos you know I’ve been building a lot of circuits on prototype boards. I also took the liberty of 3D printing a couple of useful tools to help measure and bend wire.

The first on the left helps measure lengths of wire; each wire is measured in each groove 0.7″ longer than the number of holes (separated by 0.1″ in length) indicated on the scale. (That’s because the strippers I use to trim the hookup wire for my prototyping breadboard cuts around 0.35″ off the ends of each wire, so this allows the insulation to be precisely the right length.)

The second helps bend wires precisely by the number of 0.1″ lengths desired, and even has a small cylindrical impression for resistors:

Bending Resistors

All of the designs were created using OpenSCAD, and printed using a Form 2 Printer. The files can be downloaded from here: wireforms.zip

The test print of the Earth-Moon Orrery

So after a couple of days of printing, and a little sanding, some assembly, and not a tiny bit of cursing, I have a printed orrery gear assembly for our Earth-Moon Orrery.

Assembled

It’s a little stiff, but that’s to be expected since I haven’t perfected the gears through sanding. (That means carefully going through each tooth with a tiny little strip of sandpaper and polishing down all the little rough edges.) Of course the mechanism also needs to set for a few days; I’ve found 3D prints out of the FormLabs Form 2 printer generally take a couple of days to set before the parts seem totally cured. (Of course I could buy the system FormLabs sells to harden parts–but I haven’t.)

The ideal way to build this mechanism, of course, is out of brass–and the next thing for me to do is figure out how to cut brass gears and replicate this mechanism in aluminum and brass.

But as of now, our very simple little mechanism works.

Designing a simple Earth-Moon Orrery.

My eventual goal: to build a simple a simple Tellurion, an Orrery which shows the relative position of the moon around the earth as the earth revolves around the sun.

This will be a series of blog posts, documenting the good, the bad and the ugly.


For me the first step is to fire up Kythera and design the gear chain that controls the motion of the moon around the earth as the earth goes around the sun. (Now many such Orreries show the rotation of the earth, but we’re going to skip that for now.)

Ultimately we want a gear chain that then allows us to rotate the moon around the earth relative to the earth moving around the sun, with both moving in a counter-clockwise relative motion:

E-M Diagram


So here’s a question: what’s the relative motion we should use?

Well, it takes approximately 365.25 days for the Earth to move around the Sun, relative to the fixed stars around the solar system. And it takes 29.530 days between new moons–which means it takes that long for the moon to rotate to the far side of the Earth.

This means that there are 12.368 746 34 passes of the moon per solar orbit–which agrees with the Wikipedia article.

(Now the difference between a Sidereal month and a Synodic month is that the Sidereal month represents the movement of the moon relative to the stars. Think for a moment: as our Sun/Earth arm revolves once around the sun, the moon revolves 12.368 times around the Earth/Sun arm.

And as the moon revolves 12.368 times around the Earth/Sun arm, the Earth/Sun arm goes around once. This means the moon goes 13.368 times total around the sun–which gives us a sidereal month of 27.321 days.)


Lets find a gear system which does this.

So, opening the Kythera Gear Calculator screen, we enter our target fraction:

Emratio

There is an interesting ratio, which is extremely accurate, with some very interesting prime factors at the bottom of the list.

Since we need an odd set of gears (because we want both the Earth/Sun arm and the Earth/Moon arm to rotate counter-clockwise), the last gear ratio turns out to be a very interesting ratio, because the top prime factor 17576 = 263.

A little fiddling later, and I came up with the following gears:

Gear 1: 52 teeth.
Gear 2: 29 teeth.
Gear 3 attaches to Gear 2 with 52 teeth.
Gear 4 with 14 teeth.
Gear 5 attaches to Gear 4 with 26 teeth.
Gear 6 with 14 teeth.

Gear 1 is a fixed gear attached to our sun. The other gears attach to an arm which swings around our sun, and Gear 6 rotates with a ratio of 17576/1421 = 12.368 754 398, a difference from our target fraction of 6.515ยท10-5%.


Some fiddling later in OpenSCAD, and we come up with the following model.

Draft Mechanism

All the files are attached here: EMOrrery2.zip.

And the gears are out of the FormLabs Form 2 printer. Right now I’m printing the rest of the components, and we’ll see how this works out.


Ultimately a mechanism like this needs to be cut using brass gears; that’s how you get the lovely appearance and the lovely movement and beautiful presentation seen in commercially available Orreries. But the beauty of using a 3D printer is it makes prototyping fairly quick and easy.

How well this works out, I’ll know tomorrow.

Testing 3D Printing of Gears

Kythera is a product sold by Glenview Software for $10 which allows you to string together complex mechanisms using spur gears. It helps you design complex mechanisms quickly on your computer and export .STL files for printing on a 3D printer.

And today we’ll use it to build a test mechanism, in order to test how well we can manipulate the gears to create a simple example mechanism; in this case, a gear train which translates the motion of a minute hand to an hour hand.

Such motion works are used in clock making and watch making. And we can very quickly build the chain of gears, to see the whole thing in action.


First, fire up Kythera. Since we’re just creating a naked motion work, we can create a new document and delete the gear that is automatically created for us. Switch to the layer menu and add a new layer, since our gear system will require two layers of gears.

Next under the “Gears” menu, select “Create Motion Work”. Create a new motion work with a 12 to 1 ratio, and for our system, we’ll select the first proposed option labeled 8:32 10:30. This will create a simple four-gear system:

Kythera Motion Work

Switch to the Document tab and verify a few settings: our axle radius should be 1.1mm; this will fit a 2mm pin. The screw radius should be set at 2.1mm; this will fit an M4 screw. Let’s bump up the “shrinkage” value to 0.625mm; this will reduce our gears by 0.625mm radius per gear, so the gears “rattles.” Remember, if it rattles, it runs; objects printed on a 3D printer are slightly larger.

(Note that I’m doing this on a FormLabs Form 2 printer; you may need to fiddle with these settings depending on the technology you’re using to print your mechanism, including fiddling with the size settings for your gears.)

Now we want to export our gear train; call it “MotionWork.gbom”. This will also design a basic frame for us.


Open the layout.scad file with OpenSCAD that is generated in the MotionWork.gbom directory. In order to make our mechanism work we’ll need to make a few adjustments.

First, we’ll want to add cylinders to our first and fourth gear; this allows us to create axles on which we could in theory attach arms. We also want to join the second and third gear so they are printed as a single gear. We need to modify the top plate so our cylinders attached to our first and fourth gears pass through the top.

In OpenSCAD the results of all this editing looks like:

Modlayout


Now we need to generate the STL files for our mechanism. As we’re printing everything as separate components, we need to selectively comment out all of the pieces, only leaving uncommented the top plate, bottom plate, support cylinders, the first gear, the second and third gear fused together, and the fourth gear.

We then print each of the parts out, and assemble using 2 25mm x 2mm pins, and four 30mm long M4 screws and M4 nuts.


This is another test print, but one of the nice elements of Kythera’s “shrinkage” feature is that we know the gears should mesh and freely spin in a 3D printed mechanism without a lot of fussing around.

Of course the actual values you want to use for your gear size and shrinkage will depend on the printing technology. But the results (printed so that spurs are not inserted between the gear teeth, which in the FormLab’s PreForm application requires a lot of fiddling with the spur locations) does spin freely, and would make a good starting point for a gear train for an hour hand and minute hand on a clock.


All the files used in this model, including generated .stl files and OpenSCAD files, can be downloaded here: MotionWork.zip

Calibrating The Printer.

If you’ve ever tried to print something with precision dimensions on a 3D printer, you notice things aren’t exactly the dimensions asked. Sometimes it happens because the printer is miscalibrated, but often, it’s due to the technology.

Take, for example, the Form 2 Printer by FormLabs. This fantastic 3D printer uses stereolithography to print parts, and it works by shining a laser through the bottom of the tank, hardening the material in a thin layer. The part is mechanically separated from the bottom of the tank, positioned micrometers above the glass, and the laser runs again, hardening the next layer.

Now the quality of the prints are absolutely fantastic. The default printing uses layers 0.05mm in thickness, and can print layers with certain materials as thin as 0.025mm in thickness. This creates very detailed models–assuming you designed them correctly.

But here’s the thing about stereolithography printing: it works by shining a laser on a point, which then hardens the material in a blob around the cylindrical laser beam path:

HardenedSLA

Now what this means is that if you’re printing a part that has a precision sized hole, because (for example) you want it to precisely fit a pre-fabricated shaft rod, you need to print the hole slightly larger in order for it to fit snugly–and even slightly larger than that if you need the part to rotate freely.

And if we want to 3D print components for a clock, an orrery or a robot, we need to understand how much bigger we need to print the holes.

The same thing, by the way, applies to fused filament fabrication, such as used by MakerBot Replicator+: the print material here is a filament, a cylinder, and the process of melting and fusing the layer onto the previous layer causes the material to squish a little. This means your holes will be slightly smaller than on your 3D CAD drawing.

To solve this problem I’ve designed a couple of simple test print objects. The first has holes ranging in size from 0.5 mm to 3 mm in radius, so we can test and verify the size of the holes we need to snugly fit a shaft, and to allow a shaft to freely rotate.

Hole Test Gadget

In the above photo, I’ve shown a 2mm diameter rod. It doesn’t fit into the 1.0mm radius hole, as expected, given the discussion above. I suspect a 1.1mm radius hole would fit snugly but not too snugly. The 1.25mm hole fits very loosely, which indicates to me that perhaps a 1.15mm to a 1.2mm hole would be perfect for a freely rotating gear.

I’ve also created a second test print, with holes ranging from 0.9mm to 1.25mm in diameter, incrementing by 0.05mm.

Hole Test 2

This allows us to better refine the exact amount we want to adjust a hole so it is relatively snug, and so it allows a gear to rotate freely without wobbling.

The answer, by the way, is 0.1mm. A hole with radius 1.05mm fits snugly around a 2mm diameter pin, and a hole with radius 1.1mm rotates freely around a 2mm diameter pin. This means if we use 2mm diameter pins, anything that needs to freely rotate (such as a gear) needs to have a hole through the axis of 1.1mm in radius (2.2mm in diameter) to rotate freely but without wobble, and a hole of 1.05mm in radius (2.1mm in diameter) to fit snugly.


Note that all of my 3D designs are done using OpenSCAD, which allows you to design parts using a text language that specifies the relative position of all the parts and holes. The advantage is that it’s free, though if you’re not a computer programmer (as I am), getting used to designing stuff in this way can be a little daunting at first.

All files referred to in this blog post can be downloaded from here: HoleTest.zip