Skip to content

Commit 781023e

Browse files
authored
Merge pull request #2528 from LinuxCNC/add_drill_cycle_letter
Add optional D word to set peck distance/count
2 parents 8bcef18 + a91f6ac commit 781023e

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

docs/src/config/ini-config.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,9 @@ The maximum number of `USER_M_PATH` directories is defined at compile time (typ:
558558
Allow to clear the G92 offset automatically when config start-up.
559559
* `DISABLE_FANUC_STYLE_SUB = 0` (Default: 0)
560560
If there is reason to disable Fanuc subroutines set it to 1.
561-
* 'PARAMETER_G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches)
561+
* 'G73_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches)
562562
Chip breaking back-off distance in machine units
563-
* 'PARAMETER_G83_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches)
563+
* 'G83_PECK_CLEARANCE = .020' (default: Metric machine: 1mm, imperial machine: .050 inches)
564564
Clearance distance from last feed depth when machine rapids back to bottom of hole, in machine units.
565565

566566
[NOTE]

docs/src/gcode/g-code.adoc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ It is an error if:
18111811

18121812
[source,{ngc}]
18131813
----
1814-
G73 X- Y- Z- R- Q- P- <L->
1814+
G73 X- Y- Z- R- Q- D- <L->
18151815
----
18161816

18171817
* 'R' - retract position along the Z axis.
@@ -1820,15 +1820,16 @@ G73 X- Y- Z- R- Q- P- <L->
18201820

18211821
The 'G73' cycle is drilling or milling with chip breaking.
18221822
This cycle takes a Q number which represents a 'delta' increment along
1823-
the Z axis. Peck clearance can be specified by optional P number.
1823+
the Z axis. Peck clearance can be specified by optional D number.
18241824

18251825
* Preliminary motion.
18261826
** If the current Z position is below the R position, The Z axis does
18271827
a <<gcode:g0,rapid move>> to the R position.
18281828
** Move to the X Y coordinates
18291829
* Move the Z-axis only at the current <<sec:set-feed-rate,feed rate>>
18301830
downward by delta or to the Z position, whichever is less deep.
1831-
* Rapid up .010 of an inch or 0.254 mm.
1831+
* Rapid up either the D value, the G73_PECK_CLEARANCE specified in the
1832+
INI file or the default of .010" / 0.254 mm.
18321833
* Repeat steps 2 and 3 until the Z position is reached at step 2.
18331834
* The Z axis does a rapid move to the R position.
18341835

@@ -2408,25 +2409,26 @@ seconds at the bottom of the hole.
24082409

24092410
[source,{ngc}]
24102411
----
2411-
G83 (X- Y- Z-) or (U- V- W-) R- L- Q- P-
2412+
G83 (X- Y- Z-) or (U- V- W-) R- L- Q- D-
24122413
----
24132414

24142415
The 'G83' cycle (often called peck drilling) is intended for deep
2415-
drilling ormilling with chip breaking. The retracts in this cycle clear
2416+
drilling or milling with chip breaking. The retracts in this cycle clear
24162417
the hole of chips and cut off any long stringers (which are common when
24172418
drilling in aluminum). This cycle takes a Q number which represents a
24182419
'delta' increment along the Z-axis. The retract before final depth will
24192420
always be to the 'retract' plane even if G98 is in effect. The final
24202421
retract will honor the G98/99 in effect. G83 functions the same as G81
2421-
with the addition of retracts during the drilling operation. Peck clearance
2422-
can be specified by optional P number.
2422+
with the addition of retracts during the drilling operation. Peck
2423+
clearance can be specified by optional D number.
24232424

24242425
* Preliminary motion, as described in the
24252426
<<gcode:preliminary-motion,Preliminary and In-Between Motion>> section.
24262427
* Move the Z-axis at the current <<sec:set-feed-rate,feed rate>>
24272428
downward by delta or to the Z position, whichever is less deep.
24282429
* Rapid move back out to the retract plane specified by the R word.
2429-
* Rapid move back down to the current hole bottom, less .010 of an inch or 0.254 mm.
2430+
* Rapid up either the D value, the G83_PECK_CLEARANCE specified in the
2431+
INI file or the default of .010" / 0.254 mm.
24302432
* Repeat steps 2, 3, and 4 until the Z position is reached at step 2.
24312433
* The Z-axis does a <<gcode:g0,rapid move>> to clear Z.
24322434

src/emc/rs274ngc/interp_check.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,13 @@ int Interp::check_other_codes(block_pointer block) //!< pointer to a block
252252
CHKS(is_a_cycle(motion), NCE_CANNOT_PUT_A_C_IN_CANNED_CYCLE);
253253
}
254254
if (block->d_flag) {
255-
CHKS(((block->g_modes[GM_CUTTER_COMP] != G_41) && (block->g_modes[GM_CUTTER_COMP] != G_42) &&
256-
(block->g_modes[GM_CUTTER_COMP] != G_41_1) && (block->g_modes[GM_CUTTER_COMP] != G_42_1) &&
257-
(motion != G_70) &&
258-
(motion != G_71) && (motion != G_71_1) && (motion != G_71_2) &&
259-
(motion != G_72) && (motion != G_72_1) && (motion != G_72_2) &&
260-
(block->g_modes[GM_SPINDLE_MODE] != G_96)),
261-
_("D word with no G41, G41.1, G42, G42.1, G71, G71.1, G71.2 or G96 to use it"));
255+
CHKS(((block->g_modes[7] != G_41) && (block->g_modes[7] != G_42) &&
256+
(block->g_modes[7] != G_41_1) && (block->g_modes[7] != G_42_1) &&
257+
(motion != G_70) && (motion != G_71) && (motion != G_71_1) &&
258+
(motion != G_71_2) && (motion != G_72) && (motion != G_72_1) &&
259+
(motion != G_72_2) && (motion != G_73) && (motion != G_83) &&
260+
(block->g_modes[14] != G_96)),
261+
_("D word with no G41, G41.1, G42, G42.1, G71, G71.1, G71.2 G73, G83 or G96 to use it"));
262262
}
263263

264264
if (block->dollar_flag) {

src/emc/rs274ngc/interp_cycles.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ int Interp::convert_cycle_g83(block_pointer block,
154154
Thanks to Billy Singleton for pointing it out... */
155155
CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED);
156156

157-
rapid_delta = block->p_flag?block->p_number:_setup.parameter_g83_peck_clearance;
157+
rapid_delta = block->d_flag?block->d_number_float:_setup.parameter_g83_peck_clearance;
158158

159159
for (current_depth = (r - delta);
160160
current_depth > bottom_z; current_depth = (current_depth - delta)) {
@@ -215,7 +215,7 @@ int Interp::convert_cycle_g73(block_pointer block,
215215
Thanks to Billy Singleton for pointing it out... */
216216
CHKS((delta <= 0.0), NCE_NEGATIVE_OR_ZERO_Q_VALUE_USED);
217217

218-
rapid_delta = block->p_flag?block->p_number:_setup.parameter_g73_peck_clearance;
218+
rapid_delta = block->d_flag?block->d_number_float:_setup.parameter_g73_peck_clearance;
219219

220220
for (current_depth = (r - delta);
221221
current_depth > bottom_z; current_depth = (current_depth - delta)) {

src/emc/rs274ngc/rs274ngc_pre.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,8 @@ int Interp::init()
930930
_setup.c_indexer_jnum = atol(*inistring);
931931
}
932932
inifile.Find(&_setup.orient_offset, "ORIENT_OFFSET", "RS274NGC");
933-
inifile.Find(&_setup.parameter_g73_peck_clearance, "PARAMETER_G73_PECK_CLEARANCE", "RS274NGC");
934-
inifile.Find(&_setup.parameter_g83_peck_clearance, "PARAMETER_G83_PECK_CLEARANCE", "RS274NGC");
933+
inifile.Find(&_setup.parameter_g73_peck_clearance, "G73_PECK_CLEARANCE", "RS274NGC");
934+
inifile.Find(&_setup.parameter_g83_peck_clearance, "G83_PECK_CLEARANCE", "RS274NGC");
935935

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

0 commit comments

Comments
 (0)