# Design Most of the time I work on the design of the mechanics so they work properly. I made everything in FreeCAD and KiCAD. \ In FreeCAD I also made many thing parametric on one hand for easier adjustment and possible errors in production/assembly. ## Electronics For the electronics I separated the project into 5 different modules for easier replacement, if some get destroyed while using (because some of them are mechanically stressed on usage, see below). ### Schematics I used 2 ATtiny because I did not had enough input pins on the ATtiny1624 either and I wanted to be decoupled from the top MIDI module to easily replace and extend it on that part (and I missed, that we had an ATtiny in the inventory with more pins (ATtiny3226) -.- ) ![IMAGE](../media/final_project/pcb_schematics_mcu.png) For the connectors I used simple pin header and for the I2C because I wanted to make extra PCB for them I used cable connectors for it (and I didn't want to make a big PCB because this would be a part that could break easier). ![IMAGE](../media/final_project/pcb_schematics_connectors.png) ### Routing ![IMAGE](../media/final_project/pcb_route_keys.png) ::::{grid} :::{grid-item} :columns: 8 For the key traces I simply used a ground-plane and a windy, square-wave like structure that gets connected with the conductive foam when touched.\ I used small traces and many winds to increase the probability of connecting the ground plane with the pin wire. ![IMAGE](../media/final_project/pcb_route_attiny.png) ::: :::{grid-item} ![IMAGE](../media/final_project/pcb_route_key.png) ::: :::: The ATtiny PCB is pretty normal except **I adjusted the top left footprint** for the 3 pin header so the ground plane can fit through the soldering pads. Also I only noticed now, that the decoupling capacitor could have been placed nearer to the VCC and GND pins as mentioned [here](https://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny1624-26-27-DataSheet-DS40002234A.pdf#_OPENTOPIC_TOC_PROCESSING_d139e9216). But this was no problem in the end.\ And here the PCB with the XIAO and the I2C connectors for the other modules on the left and right side. ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/pcb_route_right_con.png) ::: :::{grid-item} ![IMAGE](../media/final_project/pcb_route_xiao.png) ::: :::{grid-item} ![IMAGE](../media/final_project/pcb_route_left_con.png) ::: :::: ### System Integration For system integration I designed the PCBs in one file and aligned the header here so they should fit. ![IMAGE](../media/final_project/pcb_route_all.png) ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/pcb_route_system_integration.png) For creating the edge-cuts and holes I used a sketch from the 3D modelling to adjust and create the holes in the PCBs. Also I imported the PCBs into FreeCAD with the [KiCADStepUp-Addon](https://github.com/easyw/kicadStepUpMod) and then used those PCBs for further modelling. Here I used shape-binders to base my modelling on it and also check in the assembly, if everything fits nicely with a bit of tolerance (see below). ::: :::{grid-item} ![IMAGE](../media/final_project/pcb_freecad_test_import.png) ![IMAGE](../media/final_project/pcb_freecad_imported.png) ::: :::: And Because I had problems that when connecting the PCBs the peeled off from the PCB I made the traces a bit thicker (I don't know, if this helped anyway ._.). ::::{grid} :::{grid-item} Before ![IMAGE](../media/final_project/pcb_after_fix_thickness.png) ::: :::{grid-item} After (look on the top pin header) ![IMAGE](../media/final_project/pcb_before_fix_thickness.png) ::: :::: For more system integration, see [below](#sys-int) ## Mechanics and Housing I started designing of the keys and housing and also tested the first assembly in the [CAD-Week](../assignments/computer_aided_design.md#first-design-files-final-project). ### Keys ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_model_basekey.png) First I designed a base key which I used for the other keys to build upon.\ I cut them by a specific calculation so the distance on the back is equal (almost ._.) ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_blackkey.png) ::: :::: ![IMAGE](../media/final_project/freecad_model_other_keys.png) ### Housing I also designed simultaneously the housing and for making better adjustment, I cut it up in 4 pieces: ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_model_base_housing.png) First Housing design ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_split_base_housing.png) Cut up in bottom plates, Led housing and key holder ::: :::: **Key Holder** The I first extended the key holder design: ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_model_keyholdertop1.png) Here the harder part was the calculation for the right linear pattern I used for the key slots. ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_keyholdertop2.png) I also integrated snap-fits for the top modules and a b-spline structure for easier sliding in the rubber bands ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_keyholdertop3.png) And then for a good system integration I added holes for the bottom plate, PCB and holes to but the magnets (slits on the side) ::: :::: **XIAO Body** Then I designed the first body for just the XIAO and the side connectors. ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_model_xiaobody3.png) I made a little overhang for a better packaging (so you don't see the rubber bands). Also note the slots on the bottom for the PCB and the snap-fits. And on the side for the modules. ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_xiaobody2.png) Also a slot for the USB-C connector, so that it lays inside the slot (see system integration). ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_xiaobody1.png) And created inside the housing mounting holes for each PCB (the smaller ones) and for the bottom plate (the bigger ones). ::: :::: **Covers** Next I designed a side and bottom plate to connect and cover up everything. ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_model_side_plate.png) Side plate with holes for the magnets. ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_model_bottom_plate.png) Bottom plate with holes for the screws ::: :::: ### Assembly Then I constantly worked with the assembly and tested everything there first. **Inside** I tested the imported PCBs ![IMAGE](../media/final_project/freecad_assambly_inside.png) **Assembled** Here the full assembly with the side plates. ![IMAGE](../media/final_project/freecad_assambly1.png) ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly3.png) ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly2.png) ::: :::: **Exploded** And also here some exploded views: ![IMAGE](../media/final_project/freecad_assambly_exploded1.png) ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly_exploded4.png) ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly_exploded3.png) ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly_exploded2.png) ::: :::: (sys-int)= ### System Integration ![IMAGE](../media/final_project/freecad_assambly_system_integration1.png) To have a well integrated/packaged system I always tried to use the imported PCBs and the assembly as a reference to create the models. ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_make_assambly.png) Here most of the time I used shape-binders from the assembly to create holes and attachment to the body on those shape-binders geometry.\ This way (and with some tolerance) I could design very closely to the PCBs and could make a good and tight fit to them. ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_modelling_system_integration1.png) ![IMAGE](../media/final_project/freecad_modelling_system_integration2.png) ::: :::: Here I checked the distance because we had only 25mm cable for the connector PCBs ![IMAGE](../media/final_project/freecad_assambly_system_integration_assure_wire_with.png) And here I used the assembly with a 'Revolute'-Joint to test the keys on the PCBs: ::::{grid} :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly_test_key_angle2.png) Here I tested the alignment of the individual keys so they hit the prepared traces. ::: :::{grid-item} ![IMAGE](../media/final_project/freecad_assambly_test_key_angle.png) Here I tested the angle of the little cut when the key is pressed. ::: :::: For the physical testing of the system integration, see [here](./final_project_production.md#system-integration).