Table of Contents

Namespace Hi.NcParsers.PostLogicSyntaxs.Heidenhain

Classes

HeidenhainApproachDepartureSyntax

Heidenhain klartext contour approach and departure functions — APPR LT / LN / CT / LCT and DEP LT / LN / CT / LCT, recorded by HeidenhainApprDepSyntax — turned into the tool-center path the control runs: the auxiliary point PH is computed from the contour's direction, the tool radius and the compensation side, and the block's motion becomes a CompoundMotion of one or two items (a straight to PH, then a straight or an arc onto the compensated first contour point; an arc off the compensated last contour point, then a straight to the end point), an M140 retract on the block a third before them. Klartext Programming User's Manual, “Approaching and departing a contour” (TNC 640 892903-2C pp. 152–159, TNC7 1358773-24 §9.5–9.6, iTNC 530 737759-24 §6.3).

Why a PostLogic syntax, ahead of RadiusCompensationSyntax. An approach needs the direction of the first contour element, which is the Logic result of the block after this one (a look-forward, the compensation pass's own device — the shared running-direction reading of the Logic stage), and a departure needs the compensated end of the last contour element, which only exists once that block's compensation pass has run. The approach ends with the tool center already on the offset path (PA plus the tool radius to the compensation side), so the pass then treats the first contour element as a mid-region block and continues from there: this block carries a compound motion, which the pass leaves alone, and the pass's own look-back finds no earlier offset and takes the block's machine position as the region's previous point. A departure writes the R0 word, so the pass ends the region on the last contour element with its perpendicular offset (a cancel without a move of its own) and writes the cancelled state on this block. The Logic stage stamps an approach block G01 (G00 under FMAX, HeidenhainMotionModeSyntax) like an L block, so the one-shot motion event it carries until this syntax replaces it reads as the feed motion it is (the spindle-direction fallback judges by it); the modal motion state this syntax leaves reads G00 under the block's own FMAX and G01 otherwise, the latch every rapid or feed block keeps.

The geometry, with t the unit direction of the contour element at the contour point, left = n × t (n the working plane's positive normal — the "left of travel" of the compensation pass), r the tool radius of the compensation's offset row (the same signed convention as the pass: RL offsets to left, RR to −left), PAc / PEc the contour points moved by that offset:

  • APPR LT: PS → PH → PAc on straights, PH = PAc − t·LEN (TNC 640 p.155).
  • APPR LN: PH = PAc + side·LEN, side the unit normal toward the tool's side — the auxiliary point is separated from PA by the distance LEN plus the tool radius (iTNC 530 p.228; the DEP LN pages of every manual say the same of PN).
  • APPR CT: an arc of radius |R| and center angle CCA ending tangentially at PAc; the turning sense from the TNC7 table (p.269: RL and R > 0 or RR and R < 0 counterclockwise, otherwise clockwise), the center on the inner side of that turn, PH the point CCA back along the arc; whole turns of CCA are the arc's own count and a remainder of nothing puts PH on PA itself (the full-circle convention of HeidenhainCircularMotionSyntax). PS → PH on a straight.
  • APPR LCT: an arc of radius R tangent to the contour at PAc with its center on the tool's side, and the straight from PS tangent to that circle; PH is the tangent point whose arc velocity continues the straight's direction (TNC 640 p.157: the arc joins the line PS–PH and the first contour element tangentially). A tangent point on PA itself (PS on the offset path's own extension, within the degenerate radius) leaves no arc; a PS on the circle is its own tangent point, the straight to it of no length in the plane (it carries the plane-normal travel an LCT puts on it). A PS on the workpiece side of that extension — the nominal contour's own extension is one, a tool radius inside the offset path's — has one tangent that continues into the arc's turn, and the geometry's answer is an arc of more than three quarters of a turn, nearly a full one when PS is close to that extension (the manual's CIRCULAR example with PS on the contour line: about 342°); a DEP LCT mirrors it for a PN on the workpiece side of the offset path's forward extension (the nominal contour's own: about 346° on the LT example); whether the control does the same, or applies a tolerance, the manuals do not say, and it is not verified on a control.
  • DEP LT: PEc → PN = PEc + t·LEN. DEP LN: PN = PEc + side·LEN (LEN plus the tool radius from the contour, TNC 640 p.158). DEP CT: the arc of |R| and CCA leaving PEc tangentially, the same sense table (TNC7 p.275). DEP LCT: the arc of R tangent at PEc on the tool's side to PH, the tangent point toward PN, then the straight to PN (TNC7 p.277).
  • Feed. LT / LN / CT run PS → PH at the feed in effect before the block, "at the last feed rate entered" — rapid when the last positioning block before the approach was programmed FMAX (TNC 640 p.153 and p.154, iTNC 530 p.226; the positioning block of a cycle call, L … FMAX M99 or CYCL CALL POS … FMAX, counts by its own word, the rapid retract its expansion ends with does not, and an M140 retract standing in a block of its own does not either — a rapid of the function's own, no FMAX entered — while a positioning block that carries the M140 is judged by its own FMAX or F, the stamp the retract writer keeps on its event; TNC 640 p.246: "If you enter M140 in a positioning block") — and PH → PA at the block's feed; an LCT runs the whole PS → PA path at the block's feed (TNC 640 p.157); a departure runs at its own block's feed (the F word of every DEP form's syntax, TNC7 pp. 273–277). FMAX on the block makes its own segments rapid; an arc under rapid takes as its feed the slower in-plane rapid rate the machine declares (the stock 20000 mm/min without one), capped so that a helical arc's plane-normal travel never exceeds that axis' rapid rate — the simulation's own rule, the manuals give none.
  • The plane-normal coordinate (Z under G17). The TNC 640 states that an approach block moves the tool at the same time to the first contour point PA (p.153), so on LT / LN / CT it travels on the segment onto the contour: PH keeps the level of PS, the straight PH → PAc ramps, the CT arc becomes a helix. An LCT is the manual's exception, PS → PH on all three axes and PH → PA in the plane only (TNC 640 p.157, TNC7 p.271). A departure block's coordinate (DEP LCT) travels on the straight PH → PN (TNC7 p.277), the arc staying at the contour's level. The iTNC 530 generation did both another way — to PH in the plane, then to the depth along the tool axis, on an approach and on a departure alike (p.226) — not modelled.
  • M140 on the block. The retract of M140 MB takes effect at the start of the block (TNC 640 p.246, TNC7 p.589), so it runs first, as a straight along the tool axis to the retract height (at the M140 feed when one is given, else rapid: the rule TNC 640 p.246, the examples TNC7 p.589, M140 MB+50 F750 retracting at 750 mm/min and M140 MB MAX at rapid traverse), and the function's path starts from the lifted position: PS, or PEc, at that height; a plane-normal coordinate the approach block does not state keeps that level (an unprogrammed axis stays where the retract left it), and the next blocks start from it — a stated one travels as on any approach. The messages of a function that moves nothing speak of the function, not of the block, since the retract has moved the tool. The Logic-stage retract writer leaves the word to this syntax on an approach or departure block (HeidenhainMFunctionSyntax, HeidenhainCycleRetractSyntax).

Degraded shapes. Each warns, and the simulation runs the nearest path it can so the tool is never teleported; where a manual says what the control does in every case the warning covers, the warning says so, elsewhere only the simulation's own course is stated:

  • no path function with an in-plane direction follows an approach (HeidenhainAppr--NoContourAfter: a straight to PA; with no path function after it the control stops with an error, TNC7 p.263 — the warning also covers an approach followed only by a plunge, a departure or a cycle, where the manuals say nothing) or precedes a departure (HeidenhainDep--NoContourBefore: the function moves nothing, the cancel stands);
  • an approach without a coordinate of PA (HeidenhainAppr--FirstContourPointMissing: the function moves nothing); a machining cycle firing on the block, M89 armed or M99 on it (HeidenhainAppr--CycleCallOnBlock: the cycle runs, the approach is not computed, the record's words the form does not take reported all the same; HeidenhainDep--CycleCallOnBlock: the cycle runs at the last programmed position, the nominal end of the contour, its own positioning taking the tool there from the offset path in the plane at the depth it stands at, the compensation is cancelled and the departure is not computed — the control's course for M99 on a departure block the manuals do not give);
  • a word of the form missing (HeidenhainApprDep--WordMissing: a straight to the segment's end point — the compensated PA, or PN; HeidenhainDep--WordMissing on DEP LT / LN / CT: the function moves nothing, the cancel stands); a word the form does not take — a parameter word of another form on either function (an R on an LT, a CCA on an LN), a DIN/ISO arc word (I / J / K) on either, and on a DEP LT / LN / CT any axis word (a DEP LCT takes them all: PN and its rotary and parallel coordinates) — kept in the record by the parser so that no shared syntax reads it, reported and dropped (HeidenhainApprDep--WordNotTaken); a word the form takes written more than once (HeidenhainApprDep--WordRepeated: the first is used; written once or more, a word the form does not take is reported once as not taken; the parser reads the words case-insensitively and takes them as the word they spell); an RL / RR on a departure stays unread on the block (UnparsedText--Remaining);
  • R0 on an APPR LN / CT / LCT (HeidenhainAppr--R0DirectionAssumedRR; the TNC 640 refuses LN and CT with R0, p.154, the TNC7 may stop, p.263) or a DEP LN / CT / LCT after an uncompensated contour (HeidenhainDep--NoCompensationDirectionAssumedRR): a zero radius and the RR side, the iTNC 530's reading of R0 (p.227) taken as the simulation's assumption;
  • a LEN that is not positive on an LN (HeidenhainApprDep--WordOutOfRange: "always enter LEN as a positive value", TNC 640 p.155, and p.158 for the DEP LN) or a CCA above 360 (the same id: TNC 640 p.156 gives 360° as the maximum input value, TNC7 p.275 the same range for the DEP CT), used as written, a CCA above 360 as whole turns plus the remainder; a LEN that is not positive on an LT (HeidenhainApprDep--LenNotPositive: used as written — the manuals give LT no range);
  • a zero radius, or a center angle of nothing or less (HeidenhainApprDep--WordLeavesNoArc: the segment runs straight; HeidenhainDep--WordLeavesNoArc on DEP CT: the function moves nothing, the cancel stands; the manuals take CCA positive, TNC 640 p.156, TNC7 p.269 and p.275); a negative LCT radius (HeidenhainApprDep--RadiusMagnitudeUsed: the manuals take R positive, TNC 640 p.157 and p.159); the start or end point inside the LCT circle (HeidenhainApprDep--AuxiliaryPointUndefined: a straight);
  • a radius compensation still active before an approach (HeidenhainAppr--CompensationActiveBefore: the control runs an approach from a position without compensation, TNC 640 p.150 and p.153, with an R0 block between RR and RL, p.140; the pass ends the contour before on its last element with its perpendicular offset, and the approach takes the compensation the block states, else the one in effect — an approach followed directly by another approach or by a departure finds no contour (HeidenhainAppr--NoContourAfter: a straight to its nominal PA), and the approach after it starts from that point);
  • no feed programmed before an approach (HeidenhainAppr--NoFeedrateBefore: the move to PH at rapid; the control generates an error, TNC 640 p.154) or none for the block (HeidenhainApprDep--NoFeedrate: rapid) — where the shared motion semantics drop a feed motion without a feed (McMotion--NoFeedrate), a compound's segment runs at rapid instead, because a dropped segment would leave the next act starting where this block's machine position already stands.

The polar forms are not recognized at all (see the parser). Not modelled: an approach or departure on a helix (the manual's APPR CT / DEP CT "on its extension", TNC 640 p.152 — the CT arc here ramps only what the block's own coordinate states, not the helix's pitch); M120 look-ahead's constraints on APPR / DEP LCT (TNC 640 p.243: under M120 a tangential approach must be an APPR LCT with only the working plane's coordinates, the departure a DEP LCT). A rotary word is a coordinate of PA on every approach form and of PN on a DEP LCT (the TNC7 syntax tables; the other departure forms take none, HeidenhainApprDep--WordNotTaken); which segment the control turns it on the manuals do not say, so it rides the first segment of an approach's path (after an M140 retract) and the last of a DEP LCT's, the straight to PN, the arc before it holding the angle the block began at; under a dynamic transform chain (RTCP) the turn gets a straight of its own ahead of the path, the tool's tip standing while the axis turns, since every item is mapped with the block's end-point snapshot and an arc act holds one angle, and the turn runs at the feed of the segment it precedes; an M140 retract, which runs at the angle the block began at, is mapped with the transformation of the block before, the chain's snapshot being built at the angle the block ends at; a function that moves nothing holds the angle before, and with it the machine position and the transformation before. A parallel-axis word (U / V / W) goes to the root as on an L block, where the simulation, which supports no parallel axis, reports it as residue. NcOpt (NcOptPieceClassifier) leaves an APPR LT / LN / CT block as it is, because the one F word of the line cannot carry a segment that runs at the feed before it, and with it every motion line back to the one that carries that feed's F word or can take it restated (a positioning block carrying M140 counts by its own stamp, a retract standing alone is stepped over; a rapid line first makes PS → PH rapid and preserves nothing), so that no optimized line re-emits an F before the approach; an LCT approach and a departure run at their own feed and are optimized as whole lines, and under FMAX any of them is a rapid line, preserved as every rapid line is; no compound motion is ever re-interpolated.