tompi / cheapino

An affordable split 36 keys keyboard
650 stars 26 forks source link

Request for MCU-Covered Case for Cheapino v2 #72

Open azzamsa opened 2 months ago

azzamsa commented 2 months ago

Hi 👋🏽,

I absolutely love everything about Cheapino, but one thing that bothers me is the exposed MCU. I’m a bit paranoid about solder residue, so I clean it frequently and use a full-coverage case for my keyboard.

Most of the time, I use Chewiedies's case, which is great because it only requires a 3D printer thanks to its gasket mount design. I love it, especially since sourcing exact screws or heat inserts is really difficult here. I use the case as-is, without any screws or magnets, as my main goal is simply to cover the MCU and PCB to prevent accidental contact.

Cheapino already has a v2 case, but the MCU is still exposed. How difficult would it be to add a version where the MCU is covered? I don’t have any 3D modeling experience beyond using Tinkercad to cover a TRRS hole.

Here’s an example of what I’m envisioning:

image

I am also surprised by its size, a whopping 24 MB.

image

Thanks a lot in advance 🙏🏽

tompi commented 2 months ago

Hi!

I thought about this, and there are several problems when doing this:

  1. It will be very difficult to print if the top is not uniform(today it prints with top down, since top is even. if you wanted mcu cover, there would be no surface to be placed down on the bed, so maybe you would print it 45degrees angle with supports?
  2. The height of the mcu varies drastically depending on which type of mount you choose(pin headers or sockets, and there are very different height sockets...)
  3. The LED would be hidden. (P.T. its controlled by qmk, so you can use it for effects, caps lock, layer indication etc)

I think a solution with a separate mcu-"lid" would be best, some type of snap on...

I tried to use tinkercad myself, but very quickly ran into size limitations, and switched to openscad, which is VERY cool :) You can find the openscad files in the repo if you like to try, otherwise I will keep this and use it for a lid-addon whenever I get some time...

SadWitchBoards commented 2 months ago

Snap on or magnetic with a height based on the 3.5 headers on the shopping list and a hole for the led to shine through, perhaps?

azzamsa commented 1 week ago

Hi,

I’ve been working on modifying the Cheapino case to add an MCU and an RJ45 cover. The cover might not be for everyone, but I wanted to share my journey and get some suggestions along the way.


Having no prior experience with OpenSCAD, I initially jumped into TinkerCAD. However, I ran into issues with the case's large size, which is caused by the $fn=50 variable in OpenSCAD.

After removing $fn, I was able to work on the case in TinkerCAD without issues. But creating fillets in TinkerCAD turned out to be a real pain. So, I switched to FreeCAD. Unfortunately, modifying STL files in FreeCAD was painfully slow due to the huge mesh of the case. Simple operations often took forever, and saving the file frequently caused my system to hang. On several occasions, I even had to restart my machine because it became completely unresponsive—even though it’s a fairly powerful setup.

I also tried Plasticity, but modifying existing STL files there wasn’t straightforward either.

The OpenSCAD workbench in FreeCAD worked well for simple models but failed when handling the case. I brought up this issue several times on the FreeCAD Discord server, but received no response. An admin mentioned that the OpenSCAD workbench doesn’t get much attention, so bugs are to be expected.

Next, I tried OnShape. While it handled large STL imports well, I wasn’t interested in investing time learning a tool I don’t enjoy.

Finally, I decided to give OpenSCAD another shot. Initially, I manually adjusted positions, which was time-consuming. Eventually, I realized I could copy the positions from the original model. At first, I tried building the structure using three cubes (|-|), but later learned it’s better to use two cubes with difference.

That said, there are still challenges with OpenSCAD. Rotating items in preview mode is cumbersome, as you have to render the model first before adjusting its position. To simplify this, I started using $fn = $preview ? 10 : 50;

I turned to OpenSCAD because creating fillets in TinkerCAD was frustrating, but it’s proving to be a similar struggle here. I also attempted to use FreeCAD to add fillets to an exported STL file, but it just kept crashing.

I don’t want to use minkowski for filleting because it messes up the dimensions by adding extra size to the cube. The hull function works well for the sides, but I’d need additional steps to fillet the top. Using an SVG imported into OpenSCAD could work, but I’d face the same issue for the top side.


Hi @tompi,

Would you mind reviewing my modifications before I send them for printing? Any suggestions—especially regarding the fillets—would be really helpful.

Since I don’t have a 3D printer, I’ll need to send this out to get printed. I’ve already checked the dimensions using the ruler tool, and everything seems to match my requirements.

For reference, I have a 13mm RJ45 (measured from the PCB) and a 9mm MCU (also from the PCB).

Thanks in advance!


image

From 1af1ddb71185924ef26874b7ab845e6ed8207fc6 Mon Sep 17 00:00:00 2001
From: "Azzam S.A" <noreply@azzamsa.com>
Date: Thu, 21 Nov 2024 04:53:49 +0700
Subject: [PATCH 1/3] feat: rj45 cover (right side)

---
 case/cheapino-top-right.scad | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/case/cheapino-top-right.scad b/case/cheapino-top-right.scad
index 1508715..14985dd 100644
--- a/case/cheapino-top-right.scad
+++ b/case/cheapino-top-right.scad
@@ -1,7 +1,7 @@
 height = 95.1738;
 width = 132.6134;
 step = 0.06;
-$fn=50;
+$fn = $preview ? 10 : 50;

 height_translation = 0;
 include <modules.scad>
@@ -26,10 +26,12 @@ mirror() {

     // RJ45 socket
     color("cyan") {
+        // main hole
         translate([29.2, -9.33, 4.1])
         linear_extrude(10)
         square([30, 16.6]);

+        // clip hole
         translate([45, -4.53, 2.5])
         linear_extrude(10)
         square([15, 7]);
@@ -55,5 +57,27 @@ mirror() {

     mounting_hole_inserts();
   }
+
+  // RJ45 socket cover
+  color("purple") {
+    difference() {
+      // x = front/back, y = left/right
+      // -2 is thickness of the back cover
+      // -8.7 is the initial size of left/right
+      // 4.1 is the intial value of the PCB
+      translate([29.2 + -2, -9.33 - 2, 4.1])
+        // RJ45 height is 13mm
+        // I set 15, then I will use a difference to get 13mm
+        linear_extrude(15)
+        // width = front/back, height = left/right
+        // Add thickness of 4. 2 left 2 right.
+        square([30 - 7, 16.6 + 4]);
+
+      // repeat the difference() for initial rj45
+      translate([29.2, -9.33, 4.1])
+        linear_extrude(13)
+        square([30, 16.6]);
+    }
+  }
 }

-- 
2.47.0

From fd91478b1479a31c6de0c901b2200a4827fc5724 Mon Sep 17 00:00:00 2001
From: "Azzam S.A" <noreply@azzamsa.com>
Date: Fri, 22 Nov 2024 04:53:54 +0700
Subject: [PATCH 2/3] feat: rj45 cover (left side)

---
 case/cheapino-top-left.scad | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/case/cheapino-top-left.scad b/case/cheapino-top-left.scad
index 1cc6a33..beab5e4 100644
--- a/case/cheapino-top-left.scad
+++ b/case/cheapino-top-left.scad
@@ -1,7 +1,7 @@
 height = 95.1738;
 width = 132.6134;
 step = 0.06;
-$fn=50;
+$fn = $preview ? 10 : 50;

 height_translation = 0;
 include <modules.scad>
@@ -41,3 +41,34 @@ mounting_hole_inserts();

+
+// RJ45 socket
+
+translate([0,0,9.1])
+rotate([0,180,0])
+ // RJ45 socket cover
+  color("purple") {
+    difference() {
+      // x = front/back, y = left/right
+      // -2 is thickness of the back cover
+      // -10.6 is the initial size of left/right
+      // 4.1 is the intial value of the PCB
+      translate([29.2 + -2, -10.6 - 2, 4.1])
+        // RJ45 height is 13mm
+        // I set 15, then I will use a difference to get 13mm
+        linear_extrude(15)
+        // width = front/back, height = left/right
+        // Add thickness of 4. 2 left 2 right.
+        square([30 - 7, 16.6 + 4]);
+
+      // repeat the difference() for initial rj45
+      translate([29.2, -10.6, 4.1])
+        linear_extrude(13)
+        square([30, 16.6]);
+    }
+}
+
+
+
+
+
-- 
2.47.0

From c4d370298b0d17b2becd5f80ea85d3608e2f8c3f Mon Sep 17 00:00:00 2001
From: "Azzam S.A" <noreply@azzamsa.com>
Date: Fri, 22 Nov 2024 05:10:33 +0700
Subject: [PATCH 3/3] feat: MCU cover (left side)

---
 case/cheapino-top-left.scad | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/case/cheapino-top-left.scad b/case/cheapino-top-left.scad
index beab5e4..e954e58 100644
--- a/case/cheapino-top-left.scad
+++ b/case/cheapino-top-left.scad
@@ -40,13 +40,9 @@ mounting_hole_inserts();
 }

-
-
-// RJ45 socket
-
+// RJ45 socket cover
 translate([0,0,9.1])
 rotate([0,180,0])
- // RJ45 socket cover
   color("purple") {
     difference() {
       // x = front/back, y = left/right
@@ -68,6 +64,27 @@ rotate([0,180,0])
     }
 }

+// MCU cover
+translate([0,0,9.1])
+rotate([0,180,0])
+  color("gray") {
+    difference() {
+      // x = left/right, y = front/back
+      translate([29.5 - 2, 10.2 - 2, 4.1])
+        // MCU+hotswap height is 9mm
+        // I set 11, then I will use a difference to get 9mm
+        linear_extrude(11)
+        // width = left/right, height = front/back
+        // Add thickness of 4. 2 left 2 right.
+        square([19.5 + 4, 25 + 2]);
+
+      // repeat the difference() for initial mcu cutout
+      translate([29.2, 10.2, 4.1])
+        linear_extrude(9)
+        square([19.5, 25]);
+    }
+}
+

-- 
2.47.0
SadWitchBoards commented 1 week ago

I have a printer and can print this and share photos if you like.

azzamsa commented 1 week ago

Thanks! 🙏🏻

But, let's wait for Tompi response. Maybe he got a better design or a suggestion for easier steps to do fillets.

tompi commented 1 week ago

Looks good, I really like your $preview conditional $fn solution!

It would probably be nice with a bit rounded corners for the rj45/mcu covers?

If you make it a pull request, its much easier to cooperate on, if I want to make a suggestion, or if @SadWitchBoards wants to test it, it will be super easy to just use the PR ?

SadWitchBoards commented 1 week ago

Sounds good. Just send me any files you want tested and I will print them and try them out on one of my boards.

azzamsa commented 1 week ago

It would probably be nice with a bit rounded corners for the rj45/mcu covers?

I don’t want to use minkowski for filleting because it messes up the dimensions by adding extra size to the cube. The hull function works well for the sides, but I’d need additional steps to fillet the top. Using an SVG imported into OpenSCAD could work, but I’d face the same issue for the top side. https://github.com/tompi/cheapino/issues/72#issuecomment-2494828805

@tompi do you have any comments on a better way to do fillet in OpenSCAD?

I have put the relevant commits here https://github.com/tompi/cheapino/pull/106/commits

tompi commented 1 week ago

Thanks for the PR!

For the rounded corners: I was thinking starting with 2D rounded rectangle, and then, with a loop, shrink it and copy it on top of the previous.

This is how the case is rounded on the case.