diff options
author | hoekstar <hoekstar> | 2009-02-22 17:23:26 +0000 |
---|---|---|
committer | hoekstar <hoekstar@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2009-02-22 17:23:26 +0000 |
commit | 8bbfedbeab7e413aa0464352b5c0e8e36bdadf11 (patch) | |
tree | 74fa31911aba05ac92e69f537dc839e060db904a | |
parent | e0b20c88967b1811f4e2f0993678d6913a43752e (diff) | |
download | reprap-8bbfedbeab7e413aa0464352b5c0e8e36bdadf11.tar.gz reprap-8bbfedbeab7e413aa0464352b5c0e8e36bdadf11.zip |
fixed rod removal bug, added proper support for XZ and YZ diagonals.
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@2587 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rwxr-xr-x | trunk/users/hoeken/pythagoras/make_bot.py | 75 |
1 files changed, 54 insertions, 21 deletions
diff --git a/trunk/users/hoeken/pythagoras/make_bot.py b/trunk/users/hoeken/pythagoras/make_bot.py index ab1a0c2f..30bf5796 100755 --- a/trunk/users/hoeken/pythagoras/make_bot.py +++ b/trunk/users/hoeken/pythagoras/make_bot.py @@ -39,6 +39,9 @@ useWashers = True #z bearing holders made from lasercut acrylic zBearingHolderHeight = 5.45*3 +#placeholder until i know how tall the xy assembly is. +zArbitraryHeight = 50 + from math import * import sys import getopt @@ -118,7 +121,7 @@ def main(argv): yRods = 4 zRods = 4 xyRods = 2 - xzRods = 4 + xzRods = 2 yzRods = 4 totalRods = xRods + yRods + zRods + xyRods + xzRods + yzRods @@ -133,30 +136,51 @@ def main(argv): totalWashers = 0 #how far apart are our corner ties? - xMidpointFar = x - nutHeight - washerHeight - rodSize - blockSize - blockSize - blockSize/2.0 + xMidPointFar = x - nutHeight - washerHeight - rodSize - blockSize - blockSize - blockSize/2.0 xMidPointNear = nutHeight + washerHeight + rodSize + blockSize + blockSize + blockSize/2.0 - xDistance = xMidpointFar - xMidPointNear + xDistance = xMidPointFar - xMidPointNear - yMidpointFar = y - nutHeight - washerHeight - rodSize - blockSize - blockSize - blockSize/2.0 + yMidPointFar = y - nutHeight - washerHeight - rodSize - blockSize - blockSize - blockSize/2.0 yMidPointNear = nutHeight + washerHeight + rodSize + blockSize + blockSize + blockSize/2.0 - yDistance = yMidpointFar - yMidPointNear + yDistance = yMidPointFar - yMidPointNear + + zMidPointFar = z - zArbitraryHeight - blockSize/2.0 + zMidPointNear = nutHeight + washerHeight + blockSize + rodSize + blockSize + blockSize/2.0 + zDistance = zMidPointFar - zMidPointNear + xDistanceForZ = xDistance + blockSize * 2.0 + yDistanceForZ = yDistance + blockSize * 2.0 - xyMidpointDistance = sqrt(xDistance*xDistance + yDistance*yDistance) - xyDistance = xyMidpointDistance + blockSize + (nutHeight + washerHeight)*2.0+ nutHeight*6.0 + xyMidPointDistance = sqrt(xDistance*xDistance + yDistance*yDistance) + xzMidPointDistance = sqrt(xDistanceForZ*xDistanceForZ + zDistance*zDistance) + yzMidPointDistance = sqrt(yDistanceForZ*yDistanceForZ + zDistance*zDistance) + + diagonalExtraLength = blockSize + (nutHeight + washerHeight)*2.0+ nutHeight*6.0 + + xyDistance = xyMidPointDistance + diagonalExtraLength + xzDistance = xzMidPointDistance + diagonalExtraLength + yzDistance = yzMidPointDistance + diagonalExtraLength #show some header / info print "(Generated by make_bot.py)" print "(Required Rod Lengths:)" - print "( X Rods: 4 * %06.2fmm)" % (x) - print "( Y Rods: 4 * %06.2fmm)" % (y) - print "( Z Rods: 4 * %06.2fmm)" % (z) - print "(XZ Rods: 4 * %06.2fmm)" % (bot.getXZ()) - print "(YZ Rods: 4 * %06.2fmm)" % (bot.getYZ()) - print "(XY Rods: 2 * %06.2fmm)" % (xyDistance) + print "( X Rods: %d * %06.2fmm)" % (xRods, x) + print "( Y Rods: %d * %06.2fmm)" % (yRods, y) + print "( Z Rods: %d * %06.2fmm)" % (zRods, z) + print "(XZ Rods: %d * %06.2fmm)" % (xzRods, xzDistance) + print "(YZ Rods: %d * %06.2fmm)" % (yzRods, yzDistance) + print "(XY Rods: %d * %06.2fmm)" % (xyRods, xyDistance) print "(Total Volume: %06.2fm^3)" % (bot.getVolume()) print "(Total kebabs: %d)" % (totalRods) print "(Total nuts required: %d)" % (totalNuts) print "(Total washers required: %d)" % (totalWashers) + print "(X Distance: %06.2fmm)" % (xDistance) + print "(Y Distance: %06.2fmm)" % (yDistance) + print "(Z Distance: %06.2fmm)" % (zDistance) + print "(X Distance for Z Diagonals: %06.2fmm)" % (xDistanceForZ) + print "(Y Distance for Z Diagonals: %06.2fmm)" % (yDistanceForZ) + print "(XY Diagonal Distance: %06.2fmm)" % (xyMidPointDistance) + print "(XZ Diagonal Distance: %06.2fmm)" % (xzMidPointDistance) + print "(YZ Diagonal Distance: %06.2fmm)" % (yzMidPointDistance) #TODO: print the total number of whole rods required. print "(GCODE STARTS BELOW)" print "G90 (Absolute Mode)" @@ -176,15 +200,15 @@ def main(argv): print "M00 (Starting XY kebabs)" for i in range(0, xyRods): - build_diagonal_kebab(xyDistance, xyMidpointDistance) + build_diagonal_kebab(xyDistance, xyMidPointDistance) -# print "M00 (Starting XZ kebabs)" -# for i in range(0, xzRods): -# build_diagonal_kebab(bot.getXZ()) + print "M00 (Starting XZ kebabs)" + for i in range(0, xzRods): + build_diagonal_kebab(xzDistance, xzMidPointDistance) -# print "M00 (Starting YZ kebabs)" -# for i in range(0, yzRods): -# build_diagonal_kebab(bot.getYZ()) + print "M00 (Starting YZ kebabs)" + for i in range(0, yzRods): + build_diagonal_kebab(yzDistance, yzMidPointDistance) def build_frame_kebab(length): @@ -252,6 +276,7 @@ def build_frame_kebab(length): #okay, remove the rod print "M00 (Firmly grasp the rod. We're going to remove it from the winder.)" + print "G92 Z0" print "G1 Z%06.2f F%06.2f" % (-nutHeight * 1.5, feedrate * 0.5) print "G92 Z0" @@ -262,7 +287,7 @@ def build_z_kebab(length): print "M00 (Grab a %06.2fmm rod and 4 nuts)" % (length) #the first/top. nut on the rod. - nutPosition = length - nutHeight - 50 - blockSize - blockSize + nutPosition = length - nutHeight - zArbitraryHeight - blockSize - blockSize if useWashers: nutPosition = nutPosition - washerHeight thread_nut(nutPosition) @@ -290,6 +315,7 @@ def build_z_kebab(length): #okay, remove the rod print "M00 (Firmly grasp the rod. We're going to remove it from the winder.)" + print "G92 Z0" print "G1 Z%06.2f F%06.2f" % (-nutHeight * 1.5, feedrate * 0.5) print "G92 Z0" @@ -345,6 +371,13 @@ def build_diagonal_kebab(length, distance): nutPosition = nutPosition - nutHeight - blockSize thread_nut(nutPosition) + #okay, remove the rod + print "M00 (Firmly grasp the rod. We're going to remove it from the winder.)" + print "G92 Z0" + print "G1 Z%06.2f F%06.2f" % (-nutHeight * 1.5, feedrate * 0.5) + print "G92 Z0" + + def thread_nut(position): "Thread the front of a nut to a position on the rod" print "M00 (Thread a nut on the rod)" |