In the summer I replaced all the switches on my keyboard from Cherry Blues to Hako Royal Clears and wasn't sure what to do with the rest of the switches. Why not build a numpad!
I first began making a few drawings of what the numpad should look like. I wanted to have an encoder and the layout would be 4x5. The size would be dictated by the size of the largest PCB I could get manufactured for cheap (100mm x 100mm). This is perfect for a fully filled out 5x5 layout, but I wanted that encoder and an angle in the design.
Render of the PCB from KiCAD. |
With a general concept in mind, I went over to Fusion 360 to generate a CAD model. A few iterations later and relearning how to CAD in a not entirely garbage manner, I had a workable design. I still don't know what is the best way to create the sketches and dimensions in a way that is easy to adjust later, but I tried my best.
CAD Model of the case. |
At the same time I began putting together a schematic and layout for the circuitry. The microcontroller of choice was the ATMega32u4, since it is the most popular microcontroller for the QMK firmware I plan to use. A few switches, diodes, and LEDs later, I had something ready for shipout:
With parts and boards on the way, I tested out making the case for the numpad (Oct 12). The cutting operation began with an adaptive clearing for the pocket in the middle:
Adaptive Clearing with 1/8" endmill. |
Afterwards, the program cut out the inner lip for the plate, then the drills for the corner screws, and finally the contour operation for the outside:
Inner lip, drills, and outer contour operations all done with 1/8" endmill. |
The finished cutout (the part was not removable since I tested it out in 3/4" MDF while the model is 1/2"):
Test cutting of the case in MDF. |
I laser cut out some stencils for solder paste and reflowing the parts (Oct 29):
Spreading the paste. |
Didn't have the USB C connector at the time and had to hand solder that later. |
For the plate, I wanted to use aluminum. I never cut aluminum before on my CNC but now was a great time to try (Nov 11). The stock was 1.5mm thick 5052 aluminum, and I used a 1/8, 2 flute end mill and some Tap Magic. The feedrate was 20 IPM with 0.012" depth of cut per pass:
Got a little too ambitious trying to see if it would fit in the bottom hole with 1/16" radius corners (datasheet max is 0.3mm).
Switch fits in the dogbone'd hole.
|
After that successful run, I went on to the whole plate. I slightly modified the dogbone geometry for the corners so they would be smaller. My first dogbones in the cutting test I manually put in, but there was a nice add-in for Fusion 360 that I used to add dogbones for the whole plate that can be found here.
1/8" 2 flute endmill for all operations. |
After exporting the G-code and continuous application of Tap Magic for cooling, I got this:
With some clean up:
The plate dimensions in CAD were 108.00 mm by 104.43 mm. The actual cut out plate came out to 107.9 mm by 104.7 mm. Not bad.
|
|
Before soldering all the switches to the PCB I realized there was going to be a clearance issue with the USB C connector with some types of USB C cables that have a thicker housing:
Uh-oh. USB C connection collides with the plate.
|
Soldering the PCB to the bottom of the legs for the switches (instead of the PCB sitting flush with the the bottom of the switches) gives just enough room for most cables to fit. It also turns out the cables I bought were very low quality and in some ports the USB-A side is loose, which led to my numpad being intermittently connected. When I used a snug cable or a C to C cable the numpad works fine every time.
The basic QMK firmware was easy to get working, and I was able to get keypresses on the switches and volume control on the encoder with minutes. However, the RGB LED control turned out to be a large pain in the neck. The APA102 driver in the QMK firmware has never been used before by anyone else's design and it clearly shows. Right off the bat, the base file does not compile since there was an unmatched parenthesis. I'm going to need to put some time into fixing the code and hopefully can get some nice colors running.
No comments:
Post a Comment