-
Notifications
You must be signed in to change notification settings - Fork 0
/
servo_gauge.scad
142 lines (129 loc) · 3.99 KB
/
servo_gauge.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
140
141
142
// Smoothing parameter
$fn = 100;
// Gauge parameters
gauge_od = 60;
gauge_wall_thickness = 2;
gauge_height = 20;
// Call this function to render all parts
render_all();
module render_all() {
// Servo model
translate([-23/2+5.9,0,16 - 4])
9g_motor();
// Main housing for the servo
translate([-23/2+5.9,0,-20])
color("grey")
servomount();
// The disc mounted to the front of the servo that will show the dial graphic
translate([0,0,43.5])
color("white")
dial_plate();
// The mount to secure the acrylic
// Translate upwards by height of base + thickness of glass front
translate([0,0,75])
rotate([180,0,0])
color("grey", 0.8)
front_cover_holder();
}
// Create the plate that will be placed on top of the servo
// and have the indicator dial display printed on it.
module dial_plate() {
// Allowance to make sure disc definitely fits inside the tube
rim_fudge = 0.4;
difference() {
union() {
translate([0,0,3])
cylinder(h=1, d=gauge_od - (gauge_wall_thickness*2) - rim_fudge);
translate([-5.5,0,0])
cube([36,18,8],center=true);
}
translate([-5.5,0,-11])
9g_motor();
for ( hole = [8.5,-19.5] ){
translate([hole,0,5]) cylinder(r=1.5, h=20, $fn=20, center=true);
}
}
}
// This holds the acrylic screen protector on the front
module front_cover_holder() {
front_thickness = 1;
outside_rim_thickness = 2;
// reduce this for a tighter fit
rim_fudge = 0.05;
difference() {
cylinder(h=8, d=gauge_od + outside_rim_thickness);
translate([0,0,front_thickness])
cylinder(h=10, d=gauge_od + rim_fudge);
translate([0,0,-0.01])
cylinder(h=10, d=gauge_od - 3);
}
}
module servomount() {
outside_rim_height = 5;
outside_rim_thickness = 2;
inside_rim_height = 4;
inside_rim_thickness = 1;
// The thickness of the back of the dial
back_thickness = 2;
rim_fudge = 0.2;
// The default height gives room for the servo to either be inserted
// onto the top of the mount, or pushed through from underneath.
// If you'd like only one of these, you can reduce the height.
// Value of -5 means a servo pushed down from above just rests flush on the base.
servo_height_adjust = -4;
difference() {
union() {
translate([23/2-5.9,0,0]) {
// Use this to create a tube
// Make sure it is tall enough to accommodate the servo and needle
difference() {
cylinder(h=32, d=gauge_od);
translate([0,0,back_thickness])
cylinder(h=32, d=gauge_od - (gauge_wall_thickness*2));
}
}
// Main mount box
translate([0,0,(20+servo_height_adjust)/2])
cube([36,18,20+servo_height_adjust], center=true);
}
// Screw holes
translate([23/2-5.9,0,0]) {
for(x=[15,-15], y=[14,-14]) {
translate([x, y, 1]) {
cylinder(r2=4,r1=2,h=2);
cylinder(r=2,h=4,center=true);
}
}
}
// Cutout in base
translate([0,0,(20+servo_height_adjust)/2-4])
cube([33,12.6,20+servo_height_adjust],center=true);
// Cutout cable channel
translate([12,0,16+servo_height_adjust])
cube([1.5,5,40],center=true);
// Cutout Servo model
translate([0,0,16+servo_height_adjust]) {
9g_motor();
}
// Cutout Servo screw holes
for(hole = [-14,14] ){
translate([hole,0,16+servo_height_adjust])
cylinder(r=1, h=12, $fn=32, center=true);
}
}
}
module 9g_motor(){
difference(){
union(){
color("blue") cube([23,12.5,22], center=true);
color("blue") translate([0,0,5]) cube([32,12,2], center=true);
color("blue") translate([5.5,0,2.75]) cylinder(r=6, h=25.75, $fn=100, center=true);
color("blue") translate([-.5,0,2.75]) cylinder(r=1, h=25.75, $fn=20, center=true);
color("blue") translate([-1,0,2.75]) cube([5,5.6,24.5], center=true);
color("white") translate([5.5,0,3.65]) cylinder(r=2.35, h=29.25, $fn=20, center=true);
}
for ( hole = [14,-14] ){
translate([hole,0,5]) cylinder(r=2.2, h=4, $fn=20, center=true);
}
}
}