-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlp_4g_lte_ant.scad
267 lines (237 loc) · 7.21 KB
/
lp_4g_lte_ant.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/***
* Log periodic antenna for 3G/4G/LTE based on Andrew McNeil's measurements
* in his YouTube(r) video "Log Periodic Antenna 3G 4G LTE 850MHz to 2.7GHz"
* https://www.youtube.com/watch?v=IgloDJYZKLI
*
* - Visualize antenna and parts
* - Generate drill template for drilling the boom (export pdf ...)
*
* Current variable settings are based on materials that are
* easily and locally available to me:
* - Alfer(r) Aluminum extrusions
* - Metric fasteners
*
* All measurements are Millimeters, I hope it's easily adaptable to
* your choice of materials
*
* TODO/ ideas
* - nec2 model (maybe)
* - maybe add log periodic antenna calculation
* - stub calculation
*
***/
$fn=32; //facets used for a circle or cylinder
/*
visual_mode ( what to show when previewing or rendering)
0 - nothing
1 - render whole antenna
2 - render one side (with tab)
3 - boom template for center punch
(render (F6) before converting to PDF ... check for scaling settings )
8 - Shell (takes a while to render)
9 - nec2 output to console
*/
visual_mode=1;
// Boom dimensions
boom_x = 300;
boom_y = 11.5;
boom_z = 2;
// spacing between booms
boom_clearance = 5;
// where to start the first element.
element_offset_x = 10;
element_dia = 6;
element_hole_dia = 5 ;
coax_hole_dia = 2.5;
coax_hole_offset = 3; // coax hole is offset from the end corner
mounting_hole = 5;
mounting_hole_offset1=10;
mounting_hole_offset2=30;
// elements run along x, and alternate direction as indicated by sign of z
element_xz = [
[ 0,16 ],
[ 5+3,-19],
[ 15,25],
[ 25+3,-35],
[ 50,45],
[ 77+3,-55],
[ 112,65],
[ 154+3,-75],
[ 207, 90]
];
impedance_tab_hole_dia = 2.5;
impedance_tab_size = [13.5,25,1];
impedance_tab_offset = [ element_offset_x + element_xz[8][0] - (3.5 + 3 +impedance_tab_size[0]) ,boom_y/2 , -boom_z/2];
impedance_tab_hole_offset = 3;
module draw_impedance_tab( holes=0)
{
if (holes > 0)
{
// offset from end of tab and tab thickness x 2??
// check clearance for screw heads.
translate([impedance_tab_hole_offset,-(impedance_tab_hole_offset + impedance_tab_size[2]),-boom_z-1])
cylinder(d= holes==0 ? impedance_tab_hole_dia: holes , h = 10,center=true);
translate([impedance_tab_size[0]-impedance_tab_hole_offset,-(impedance_tab_hole_offset + impedance_tab_size[2]),-boom_z-1])
cylinder(d= holes==0 ? impedance_tab_hole_dia: holes , h = 10,center=true);
}
else
{
translate([impedance_tab_size[0],0,-impedance_tab_size[2] ])
rotate([0,0,180])
cube( size = impedance_tab_size+[0,-impedance_tab_size[1]+impedance_tab_hole_offset*2 ,0] );
translate([-0,-impedance_tab_size,-boom_z])
rotate([-90,0,0])
//main part of tab
cube(impedance_tab_size);
}
}
// hole diameter
module draw_elements( holes=0 , text = 0 , nec2=0 )
{
for ( i = element_xz)
{
rotate([ i[1]<0 && text==0 ? 180 : 0 ,0,0])
translate([i[0],0, holes==0 ? boom_z/2 : -boom_z/2-1 ])
if (text == 0)
{
cylinder(h=abs(i[1]),d= (holes==0 ? element_dia : holes ) );
}
else
{
rotate([0,0,-60])
text( str( i[1]," mm @ ",i[0] ," mm") , size=4, halign = "left", valign="center");
}
if (nec2 > 0)
echo("NEC2 cards TODO?");
}
}
// module draw antenna (or just bar with holes)
// center the bar on x and z axis
module draw_half_antenna(no_impedance_tab=0, impedance_tab=1, hole_dots=0 )
{
difference()
{
union()
{
translate([0,-boom_y/2,-boom_z/2])
cube(size = [boom_x,boom_y,boom_z], center = false);
// elements
//translate([element_offset_x,0,0])
//draw_elements();
if (no_impedance_tab==0)
{
// tab
translate([element_offset_x,0,0])
draw_elements();
if (impedance_tab == 1)
{
translate(impedance_tab_offset)
draw_impedance_tab();
}
}
}
translate([element_offset_x,0,0])
draw_elements(holes = hole_dots==0 ? element_hole_dia : hole_dots);
// tab holes2
if (impedance_tab == 1)
{
translate(impedance_tab_offset)
draw_impedance_tab(holes = hole_dots==0 ? impedance_tab_hole_dia : hole_dots );
}
// connection hole
translate([coax_hole_offset,coax_hole_offset-boom_y/2,0])
//rotate([90,0,0])
cylinder(h=boom_z+1, d= hole_dots==0 ? coax_hole_dia : hole_dots , center=true);
// mounting holes
translate([boom_x-mounting_hole_offset1,0,0])
cylinder(h=boom_z+1, d= hole_dots==0 ? mounting_hole: hole_dots, center=true);
translate([boom_x-mounting_hole_offset2,0,0])
cylinder(h=boom_z+1, d= hole_dots==0 ? mounting_hole: hole_dots, center=true);
}
}
//draw whole antenna
module draw_antenna()
{
draw_half_antenna(impedance_tab=1);
translate([0,-(boom_y + boom_clearance),0 ])
rotate([180,0,0])
draw_half_antenna(impedance_tab=0);
}
/*
Render 2D projection of the boom that can be exported to a 2D format like
pdf for use as a template.
The booms are rotated so that bit so they will fit on an A4
*/
module boom_template()
{
translate([-10,0,0])
rotate([0,0,60])
projection()
translate([-150,0,0])
draw_half_antenna(no_impedance_tab=1, hole_dots=0.25 );
translate([10,0,0])
rotate([0,0,60])
projection()
translate([-150,0,0])
draw_half_antenna(no_impedance_tab=1, hole_dots=0.25);
// text right
translate([20,0,0])
rotate([0,0,60])
translate([-150,0,0])
{
translate([element_offset_x,0,0])
draw_elements(text=1);
//
rotate([0,0,-60])
translate([coax_hole_offset,0,0])
//rotate([90,0,0])
text( "coax connection" , size=4, halign = "left", valign="center");
}
// text left
translate([-20,0,0])
rotate([0,0,60])
translate([-150,0,0])
{
// text left
// tab holes2
// mounting holes
translate([boom_x-mounting_hole_offset1,0,0])
rotate([0,0,-60])
text( "mounting hole 1" , size=4, halign = "right", valign="center");
translate([boom_x-mounting_hole_offset2,0,0])
//cylinder(h=boom_z+1, d= hole_dots==0 ? mounting_hole: hole_dots, center=true);
rotate([0,0,-60])
text( "mounting holes 2" , size=4, halign = "right", valign="center");
//
translate(impedance_tab_offset)
rotate([0,0,-60])
text( "impedance tab holes x 2" , size=4, halign = "right", valign="center");
}
}
/*
visual_mode rendering
*/
if (visual_mode == 1 )
translate([-150,0,0])
draw_antenna();
if (visual_mode == 2 )
translate([-150,0,0])
draw_half_antenna(impedance_tab=1);
if (visual_mode == 3 ) boom_template();
// shell of antenna
if (visual_mode == 8 )
{
rotate([90,0,0])
scale([1.2,1.2,1.2])
//projection()
hull()
minkowski()
{
{
rotate([90,0,0])
draw_antenna();
}
cylinder(r=5,h=5,center=true);
}
//draw_antenna();
}