5-Axis Transformation (TRAORI)
On a 3-axis mill the tool always points straight down, so “the position” and “the tool tip” are the same thing. The moment you add rotary axes that swing the tool at an angle, they stop being the same: tilt the head 20° and the tip swings away from where the linear axes say it is. TRAORI — Siemens’ orientation (5-axis) transformation — closes that gap. With it active, the programmed X/Y/Z always mean the tool tip, and the control automatically moves the linear axes to compensate whenever the rotary axes turn, so the tip stays exactly where you put it. It is the SINUMERIK equivalent of Fanuc’s Tool Center Point control (G43.4/G43.5) and Heidenhain’s FUNCTION TCPM. This page is derived from Siemens’ SINUMERIK 840D sl / 840D / 840Di sl NC Programming manual (A5E47432823B AA, 06/2019), §3.9.2.
The Core Behavior
Straight from the manual: “When the transformation is enabled, the positional data (X, Y, Z) always relates to the tip of the tool. Changing the positions of the rotary axes involved in the transformation causes compensating motion of the remaining machine axes — which means that the position of the tool tip remains unchanged.” In three-, four-, and five-axis transformations the programmed position always relates to the tip, which is tracked orthogonally to the machined surface in space. You program where the tip goes and how it’s oriented; the control solves for the actual machine-axis moves.
Activating and Deactivating
| Command | Meaning |
|---|---|
TRAORI | Activates the first configured orientation transformation. |
TRAORI(<n>) | Activates orientation transformation number n (value 1 or 2). |
TRAORI(<n>,<X>,<Y>,<Z>,<A>,<B>) | Activates transformation n with an orientation vector (X,Y,Z) and programmable rotary-axis offsets (A,B). |
TRAFOOF | Deactivates the active transformation (also cancels TRANSMIT / TRACYL / TRAANG). |
Siemens describes the parameterized form as TRAORI(transformation number, orientation vector, rotary axis offsets). Parameters can be omitted if the correct order is kept — e.g. TRAORI(, , , ,A,B) enters only the rotary-axis offset. As an alternative to programming the offset directly, it can be taken automatically from the currently active zero offset (configured in machine data).
Because tool-length compensation must act along the tool-orientation direction, set the working plane (G17/G18/G19) so the length offset works in the direction the tool points.
The Orientation Vector
The vector (X,Y,Z) in the parameterized call is the component of the orientation to which the tool points — and the manual is specific about direction: “Orientation transformation always points from the tool tip to the tool adapter.” So the vector runs tool-tip → adapter (up the tool). The examples:
| Example | Basic tool orientation |
|---|---|
TRAORI(1,0,0,1) | Basic tool orientation in the Z direction (vector 0,0,1). |
TRAORI(1,0,1,0) | Orientation in the Y direction (vector 0,1,0). |
TRAORI(1,0,1,1) | Orientation in the Y/Z direction (vector 0,1,1) — corresponds to −45°. |
The transformation assumes the rotary axis is orthogonal to the orientation plane, and orientation is possible only in the plane perpendicular to that rotary axis. It supports both moving-tool and moving-workpiece machine types — two-axis swivel head, two-axis rotary table, or one-axis head plus one-axis table.
Programming the Tool Orientation
The vector in the TRAORI() call only sets the basic orientation. The useful part is changing the orientation as you cut, and SINUMERIK gives you several ways to say where the tool points — with a G-code group choosing how the values are read:
| Programmed as | Meaning |
|---|---|
Rotary axes A B C | Position the physical rotary axes directly — the literal way, and what a post usually emits for AXIS POS-style output. |
Angles A2= B2= C2= | Orientation as angles on the virtual orientation axes, read per the active mode: ORIEULER (Euler angles, the standard), ORIRPY (roll-pitch-yaw), or ORIAXES (as orientation/machine axes). Which of Euler vs. RPY is meant when the mode isn’t stated is fixed by $MC_ORIENTATION_IS_EULER (MD21100). |
Vector A3= B3= C3= | Orientation as a direction vector (ORIVECT) — the tool-vector form CAM output favours. |
LEAD / TILT | LEAD = lead angle relative to the surface-normal vector; TILT = tilt about the path tangent. The CAM-friendly way to lean the tool along a surface (bounded by MD21090/21092 MAX_LEAD/TILT_ANGLE). |
THETA= | Angle of rotation about the tool direction (Z) — needs a 3rd rotary axis. |
Two things bite here. Near the pole (tool axis parallel to the 1st rotary axis) an ORIWKS reorientation can demand runaway rotary speed — $MC_TRAFO5_POLE_LIMIT / NON_POLE_LIMIT (24540/24530) bound how the control passes through it. And an orientation-vector or Euler orientation cannot be combined with thread cutting (G33/G331/G332), G04, G63, G74/G75 or REPOS — that raises alarm 12130; a doubly-programmed orientation raises 12240.
Singularities and the Pole
The two orientation axes span a coordinate system of longitude and latitude over a sphere; the pole is where they converge — the tool axis lined up with the 1st rotary axis. Near it, a tiny change in tool orientation demands a huge rotary swing, so one or more axes want to move very fast. Rather than run away, the control raises Alarm 10910 “irregular velocity run in a path axis” and caps the programmed velocity to the maximum axis velocity — it slows through the region instead of gouging. How it negotiates the pole is set by two machine data:
| Machine data | Role at the pole |
|---|---|
$MC_TRAFO5_NON_POLE_LIMIT_1 (24530) | Defines the pole area. If the programmed path passes the pole within this angle, the control routes cleanly through the pole — only the 5th axis moves, the 4th holds its start position — instead of chasing the exact orientation and thrashing. |
$MC_TRAFO5_POLE_LIMIT_1 (24540) | The end-angle tolerance for that through-pole interpolation: how far off the exact pole the “pass through” behaviour still applies. (SW 5.2 and later collapse the two into just POLE_LIMIT.) |
Practical upshot: don’t program an orientation change right at the pole; if a toolpath must cross it, expect the machine to either slow down (10910) or snap the tool through. Interpolating in ORIMKS (machine-axis reference, below) sidesteps the worst of it, because it moves the rotary axes directly rather than trying to hold the tool vector on a straight line past the singularity.
ORIWKS vs. ORIMKS — Reference for Orientation Interpolation
When the tool re-orients between two blocks, the path the orientation sweeps depends on which reference system it’s interpolated in. That’s ORIWKS vs. ORIMKS:
| Command | Reference system | Behavior |
|---|---|---|
ORIWKS (default) | Workpiece coordinate system | Rotation in the WCS. The tool movement does not depend on the machine kinematics — portable across machines. |
ORIMKS | Machine coordinate system | Rotation in the MCS. The movement the tool executes depends on the machine kinematics — use it to program real machine moves, e.g. to avoid a collision with a fixture. |
ORIWKS is the basic setting, and Siemens advises: for a 5-axis program where it isn’t yet obvious which machine will run it, always select ORIWKS — because its motion is kinematics-independent, the program behaves the same everywhere. Reach for ORIMKS only when you need actual machine movements (collision avoidance). Whether the reference follows these G commands is itself machine-data-gated (a set-up mask can force one system).
TCARR — The Orientable Toolholder
Not every “5-axis” job runs a full transformation. For a manually or mechanically set orientable toolholder, SINUMERIK computes tool-length compensation from the holder’s orientation with TCARR and the TCO… path commands:
| Command | Meaning |
|---|---|
TCARR=[<m>] | Request orientable toolholder number m with its geometry (compensation) data. TCARR=0 deselects. |
TCOABS | Determine the tool-length components from the orientation of the current toolholder (its orientation angles). |
TCOFR | Determine the tool-length components from the orientation of the active frame. |
TCOFRZ / TCOFRY / TCOFRX | Orientable toolholder from the active frame, with the tool pointing in the Z / Y / X direction respectively. |
The tool-length offset is re-calculated when you switch between TCOFR and TCOABS. TCARR pairs naturally with the swivel plane cycle — a swivel-mounted workholder or head can be handled as a TCARR toolholder for 3+2 work, while TRAORI is for continuous orientation change.
Resetting at Program Start
Siemens recommends clearing any active transformation and swivel at the top of a program so a leftover state can’t corrupt the setup:
| Block | Effect |
|---|---|
N10 CYCLE800() | Resets the swivelled plane. |
N20 TRAFOOF | Resets TRAORI / TRANSMIT / TRACYL / … |
Parameters by Axis Configuration
TRAORI’s behaviour is fixed by machine data the MTB commissions — but those machine data are worth knowing, because they literally encode whether the rotaries are on the head, the table, or split between them. The master switch is $MC_TRAFO_TYPE_1 (MD24100): its value declares the kinematics.
| Rotary axes | Swivel head (tool) | Rotary table (workpiece) | Mixed (tool + table) |
|---|---|---|---|
| A, B | 16 | 32 | 48 |
| A, C | — | 33 | 49 |
| B, A | 18 | 34 | 50 |
| B, C | — | 35 | 51 |
| C, A / C, B | 20 / 21 | — | — |
The newer generic 5-axis transformation collapses that to one value per kind: 24 = rotatable tool (T), 40 = rotatable workpiece/table (P), 56 = mixed (M), 72 = read the kinematics straight from the orientable toolholder. The geometry vectors that go with the transformation — some of which mean different things depending on type:
| Machine data | What it holds (and how it differs by config) |
|---|---|
$MC_TRAFO5_JOINT_OFFSET_1 (24560) | Head: vector from the 1st to the 2nd swivel joint. Table: machine zero → table swivel joint. Same MD, different meaning per kinematics. |
$MC_TRAFO5_BASE_TOOL_1 (24550) | Base-tool vector: tool tip → 1st rotary axis. |
$MC_TRAFO5_PART_OFFSET_1 (24500) | Table / mixed only: last rotating table joint → table zero. |
$MC_TRAFO5_ROT_AX_OFFSET_1 (24510) | Position offsets of the rotary axes. |
$MC_TRAFO5_AXIS1_1 / AXIS2_1 (24570 / 24572) | Direction vectors of the 1st / 2nd rotary axis. |
$MC_TRAFO5_NUTATOR_AX_ANGLE_1 (24564) | Nutation angle of a 45° / cardan swivel head — not used for a perpendicular AB head. |
$MC_TRAFO5_POLE_LIMIT_1 / NON_POLE_LIMIT_1 (24540 / 24530) | Singularity handling near / through the pole (tool axis parallel to the 1st rotary axis), where ORIWKS can otherwise demand runaway rotary speed. |
$MC_ORIENTATION_IS_EULER (21100) | Whether A2 B2 C2 are read as Euler or RPY angles. |
Notice where the axis pair is encoded. In the classic transformation it’s baked into the type number itself (AB head = 16, BC table = 35, …). In the generic transformation the type stays 24/40/56 and the pair lives in the rotary-axis direction vectors: $MC_TRAFO5_AXIS1_1 / AXIS2_1 = [1,0,0] / [0,1,0] for AB, [1,0,0] / [0,0,1] for AC, [0,1,0] / [0,0,1] for BC (any direction is allowed, so a non-orthogonal axis just gets its true unit vector). Either way the offset vectors above are full measured geometry, not a per-pair component subset — the same principle as Fanuc, which carries the pair in its 19682 / 19687 direction codes rather than in the offset components.
On a machine with an orientable toolholder, the same geometry lives in the TCARR data set and $TC_CARR23 selects the kinematic type there — T rotatable tool (head), P rotatable part (table), M mixed. The head/table split is explicit in how the offset vectors are used: for a type-P (table) holder l1 is ignored and l2/l3/l4 carry the geometry; for a type-T (head) holder l1 is significant and l4 is ignored. And note the two manuals differ on the orientation-reference default: the NC-programming manual calls ORIWKS the basic setting while the Function Manual calls ORIMKS basic — the true default is set per machine by $MC_GCODE_RESET_VALUES[24].
Transformation machine data from SINUMERIK 840D sl Transformations Function Manual (F2), A5E47435470B AA (06/2019) — §3.2.3 (type table p.147), MD list §2.9; orientable-toolholder $TC_CARR fields from the Tools Function Manual (W1), A5E47435126B AA §2.8.
See also — the same idea on other controls: Fanuc keeps the tool tip on path with Tool Center Point control (G43.4 tool-axis / G43.5 vector); Heidenhain uses FUNCTION TCPM (M128’s successor). For the neighbouring Siemens features: Swivel Plane (CYCLE800) for 3+2 tilted-plane work and Workpiece Alignment (CYCLE998 & frames). For how TCP and tilted-plane machining compare across brands, see the cross-control primer on TWP and TCPM.
Sources: SINUMERIK 840D sl / 840D / 840Di sl NC Programming Programming Manual, A5E47432823B AA (06/2019) — §3.9.2.2 Three, four and five axis transformation (TRAORI), §3.9.2.6 Reference of the orientation axes (ORIWKS, ORIMKS), and §3.13.9 Tool length compensation for orientable toolholders (TCARR, TCOABS, TCOFR, TCOFRX/Y/Z). Transformation machine data: SINUMERIK Function Manual, Special Functions (F2).
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch