Drilling: can't set peck retract, problem Z rapids

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Steveco
Posts: 57
Joined: Wed Aug 29, 2018 11:19 pm
Location: San Diego, CA, USA

Drilling: can't set peck retract, problem Z rapids

Post by Steveco »

I set out to recreate old job (created with version 0.19-21514) using latest weekly build. I ran into two issues:

1. the drilling operation is set with Peck Enabled = true and a Retract Height of 5.0, but the G-Code always has 'R0.000'. I tried various values for the Retract Height but it did not make a difference.

2. there are extra rapid moves to a Z height that is above what the operation sets - 'G0 Z10.000' and 'G0 Z11.000' despite the operation having Safe Height = 3.0mm and Clearance Height = 4.0mm. Part of the G-Code is shown below. The extra rapids are on lines 10, 28, 31, 34, and 37.

Code: Select all

     7  (begin operation: G54)
     8  (machine units: mm/min)
     9  G54
    10  G0 Z11.000
    11  (finish operation: G54)
    12  (begin operation: TC: 3/16" drill)
    13  (machine units: mm/min)
    14  (TC: 3/16" drill)
    15  M5
    16  M6 T6
    17  G43 H6
    18  M3 S6000
    19  (finish operation: TC: 3/16" drill)
    20  (begin operation: NeckScrewHoles_Back_Drilling)
    21  (machine units: mm/min)
    22  (NeckScrewHoles_Back_Drilling)
    23  (Begin Drilling)
    24  G0 Z4.000
    25  G90
    26  G99
    27  G0 X-11.000 Y15.880
    28  G0 Z10.000
    29  G83 X-11.000 Y15.880 Z-33.000 F500.000 Q3.570 R0.000
    30  G0 X19.050 Y15.880
    31  G0 Z10.000
    32  G83 X19.050 Y15.880 Z-33.000 F500.000 Q3.570 R0.000
    33  G0 X19.050 Y61.000
    34  G0 Z10.000
    35  G83 X19.050 Y61.000 Z-33.000 F500.000 Q3.570 R0.000
    36  G0 X-8.500 Y61.000
    37  G0 Z10.000
    38  G83 X-8.500 Y61.000 Z-33.000 F500.000 Q3.570 R0.000
    39  G80
    40  G0 Z3.000
    41  G0 Z4.000
    42  (finish operation: NeckScrewHoles_Back_Drilling)
For this issue I found a partial workaround: if I change the setup sheet values for Safe Height Offset and Clearance Height Offset, the extra rapids will go to those values. So if Safe Height Offset is set to match operation Safe Height and Clearance Height Offset is set to match operation Clearance Height then the extra lines will still be present but won't cause a problem.

The complete G-Code:
DrillingTest_1_Job.ngc.zip
(548 Bytes) Downloaded 18 times
The test file I used to generate it:
DrillingTest_1.FCStd
(25.16 KiB) Downloaded 16 times
My FreeCAD version info:

Code: Select all

OS: Ubuntu 20.04.4 LTS (Trinity/trinity)
Word size of FreeCAD: 64-bit
Version: 0.20.28918 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 69a4963)
Hash: 69a4963ebfdbdda0d069347d013f28f2d6ba687a
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * CurvedShapes
  * LCInterlocking
  * Manipulator
User avatar
luvtofish
Posts: 83
Joined: Thu Mar 31, 2022 8:45 pm

Re: Drilling: can't set peck retract, problem Z rapids

Post by luvtofish »

While writing the post processor for my control (dynapath delta 40), I too am struggling with all the "G0 Zxx" entries. Every time a fixture is declared, operation starts, and operation ends, this line is inserted. We need more control over when and what is declared here. To satisfy my control, I had to insert an X0 and a Y0 in all of the opening operation "G0 Z" entries and still need to find a way to remove entirely the one inserted with the fixture entry -- it is just not needed here since it has the undesirable effect of instructing the spindle to rapid to the Z"ClearanceHeight", X0, Y0 datum point and then rapids back to home for the initial tool change.

These "G0 Z" entries should occur and be tied in with the "use starting point" radio button or even be made "mandatory". it should be a full 3 parameter vector not a single "Z" move! This would obviously be a preparatory step to place the current tool in close relation to it's initial cutting steps.

Every operation "ending entry" could optionally be setup this way or remain as is with just a "G0 "ClearanceHeight" and just prior to the follow on M02/M6/M30, etc., which brings the spindle back to it's home position. Right now my post code indiscriminately inserts the same X0 Y0 in the operation ending G0 "ClearanceHeight" entry which is technically not needed.

The "R" you reference is the standard G83 "safe height" or reference plane parameter. In addition to "R" on my control, I'm inserting an optional "O" parameter which is a 2nd reference plane height intended to navigate over obstacles as needed. This control does not recognize the "G98/G99" retraction entries used by Path.

Dan
Post Reply