Showing posts with label openscad. Show all posts
Showing posts with label openscad. Show all posts

Wednesday, February 14, 2024

A 410 shotshell in a 44 Magnum rifle

I regularly use a 22LR pistol at close range for certain utilitarian purposes. It's convenient and in theory, it should be adequate.  Let's be realistic though.  It's always at night, and I permanently suck with a pistol.  Something with more energy and better tolerance on shot placement would be nice, but a long 20ga is the other extreme.  It's prohibitively awkward in a doorway, and at close range, it's a bit excessive.  A short 410 would be nice, but that's not what's at hand here.  I do have a Marlin 1894 in 44 Magnum.  So the wheels start turning.  


Oh, it'll fit.  Okay, maybe not a 3" load.


The Shot Capsule

Now, I know they make shotshells in pistol cartridges, but they're expensive, the payload is miniscule, and the shot size is small.  Supposedly you can even buy the caps to reload yourself, but they're also miniscule, expensive, and I have not witnessed them ever being in stock at any time I looked.  So I think it's clear that those aren't what I want, so what do I want?  I want to somehow find a simple and convenient way to load 44 SPL/MAG cartridges that will roughly duplicate a standard 410 load: 1/2 ounce of shot at 1100-1200 fps.  It has to fit in this particular rifle, and its fitness for revolvers or other rifles is irrelevant. I tend to single-load cartridges anyway, so it doesn't need to actually feed through the magazine. 


No.  Just ... no.


Now, I hope it's obvious that a half-ounce shot load won't fit into the SAAMI spec OAL for either 44 SPL/MAG.  What's the actual OAL we have to work with?  With this specific rifle, the maximum OAL which can be single-loaded into the chamber is about 2.15".  At this length, an unfired cartridge cannot be ejected, striking the ejector before the cartridge fully clears the chamber.  It needs to be manually unhooked from the extractor and tipped out of the action. At 1.75" OAL, the cartridge can be manually fed and loaded cartridges can be ejected.  The longest OAL which can be reliably fed through the magazine is about 1.63", which is close to the SAAMI spec for 44 Magnum (1.610").  The payload constraint means that magazines and revolvers are simply not an option.  The cartridge will actually have to extend well into the bore when chambered, and ejection is going to be slightly inconvenient. 


A long cartridge strikes the ejector before it clears the chamber.

The first thing that crossed my mind was to make a paper shot capsule.  While I tried several variations of this, they were consistently inconsistent.  It's a difficult balance trying to get something that will stay intact while handling, but will open up quickly, uniformly, and consistently.  Rolling too many layers, using glue or tape, or tucking the ends too tightly would often delay the capsule from opening for about 2-3 yards.  Considering that the target distance is about 3 yards, that's not acceptable.  When the paper opened earlier, it would tend to unroll instead of tearing or breaking apart, creating a strongly asymmetric pattern.  The paper patch/capsule idea still has some appeal and might be solvable.  It has its simplicity and it's potentially a very accessible option.  Who doesn't have a sheet of paper lying around?  While the paper cartridges aren't terribly robust and are prone to spilling and getting kinked, that physical flexibility is a minor advantage.  Since the paper capsule bends just a bit, you can snake a slightly longer cartridge into the chamber than you otherwise could with any rigid capsule.  That might not seem like much, but bear in mind how pressed we are for volume with that payload constraint. 
 

A paper cap in 44 SPL brass.

That brings us to the solution.  I had a small second-hand SLA 3D printer sitting on the shelf for nearly a year untouched because I didn't want to deal with figuring out the shitty OEM windows-only webapp-on-the-desktop slicer application for the poorly-documented and widely-unsupported unofficial design revision of the particular model I had (a late-model "original" AnyCubic Photon).  I've used FDM 3D printers before, but I've always seen 3D printing as a severe compromise in terms of accuracy, surface finish, and material properties. Consequently, I rarely found a good reason to bother with the printer.  While I hadn't used SLA printers before, I did expect the acrylic parts to be relatively brittle.  I had some old expired clear resin that I got with the printer, so maybe this would actually be an appropriate use for it.  After all, how else would I easily make a bunch of thin, brittle plastic cups? 



Why do you assholes have to call every product model the same thing?

Working off the dimensions gathered in earlier attempts with paper and other materials, I spent some time in OpenSCAD coming up with a cap geometry that would work.  Since we're not injection molding these parts, there are a number of features we can afford that commercial caps can't.  To ensure unifom breakup and resin drainage during printing, I slotted the parts.  The caps can also have a uniform wall thickness with reentrant features like a base taper and cannelure.  This gives us a few advantages:  The base taper makes them easier to assemble into the case and it stiffens the mouth of the cap.  The cannelure gives a bit better retention with less risk of cap breakage when crimping.  The lack of mold draft means that the cap nose is less likely to survive intact and cause a defect in the shot pattern. Other than the hassle and mess of dealing with SLA printing, I think these features make the printed caps better than the commercially available caps.  At the very least, they're available and customizable.

After a lot of trial and error, I had something that could be assembled, handled, and chambered with little risk of breakage, but would still reliably break up and pattern uniformly -- or at least as uniformly as you can expect from a shot pattern coming out of a fully-rifled bore. The design file is parametric, so features and geometry can be configured for calibers and applications other than my own.  The nose geometry can be adjusted, whether you need a taper for easier insertion at max OAL, or whether you want a square nose for maximum capacity in a revolver. The zipper slots can be configured depending on how stiff you want the cap to be, though they do serve a purpose as drain vents during printing, and they aid in nose breakup, so it's probably not a good idea to eliminate them.  The SCAD file optionally generates the parts on a raft.  This helps with removing the fragile uncured parts from the build plate, and the attached label tag aids in incremental design refinement. The parts can be snipped off the raft with a pair of fine nippers.
 

Rafted parts and nippers

Different size caps

 
A word on the resin.  Unlike nearly every other application, this is one case where we actually want our resin prints to be brittle.  As time goes by, even the cheap resins will likely have improved toughness, so bear that in mind.  It's preferable to stick with cheap, standard clear SLA resins.  I'm currently using SUNLU standard clear green, though the original bottle I started with was a much older ERYONE standard clear that expired around 2019.  There seem to be fairly wide margins on how tough the material can be before it causes breakup problems, but I'd stick with clear resins and thoroughly overcure them.

I should note that these clear resins can be dyed in a heated bath, so if you want to color-code your shotcaps (e.g. to denote the shot size or loading), you don't necessarily need multiple resins.  I used my stock of old RIT dyes, though modern reformulated RIT will probably not work.  You should be able to use iDye Poly without much issue.
 

Dyed caps


Can these caps be printed with an FDM printer?  Maybe, but I wouldn't bother.  The design is more or less a nightmare stringing test for an FDM printer.  You're trying to print a series of tall cylindrical and conical arc segments that are approximately one nozzle-width thick, with tiny gaps that are even smaller. Maintaining dimensional accuracy and stripping heat are going to be challenges.  You could easily configure the SCAD file to produce a slotless cap and print it with a single wall.  That might be easier, but it might not break up like we want.  In the end, you'll get a part that's probably tougher than what you really want, and will likely smear and coat the bore due to friction and the relatively low melting temperature.  The desire to make a brittle cap suggests that we should use something like PLA.  You're free to try it, but I'm not interested in trying to find out how to remove a thin coating of solvent-resistant plastic from a rifle bore.  Maybe there are exotic filaments that would work, but that's out of my capabilities.  The acrylic resins are surprisingly resistant to heat, so SLA printed caps don't seem to be at significant risk. 


The Wads

Now I haven't mentioned what goes under the shot column.  That's because the wad is where everything starts becoming less ... satisfying.  When I was originally playing around with paper caps, I was using something that I've used several times before -- starch packing peanuts.  Not styrofoam peanuts, but the water-soluble packing peanuts.  They compress into a tough, heat-resistant wad that will conform to the cartridge and bore with little issue.  I have found them to be surprisingly effective for doing dumbass weird shit like this.  That said, they're tedious to install and compress, they need to be fairly thick to work, they're limited in the amount of heat and pressure they can take, and they're inherently inconsistent.  With a rigid cap, the maximum allowable powder+wad stack height demands a dense powder and a short wad. While moderate for the rifle, the developed pressures are still too much to reliably withstand at an appropriately short wad thickness. 
 

Fired peanut wads


I thought about printing plastic wads, but considering the brittleness of the material, and the fact that I didn't want a bunch of significant chunks of plastic trash all over the place, I didn't pursue the idea.  I also wasn't really too keen on having powder stored in contact with questionably-cured SLA resin and potentially turning all sweaty and weird. The long-term compatibility of powder and resin is something I'd want to test experimentally before I'd use it, and that would take a long time to test.

Instead, I just made a primitive punch and die out of scrap from the trash pile, just to see if paper wads would work or not -- a proof of concept.  I'm using 0.058" thick card stock (some used presentation boards).  Call that 500lb cardstock or a 60pt mat board.  Translating that into the conventional ill-standard "ply" units is pure guesswork, so good luck shopping.  With a die diameter of 0.425" and a concave punch face, the wads come out around 0.429-0.430", which is a nice snug fit in sized brass.  For most loads, I use 3 cards for a wad height of 0.175".  With this heavy card stock, I can get by with 2-card wads, but I wouldn't try to replicate such a thin wad with more layers of thinner stock.
 

Using the lathe tailstock as a simple screw press


Wads, wad insertion tool


The cardstock wads work well, though I dislike the fact that the wads or punch aren't something that can be easily obtained.  They aren't a standard size, so you're not going to be able to buy a tool set or precut wads.  Even the rudimentary die set I made required a lathe to make.  A press-mounted punch would be more complicated, and like most practical problems, it's well out of the capabilities of pedestrian 3D printing, so maybe it's not as accessible as I would have liked.

EDIT: In recent efforts, I have actually found that there are appropriate card wads available for 38/44/45 applications. In 44, I'm using a 0.175" wad stack, but a single 0.125" nitro card should be totally adequate. The wad thickness difference can be compensated for with a simple change in the SCAD file.
Ballistic Products
Track Of The Wolf


The Powder

I also haven't mentioned what powder I used.  Well, that's where things are even less ideal -- at least for me.  It's fair to say that this entire project is not something you're going to find load data on in any book, but we could always look at the nearest neighbors.  I use Herco for 44 SPL plinking loads: 240gr @ ~1030 fps with 7.0gr, or 1125 fps with 7.5gr.  That's not too far off-target, considering that 1/2oz is roughly 220gr.  Surely the slightly lighter payload would push us a bit higher in the velocity?  There's a couple problems with thinking that these pistol powder loads are going to be comparable or usable.  First off, Unique and Herco are just too bulky to be viable.  Second, there's no tight crimp, neck tension, or engraving force, so early pressures are low and the actual powder efficiency is low.  The same charge that gets over 1100 fps out of a 240gr bullet barely makes over 900 fps with a lighter payload, leaving behind lots of sticky unburned residue.

What else is on the shelf?  Circa 15gr of H110 might be appropriate for an actual 410 load, so what's wrong with that?  It's really the same story.  That large charge of H110 eats up the available stack height really fast, and is still on the borderline of being underpressured.  It seems that 410 loads are probably at the lower end of the pressures that H110 likes to burn properly.  The shift to a slightly larger bore diameter is probably just enough to push us close to the hairy edge of having occasional poppers and barrels full of yellow unburned powder grains.  H110 is simply inappropriate for lighter (i.e. SAAMI spec-length) loads, though perhaps those could work with the pistol powders.

I don't have a lot of powders on hand, and my LGS hasn't had much of any powder (or anything) on the shelf in the last three years.  I'm sure there's something that's more dense than Herco, while being able to perform at relatively low chamber pressures.  I could throw a dart at a burn rate chart and try something blindly, but I hate gambling on components if I know I don't have an alternative application for whatever I'm buying.  Besides, I do have this ancient can of Alcan AL-7. 
 

Sketchy? Pff. It'll be fiiine. That rust is just part of the aesthetic.


With 12.0gr of AL-7, 2 card wads, I can barely fit everything within 2.15" OAL.  The result is 220gr of shot at 1215 fps.  A 10gr charge puts us just under 1100 fps, which at 3-5 yards isn't really that much of a loss, but it gives us more wiggle room on stack height.  I've settled on 10.5gr and 3 card wads.  That's a bit on the low end of what I'd call a 410-equivalent load, but considering how severely the rifling limits the effective range, there really isn't much point in pushing the velocity too far anyway.

So AL-7 works great.  It's dense enough and tolerates the low pressures just fine, but nobody will be able to use this load data because AL-7 hasn't been on the shelves in 40 years.  It's going to really suck when I run out of AL-7, but maybe if you're more familiar with powders in this part of the spectrum, you'll be able to use this suggestion as a data point in finding a suitable replacement. 


Conclusion 


Obligatory glamour shots

 

So in the end, I have what I think is about all I really need from the cartridge.  It's roughly equivalent to a moderate 2-1/2" 410 load, but I can use it in a short, handy rifle that's also usable for other things.  They sound good, feel good, and I'm getting fond of the smell of AL-7.  They produce about a 6" pattern at 3 yards, and the cap breakup is uniform.  Setback dictates that the nose of the cap is never really subjected to any hoop stress as the shot column is upset, so the largest cap fragments tend to be from the nose.  Since the cap is slotted, those fragments are never large enough to disturb the patterning (at least not with the #6 shot I'm using). 
 

Cap fragments captured in a deep box of loose paper


While the loaded cartridges are durable enough to handle or put in a pocket, they aren't a 410 hull.  If you drop them on concrete, they'll likely break and spill.  It's easy enough to pick the rest of the cap out of the case mouth, expand the neck, and install a new shotcap without wasting the other components.  I don't know if that's even practical with commercial caps, since they use a snap-in plastic base wad.

Preferred:
Remington LP primers
10.5gr AL-7
3 card wad (0.175")
one 215L cap full of shot (approx 220-230gr)
a bit over 1100 fps

Full power:
Remington LP primers
12gr AL-7
2 card wad (0.117")
one 215L cap full of shot (approx 220-230gr)
a bit over 1200 fps 

Size and prime, expand the mouth if desired, charge the cases, and ram the wads.  Fill a shot cap like a cup and gently press the loaded case on top.  Crimping just requires the removal of the bullet seater (if you use a seat+crimp die).  Contrary to what I've read about the blue caps, I don't ever have issues with breakage during crimping, only during seating.  Work over a pan, because you'll probably break a few caps along the way.  Shot spilled in a pan is a lot less of a mess than shot spilled in the press.

If you want to play around with different powders, you might need to adjust the cannelure position or cap length as necessary for your stack height.  For perspective, 10.5gr AL-7 is approximately the same compressed volume as 9.0gr of Unique or 8.3gr of 700x.  All of these loads will work with the same wad stack and shot cap, so if you want to play around with unsuitable pistol powders, that's one place to start.  For what it's worth, both of those charges do work.  The Unique load runs about 1100+ fps, but burns poorly.  I forget the velocity for the 700x load, but it's hard on wads and the shot column, so expect pattern degradation.  On the bright side, at least there's plenty of margin on max pressure when working in 44 magnum.

The SCAD files are up on Thingiverse.



EDIT: I've come to discover the existence of early pre-410 cartridges such as the 44XL. The 44XL was basically a 44-40 with a paper cap and an overspec ~2" OAL. So I basically reinvented a cartridge concept that died out a century ago. I suppose if anyone wants to load 44XL, these caps would work great for that as well.

I also see bastard 45LC/410 chamberings in things like the Taurus Judge and Rossi Brawler and I have to cringe at the notion. I haven't seen a dimensioned chamber drawing, but I imagine it's the worst of both worlds. You get to shoot 45LC with a bunch of freebore for maximum leading, and you get to shoot 410 out of a grossly oversize rifled bore for terrible powder efficiency and patterning -- all because garbage laws force us into these compromises. That said, if you want to get more payload into a Brawler, an oversize cap in 45LC brass should at least be able to get more lead into the pattern. That's probably going to be way more effective than wasting money on 410 in such a pistol.

All of these shot caps will fit on top of the same powder+wad stack.


Friday, March 20, 2020

Improving a Laptop Keyboard with Custom Keycap Veneers

I admit that I'm picky about the keyboards I use.  I'm accustomed to the general ergonomics of classic keyboards and have become spoiled by a Model M for the last 20 years.  While I can hardly expect to get a comparable experience from a laptop keyboard, I do feel that some desirable aspects of design are painstakingly avoided for the sake of petty fashion.  The keyboard on my laptop has been one of the most frustrating I have ever attempted to use.  At some point, I decided that there must be something I could do to turn it into a more comfortable and efficient keyboard.

Since full-size keyboards are where I find the most comfort, perhaps it's worth describing what aspects of their design I feel are important to address in my efforts.  While that discussion is likely going to suggest a mechanical keyboard as a central ideal, I don't think that any particular mechanism is as important as what properties it can impart to the product.  Bear in mind that much of this is merely my preference.


An old XT keyboard, showing cylindrical crowns and overall contour.
The most commonly noted aspects in which laptop and typical desktop keyboards differ have to do with the key stroke.  The mechanical characteristics of the key stroke are primarily a comfort concern, though they may also provide forms of feedback which promote speed -- or at least confidence in motion at speed. Hysteretic mechanisms can provide tactile feedback, higher actuation force makes the motions assertive, and long stroke length allows for natural follow-through.  While users of discrete mechanical keyboards may have a broad range of stroke characteristics to explore, it's reasonable to expect that any practical laptop keyboard is going to necessarily have a restricted range of possible characteristics.

While an unfamiliar laptop key layout may certainly conflict with motor memory, even a familiar layout becomes difficult to use without some form of orienting information.  It is the physical geometry of the keyboard which provides spatial cues to reinforce and maintain the accuracy of learned motions when moving from key to key.  Consider a similar sensorimotor task; it's easy to walk through a familiar room in darkness if you can occasionally touch known surfaces along the way.  Doing the same without any references is an exercise in error accumulation.  In terms of a continuous process, these forms of feedback facilitate the error determination necessary for error correction to be possible; they allow the control loop to be closed. 

The most obvious and universal orienting features are identifier bumps.  They are usually only located on the F and J keys, as well as the numpad 5 key (on keyboards with a numpad).  Bumps are one of the few physical features of keycaps that people can easily customize.  While self-adhesive bumps can be bought for this purpose, other methods such as glue are common.  Custom bumps are especially useful in emphasizing keys associated with certain keyboard commands.

While the typical keyboard bumps are a mechanism to orient hand position within a general area of the keyboard, it is the feedback provided by the shape of the keycaps and the overall contour of the keyboard itself which reinforces the discreteness of all keys.  The center of each key can be emphasized by making the crown of the keycap slightly concave, or by making the crown smaller than the pitch distance between key centers.  Providing strong centering cues helps maintain spatial awareness and helps to reduce the tendency for edge strikes and two-key strikes.  Many keyboards have the rows laid out in either a curved or linear stairstep fashion, a feature which both adds to the distinctness of the rows and aids in comfortably reaching the upper rows.

You could at least pretend that ergonomics matter.
The keyboard on this old laptop (Acer 7736z) had none of that going for it. Being a laptop, the keyboard is flat (planar); that much is a necessity, though it isn't exactly helping.  The level of the keyboard is actually slightly lower than the body of the laptop, which makes the hand positions uncomfortably low, turning the overly-sensitve trackpad into an even worse nuisance.  The keystroke is light, short, and ambiguous.  Every keystroke is like the experience of stomping at the top of a long flight of stairs when you thought there was still one more step to go. The keycaps are perfectly flat, with no crown and no functional centering cues.  The key identifiers (bumps) are tiny and barely noticeable with dry hands.  Just trying to find home row after using the mouse is a tedious routine of sliding fingers around in a broad expanse of flat slippery plastic, all the while trying to maintain the lightest of touch to avoid errant keystrokes.  Once my hands move away from a known position, the lack of any discernable spatial references is immediately disorienting.  Combine that with the lack of feedback, and the whole experience becomes both tedious and precarious, like trying to touch-type with chopsticks.  Keyboard commands and programming both involve broader reaching motions than writing in simple prose, and are the most tiring of all.  The only way a keyboard could be ergonomically worse is if it were entirely featureless and truly devoid of feedback, like a touchscreen OSK or projection keyboard. 

In all the time I've spent using this laptop, nearly every minute has been steeped in the thought that there must be a way to improve its keyboard.  As per the mentioned limits of practicality, there is little I can do to alter the keystroke or overall contour.  While I can't alter the layout, perhaps I can add some extra identifiers.  Adding various forms of spatial cues to the keycaps should be possible, though there are some limitations.  Of course, there's the limitation of the distance between the keyboard and screen when the laptop is closed.  It might also be desirable to make sure any alterations are removable; after all, this is likely to require some experimentation. 

The First Attempt at a Solution

My first thought was to use adhesive to add identifier bumps to certain keys.  After some thought, I came to the prior conclusions regarding more general spatial awareness reinforcement, ultimately deciding that a centering mark of some sort should be added to the most-used keys.  My thought was to simulate the effect of a concave keycap crown by adding a circular ridge on each key.  I could add ancillary bumps or ridges either for location, identification, or for avoidance. 

While a finalized design could be implemented using epoxy, I opted to prototype my ideas using a conformal coating made from clear Dap Sidewinder thinned with xylene.  This can be thinned to an appropriate consistency and provides a smooth, self-leveling finish.  It can also be completely removed once dry by simply redissolving in xylene; though in this case, sound material could be picked/peeled off cleanly without solvent.  It may also be possible to use something like E6000 if thinned appropriately. 

I applied the coating with a 1mL syringe and a 25ga dispensing needle bent to a comfortable angle.  There are a couple of important things that need to be considered in that effort.  Dispensing a viscous material through a fine needle requires a lot of pressure.  The pressure requirements can be lowered by reducing the viscosity or by using a shorter needle or one of larger diameter.  I chose a 1mL syringe because it allowed me to generate relatively high pressures, but care must be taken to avoid making a mess on the keyboard.  With firm hand strength, a 1mL syringe can produce upwards of 200 PSI -- more than enough to eject the needle and blurt a wad of glue across your work.  If you can use a syringe with a luer-lok type spigot, do so.  If all you can get are syringes with plain tapered spigots, pay attention to keep the taper clean and tight.  Practice first.

One also should consider the materials used.  Many adhesives and coatings will degrade when in constant contact with skin oils.  While I chose this coating for prototyping, it is wholly unsuited for long-term use.  After a week or so, it will begin to become sticky and will eventually get smeared everywhere.  Other products like E6000 will likely do the same on a longer timeframe, and I would expect the same of almost every common adhesive other than epoxy.

While I found it helpful to have more noticeable identifier bumps, the circular ridges left me relatively disappointed.  The rings were certainly better than nothing, but they were still a poor simulant of a key crown.  The fact that the keycap is the same height inside and outside the ring makes them fairly ineffective at suggesting a boundary.  With this effect in mind and considering the low height of the glue ridge, the ring diameter needed to be fairly small to present an unambiguous shape to the fingertip.  The smaller the rings are, the more awkward they feel, and the more often they're escaped. 

Placing my hands in the rings on home row felt awkward -- as if they're too straight.  Certainly, the wear marks on my main keyboard suggest that my fingertips naturally rest in an arc across the keys.  It followed that the landing points were generally centered laterally, but otherwise varied depending on what was most comfortable for a given finger.  I switched the circular glue rings out for elongated rectangular glue rings and noted a marginal improvement.  I felt that it was ultimately impractical to achieve much more with such a low-profile method. 

The Development of Keycap Veneers

Finding myself idle on my laptop away from home, I dared to spend some time on what I'd presumed would surely be a huge waste of time.  I figured I'd whip up a parametric model for 3D-printed keycaps.  The idea was to print some caps (if they would print flat and thin), clean them up (easier said than done), and glue them like veneers on top of the existing keys.  The modelling was done in OpenSCAD, a simple and enjoyable script-based parametric 3D CAD tool.  I conjured up several different variations on crown geometry, printing and testing along the way. 

// //////////////////////////////////////////////////////
// keycap veneers for shitty flat laptop keyboards

// cylinder cuts only strongly enforce x-positioning
// this allows fingertips to rest in a more natural arc across home row
// and may be more comfortable on keys which require more reaching or are otherwise habitually struck off-center
// they're also easier to make smooth (easier to print without fuzz, also easier to scrape/sand by hand)
// spherical cuts reinforce y-pos more than cylinder cuts do (important on flat kb)
// elliptical cuts are a compromise especially suited to flat profile kb

// proportions aren't fixed. some things require manual adjusting

// //////////////////////////////////////////////////////
// RENDERING & MULTIPART LAYOUT
nf=100;   // facet number (~50 for speed; ~200 for printing)
Nx=4;    // number of caps to tile along X-axis
Ny=2;    // number of caps to tile along Y-axis
tilegap=2;  // gap between tiles

// //////////////////////////////////////////////////////
// BASIC KEYCAP GEOMETRY
h=17;      // keycap height (in key plane)
w=17;    // keycap width (in key plane)
th=1.7;    // maximum cap thickness (limited by kb-screen gap)
th_min=0.3;  // minimum cap thickness (limited by print strength)
draftx=45;  // draft angle (vertical taper on R,L faces)
drafty=45;  // draft angle (vertical taper on T,B faces)
cr=3;     // corner radius 

// //////////////////////////////////////////////////////
// PRIMARY RELIEF CUTS
// sphere & cylinder mimic legacy alpha key designs 
// lcylinder is the transverse version of 'cylinder', for wide keys
// wcylinder is a double-cylindrical hull, for wide keys
// sausage is a double-spherical hull, for wide/tall keys
// ysausage is the same as 'sausage', but each sphere location can be independently offset
// bumps is a series of spherical bumps (used as an avoidance indicator) 
// using 'none' will produce a flat keycap
style="sphere";

// these parameters may need tweaked when geometry is changed significantly
drc=20;     // relief cut radius for cylinder styles
drs=20;     // relief cut radius for sphere & sausage styles
// the following options only apply to spherical cuts
osx=0;     // offset x
osy=0;     // offset y
osz=0;     // offset z
scaley=1.3;   // stretch factor (elliptical cut)
// the following options only apply to ysausage cuts
os1=-.5;     // y-offset for top sphere
os2=-3;     // y-offset for bottom sphere
// the following options only apply to 'bumps'
brad=1;     // bump radius
bdepth=0.7;   // bump depth
blayout=[3,4];  // number of bumps [x,y]

// //////////////////////////////////////////////////////
// ADDITIONAL FEATURES
// bevel produces a single beveled edge (e.g. for bottom-row keys)
// multiple bevels can be specified (e.g. ["top","bottom"])
bevel="none";   // bottom top left right or none
bevangle=10;  // angle of beveled face
bevhos=0.6;   // height offset of bottom edge of bevel

// cuts can be made asymmetric so that a single cut spans multiple keys
// this allows certain keys to be grouped by touch (e.g. groups of four F-keys)
lowside="none";  // right left both or none

// identifier position may be in the center or bottom edge
identifier="none";  // center edge or none
idw=0.5;   // identifier width
idl=5;     // identifier length
idh=0.95;   // identifier height WRT cap height (used for 'edge')
idhc=0.5;   // height used for "center"


// //////////////////////////////////////////////////////
// //////////////////////////////////////////////////////
// THE MAGIC

module cap(){
 color("dimgray")
 render(){
  linear_extrude(height=th,scale=[1-2*th*tan(drafty)/w,1-2*th*tan(drafty)/h]){
   hull(){
    translate([(w/2-cr),(h/2-cr),0])
     circle(r=cr,center=true,$fn=nf/5);
    translate([-(w/2-cr),-(h/2-cr),0])
     circle(r=cr,center=true,$fn=nf/5);
    translate([(w/2-cr),-(h/2-cr),0])
     circle(r=cr,center=true,$fn=nf/5);
    translate([-(w/2-cr),(h/2-cr),0])
     circle(r=cr,center=true,$fn=nf/5);
   }
  }
    }
}

module relief_bumps(){
 render(){
   difference(){
    translate([-0.6*w,-0.6*h,th-bdepth])
     cube(1.2*[w,h,brad]);
    union(){
     for (m=[1:blayout[1]]){
      for (n=[1:blayout[0]]){
       translate([-(w-w/blayout[0])/2+w/blayout[0]*(n-1),-(h-h/blayout[1])/2+h/blayout[1]*(m-1),th-brad])
        sphere(r=brad,center=true,$fn=nf/5); 
      }
     }
    }
   }
 }
}

module relief_spherical(){
 render(){
  translate([osx,osy,drs+th_min+osz]){
   sphere(r=drs,center=true,$fn=nf);
   if (lowside=="right" || lowside=="both")
    translate([h/2+osx,osy,0])
     rotate([90,0,90])
      cylinder(r=drs,h=h,center=true,$fn=nf);
   if (lowside=="left" || lowside=="both")
    translate([-h/2+osx,osy,0])
     rotate([90,0,90])
      cylinder(r=drs,h=h,center=true,$fn=nf);
  }
 }
}

module relief_cylindrical(){
 render(){
  translate([0,0,drc+th_min]){
   rotate([90,0,0])
    cylinder(r=drc,h=h+1,center=true,$fn=nf);
   if (lowside=="right" || lowside=="both")
    translate([h/2,0,0])
     rotate([90,0,90])
      cube([drc*2,drc*2,h],center=true);
   if (lowside=="left" || lowside=="both")
    translate([-h/2,0,0])
     rotate([90,0,90])
      cube([drc*2,drc*2,h],center=true);
  }
 }
}

module relief_cylindrical_long(){
 render(){
  translate([0,0,drc+th_min]){
   rotate([90,0,90])
    cylinder(r=drc,h=w+1,center=true,$fn=nf);
  }
 }
}

module relief_cylindrical_wide(){
 render(){
  translate([0,0,drc+th_min]){
   rotate([90,0,0])
    hull(){
     translate([(w-h)/2,0,0])
      cylinder(r=drc,h=h+1,center=true,$fn=nf);
     translate([-(w-h)/2,0,0])
      cylinder(r=drc,h=h+1,center=true,$fn=nf);
    }
   if (lowside=="right" || lowside=="both")
    translate([h/2,0,0])
     rotate([90,0,90])
      cube([drc*2,drc*2,h],center=true);
   if (lowside=="left" || lowside=="both")
    translate([-h/2,0,0])
     rotate([90,0,90])
      cube([drc*2,drc*2,h],center=true);
  }
 }
}

module relief_sausage(){
 render(){
  translate([0,0,drs+th_min]){
   hull(){
    translate([(w-h)/2,0,0])
     sphere(r=drs,center=true,$fn=nf);
    translate([-(w-h)/2,0,0])
     sphere(r=drs,center=true,$fn=nf);
   }
   if (lowside=="right" || lowside=="both")
    translate([h/2,0,0])
     rotate([90,0,90])
      cylinder(r=drs,h=h,center=true,$fn=nf);
   if (lowside=="left" || lowside=="both")
    translate([-h/2,0,0])
     rotate([90,0,90])
      cylinder(r=drs,h=h,center=true,$fn=nf);
  }
 }
}

module relief_ysausage(){
 render(){
  translate([0,0,drs+th_min]){
   hull(){
    translate([0,os1,0])
     sphere(r=drs,center=true,$fn=nf);
    translate([0,os2,0])
     sphere(r=drs,center=true,$fn=nf);
   }
   if (lowside=="right" || lowside=="both")
    translate([0,w/2,0])
     rotate([90,0,0])
      cylinder(r=drs,h=h,center=true,$fn=nf);
   if (lowside=="left" || lowside=="both")
    translate([0,-w/2,0])
     rotate([90,0,0])
      cylinder(r=drs,h=h,center=true,$fn=nf);
  }
 }
}

module relief_bevel(){
 union(){
  for (i=bevel){
   if (i=="top")
    translate([0,h/2,th_min+bevhos])
     rotate([bevangle,0,180])
     translate([0,h/4,w/2])
     rotate([90,0,0])
      cube([w,w,h/2],center=true);
   if (i=="bottom")
    translate([0,-h/2,th_min+bevhos])
     rotate([bevangle,0,0])
     translate([0,h/4,w/2])
     rotate([90,0,0])
      cube([w,w,h/2],center=true);
   if (i=="right")
    translate([w/2,0,th_min+bevhos])
     rotate([bevangle,0,90])
     translate([0,w/4,h/2])
     rotate([90,0,0])
      cube([h,h,w/2],center=true);
   if (i=="left")
    translate([-w/2,0,th_min+bevhos])
     rotate([bevangle,0,-90])
     translate([0,w/4,h/2])
     rotate([90,0,0])
      cube([h,h,w/2],center=true);
  }
 }
}

module drawcap(){
 difference(){
  cap();
  
  if (style=="sphere")
   if (scaley!=1)
    scale([1,scaley,1])
     relief_spherical();
   else
    relief_spherical();
  if (style=="cylinder")
   relief_cylindrical();
  if (style=="lcylinder")
   relief_cylindrical_long();
  if (style=="wcylinder")
   relief_cylindrical_wide();
  if (style=="sausage")
   relief_sausage();
  if (style=="ysausage")
   relief_ysausage();
  if (style=="bumps")
   relief_bumps();
  if (bevel!="none")
   relief_bevel();
 }
 
 if (identifier=="edge")
  translate([-idl/2,-idw/2-h*0.34,th_min])
   cube([idl,idw,th*idh-th_min+0.001]);
 else if (identifier=="center")
  translate([-idl/2,-idw/2,th_min])
   cube([idl,idw,th*idhc-th_min+0.001]);
}

module tilecaps(){
 color("dimgray"){
  for (m=[1:Ny]){
   translate([0,(m-1)*(h+tilegap),0]){
    for (n=[1:Nx]){
     translate([(n-1)*(w+tilegap),0,0]){
      drawcap();
     }
    }
   }
  }
 }
}

tilecaps();

Much of the core focus of these experiments stems from the lessons of the glue ring experiment; that is, finding the balance between the axial components of the crown geometry.  The equivalent analog for the circular glue ring is of course a spherically concave crown.  By contrast, many keyboards such as the Model M have cylindrically concave crowns.  While the spherical crowns provide constraint cues both laterally (side to side) and transversely (across the rows), cylindrical crowns only provide strong constraint laterally.  Much like using elongated glue rings, this allows for more variation of finger placement in the transverse direction without affecting comfort.  While the cylindrical shapes are certainly easier to deburr and finish than spherical ones, the overall flatness of the keyboard and the tendency to use the laptop in awkward positions without a desk left me wanting more transverse constraint than they could provide.  After all, while the Model M uses cylindrical crowns, it also has a significant and unambiguous height difference between rows.  The solution was simply a deep ellipsoidal crown contour.  Using atypically deep crowns helps compensate for the flatness inherent to a laptop keyboard, and generally provides more constraint overall.  A few quick tweaks were required to find what I felt was a good balance.  Compared to either spherical or cylindrical reliefs of a similar depth, the final ellipsoidal crown allowed a dramatic improvement in speed, accuracy, and comfort within the alpha keys.

Caps with spherical, cylindrical, and ellipsoidal crowns (and an identifier bump)
Wary of losing track of home row (something that was easy to do on the original keyboard), I decided to use different caps for the numeric row.  In order to provide a sense of overall contour, I opted to reduce the degree to which these cap crowns were contoured themselves.  In other words, any concave relief should be shallower, allowing the cap to be effectively thicker in the strike location.  Again, I used wear marks on a well-worn keyboard to locate the crown features.

The F-keys are grouped into blocks of four, with each group sharing an elongated concave relief.  This addresses the fact that the keys are not spaced or located as they are on a standard keyboard.  Only ESC and DEL have their own spherical relief. 

Keys which I rarely use, or keys which are otherwise hit accidentally need some sort of avoidance identifier.  I opted for a lower-profile cap with a grid of bumps.  While it makes for frustrating print cleanup, it's an effective solution. 

Other keys were given either shallow concave reliefs or simple bevels.  In this way, they are brought up to a comparable height with the other modified keys, even if they otherwise do not require any particular improvement.

Other cap types for function-row and numeric-row keys
The caps were printed in PLA, though this makes them difficult to clean up and finish.  The surfaces require quite a bit of burr removal or "defuzzing".  Most of this can be done by scraping, though the shapes of the parts often makes it awkward and the process is generally tedious.  Sanding is likewise very tedious, especially corners and edges.  Cylindrical-relief keys can be printed in rows and sanded in a comfortable motion, though spherical or ellipsoidal reliefs don't allow this.  Sanding tends to leave more fine fuzz.

Improving the finish beyond that is difficult.  As the parts are very thin, heat polishing (flame or hot air) doesn't really work.  The features are either destroyed, or the part curls and requires restraint -- leading to more marring.  Solvent polishing PLA is not really a thing.  No, acetone, MEK, and ethyl acetate don't work.  They might slightly soften and deglaze the part, but they will not dissolve the surface enough to allow it to reflow.  I do not know of any other solvents that would, but if there were one, I have a feeling that the parts would be so thin that they would tend to curl anyway.

Sanded, fuzzy caps temporarily affixed during fitting
Using a rotary tool to buff or burnish the surface is fairly counterproductive.  The tool needs to run much slower than they can, otherwise the heat generated by friction melts and smears the material due to its very low melting point.  Wool buffs, brushes, cratex points, and scotch brite bobs all ended up just making a mess.  In practice, the first thing they do is erase edges and corners. 

I ended up opting to just coat the caps, though I know that coatings on a keyboard are likely going to eventually fail.  I figured that my best bet was either polyurethane or a good clear acrylic.  I didn't feel like applying the poly with a brush or sprayer, so I just used an aerosol acrylic spray. No, I did not just spray the keys in-situ.  I used double-sided tape to hold them down to a waste board when spraying. 


The keycaps after a sloppy spray job. It feels better than it looks.
The caps were originally prototyped using simple craft rubber cement for adhesion.  This allowed them to easily be removed with a knife, and the residual glue simply rolled off the surfaces cleanly.  For final reassembly, I used a more proper polychloroprene contact cement (e.g. Weldwood, Barge).  Removal may now be more difficult, but possible.  Instead of brushing the cement on, I used a syringe to dispense a small amount on each key.  There are plenty of other adhesives that could be used here.  I figured that replacement keyboards are cheap enough that I don't really need to worry about removing the caps once I've settled on the design. 

Final Thoughts

The keyboard as modified has proven to be about as good as a laptop keyboard can possibly be.  The height is much more comfortable, the alpha keys are distinct from surrounding keys.  The identifier bumps are distinct, and I added a couple extra where I wanted them.  The finish isn't very pretty, but beauty isn't necessary here. 

If you read all that blather without losing interest or the will to live, I should congratulate you.  Even I had a hard time enduring it.