update TeleBT box g-code for v4.0b and later with slide switch
authorBdale Garbee <bdale@gag.com>
Wed, 19 Aug 2020 22:20:34 +0000 (16:20 -0600)
committerBdale Garbee <bdale@gag.com>
Wed, 19 Aug 2020 22:20:34 +0000 (16:20 -0600)
mechanical/telebt-box.py

index afdce1e624d1805408921353f67738ed3fba62b6..190a38565b55bff4b8b976130801554b49a7fabd 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/python
-# Copyright 2013 by Bdale Garbee <bdale@gag.com>.  GPLv3
+# Copyright 2020 by Bdale Garbee <bdale@gag.com>.  GPLv3
 
-# cut the required holes in a Hammond 1551K box to mount TeleBT
+# cut required holes in a Hammond 1551K box to mount TeleBT v4.0b and later
 
 # we assume the box is standing on edge, with the bottom of the box to the
 # "rear" (away from the front of the mill) against a reference plane, and
@@ -11,7 +11,7 @@
 
 import math
 
-Zfree = 0.1000         # height in Z to clear all obstructions
+Zfree = 0.2500         # 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
@@ -23,15 +23,14 @@ CutterOD = CutterSize + RunOut
 BoxWidth = 3.150       # measured one at 3.145, Hammond says 3.150, matters
                        # because most dimensions are relative to center line!
 
-X_Switch = -1.060      # switch distance from center line
-Y_Switch = 0.185       # switch centerline above PCB top surface
-D_Switch = 0.270       # diameter of switch hole (250 mils plus clearance)
+X_Switch = 0.886       # switch distance from center line
+Y_Switch = 0.220       # switch centerline above PCB top surface (adjusted)
+X_Switch_slot = 0.300  # width of switch slot
+Y_Switch_slot = 0.160  # height of switch slot
 
-X_USB = 0.935          # USB distance from center line
+X_USB = -1.143         # USB distance from center line
 Y_USB = -0.049         # USB centerline below PCB bottom surface
 
-#X_USB_slot = 0.325    # width of the USB slot
-#Y_USB_slot = 0.125    # height of the USB slot
 X_USB_slot = 0.350     # width of the USB slot  (account for plastic melting
 Y_USB_slot = 0.150     # height of the USB slot  around end mill)
 
@@ -56,20 +55,19 @@ def park():
        print "G00 X0 Y5 Z0.25"
 
 print "%"
+print "(TeleBT box using 1/16 mill, box base to back, origin back/left/top edges)"
 
 print "G17 G20 G90"
 print "M3 S5000"
 
 retract()
 
-# cut power switch hole
-
 print
-print "(power switch hole)"
+print "(SMA hole)"
 
-X_Pos = (BoxWidth / 2) + X_Switch
-Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_PCB + Y_Switch)
-CutLineRadius = (D_Switch / 2) - (CutterOD / 2)
+X_Pos = (BoxWidth / 2)
+Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_SMA)
+CutLineRadius = (D_SMA / 2) - (CutterOD / 2)
 
 print "G00 X",(X_Pos + CutLineRadius),"Y",Y_Pos
 print "G01 Z",-Zdepth," F",Speed
@@ -78,22 +76,35 @@ print "G02 X%6.4f" % (X_Pos + CutLineRadius),"Y%6.4f" % Y_Pos,"I%6.4f" % CutLine
 retract()
 
 print
-print "(SMA hole)"
+print "(power switch slot)"
 
-X_Pos = (BoxWidth / 2)
-Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_SMA)
-CutLineRadius = (D_SMA / 2) - (CutterOD / 2)
+X_Start = (BoxWidth / 2) + X_Switch + (X_Switch_slot / 2) - (CutterOD / 2)
+X_End = (BoxWidth / 2) + X_Switch - (X_Switch_slot / 2) + (CutterOD / 2)
+Y_Start = -(Y_Box_Bottom + Y_Standoff + Y_Switch) + (Y_Switch_slot / 2) - (CutterOD / 2)
+Y_End = -(Y_Box_Bottom + Y_Standoff + Y_Switch) - (Y_Switch_slot / 2) + (CutterOD / 2)
 
-print "G00 X",(X_Pos + CutLineRadius),"Y",Y_Pos
+print "(  first pass)"
+print "G00 X",X_Start,"Y",Y_Start
 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 "G01 X",X_End," Y",Y_Start," F",Speed
+print "G01 X",X_End," Y",Y_End," F",Speed
+print "G01 X",X_Start," Y",Y_End," F",Speed
+print "G01 X",X_Start," Y",Y_Start," F",Speed
+print
+print "(  second pass)"
+print "G00 X",X_Start,"Y",Y_Start
+print "G01 Z",-Zdepth," F",Speed
+print "G01 X",X_End," Y",Y_Start," F",Speed
+print "G01 X",X_End," Y",Y_End," F",Speed
+print "G01 X",X_Start," Y",Y_End," F",Speed
+print "G01 X",X_Start," Y",Y_Start," F",Speed
+
 retract()
 
 print
 print "(USB slot)"
 
-print "(first end)"
+print "(  first end)"
 X_Pos = (BoxWidth / 2) + X_USB + ((X_USB_slot - Y_USB_slot)/2)
 Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_USB)
 CutLineRadius = (Y_USB_slot / 2) - (CutterOD / 2)
@@ -102,18 +113,18 @@ print "G00 X",X_Pos,"Y",(Y_Pos - CutLineRadius)
 print "G01 Z",-Zdepth," F",Speed
 print "G03 X%6.4f" % X_Pos, "Y%6.4f" % (Y_Pos + CutLineRadius),"I0 J%6.4f" % CutLineRadius," F",Speed
 
-print "(top and second end)"
+print "(  top and second end)"
 X_Pos = (BoxWidth / 2) + X_USB - ((X_USB_slot - Y_USB_slot)/2)
 print "G01 X",X_Pos," F",Speed
 print "G03 X%6.4f" % X_Pos, "Y%6.4f" % (Y_Pos - CutLineRadius),"I0 J%6.4f" % -CutLineRadius," F",Speed
 
-print "(bottom)"
+print "(  bottom)"
 X_Pos = (BoxWidth / 2) + X_USB + ((X_USB_slot - Y_USB_slot)/2)
 print "G01 X",X_Pos," F",Speed
 
 retract()
 
-print "(second pass - first end)"
+print "(  second pass - first end)"
 X_Pos = (BoxWidth / 2) + X_USB + ((X_USB_slot - Y_USB_slot)/2)
 Y_Pos = -(Y_Box_Bottom + Y_Standoff + Y_USB)
 CutLineRadius = (Y_USB_slot / 2) - (CutterOD / 2)
@@ -122,17 +133,15 @@ print "G00 X",X_Pos,"Y",(Y_Pos - CutLineRadius)
 print "G01 Z",-Zdepth," F",Speed
 print "G03 X%6.4f" % X_Pos, "Y%6.4f" % (Y_Pos + CutLineRadius),"I0 J%6.4f" % CutLineRadius," F",Speed
 
-print "(second pass - top and second end)"
+print "(  second pass - top and second end)"
 X_Pos = (BoxWidth / 2) + X_USB - ((X_USB_slot - Y_USB_slot)/2)
 print "G01 X",X_Pos," F",Speed
 print "G03 X%6.4f" % X_Pos, "Y%6.4f" % (Y_Pos - CutLineRadius),"I0 J%6.4f" % -CutLineRadius," F",Speed
 
-print "(second pass - bottom)"
+print "(  second pass - bottom)"
 X_Pos = (BoxWidth / 2) + X_USB + ((X_USB_slot - Y_USB_slot)/2)
 print "G01 X",X_Pos," F",Speed
 
-retract()
-
 park()
 
 print "M5 M2"