From f01ac4483ad3391cd7f1ed66e14832f17a4f474d Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 10 Feb 2019 13:42:22 +0200 Subject: [PATCH] - adjusted the postprocessor files so the Spindle Off command (M5) is done before the move to Toolchange Z - adjusted the Toolchange Manual postprocessor file to have more descriptive messages on the toolchange event --- README.md | 3 +- postprocessors/Toolchange_Probe_MACH3.py | 10 +++---- postprocessors/Toolchange_Probe_general.py | 8 +++--- postprocessors/Toolchange_manual.py | 32 +++++++++++++++------- postprocessors/default.py | 20 ++++++++------ postprocessors/grbl_11.py | 26 ++++++++++-------- postprocessors/line_xyz.py | 10 ++++--- postprocessors/marlin.py | 20 ++++++++------ 8 files changed, 78 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index b3c2a8cb..2a4595a1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ CAD program, and create G-Code for Isolation routing. - the SELECTED type of messages are no longer printed to shell from 2 reasons: first, too much spam and second, issue with displaying html - on set_zero function and creation of new geometry or new excellon there is no longer a zoom fit - repurposed shortcut key 'Delete' to delete tools in tooltable when the mouse is over the Seleted tab (with Geometry inside) or in Tools tab (when NCC Tool or Paint Tool is inside). Or in Excellon Editor when mouse is hovering the Selected tab selecting a tool, 'Delete' key will delete that tool, if on canvas 'Delete' key will delete a selected shape (drill). In rest, will delete selected objects. - +- adjusted the postprocessor files so the Spindle Off command (M5) is done before the move to Toolchange Z +- adjusted the Toolchange Manual postprocessor file to have more descriptive messages on the toolchange event 9.02.2019 diff --git a/postprocessors/Toolchange_Probe_MACH3.py b/postprocessors/Toolchange_Probe_MACH3.py index 0ce20de1..e77a40f5 100644 --- a/postprocessors/Toolchange_Probe_MACH3.py +++ b/postprocessors/Toolchange_Probe_MACH3.py @@ -98,9 +98,9 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc): no_drills = i[2] if toolchangexy is not None: - gcode = """ + gcode = """ +M5 T{tool} -M5 M6 G00 Z{toolchangez} G00 X{toolchangex} Y{toolchangey} @@ -129,8 +129,8 @@ G00 Z{z_move} toolC=toolC_formatted) else: gcode = """ -T{tool} M5 +T{tool} M6 G00 Z{toolchangez} (MSG, Change to Tool Dia = {toolC} ||| Drills for this tool = {t_drills} ||| Tool Probing MACH3) @@ -162,8 +162,8 @@ G00 Z{z_move} else: if toolchangexy is not None: gcode = """ -T{tool} M5 +T{tool} M6 G00 Z{toolchangez} G00 X{toolchangex} Y{toolchangey} @@ -191,8 +191,8 @@ G00 Z{z_move} toolC=toolC_formatted) else: gcode = """ -T{tool} M5 +T{tool} M6 G00 Z{toolchangez} (MSG, Change to Tool Dia = {toolC} ||| Tool Probing MACH3) diff --git a/postprocessors/Toolchange_Probe_general.py b/postprocessors/Toolchange_Probe_general.py index a676476d..829294bf 100644 --- a/postprocessors/Toolchange_Probe_general.py +++ b/postprocessors/Toolchange_Probe_general.py @@ -97,9 +97,9 @@ class Toolchange_Probe_general(FlatCAMPostProc): if toolchangexy is not None: gcode = """ +M5 G00 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0 @@ -111,8 +111,8 @@ M0 else: gcode = """ -T{tool} M5 +T{tool} M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0 @@ -127,9 +127,9 @@ M0 else: if toolchangexy is not None: gcode = """ +M5 G00 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC}) M0 @@ -139,8 +139,8 @@ M0 toolC=toolC_formatted) else: gcode = """ -T{tool} M5 +T{tool} M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(tool=int(p.tool), diff --git a/postprocessors/Toolchange_manual.py b/postprocessors/Toolchange_manual.py index f708ab3d..019f044d 100644 --- a/postprocessors/Toolchange_manual.py +++ b/postprocessors/Toolchange_manual.py @@ -100,15 +100,18 @@ class Toolchange_manual(FlatCAMPostProc): no_drills = i[2] if toolchangexy is not None: - gcode = """G00 Z{toolchangez} -T{tool} -M5 + gcode = """ +M5 +G00 Z{toolchangez} +T{tool} G00 X{toolchangex} Y{toolchangey} (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0 G01 Z0 +(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.) M0 G00 Z{toolchangez} +(MSG, Now the tool can be tightened more securely.) M0 """.format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex), toolchangey=self.coordinate_format%(p.coords_decimals, toolchangey), @@ -118,14 +121,17 @@ M0 toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} -T{tool} -M5 + gcode = """ +M5 +G00 Z{toolchangez} +T{tool} (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0 G01 Z0 +(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.) M0 G00 Z{toolchangez} +(MSG, Now the tool can be tightened more securely.) M0 """.format( toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez), @@ -139,15 +145,18 @@ M0 else: if toolchangexy is not None: - gcode = """G00 Z{toolchangez} -T{tool} + gcode = """ M5 +G00 Z{toolchangez} +T{tool} G00 X{toolchangex}Y{toolchangey} (MSG, Change to Tool Dia = {toolC}) M0 G01 Z0 +(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.) M0 G00 Z{toolchangez} +(MSG, Now the tool can be tightened more securely.) M0 """.format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex), toolchangey=self.coordinate_format%(p.coords_decimals, toolchangey), @@ -155,14 +164,17 @@ M0 tool=int(p.tool), toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} -T{tool} + gcode = """ M5 +G00 Z{toolchangez} +T{tool} (MSG, Change to Tool Dia = {toolC}) M0 G01 Z0 +(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.) M0 G00 Z{toolchangez} +(MSG, Now the tool can be tightened more securely.) M0 """.format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez), tool=int(p.tool), diff --git a/postprocessors/default.py b/postprocessors/default.py index 7441bc44..b944b1ab 100644 --- a/postprocessors/default.py +++ b/postprocessors/default.py @@ -98,10 +98,11 @@ class default(FlatCAMPostProc): no_drills = i[2] if toolchangexy is not None: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} G00 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), @@ -111,9 +112,10 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange t_drills=no_drills, toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez), @@ -126,10 +128,11 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange else: if toolchangexy is not None: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} G00 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), @@ -138,9 +141,10 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange tool=int(p.tool), toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} -T{tool} + gcode = """ M5 +G00 Z{toolchangez} +T{tool} M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez), diff --git a/postprocessors/grbl_11.py b/postprocessors/grbl_11.py index 5470760f..09aac50c 100644 --- a/postprocessors/grbl_11.py +++ b/postprocessors/grbl_11.py @@ -97,10 +97,11 @@ class grbl_11(FlatCAMPostProc): no_drills = i[2] if toolchangexy is not None: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} G00 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), @@ -110,9 +111,10 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange t_drills=no_drills, toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez), @@ -126,11 +128,12 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange else: if toolchangexy is not None: - gcode = """G00 Z{toolchangez} -G00 X{toolchangex} Y{toolchangey} + gcode = """ +M5 +G00 Z{toolchangez} +G00 X{toolchangex} Y{toolchangey} T{tool} -M5 -M6 +M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey), @@ -138,10 +141,11 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange tool=int(p.tool), toolC=toolC_formatted) else: - gcode = """G00 Z{toolchangez} + gcode = """ +M5 +G00 Z{toolchangez} T{tool} -M5 -M6 +M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez), tool=int(p.tool), diff --git a/postprocessors/line_xyz.py b/postprocessors/line_xyz.py index a9db9a23..b6fb06a6 100644 --- a/postprocessors/line_xyz.py +++ b/postprocessors/line_xyz.py @@ -110,9 +110,10 @@ class line_xyz(FlatCAMPostProc): for i in p['options']['Tools_in_use']: if i[0] == p.tool: no_drills = i[2] - gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez} + gcode = """ +M5 +G00 X{toolchangex} Y{toolchangey} Z{toolchangez} T{tool} -M5 M6 (MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills}) M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex), @@ -129,9 +130,10 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex) z_move=self.coordinate_format % (p.coords_decimals, p.z_move)) return gcode else: - gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez} -T{tool} + gcode = """ M5 +G00 X{toolchangex} Y{toolchangey} Z{toolchangez} +T{tool} M6 (MSG, Change to Tool Dia = {toolC}) M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex), diff --git a/postprocessors/marlin.py b/postprocessors/marlin.py index 194e535c..0f18fd39 100644 --- a/postprocessors/marlin.py +++ b/postprocessors/marlin.py @@ -98,10 +98,11 @@ class marlin(FlatCAMPostProc): no_drills = i[2] if toolchangexy is not None: - gcode = """G0 Z{toolchangez} + gcode = """ +M5 +G0 Z{toolchangez} G0 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 ;MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills} M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), @@ -111,9 +112,10 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange t_drills=no_drills, toolC=toolC_formatted) else: - gcode = """G0 Z{toolchangez} -T{tool} + gcode = """ M5 +G0 Z{toolchangez} +T{tool} M6 ;MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills} M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez), @@ -127,10 +129,11 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange else: if toolchangexy is not None: - gcode = """G0 Z{toolchangez} + gcode = """ +M5 +G0 Z{toolchangez} G0 X{toolchangex} Y{toolchangey} T{tool} -M5 M6 ;MSG, Change to Tool Dia = {toolC} M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex), @@ -139,9 +142,10 @@ M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchange tool=int(p.tool), toolC=toolC_formatted) else: - gcode = """G0 Z{toolchangez} -T{tool} + gcode = """ M5 +G0 Z{toolchangez} +T{tool} M6 ;MSG, Change to Tool Dia = {toolC} M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),