CADpad
Hardware- 3 Devlogs
- 7 Total hours
A macropad made to optimize my own most used commands/actions in Solidworks-Makers CAD.
A macropad made to optimize my own most used commands/actions in Solidworks-Makers CAD.
This is devlog number three, and i unfortunately came to the code! This is the last for this project. Then i also want to say and recommend everyone to go to bed.
Finishing up the github repository at 3 am as im writing this isnt especially fun as i promissed some old friends from another country to meet up in 6 hours. So if you looking through commits, dont.
Since this pad uses a Direct Pin layout (every switch goes straight to its own pin and GND), QMK forced me to trick its system. It is built for huge keyboards with regular row/column grids, so I had to map my XIAO RP2040 pins into a “virtual” 4x2 rutenett grid in the info.json file, filling blank spaces with null tokens so the compiler wouldn’t crash.
The not fun and the biggest headache was writing the manual C-functions in keymap.c to handle my specific SolidWorks workflow:
The 0.1mm Problem: I originally wanted the knob to toggle down to a 0.1 interval. But you remember quickly that QMK integer variables (uint8_t) doesnt work with decimals. If you pass 0.1, it compresses to 0 and the wheel stops working. I just changed the interval to (1mm-10mm-25mm)
The Blind Macro: Since a keyboard is “blind” and can’t read what’s on my screen, making the SW4_Round click function actually work required a clipboard loop. When you click the knob, it grabs whatever number you have highlighted (Ctrl + A then Ctrl + X), types out =round(, pastes it back (Ctrl + V), and adds /10)*10 to do the rounding math inside SolidWorks.
This is devlog number two and unlike the first part making the PCB, there was no major problems however several smaller ones that took quite some time.
The biggest hurdle by far was converting the KiCad PCB into a correct useable file. Importing the 3D models into KiCad to make a correct STEP file took quite some time. All components ofc lacked native 3D files, which had to be brought in from grabCAD. Hardest part here was trying to aling the 3D file with the footprint so i could update all the footprints instead of having to do each manually. (I ended up having to do each manually).
Once the PCB step file was successfully created, I brought it into my CAD software as a layout guide. Having the 3D model helped me to design the case from the inside out, ensuring good clearance for the key switches and the rotary encoder knob. The final enclosure features a kinda sandiwch ice cream design.
This is devlog number one so i will also give a quick explanation on what this project is intended for if the title is not obvious enough. Im using the basis of the hackpad mission to make a quickmacro board for CAD/solidworks. I wanted this pad to include my own most common actions/commands using regular keyboard buttons. This also including a distance-adjuster using a knob with a switch if you want to round the distance.
Rotary_Encoder:RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Sxxxx.The correct footprint to use for the rotary encoder included in the package would just be the standard Rotary_Encoder:RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mm