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.

3 Responses to “A 3D printed Enigma machine.”

  1. Mark Says:

    Following your blog with great interest. Hoping to make an Enigma too. Why did you decide to go down the 3DE print route when you mentioned in your posts that your a skilled metalworker? Surely, it’ll be easier in metal? I’ve got the fun of learning metalwork while trying to recreate Enigma!
    Just bought my first lathe and cnc mill. This is gonna be a journey! Keep on posting, just loving this trip watching your machine grow. Respect

  2. Simon Says:

    Hi Mark, it was mainly as an excuse to learn 3D modelling and have some use for the 3D printer I made! If you want to see how to make a replica from metal have a look at Paul’s site here: http://www.enigma-maschine.de

    He is doing an absolutely amazing job with his replica. He also spotted a silly error I made on mine for which I am grateful (I had the letters on the rings in reverse order)!

    I need to do an update soon. Just been busy with trying to find a new job lately.

  3. Mark Says:

    thanks for the link. It is an amazing job Paul is doing. Looks like he’s producing more than one! Don’t think my budget can stretch to the equipment and setup he is using. Look forward to both yours and Pauls finished projects!