summaryrefslogtreecommitdiff
path: root/gcode/rings.py
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2013-08-30 03:36:35 +1200
committerMike Beattie <mike@ethernal.org>2013-08-30 03:36:35 +1200
commit4d8d3ce82a05316912088ceec144c5b557a4b5cb (patch)
tree3dc8a09fe1fa6495bcd4f47087c39e8f518d8e37 /gcode/rings.py
parentd7f66ca9c6e643d4fcad1602681fa13bb7bc2028 (diff)
Add gcode generation script
For generating gcode to cut rings and bulkheads with a cnc router Signed-off-by: Mike Beattie <mike@ethernal.org>
Diffstat (limited to 'gcode/rings.py')
-rwxr-xr-xgcode/rings.py200
1 files changed, 200 insertions, 0 deletions
diff --git a/gcode/rings.py b/gcode/rings.py
new file mode 100755
index 0000000..2a9abe0
--- /dev/null
+++ b/gcode/rings.py
@@ -0,0 +1,200 @@
+#! /usr/bin/python
+# Copyright 2008 by Bdale Garbee <bdale@gag.com>. GPLv2
+# Copyright 2011 by Anthony Towns <aj@erisian.com.au>. GPLv2
+
+import math
+from rocket_gcode import *
+
+Zfree = 0.2500 # height in Z to clear all obstructions
+Speed = 10 # cutting speed
+
+MMT_OD = mm2inch(79.3)
+Coupler_ID = 3.74
+Airframe_ID = 3.90
+Nose_ID = 3.75
+
+FinCount = 3
+FinWidth = mm2inch(6.25) # Actually 6.85, but allowance for wandering bit.
+
+
+### AFT CR - Aeropack holes and fin slots - 1/8" bit
+CutterOD = 0.125 # 1/8"
+gcode = Gcode(output=open("mjbl3_cr_aft-aeropack.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+RingThickness = 0.75
+RingID = MMT_OD
+RingOD = Airframe_ID
+AeropackRotation = 15 # Get the holes out of alignment with fin slots.
+AeropackDepth = 0.8 # Go right through the bulkhead
+AeropackStep = 0.2 # cut in 0.2 inch increments
+FinDepth = RingThickness/2
+FinIncrement = 0.1
+
+gcode.comment("Aeropack retainer holes, depth %s" % (AeropackDepth,))
+gcode.aeropack_75mm(AeropackRotation, AeropackDepth, AeropackStep)
+
+gcode.comment("Fin slots, depth %1.3f in %1.1f increments" % (FinDepth, FinIncrement))
+gcode.fin_slots(FinCount, RingID, RingOD, FinWidth, FinDepth, FinIncrement)
+
+gcode.close()
+
+### AFT CR - MMT/Airframe cuts - 1/4" bit.
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_cr_aft-rings.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+RingID = MMT_OD
+RingOD = Airframe_ID
+
+for Zthrough in (0.25, 0.5, 0.8):
+ gcode.Zdepth = Zthrough
+ gcode.comment("MMT hole depth %s" % (Zthrough,))
+ gcode.circle(RingID - CutterOD)
+
+for Zthrough in (0.25, 0.5, 0.8):
+ gcode.Zdepth = Zthrough
+ gcode.comment("ring outer diameter")
+ gcode.circle(RingOD + CutterOD)
+
+gcode.close()
+
+### FORWARD FIN CR - fin slots
+CutterOD = 0.125 # 1/8"
+gcode = Gcode(output=open("mjbl3_cr_finfwd-slots.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+RingThickness = 0.75
+RingID = MMT_OD
+RingOD = Airframe_ID
+FinDepth = RingThickness/2
+FinIncrement = 0.1
+
+gcode.fin_slots(FinCount, RingID, RingOD, FinWidth, FinDepth, FinIncrement)
+
+gcode.close()
+
+### AFT CR - MMT/Airframe cuts - 1/4" bit.
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_cr_finfwd-rings.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+RingID = MMT_OD
+RingOD = Airframe_ID
+
+for Zthrough in (0.25, 0.5, 0.8):
+ gcode.Zdepth = Zthrough
+ gcode.comment("MMT hole depth %s" % (Zthrough,))
+ gcode.circle(RingID - CutterOD)
+
+for Zthrough in (0.25, 0.5, 0.8):
+ gcode.Zdepth = Zthrough
+ gcode.comment("ring outer diameter")
+ gcode.circle(RingOD + CutterOD)
+
+gcode.close()
+
+### ZIPPERLESS FORWARD CR
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_cr_zipperless.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+RingID = MMT_OD
+RingOD = Coupler_ID
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("Zipperless CR, MMT diam")
+ gcode.circle(RingID - CutterOD)
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("Zipperless CR, coupler diam")
+ gcode.circle(RingOD + CutterOD)
+
+gcode.close()
+
+### EBAY BULKHEAD HOLES
+CutterOD = 0.125 # 1/8"
+gcode = Gcode(output=open("mjbl3_bh_ebay-holes1.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+Allthread_width = 2.50
+
+gcode.hole(x=0, y= (Allthread_width/2), depth=0.6, increment=0.3, speed=25)
+gcode.hole(x=0, y=-(Allthread_width/2), depth=0.6, increment=0.3, speed=25)
+
+gcode.close()
+
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_bh_ebay-holes2.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+UBolt_width = 0.945
+
+gcode.hole(x= (UBolt_width/2), y=0, depth=0.6, increment=0.3, speed=25)
+gcode.hole(x=-(UBolt_width/2), y=0, depth=0.6, increment=0.3, speed=25)
+
+gcode.close()
+
+### EBAY BULKHEADS
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_bh_ebay.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+BulkheadOD = Airframe_ID
+StepOD = Coupler_ID
+
+gcode.Zdepth = 0.25
+gcode.comment("ebay bulkhead - step, coupler diameter")
+gcode.circle(StepOD + CutterOD)
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("ebay bulkhead - outer diameter")
+ gcode.circle(BulkheadOD + CutterOD)
+
+gcode.close()
+
+### Nosecone bulkhead
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_bh_nose.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+BulkheadOD = Nose_ID
+HatchOD = 2.0
+HatchFlangeOD = 2.5
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("Nose bulkhead, hatch.")
+ gcode.circle(HatchOD - CutterOD)
+
+gcode.Zdepth = 0.25
+gcode.comment("Nose bulkhead, hatch flange")
+gcode.circle(HatchFlangeOD - CutterOD)
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("Nose bulkhead - outer diameter")
+ gcode.circle(BulkheadOD + CutterOD)
+
+gcode.close()
+
+### Nosecone bulkhead - hatch slot
+CutterOD = 0.125 # 1/8"
+gcode = Gcode(output=open("mjbl3_bh_nose-hatch-slot.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+gcode.slot(startX=0, startY=0.75, stopX=0, stopY=-0.75, width=0.180, depth=0.6, increment=0.1)
+
+gcode.close()
+
+### Nosecone bulkhead - hatch
+CutterOD = 0.25 # 1/4"
+gcode = Gcode(output=open("mjbl3_bh_nose-hatch.ngc","w"), speed=Speed, free=Zfree, cutter=CutterOD)
+
+HatchOD = 2.0
+HatchFlangeOD = 2.5
+
+gcode.Zdepth = 0.25
+gcode.comment("Nose bulkhead, hatch")
+gcode.circle(HatchOD + CutterOD)
+
+for Zthrough in (0.25, 0.6):
+ gcode.Zdepth = Zthrough
+ gcode.comment("Nose bulkhead, hatch flange.")
+ gcode.circle(HatchFlangeOD + CutterOD)
+
+gcode.close()
+