diff --git a/docs/src/config/ini-config.adoc b/docs/src/config/ini-config.adoc index 0d018b9ec23..3a7d6727a10 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. - +* 'G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches) + Chip breaking back-off distance in machine units +* '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. diff --git a/docs/src/gcode/g-code.adoc b/docs/src/gcode/g-code.adoc index 7354804b640..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- +G73 X- Y- Z- R- Q- D- ---- * '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 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. ** 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,24 +2371,26 @@ 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- 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. +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 1c677764649..a6bf5600c38 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 = G83_RAPID_DELTA; - if (_setup.length_units == CANON_UNITS_MM) - rapid_delta = (rapid_delta * 25.4); + 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)) { @@ -212,18 +210,15 @@ int Interp::convert_cycle_g73(block_pointer block, { double current_depth; double rapid_delta; - /* 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; - if (_setup.length_units == CANON_UNITS_MM) - rapid_delta = (rapid_delta * 25.4); + 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)) { + current_depth > bottom_z; current_depth = (current_depth - delta)) { cycle_feed(block, plane, x, y, current_depth); cycle_traverse(block, plane, x, y, current_depth + rapid_delta); } diff --git a/src/emc/rs274ngc/interp_internal.hh b/src/emc/rs274ngc/interp_internal.hh index a6aeda5bd37..d3c51cd80ab 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,6 +789,8 @@ struct setup int tool_change_at_g30; int tool_change_quill_up; int tool_change_with_spindle_on; + 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 169d3aa8f42..a8773e0592a 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_clearance (Interp &interp) { + return interp._setup.parameter_g73_peck_clearance; +} +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_clearance (Interp &interp) { + return interp._setup.parameter_g83_peck_clearance; +} +static inline void set_parameter_g83_peck_clearance(Interp &interp, double value) { + interp._setup.parameter_g83_peck_clearance = 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_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 0648ef32440..2024047dfc4 100644 --- a/src/emc/rs274ngc/rs274ngc_pre.cc +++ b/src/emc/rs274ngc/rs274ngc_pre.cc @@ -833,12 +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; + if (_setup.length_units == CANON_UNITS_INCHES) { + _setup.parameter_g73_peck_clearance = .050; + _setup.parameter_g83_peck_clearance = .050; + } else{ + _setup.parameter_g73_peck_clearance = 1; + _setup.parameter_g83_peck_clearance = 1; + } _setup.a_axis_wrapped = 0; _setup.b_axis_wrapped = 0; _setup.c_axis_wrapped = 0; @@ -907,6 +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, "G73_PECK_CLEARANCE", "RS274NGC"); + inifile.Find(&_setup.parameter_g83_peck_clearance, "G83_PECK_CLEARANCE", "RS274NGC"); inifile.Find(&_setup.debugmask, "DEBUG", "EMC"); @@ -1075,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)