Learning through failure - a keyboard creation journey
- Built a custom keyboard cuz I have weirdo nerve pain issues.
- Learned a lot cuz I failed a lot.
- Maybe 'do it right the first time' is a bad frame of mind.
- The keyboard ended up being kinda nifty.
- It has lights, and a trackball, and QMK, and it helps my issues.
(tl;dr is internet lingo that means, too long; didn't read)
Pain as a key ingredient
An old proverb says, 'necessity is the mother of invention', and that is how this story begins.
Over the last few years, age or stress or something has caught up with me and I developed the need to change my human-to-computer interface. Mousing changed to trackballing. The traditional keyboard was swapped out for an ergonomic, and then split keyboard. Complicated multi-finger-and-hand key combinations were replaced by single keypress macros. And yet more was still needed.
It's often said that change only happens with pain - indeed, the organizations many of us work in seem to apply this as law - and so, unsurprisingly, I seem to work the same way. There is something to be said for understanding the 'socio' in 'sociotechnical systems', as well as the psychology component of Deming's 'system of profound knowledge'. And so, with pain girding me, I set out on the next step...the niche of custom ergonomic keyboards. (not covered here...the array of other things being tried in parallel)
Above is one of the last 'as close as it gets' iterations...where we were at before heading down the path of...
Build or buy?
In software development (ok, everywhere...?), there is always a question of discerning when to buy something pre-made, or when it is time to build something yourself. Wardley maps paint this picture very clearly, illustrating a range of 'idea genesis' (thing entirely non-existent, you must make it) through to 'utility' (it's so ubiquitous that the sudden absence of it is a surprise). In the case of ergonomics, there is a limited portion of the population that exactly matches your ergonomic dimensions. In the case of specific ergonomic problems, there is only you.
Now, there are some prebuilt options that are close to what I needed, so the build/buy decision needed weighting. The rationale for me to go 'build' ended up being 'because I can, because it's less risky, and because we'll end up with a 3D printer for our trouble'. Cost-wise, it was a gamble, and probably ended up costing a bit more - but risk-wise, it meant that there were no dead ends if something doesn't quite work out.
The major need was to have a split keyboard with integrated trackball, where the trackball could be used from a 'home row' hand position. There is only one commercial offering that provides this (at the time of this writing), and it uses bespoke closed-source software to customize it. Given the obvious risks of that path, and that it was almost the cost of the 3D printer alone, we had our decision.
What does it take?
Setting cost aside, there are a number of components in a keyboard. A picture is perhaps best.
Clearly there are also a number of special skillsets required...skillsets that can be learned.
- 3D design work (using the tool, and executing your vision)
- 3D printing (unfortunately not just as simple as 'send file to printer')
- Relatively simple electronics and soldering? (I still don't get why some solder joints stopped working)
- Basic programming and debugging? (in C++?)
- Tying all together the ergonomic, the physical, the mechanical, the electrical, and the code
- time (as mentioned, took me over four months)
- money (the obvious question, how much, is directly tied to your need; similarly, your self-control - anyone suggesting this is a cheap exercise should be asked deeper questions)
- tools (soldering iron, 3D printer, computer that can run Fusion, multimeter, various hand tools, a place to work on stuff that can occasionally be smelly - see more detail at the bottom of this post)
- Split keyboard, columnar key layout (I could never use a non-split keyboard again, disregarding my personal issues)
- Integral trackball accessible from home row hand position
- QMK software for customizability, layers, trackball functionality
- Chassis design that aids troubleshooting, simplifies modelling, speeds prototyping, lowers print costs (time and plastic)
- Key-well design (i.e. not-flat), 3x6 layout to encourage thumb usage and QMK automation
- Lots of thumb keys to both maximize 'single key' functionality and reduce pinky usage
- Per-key RGB LEDs to function as rapid-cue labels, speeding keymap memorization, looking baller
- Hotswap key switches, re-use Moonlander keycaps (OEM row three size, "piano keys" on the thumbs)
Learning is failing
Learning is hard, a fire that consumes your patience and time - easily extinguished by pride.
- Default layer - a normal qwerty keymap, like any normal keyboard would have; one button works to toggle drag-scroll on/off; two buttons on the left thumb cluster are tab back/fwd; two buttons on the right thumb cluster are Mac 'spaces' left/right; etc etc etc
- Mouse layer - the JKL keys become left, middle, and right click; YU are Chrome back/forward buttons
- Nav layer - triggered by left thumb, right hand suddenly has arrows, pgup/dn, home/end, normal arrows work like alt-arrow
- Symbols layer - all the letter keys become the symbols on the left hand, and right hand is the numpad; more tab/terminal switching functionality; VS Code multi-line select is one button, etc
- Drag-scroll toggle - click a button, and the trackball switches to two scroll wheels - vertical on vertical swipes, horizontal on sideways swipes.
- Mouse layer auto-on - after the trackball moves three "units" the mouse layer is triggered automatically. After 750ms of inactivity, it reverts to the previous layer. I continue to play with these settings...but it works just how I want it to most of the time.
- Per-key RGB, per-layer - so every layer has a corresponding key colour - effectively acts as labels, it's quite effective at helping me memorize the keymap, and adapt to keymap changes.
Learning by doing
- Read the right blog posts at the right time in the right order, discover that this is a solvable problem
- Figure out what components, printer, etc to order, and where to order them from
- Order them, discover some stuff is out of stock or can't ship to me, find other suppliers
- While waiting for things to arrive, start looking at the Dactyl generator code, Fusion360
- Spend at least a month on F360 before discovering that you've been doing it wrong (parametric)
- Spend another month re-learning F360, and printing test pieces
- Start printing shells that are already done, hoping they will work out
- Narrator: They did not.
- Discover 3D printing is actually a rabbit hole all its own, spend a month printing almost non-stop to learn the ins and outs
- Give up on your design methodology again, re-do the design entirely so you can spend less time printing.
- Finally get a design that feels good printed and assembled
- Protip: "feels good at rest" and "feels good at the end of 10 hours"...these are not the same thing.
- Spend at least a week creating a wiring diagram, realizing that this is why flexible PCBs are the way you'd ideally go
- Discover that soldering is very time consuming, spend a week soldering, testing, re-soldering
- Discover that you have no comprehension of how the source code actually works, get help from the community, only to...
- Discover that your soldering skills are apparently not electronics-grade, discard almost half of your assembled PCBs and re-do them (thankful you bought extras...right?...right?)
- Spend hours and hours reading code and adding comments in an effort to understand why your LEDs won't work properly
- Re-do another handful of PCBs
- Discover that you still don't understand the code/framework - many hours later find out that your non-master half is not lighting up because there is a very tiny 'if slave' block that is missing the RGB function
- Spend many many many more hours getting the keymaps and layers figured out
- Accidentally git reset --hard everything you have done because you're a hubris-fueled chump sometimes, and then humbly thank God because in your hubris you did the ol' "keyboard.old" trick into the trash bin, and so you're able to recover from catastrophe, not deserving that kind of grace but getting it anyways.
- Discover that your entire chassis design is tilted too far up at the back, and you need to reprint basically the whole thing; use scrap wood to tilt it up and make it useable
- Write a the start of a blog post to procrastinate this next step
- Replace key switches to deal with finger pain, break another section of LEDs, have to troubleshoot and then reflow solder on one pin of one LED
- Refactor your design to accommodate the new tilt, reprint the parts
- Still see issues with the keyboard that need addressing...like the obviously-not-done wrist rests...
How the story ends
- Userspace: https://github.com/christrotter/qmk_fw/tree/arcboard-mk9-3x5/users/christrotter
- Keyboard: https://github.com/christrotter/qmk_fw/tree/arcboard-mk9-3x5/keyboards/handwired/tractyl_manuform_ct
Suggested tools/parts, further reading...
- Clamping tweezers: These were recommended by Quentin from bastardkb.com, and MAN are they worth the price of admission. Could not imagine project life without this tool: https://www.amazon.ca/gp/product/B004C4419G/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1
- Flush cutters: These are superb and magnificently sharp: https://www.amazon.ca/gp/product/B0048F601Q/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1
- PCBs: I ended up using these ('container' version, through: https://jlcpcb.com/), although I suspect by now there might be something better? https://github.com/swanmatch/MxLEDBitPCB/blob/master/readme_en.md
- These came to my attention after I'd already ordered PCBs, but I'm not sure how hand-wiring them up would go...
- You want SK6812 MINI-E LEDs, like this, being well aware that soldering these takes practice - practice wherein you will fry them. Get a lot of extras.
- Trackball PCB: This one, works perfectly.
- 3D printer: I was recommended by a friend to get this if fiddling with a printer was not my hobby, and he was so right. https://www.prusa3d.com/category/original-prusa-i3-mk3s/
- I used their PETG filament. In future I might stick to PLA, never really figured out how to deal with support material fusing to the part.
- Multimeter: You absolutely need a reliable way of checking continuity, dc voltage, and resistance. Waveform/oscilloscope functionality I found super handy in troubleshooting the LED signal chain (you can look for square wave signal).
- Soldering iron: Get a decent temperature controlled soldering iron - the LEDs cook if you use more than 230C. Mine is really old and kept doing the thermal shutdown dance. Hakko seems to be the go-to brand these days.
- Solder sucker: Was recommended to get one, it works orders of magnitude better than those copper strips. https://www.amazon.ca/gp/product/B002MJMXD4/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1
- Fusion360, it has its warts, and sometimes can be buggy, and it's getting old, but it works, and it's free, and there's lots of information on how to use it. https://www.autodesk.ca/en/products/fusion-360/overview?term=1-YEAR&tab=subscription
- KiCAD is used to look at PCB files, for when you're not convinced you understand how the PCB works. https://www.kicad.org/
- PrusaSlicer did the trick, found no reason to try others. https://www.prusa3d.com/page/prusaslicer_424/
- VS Code is what I'm used to using at work...it's just text files at the end of the day, but a good editor can make that wayyyy easier. https://code.visualstudio.com/
- The hot-melt insert pattern for securing components together really worked well for my design.
- An example of this pattern in Fusion, where partA holds the insert, and partB is getting clamped to partA with an M3 bolt.
- PartA has a 5mm hole, 7mm? deep to hold the insert (which is like 5.3mm dia or something). Chamfer to 0.5mm.
- PartB has a 3mm through hole, 6mm clearance hole (for the M3 bolt head). Chamfer the 3mm hole to 1.5mm, the 6mm hole to 0.5mm.
- M3 machine screws of whatever flavour - I went with these: https://www.amazon.ca/gp/product/B07VZTSHB4/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1
- M3 hot-melt inserts: https://www.amazon.ca/gp/product/B087N4LVD1/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1
- The ball bearings I used are not that great, but the size needed by my design files is: 3x6x2.5mm
- I found some old scrap stainless dowel and cut it to size.
- As a point of reference, Ploopy's kits use 3D-printed dowels - you are just trying to keep the bearings from moving under the load of a trackball and your thumb...not trying to keep Godzilla at bay.