Skip to content

Commit 767d5f2

Browse files
authored
Merge pull request #141 from RobertGawron/develop
Develop
2 parents 7f8675c + 18158b3 commit 767d5f2

6 files changed

Lines changed: 415 additions & 238 deletions

File tree

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// This is model of bottom chassis.
2+
3+
module ChassisBottom_FrontPanel(Height)
4+
{
5+
translate([-PCB_X/2 - CHASSIS_THICKNESS-COMPONENT_TOLERANCE,
6+
-PCB_Y/2,
7+
Height])
8+
{
9+
GenericFrontPanel();
10+
}
11+
}
12+
13+
module ChassisBottom_SupportAroundPCB()
14+
{
15+
linear_extrude(height = 2*CHASSIS_THICKNESS+PCB_Z_OFFSET, convexity = 10, twist = 0)
16+
{
17+
square([PCB_X+2*COMPONENT_TOLERANCE, CHASSIS_THICKNESS]);
18+
}
19+
}
20+
21+
module ChassisBottom_SupportsAroundPCB()
22+
{
23+
translate([-PCB_X/2 -COMPONENT_TOLERANCE,
24+
-PCB_Y/2-CHASSIS_THICKNESS-COMPONENT_TOLERANCE,
25+
0])
26+
{
27+
ChassisBottom_SupportAroundPCB();
28+
}
29+
30+
translate([-PCB_X/2 - COMPONENT_TOLERANCE,
31+
PCB_Y/2+COMPONENT_TOLERANCE,
32+
0])
33+
{
34+
ChassisBottom_SupportAroundPCB();
35+
}
36+
}
37+
38+
module ChassisBottom_PCBMountingHole()
39+
{
40+
translate([0,
41+
0,
42+
CHASSIS_THICKNESS])
43+
{
44+
GenericChassis_InsertNutSocket(PCB_Z_OFFSET, false);
45+
}
46+
}
47+
48+
module ChassisBottom_PCBBottomHolder()
49+
{
50+
PCBBottomHolderThickness = 2;
51+
52+
linear_extrude(height = PCB_Z_OFFSET, convexity = 10, twist = 0)
53+
{
54+
square([PCBBottomHolderThickness, PCB_Y]);
55+
}
56+
}
57+
58+
module ChassisBottom_PCBBottomHolders()
59+
{
60+
translate([-PCB_X/2,
61+
-PCB_Y/2,
62+
CHASSIS_THICKNESS])
63+
{
64+
ChassisBottom_PCBBottomHolder();
65+
}
66+
67+
translate([PCB_X/2-1,
68+
-PCB_Y/2,
69+
CHASSIS_THICKNESS])
70+
{
71+
ChassisBottom_PCBBottomHolder();
72+
}
73+
}
74+
75+
module ChassisBottom(Height)
76+
{
77+
difference()
78+
{
79+
union()
80+
{
81+
GenericChassis(Height);
82+
ChassisBottom_FrontPanel(Height);
83+
ChassisBottom_SupportsAroundPCB();
84+
ChassisBottom_PCBMountingHole();
85+
ChassisBottom_PCBBottomHolders();
86+
87+
InsertNutSockets(Height, false);
88+
}
89+
90+
// add mounting for top and bottom chassis
91+
InsertNutSockets(Height, true);
92+
}
93+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// This is model of top chassis.
2+
3+
// below values are taken from KiCad model
4+
5+
SCREW_CONNECTOR_DX = 10 + COMPONENT_TOLERANCE;
6+
SCREW_CONNECTOR_Y = 1 - COMPONENT_TOLERANCE;
7+
SCREW_CONNECTOR_DY = 20.668 + 2*COMPONENT_TOLERANCE;
8+
9+
AdcPowerSupplyYOffset = PCB_X/2
10+
- SCREW_CONNECTOR_DX
11+
+ CHASSIS_THICKNESS
12+
- COMPONENT_TOLERANCE;
13+
14+
module ChassisTop_WallsAroundADCAndPowerSupplySocket(Height)
15+
{
16+
linear_extrude(height = Height, convexity = 10, twist = 0)
17+
{
18+
translate([AdcPowerSupplyYOffset,
19+
-SCREW_CONNECTOR_DY - SCREW_CONNECTOR_Y - CHASSIS_THICKNESS,
20+
0])
21+
{
22+
square([SCREW_CONNECTOR_DX + COMPONENT_TOLERANCE, CHASSIS_THICKNESS]);
23+
}
24+
25+
translate([AdcPowerSupplyYOffset,
26+
-SCREW_CONNECTOR_DY - SCREW_CONNECTOR_Y + SCREW_CONNECTOR_DY,
27+
0])
28+
{
29+
square([SCREW_CONNECTOR_DX + COMPONENT_TOLERANCE, CHASSIS_THICKNESS]);
30+
}
31+
32+
translate([AdcPowerSupplyYOffset,
33+
-SCREW_CONNECTOR_DY - SCREW_CONNECTOR_Y,
34+
0])
35+
{
36+
square([CHASSIS_THICKNESS, SCREW_CONNECTOR_DY + CHASSIS_THICKNESS]);
37+
}
38+
}
39+
}
40+
41+
module ChassisTop_SupportFrontPanel()
42+
{
43+
translate([-PCB_X/2 -COMPONENT_TOLERANCE,
44+
-PCB_Y/2,
45+
CHASSIS_THICKNESS])
46+
{
47+
linear_extrude(height = CHASSIS_THICKNESS, convexity = 10, twist = 0)
48+
{
49+
square([CHASSIS_THICKNESS, PCB_Y]);
50+
}
51+
}
52+
53+
}
54+
55+
module ChassisTop_DebugPanelMountingScrewSupport()
56+
{
57+
58+
DebugPanelSupportSize = 10;
59+
60+
translate([-PCB_X/2+DEBUG_CONNECTOR_X+DEBUG_CONNECTOR_DX/2,
61+
-PCB_Y/2+DEBUG_CONNECTOR_DY/2+COMPONENT_TOLERANCE,
62+
0])
63+
{
64+
difference()
65+
{
66+
union()
67+
{
68+
translate([0,DebugPanelSupportSize/2,0])
69+
{
70+
linear_extrude(height = CHASSIS_THICKNESS+INSERT_NUT_LENGTH, convexity = 10, twist = 0)
71+
{
72+
square([INSERT_NUT_HOLDER_DIAMETER, DebugPanelSupportSize], center=true);
73+
}
74+
}
75+
GenericChassis_InsertNutSocket(CHASSIS_THICKNESS+INSERT_NUT_LENGTH, false);
76+
}
77+
78+
// add hole for debug socket screw
79+
linear_extrude(height = CHASSIS_THICKNESS+INSERT_NUT_LENGTH, convexity = 10, twist = 0)
80+
{
81+
circle(r=INSERT_NUT_RADIUS);
82+
}
83+
}
84+
}
85+
}
86+
87+
module Chassis3DTop(Height)
88+
{
89+
difference()
90+
{
91+
union()
92+
{
93+
difference()
94+
{
95+
GenericChassis(Height);
96+
GenericDebugPanel(Height);
97+
}
98+
99+
ChassisTop_DebugPanelMountingScrewSupport();
100+
}
101+
102+
// add hole for ADC and power supply socket
103+
translate([AdcPowerSupplyYOffset,
104+
-SCREW_CONNECTOR_DY - SCREW_CONNECTOR_Y,
105+
0])
106+
{
107+
linear_extrude(height = Height, convexity = 10, twist = 0)
108+
{
109+
square([SCREW_CONNECTOR_DX + CHASSIS_THICKNESS, SCREW_CONNECTOR_DY]);
110+
}
111+
}
112+
113+
// add hole for front pannel
114+
translate([-PCB_X/2 - CHASSIS_THICKNESS-COMPONENT_TOLERANCE,
115+
-PCB_Y/2,
116+
CHASSIS_THICKNESS])
117+
{
118+
GenericFrontPanel();
119+
}
120+
}
121+
122+
ChassisTop_WallsAroundADCAndPowerSupplySocket(Height);
123+
ChassisTop_SupportFrontPanel();
124+
125+
// add nounting screws
126+
InsertNutSockets(Height, false);
127+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This is model panel for UART and MCU sockets, it will be taken out for debugging and development.
2+
3+
module GenericDebugPanel(Height)
4+
{
5+
translate([-PCB_X/2+DEBUG_CONNECTOR_X,
6+
,-PCB_Y/2
7+
+ COMPONENT_TOLERANCE
8+
- 2*CHASSIS_THICKNESS // TODO this is wrong
9+
- DEBUG_CONNECTOR_DY/2
10+
+ CHASSIS_CORNER_DIAMETER,
11+
0])
12+
{
13+
linear_extrude(height = Height, convexity = 10, twist = 0)
14+
{
15+
square([DEBUG_CONNECTOR_DX, DEBUG_CONNECTOR_DY]);
16+
}
17+
}
18+
}
19+
20+
module DebugPanel(Height)
21+
{
22+
difference()
23+
{
24+
GenericChassis(Height);
25+
26+
difference()
27+
{
28+
GenericChassis(Height);
29+
GenericDebugPanel(Height);
30+
}
31+
}
32+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
module Chassis2DQuarter(Thickness)
2+
{
3+
CHASSIS_X = PCB_X/2 + COMPONENT_TOLERANCE + Thickness;
4+
CHASSIS_Y = PCB_Y/2 + COMPONENT_TOLERANCE + Thickness;
5+
6+
polygon(points=[
7+
[0, 0],
8+
[CHASSIS_X, 0],
9+
[CHASSIS_X, CHASSIS_Y + CHASSIS_CORNER_DIAMETER/2 - Thickness/2],
10+
[CHASSIS_X - CHASSIS_CORNER_RADIUS - CHASSIS_THICKNESS/2, CHASSIS_Y + CHASSIS_CORNER_DIAMETER],
11+
[0, CHASSIS_Y + CHASSIS_CORNER_DIAMETER],
12+
]);
13+
14+
translate([CHASSIS_X - CHASSIS_THICKNESS - INSERT_NUT_RADIUS,
15+
CHASSIS_Y + INSERT_NUT_RADIUS,
16+
0])
17+
{
18+
circle(r=INSERT_NUT_RADIUS + CHASSIS_THICKNESS);
19+
}
20+
}
21+
22+
module Chassis2DHalf(Thickness)
23+
{
24+
Chassis2DQuarter(Thickness);
25+
26+
rotate([180, 0, 0])
27+
{
28+
Chassis2DQuarter(Thickness);
29+
}
30+
}
31+
32+
module GenericChassis2D(Thickness)
33+
{
34+
Chassis2DHalf(Thickness);
35+
36+
rotate([0, 180, 0])
37+
{
38+
Chassis2DHalf(Thickness);
39+
}
40+
}
41+
42+
43+
44+
module GenericChassis_InsertNutSocket(Height, isFull)
45+
{
46+
linear_extrude(height = Height, convexity = 10, twist = 0)
47+
{
48+
difference()
49+
{
50+
if(!isFull)
51+
{
52+
circle(r=INSERT_NUT_RADIUS + CHASSIS_THICKNESS);
53+
}
54+
55+
circle(r=INSERT_NUT_RADIUS);
56+
}
57+
}
58+
}
59+
60+
module InsertNutSockets(Height, isFull)
61+
{
62+
Thickness = CHASSIS_THICKNESS;
63+
CHASSIS_X = PCB_X/2 + COMPONENT_TOLERANCE + Thickness;
64+
CHASSIS_Y = PCB_Y/2 + COMPONENT_TOLERANCE + Thickness;
65+
66+
translate([CHASSIS_X - Thickness - INSERT_NUT_RADIUS,
67+
CHASSIS_Y + INSERT_NUT_RADIUS,
68+
0])
69+
{
70+
GenericChassis_InsertNutSocket(Height, isFull);
71+
}
72+
73+
translate([CHASSIS_X - Thickness - INSERT_NUT_RADIUS,
74+
-CHASSIS_Y - INSERT_NUT_RADIUS,
75+
0])
76+
{
77+
GenericChassis_InsertNutSocket(Height, isFull);
78+
}
79+
80+
translate([-CHASSIS_X + Thickness + INSERT_NUT_RADIUS,
81+
CHASSIS_Y + INSERT_NUT_RADIUS,
82+
0])
83+
{
84+
GenericChassis_InsertNutSocket(Height, isFull);
85+
}
86+
87+
translate([-CHASSIS_X + Thickness + INSERT_NUT_RADIUS,
88+
-CHASSIS_Y - INSERT_NUT_RADIUS,
89+
0])
90+
{
91+
GenericChassis_InsertNutSocket(Height, isFull);
92+
}
93+
}
94+
95+
module GenericChassis(Height)
96+
{
97+
difference()
98+
{
99+
linear_extrude(height = Height, convexity = 10, twist = 0)
100+
{
101+
GenericChassis2D(CHASSIS_THICKNESS);
102+
}
103+
104+
translate([0, 0, CHASSIS_THICKNESS])
105+
{
106+
linear_extrude(height = Height - CHASSIS_THICKNESS, convexity = 10, twist = 0)
107+
{
108+
GenericChassis2D(0);
109+
}
110+
}
111+
}
112+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This is model of panel where BNC, LCD and encoder are.
2+
3+
module GenericFrontPanel()
4+
{
5+
linear_extrude(height = TOP_CHASSIS_HEIGHT-CHASSIS_THICKNESS, convexity = 10, twist = 0)
6+
{
7+
square([CHASSIS_THICKNESS, PCB_Y]);
8+
}
9+
}

0 commit comments

Comments
 (0)