]> git.gag.com Git - hw/altusmetrum/commitdiff
add script for generating g-code to cut TeleDongle boxes
authorBdale Garbee <bdale@gag.com>
Mon, 21 May 2018 13:25:21 +0000 (07:25 -0600)
committerBdale Garbee <bdale@gag.com>
Mon, 21 May 2018 13:25:21 +0000 (07:25 -0600)
mechanical/Notebook
mechanical/teledongle-box.py [new file with mode: 0755]

index 67c80ba28003a5c2c32b54402ab86a3b5aae0a8a..12885dc6e410416af3aa9dc173dec7527a501f1d 100644 (file)
@@ -8,6 +8,10 @@ M22_Powerpole_Mount.zip
        used for battery charger attachment to TeleFire series, acquired
        via Thingiverse.        https://www.thingiverse.com/thing:2580868
 
+teledongle-box.py
+       script to generate g-code used for cutting TeleDongle boxes on
+       Bdale's cnc router
+
 telelco_1170_panel.fcstd
        panel design for TeleLCO mounted in a Pelican model 1170 case
 
diff --git a/mechanical/teledongle-box.py b/mechanical/teledongle-box.py
new file mode 100755 (executable)
index 0000000..ef10ee0
--- /dev/null
@@ -0,0 +1,101 @@
+#! /usr/bin/python
+# Copyright 2017 by Bdale Garbee <bdale@gag.com>.  GPLv3
+
+# cut the required holes in a Hammond 1551NTBU box to mount TeleDongle
+
+# we assume the box starts out standing on edge, with the bottom of the box 
+# to the "rear" (away from the front of the mill) against a reference plane, 
+# and the left edge of the box also up against a reference block.  The box
+# is then flipped 180 degrees putting the right edge of the box against the
+# reference plane to drill the cable hole.
+
+# the Z reference plane is top surface of the box, X is the left edge of box
+
+import math
+
+Zfree = 0.1000         # height in Z to clear all obstructions
+Speed = 10             # cutting speed
+Zdepth = 0.125         # how deep we need to cut to go cleanly through the 
+                       # box wall, where the wall is 0.079 thick
+
+CutterSize = 0.0625    # 1/16" end mill
+RunOut = 0.0000                # how much larger slots are than desired 
+CutterOD = CutterSize + RunOut
+
+BoxWidth = 1.378
+
+D_SMA = 0.281          # diameter of SMA hole (doc says 0.256)
+
+Box_Bottom = 0.472     # how tall the bottom of the box is
+
+D_Cable = 0.180                # cable diameter, as measured
+Y_Cable = Box_Bottom - D_Cable/2       # centerline of hole for cable
+Y_fudge = 0.025                # fudge factor to ensure top of cable hole open
+
+Y_Box_Bottom = 0.079   # thickness of box bottom wall
+Y_Standoff = 0.157     # height of standoff nubs in box
+Y_PCB = 0.063          # PCB thickness
+
+def plunge():
+       print "(plunge)"
+       print "G01 Z",-Zdepth," F",Speed
+
+def retract():
+       print "(retract)"
+       print "G00 Z",Zfree
+
+def park():
+       retract()
+       print "(park)"
+       print "G00 X0 Y5 Z0.25"
+
+print "%"
+
+print "(TeleDongle Box using 1/16 end mill)"
+print "G17 G20 G90"
+print "M3 S5000"
+
+retract()
+
+print
+print "(SMA hole)"
+
+X_Pos = (BoxWidth / 2)
+#Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_PCB + Y_SMA)
+# above should be correct, but puts the hole too high!
+Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_PCB)
+CutLineRadius = (D_SMA / 2) - (CutterOD / 2)
+
+print "G00 X",(X_Pos + CutLineRadius),"Y",Y_Pos
+print "G01 Z",-Zdepth," F",Speed
+print "G02 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % -CutLineRadius,"J0 F",Speed
+print "G02 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % CutLineRadius,"J0 F",Speed
+
+print "(pausing for box flip)"
+retract()
+print "M5"
+park()
+print "M0"
+
+print
+print "(cable hole)"
+print "M3 S5000"
+
+X_Pos = (BoxWidth / 2)
+Y_Pos = -Y_Cable
+CutLineRadius = (D_Cable / 2) - (CutterOD / 2)
+
+print "G00 X",(X_Pos - CutLineRadius),"Y",Y_Pos
+print "G01 Z",-Zdepth," F",Speed
+print "G02 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % CutLineRadius,"J0 F",Speed
+print "G01 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % -(Box_Bottom - (CutterOD / 2) + Y_fudge),"F",Speed
+print "G01 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % -(Box_Bottom - (CutterOD / 2) + Y_fudge),"F",Speed
+print "G01 X%6.4f" % (X_Pos - CutLineRadius),"Y%6.4f" % Y_Pos,"F",Speed
+
+retract()
+print "M5"
+park()
+
+print "M2"
+print "%"
+