Virtual Precision Clock

8organicbits1 pts0 comments

Virtual Precision Clock - mitxela.com

Virtual Precision Clock<br>13 May 2026<br>Progress: Complete

Clocks... clocks! Lately I have built so many precision clocks that my brain has rewired into a clock-building machine. I breathe in clocks and I dream of the racing red digits.

It's not like I'm complaining about its popularity, but the increasingly long waiting list combined with my inability to delegate has made the clock production a round-the-clock endeavour.

I decided it was time for a break. Something different, a relaxing weekend making something purely for fun. I am, it seems, in the tiny minority of people who actually enjoy writing software. Furthermore I enjoy writing vanilla javascript. Nothing calms my nerves quite like staying indoors and fervently hammering out some JS.

Ideas, like little golden particles racing down from the cosmos, sometimes pierce my withered neurons and trigger a chain reaction. When this happens I find it best to run with it and ask questions later. What I'm trying to say is that I spent my "not doing clocks" weekend creating a virtual precision clock.

You can play with it here.

Before you get too excited, this is a toy and is nowhere near as accurate as the real thing. The precision is purely decorative. But for those of you yearning for one, here's a simulated a Precision Clock Mk IV for comfort.

Now let me recount the tale...

Modelling

It occurred to me that I didn't have an accurate 3D model of the clock. KiCad can export the PCB, but that depends on you having set up 3D models for all the components. The libraries have recently switched to keeping everything as STEP files, which is probably a good thing, so I started by switching all the generic components over to their STEP equivalents.

If the reader is not familiar, STEP files are boundary-representation, very useful if you want to edit the model later, as opposed to mesh files building everything out of triangles.

The 7-segment displays I originally modelled in OpenSCAD, back in 2018, importing the thing into Wings3D to set the colours as was customary at the time. The git history tells me that in 2021 I recreated the models by importing the OpenSCAD code into FreeCAD and somehow producing a step file as a result. All I can remember is pain.

Anyway, there are slight differences between 7-segment displays from different manufacturers, so chasing an "accurate" one is a fool's errand. For now I lazily tweaked things so that the positions were symmetrical.

I also modelled the phototransistor, just finding a 5mm LED model and flattening it in FreeCAD.

The next "step" is to bring in the 3D printed and laser-cut parts. I created some basic footprints, just on the Fab layer, to represent these.

The laser-cut vector files were imported into FreeCAD and extruded. I used the Fasteners workbench (an addon) to bring in some nuts and bolts. Overall, it wasn't too difficult, and it only occasionally crashed!

And so, sooner than anticipated I had an almost-up-to-date model of the clock.

To get the full model, we could just translate and rotate the pieces so the hinge links up before exporting from KiCad. If they butt up completely the board outline fuses but we can add a micron of gap if needed. But really, wouldn't it be better if the hinge was functional?

Assembly

FreeCAD 1.1 has brought with it a whole load of improvements so I was keen to try them out on something pointless. The assembly workbench has seen a lot of work.

Two revolute joints were used to snap things into place.

I didn't model the cable that goes across the hinge. In Fusion 360 I'd have attempted it, but here I think we need to be realistic.

The assembly functions. I entered angle limits for the joints and we can fold and unfold the clock.

Unfortunately, the double-link of the hinge seems to cause the solver some confusion. Near the ends it snaps wildly between folded and unfolded positions.

It's possible to work it by alternately grabbing the different pieces, so I guess it's technically functional. Ideally we could set a driver so the two joints are always proportional to each other. I couldn't figure out how to do that, but I was able to create a simulation and enter formulas for each joint ( time*pi/2 etc) and then drag the animation frame to fold and unfold the clock.

The simulation stuff is all new to FreeCAD, so I can't be too critical. Mostly I think the user interface could do with a lot of improvement. Even dragging the slider for the simulation seems to jump around erratically. I would advise the developers to steal as much as they can from Blender, where these problems have all been solved already.

Reapproach

Unsatisfied, I screenshotted the front of the model, and whipped up a javascript demo where you could fold and unfold the clock in a pleasingly gentle way. At this point, the obvious next step was to illuminate the digits.

Before I knew it I'd reimplemented most of the modes of the clock. It would be lovely if we could...

clock precision model step clocks freecad

Related Articles