forked from jcrocholl/rostock
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcarriage.scad
139 lines (127 loc) · 4.45 KB
/
carriage.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
include <configuration.scad>
use <polyholes.scad>
offset = rod_separation / 2;
height = carriage_height;
cutout = 13;
width = rod_separation + cutout + 13;
middle = 2*offset - width/2;
module ball_parallel_joints(reinforced=0) {
cup_crop_angle = 20;
cup_crop_y = cup_rad*sin(cup_crop_angle);
cup_crop_z = cup_rad*cos(cup_crop_angle);
cup_angle = -45;
attachment_width = ball_rad * 4;
width = rod_separation + attachment_width;
middle = 2*offset - width/2;
difference() {
union() {
for (i = [-1, 1]) {
hull() {
translate([i*offset, 0, 0]) difference() {
translate([0, 0, cup_offset]) rotate([270+cup_angle, 0, 0]) translate([0, 0, cup_crop_y]) cylinder(r = cup_rad, h = 20);
translate([0, 10, -platform_thickness/2-10]) cube([width, 30, 20], center = true);
}
if (reinforced>0) {
translate([i*(offset+cup_rad-reinforced/2), 18, -platform_thickness/2+(platform_thickness+reinforced/2)/2]) cube([reinforced, 0.1, platform_thickness+reinforced/2], center = true);
} else {
#translate([i*offset, 18, 0]) cube([attachment_width, 0.1, platform_thickness], center = true);
}
}
}
}
for (i = [-1, 1]) {
translate([i*offset, 0, cup_offset]) sphere(r = ball_rad);
}
translate([0, 16-middle, 0]) cylinder(r=middle, h=100, center=true);
*translate([0, -8, 0]) cube([2*middle, 20, 100], center=true);
}
}
module parallel_joints(reinforced) {
difference() {
union() {
translate([0, 8, 0]) cube([width, 20, platform_thickness], center=true);
intersection() {
cube([width, 20, platform_thickness], center=true);
rotate([0, 90, 0]) cylinder(r=5, h=width, center=true);
}
// Reinforcing
intersection() {
translate([0, 18, platform_thickness/2]) rotate([45, 0, 0])
cube([width, reinforced, reinforced], center=true);
translate([0, 0, 20]) cube([width, 35, 40], center=true);
}
}
rotate([0, 90, 0]) poly_cylinder(r=1.5, h=80, center=true, $fn=12);
for (x = [-offset, offset]) {
translate([x, 5.5, 0])
cylinder(r=cutout/2, h=100, center=true, $fn=24);
translate([x, -4.5, 0])
cube([cutout, 20, 100], center=true);
translate([x, 0, 0]) rotate([0, 90, 0]) rotate([0, 0, 30])
cylinder(r=3.3, h=17, center=true, $fn=6);
}
translate([0, 2, 0]) cylinder(r=middle, h=100, center=true);
translate([0, -8, 0]) cube([2*middle, 20, 100], center=true);
}
}
module lm8uu_mount(d, h) {
union() {
difference() {
intersection() {
cylinder(r=d/2+3.5, h=h, center=true);
translate([0, -8, 0]) cube([d+4, 13, h+1], center=true);
}
poly_cylinder(r=d/2, h=h+1, center=true);
}
}
}
module belt_mount(height=height) {
translate([idler_bearing[1]/2 - 2, 0, 0]) {
union() {
#difference() {
translate([0, 2, 0]) cube([4, 13, height], center=true);
for (z = [-3.5, 3.5])
translate([0, 5, z])
cube([5, 13, 3], center=true);
}
for (y = [1.5, 5, 8.5]) {
translate([0, y, 0]) cube([4, 1.2, height], center=true);
}
}
}
}
module carriage() {
translate([0, 0, height/2 - (ball_joints ? cup_offset : 0)])
union() {
for (x = [-smooth_rod_separation/2, smooth_rod_separation/2]) {
translate([x, 0, 0]) lm8uu_mount(d=smooth_rod_bearing[1], h=smooth_rod_bearing[2]);
}
belt_mount();
difference() {
union() {
translate([0, -5.6, 0])
cube([smooth_rod_separation-10, 5, height], center=true);
translate([0, -carriage_hinge_offset, -height/2+4])
if (ball_joints) {
ball_parallel_joints(smooth_rod_bearing[1]+1);
} else {
parallel_joints(smooth_rod_bearing[1]+1);
}
}
// Screw hole for adjustable top endstop.
translate([18, -16, -height/2+4]) cylinder(r=1.5, h=20, center=true, $fn=12);
for (x = [-smooth_rod_separation/2, smooth_rod_separation/2]) {
translate([x, 0, 0])
cylinder(r=smooth_rod_bearing[1]/2+0.5, h=height+1, center=true);
// Zip tie tunnels.
for (z = [-height/2+4, height/2-4])
translate([x, 0, z])
cylinder(r=smooth_rod_bearing[1]/2+5.5, h=3, center=true);
}
}
}
}
carriage();
// Uncomment the following lines to check endstop alignment.
use <idler_end.scad>;
translate([0, 0, -20]) rotate([180, 0, 0]) idler_end();