Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

Clockwork Library & Printable Clock Script

by syvwlch, published

Clockwork Library & Printable Clock Script by syvwlch Apr 22, 2011

Featured Thing!

1 Share
Download This Thing! Customize Order This Printed Tools & Utilities

Thing Info

38236Views 7097Downloads
Report Thing


Winner of the Pattywac Makerbot United Challenge for collaborative design: http://www.makerbot.com/blog/2011/05/16/pattywac-makerbot-united-challenge-winner/

Thank you team! :-)

Video of the first ticking powered escapement mechanism:



Several bugs have been fixed since this release, and the current tip-of-the-spear for development is a simplified 2-gear clock with only minutes and seconds.

Current development version to be found on git hub here:


Current version of the 8-Gear Clock (revision D):


Current bleeding edge development version of the test jig:


Current repository for the latest version of the clockwork library:


Thanks to RustedRobot for his continued assistance debugging the clock!


This is both a derivative of the printable clock PoC, and of my escapement library: http://www.thingiverse.com/thing:7822 . The involute gear profiles are from the MCAD library.

(EDIT: The clock got a mention by Cory Doctorow on boing boing!

http://www.boingboing.net/2011/04/23/model-files-for-a-wo.html )

I cleaned up the code so it would render faster, moved all the gear work into the library, and created a laidOutToPrint() module to facilitate creating the STLs of the individual parts. I included an optional print volume visualizer, so you can check every part doesn't exceed the printer's capabilities.

The assembled() module is still fully animate-able, and I've added colors to help see if everything meshes properly.

The clock itself now has clip-on hands, front & back frames, and most importantly, I switched to a different set of gear ratios (3.2, 3, 2.5 & 2.5) which allows for bigger shafts by keeping the ratios small.

Assuming an 80x80x80mm printing volume, you now have a bit more than 12mm (almost half an inch!) available for the overall diameter of the shaft, the two sleeves that slide over it and the necessary clearances.

I think this configuration is close to final, except for the escapement, which will need fine-tuning... but without re-printing the rest of the clock.


Print one of each STL file, or fiddle with the script, check your work with assembled(), and then generate a new STL for each part with laidOutToPrint(), and print those.

The current configuration requires four shafts to slip the sleeved gears over, outer diameter 2mm with a clearance of half a millimeter either side. I suspect it might be possible to simply screw an M3 bolt into each end of the longest sleeves and to widen the holes in the frames a tad.

I'm unfortunately rather sure the escapement won't work properly as is, but it would be nice to know if the rest of the clock does, i.e. if you can turn the escapement wheel, and have the gear train run smoothly and the three hands spin around.

I'll be working on the escapement next, but whatever I come up with in that regard should be backwards compatible with this design, with only the need to print a new escapement wheel, escapement and pendulum.

Thing Info

38236Views 7097Downloads
Report Thing


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

All Apps

This App connects Thingiverse with Makeprintable, a cloud-based mesh repair service that analyzes, validates and repairs most common mesh errors that can occur when preparing a 3D design file for p...

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

question: is this a working design? or nearly working design? :)

I have printed the gears from the 4 gear clock and playing with them, also thinking how to reduce friction.

if the shafts were build with non-printed material, maybe metal, would that help. is having an all 3d printed clock a design objective?

another thing is i would use silicone grease for the

also, i will try rotary shafts from some crashed rc helicopters instead of the m2 screws.

btw, i still have not figured out how the pendulum piece works.

i will try the silicone grease, and the steel shafts and report back tomorrow.

i really want to see this working!

It is definitely still a work in progress and not a working clock, yet. :-)

I would say that a 100% printed clock is a long term objective, but we're not shooting for it right now. If you can get this to work with 'vitamins', i.e. non-printed parts, that is definitely a step forward and a major accomplishment we can all benefit from!

The pendulum piece is the most compli
cated, and we can't really fine-tune it until we get the friction problem solved. rustedrobot and I are working on a new frame-system for all the clocks which will hold that part at the right distance from the wheel that has the spiky teeth, and then you will have something to hang the pendulum from

Can't wait to hear back from your experiments, and welcome to the printable clock project!


Hi cambazz. I've been using M3x50MM screws (what I have lying around) in my tests so far and have been drilling out the holes to accommodate them. I've had issues with the drilled out holes not being perfectly perpendicular though. I'll probably be switching to properly printed 3mm holes moving forward in my tests though.

The minutes
amp; seconds only test jig version now has 3mm printed holes, stock!

I should rename it the rustedrobot edition. ;-)

Oh, the discussions are a bit scattered, with important parts of them going on in the Other People's Copies link where rustedrobot has posted pictures of his prints:


It would be nice if the pendulum was in parts... like, have a way to attach the weight using a dowel and a set screw or something.... that would get us closer to an adjustable pendulum without making it harder to print... does the weight of the pendulum matter? pockets for pennies? idunno.

syvwlch - in reply to ssd

Weight does not matter per se for the period, which is set by the distance between the axis of rotation and the pendulum's center of gravity... So by placing a heavy weight at the swinging end, you keep the overall length shorter.

Having said that, you want a pendulum with enough inertia to keep swinging but not so much that the escapement doesn't provide enough impulse to keep it going.

For this clock, the escapement beats twice per pendulum period, and drives the seconds hand... so we need a two second pendulum, which wo
uld need to be a meter long. About seven and a half times longer than the clock is wide :-)

The pendulum period follows the square of the length, by the way, so if we introduce a 2:1 gear between the escapement and the second's hand, the pendulum would be 1/4 the length, or 25cm. Use a 3:1 gear and it would 1/9 the length, or 11 cm.

Since I'm starting to get some really valuable feedback from Makers that have printed and assembled this Thing, I figured I would say thank you by entering it in the MakerbotUnited challenge (Original idea by Sir MakeALot) and opening up a comment thread for these contributors to speak up.

I can already name rustedrobot, barrychuck, and MakerBlock provided some very handy insight on how to make a design printable in the first place (tolerances for tight and loose fits, in particular)... but I think by the rules, you guys have to actually comment here:


Extreme comment! =-O


Oh, and how could I forget DaveD's help on the previous version. He found a bug in my code which would made the gears fell to mesh properly. Big help right there :-)

Here is the little animated gif I threw together showing how the escapement is supposed to work with the escapement wheel. It resets after one pendulum swing back and forth, which is why it looks like the wheel's hub ratchets back. :-)

Based on the animation, this escapement SHOULD work, but the tolerances are so fine we won't know until we try it... which means I need to design an add-on to the frame to hold the escapement at the right distance from the wheel.

While your at it, please add a tiny bit of center distance between the gears for freedom of motion. It could be my calibration but the mesh is too tight stock. Even if there what backlash it doesn't matter in this application.

I left the clearance parameter for the involute_gear MCAD library as a top-level parameter, and that would be the best way to fix that, rather than changing the axis separation (too many knock-on effects). Backlash is also adjustable.

Clearance basically increases the depth of the "notches" (dedendum) without symmetrically increasing the height of the "pegs" (addendum), thereby giving the gears a little wiggle-room along the center-to-center axis.

How much extra room would you say you need? 1mm enough?

That sounds right. I'm trying a test where I reprint the endplates using scale of 1.02 (one gripe of rep-g is not good measurement tool).

From the looks it will be just right.

Actually, yeah, that's the best way to fix it given the mass of gears you already have lying on the work bench. :-)

So, scaling by 1.03 was perfect dead on for the 2 end plates. The next issue. Without changing to some ball bearings, I don't think we can get this to work driving by a weight system. From the minutes hand (from the gear itself) is about the limit of where I could spin mine for the escapement to work. There is just too much friction and binding to work as a "real" clock driven from the hours drum. Mine is very free spinning,just as the gear ratio increases-so does the torque required due to friction. It's a beautiful work of art and demonstrates the possibities of what can be done. This is not to say it won't work as a demonstration clock. We just won't get days of operation like a real clock would (unless you have a really tall elevator shaft to drop the weight in). Also, for those gettting the bright idea for weights and pulleys, there is a limit to how much weight we could pull and then, it still binds on the critical 3 concentric shafts (really part of the problem). We need to reduce friction caused by heavy side load on shafts, drive it from someplace other than the hours gear directly. Some creative pockets to allow gears to be supported on the longer shafts by ball bearings on both sides would do wonders. The space is there-and I know I've seen bearings in RC cars with large inner diameters and ony slightly larger outers that would work.

Interesting... we could drive if off the escapement by putting the drum there, but then yeah, we'd only get a minute of drive per winding of the string! Still, a valuable step forward if it gets us to a ticking clock! Halfway there would be to drive if off the minute gear... that could get us a few hours' worth of run-time, enough to gauge accuracy. :-)

Bearings would definitely solve the problem, if we can fit them, but that's a lot of vitamins for the purists among us.

Say, would like to fork off the bearing-based design? I can help you make sense of my code and ensure it'll be easy to work in the final escapement when we get one, if you want
to go that route.

I add that all the gear modules, pinionWheel(), pinionDrum() and pinionEscapementWheel(), have parametric hubs for height, bore diameter and wall thickness, and so fitting a bearing in there should not be too hard.

For the gears without hands, we could just run then straight on the metal shaft, no concentric sleves.

For the gears that bear a hand and thus HAVE to be on concentric shafts (at least in conventional clock designs, eh?)... either we leave that stack bearing-less (we should have reduced friction
by 75% already with the other shafts), or we need to be smart about where to put the bearings...

Further thought on the whole arrangement. While the current design is compact, the issue is massive friction from plastic on plastic. Real clocks also don't use this design and a simple change making each gear ride on the metal shafting directly will reduce friction. I can try a very simple experiment where I use long 3mm shafts, break the current long plastic shafts on the gears so that they become indepedent. Also, the front and back plates really need to get tied together and maintain a square relationship-but we knew that anyway for the escapement. In all, its very possible. Also, I was thinking a 5th shaft and gear for the actual tension drum to drive the clock.

Yeah, friction is clearly a problem, altho now that we know I got the minute-hour gearing wrong, it's going to take 5 times less power to drive the whole train. Silly me. :-)

I tried again with only two gears between hands (6:1 and 10:1, say) and the issue remains that the pinion (the smaller gear on the wheel) still gets very small, which is hard to print and doesn't leave enough room for even the thinner sleeves... so we might be stuck with four gears per hand for no

The idea of placing every gear directly on the metal shaft is a sound one, the only downside is we need a different way to drive the hands, perhaps a dedicated shaft off to the side, running off the real gear train? The main advantage is that we would be free to make THOSE hubs as fat as we want
, possibly with room for bearings, including printable ones. The disadvantage is adding three more gears to the whole thing.

Lastly, on the frame, it is actually a non-trivial task, given the size constraints on individual parts... any ideas?

I think I had a minor epiphany on the topic of driving the gears directly on the metal shafts. With the exception of the nested hour/minute/seconds gears, the remainder could work in the original configuration. I'd misread syvwich's original BOM and the reference to 8 M2 screws and used 4 50MM M3 screws with nylock nuts. With that length of screw it eliminates the need for the narrow shafted gears to continue through the gear above. It should be possible to shorten the length of the narrow shaft to provide shelf for the gear above to rest on, while shrinking the larger diameter shafted gears back down to fit the M2 or M3 screw!

Yup, that would certainly work, and eliminate most of plastic on plastic friction from 3 of the 4 stacks. I think that is an important enough change, along with the 60/12 gaffe-fix, to warrant a new release. Might be nice if I included the escapement shaft in the frame this time, too.

Nicely done, both of you!

One other thing that i've done on the latest test of the 12x60 scad file is add an X cross brace to the front and back frames (corner to corner). It will hide a bit of the pretty gearing, but should add rigidity to the structure. I'm not sure it wil be needed in the new release (or maybe only on the back?) but figured it was worth a try.

That is another great idea. :-)

I'm working on making the code in the script a little more user-friendly, so more people can dive in and make improvements!

Do you want to publish the improvement as a derivative, or just the frame as a non-stock part for clock-modders? :-)

I'd rather not start forking until we have a working 1.0. For now, here's the code. It should work for both the front and back frames. it could also use some cleanup as it makes assumptions that most of the holes will be the same size (except for the hour/minute/seconds location).

Placed into the frame() module:

( below sleeve_radius4=... )
hyp=sqrt(pow(axis_separation-bore_radius22, 2) 2);

( after ring() inside untion() )
difference() {
translate([-axis_separation/2,axis_separation/2,height0/2]) {
union() {
eight0], center=true);
cube([hyp,sleeve_radius0,height0], center=true);

        cylinder(h=height0*2, r=bore_radius1, center=true);

Speaking of a separate shaft for the hands, we could place it at the center of this configuration, if we can think of a good frame design for it:

Ok, so "Pro" tips if you want this to work. Use a heated build platform (ABP belts are not flat enough). Wipe down your HBP when cool with acetone (only when cool) to remove any fingerprints since any curling at an edge will ruin the print. Level your platform with extreme precision.

The main reason for these tips is that stock, there is no room for any warpage on the teeth. I know we could fix this in openscad, but even then-these tips are the only way it's going to work for "most" people.

So far-this is amazing and everything works! Really nice fit on all the parts!

ng using .32 layer height, .40 nozzle, profile tuned using the "profilinator", MK6+ heater upgrade. I also turned off reversal and will just trim the minimal number of strings until I get a better tuning on reversal. Pics soon!

Awesome! Thanks for taking the time and plastic to make this happen. :-)

Would thicker gears pose fewer warpage problems? The issue would be that the shafts and sleeves would have to be longer, of course... but I can think of several ways to get around that.

I've generally found that thicker parts stay hot and pliable longer and with more layers you end up with a greater strength pulling at the corners. Thinner pieces don't have as much time to do the pulling before they cool. I've had 0.5" thick pieces pull the kapton tape and the aluminium heat spreader off the heater pcb at times. Active cooling may help.

Also i've found the cool plugin for skeinforge is very helpful so far with this print. (I think its taking 30 secs/layer for the tall, thin parts.) But the result is fantastic.

Actually make that 0.75" thick pieces. Just went and measured.

Aha... Interesting. So thinner parts actually warp less?

I can't speak for everyone, but for me that seems to be the case.

This is going to be one of those tradeoff situations. What I was getting at is the smaller pinions could be thicker to accomodate warpage of the larger gear teeth, but making longer shafts is a problem too. Right now, it seems it's going to work fine (I'm on the third gear and al shafts and everything fit inside each other perfectly. I guess what I'm getting at is this is the ultimate "calibration" print. Find out how god your printer really is by trying to print part 10 clock escapement, followed by a gear such as part 9. If those go well, you can easily just print the rest.

7 parts printed so far!

Can't wait to see the pictures and find out if the gear train works without needing too much torque... Again, thanks for printing this out. :-)

first pics


You know, looking at the picture of that pinion wheel on the printing platform, I understand why the MCAD involute_gear library doesn't make the tooth profile more detailed. It clearly wouldn't make a difference in the finished product here...


The previous instance of this thing ended up illustrating a post by Cory Doctorow on Boing Boing about sharing digital models. I feel like I've just earned my Maker merit badge. 8-)


Ad majorem Thingiversi gloriam! :-)

This is looking fantastic! :)

Thank you. :-)

I've learned a lot getting this far, that's for sure.