From 2aeba71c724c3cf39972fc2f9d1d1de1d788c801 Mon Sep 17 00:00:00 2001 From: carlosgs Date: Fri, 7 Jun 2013 00:08:00 +0200 Subject: [PATCH] Bugfix --- Software/CycloneHost/CycloneHost.py | 2 +- .../out/DTMF_Shield_drill.gcode | 2 +- .../out/DTMF_Shield_edge.gcode | 2 +- .../out/DTMF_Shield_etch.gcode | 2 +- .../out/DTMF_Shield_etch2pass.gcode | 2 +- .../out/DTMF_Shield_etch3pass.gcode | 2 +- .../pygerber2gcode_cui_MOD.conf | 16 +++++++-------- .../pygerber2gcode_cui_MOD.py | 4 ++-- Software/gcode_Z_adjust/Send.py | 20 +++++++++++++------ Software/gcode_Z_adjust/Z_probe.py | 10 +++++----- Software/gcode_Z_adjust/viewGcode.py | 2 +- 11 files changed, 36 insertions(+), 28 deletions(-) diff --git a/Software/CycloneHost/CycloneHost.py b/Software/CycloneHost/CycloneHost.py index c8ada29..e0655af 100644 --- a/Software/CycloneHost/CycloneHost.py +++ b/Software/CycloneHost/CycloneHost.py @@ -222,7 +222,7 @@ def probeZ(): def close(): # IMPORTANT: Before closing the serial port we must make a blocking move in order to wait for all the buffered commands to end - sendCommand("G28 Z0\n",timeoutResend) # move Z to min endstop + sendCommand("G28 Z0\n") # move Z to min endstop if Emulate == 0: CNC_Machine.close() # Close the serial port connection diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_drill.gcode b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_drill.gcode index 4c3ab63..2da5709 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_drill.gcode +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_drill.gcode @@ -1,5 +1,5 @@ (Generated by ./pygerber2gcode_cui_MOD.py ) -( 2013-06-05 17:19:17 ) +( 2013-06-06 17:09:39 ) (Initialize) (Start form here) diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_edge.gcode b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_edge.gcode index 225f1ca..cb964da 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_edge.gcode +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_edge.gcode @@ -1,5 +1,5 @@ (Generated by ./pygerber2gcode_cui_MOD.py ) -( 2013-06-05 17:19:17 ) +( 2013-06-06 17:09:39 ) (Initialize) (Start form here) diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch.gcode b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch.gcode index 9f53759..26e7a8b 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch.gcode +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch.gcode @@ -1,5 +1,5 @@ (Generated by ./pygerber2gcode_cui_MOD.py ) -( 2013-06-05 17:19:17 ) +( 2013-06-06 17:09:39 ) (Initialize) (Start form here) diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch2pass.gcode b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch2pass.gcode index 4d31b51..ba081c3 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch2pass.gcode +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch2pass.gcode @@ -1,5 +1,5 @@ (Generated by ./pygerber2gcode_cui_MOD.py ) -( 2013-06-05 17:19:17 ) +( 2013-06-06 17:09:39 ) (Initialize) (Start form here) diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch3pass.gcode b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch3pass.gcode index ed6b4f2..5b95724 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch3pass.gcode +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/out/DTMF_Shield_etch3pass.gcode @@ -1,5 +1,5 @@ (Generated by ./pygerber2gcode_cui_MOD.py ) -( 2013-06-05 17:19:17 ) +( 2013-06-06 17:09:39 ) (Initialize) (Start form here) diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.conf b/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.conf index e363521..4dbae98 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.conf +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.conf @@ -1,8 +1,8 @@ GERBER_DIR = "./in" FRONT_FILE = "" -BACK_FILE = "DTMF_Shield-B_Cu.gbl" -DRILL_FILE = "DTMF_Shield.drl" -EDGE_FILE = "DTMF_Shield-Edge_Cuts.gbr" +BACK_FILE = "placa_cny70-B_Cu.gbl" +DRILL_FILE = "placa_cny70.drl" +EDGE_FILE = "placa_cny70-Edge_Cuts.gbr" MIRROR_FRONT = 0 MIRROR_BACK = 1 MIRROR_DRILL = 1 @@ -10,13 +10,13 @@ MIRROR_EDGE = 1 ROT_ANG = 0 OUT_DIR = "./out" OUT_FRONT_FILE = "" -OUT_BACK_FILE = "DTMF_Shield_etch.gcode" +OUT_BACK_FILE = "placa_cny70_etch.gcode" OUT_FRONT_2PASS_FILE = "" -OUT_BACK_2PASS_FILE = "DTMF_Shield_etch2pass.gcode" +OUT_BACK_2PASS_FILE = "placa_cny70_etch2pass.gcode" OUT_FRONT_3PASS_FILE = "" -OUT_BACK_3PASS_FILE = "DTMF_Shield_etch3pass.gcode" -OUT_DRILL_FILE = "DTMF_Shield_drill.gcode" -OUT_EDGE_FILE = "DTMF_Shield_edge.gcode" +OUT_BACK_3PASS_FILE = "placa_cny70_etch3pass.gcode" +OUT_DRILL_FILE = "placa_cny70_drill.gcode" +OUT_EDGE_FILE = "placa_cny70_edge.gcode" INI_X=0.0 INI_Y=0.0 diff --git a/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.py b/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.py index df1ecd6..b82b4f0 100644 --- a/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.py +++ b/Software/GcodeGenerators/pyGerber2Gcode_CUI/pygerber2gcode_cui_MOD.py @@ -794,7 +794,7 @@ def circle_points(cx,cy,r,points_num): elif new_points_num > 50 : new_points_num = 50 - print "Modifying CIRCLE points_num from",points_num,"to",new_points_num + #print "Modifying CIRCLE points_num from",points_num,"to",new_points_num points_num = new_points_num # print "Circle: Radius:", str(r), "Points:", points_num points=[] @@ -947,7 +947,7 @@ def arc_points(cx,cy,r,s_angle,e_angle,kaku): elif new_kaku > 50 : new_kaku = 50 if kaku != new_kaku: - print "Modifying ARC points from",kaku,"to",new_kaku + #print "Modifying ARC points from",kaku,"to",new_kaku kaku = new_kaku # print "Arc: Radius:", str(r), "Points:", kaku diff --git a/Software/gcode_Z_adjust/Send.py b/Software/gcode_Z_adjust/Send.py index 3d81a7b..5350f28 100644 --- a/Software/gcode_Z_adjust/Send.py +++ b/Software/gcode_Z_adjust/Send.py @@ -34,7 +34,7 @@ from helper import * # End modules filePath = "../GcodeGenerators/pyGerber2Gcode_CUI/out/" -fileName = "DTMF_Shield" # sys.argv[1] +fileName = "DTMF_Shield_etch" # sys.argv[1] @@ -68,17 +68,22 @@ def pltShow(): def probingResults(): # quick and dirty temporal code - global Z_workbed_surface + global Z_workbed_surface, x_points, y_points # x_points = [0.0, 12.272727272727273, 24.545454545454547, 36.81818181818182, 49.09090909090909, 61.36363636363637, 73.63636363636364, 85.9090909090909, 98.18181818181819, 110.45454545454547, 122.72727272727273, 135.0] # y_points = [0.0, 16.8, 33.6, 50.400000000000006, 67.2, 84.0] # probe_result = [[0.0, 0.2, 0.4, 0.53, 0.58, 0.6, 0.56, 0.53, 0.5, 0.44, 0.33, 0.2], [-0.03, 0.07, 0.16, 0.26, 0.32, 0.33, 0.33, 0.33, 0.29, 0.23, 0.15, 0.05], [-0.07, 0.0, 0.05, 0.12, 0.16, 0.2, 0.2, 0.22, 0.2, 0.16, 0.08, 0.0], [-0.07, -0.03, 0.04, 0.11, 0.15, 0.19, 0.2, 0.22, 0.22, 0.19, 0.11, 0.04], [0.0, 0.04, 0.08, 0.19, 0.23, 0.29, 0.33, 0.36, 0.37, 0.32, 0.2, 0.11], [0.13, 0.2, 0.27, 0.37, 0.44, 0.51, 0.55, 0.61, 0.64, 0.55, 0.41, 0.22]] # duration = 346.076061 # DTMF board - x_points = [0.0, 17.5, 35.0, 52.5, 70.0] +# x_points = [0.0, 17.5, 35.0, 52.5, 70.0] +# y_points = [0.0, 13.333333333333334, 26.666666666666668, 40.0] +# probe_result = [[0.0, 0.28000000000000114, 0.490000000000002, 0.5599999999999987, 0.5199999999999996], [0.0, 0.1700000000000017, 0.33000000000000185, 0.41000000000000014, 0.41000000000000014], [-0.030000000000001137, 0.08999999999999986, 0.21999999999999886, 0.3000000000000007, 0.33000000000000185], [-0.08999999999999986, 0.03999999999999915, 0.16000000000000014, 0.26000000000000156, 0.28999999999999915]] +# duration = 102.808573 + + x_points = [70.0, 87.5, 105.0, 122.5, 140.0] y_points = [0.0, 13.333333333333334, 26.666666666666668, 40.0] - probe_result = [[0.0, 0.28000000000000114, 0.490000000000002, 0.5599999999999987, 0.5199999999999996], [0.0, 0.1700000000000017, 0.33000000000000185, 0.41000000000000014, 0.41000000000000014], [-0.030000000000001137, 0.08999999999999986, 0.21999999999999886, 0.3000000000000007, 0.33000000000000185], [-0.08999999999999986, 0.03999999999999915, 0.16000000000000014, 0.26000000000000156, 0.28999999999999915]] - duration = 102.808573 + probe_result = [[0.0, -0.15000000000000213, -0.28000000000000114, -0.38000000000000256, -0.4299999999999997], [-0.08000000000000185, -0.20000000000000284, -0.33999999999999986, -0.4400000000000013, -0.490000000000002], [-0.15000000000000213, -0.26000000000000156, -0.370000000000001, -0.46000000000000085, -0.5100000000000016], [-0.21000000000000085, -0.26000000000000156, -0.35999999999999943, -0.4400000000000013, -0.490000000000002]] + duration = 105.028261 # Show our grid # print "--- Probing results ---" @@ -129,7 +134,7 @@ probingResults() print "Must be zero:",floats(getZoffset(0,0)) # Display the Gcode that is going to be etched -(etch_moves, travel_moves, gcode_minXY_global, gcode_maxXY_global) = gcv.view(filePath,fileName,showEdge=1) +(etch_moves, travel_moves, gcode_minXY_global, gcode_maxXY_global) = gcv.view(filePath,fileName,showEtch=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch1=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch2=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showDrill=1) @@ -188,6 +193,9 @@ cy.homeZXY() # Home all the axis drawTool(10, 20) # Show a marker on the gcode plot +# Move to the origin of the grid +cy.moveXY(x_points[0], y_points[0], F_fastMove) + # Warning: Do not lower too much or you will potentially cause damage! initial_Z_lowering_distance = -10 diff --git a/Software/gcode_Z_adjust/Z_probe.py b/Software/gcode_Z_adjust/Z_probe.py index 938d049..1717f6a 100644 --- a/Software/gcode_Z_adjust/Z_probe.py +++ b/Software/gcode_Z_adjust/Z_probe.py @@ -37,7 +37,7 @@ cy.homeZXY() # Home all the axis #grid_origin = (0,0) # Initial point of the grid [mm] #grid_len = (135,84) # Distance to probe [mm] #grid_N = (12,6) # Number of points -grid_origin = (0,0) # Initial point of the grid [mm] +grid_origin = (70,0) # Initial point of the grid [mm] grid_len = (70,40) # Distance to probe [mm] grid_N = (5,4) # Number of points (AT LEAST 4 IN EACH DIRECTION, OTHERWISE INTERPOLATION WILL FAIL) @@ -56,10 +56,10 @@ cy.moveZrelSafe(initial_Z_lowering_distance,F_slowMove) # Move Z towards the PCB #probe_result = [[0.0, 0.2, 0.4, 0.53, 0.58, 0.6, 0.56, 0.53, 0.5, 0.44, 0.33, 0.2], [-0.03, 0.07, 0.16, 0.26, 0.32, 0.33, 0.33, 0.33, 0.29, 0.23, 0.15, 0.05], [-0.07, 0.0, 0.05, 0.12, 0.16, 0.2, 0.2, 0.22, 0.2, 0.16, 0.08, 0.0], [-0.07, -0.03, 0.04, 0.11, 0.15, 0.19, 0.2, 0.22, 0.22, 0.19, 0.11, 0.04], [0.0, 0.04, 0.08, 0.19, 0.23, 0.29, 0.33, 0.36, 0.37, 0.32, 0.2, 0.11], [0.13, 0.2, 0.27, 0.37, 0.44, 0.51, 0.55, 0.61, 0.64, 0.55, 0.41, 0.22]] #duration = 346.076061 -x_points = [0.0, 17.5, 35.0, 52.5, 70.0] -y_points = [0.0, 13.333333333333334, 26.666666666666668, 40.0] -probe_result = [[0.0, 0.28000000000000114, 0.490000000000002, 0.5599999999999987, 0.5199999999999996], [0.0, 0.1700000000000017, 0.33000000000000185, 0.41000000000000014, 0.41000000000000014], [-0.030000000000001137, 0.08999999999999986, 0.21999999999999886, 0.3000000000000007, 0.33000000000000185], [-0.08999999999999986, 0.03999999999999915, 0.16000000000000014, 0.26000000000000156, 0.28999999999999915]] -duration = 102.808573 +#x_points = [0.0, 17.5, 35.0, 52.5, 70.0] +#y_points = [0.0, 13.333333333333334, 26.666666666666668, 40.0] +#probe_result = [[0.0, 0.28000000000000114, 0.490000000000002, 0.5599999999999987, 0.5199999999999996], [0.0, 0.1700000000000017, 0.33000000000000185, 0.41000000000000014, 0.41000000000000014], [-0.030000000000001137, 0.08999999999999986, 0.21999999999999886, 0.3000000000000007, 0.33000000000000185], [-0.08999999999999986, 0.03999999999999915, 0.16000000000000014, 0.26000000000000156, 0.28999999999999915]] +#duration = 102.808573 # Show our grid diff --git a/Software/gcode_Z_adjust/viewGcode.py b/Software/gcode_Z_adjust/viewGcode.py index 1e07714..ffe8bab 100644 --- a/Software/gcode_Z_adjust/viewGcode.py +++ b/Software/gcode_Z_adjust/viewGcode.py @@ -66,7 +66,7 @@ gcodeviewer = pltNewFig() # Define a new figure, this doesnt open a window by it filePath = "../GcodeGenerators/pyGerber2Gcode_CUI/out/" -fileName = "DTMF_Shield" # sys.argv[1] +fileName = "DTMF_Shield_etch" # sys.argv[1] gcv.view(filePath,fileName,showAll=1)