- added a parameter ('Fast plunge' in Edit -> Preferences -> Geometry Options and Excellon Options) to control if the fast move to Z_move is done or not

This commit is contained in:
Marius Stanciu 2019-01-31 13:58:49 +02:00 committed by Marius
parent 965e7f48ed
commit 3c355f72be
9 changed files with 83 additions and 18 deletions

View File

@ -350,6 +350,7 @@ class App(QtCore.QObject):
"excellon_toolchangez": self.excellon_defaults_form.excellon_opt_group.toolchangez_entry,
"excellon_toolchangexy": self.excellon_defaults_form.excellon_opt_group.toolchangexy_entry,
"excellon_ppname_e": self.excellon_defaults_form.excellon_opt_group.pp_excellon_name_cb,
"excellon_f_plunge": self.excellon_defaults_form.excellon_opt_group.fplunge_cb,
"excellon_startz": self.excellon_defaults_form.excellon_opt_group.estartz_entry,
"excellon_endz": self.excellon_defaults_form.excellon_opt_group.eendz_entry,
"excellon_tooldia": self.excellon_defaults_form.excellon_opt_group.tooldia_entry,
@ -371,6 +372,7 @@ class App(QtCore.QObject):
"geometry_dwell": self.geometry_defaults_form.geometry_opt_group.dwell_cb,
"geometry_dwelltime": self.geometry_defaults_form.geometry_opt_group.dwelltime_entry,
"geometry_ppname_g": self.geometry_defaults_form.geometry_opt_group.pp_geometry_name_cb,
"geometry_f_plunge": self.geometry_defaults_form.geometry_opt_group.fplunge_cb,
"geometry_toolchange": self.geometry_defaults_form.geometry_opt_group.toolchange_cb,
"geometry_toolchangez": self.geometry_defaults_form.geometry_opt_group.toolchangez_entry,
"geometry_toolchangexy": self.geometry_defaults_form.geometry_opt_group.toolchangexy_entry,
@ -521,6 +523,7 @@ class App(QtCore.QObject):
"excellon_startz": None,
"excellon_endz": 2.0,
"excellon_ppname_e": 'default',
"excellon_f_plunge": False,
"excellon_gcode_type": "drills",
"geometry_plot": True,
@ -541,6 +544,7 @@ class App(QtCore.QObject):
"geometry_dwell": False,
"geometry_dwelltime": 1,
"geometry_ppname_g": 'default',
"geometry_f_plunge": False,
"geometry_depthperpass": 0.002,
"geometry_multidepth": False,
"geometry_extracut": False,
@ -654,6 +658,7 @@ class App(QtCore.QObject):
"excellon_toolchangexy": self.excellon_options_form.excellon_opt_group.toolchangexy_entry,
"excellon_tooldia": self.excellon_options_form.excellon_opt_group.tooldia_entry,
"excellon_ppname_e": self.excellon_options_form.excellon_opt_group.pp_excellon_name_cb,
"excellon_f_plunge": self.excellon_options_form.excellon_opt_group.fplunge_cb,
"excellon_startz": self.excellon_options_form.excellon_opt_group.estartz_entry,
"excellon_endz": self.excellon_options_form.excellon_opt_group.eendz_entry,
@ -671,6 +676,7 @@ class App(QtCore.QObject):
"geometry_dwell": self.geometry_options_form.geometry_opt_group.dwell_cb,
"geometry_dwelltime": self.geometry_options_form.geometry_opt_group.dwelltime_entry,
"geometry_ppname_g": self.geometry_options_form.geometry_opt_group.pp_geometry_name_cb,
"geometry_f_plunge": self.geometry_options_form.geometry_opt_group.fplunge_cb,
"geometry_toolchange": self.geometry_options_form.geometry_opt_group.toolchange_cb,
"geometry_toolchangez": self.geometry_options_form.geometry_opt_group.toolchangez_entry,
"geometry_toolchangexy": self.geometry_options_form.geometry_opt_group.toolchangexy_entry,
@ -759,6 +765,7 @@ class App(QtCore.QObject):
"excellon_toolchangexy": "0.0, 0.0",
"excellon_tooldia": 0.016,
"excellon_ppname_e": 'default',
"excellon_f_plunge": False,
"excellon_startz": None,
"excellon_endz": 2.0,
@ -780,6 +787,7 @@ class App(QtCore.QObject):
"geometry_startz": None,
"geometry_endz": 2.0,
"geometry_ppname_g": "default",
"geometry_f_plunge": False,
"geometry_depthperpass": 0.002,
"geometry_multidepth": False,
"geometry_extracut": False,

View File

@ -1972,6 +1972,16 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.pp_excellon_name_cb.setFocusPolicy(Qt.StrongFocus)
grid2.addWidget(self.pp_excellon_name_cb, 12, 1)
fplungelabel = QtWidgets.QLabel('Fast Plunge:')
fplungelabel.setToolTip(
"By checking this, the vertical move from\n"
"Z_Toolchange to Z_move is done with G0,\n"
"meaning the fastest speed available."
)
self.fplunge_cb = FCCheckBox()
grid2.addWidget(fplungelabel, 13, 0)
grid2.addWidget(self.fplunge_cb, 13, 1)
#### Choose what to use for Gcode creation: Drills, Slots or Both
excellon_gcode_type_label = QtWidgets.QLabel('<b>Gcode: </b>')
excellon_gcode_type_label.setToolTip(
@ -1983,8 +1993,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.excellon_gcode_type_radio = RadioSet([{'label': 'Drills', 'value': 'drills'},
{'label': 'Slots', 'value': 'slots'},
{'label': 'Both', 'value': 'both'}])
grid2.addWidget(excellon_gcode_type_label, 13, 0)
grid2.addWidget(self.excellon_gcode_type_radio, 13, 1)
grid2.addWidget(excellon_gcode_type_label, 14, 0)
grid2.addWidget(self.excellon_gcode_type_radio, 14, 1)
# until I decide to implement this feature those remain disabled
excellon_gcode_type_label.setDisabled(True)
@ -2268,6 +2278,17 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
self.pp_geometry_name_cb.setFocusPolicy(Qt.StrongFocus)
grid1.addWidget(self.pp_geometry_name_cb, 16, 1)
# Fast Move from Z Toolchange
fplungelabel = QtWidgets.QLabel('Fast Plunge:')
fplungelabel.setToolTip(
"By checking this, the vertical move from\n"
"Z_Toolchange to Z_move is done with G0,\n"
"meaning the fastest speed available."
)
self.fplunge_cb = FCCheckBox()
grid1.addWidget(fplungelabel, 17, 0)
grid1.addWidget(self.fplunge_cb, 17, 1)
# Size of trace segment on X axis
segx_label = QtWidgets.QLabel("Seg. X size:")
segx_label.setToolTip(
@ -2275,9 +2296,9 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
"Useful for auto-leveling.\n"
"A value of 0 means no segmentation on the X axis."
)
grid1.addWidget(segx_label, 17, 0)
grid1.addWidget(segx_label, 18, 0)
self.segx_entry = FCEntry()
grid1.addWidget(self.segx_entry, 17, 1)
grid1.addWidget(self.segx_entry, 18, 1)
# Size of trace segment on Y axis
segy_label = QtWidgets.QLabel("Seg. Y size:")
@ -2286,9 +2307,9 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
"Useful for auto-leveling.\n"
"A value of 0 means no segmentation on the Y axis."
)
grid1.addWidget(segy_label, 18, 0)
grid1.addWidget(segy_label, 19, 0)
self.segy_entry = FCEntry()
grid1.addWidget(self.segy_entry, 18, 1)
grid1.addWidget(self.segy_entry, 19, 1)
self.layout.addStretch()

View File

@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
=================================================
31.01.2019
- added a parameter ('Fast plunge' in Edit -> Preferences -> Geometry Options and Excellon Options) to control if the fast move to Z_move is done or not
30.01.2019
- added a space before Y coordinate in end_code() function in some of the postprocessor files

View File

@ -4415,6 +4415,9 @@ class CNCjob(Geometry):
self.pp_excellon_name = pp_excellon_name
self.pp_excellon = self.app.postprocessors[self.pp_excellon_name]
# Controls if the move from Z_Toolchange to Z_Move is done fast with G0 or normally with G1
self.f_plunge = None
self.spindlespeed = spindlespeed
self.dwell = dwell
self.dwelltime = dwelltime
@ -4595,10 +4598,11 @@ class CNCjob(Geometry):
self.gcode = []
# Basic G-Code macros
self.pp_excellon = self.app.postprocessors[self.pp_excellon_name]
p = self.pp_excellon
self.f_plunge = self.app.defaults["excellon_f_plunge"]
# Initialization
gcode = self.doformat(p.start_code)
gcode += self.doformat(p.feedrate_code)
@ -4931,6 +4935,7 @@ class CNCjob(Geometry):
pass
self.pp_geometry_name = pp_geometry_name if pp_geometry_name else 'default'
self.f_plunge = self.app.defaults["geometry_f_plunge"]
if self.z_cut > 0:
self.app.inform.emit("[warning] The Cut Z parameter has positive value. "
@ -5124,6 +5129,7 @@ class CNCjob(Geometry):
pass
self.pp_geometry_name = pp_geometry_name if pp_geometry_name else 'default'
self.f_plunge = self.app.defaults["geometry_f_plunge"]
if self.z_cut > 0:
self.app.inform.emit("[warning] The Cut Z parameter has positive value. "

View File

@ -67,6 +67,7 @@ class default(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@ -111,8 +112,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@ -138,7 +139,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@ -66,6 +66,7 @@ class grbl_11(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@ -111,7 +112,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@ -137,7 +139,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@ -74,6 +74,7 @@ class line_xyz(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@ -101,7 +102,7 @@ class line_xyz(FlatCAMPostProc):
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
return """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
T{tool}
M5
M6
@ -112,8 +113,15 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex)
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
if f_plunge is True:
gcode += """\nG00 X{toolchangex} Y{toolchangey} Z{z_move}""".format(
toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
return gcode
else:
return """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
T{tool}
M5
M6
@ -124,6 +132,13 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex)
tool=int(p.tool),
toolC=toolC_formatted)
if f_plunge is True:
gcode += """\nG00 X{toolchangex} Y{toolchangey} Z{z_move}""".format(
toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
return gcode
def up_to_zero_code(self, p):
g = 'G01 ' + 'X' + self.coordinate_format % (p.coords_decimals, p.x) + \
' Y' + self.coordinate_format % (p.coords_decimals, p.y) + \

View File

@ -65,6 +65,7 @@ class manual_toolchange(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@ -123,7 +124,8 @@ M0
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@ -157,7 +159,8 @@ M0
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@ -67,6 +67,7 @@ class marlin(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@ -112,7 +113,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G0 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG0 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@ -138,7 +140,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G0 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG0 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):