- added a new parameter to set the feedrate of the probing in case the used postprocessor does probing (has toolchange_probe in it's name)

- fixed bug in Marlin postprocessor for the Excellon files; the header and toolchange event always used the parenthesis witch is not compatible with GCode for Marlin
- fixed a issue with a move to Z_move before any toolchange
This commit is contained in:
Marius Stanciu
2019-02-05 19:40:46 +02:00
committed by Marius S
parent 822800e7f5
commit 3b8b7d470a
10 changed files with 205 additions and 57 deletions

View File

@@ -25,6 +25,7 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
gcode += '(Feedrate Probe ' + str(p['feedrate_probe']) + units + '/min' + ')\n' + '\n'
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
if str(p['options']['type']) == 'Geometry':
@@ -42,6 +43,7 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
gcode += '(Z Probe Depth: ' + str(p['z_pdepth']) + units + ')\n'
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
@@ -99,16 +101,17 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
gcode = """
T{tool}
M5
M6
G00 Z{toolchangez}
G00 X{toolchangex} Y{toolchangey}
(MSG, Change to Tool Dia = {toolC} ||| Drills for this tool = {t_drills} ||| Tool Probing MACH3)
M0
G00 Z{z_move}
F{fr}
F{feedrate_probe}
G31 Z{z_pdepth}
G92 Z0
G00 Z{z_move}
F{fr_slow}
F{feedrate_probe_slow}
G31 Z{z_pdepth}
G92 Z0
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
@@ -118,8 +121,8 @@ G00 Z{z_move}
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
fr=str(self.feedrate_format %(p.fr_decimals, p.feedrate)),
fr_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate / 2))),
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
feedrate_probe_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate_probe / 2))),
z_pdepth=self.coordinate_format % (p.coords_decimals, p.z_pdepth),
tool=int(p.tool),
t_drills=no_drills,
@@ -128,15 +131,16 @@ G00 Z{z_move}
gcode = """
T{tool}
M5
M6
G00 Z{toolchangez}
(MSG, Change to Tool Dia = {toolC} ||| Drills for this tool = {t_drills} ||| Tool Probing MACH3)
M0
G00 Z{z_move}
F{fr}
F{feedrate_probe}
G31 Z{z_pdepth}
G92 Z0
G00 Z{z_move}
F{fr_slow}
F{feedrate_probe_slow}
G31 Z{z_pdepth}
G92 Z0
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
@@ -144,8 +148,8 @@ M0
G00 Z{z_move}
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
fr=str(self.feedrate_format %(p.fr_decimals, p.feedrate)),
fr_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate / 2))),
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
feedrate_probe_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate_probe / 2))),
z_pdepth=self.coordinate_format % (p.coords_decimals, p.z_pdepth),
tool=int(p.tool),
t_drills=no_drills,
@@ -160,16 +164,17 @@ G00 Z{z_move}
gcode = """
T{tool}
M5
M6
G00 Z{toolchangez}
G00 X{toolchangex} Y{toolchangey}
(MSG, Change to Tool Dia = {toolC} ||| Tool Probing MACH3)
M0
G00 Z{z_move}
F{fr}
F{feedrate_probe}
G31 Z{z_pdepth}
G92 Z0
G00 Z{z_move}
F{fr_slow}
F{feedrate_probe_slow}
G31 Z{z_pdepth}
G92 Z0
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
@@ -179,8 +184,8 @@ G00 Z{z_move}
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
fr=str(self.feedrate_format % (p.fr_decimals, p.feedrate)),
fr_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate / 2))),
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
feedrate_probe_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate_probe / 2))),
z_pdepth=self.coordinate_format % (p.coords_decimals, p.z_pdepth),
tool=int(p.tool),
toolC=toolC_formatted)
@@ -188,15 +193,16 @@ G00 Z{z_move}
gcode = """
T{tool}
M5
M6
G00 Z{toolchangez}
(MSG, Change to Tool Dia = {toolC} ||| Tool Probing MACH3)
M0
G00 Z{z_move}
F{fr}
F{feedrate_probe}
G31 Z{z_pdepth}
G92 Z0
G00 Z{z_move}
F{fr_slow}
F{feedrate_probe_slow}
G31 Z{z_pdepth}
G92 Z0
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
@@ -204,8 +210,8 @@ M0
G00 Z{z_move}
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
fr=str(self.feedrate_format %(p.fr_decimals, p.feedrate)),
fr_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate / 2))),
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
feedrate_probe_slow=str(self.feedrate_format % (p.fr_decimals, (p.feedrate_probe / 2))),
z_pdepth=self.coordinate_format % (p.coords_decimals, p.z_pdepth),
tool=int(p.tool),
toolC=toolC_formatted)

View File

@@ -108,17 +108,17 @@ M0
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'M0'
else:
gcode = """
T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
M0""".format(tool=int(p.tool),
M0
""".format(tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'M0'
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
@@ -132,11 +132,11 @@ T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC})
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
M0
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'M0'
else:
gcode = """
T{tool}
@@ -145,7 +145,6 @@ M6
(MSG, Change to Tool Dia = {toolC})
M0""".format(tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'M0'
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)

View File

@@ -43,7 +43,7 @@ class Toolchange_manual(FlatCAMPostProc):
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
gcode += '(Postprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n'
gcode += '(Postprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n'
else:
gcode += '(Postprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n'
@@ -54,6 +54,7 @@ class Toolchange_manual(FlatCAMPostProc):
gcode += ('G20\n' if p.units.upper() == 'IN' else 'G21\n')
gcode += 'G90\n'
gcode += 'G17\n'
gcode += 'G94\n'
return gcode

View File

@@ -103,7 +103,7 @@ G0 X{toolchangex} Y{toolchangey}
T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills})
;MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills}
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
@@ -115,7 +115,7 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange
T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills})
;MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills}
M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
tool=int(p.tool),
t_drills=no_drills,
@@ -132,7 +132,7 @@ G0 X{toolchangex} Y{toolchangey}
T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC})
;MSG, Change to Tool Dia = {toolC}
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
@@ -143,7 +143,7 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange
T{tool}
M5
M6
(MSG, Change to Tool Dia = {toolC})
;MSG, Change to Tool Dia = {toolC}
M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
tool=int(p.tool),
toolC=toolC_formatted)