From ede907a8041af1a84337a5b60d6e5d363aeb05f1 Mon Sep 17 00:00:00 2001 From: CMorley Date: Fri, 22 Jul 2022 22:37:49 -0700 Subject: [PATCH 1/7] interpeter - add INI paremeters to set peck distance/count peck distance for g73/g83 peck count for g73 g73 does short pecks to break chips. If count is >0, it will fully retract to clear chips every 'count' number of pecks [RS274NGC] PARAMETER_DRILL_CYCLE_CHIP_BREAK_DISTANCE = .020 PARAMETER_G73_PECK_TILL_CLEAR_COUNT = 2 --- src/emc/rs274ngc/interp_cycles.cc | 13 +++++++++---- src/emc/rs274ngc/interp_internal.hh | 2 ++ src/emc/rs274ngc/rs274ngc_pre.cc | 7 +++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/emc/rs274ngc/interp_cycles.cc b/src/emc/rs274ngc/interp_cycles.cc index 1c677764649..49c60c4f33d 100644 --- a/src/emc/rs274ngc/interp_cycles.cc +++ b/src/emc/rs274ngc/interp_cycles.cc @@ -154,7 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = G83_RAPID_DELTA; + rapid_delta = _setup.parameter_drill_cycle_chip_break_distance; if (_setup.length_units == CANON_UNITS_MM) rapid_delta = (rapid_delta * 25.4); @@ -212,19 +212,24 @@ int Interp::convert_cycle_g73(block_pointer block, { double current_depth; double rapid_delta; - + int count = 0; /* Moved the check for negative Q values here as a sign may be used with user defined M functions Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = G83_RAPID_DELTA; + rapid_delta = _setup.parameter_drill_cycle_chip_break_distance; if (_setup.length_units == CANON_UNITS_MM) rapid_delta = (rapid_delta * 25.4); for (current_depth = (r - delta); - current_depth > bottom_z; current_depth = (current_depth - delta)) { + current_depth > bottom_z; current_depth = (current_depth - delta)) { + count ++; cycle_feed(block, plane, x, y, current_depth); + if (count == _setup.parameter_g73_peck_till_clear_count) { + cycle_traverse(block, plane, x, y, r); + count = 0; + } cycle_traverse(block, plane, x, y, current_depth + rapid_delta); } cycle_feed(block, plane, x, y, bottom_z); diff --git a/src/emc/rs274ngc/interp_internal.hh b/src/emc/rs274ngc/interp_internal.hh index a6aeda5bd37..3cfb4747e41 100644 --- a/src/emc/rs274ngc/interp_internal.hh +++ b/src/emc/rs274ngc/interp_internal.hh @@ -792,6 +792,8 @@ struct setup int tool_change_at_g30; int tool_change_quill_up; int tool_change_with_spindle_on; + double parameter_drill_cycle_chip_break_distance; + int parameter_g73_peck_till_clear_count; int a_axis_wrapped; int b_axis_wrapped; int c_axis_wrapped; diff --git a/src/emc/rs274ngc/rs274ngc_pre.cc b/src/emc/rs274ngc/rs274ngc_pre.cc index 0648ef32440..6b09fe34663 100644 --- a/src/emc/rs274ngc/rs274ngc_pre.cc +++ b/src/emc/rs274ngc/rs274ngc_pre.cc @@ -839,6 +839,8 @@ int Interp::init() _setup.tool_change_at_g30 = 0; _setup.tool_change_quill_up = 0; _setup.tool_change_with_spindle_on = 0; + _setup.parameter_drill_cycle_chip_break_distance = .010; + _setup.parameter_g73_peck_till_clear_count = 0; _setup.a_axis_wrapped = 0; _setup.b_axis_wrapped = 0; _setup.c_axis_wrapped = 0; @@ -907,6 +909,11 @@ int Interp::init() _setup.c_indexer_jnum = atol(inistring); } inifile.Find(&_setup.orient_offset, "ORIENT_OFFSET", "RS274NGC"); + inifile.Find(&_setup.parameter_drill_cycle_chip_break_distance, "PARAMETER_DRILL_CYCLE_CHIP_BREAK_DISTANCE", "RS274NGC"); + if(NULL != (inistring = inifile.Find("PARAMETER_G73_PECK_TILL_CLEAR_COUNT", "RS274NGC"))) + { + _setup.parameter_g73_peck_till_clear_count = atoi(inistring); + } inifile.Find(&_setup.debugmask, "DEBUG", "EMC"); From 37beadead14e5602201bb5b182a83fc806a1d328 Mon Sep 17 00:00:00 2001 From: CMorley Date: Fri, 29 Jul 2022 19:05:46 -0700 Subject: [PATCH 2/7] task -use separate settings for g83/g73, drop peck/full retract option --- src/emc/rs274ngc/interp_cycles.cc | 14 ++------------ src/emc/rs274ngc/interp_internal.hh | 7 ++----- src/emc/rs274ngc/rs274ngc_pre.cc | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/emc/rs274ngc/interp_cycles.cc b/src/emc/rs274ngc/interp_cycles.cc index 49c60c4f33d..d988da65d99 100644 --- a/src/emc/rs274ngc/interp_cycles.cc +++ b/src/emc/rs274ngc/interp_cycles.cc @@ -154,9 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_drill_cycle_chip_break_distance; - if (_setup.length_units == CANON_UNITS_MM) - rapid_delta = (rapid_delta * 25.4); + rapid_delta = _setup.parameter_g83_peck_clearence;; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { @@ -212,24 +210,16 @@ int Interp::convert_cycle_g73(block_pointer block, { double current_depth; double rapid_delta; - int count = 0; /* Moved the check for negative Q values here as a sign may be used with user defined M functions Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_drill_cycle_chip_break_distance; - if (_setup.length_units == CANON_UNITS_MM) - rapid_delta = (rapid_delta * 25.4); + rapid_delta = _setup.parameter_g73_peck_clearence; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { - count ++; cycle_feed(block, plane, x, y, current_depth); - if (count == _setup.parameter_g73_peck_till_clear_count) { - cycle_traverse(block, plane, x, y, r); - count = 0; - } cycle_traverse(block, plane, x, y, current_depth + rapid_delta); } cycle_feed(block, plane, x, y, bottom_z); diff --git a/src/emc/rs274ngc/interp_internal.hh b/src/emc/rs274ngc/interp_internal.hh index 3cfb4747e41..6018fb1c0e2 100644 --- a/src/emc/rs274ngc/interp_internal.hh +++ b/src/emc/rs274ngc/interp_internal.hh @@ -50,9 +50,6 @@ inline int round_to_int(T x) { return (int)std::nearbyint(x); } -/* how far above hole bottom for rapid return, in inches */ -#define G83_RAPID_DELTA 0.010 - /* nested remap: a remapped code is found in the body of a subroutine * which is executing on behalf of another remapped code * example: a user G-code command executes a tool change @@ -792,8 +789,8 @@ struct setup int tool_change_at_g30; int tool_change_quill_up; int tool_change_with_spindle_on; - double parameter_drill_cycle_chip_break_distance; - int parameter_g73_peck_till_clear_count; + double parameter_g73_peck_clearence; + double parameter_g83_peck_clearence; int a_axis_wrapped; int b_axis_wrapped; int c_axis_wrapped; diff --git a/src/emc/rs274ngc/rs274ngc_pre.cc b/src/emc/rs274ngc/rs274ngc_pre.cc index 6b09fe34663..4cd5808c31f 100644 --- a/src/emc/rs274ngc/rs274ngc_pre.cc +++ b/src/emc/rs274ngc/rs274ngc_pre.cc @@ -833,14 +833,20 @@ int Interp::init() INIT_CANON(); iniFileName = getenv("INI_FILE_NAME"); - + _setup.length_units = GET_EXTERNAL_LENGTH_UNIT_TYPE(); + // the default log file _setup.loggingLevel = 0; _setup.tool_change_at_g30 = 0; _setup.tool_change_quill_up = 0; _setup.tool_change_with_spindle_on = 0; - _setup.parameter_drill_cycle_chip_break_distance = .010; - _setup.parameter_g73_peck_till_clear_count = 0; + if (_setup.length_units == CANON_UNITS_INCHES) { + _setup.parameter_g73_peck_clearence = .050; + _setup.parameter_g83_peck_clearence = .050; + } else{ + _setup.parameter_g73_peck_clearence = 1; + _setup.parameter_g83_peck_clearence = 1; + } _setup.a_axis_wrapped = 0; _setup.b_axis_wrapped = 0; _setup.c_axis_wrapped = 0; @@ -909,11 +915,8 @@ int Interp::init() _setup.c_indexer_jnum = atol(inistring); } inifile.Find(&_setup.orient_offset, "ORIENT_OFFSET", "RS274NGC"); - inifile.Find(&_setup.parameter_drill_cycle_chip_break_distance, "PARAMETER_DRILL_CYCLE_CHIP_BREAK_DISTANCE", "RS274NGC"); - if(NULL != (inistring = inifile.Find("PARAMETER_G73_PECK_TILL_CLEAR_COUNT", "RS274NGC"))) - { - _setup.parameter_g73_peck_till_clear_count = atoi(inistring); - } + inifile.Find(&_setup.parameter_g73_peck_clearence, "PARAMETER_G73_PECK_CLEARENCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g83_peck_clearence, "PARAMETER_G83_PECK_CLEARENCE", "RS274NGC"); inifile.Find(&_setup.debugmask, "DEBUG", "EMC"); @@ -1082,7 +1085,6 @@ int Interp::init() } } - _setup.length_units = GET_EXTERNAL_LENGTH_UNIT_TYPE(); USE_LENGTH_UNITS(_setup.length_units); GET_EXTERNAL_PARAMETER_FILE_NAME(filename, LINELEN); if (filename[0] == 0) From b466e8b92d76d18bf22be1a727df13903dd2181a Mon Sep 17 00:00:00 2001 From: CMorley Date: Fri, 29 Jul 2022 19:06:53 -0700 Subject: [PATCH 3/7] task -add g73/83 peck clearence settings to python remap code --- src/emc/rs274ngc/interpmodule.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/emc/rs274ngc/interpmodule.cc b/src/emc/rs274ngc/interpmodule.cc index 169d3aa8f42..cb61307c07e 100644 --- a/src/emc/rs274ngc/interpmodule.cc +++ b/src/emc/rs274ngc/interpmodule.cc @@ -810,12 +810,24 @@ static inline int get_tool_change_quill_up (Interp &interp) { static inline void set_tool_change_quill_up(Interp &interp, int value) { interp._setup.tool_change_quill_up = value; } -static inline int get_tool_change_with_spindle_on (Interp &interp) { +static inline int get_tool_change_with_spindle_on(Interp &interp) { return interp._setup.tool_change_with_spindle_on; } static inline void set_tool_change_with_spindle_on(Interp &interp, int value) { interp._setup.tool_change_with_spindle_on = value; } +static inline double get_parameter_g73_peck_clearence (Interp &interp) { + return interp._setup.parameter_g73_peck_clearence; +} +static inline void set_parameter_g73_peck_clearence(Interp &interp, double value) { + interp._setup.parameter_g73_peck_clearence = value; +} +static inline double get_parameter_g83_peck_clearence (Interp &interp) { + return interp._setup.parameter_g83_peck_clearence; +} +static inline void set_parameter_g83_peck_clearence(Interp &interp, double value) { + interp._setup.parameter_g83_peck_clearence = value; +} BOOST_PYTHON_MODULE(interpreter) { using namespace boost::python; @@ -1008,6 +1020,8 @@ BOOST_PYTHON_MODULE(interpreter) { .add_property("tool_change_quill_up", &get_tool_change_quill_up, &set_tool_change_quill_up) .add_property("tool_change_with_spindle_on", &get_tool_change_with_spindle_on, &set_tool_change_with_spindle_on) + .add_property("parameter_g73_peck_clearence", &get_parameter_g73_peck_clearence, &set_parameter_g73_peck_clearence) + .add_property("parameter_g83_peck_clearence", &get_parameter_g83_peck_clearence, &set_parameter_g83_peck_clearence) .add_property( "params", bp::make_function( ¶m_wrapper, From 6c4fcf7b5d7de119a1173575cd199bb1ee9971ca Mon Sep 17 00:00:00 2001 From: CMorley Date: Sat, 20 May 2023 14:33:01 -0700 Subject: [PATCH 4/7] fix spelling mistake --- src/emc/rs274ngc/interp_cycles.cc | 4 ++-- src/emc/rs274ngc/interp_internal.hh | 4 ++-- src/emc/rs274ngc/interpmodule.cc | 20 ++++++++++---------- src/emc/rs274ngc/rs274ngc_pre.cc | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/emc/rs274ngc/interp_cycles.cc b/src/emc/rs274ngc/interp_cycles.cc index d988da65d99..363a5337c6d 100644 --- a/src/emc/rs274ngc/interp_cycles.cc +++ b/src/emc/rs274ngc/interp_cycles.cc @@ -154,7 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_g83_peck_clearence;; + rapid_delta = _setup.parameter_g83_peck_clearance;; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { @@ -215,7 +215,7 @@ int Interp::convert_cycle_g73(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_g73_peck_clearence; + rapid_delta = _setup.parameter_g73_peck_clearance; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { diff --git a/src/emc/rs274ngc/interp_internal.hh b/src/emc/rs274ngc/interp_internal.hh index 6018fb1c0e2..d3c51cd80ab 100644 --- a/src/emc/rs274ngc/interp_internal.hh +++ b/src/emc/rs274ngc/interp_internal.hh @@ -789,8 +789,8 @@ struct setup int tool_change_at_g30; int tool_change_quill_up; int tool_change_with_spindle_on; - double parameter_g73_peck_clearence; - double parameter_g83_peck_clearence; + double parameter_g73_peck_clearance; + double parameter_g83_peck_clearance; int a_axis_wrapped; int b_axis_wrapped; int c_axis_wrapped; diff --git a/src/emc/rs274ngc/interpmodule.cc b/src/emc/rs274ngc/interpmodule.cc index cb61307c07e..a8773e0592a 100644 --- a/src/emc/rs274ngc/interpmodule.cc +++ b/src/emc/rs274ngc/interpmodule.cc @@ -816,17 +816,17 @@ static inline int get_tool_change_with_spindle_on(Interp &interp) { static inline void set_tool_change_with_spindle_on(Interp &interp, int value) { interp._setup.tool_change_with_spindle_on = value; } -static inline double get_parameter_g73_peck_clearence (Interp &interp) { - return interp._setup.parameter_g73_peck_clearence; +static inline double get_parameter_g73_peck_clearance (Interp &interp) { + return interp._setup.parameter_g73_peck_clearance; } -static inline void set_parameter_g73_peck_clearence(Interp &interp, double value) { - interp._setup.parameter_g73_peck_clearence = value; +static inline void set_parameter_g73_peck_clearance(Interp &interp, double value) { + interp._setup.parameter_g73_peck_clearance = value; } -static inline double get_parameter_g83_peck_clearence (Interp &interp) { - return interp._setup.parameter_g83_peck_clearence; +static inline double get_parameter_g83_peck_clearance (Interp &interp) { + return interp._setup.parameter_g83_peck_clearance; } -static inline void set_parameter_g83_peck_clearence(Interp &interp, double value) { - interp._setup.parameter_g83_peck_clearence = value; +static inline void set_parameter_g83_peck_clearance(Interp &interp, double value) { + interp._setup.parameter_g83_peck_clearance = value; } BOOST_PYTHON_MODULE(interpreter) { @@ -1020,8 +1020,8 @@ BOOST_PYTHON_MODULE(interpreter) { .add_property("tool_change_quill_up", &get_tool_change_quill_up, &set_tool_change_quill_up) .add_property("tool_change_with_spindle_on", &get_tool_change_with_spindle_on, &set_tool_change_with_spindle_on) - .add_property("parameter_g73_peck_clearence", &get_parameter_g73_peck_clearence, &set_parameter_g73_peck_clearence) - .add_property("parameter_g83_peck_clearence", &get_parameter_g83_peck_clearence, &set_parameter_g83_peck_clearence) + .add_property("parameter_g73_peck_clearance", &get_parameter_g73_peck_clearance, &set_parameter_g73_peck_clearance) + .add_property("parameter_g83_peck_clearance", &get_parameter_g83_peck_clearance, &set_parameter_g83_peck_clearance) .add_property( "params", bp::make_function( ¶m_wrapper, diff --git a/src/emc/rs274ngc/rs274ngc_pre.cc b/src/emc/rs274ngc/rs274ngc_pre.cc index 4cd5808c31f..fc378375d35 100644 --- a/src/emc/rs274ngc/rs274ngc_pre.cc +++ b/src/emc/rs274ngc/rs274ngc_pre.cc @@ -841,11 +841,11 @@ int Interp::init() _setup.tool_change_quill_up = 0; _setup.tool_change_with_spindle_on = 0; if (_setup.length_units == CANON_UNITS_INCHES) { - _setup.parameter_g73_peck_clearence = .050; - _setup.parameter_g83_peck_clearence = .050; + _setup.parameter_g73_peck_clearance = .050; + _setup.parameter_g83_peck_clearance = .050; } else{ - _setup.parameter_g73_peck_clearence = 1; - _setup.parameter_g83_peck_clearence = 1; + _setup.parameter_g73_peck_clearance = 1; + _setup.parameter_g83_peck_clearance = 1; } _setup.a_axis_wrapped = 0; _setup.b_axis_wrapped = 0; @@ -915,8 +915,8 @@ int Interp::init() _setup.c_indexer_jnum = atol(inistring); } inifile.Find(&_setup.orient_offset, "ORIENT_OFFSET", "RS274NGC"); - inifile.Find(&_setup.parameter_g73_peck_clearence, "PARAMETER_G73_PECK_CLEARENCE", "RS274NGC"); - inifile.Find(&_setup.parameter_g83_peck_clearence, "PARAMETER_G83_PECK_CLEARENCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g73_peck_clearance, "PARAMETER_G73_PECK_CLEARANCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g83_peck_clearance, "PARAMETER_G83_PECK_CLEARANCE", "RS274NGC"); inifile.Find(&_setup.debugmask, "DEBUG", "EMC"); From 3b6f309c16544fe860e515c499d97813992c2c3c Mon Sep 17 00:00:00 2001 From: CMorley Date: Sat, 20 May 2023 15:01:54 -0700 Subject: [PATCH 5/7] docs -add PARAMETER_G73_PECK_CLEARANCE, PARAMETER_G83_PECK_CLEARANCE --- docs/src/config/ini-config.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/config/ini-config.adoc b/docs/src/config/ini-config.adoc index 0d018b9ec23..ef12e5f59b8 100644 --- a/docs/src/config/ini-config.adoc +++ b/docs/src/config/ini-config.adoc @@ -541,7 +541,11 @@ The maximum number of `USER_M_PATH` directories is defined at compile time (typ: Allow to clear the G92 offset automatically when config start-up. * `DISABLE_FANUC_STYLE_SUB = 0` (Default: 0) If there is reason to disable Fanuc subroutines set it to 1. - +* 'PARAMETER_G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) + Chip breaking back-off distance in machine units +* 'PARAMETER_G83_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) + Clearance distance from last feed depth when machine rapids back to bottom of hole, in machine units. + [NOTE] ==== The above six options were controlled by the `FEATURES` bitmask in versions of LinuxCNC prior to 2.8. From ae9310497e102267863da58f154f2845429a5076 Mon Sep 17 00:00:00 2001 From: Rene Hopf Date: Sun, 18 Jun 2023 18:53:46 +0200 Subject: [PATCH 6/7] add optional p word for peck clearance to G73 and G83 --- docs/src/gcode/g-code.adoc | 9 +++++---- src/emc/rs274ngc/interp_cycles.cc | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/src/gcode/g-code.adoc b/docs/src/gcode/g-code.adoc index 7354804b640..bdedb8a26a3 100644 --- a/docs/src/gcode/g-code.adoc +++ b/docs/src/gcode/g-code.adoc @@ -1757,7 +1757,7 @@ It is an error if: [source,{ngc}] ---- -G73 X- Y- Z- R- Q- +G73 X- Y- Z- R- Q- P- ---- * 'R' - retract position along the Z axis. @@ -1766,7 +1766,7 @@ G73 X- Y- Z- R- Q- The 'G73' cycle is drilling or milling with chip breaking. This cycle takes a Q number which represents a 'delta' increment along -the Z axis. +the Z axis. Peck clearance can be specified by optional P number. * Preliminary motion. ** If the current Z position is below the R position, The Z axis does @@ -2371,7 +2371,7 @@ seconds at the bottom of the hole. [source,{ngc}] ---- -G83 (X- Y- Z-) or (U- V- W-) R- L- Q- +G83 (X- Y- Z-) or (U- V- W-) R- L- Q- P- ---- The 'G83' cycle (often called peck drilling) is intended for deep @@ -2381,7 +2381,8 @@ drilling in aluminum). This cycle takes a Q number which represents a 'delta' increment along the Z-axis. The retract before final depth will always be to the 'retract' plane even if G98 is in effect. The final retract will honor the G98/99 in effect. G83 functions the same as G81 -with the addition of retracts during the drilling operation. +with the addition of retracts during the drilling operation. Peck clearance +can be specified by optional P number. * Preliminary motion, as described in the <> section. diff --git a/src/emc/rs274ngc/interp_cycles.cc b/src/emc/rs274ngc/interp_cycles.cc index 363a5337c6d..064ed1301b1 100644 --- a/src/emc/rs274ngc/interp_cycles.cc +++ b/src/emc/rs274ngc/interp_cycles.cc @@ -154,7 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_g83_peck_clearance;; + rapid_delta = block->p_flag?block->p_number:_setup.parameter_g83_peck_clearance; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { @@ -215,7 +215,7 @@ int Interp::convert_cycle_g73(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = _setup.parameter_g73_peck_clearance; + rapid_delta = block->p_flag?block->p_number:_setup.parameter_g73_peck_clearance; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { From cb85b838292883c169c1d4ae845061ab69fa8fe5 Mon Sep 17 00:00:00 2001 From: andypugh Date: Sun, 18 Jan 2026 23:19:29 +0000 Subject: [PATCH 7/7] Swap the controlling G-code letter from P to D, shorten INI entries. The G-code letter has been changed from P to D to allow potential future use of P for "Pause". The word "PARAMETER" has been removed from the INI entries. (what else would they be but parameters?) --- docs/src/config/ini-config.adoc | 4 ++-- docs/src/gcode/g-code.adoc | 17 +++++++++-------- src/emc/rs274ngc/interp_cycles.cc | 4 ++-- src/emc/rs274ngc/rs274ngc_pre.cc | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/src/config/ini-config.adoc b/docs/src/config/ini-config.adoc index ef12e5f59b8..3a7d6727a10 100644 --- a/docs/src/config/ini-config.adoc +++ b/docs/src/config/ini-config.adoc @@ -541,9 +541,9 @@ The maximum number of `USER_M_PATH` directories is defined at compile time (typ: Allow to clear the G92 offset automatically when config start-up. * `DISABLE_FANUC_STYLE_SUB = 0` (Default: 0) If there is reason to disable Fanuc subroutines set it to 1. -* 'PARAMETER_G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) +* 'G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) Chip breaking back-off distance in machine units -* 'PARAMETER_G83_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) +* 'G83_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) Clearance distance from last feed depth when machine rapids back to bottom of hole, in machine units. [NOTE] diff --git a/docs/src/gcode/g-code.adoc b/docs/src/gcode/g-code.adoc index bdedb8a26a3..48813d2082b 100644 --- a/docs/src/gcode/g-code.adoc +++ b/docs/src/gcode/g-code.adoc @@ -1757,7 +1757,7 @@ It is an error if: [source,{ngc}] ---- -G73 X- Y- Z- R- Q- P- +G73 X- Y- Z- R- Q- D- ---- * 'R' - retract position along the Z axis. @@ -1766,7 +1766,7 @@ G73 X- Y- Z- R- Q- P- The 'G73' cycle is drilling or milling with chip breaking. This cycle takes a Q number which represents a 'delta' increment along -the Z axis. Peck clearance can be specified by optional P number. +the Z axis. Peck clearance can be specified by optional D number. * Preliminary motion. ** If the current Z position is below the R position, The Z axis does @@ -1774,7 +1774,7 @@ the Z axis. Peck clearance can be specified by optional P number. ** Move to the X Y coordinates * Move the Z-axis only at the current <> downward by delta or to the Z position, whichever is less deep. -* Rapid up .010 of an inch or 0.254 mm. +* Rapid up either the D value or the default of .010 of an inch or 0.254 mm. * Repeat steps 2 and 3 until the Z position is reached at step 2. * The Z axis does a rapid move to the R position. @@ -2371,25 +2371,26 @@ seconds at the bottom of the hole. [source,{ngc}] ---- -G83 (X- Y- Z-) or (U- V- W-) R- L- Q- P- +G83 (X- Y- Z-) or (U- V- W-) R- L- Q- D- ---- The 'G83' cycle (often called peck drilling) is intended for deep -drilling ormilling with chip breaking. The retracts in this cycle clear +drilling or milling with chip breaking. The retracts in this cycle clear the hole of chips and cut off any long stringers (which are common when drilling in aluminum). This cycle takes a Q number which represents a 'delta' increment along the Z-axis. The retract before final depth will always be to the 'retract' plane even if G98 is in effect. The final retract will honor the G98/99 in effect. G83 functions the same as G81 -with the addition of retracts during the drilling operation. Peck clearance -can be specified by optional P number. +with the addition of retracts during the drilling operation. Peck +clearance can be specified by optional D number. * Preliminary motion, as described in the <> section. * Move the Z-axis at the current <> downward by delta or to the Z position, whichever is less deep. * Rapid move back out to the retract plane specified by the R word. -* Rapid move back down to the current hole bottom, less .010 of an inch or 0.254 mm. +* Rapid move back down to the current hole bottom, less the D word value + or a default of .010 of an inch or 0.254 mm. * Repeat steps 2, 3, and 4 until the Z position is reached at step 2. * The Z-axis does a <> to clear Z. diff --git a/src/emc/rs274ngc/interp_cycles.cc b/src/emc/rs274ngc/interp_cycles.cc index 064ed1301b1..a6bf5600c38 100644 --- a/src/emc/rs274ngc/interp_cycles.cc +++ b/src/emc/rs274ngc/interp_cycles.cc @@ -154,7 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = block->p_flag?block->p_number:_setup.parameter_g83_peck_clearance; + rapid_delta = block->d_flag?block->d_number:_setup.parameter_g83_peck_clearance; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { @@ -215,7 +215,7 @@ int Interp::convert_cycle_g73(block_pointer block, Thanks to Billy Singleton for pointing it out... */ CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED); - rapid_delta = block->p_flag?block->p_number:_setup.parameter_g73_peck_clearance; + rapid_delta = block->d_flag?block->d_number:_setup.parameter_g73_peck_clearance; for (current_depth = (r - delta); current_depth > bottom_z; current_depth = (current_depth - delta)) { diff --git a/src/emc/rs274ngc/rs274ngc_pre.cc b/src/emc/rs274ngc/rs274ngc_pre.cc index fc378375d35..2024047dfc4 100644 --- a/src/emc/rs274ngc/rs274ngc_pre.cc +++ b/src/emc/rs274ngc/rs274ngc_pre.cc @@ -915,8 +915,8 @@ int Interp::init() _setup.c_indexer_jnum = atol(inistring); } inifile.Find(&_setup.orient_offset, "ORIENT_OFFSET", "RS274NGC"); - inifile.Find(&_setup.parameter_g73_peck_clearance, "PARAMETER_G73_PECK_CLEARANCE", "RS274NGC"); - inifile.Find(&_setup.parameter_g83_peck_clearance, "PARAMETER_G83_PECK_CLEARANCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g73_peck_clearance, "G73_PECK_CLEARANCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g83_peck_clearance, "G83_PECK_CLEARANCE", "RS274NGC"); inifile.Find(&_setup.debugmask, "DEBUG", "EMC");