I was introduced to the idea of a none sequential clock by Bob at Hacman. The idea is two large gear rings with hours and minutes engraved on them driven by stepper motors. The numbers though, are out of sequence, and so each new minute and hour involves movement of the rings in a different direction and distance.
A picture paints a thousand words:
Bob's clock at Hacman. |
I've always had a fascination with clocks, and I really liked the idea of this one. The rings are suspended from smaller gears which are directly attached to the steppers. It's a bit big though, probably 1.2m in diameter. I thought I'd try making one a bit smaller.
My original plan was to laser cut the gears, using plywood for the rings and acrylic for the driving gears. To make it a bit more visually exciting, I introduced some idler gears on both rings. The idea being that a single gear at the top would drive the ring, and the ring would drive the idlers (this turned out to be an idea doomed to fail...).
I used GearGenerator to create the gears,
Gear Generator. |
OpenSCAD to produce the number layout. |
I then imported the 2D output from both these into my CAD package, and from here went straight to the laser cutter.
First design. |
So along comes 2020, and like many others I was looking for something to occupy me, and this seemed like a good place to start.
I started looking at electronics to drive the steppers. I decided to use a Wemos D1 mini as the controller as the wifi module would allow me to use NTP to automatically set the clock without user interaction. All that would be needed would be the WiFi credentials and the daylight savings settings, and a connection to Google's NTP server would do the rest.
Bunging some Pololu DRV8825 stepper drivers on a breadboard got me a platform on which to start the software development.
Untidy, but it works. |
I used the accel stepper library to create the motor step pulses. This library handles the acceleration/ deceleration for multiple motors, and uses the concept of a numeric position for the motor spindle which can include multiple spindle rotations.
After getting this running , it soon became clear that the small idler gears were causing the hour and minute rings to jam. The single, small cog on the stepper spindle is OK driving the much larger number rings, but these larger rings driving multiple, smaller gears caused far too much friction.
I resigned myself to losing the idler gears, and concentrated on implementing software to move the rings to the correct position.
Each ring is represented by an array of integers, each specifying the distance in steps to the next number. I began by running test software to count the minutes from 00 to 59 using a mocked clock interface which increments the minute as soon as the ring stops moving.
The idea is to have the clock find the '00' position using a magnet and hall effect sensor, then total the number of steps from '00' to the current minute, then move that many steps. Initially I set the ring to 00 by hand.
Somehow I decided the wooden clock looked a bit boring. So I decided to go for steampunk style look. The rings were replaced with clear acrylic, with the numbers to be illuminated from behind, the drive gears from brass.
I'd originally thought of it being a wall hanger but changed it to a free standing device during the re-design. A wooden base with an internal aluminium frame supports a curved top. The rear was to be laser cut birch ply with ventilation slots.
CAD view of the case. |
The rear of the case. |
First the brass gears. These were machine on my CNC router from 6mm brass plate. At first I thought to keep the acrylic rings away from the back plate by including a disk into the rear of the design.
This caused problems as the teeth of the ring sometimes caught on this, causing a jam. The solution was to replace it with an acrylic disk 2mm thick and of a larger diameter, and simply bolt this to the back of the gears with countersunk screws.
I was pleased with the way both drive gears turned out. I added an acrylic plate at the front to prevent the rings from slipping off the gears. The number fascia plate will prevent this too, but it means I can run the clock without the plate fitted.
The larger one had enough space for the obligatory time based Latin inscription (I spent 5 bloody years learning Latin and I intend to use that knowledge at least once.) The text was laser engraved, then filled with black acrylic paint.
The larger one had enough space for the obligatory time based Latin inscription (I spent 5 bloody years learning Latin and I intend to use that knowledge at least once.) The text was laser engraved, then filled with black acrylic paint.
Brass Cogs. |
For the curious it translates to "Time, commander of all things".
Really pleased with how it turned out.
The current hour and minute digits are isolated from the rest of the numbers by slots cut into the numeric fascia plate. The original intention was for this to be birch ply cut on the lasercutter.
Laser cutting the wooden fascia. |
The wooden fascia. |
The new style demanded brass.
I wanted to engrave the fascia with some time themed motifs. I found a few I liked, and experimented engraving these into a 1mm sheet from ebay. The material for the real fascia is 3mm brass plate at £15 each so I wanted to check the result before committing.
I used a 0.2mm PCB engraving bit on the router. The step down was set to 0.1mm and the feed rates really low (10mm/s), with a splash of cutting fluid. The plate was simply stuck down with double sided tape to the sacrificial bed.
Test filling the engraved brass. |
Initially I was unsure if I wanted to fill the engravings with black paint to highlight them. In the end I decided not to. Time to commit to the real thing:
Brass fascia after engraving. |
The electronics
Using DesignSpark I created a PCB for the Wemos and the stepper drivers.
PCB in DesignSpark. |
I used Flatcam to machine the board on the CNC. The last double sided design that I made for Leadscrew Buddy used tinned copper wire between vias for the top layer. This time I tried the true double sided routing feature and it worked brilliantly. It was tinned with a tinning solution from ebay.
Double sided PCB CNC routed with Flatcam. |
The next PCB needed was one to mount the hall effect sensor and some LEDs for the acrylic back illumination. These were simple single sided affairs initially using 5mm orange LEDs for that 'valve glow' look.
5mm LEDs not good enough. |
The current surface mount current limiting resistors and hall effect device are underneath. I'm using neodymian magnets in the rings to indicate the home position and the magnetic field from these will go straight through the PCB.
I also added a small MOSFET to give me control over the LEDs.
When mounted, these didn't work very well at all. The lens of the clear LEDs gave such a tight focus at short range that the light was not sufficiently diffused within the acrylic ring to illuminate the engraved numbers. I redesigned the PCB to use two banks of four surface mount LEDs. I also dropped the FET, deciding I didn't really want to control the LEDs after all.
LEDs are great but resistors too hot. |
This gave much better illumination of the numbers.
But, although rated sufficiently, the current limit resistors were getting much hotter than I would like. I made a third board with one resistor per LED. Having the router makes it so easy to quickly turn around changes like this.
I would have got away with it too, if it wasn't for those meddling kids....
Showing off my prototype creation to my teenage offspring was met with: "Yeah, it's OK but that whining noise is terrible. Are you trying to keep us away?"
Hmmmm.
The noise they could hear was the stepper drivers applying holding current to the motors. Being ancient the frequency was way above anything I could hear. Trouble was, I'd hard wired the drives to be permanently enabled. So, I re designed the Wemos board to have the stepper enable under software control. While I was at it, I replaced the 7805 voltage regulator, which was also getting hot, with a small switch mode regulator from Murata.
With the new PCB in place, the kids were (less) whiny.
Up to this point, I'd been testing with neodymian magnets held into holes in the rings with insulating tape. The silver of the magnets was distracting so I turned some small brass plates to cover them up. These and the magnets were held in place with epoxy.
Brass plates hide neodymian magnets. |
The Clock Case
The base of the clock was made from an old chopping block donated by a friend. Unsure what wood it is, but it seems reasonable quality. It was CNC machined, stained and varnished.
The CNC routed base stained and varnished. |
The holes are for M4 brass inserts which fasten the clock frame. These were pushed in with the milling machine quill.
Pushing brass bushings in with mill quill. |
The case frame is formed from 9mm square aluminium bar.
The frame and base CAD. |
Shaping one part of the frame. |
The partial frame mounted on the base. |
The curved sections of the frame were the biggest challenge. I could have CNC routed them from 9mm aluminium plate, but this would have been expensive and wasteful. So the decision was made to get a ring roller.
I don't have room for a large one, and the cheaper Ebay offerings did not inspire me until I found Cyclops Designs in Sheffield. They make small rollers good for up to 10mm square. They are made to order and I found it to be of excellent quality.
So began my first ever experience of using the ring roller.
Cyclops Designs ring roller in action. |
This was about as difficult as I imagined. The ring roller performed well, but I was a novice trying to match a CAD designed part. I took some time to make two semi circular pieces of the correct radius.
Once made though, I stuck a 2D print of the hole locations to each piece to be punched, drilled and tapped to M3.
Once made though, I stuck a 2D print of the hole locations to each piece to be punched, drilled and tapped to M3.
Paper template helps to align holes. |
Arc has been welded to case frame. |
It was still a bit off so I got the sander to it.
Cleaning up my amateur ring rolling. |
2.5mm transfer punch used to set hole positions. |
Again this wood was stained and varnished.
To finish the case off, four brass feet were turned on the lathe. I modified the Leadscrew Buddy software to give me a step function software. A step distance is set and when the function is activated the carriage is moved the step distance from the current position. This makes producing multiple parts of the same length a breeze.
For added retro I laser cut some self adhesive green felt for each foot.
All the old clocks I have have felt pads. |
The feet are held in place with M4 bolts into more brass inserts. I couldn't machine these at the same time the base was made as they are on the underside, so I knocked up a small jig to help me align the feet.
Simple jig to position the foot. |
Up to this point I had been using standard steel bolts to hold everything together. These were starting to clash with the brass, and in some cases were just too big and needed trimming.
Ugly steel screws on brass cog. |
I decided to turn a full set of screws for all the outward facing fittings. For more steampunk the obvious, and easiest screw head style was slotted cheese. These are available to buy, but I couldn't find any with the old school look I wanted. All brass fittings also removes the chance that the magnets will stick.
Again, Leadscrew buddy helped me turn down brass bar to the correct size. The threads were cut with a die and holder on the lathe.
Cutting a thread onto a screw. |
And the slots were created with a slitting saw on the milling machine.
Cutting the slit in a brass screw head. |
Also made were some brass stand offs to hold the brass fascia away from the back plate. And so after several hours in the workshop.
A selection of the handmade screws and spacers. |
The smallest of these screws were to hold the acrylic plates to the drive gears.
The smallest hand made screws. |
To finish off, a piece of self adhesive felt was laser cut to stick behind the fascia, protecting the acrylic from being scratched by the brass plate.
The case rear was laser cut from birch with plenty of ventilation slots.
Laser cutting the case rear. |
Telling the time
Powering up, if no WiFi network is found, the Wemos becomes an access point. Pointing a browser at it's IP address allows the network credentials to be entered and stored. At the next boot, the device connects to Google's NTP service sets the time and, using the excellent Arduino Timezone library, adjusts itself for daylight saving.
I tried a few homing strategies, but going as fast as possible to detect the magnets in the ring, stopping, then reversing a known distance to get to zero seems to work best. Seeking from the zero position to the current minute can take some time as it has to sum all the distances from 00 minutes to 'now' minutes. This is a one off at first power up.
The offsets between consecutive digits are positive and negative to make the transitions a bit more dynamic. After the power up calibration, no transition takes longer than about 5 seconds.
Overall I'm pretty pleased. It's not really practical and a bit noisy. Certainly not a bedroom clock. More of a talking point piece. I really enjoyed making it,though and learned a lot in the process.
No comments:
Post a Comment