-
Notifications
You must be signed in to change notification settings - Fork 5
/
QFH-Antenna-868MHz.scad
215 lines (165 loc) · 5.74 KB
/
QFH-Antenna-868MHz.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// OpenSCAD script for a 868 MHz ISM band "quadrifilar helix antenna".
// The design originated in: http://www.thingiverse.com/thing:634205
// -------------------------------------------------------------
// Dimensions calculated with John Coppens webpage java script
// @ http://jcoppens.com/ant/qfh/calc.en.php
// Input params:
// Center frequency = 913 MHz
// Numbers of turns = 0.5
// Length of one turn = 1
// Bending radius = 1.5 mm
// Conductor diameter = 0.8 mm
// Width/height ratio = 0.44
//
// -------------------------------------------------------------
$fn=80;
PI = 3.14159265358979;
D1 = 46.6; // mm large helix1 diameter.
D2 = 44.3; // mm small helix2 diameter.
HH1 = 107.8; // mm height of helix1.
HH2 = 102.5; // mm height of helix2.
WIRE = 1; // mm diameter.
CYLH = 120; // mm height of support cylinder.
CYLH2 = CYLH/2; // the half-height of the support cylinder.
SLICES = 60;
HWIRE11 = CYLH2-HH1/2; // place the four hole-pairs at these heights.
HWIRE12 = CYLH2-HH2/2;
HWIRE21 = CYLH2+HH1/2;
HWIRE22 = CYLH2+HH2/2;
EXTRUSION_WIDTH=0.6;
pedestal_height = 1; // designed for use the MLAB standard 12mm screws.
mount_hole = 3.5;
clear = 0.175;
MLAB_grid_xoffset = 4.2;
MLAB_grid_yoffset = 4.2;
MLAB_grid = 10.16;
// some internal calculations. quite hairy math.
THETA1 = atan2(HH1,D1*PI); // Thetas are used for projecting the wirechannel cross-section onto the xy-plane.
THETA2 = atan2(HH2,D2*PI);
echo("theta1=",THETA1," - theta2=",THETA2);
XSI1 = ((CYLH/HH1*180)-180); // extra rotation beyond the height of helix1. half above, half below.
XSI2 = ((CYLH/HH2*180)-180); // extra rotation beyond the height of helix2.
echo("xsi1=",XSI1," - xsi2=",XSI2);
//------------ Safety grid parameters---------------------------
nY = 5;
nX = 5;
meshX=100;
meshY=100;
// width of solid part of grid
meshSolid=1.2;
meshSpaceX = (meshX - meshSolid*nX)/nX;
meshSpaceY = (meshY - meshSolid*nY)/nY;
module base(){
union()
{
for (i=[1:nX-1]) {
translate([i*(meshSolid+meshSpaceX) - meshSolid/2,0,0]) cube(size=[meshSolid, meshY, pedestal_height],center=false);
}
for (i=[1:nY-1]) {
translate([0,i*(meshSolid+meshSpaceY) - meshSolid/2,0]) cube(size=[meshX, meshSolid, pedestal_height],center=false);
}
}
}
// test helix1.
module helix1(rot1=0)
{
linear_extrude(height=50, twist=-XSI1-180, slices=SLICES)
rotate([0,0,rot1-XSI1/2]) translate([D1,0,0]) projection() scale([1,1/sin(THETA1),1]) wirechannel();
}
// test helix2.
module helix2(rot2=90)
{
color("red") linear_extrude(height=50, twist=-XSI2-180, slices=SLICES)
rotate([0,0,rot2-XSI2/2]) translate([D2,0,0]) projection() scale([1,1/sin(THETA2),1]) wirechannel();
}
// definition of the wire channel by CSG.
// used for projecting outline onto the xy-plane.
module wirechannel()
{
difference()
{
cylinder(h=2, r=WIRE*0.8, center=true);
translate([0,0,-0.1])
cylinder(h=3, r=WIRE/2, center=true);
translate([1.5*WIRE,0,0])
cube([3*WIRE,WIRE,4], center=true);
}
}
// definition of elliptic cylinder by CSG.
// used for projecting outline onto xy-plane.
module ellipse_base()
{
scale([1,D2/D1,1])
difference(){
cylinder(h=1, r=(D1/2-WIRE/2), center = true);
cylinder(h=2, r=(D1/2 - WIRE/2 - EXTRUSION_WIDTH), center = true);
}
}
// just a elliptic torus.
// (penalty for using $fn quality.)
module torus(Rmajor=10, Rminor=1, h1=25)
{
translate([0,0,h1]) scale([1,D2/D1,1]) rotate_extrude(convexity = 10) translate([Rmajor, 0, 0]) circle(r = Rminor);
}
// the composite structure of support cylinder, wire channels, holes and cut-outs.
module composite()
{
difference()
{
union()
{
// combine all elements in one extrude and twist.
// helix1's.
linear_extrude(height=HWIRE21, twist=-XSI1/2-180, slices=SLICES)
{
rotate([0,0,0-XSI1/2]) translate([D1/2,0,0]) projection() scale([1,1/sin(THETA1),1]) wirechannel();
rotate([0,0,180-XSI1/2]) translate([D1/2,0,0]) projection() scale([1,1/sin(THETA1),1]) wirechannel();
}
// helix2's.
linear_extrude(height=HWIRE22, twist=-XSI2/2-180, slices=SLICES)
{
rotate([0,0,90-XSI2/2]) translate([D2/2,0,0]) projection() scale([1,1/sin(THETA2),1]) wirechannel();
rotate([0,0,270-XSI2/2]) translate([D2/2,0,0]) projection() scale([1,1/sin(THETA2),1]) wirechannel();
}
// elliptic support cylinder.
linear_extrude(height=CYLH, twist=-XSI1/2-180, slices=SLICES)
{
rotate([0,0,0-XSI1/2]) projection(cut=true) ellipse_base();
}
// half-height marker on cylinder
//rotate([0,0,90]) torus(Rmajor=(D1/2-WIRE/2), Rminor=0.2, h1=CYLH2);
}
union()
{
// lower hole pairs.
translate([0,0,HWIRE11]) rotate([0,90,0]) cylinder(h=3*HH1, r=WIRE/2, center=true);
translate([0,0,HWIRE12]) rotate([90,0,0]) cylinder(h=3*HH1, r=WIRE/2, center=true);
// upper hole slots.
translate([0,0,HWIRE21]) rotate([0,90,0]) cylinder(h=3*HH1, r=WIRE/2, center=true);
translate([0,0,HWIRE22]) rotate([90,0,0]) cylinder(h=3*HH1, r=WIRE/2, center=true);
translate([0,0,HWIRE21+CYLH2]) cube([CYLH,WIRE,CYLH], center=true);
translate([0,0,HWIRE22+CYLH2]) cube([WIRE,CYLH,CYLH], center=true);
}
}
translate([-50,-50,0])
base();
}
module drillholes()
{
// lower hole pairs.
translate([0,0,HWIRE11]) rotate([0,90,0]) cylinder(h=3*HH1, r=WIRE/3, center=true);
translate([0,0,HWIRE12]) rotate([90,0,0]) cylinder(h=3*HH1, r=WIRE/3, center=true);
// upper hole pairs.
translate([0,0,HWIRE21]) rotate([0,90,0]) cylinder(h=3*HH1, r=WIRE/3, center=true);
translate([0,0,HWIRE22]) rotate([90,0,0]) cylinder(h=3*HH1, r=WIRE/3, center=true);
}
//wirechannel();
//helix1(rot1=0);
//helix1(rot1=180);
//helix2(rot2=90);
//helix2(rot2=270);
//drillholes();
//ellipse_base();
//base();
// MAIN()
composite();