data sheet for AD7997, ADC to be emulated by LPC11U14 SOC on QuantiMotor
[hw/altusmetrum] / mechanical / teledongle-box.py
1 #! /usr/bin/python
2 # Copyright 2017 by Bdale Garbee <bdale@gag.com>.  GPLv3
3
4 # cut the required holes in a Hammond 1551NTBU box to mount TeleDongle
5
6 # we assume the box starts out standing on edge, with the bottom of the box 
7 # to the "rear" (away from the front of the mill) against a reference plane, 
8 # and the left edge of the box also up against a reference block.  The box
9 # is then flipped 180 degrees putting the right edge of the box against the
10 # reference plane to drill the cable hole.
11
12 # the Z reference plane is top surface of the box, X is the left edge of box
13
14 import math
15
16 Zfree = 0.1000          # height in Z to clear all obstructions
17 Speed = 10              # cutting speed
18 Zdepth = 0.125          # how deep we need to cut to go cleanly through the 
19                         # box wall, where the wall is 0.079 thick
20
21 CutterSize = 0.0625     # 1/16" end mill
22 RunOut = 0.0000         # how much larger slots are than desired 
23 CutterOD = CutterSize + RunOut
24
25 BoxWidth = 1.378
26
27 D_SMA = 0.281           # diameter of SMA hole (doc says 0.256)
28
29 Box_Bottom = 0.472      # how tall the bottom of the box is
30
31 D_Cable = 0.180         # cable diameter, as measured
32 Y_Cable = Box_Bottom - D_Cable/2        # centerline of hole for cable
33 Y_fudge = 0.025         # fudge factor to ensure top of cable hole open
34
35 Y_Box_Bottom = 0.079    # thickness of box bottom wall
36 Y_Standoff = 0.157      # height of standoff nubs in box
37 Y_PCB = 0.063           # PCB thickness
38
39 def plunge():
40         print "(plunge)"
41         print "G01 Z",-Zdepth," F",Speed
42
43 def retract():
44         print "(retract)"
45         print "G00 Z",Zfree
46
47 def park():
48         retract()
49         print "(park)"
50         print "G00 X0 Y5 Z0.25"
51
52 print "%"
53
54 print "(TeleDongle Box using 1/16 end mill)"
55 print "G17 G20 G90"
56 print "M3 S5000"
57
58 retract()
59
60 print
61 print "(SMA hole)"
62
63 X_Pos = (BoxWidth / 2)
64 #Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_PCB + Y_SMA)
65 # above should be correct, but puts the hole too high!
66 Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_PCB)
67 CutLineRadius = (D_SMA / 2) - (CutterOD / 2)
68
69 print "G00 X",(X_Pos + CutLineRadius),"Y",Y_Pos
70 print "G01 Z",-Zdepth," F",Speed
71 print "G02 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % -CutLineRadius,"J0 F",Speed
72 print "G02 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % CutLineRadius,"J0 F",Speed
73
74 print "(pausing for box flip)"
75 retract()
76 print "M5"
77 park()
78 print "M0"
79
80 print
81 print "(cable hole)"
82 print "M3 S5000"
83
84 X_Pos = (BoxWidth / 2)
85 Y_Pos = -Y_Cable
86 CutLineRadius = (D_Cable / 2) - (CutterOD / 2)
87
88 print "G00 X",(X_Pos - CutLineRadius),"Y",Y_Pos
89 print "G01 Z",-Zdepth," F",Speed
90 print "G02 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % CutLineRadius,"J0 F",Speed
91 print "G01 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % -(Box_Bottom - (CutterOD / 2) + Y_fudge),"F",Speed
92 print "G01 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % -(Box_Bottom - (CutterOD / 2) + Y_fudge),"F",Speed
93 print "G01 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % Y_Pos,"F",Speed
94
95 retract()
96 print "M5"
97 park()
98
99 print "M2"
100 print "%"
101