|
|
@ -7,135 +7,48 @@ use <lib/LCD_1602_I2C.scad>; |
|
|
|
use <lib/PCB.scad>; |
|
|
|
use <lib/Arduino_nano.scad>; |
|
|
|
|
|
|
|
show_switch=1; |
|
|
|
show_lcd=1; |
|
|
|
show_sticks=1; |
|
|
|
show_stm32=1; |
|
|
|
show_antenna=1; |
|
|
|
show_cc2500=1; |
|
|
|
show_switch =1; |
|
|
|
show_lcd =1; |
|
|
|
show_sticks =1; |
|
|
|
show_stm32 =1; |
|
|
|
show_antenna =1; |
|
|
|
show_cc2500 =1; |
|
|
|
show_battery_charger=1; |
|
|
|
show_joysticks =1; |
|
|
|
show_joysticks_pcb =1; |
|
|
|
|
|
|
|
show_top =1; |
|
|
|
show_bottom =1; |
|
|
|
|
|
|
|
|
|
|
|
name="phschoen"; |
|
|
|
|
|
|
|
text_pos=[[-10,-18,0], [10,-18,0], [-55,49,0], [-25,49,0], [0,40,0], [25,49,0], [55,49,0] ]; |
|
|
|
top_text=["on", "armed", "some", "thing", "needs", "to be", "configur"]; |
|
|
|
bot_text=["off", "disarmed", "", "", "", "", "" ]; |
|
|
|
text_pos=[[-8.5,-15,0], [8.5,-15,0], [-54,45,0], [-20,45,0], [0,40,0], [20,45,0], [54,45,0] ]; |
|
|
|
top_text=["on", "armed", "mode", "beeper", "failsave", "led", "turtle"]; |
|
|
|
bot_text=["off", "disarmed", "", "", "", "", "" ]; |
|
|
|
|
|
|
|
pos_cc2500=[0,10,-3]; |
|
|
|
pos_stm32=[48,-15,-1]; |
|
|
|
pos_antenna=[0,70,-15]; |
|
|
|
pos_lcd=[0,-44,-10]; |
|
|
|
pos_stm32=[40.5,-10,-3]; |
|
|
|
pos_antenna=[0,75.20,-15]; |
|
|
|
pos_lcd=[0,-40,-10]; |
|
|
|
pos_batery_charger=[-48,-15,-5]; |
|
|
|
|
|
|
|
eps=0.1; |
|
|
|
$fn=32; |
|
|
|
|
|
|
|
module lcd_1602() { |
|
|
|
pcb=[80,36,1.6]; |
|
|
|
metal_case=[71.2, 24.2, 6.5]; |
|
|
|
case_lcd_cut=[64.5, 14.5, 6.5+2*eps]; |
|
|
|
|
|
|
|
// metal case |
|
|
|
difference() { |
|
|
|
translate([0,0,pcb[2]]) |
|
|
|
aligned_cube(metal_case,[1,1,0]); |
|
|
|
|
|
|
|
translate([0,0,pcb[2]]) |
|
|
|
aligned_cube(case-2,[1,1,0]); |
|
|
|
|
|
|
|
// glas cut |
|
|
|
translate([0,0,pcb[2]-eps]) |
|
|
|
aligned_cube(case_lcd_cut,[1,1,0]); |
|
|
|
} |
|
|
|
|
|
|
|
// glas cut |
|
|
|
color("blue") |
|
|
|
translate([0,0,0]) |
|
|
|
aligned_cube(case_lcd_cut,[1,1,0]); |
|
|
|
|
|
|
|
// pcb |
|
|
|
color("green") |
|
|
|
aligned_cube(pcb,[1,1,0]); |
|
|
|
} |
|
|
|
|
|
|
|
module remote() { |
|
|
|
|
|
|
|
// animate sticks |
|
|
|
if($t < 0.25) |
|
|
|
sticks($t*4,0); |
|
|
|
else if($t < 0.5) |
|
|
|
sticks(1,($t-0.25)*4); |
|
|
|
else if($t < 0.75) |
|
|
|
sticks(1-($t-0.5)*4,1); |
|
|
|
else |
|
|
|
sticks(0,1-($t-0.75)*4); |
|
|
|
|
|
|
|
module ps2_pad() { |
|
|
|
// pcb |
|
|
|
difference() |
|
|
|
{ |
|
|
|
pcb=[26, 34, 1.6]; |
|
|
|
color([0.2, 0.2, 0.2]) { |
|
|
|
aligned_cube(pcb,[0,0,0]); |
|
|
|
} |
|
|
|
|
|
|
|
// mounting holes |
|
|
|
r=3.4/2; |
|
|
|
color([0.8, 0.8, 0.8]) |
|
|
|
for (i = [ |
|
|
|
[ 1.4+r, 3.3+r, -0.1], // bot left |
|
|
|
[pcb[0]-(1.4+r), 3.3+r, -0.1], // bot right |
|
|
|
[pcb[0]-(1.4+r), pcb[1]-(1.6+r), -0.1], // top right |
|
|
|
[ (1.4+r), pcb[1]-(1.6+r), -0.1], // top left |
|
|
|
]) { |
|
|
|
translate(i) |
|
|
|
cylinder($fn=16, r=r, h=0.2 + pcb[2]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// pins |
|
|
|
|
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//ps2_pad(); |
|
|
|
//pin_angled(); |
|
|
|
|
|
|
|
module pin_angled(pins=4, angled=true) { |
|
|
|
w=0.65; |
|
|
|
pin_angled=[w, 7-w, w]; |
|
|
|
pin_vertical=[w, w, 7.2-w]; |
|
|
|
|
|
|
|
plastic=[2.16,12.6]; |
|
|
|
|
|
|
|
color([0.8,0.8,0.8]) { |
|
|
|
// vertical pin part |
|
|
|
translate([0,0,0]) |
|
|
|
aligned_cube(pin_vertical, [1,0,0]); |
|
|
|
|
|
|
|
// angled pin part |
|
|
|
translate([0,w,7.2]) |
|
|
|
aligned_cube(pin_angled, [1,0,2]); |
|
|
|
|
|
|
|
difference() { |
|
|
|
d=1.5; |
|
|
|
|
|
|
|
translate([0,d/2,7.2-d/2]) |
|
|
|
rotate([0,90,0]) |
|
|
|
translate([0,0,-w/2]) |
|
|
|
cylinder($fn=32,d=d, h=w); |
|
|
|
|
|
|
|
translate([0,w+d/2,7.2-d/2-w]) |
|
|
|
rotate([0,90,0]) |
|
|
|
translate([0,0,-w/2-eps]) |
|
|
|
cylinder($fn=32,d=d, h=w+2*eps); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module remote() { |
|
|
|
if (show_sticks) { |
|
|
|
if($t < 0.25) |
|
|
|
sticks($t*4,0); |
|
|
|
else if($t < 0.5) |
|
|
|
sticks(1,($t-0.25)*4); |
|
|
|
else if($t < 0.75) |
|
|
|
sticks(1-($t-0.5)*4,1); |
|
|
|
else |
|
|
|
sticks(0,1-($t-0.75)*4); |
|
|
|
} |
|
|
|
if(show_stm32) { |
|
|
|
translate(pos_stm32) { |
|
|
|
rotate([0,180,180]) |
|
|
@ -144,9 +57,9 @@ module remote() { |
|
|
|
} |
|
|
|
|
|
|
|
if(show_antenna) { |
|
|
|
translate(pos_antenna) { |
|
|
|
rotate([90,0,0]) |
|
|
|
color("darkgray") |
|
|
|
translate(pos_antenna) |
|
|
|
rotate([90,0,0]) { |
|
|
|
sma_connector_male(3.5); |
|
|
|
antenna(); |
|
|
|
} |
|
|
|
} |
|
|
@ -176,20 +89,29 @@ module remote() { |
|
|
|
battery_charger(); |
|
|
|
} |
|
|
|
|
|
|
|
top_case(); |
|
|
|
//bottom_case(); |
|
|
|
if(show_top) |
|
|
|
top_case(); |
|
|
|
if(show_bottom) |
|
|
|
bottom_case(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
module sticks(l1,l2) |
|
|
|
{ |
|
|
|
max_angle=30; |
|
|
|
color("orange") |
|
|
|
for(i=[1,-1]) { |
|
|
|
translate([40*i,20,-10]) { |
|
|
|
rotate([max_angle*(l1*2-1),max_angle*(l2*2-1),0]) |
|
|
|
translate([0,0,8]) { |
|
|
|
stick(h=20); |
|
|
|
if (show_sticks) { |
|
|
|
color("orange") |
|
|
|
rotate([max_angle*(l1*2-1),max_angle*(l2*2-1),0]) |
|
|
|
translate([0,0,7]) { |
|
|
|
stick(h=20); |
|
|
|
} |
|
|
|
} |
|
|
|
if (show_joysticks_pcb) { |
|
|
|
translate([0,0,-8]) { |
|
|
|
ps2_joystick(l1,l2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -201,24 +123,15 @@ module top_case() { |
|
|
|
color([0.5,0.8,0,0.8]) |
|
|
|
union() { |
|
|
|
hull() { |
|
|
|
remote_top_plate_1=[150,110,1]; |
|
|
|
remote_top_plate_2=[140,120,thick]; |
|
|
|
remote_top_plate_3=[100,135,thick]; |
|
|
|
remote_top_plate_1=[140,110,1]; |
|
|
|
remote_top_plate_2=[130,110,thick]; |
|
|
|
remote_top_plate_3=[100,125,thick]; |
|
|
|
|
|
|
|
aligned_rounded_cube(remote_top_plate_1,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_2,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_3,2,[1,1,0],[1,1,0]); |
|
|
|
|
|
|
|
} |
|
|
|
{ |
|
|
|
for(i=[0:1:len(text_pos)-1]) { |
|
|
|
translate(text_pos[i]) |
|
|
|
button_with_text(thick=thick+2*eps, |
|
|
|
text_size=4, |
|
|
|
top_text=top_text[i], |
|
|
|
bottom_text=bot_text[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
// lcd screw holder |
|
|
|
translate([pos_lcd[0],pos_lcd[1]-1.2,0]) |
|
|
|
translate([-40.6,-20.25,0]) |
|
|
@ -259,7 +172,7 @@ module top_case() { |
|
|
|
translate([x*(pcb_size[0]/2-10), |
|
|
|
y*(pcb_size[1]/2), |
|
|
|
0.2]){ |
|
|
|
aligned_cube([5,6.25,pcb_size[2]-0.5],[1,1,0]); |
|
|
|
aligned_cube([5,6.25,pcb_size[2]-pos_stm32[2]],[1,1,0]); |
|
|
|
} |
|
|
|
translate([x*(pcb_size[0]/2-10), |
|
|
|
y*(pcb_size[1]/2+1.625), |
|
|
@ -308,7 +221,7 @@ module top_case() { |
|
|
|
|
|
|
|
} |
|
|
|
//lcdcutout |
|
|
|
translate([0,-45,-eps]) { |
|
|
|
translate([pos_lcd[0],pos_lcd[1],-eps]) { |
|
|
|
color("green") { |
|
|
|
aligned_rounded_cube(size=[64,14,5+2*eps], r=2, rounding=[1,1,0]); |
|
|
|
hull() { |
|
|
@ -323,7 +236,7 @@ module top_case() { |
|
|
|
// stick cutouts |
|
|
|
color("orange") |
|
|
|
for(i=[1,-1]) { |
|
|
|
w=36; |
|
|
|
w=32; |
|
|
|
r=14; |
|
|
|
translate([40*i,20,-eps]) { |
|
|
|
//aligned_rounded_cube(size=[w,w,thick+2*eps], r=2, rounding=[1,1,0]); |
|
|
@ -346,17 +259,17 @@ module top_case() { |
|
|
|
} |
|
|
|
// buttons cutouts and naming |
|
|
|
translate([0,0,-eps]) { |
|
|
|
translate([0,61,0]) |
|
|
|
translate([0,26,0]) |
|
|
|
text_engave(thick, text_size=5, text_=name); |
|
|
|
|
|
|
|
translate([0,-61,0]) |
|
|
|
translate([0,pos_lcd[1]-15,0]) |
|
|
|
text_engave(thick, text_size=5, text_="toolbox v1"); |
|
|
|
|
|
|
|
// buttons |
|
|
|
for(i=[0:1:len(text_pos)-1]) { |
|
|
|
translate(text_pos[i]) |
|
|
|
button_with_text(thick=thick+2*eps, |
|
|
|
text_size=4, |
|
|
|
text_size=4.2, |
|
|
|
top_text=top_text[i], |
|
|
|
bottom_text=bot_text[i]); |
|
|
|
} |
|
|
@ -368,10 +281,9 @@ module top_case() { |
|
|
|
module button_with_text(thick=4,text_size=5, top_text="on",bottom_text="off") |
|
|
|
{ |
|
|
|
dist_text=10.5; |
|
|
|
cylinder(d=5.8, h=thick+2*eps); |
|
|
|
cylinder(d=5.8, h=5*thick+2*eps, center=true); |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
color("gray") |
|
|
|
translate([0,0,thick-1]) |
|
|
|
union() { |
|
|
@ -406,29 +318,88 @@ module text_engave(thick, text_size, text_) |
|
|
|
|
|
|
|
module bottom_case() { |
|
|
|
|
|
|
|
h=25; |
|
|
|
h=20; |
|
|
|
wall=3*2; |
|
|
|
remote_top_plate_1=[150,110,h]; |
|
|
|
remote_top_plate_2=[140,120,h]; |
|
|
|
remote_top_plate_3=[100,135,h]; |
|
|
|
remote_top_plate_1=[140,110,h]; |
|
|
|
remote_top_plate_2=[130,110,h]; |
|
|
|
remote_top_plate_3=[100,125,h]; |
|
|
|
|
|
|
|
translate([0,0,-h]) |
|
|
|
color([1,1,1,0.1]) |
|
|
|
difference() { |
|
|
|
//body itself |
|
|
|
hull() { |
|
|
|
aligned_rounded_cube(remote_top_plate_1,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_2,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_3,2,[1,1,0],[1,1,0]); |
|
|
|
color([1,1,1,0.8]) |
|
|
|
union() { |
|
|
|
//body itself |
|
|
|
hull() { |
|
|
|
aligned_rounded_cube(remote_top_plate_1,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_2,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_3,2,[1,1,0],[1,1,0]); |
|
|
|
|
|
|
|
translate([0,0,-5]) { |
|
|
|
aligned_rounded_cube(remote_top_plate_3,2,[1,1,0],[1,1,0]); |
|
|
|
} |
|
|
|
} |
|
|
|
for(i=[1,-1]) { |
|
|
|
hull() { |
|
|
|
union() { |
|
|
|
translate([i*(remote_top_plate_1[1]/2)-i*0,0,-14]) { |
|
|
|
aligned_rounded_cube([remote_top_plate_3[2],100,20],6 ); |
|
|
|
} |
|
|
|
} |
|
|
|
translate([i*remote_top_plate_1[1]/2-i*5,0,0]) { |
|
|
|
aligned_rounded_cube([remote_top_plate_3[2]+20,110,0.1],6,[1,1,0]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
s=[wall,wall,0]; |
|
|
|
// inner cutout |
|
|
|
color([0.8,0.8,0.8,0.8]) |
|
|
|
translate([0,0,3]) |
|
|
|
hull() { |
|
|
|
aligned_rounded_cube(remote_top_plate_1-[wall,wall,0],2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_2-[wall,wall,0],2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_3-[wall,wall,0],2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_1 - s,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_2 - s,2,[1,1,0],[1,1,0]); |
|
|
|
aligned_rounded_cube(remote_top_plate_3 - s,2,[1,1,0],[1,1,0]); |
|
|
|
translate([0,0,-5]) { |
|
|
|
aligned_rounded_cube(remote_top_plate_3 - s,2,[1,1,0],[1,1,0]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// left and right holder |
|
|
|
color([0.7,0.7,0.7,0.8]) |
|
|
|
translate([0,0,wall/2]) |
|
|
|
for(i=[1,-1]) { |
|
|
|
hull() { |
|
|
|
union() { |
|
|
|
translate([i*remote_top_plate_1[1]/2-i*0,0,-14]) { |
|
|
|
aligned_rounded_cube([remote_top_plate_3[2],100,20],6 ); |
|
|
|
} |
|
|
|
} |
|
|
|
translate([i*remote_top_plate_1[1]/2-i*5,0,0]) { |
|
|
|
aligned_rounded_cube([remote_top_plate_3[2]+20,110,0.1],6,[1,1,0]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
translate([0,0,h]) // undo moveing |
|
|
|
{ |
|
|
|
// sma connector cutout |
|
|
|
color("gold") { |
|
|
|
translate(pos_antenna) |
|
|
|
rotate([90,0,0]) { |
|
|
|
translate([0,0,10]) // inner sma offset |
|
|
|
cylinder(d=6.5,h=10, center=true); |
|
|
|
} |
|
|
|
} |
|
|
|
// usb connector cutout |
|
|
|
pcb_size=[52.3, 22.6, 1.6]; |
|
|
|
color("red") |
|
|
|
{ |
|
|
|
translate(pos_stm32) |
|
|
|
translate([pcb_size[0]/2, 0,-2-5]) // undo moveing |
|
|
|
aligned_rounded_cube([10,12,8], 3, [0,1,1]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -681,5 +652,95 @@ module battery_charger() { |
|
|
|
rotate([0,0,-90]) |
|
|
|
usb_micro(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
module ps2_joystick(l1,l2) |
|
|
|
{ |
|
|
|
pcb_size=[26.15, 34.15, 1.6]; |
|
|
|
eps=0.1; |
|
|
|
max_angle=30; |
|
|
|
|
|
|
|
// joystick module |
|
|
|
/* color("silver") */ |
|
|
|
/* translate([0,8.75]) */ |
|
|
|
// jostick module iself |
|
|
|
color("silver") |
|
|
|
translate(pcb_size/2) |
|
|
|
translate([-4.1,-9,0]) { |
|
|
|
aligned_cube([16,16, 12.5], [2,2,0]); |
|
|
|
translate([-8,-8,3.5]) |
|
|
|
rotate([max_angle*(l1*2-1),max_angle*(l2*2-1),0]) |
|
|
|
translate([0,0,9]) |
|
|
|
cylinder(d=4, h=7); |
|
|
|
} |
|
|
|
// potties |
|
|
|
color("darkgray") |
|
|
|
translate(pcb_size/2) |
|
|
|
translate([-0.5,-12.4,0]) { |
|
|
|
aligned_cube([3.8, 9.52, 12], [2,2,0]); |
|
|
|
} |
|
|
|
color("darkgray") |
|
|
|
translate(pcb_size/2) |
|
|
|
translate([-7.35,-25,0]) { |
|
|
|
aligned_cube([9.52, 3.8,12], [2,2,0]); |
|
|
|
} |
|
|
|
|
|
|
|
/* color("silver") { */ |
|
|
|
/* rotate([90,0]) */ |
|
|
|
/* import("ps2_analog.stl"); */ |
|
|
|
/* } */ |
|
|
|
|
|
|
|
difference() |
|
|
|
{ |
|
|
|
pin_x=[2,1,0,-1,-2]; |
|
|
|
pin_names=["GND", "+5V", "VRX", "VRY", "SW"]; |
|
|
|
union() |
|
|
|
{ |
|
|
|
// pcb |
|
|
|
color("lightblue") |
|
|
|
aligned_rounded_cube(pcb_size, r=1, rounding=[1,1,0]); |
|
|
|
|
|
|
|
//pinpads |
|
|
|
for(i=[0:len(pin_x)-1]) { |
|
|
|
translate([pin_x[i]*(2), pcb_size[1]/2-4.5,-eps]) { |
|
|
|
color("silver") |
|
|
|
cylinder(d=1.5,h=pcb_size[2]+2*eps); |
|
|
|
|
|
|
|
color("black") |
|
|
|
translate([0,-1,pcb_size[2]]) |
|
|
|
linear_extrude(height = 2*eps) |
|
|
|
rotate([0,0,-90]) |
|
|
|
text( |
|
|
|
halign="left", |
|
|
|
valign="center", |
|
|
|
$fn=$fn, |
|
|
|
size=1, |
|
|
|
font="Linux Libertine O", |
|
|
|
pin_names[i] |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// pins |
|
|
|
for(i=[0:len(pin_x)-1]) { |
|
|
|
translate([pin_x[i]*(2), pcb_size[1]/2-4.5,-2*eps]) { |
|
|
|
cylinder(d=1,h=pcb_size[2]+4*eps); |
|
|
|
} |
|
|
|
} |
|
|
|
// screwholes near pin |
|
|
|
for(x=[1,-1]) { |
|
|
|
translate([x*(pcb_size[0]/2-2.7), pcb_size[1]/2-4.5,-eps]) |
|
|
|
cylinder(d=2.9,h=pcb_size[2]+2*eps); |
|
|
|
} |
|
|
|
// screwholes other side |
|
|
|
for(x=[1,-1]) { |
|
|
|
translate([x*(pcb_size[0]/2-2.7), 2.9-pcb_size[1]/2,-eps]) |
|
|
|
cylinder(d=2.9,h=pcb_size[2]+2*eps); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
remote(); |