This is a practical example on how simple tumbler locks work.
There are 3 different variations of the inner plug.
Unfortunately some adjustments to make it easily printable also make it quite difficult to pick the lock with normal diamond, rake or snake picks, so a special lockpick is also included.
You will need one spring of 4mm diameter and approximately 15mm length for each pin. Springs from a ball point pen should work.
I've experimented with printed springs in a flexure design, but all of them made the final design unreasonably large.
All components should be printed in the orientation they are in the file.
Most things should be fine with 2 perimeters and 10% infill, PLA works well and adaptive layer height can be used to increase detail and reducing print time. For the outer cylinder it can be useful to increase the perimeter count to 3, to make the whole hull solid.
Only the key and the pick need supports on build plate enabled. If you have good bed adhesion, you can also flip the key upside down, and it should print without supports.
Add the key pins in the right order to each channel. Add a driver pin on top of each, the rounded part of both the key and the driver pins should point towards the key.
Add a spring to each channel and slide the cylinder lock in place. This works best without a key in the lock.
In trying to make the lock easier to print and improving the tolerances, it looks like I made the lock a bit hard to pick.
The keyway is surprisingly tight, since the shortest keypins are quite small. Both driver and keypins are also rounded / chamfered at the ends, to make the movement smoother, but this seems to have made picking them harder.
You can use the provided python script to create your own keys and locks. You will need an installation of `openscad`.
This script has only been tested on ubuntu and openscad version 22.09.23 so far. The full commandline would look like this:
python3 generateLock.py "4,9,7,2" --quality 8 --out stl --exec openscad-nightly
The author hasn't provided the model origin yet.