3D printed Enigma October update.

October 2nd, 2017

Just a quick update. I made another blurry film.

I have made progress on the keyboard and have that mechanism all worked out now. I am not sure I am 100% happy with it so it might get redesigned and reprinted! The mechanism of it is fine. Just minor changes to make it easier to assemble. In fact after making that film I already changed the little springs to something different.

I also created and printed onto clear plastic sheet the fonts for the keys and the lamp board.

I have also decided my machine will be based on the Polish Enigma Double rather than the German Enigma just because German Enigmas have been done before (in fact you can buy incredibly accurate replicas here already: http://enigmamuseum.com/replica/) and I don’t believe the Poles get enough recognition for what they achieved.

I’ve posted links to it before and there is a ton of information online about it if you search.


3D printed Enigma keyboard.

August 6th, 2017

First another film. Sorry for the blurriness again, really need a better camera! Canon Ixus 175 is rubbish! Don’t buy one!

I have been busy working on the keyboard mechanism of my machine. This will vary a lot in actual mechanical details from an original machine as I am using totally different switches. The original Enigma used metal contacts actuated by pins though the shafts of the keys. Two rows of keys (of the three on the keyboard) use compression springs on the key shafts but the third, top row, actually uses small tension springs. My mechanism is considerably different.

I am using modern micro switches in mine as they are easy to obtain and come in standard sizes. To wire the Enigma up correctly you need what is called a double throw switch. This switch has three contacts, a common and then two outputs, one active in each switch position. In the real Enigma machine the key switches swap the current from being an input to an output. The switch is wired so the common goes to the entry wheel (via the plug board). The NC (normally closed – key up) contact goes to the lamp matching the letter of the key and the NO (normally open – key down) goes to the battery positive. When a key is pressed the switch in it connects that letter to the battery. The current then flows through the plug board, into the scrambler (entry wheel, three rotors and reflector) then back out of the scrambler to a different key (NEVER the same key – one of Enigmas weaknesses). That key, being up, directs the current to its correct letter lamp.

I started by modelling up small parts of the mechanism. I am using the same external dimensions as the real machine for the keyboard itself and the keys. I made a base plate with little pockets that the micro switches press fit into. I only printed a part of the whole plate for these tests.

IMG_0878_1

I then set about making some kind of cam to actuate the switch as the key is pressed. For the shaft of the keys I am using 1/4 inch aluminium rod. I can 3D print shafts but they aren’t really smooth or strong enough so don’t provide a very nice action. I know some dozy twat will come along and say “the machine isn’t fully 3D printed then” but having one 100% 3D printed is somewhat impossible so I am not claiming it’s fully 3D printed. I could 3D print a static model I guess but a working one will always need some non plastic parts of course.

I started working out how to do a cam and the basic idea is very simple. A press fit collar on the key shaft that has an appropriate profile to actuate the switch as the key is pressed. I started playing about with ideas. Luckily small parts like this are quick to print so you can try many ideas (rapid prototyping).

IMG_0865_1_1

A simple round collar with a flat on the side worked but the issue then was that the key shaft is free to rotate. You could use square shafts in square holes to solve that issue but that’s a lot harder to engineer. To stop the rotation happening I ended up using the body of the switch itself. I extended the cam collar so it had little flat extensions to it. These are sized to be just wider than the width of the switch itself and they slide up and down the sides of the switch freely but prevent the key shaft from rotating.

IMG_0880_1 IMG_0876_1

The other thing I did was make the hole in the base of the cam wider than the shaft. This is so there is room for a spring that fits around the shaft and up inside the cam. This spring will cause the key to pop back up after it is pressed. I have ordered some appropriate springs from China (thank you Aliexpress!) so am waiting for them to arrive now.

To test the whole mechanism I printed a small model of one key. You can see it below with the key fully down then fully up.

IMG_0870_1 IMG_0871_1

I think on my machine the keys won’t move up and down as much as on a real machine. You only need around 10 mm maximum movement to actuate the mechanism to step the rotors. My key mech gives me 11mm of movement currently. I can add up to another 5mm to that if needed. The other tricky thing is each of the three rows of keys moves a slightly different amount. I should be able to compensate for this by changing the profile of my cams. This will take some trial and error but should be workable. Of course the key needs to move the rotors THEN actuate the switch. I do know from a film that James did for me that the keys on a real machine go all the way down to the body. On mine they will probably stop a little short.

The whole mechanism holding the keys consists of three parts. The bottom part holds the switches. Then there is an upper part that has supports to press down on the switches to hold them in place. That sits directly under the actual keyboard, which I have printed to the same dimensions and profile as the original so the keyboard layout will be identical although my mounting holes are in different places. The whole lot is held together with the same aluminium rod as the key shafts. I drilled and tapped these on the lathe to make spacers.

IMG_0873_2

There are spacers under the bottom layer that attach the keyboard to the base and hold it the correct height above the see-saw. These I tapped both ends then I added threaded rods (cut down machine screws) into one end. These threads are Loctited in place. These threads pass through the switch plate then the top spacers are screwed onto these sandwiching the switch plate between the spacers. The top plate sliders over the spacers. Then the keyboard itself sits on top of this plate and on top of the spacers. Screws though the keyboard hold everything in place. The pictures below should help explain.

IMG_0881_1 IMG_0882_1 IMG_0884_1

When I make the base I will add in stops that go under the see-saw part to provide physical limits on that. I will also add in some extra supports for the middle section of the keyboard to stop that sagging. The original machines did have an extra middle support there.

The key tops need some work too. I mentioned in the film using my little laser cutter to make plastic windows for the key tops. This will definitely work and I might do that but I have ordered some 12mm glass microscope cover slips and I am hoping those will work so I can have real glass in the keys. I need to do some work with the actual key top printing. These are printed in two parts and I have the model complete but I need to play with my printer settings to get them to print very cleanly. This is so they will press fit together nicely. I also need to create the font for the key tops in the same was as I did the font for the letter on the rings of the rotors. Then I need another font for the lamp board. They are all different and it really annoys me! I thought the Germans were more ordered than that.

I have discovered there is a book called “Inside Enigma” by Professor Tom Perera which you can buy from the Radio Society of Great Britain online shop that apparently has pictures of the insides of the machines. This probably would have been a great help before I started. I have ordered one but it hasn’t arrived yet. Prof. Perera is also involved with the enigmamuseum.com site where you can buy real machines (if you have around a quarter million $US to spend)!

I know there were many different models of Enigma, I am not sure exactly how many, so I am really looking forward to this book arriving.

Making the keyboard made me realise how much wiring there is going to be in this bloody thing. It’s actually going to be quite tricky wiring and assembling everything. I still need to make all the little brass contact pins for the rotors (156 of them) as well as the 26 key shafts, caps and the cams. I also need to model the lamp board but that should be fairly straight forward (I hope) and the second part of the base that the keyboard and lamp board attach to.

So still lots to do!


Enigma progress update.

July 15th, 2017

Right, an update and another badly made film!

I am at the point now where the basic mechanism of my Enigma machine is proved to work. I don’t have a keyboard yet but the mechanism the keys operate on, the pawls and rotors and so on, are all working mechanically. I won’t do the electrical parts until later.

Apologies for the bad filming and the gloves. My camera is not great and it’s bloody cold here!

In other news I have started a new job, back to software testing and eventually test automation. It’s nice to not be going backwards financially again! I am working in the city for a startup based on The Terrace which is amusing as when I first moved to Wellington I lived on a flat on The Terrace and used to travel by bus to Miramar to get to Weta each day. Now I get to do the exact opposite and travel from Miramar to The Terrace. I find working in town is great, even with the commute (30 minutes on the express bus), since I get to use the library again and then get time to read. So I have been reading everything I can about Bletchley Park, Enigma, Ultra, cryptography and so on. All fascinating stuff.

I am currently reading “Enigma: How the German Machine Cipher Was Broken and How It Was Read by the Allies in World War Two” by Wladyslaw Kozaczuk. This is a great book explaining exactly what the Poles did with Enigma, something that has been woefully under reported over the years. Basically, before the war, they completely broke Enigma and it was their work that really helped the British with their own code breaking during the war.

The three mathematicians were Marian Rejewski, Jerzy Różycki and Henryk Zygalski but there were others who played a huge part in it all including French military intelligence. There is a brief description about it all here: https://en.wikipedia.org/wiki/Biuro_Szyfr%C3%B3w

The story of what they did and and how it all came about and what they actually went through is totally fascinating. It would make a excellent film if they stuck to the facts (so don’t let Americans make it and if the British do, someone keep a close eye on them). As I learn more and more about the history behind the Enigma machine the film The Imitation Game annoys me more and more! But I suppose I have it to thank for getting me interested in all this in the first place.

I am currently looking for a copy of that book (the 1984 edition – the later reprint isn’t as good) but it’s quite expensive!

Anyway, these are some close up pictures of bits of the machine to make up for the blurry, wobbly film!

IMG_0824_1 IMG_0856_1

Printing the new side piece with extra stiffening. And the mounting foot printed as a separate piece.

IMG_0840_1

The pawls with brass weights so they always fall into the rotors. You can see the little buffers they pivot on when the keys aren’t pressed. On the real machine the pawls are spring loaded but I was too lazy to do all that! Given my Enigma machine doesn’t have to operate in the back of a half-track while invading France I feel it is OK to do a little simplification!

IMG_0841_1 IMG_0854_1 IMG_0855_1

The sprung loaded pieces that keep the rotors in their fixed positions but that allow them to ‘click’ around. I still have a little wracking on the two brass shafts that these spring loaded levers work against so I will add a printed stiffening piece joining the two brass tubes to the right of the levers in the picture above.

IMG_0845_1

The reflector and the lever and ramps that push it into the rotor stack. The brass rod at the top stops the reflector from rotating.

IMG_0857_1

The keyboard plate axle mount. The base plate is printed with raised edges into which the mounting brackets fit tightly against to ensure the positioning is totally accurate.

IMG_0842_1 IMG_0847_1 IMG_0849_1 

Showing how the pawls engage the ratchets on the rotors. You can see in the last picture how the left most rotor is in it’s notch position which means on the next key press the middle rotor will move along with the first. The third rotor won’t move since it’s pawl is riding on the edge of the rotor and so it can’t engage the third rotors ratchet to move it.

So, next I want to start looking at the keyboard and how that will work. I have a ton of small micro switches so need to work out how to make the keys, how to add springs so only the key being pressed drops and how to make it so the key travel first moves the rotors and only then engages the switch. I should probably order a bunch of spring off Aliexpress now I think of it!

I am also going to reprint the reflector and entry wheel at some point. Each has a tiny lip on the outside edge that catches the rotor stack when you try to insert/remove it. It doesn’t affect the operation of the machine, it just annoys me! I will also add in pockets for more hex spacers to attach the bolts to. Currently the plastic is just tapped for the screws and while this works I like the idea of having nylon threaded inserts in there better. That method worked very well on the rotors themselves.

Finally it is hard to say how many hours I have spent on this project so far. Learning Fusion 360 takes time and there is much printing of parts, seeing how they work then modifying them. I don’t think any part I have made is exactly the same as in the real Enigma. Everything has to be redesigned and remade.

IMG_0861_1

This is my box of experimental parts. There is a good 1.2kg of printed plastic in that so far. These are all parts that didn’t work in the machine, not failed prints. I actually get very few failed prints these days. The printer is working extremely well! I happily leave it going for days at a time. With a web camera pointed at it and Repetier server running on it I can remotely monitor and stop it if needed.


More Enigma progress.

June 11th, 2017

Sorry it’s a very badly composed film. It’s a bit tricky getting the angle right! Am slowly making progress on the machine. It’s a slow process because I need to design, print, test then often redesign and re-print the parts. But I am getting there.

I need to thank Paul Zetzmann who is undertaking his own truly amazing Enigma replica build. It makes mine look like a toy in comparison. His site is here: http://www.enigma-maschine.de/en/

Paul, like James Grime, was kind enough to explain some details about the machine as well as make a small video for me explaining some of the details. I must also thank him for pointing out my embarrassing mistake of gluing the letters onto the rotor rings in the reverse order (fixed now)!

I also just discovered this site: http://enigmahut.co.uk/

They have a replica three rotor Enigma that looks amazing although it isn’t a 100% replica as it doesn’t fully function. It is built to replicate the look and feel of the machine and show some of the machine functions. It has some limitations (they describe it on the site here) as well as a modern computer inside to to do the encryption/decryption. Unfortunately their site doesn’t show the innards of the machine so I can’t see exactly how it works. It looks as though only the fast rotor moves and that you can only encrypt/decrypt 20 characters. I wonder what they are using as the computer? Some sort of Arduino or a Raspberry Pi I imagine? The machine definitely looks the part though!

Am currently somewhat pre-occupied with trying to find a new job. Unfortunately I am not earning enough at the workshop to break even and when there is no work on that problem is of course compounded. Unfortunately other animatronics jobs aren’t exactly easy to come by! So I am busy trying to get back to my old career of software testing/test automation. The good thing will be when I do find something new it should mean more money and more time. No more 10 hours standard work days – more time for projects!


A 3D printed Enigma machine.

May 16th, 2017

This post is a little late as I have already made a film about this project but it’s fairly early days so far. Basically I am trying to 3d print a working Enigma machine using the 3D printer I built.

The film explaining it is here but I will add more details here now.

I have made an Enigma machine before of course. I  made an Enigma machine wristwatch some time ago. There are plenty of posts about that and the Turing Welchman Bombe I made here on the blog. That Enigma was mostly done in software but for a long time I have wanted to build my own working, physical Enigma machine. For years I had it in the back of my mind to make one from Meccano but it would take an awful lot of it and I don’t have any! Lego Technic also sprang to mind but again I don’t have the parts, my 8860 set sadly lacking in any useful Enigma type parts!

But then 6 months or so ago I built my own 3D printer and have been looking for useful things to do with it since. Normally I am a metalworker but being able to model and print plastic parts does have its uses. I have mocked up some parts for my vintage cars with it and have made useful little bits and pieces. I’ve been a bit slack on blogging lately so I haven’t shown all the progress I have made with it.

IMG_0760_1

The machine has been upgraded to a 300 by 300 heated bed. It’s mains powered so heats up in seconds! Recently I have set up Repetier Server running on a Raspberry Pi so I can remotely upload and watch prints from any computer on the Internet. I also have a web camera set up that I can remotely monitor so I can watch the prints in action. So now I can start a print in the morning, go to work then watch the progress during the day and stop things if necessary. Being so close to work (7 minute walk!) I can pop home and start new prints if needed.

Part of the printing process is having something to print. You can download things people have already made from sites like Thingiverse but I wanted to do my own designs and learn about 3D modelling. On the advice of someone at work I started learning Fusion 360, a free for personal use, CAD program. Aside from being Cloud Based, which I don’t like (‘Cloud’ meaning ‘someone elses computer’ when it comes to software), it works very well and is quite powerful. It is also being updated all the time with new features and there is a ton of help and advice for it available online.

To learn how to use it properly I needed a decent project. That’s where the 3D printed Enigma machine came in. I understand how the machine works very well already and knew it shouldn’t be too hard to make a machine that works in the same way. It wasn’t to be an exact replica, that’s not possible when 3D printing because of the way the parts are made, but it is to be a fully functioning machine following the form of the original as much as possible. There will be no electronics and certainly no software or microcontrollers to worry about. Purely mechanical and electrical only. If you want electronic versions there are plenty of them available online including some very nice, modern replicas for a decent amount of money.

When I first started all I had were pictures I found online and in the various reference books I already have. So I started measuring things up to start drawing up plans. I started with the rotor. I would print out the picture then choose a base measurement, say a rotor diameter of 100mmm, then I would measure the picture to see how big the printed dimension was and work out the scale factor I would need to then convert everything into real life measurements. This sent me off on a tangent after getting sick of converting every measurement by hand.

IMG_0761_1

I decided to build a set of calipers that would do it for me! Now this is a whole other project in itself that I need to write up. I bought some (very) cheap calipers online and using and Arduino worked out how to read the data that they spit out and convert that to a measurement. There are lots of examples online of how to do this although I found mine used a different protocol to any example I found so don’t assume they all work the same!

IMG_0762_1

You can see the calipers working in the film above but basically you measure something on the drawing (or model or whatever) then press a button on the device then slide the calipers to whatever the real measurement should be and hit the button again. The device then works out the scaling factor and from that point on anything you measure will be converted to the real measurement. I took the prototype to work and people there (prop makers, model makers, sculptors and so on) all loved it. Turns out the idea is patented already but I will eventually finish mine just as my own useful tool to own.

Soon after that interesting diversion I discovered  that there are plans drawn up from an original Enigma machine online that you can download. They are available here although you have to register to download them. I can’t tell from that page (which appears to be for some kind of university or technical school?) if they ever actually finished the project. There plan seems to be building a number of replicas for teaching purposes. The drawings though seem complete although it’s hard to tell exactly which variant of machine they were drawn up from. I think I have found a few small errors in them too.

But, as I mentioned above, 3D printing a machine doesn’t mean you just copy the plans and print the parts out. It just doesn’t work that way. The problem is the way 3D printing works. Basically it’s an additive process unlike CNC machining where you are taking away. This means I have to modify every part so it can be printed, and be printed on my homemade machine. I did hit a limitation there what I will explain later. I also gave myself the added challenge of printing it using no support. Support, in 3D printing, is when you print a scaffold like structure to hold up other parts of the object you are printing. As the layers are build up from the bottom up any overhang part needs support under it. This site explains it pretty well: https://www.3dhubs.com/knowledge-base/supports-3d-printing-technology-overview

I don’t like using support, well not on visible pieces, since removing it always leave the part looking ugly. You can sand parts but I don’t want to bother with all that so I am trying to use no support in my parts. You can see where the support was in the part below. The face upmost was printed as the bottom layer hence the need for support on the overhang.

IMG_0765_1

Since the part above is bolted into place I printed the actual version as two parts that bolt together, that way I can avoid the support.

I should mention that there is another 3D printed Enigma machine out there. Well, sort off. There is this project where again it seems a school has a project to make a 3D printed Enigma. It was from there I learned of the existence of the plans online. It seems they never finished their project either (probably because they ran out of term time) and it seems to be a somewhat simplified machine but it is a very good start. Some of the parts for that are on Thingiverse here.

A very good technical description of the actual Enigma machine is found here is you are not sure how it works or want to know more of the physical details.

As soon as I had the plans I was able to start modelling my parts with 3D printing in mind. I haven’t yet modelled them all and I am still working out details like how the keys will work but this is what I have so far. I started with the rotors because even if I don’t get the whole machine working a nice set of rotors would be nice to have. I am using pogo test pins as the spring contacts and small pieces of bronze welding rod for the static ones. I also want to have a working ring setting on the rotors so built all that into them too. The ring setting is fairly easy since all you are doing is moving the wiring with respect to the lettering on the ring. I made a prototype rotor.

IMG_0766_1

Hmmm, thank goodness I still have the mind of a tester! Reading what I just wrote I realised I made a slight cock up. My model is wrong and I just had to fix it. Only the wiring moves, not the notch position. That remains locked to the same letter on the ring. On mine the letters moved but not the notch position. Novice Enigma error!

But this shows the beauty of 3D modelling. I was able to fix my model by quickly redesigning how the parts worked and now I am busy 3D printing my updated version. This is what they mean by rapid prototyping!

I confirmed with James what the actual notch positions are on the physical rotor. They don’t match the turnover positions of course as the turnover is based on the letter uppermost on the rotor where as the physical notch is on the ‘back’ of the rotor in the machine.

The so called turn over positions are usually given as follows (what is showing when the next rotor turns over):

Rotor I: R

Rotor II: F

Rotor III: W

Rotor IV: K

Rotor V: A

They say that was remembered at Bletchley Park during the war by the mnemonic “Royal Flags Wave Kings Above”.

The actual, physical notches are not against those letter though. I worked out they need to be at N, M, D, R and H on my rotors so when the turn over happens the right letters are showing in the top of the machine.

IMG_0767_1

The letters were interesting. For a start the typeface used is unique to the rotors as far as I can tell. Annoyingly, to my my mind which likes order and neatness, the typefaces used on the real Enigmas are all different. The rotors, the keyboard and the lamp board all use different typefaces! For the rotors I created my own using an online tool called FontArc, which is free to use. It works brilliantly, you can start with standard fonts then tweak them which is what I did to get my rotor letter correct.

To actually create the little letter panels I tried various things. I printed all the letters as one piece with the little letter blocks sitting on a couple of layers printed underneath them. This was so I could print all the letters at once as one object then cut them out to stick on later. This is a good example of the rapid(ish) aspect of 3D printing.

My first thought for the actual lettering was to print the white squares with the letters in them as a depression in the surface. I could then fill the depression in with black paint. That didn’t work for several reasons. First the plastic is quite rough so paint would get into small cracks in the surface and not be able to be wiped off. And secondly the plastic is actually a little porous and the paint would bleed out of the letter.

IMG_0780_1 IMG_0779_1

My next go was to make the letters raised then paint the tops of them. I tried using a roller, that didn’t work.

IMG_0782_1 IMG_0778_1

So I tried colouring them in with a sharpie.  That worked better but I  still wasn’t totally happy with the result.

What I actually did in the end took a lot of fiddling but the result was so much better it was worth it. I did a two colour print! It took a few goes…

IMG_0783_1 IMG_0784_1

How you do this on a single extruder machine is tricky but basically what I did was print the letters as in my second attempt with the letters themselves as a raised surface. But I modified the g-code the slicer produced to pause the print at the point that it was starting to print the bottom layer of the letters. Repetier allows you to do this using the command:

@pause My Message

I then manually lifted the extruder using Repetier, change the filament from black to white, purged the extruder, the reset the nozzle position. The print then continued using black filament.

The results were excellent after a bit of trial and error.

IMG_0785_1

Since then I have been designing and printing a lot of the parts to make the machine. The rotors are pretty much done. But printing parts, like the letters, takes a lot of trial and error.

IMG_0764_1

I haven’t done the electrical parts yet as I want to make sure the mechanical works first. I have started printing some of the housing and also the mechanisms to do the movement of the rotors. I want to make sure all that works before I start tackling the keyboard. That will take a bit of experimentation. Since the base is a large print I am mocking things up on a wooden base first before I commit to doing such a large print.

This is the mock up so far of the rotors, entry wheel and reflector mounted between the correct housings with the lever to the left hand side.

IMG_0774_1

One thing about trying to do this with 3D printing is how flimsy plastic is compared to metal. I am having to model in strengthening ribs on parts to stop them bending and you can see in the pic above even that isn’t enough. The reflector is sagging because the shaft it is on it only attached to plastic and it isn’t strong enough. I will probably solder a flat piece to the metal shaft (instead of replying on plastic) and attach that directly to the side piece. This is how it was done in the original anyway.

One thing to note is not everything is 3D printed. Shafts, screws, nuts and so on are metal. This is for practical reasons. On trick I have is shortening screws to be the correct length. I tend to buy screws over length then cut them down. This is a trick I use to cut them down to the same lengths. I get a piece of steel and drill and tap it the right thread of the screws I am cutting down. I then thread the screws through the plate and cut off the protruding thread then sand the ends flush on the linisher.

IMG_0768_1 IMG_0769_1 IMG_0772_1

When you unscrew the bolt the thread is cleaned up by the plate and all the threads are the same length. If you need to make the thread longer you simple add nuts under the bolt head before you screw it into the plate.

IMG_0773_1

I am not sure if writing all this up or just doing little films is a better way of showing progress on this project. I don’t seem to have as much time for blogging about things these days. Perhaps small films are a better way to go? This is one I did about making the rotors.


Next Page »