Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional p word to set peck distance/count #2528

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/src/config/ini-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions docs/src/gcode/g-code.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ It is an error if:

[source,{ngc}]
----
G73 X- Y- Z- R- Q- <L->
G73 X- Y- Z- R- Q- P- <L->
----

* 'R' - retract position along the Z axis.
Expand All @@ -1766,7 +1766,7 @@ G73 X- Y- Z- R- Q- <L->

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the "Rapid up .010 of an inch or 0.254 mm." part below should be modified too. The documented 0.1"/0.254mm do not seem to match the ini value default listed above.

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
Expand Down Expand Up @@ -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
Expand All @@ -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
<<gcode:preliminary-motion,Preliminary and In-Between Motion>> section.
Expand Down
11 changes: 3 additions & 8 deletions src/emc/rs274ngc/interp_cycles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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->p_flag?block->p_number:_setup.parameter_g83_peck_clearance;

for (current_depth = (r - delta);
current_depth > bottom_z; current_depth = (current_depth - delta)) {
Expand Down Expand Up @@ -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->p_flag?block->p_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);
}
Expand Down
5 changes: 2 additions & 3 deletions src/emc/rs274ngc/interp_internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 15 additions & 1 deletion src/emc/rs274ngc/interpmodule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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( &param_wrapper,
Expand Down
13 changes: 11 additions & 2 deletions src/emc/rs274ngc/rs274ngc_pre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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, "PARAMETER_G73_PECK_CLEARANCE", "RS274NGC");
inifile.Find(&_setup.parameter_g83_peck_clearance, "PARAMETER_G83_PECK_CLEARANCE", "RS274NGC");

inifile.Find(&_setup.debugmask, "DEBUG", "EMC");

Expand Down Expand Up @@ -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)
Expand Down
Loading