Class PeckDrillingCycleSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
G83 peck drilling cycle. Supports modal repetition. Drills in increments of depth Q, fully retracting to R between strokes.
Cycle sequence (per stroke):
- Rapid to init position (target XY, previous Z)
- Rapid from init to R-point
- For each stroke: rapid to clearance above previous depth, feed Q deeper, rapid back to R
- If remainder exists: feed to bottom Z, rapid to R
- Rapid from R/bottom to final (G98 → init Z, G99 → R)
Retraction distance is read from ICannedCycleConfig (Fanuc #4002 / Syntec Pr4002, or FallbackConfig fallback).
Reads absolute coordinates from the cycle section, which is resolved by CannedCycleResolveSyntax (modal repetition, G91 conversion, missing-axis fallback) before this syntax runs. Must be placed after CannedCycleResolveSyntax and before IncrementalResolveSyntax in the syntax chain.
public class PeckDrillingCycleSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
PeckDrillingCycleSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Both cases below pre-populate CannedCycle as
CannedCycleResolveSyntax would have written it. There
is no #Previous:, so GetLastProgramXyz returns
Vec3d.Zero → initZ = 0. A
FallbackConfig dep with the
default PeckRetractionDistance_mm = 5 is injected via
BuildAndDump(..., deps:). Cycle parameters are chosen so
totalFeedLength = R − bottomZ = 10 and Q = 10 →
exactly one stroke, no remainder; the items list stays minimal.
G83 G98 — rapid to init (z=0), rapid to R=2, feed to bottom Z=-8 at F=600 mm/min → 10 mm/s, rapid back to R=2, then a final rapid to init Z=0 (G98). Five items:
#BeforeBuild:{
"Parsing": { "G83": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10, "F": 600 } },
"CannedCycle": {
"Term": "G83", "ReturnMode": "G98",
"Params": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10 }
}
}
#AfterBuild:
{
"CannedCycle": {
"Term": "G83", "ReturnMode": "G98",
"Params": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10 }
},
"Feedrate": { "FeedrateValue": 600, "Term": "G94", "Unit": "mm/min" },
"CompoundMotion": {
"Term": "G83",
"Items": [
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 0 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 2 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": -8 }, "MotionEvent": { "Form": "McLinear", "Feedrate_mmds": 10 } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 2 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 0 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } }
]
},
"ProgramXyz": { "X": 50, "Y": 30, "Z": 0 }
}
G83 G99 — same cycle but the return mode is R-point. Since the
retract-to-R rapid already lands at z = R, the
finalZ != rPoint guard skips the extra final-rapid item.
Four items, and the block's ProgramXyz lookback anchor lands
at R-point:
#BeforeBuild:
{
"Parsing": { "G83": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10, "F": 600 } },
"CannedCycle": {
"Term": "G83", "ReturnMode": "G99",
"Params": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10 }
}
}
#AfterBuild:
{
"CannedCycle": {
"Term": "G83", "ReturnMode": "G99",
"Params": { "X": 50, "Y": 30, "Z": -8, "R": 2, "Q": 10 }
},
"Feedrate": { "FeedrateValue": 600, "Term": "G94", "Unit": "mm/min" },
"CompoundMotion": {
"Term": "G83",
"Items": [
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 0 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 2 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": -8 }, "MotionEvent": { "Form": "McLinear", "Feedrate_mmds": 10 } },
{ "ProgramXyz": { "X": 50, "Y": 30, "Z": 2 }, "MotionEvent": { "Form": "McLinear", "IsRapid": true } }
]
},
"ProgramXyz": { "X": 50, "Y": 30, "Z": 2 }
}
Remarks
G73 (high-speed peck) retracts only a small distance instead of fully back to R — see HighSpeedPeckCycleSyntax.
Constructors
PeckDrillingCycleSyntax()
Initializes a new instance with default settings.
public PeckDrillingCycleSyntax()
PeckDrillingCycleSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public PeckDrillingCycleSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
Methods
Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)
Build syntax arrangement into the
syntaxPieceNode in-place.
public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory