-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathdrive_gear_parts.scad
114 lines (93 loc) · 2.33 KB
/
drive_gear_parts.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
include <config.scad>
use <GDMUtils.scad>
use <publicDomainGearV1.1.scad>
$fa = 2;
$fs = 2;
module drive_gear() {
shaft = motor_shaft_size;
rack_module = rack_tooth_size / pi;
gear_pcd = gear_teeth * rack_module;
addendum = rack_module;
dedendum = rack_module * 1.25;
gear_id = gear_pcd - 2*dedendum;
gear_od = gear_pcd + 2*addendum;
CA = 30;
twist = 360*0.5*rack_height*tan(CA) / (gear_pcd * pi);
base = gear_base - 1;
color("Salmon")
prerender(convexity=10)
difference() {
union() {
up(base+rack_height/2-0.05) {
difference() {
// Herringbone gear
zflip_copy() {
up(rack_height/2/2) {
gear (
mm_per_tooth = rack_tooth_size,
number_of_teeth = gear_teeth,
thickness = rack_height/2,
hole_diameter = shaft/2,
twist = twist,
teeth_to_hide = 0,
pressure_angle = 20,
backlash = gear_backlash
);
}
}
// Bevel end of gear.
up(rack_height/2) {
zflip() {
difference() {
down(0.01) cylinder(h=1, d=gear_od+2, center=false);
cylinder(h=1, d1=gear_id, d2=gear_od, center=false);
}
}
}
}
}
up(base/2) {
difference() {
// Gear Base
cylinder(h=base, d=max(18,gear_od), center=true);
right(motor_shaft_size/2+1.5) {
yrot(90) {
// Nut Slot
scale([1.1, 1.04, 1.04]) hull() {
metric_nut(size=set_screw_size, hole=false);
right(base/2) metric_nut(size=set_screw_size, hole=false);
}
// Set screw hole.
down(4) cylinder(d=set_screw_size+printer_slop, h=30, $fn=18);
// Screw head clearance
up(6) cylinder(d=set_screw_size*2+printer_slop, h=30, $fn=18);
}
}
}
}
}
down(0.01) {
difference() {
union() {
// Shaft hole
cylinder(h=rack_height+base, d=shaft, center=false, $fn=18);
// chamfer bottom of shaft hole.
down(0.01) {
cylinder(h=2, d1=shaft+2, d2=shaft, center=false, $fn=18);
}
}
// Shaft flat side.
if (motor_shaft_flatted) {
right(1.4*shaft)
cube(size=[shaft*2, shaft*2, (rack_height+base)*3], center=true);
}
}
}
}
}
//!drive_gear();
module drive_gear_parts() { // make me
drive_gear();
}
drive_gear_parts();
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap