Skip to content

Commit 2c2f8a2

Browse files
committed
initial commit
0 parents  commit 2c2f8a2

29 files changed

+2245
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.stl

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This repository contains models for various 3d printed parts used in the pypilot project.

anemometer/cup.scad

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
$fn=60;
2+
3+
cup_d = 45;
4+
cup_r = 50;
5+
6+
bearing_d = 22.3;
7+
bearing_h = 7;
8+
9+
angle=86;
10+
11+
pipe_d=10;
12+
13+
magnet_d=4;
14+
15+
key_r=.9;
16+
17+
difference() {
18+
union() {
19+
translate([0, 0, -bearing_h])
20+
21+
minkowski() {
22+
cylinder(r=bearing_d/2+1, h=bearing_h*2+key_r*2);
23+
sphere(1.4);
24+
}
25+
translate([0, 0, bearing_h-key_r])
26+
minkowski() {
27+
cylinder(r=bearing_d/2+1.5, h=key_r*2);
28+
sphere(1.4);
29+
}
30+
for(i=[0:2])
31+
rotate(i*120) {
32+
difference() {
33+
rotate([angle, 0, 0]) {
34+
cylinder(r=cup_d/8, h=cup_r);
35+
scale([.7, 1, 1]) {
36+
translate([0, 0, cup_r*3/4])
37+
cylinder(r1=cup_d/8, r2=cup_d/3, h=cup_r/3);
38+
translate([0, 0, cup_r*1/5])
39+
cylinder(r2=cup_d/8, r1=cup_d/6, h=cup_r/3);
40+
}
41+
translate([cup_r/8, 0, cup_r+cup_d/3])
42+
sphere(cup_d/2);
43+
}
44+
translate([0, -cup_r-cup_d, -cup_d/2])
45+
cube([cup_d, cup_d*3, cup_d*2]);
46+
rotate([angle, 0, 0])
47+
translate([cup_r/8, 0, cup_r+cup_d/3])
48+
sphere(.94*cup_d/2);
49+
}
50+
}
51+
}
52+
53+
translate([0, 0, -1])
54+
cylinder(r=bearing_d/2, h=bearing_h*2);
55+
translate([0, 0, -2])
56+
cylinder(r=bearing_d/2-2, h=bearing_h*2);
57+
58+
cylinder(r=pipe_d/2, h=bearing_h*3, center=true);
59+
translate([0, 0, -bearing_d/4])
60+
rotate(60)
61+
rotate([90, 0, 0])
62+
cylinder(r=magnet_d/2, h=bearing_d/2);
63+
64+
for(i=[0:2])
65+
translate([0, 0, bearing_h])
66+
rotate(60+120*i)
67+
rotate([90, 0, 0])
68+
cylinder(r=key_r, h=bearing_d*2);
69+
70+
}

anemometer/naca4.scad

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Naca4.scad - library for parametric airfoils of 4 digit NACA series
2+
// Code: Rudolf Huttary, Berlin
3+
// June 2015
4+
// commercial use prohibited
5+
6+
7+
// general use: for more examples refer to sampler.scad
8+
// naca = naca digits or 3el vector (default = 12 or [0, 0, .12])
9+
// L = chord length [mm] (default= 100)
10+
// N = # sample points (default= 81)
11+
// h = height [mm] (default= 1)
12+
// open = close at the thin end? (default = true)
13+
// two equivalent example calls
14+
// airfoil(naca = 2408, L = 60, N=1001, h = 30, open = false);
15+
// airfoil(naca = [.2, .4, .32], L = 60, N=1001, h = 30, open = false);
16+
17+
module help_Naca4()
18+
{
19+
echo(str("\n\nList of signatures in lib:\n=================\n",
20+
"module help() - displays this help\n",
21+
"module help_Naca() - displays this help\n",
22+
"module help_Naca4() - displays this help\n",
23+
"module airfoil(naca=2412, L = 100, N = 81, h = 1, open = false) - renders airfoil object\n",
24+
"module airfoil(naca=[.2, .4, .12], L = 100, N = 81, h = 1, open = false) - renders airfoil object using percentage for camber, camber distance and thicknes\n",
25+
"function airfoil_data(naca=12, L = 100, N = 81, open = false)\n",
26+
"=================\n"));
27+
}
28+
29+
module help() help_Naca4();
30+
31+
// help();
32+
// this is the object
33+
module airfoil(naca=12, L = 100, N = 81, h = 1, open = false)
34+
{
35+
linear_extrude(height = h)
36+
polygon(points = airfoil_data(naca, L, N, open));
37+
}
38+
39+
// this is the main function providing the airfoil data
40+
function airfoil_data(naca=12, L = 100, N = 81, open = false) =
41+
let(Na = len(naca)!=3?NACA(naca):naca)
42+
let(A = [.2969, -0.126, -.3516, .2843, open?-0.1015:-0.1036])
43+
[for (b=[-180:360/(N):179.99])
44+
let (x = (1-cos(b))/2)
45+
let(yt = sign(b)*Na[2]/.2*(A*[sqrt(x), x, x*x, x*x*x, x*x*x*x]))
46+
Na[0]==0?L*[x, yt]:L*camber(x, yt, Na[0], Na[1], sign(b))];
47+
48+
// helper functions
49+
function NACA(naca) =
50+
let (M = floor(naca/1000))
51+
let (P = floor((naca-M*1000)/100))
52+
[M/100, P/10, floor(naca-M*1000-P*100)/100];
53+
54+
function camber(x, y, M, P, upper) =
55+
let(yc = (x<P)?M/P/P*(2*P*x-x*x): M/(1-P)/(1-P)*(1 - 2*P + 2*P*x -x*x))
56+
let(dy = (x<P)?2*M/P/P*(P-x):2*M/(1-P)/(1-P)*(P-x))
57+
let(th = atan(dy))
58+
[upper ? x - y*sin(th):x + y*sin(th), upper ? yc + y*cos(th):yc - y*cos(th)];
59+
60+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$fn=60;
2+
3+
module spacer()
4+
difference() {
5+
union() {
6+
cylinder(r=6/2, h=18, center=true);
7+
// cylinder(r=8/2, h=6, center=true);
8+
}
9+
cylinder(r=5/2, h=19, center=true);
10+
}
11+
12+
13+
spacer();
14+
//translate([20, 0, 0])
15+
// spacer();

anemometer/original/body.scad

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
$fn=40;
2+
3+
support_diameter = 15.6;
4+
radius = 13;
5+
6+
top_ball_bearing = 1;
7+
top_bearing_diameter = 17.8;
8+
top_bearing_height = 6.4;
9+
top_bearing_spacing = 6;
10+
top_bearing_inside = 14;
11+
12+
top_sleeve_size=6.5;
13+
top_sleeve_inside = 5.2;
14+
15+
magnet_height = 15;
16+
magnet_diameter = 14;
17+
18+
bottom_ball_bearing = 1;
19+
bottom_bearing_diameter = 17.8;
20+
bottom_bearing_height = 6.4;
21+
bottom_bearing_spacing = 6;
22+
bottom_bearing_inside = 14;
23+
bottom_nut_height = 1;
24+
25+
bottom_sleeve_size=6.5;
26+
bottom_sleeve_inside = 5.2;
27+
28+
bottom_bolt_height = 7;
29+
bottom_bolt_diameter = 14;
30+
31+
reed_sensor=0;
32+
reed_offset=9.4;
33+
reed_diameter=2.8;
34+
reed_length=17;
35+
36+
hall_sensor=1;
37+
hall_offset=8;
38+
39+
height = 80;
40+
41+
fit = 0.4;
42+
43+
module screw_hole(h, r) {
44+
union() {
45+
cylinder(h=h, r=r);
46+
translate([0, 0, 12])
47+
cylinder(h=7, r2=6, r1=r);
48+
}
49+
}
50+
51+
module body() {
52+
difference() {
53+
union() {
54+
cylinder(h=height*2/3, r=radius, center=true);
55+
rotate(90, [1, 0, 0])
56+
cylinder(h=support_diameter*2, r1=radius, r2=support_diameter/2+2);
57+
translate([0, 0, -height*7/18+1])
58+
cylinder(h=height/9+1, r=radius*.9, center=true);
59+
translate([0, 0, -height*8/18-1.5])
60+
cylinder(h=height/18+1, r=1*radius, center=true);
61+
62+
// top cone
63+
translate([0, 0, height/3])
64+
cylinder(h=height/5, r1=radius*1.1, r2=radius*.8 + .5);
65+
66+
// support for speed wiring
67+
translate([0, -reed_offset, bottom_bearing_start + height/4+1])
68+
cylinder(h=height/2, r=reed_diameter/2+1.2, center=true);
69+
}
70+
71+
// vane bearing holder
72+
if(top_ball_bearing) {
73+
translate([0, 0, height/2-top_bearing_height/2+.1-1])
74+
cylinder(h=top_bearing_height, r=top_bearing_diameter/2, center=true);
75+
translate([0, 0, height/2 - top_bearing_height*3/2 - top_bearing_spacing-1])
76+
cylinder(h=top_bearing_height, r=top_bearing_diameter/2, center=true);
77+
translate([0, 0, height/2 - top_bearing_height - top_bearing_spacing/2-1]) {
78+
cylinder(h=top_bearing_spacing+2, r= top_bearing_diameter/2 - fit*2, center=true);
79+
cylinder(h=top_bearing_spacing+top_bearing_height*2+3, r= top_bearing_inside/2, center=true);
80+
}
81+
translate([0, 0, height/2 - top_bearing_height - top_bearing_spacing/2-1]) {
82+
cylinder(h=top_bearing_spacing+2, r= top_bearing_diameter/2 - fit*2, center=true);
83+
cylinder(h=top_bearing_spacing+top_bearing_height*2+3, r=top_bearing_inside/2, center=true);
84+
}
85+
} else {
86+
translate([0, 0, height/2 - top_bearing_height - top_bearing_spacing/2+1])
87+
cylinder(h=top_bearing_spacing+top_bearing_height*2+3, r= top_sleeve_size/2, center=true);
88+
translate([0, 0, height/2 - top_bearing_height - top_bearing_spacing/2-1])
89+
cylinder(h=top_bearing_spacing+top_bearing_height*2+3, r=top_sleeve_inside/2, center=true);
90+
}
91+
92+
// magnet
93+
translate([0, 0, height/2 - top_bearing_height*2 - top_bearing_spacing - magnet_height/2 -2])
94+
cylinder(h=magnet_height, r=magnet_diameter/2, center=true);
95+
96+
// keyhole
97+
rotate(90, [0, 1, 0])
98+
translate([0, -3/2*radius, 0])
99+
cylinder(h=25, r=1.8, center=true);
100+
101+
// main cutaway
102+
cylinder(h=support_diameter, r=support_diameter/2+1, center=true);
103+
104+
bottom_bearing_start=-height/2;
105+
106+
// circuit board
107+
translate([0, 0, 6])
108+
cube([18.4, 12, 2], center=true);
109+
110+
// cups bearing holders
111+
translate([0, 0, bottom_bearing_start+bottom_bearing_height*2+bottom_bearing_spacing+bottom_bolt_height/2+bottom_nut_height-.5])
112+
cylinder(h=bottom_bolt_height+.1, r=bottom_bolt_diameter/2, center=true);
113+
114+
if(bottom_ball_bearing) {
115+
translate([0, 0, bottom_bearing_start+bottom_bearing_height*3/2+bottom_bearing_spacing+bottom_nut_height-1])
116+
cylinder(h=bottom_bearing_height, r=bottom_bearing_diameter/2, center=true);
117+
translate([0, 0, bottom_bearing_start+bottom_bearing_height+bottom_bearing_spacing/2+bottom_nut_height]) {
118+
cylinder(h=bottom_bearing_spacing+1, r=bottom_bearing_diameter/2 - 2*fit, center=true);
119+
cylinder(h=bottom_bearing_spacing+bottom_bearing_height*2+3, r=bottom_bearing_inside/2, center=true);
120+
}
121+
122+
translate([0, 0, bottom_bearing_start+(bottom_bearing_height+bottom_nut_height)/2+1])
123+
cylinder(h=bottom_bearing_height+bottom_nut_height+.1, r=bottom_bearing_diameter/2, center=true);
124+
} else {
125+
translate([0, 0, bottom_bearing_start+bottom_bearing_height+bottom_bearing_spacing/2+bottom_nut_height+2])
126+
cylinder(h=bottom_bearing_spacing+bottom_bearing_height*2+3, r=bottom_sleeve_size/2, center=true);
127+
translate([0, 0, bottom_bearing_start+bottom_bearing_height+bottom_bearing_spacing/2+bottom_nut_height])
128+
cylinder(h=bottom_bearing_spacing+bottom_bearing_height*2+3, r=bottom_sleeve_inside/2, center=true);
129+
}
130+
131+
// slot for reed sensor
132+
if(reed_sensor) {
133+
translate([0, -reed_offset, bottom_bearing_start + height/4+.2+5])
134+
cylinder(h=height/2, r=1.2, center=true);
135+
translate([0, -reed_offset, bottom_bearing_start+.8])
136+
scale([1,1,1.4])
137+
rotate([0,90,0])
138+
cylinder(h=reed_length, r=reed_diameter/2, center=true);
139+
}
140+
141+
if(hall_sensor) {
142+
translate([0, -reed_offset, bottom_bearing_start + height/4+.2+1])
143+
cylinder(h=height/2, r=1.9, center=true);
144+
translate([0, -hall_offset, bottom_bearing_start+.8-2])
145+
cube([4,4,4], center=true);
146+
}
147+
148+
// screw holes
149+
rotate([90, 0, 0]) {
150+
translate([0, bottom_bearing_start+height/3-17*(1-bottom_ball_bearing), -7]) {
151+
translate([support_diameter/2, 0, 0])
152+
screw_hole(h=20, r=1.2);
153+
translate([-support_diameter/2, 0, 0])
154+
screw_hole(h=20, r=1.2);
155+
}
156+
translate([0, bottom_bearing_start+height*2/3+15*(1-top_ball_bearing), -7]) {
157+
translate([support_diameter/2+1, 0, 0])
158+
screw_hole(h=20, r=1.2);
159+
translate([-support_diameter/2-1, 0, 0])
160+
screw_hole(h=20, r=1.2);
161+
}
162+
}
163+
// screw holes
164+
if(0)
165+
for(i=[0:2])
166+
rotate(i*120, [0, 0, 1]) {
167+
translate([0,-radius-1,bottom_bearing_start+bottom_bearing_height])
168+
rotate(90, [1, 0, 0])
169+
cylinder(h=10, r=1.6, center=true);
170+
}
171+
172+
// cut away support
173+
translate([0, 6, 0])
174+
rotate(90, [1, 0, 0])
175+
cylinder(h=radius*3 + 6, r=support_diameter/2);
176+
}
177+
}
178+
179+
180+
module pegs(r) {
181+
for(i=[-1:1]) {
182+
translate([radius*.85, 0, height/4*i])
183+
sphere(r, $fn=24);
184+
translate([-radius*.85, 0, height/4*i])
185+
sphere(r, $fn=24);
186+
}
187+
}
188+
189+
if(1) {
190+
// split in half
191+
union() {
192+
intersection() {
193+
body();
194+
translate([0, -height/2, 0])
195+
cube([height, height, height],center=true);
196+
}
197+
pegs(1.1);
198+
}
199+
translate([3*radius, 0, 0])
200+
intersection() {
201+
rotate(180, [0, 0, 1])
202+
difference() {
203+
body();
204+
pegs(1.2);
205+
}
206+
translate([0, -height/2, 0])
207+
cube([height, height, height],center=true);
208+
}
209+
} else {
210+
translate([30, 0, 0])
211+
intersection() {
212+
body();
213+
translate([0, 0, -height/2])
214+
cylinder(h=12, r1=12.7, r=7.2);
215+
}
216+
217+
difference() {
218+
body();
219+
translate([0, 0, -height/2])
220+
cylinder(h=13, r1=13, r2=7.5);
221+
}
222+
}

0 commit comments

Comments
 (0)