Keeping the Tool Tip on Path (FUNCTION TCPM / M128)

Tilt a rotary axis and the tool tip swings off the point you programmed — because the control is positioning the tool’s reference point (up at the gauge line), and the tip is a lever-arm away. On a manual tilt you would chase it with linear moves. On a HEIDENHAIN TNC you turn on tool center point management and the control does that automatically: as the rotary axes move, the linear axes compensate so the tip stays on the programmed contour. The old way to switch it on is the miscellaneous function M128; the modern, preferred way is FUNCTION TCPM, which exposes four selectors that M128 hid behind defaults. This page is derived from HEIDENHAIN’s TNC 640 Klartext Programming User’s Manual (892903-29, 01/2021), §11.4 (M128, p. 462) and §11.5 (FUNCTION TCPM, p. 466).

Requirements

Both M128 and FUNCTION TCPM require software option 9 (Advanced Function Set 2 — 3-D machining). On the TNC7 this is the same option 9 tag (#9), with the 3-D tool compensation piece tagged #4-01-1. TCPM is normally used together with the PLANE function (option 8): PLANE tilts into the plane, TCPM keeps the tip true while it tilts and while it cuts.

FUNCTION TCPM on F TCP / AXIS / REFPNT Rotary move A / B / C tilt Linear axes compensate Tool tip on contour
TCPM turns a rotary move into a coordinated 5-axis move: the linear axes compensate the tilt so the tool tip — not the gauge point — tracks the programmed path. After HEIDENHAIN 892903-29 §11.4–11.5.

The Legacy Switch: M128 / M129

M128 retains the position of the tool tip during positioning of the tilting axes. You can append a feed rate — M128 F1000 — that caps the compensating linear motion. M128 takes effect at the start of the block; you cancel it with M129, which takes effect at the end of its block (the control also drops M128 on certain resets, such as a new TOOL CALL). A minimal line looks like L X+10 Y+45 A+10 C+5 R0 M128. M128 works, but it bundles every behavioral choice into hard-coded defaults — which is exactly what FUNCTION TCPM was created to expose.

The Modern Way: FUNCTION TCPM and Its Four Selectors

FUNCTION TCPM is an enhancement of M128. It does the same tip-on-path job but lets you set four independent behaviors in the definition block. HEIDENHAIN recommends it over M128 for new programs.

SelectorOptionsWhat it decides
Feed referenceF TCP / F CONTF TCP interprets the programmed feed as the actual relative velocity of the tool tip; F CONT interprets it as the contouring feed rate.
Rotary-coordinate interpretationAXIS POS / AXIS SPATAXIS POS reads programmed rotary coordinates as physical axis positions (best for perpendicular rotary axes). AXIS SPAT reads them as spatial angles referenced to the active coordinate system — you must state all three (even 0°) in the first positioning block after it.
Orientation interpolationPATHCTRL AXIS / PATHCTRL VECTORPATHCTRL AXIS interpolates the rotary axes linearly between block ends — smooth, recommended for small per-block orientation changes and both face and peripheral milling. PATHCTRL VECTOR holds the tool-orientation vector within the block, for large orientation changes.
Reference pointREFPNT TIP-TIP / TIP-CENTER / CENTER-CENTERWhich point positions and which is the center of rotation — see below.

The reference-point selector is the subtle one, and it is what makes TCPM work correctly with CAM output and with ball/bull-nose cutters:

  • REFPNT TIP-TIP — the (theoretical) tool tip is the reference point for positioning, and the center of rotation is also at the tool tip.
  • REFPNT TIP-CENTER — the tool tip is the positioning reference, but for a milling cutter the control references the theoretical tip while rotating about the cutting-edge-radius center (used with 3-D tool comp on a bull-nose/ball cutter).
  • REFPNT CENTER-CENTER — the center of the cutting-edge radius is both the positioning reference and the center of rotation (typical for CAM systems that output cutter-center points).

A complete, representative definition block:

FUNCTION TCPM F TCP AXIS SPAT PATHCTRL AXIS REFPNT TIP-TIP

You reset it explicitly with FUNCTION RESET TCPM when you want to switch it off deliberately inside a program.

M144 — Compensating a Kinematics Change

If you fit an adapter, angle head, or other attachment that changes the machine kinematics, M144 tells the control to account for that modification in the position display and to compensate the resulting offset of the tool tip relative to the workpiece. It becomes effective at the start of its block and is canceled with M145. One important limitation: M144 does not work together with M128 or the Tilt Working Plane function — it is for the kinematics-change case, not the tip-on-path case.

TCPM vs. Fanuc G43.4 / G43.5 — The Same Feature

HEIDENHAIN’s tool center point management is the direct counterpart of Fanuc’s Tool Center Point Control (G43.4 / G43.5): both keep the programmed point on the tool tracking the contour while the rotary axes move. Where Fanuc splits the choice into two G-codes — G43.4 (tool-axis-direction / rotary-position form) and G43.5 (tool-tip / vector form) — HEIDENHAIN folds the equivalent choices into TCPM’s AXIS POS vs. AXIS SPAT and PATHCTRL AXIS vs. PATHCTRL VECTOR selectors. And TCPM adds an explicit REFPNT selector that Fanuc handles through its own tool-length and CAM conventions. In both worlds TCP is paired with a tilted-plane feature: TCPM with the PLANE function, G43.4/.5 with G68.2.

Kinematics, Options & Machine Parameters

TCPM computes its linear compensation from the machine’s kinematic model and pivot data — which Heidenhain keeps in the manufacturer’s configuration, not in programmer-visible vectors. So its accuracy is only as good as the machine calibration: the rotary-axis position and angle errors are measured with KinematicsOpt (option 48, Cycle 451 MEASURE KINEMATICS / Cycle 452 PRESET COMPENSATION) against a calibration sphere, “regardless of whether they are realised as tables or spindle heads.” If TCPM leaves visible error on a trued program, that calibration is where you look, not the NC code.

Option / parameter / M-wordRole for TCPM
Option 9 — Advanced Function Set 2 (#9 / #4-01-1)Required for M128, FUNCTION TCPM, M144 and 3-D machining. Without it these alarm.
Option 8 — Advanced Function Set 1 (#8 / #1-01-1)The PLANE function TCPM normally accompanies.
Option 48 — KinematicsOptThe rotary-axis calibration (Cycle 451/452) TCPM’s accuracy rests on — the head/table “dial-in” equivalent.
Option 92 — 3D-ToolCompCompensates tool-radius deviation as a function of contact angle — an extension used alongside TCPM, not a requirement.
presetToAlignAxis (MP 300203, per-axis)Defines, for each axis, how the control interprets offsets under FUNCTION TCPM / M128 (and PARAXCOMP, FACING HEAD). The load-bearing case is an eccentric holder / fork head — e.g. an AC fork head sets it FALSE for C. Get this wrong and TCPM mis-compensates.
M138Selects which rotary axes take part in the solution — needed on 3-rotary machines to avoid ambiguity.
M116 / M126M116 (rotary-axis feed in mm/min) cannot be combined with M128/TCPM unless that axis is excluded via M138; M126 (shortest-path rotary) is the usual companion.

Options from 892903-29 “Software options”; presetToAlignAxis from TNC7 Setup manual 1358774-24 §12.3 (TNC 640 Setup 1261174-25 carries it too); KinematicsOpt from the TNC7 Measuring-Cycles manual 1358777-24 §10.4; M116/M126/M138 from 1358773-24 §19.4.

See also: Tilting the working plane (PLANE) (define and tilt into the feature plane) and 3D basic rotation & preset from probing (true the setup first). The Fanuc equivalent is TCP (G43.4/G43.5); the Siemens equivalent is TRAORI (transformation for orientation programming). For the concept across all three controls, see the 5-axis TWP & TCPM cross-control primer.

Source: HEIDENHAIN TNC 640 Klartext Programming User’s Manual, 892903-29 (01/2021) — §11.4 “Retaining the position of the tool tip during the positioning of tilting axes (TCPM): M128” (p. 462), M144 (p. 465), and §11.5 “FUNCTION TCPM” (definition p. 466, reset p. 471). Equivalent content in the TNC7 Klartext manual (1358773-24).

Have a question or want to contribute?

Contact us with corrections, additions, or topics you'd like covered.

Get in Touch