Resolving TRAORI 0.5mm X-Axis Shift on Sinumerik 5-Axis

David Krause15 min read
Motion ControlSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Problem Overview

A Sinumerik 840D sl 5-axis machine tool exhibits a 0.5 mm positional offset on the X axis only when TRAORI is active. The same part program produces correct geometry under 3+2 (face/planar) machining, with the CYCLE800 swivel cycle, and with the workpiece probe cycle, but as soon as the controller executes TRAORI followed by simultaneous 5-axis interpolation (CYCLE832(... _ORI_FINISH ...)), every motion vector on the linear axes X/Y/Z is translated by approximately 0.5 mm in the X direction. The offset is constant, repeatable, and independent of the programmed feed rate, RPM, or the part position inside the working envelope.

The symptom is characteristic of a kinematic-chain calibration error on a 5-axis machine, not a servo or drive issue. The fact that 3+2 operation is unaffected rules out axis-positioning problems, backlash, ball-screw pitch error, and most frame arithmetic. The fault lies in how TRAORI interprets the rotary-axis geometry compared with how CYCLE800 and the mechanical zero of the rotary axes were last calibrated.

Engineering rule of thumb: if 3+2 (CYCLE800) and the probe agree, but 5-axis (TRAORI) is offset, suspect one of three things: (a) a stale or missing CYCLE996 measurement of the kinematic switch point, (b) orientation reference mismatch (ORIWKS vs ORIMKS), or (c) a tool-length/holder offset that TRAORI applies but CYCLE800 does not.

2. Affected Configuration

Item Value / Identifier
Controller Sinumerik 840D sl (NCU 710/720/730) or 840D
Software version Confirmed against SW 4.5 SP2 / 4.7 / 4.8 families; behavior identical on 840DE sl
Transformation 5-axis (TRAORI) – typically TRAFO_TYPE = 16, 24, 32, 40, 56, 72, or 80 depending on kinematic class (head-head, head-table, table-table)
Rotary axes A (swivel, around X) and C (rotary table, around Z) – confirmed in program via A-24.4821 C=DC(144.4993)
Affected NC blocks All blocks after TRAORI (N183011 onward)
Affected direction X axis only (Y and Z clean)
Magnitude 0.5 mm (constant, repeatable)
Programmed geometry T6 5-axis finishing at constant Z; finishing tolerance _ORI_FINISH via CYCLE832

Confirming these identifiers in the part program is the first step of triage:

N182999 ; OPERAZIONE - 2: T6 5X FINITURA A Z COSTANTE - 1
N183000 D1
N183001 R1=3500.   ; Avanzamento XY
N183002 R2=1289.   ; Avanzamento Z
N183003 R8=14.2857*R1
N183004 S12032.
N183005 M3
N183006 M8
N183007 M25 ; A STAFFAGGIO OFF
N183008 M27 ; C STAFFAGGIO OFF
N183009 G00 Z254.839
N183010 G00 X-195.0943 Y69.4763 A-24.4821 C=DC(144.4993)
N183011 TRAORI
N183012 G00 X-17.4463 Y-292.3527 Z198.3922
N183013 G00 X4.4503 Y-268.5355 Z109.5213
N183014 ; --- FINISH_5X ---
N183015 CYCLE832(0.01,_ORI_FINISH,0.1)

Note the positioning pair A-24.4821 C=DC(144.4993) just before TRAORI. This is a 3+2 style approach, then the program switches to simultaneous 5-axis. DC(...) means the C axis is approached via the shortest path (direct). The X shift appears at the first block under TRAORI, which is the key diagnostic clue.

3. Root Cause Analysis

There are four realistic root causes for a constant 0.5 mm X-only shift that appears only under TRAORI. They are ranked by frequency of occurrence on installed machines.

3.1 Kinematic switch point / pivot point offset on the A axis

Every 5-axis transformation in Sinumerik is parameterised by the switch point (also called the pivot point, TCP, or center of rotation) of each rotary axis. The switch point is the physical point in machine space that does not move when the rotary axis turns. For a head-type A axis, the switch point is defined by:

  • Distance from the A-axis mechanical zero to the spindle face in Z (the A-axis offset vector), and
  • Radial offset of the spindle centerline from the A-axis rotation center in X and Y (the orthogonal offset vector).

If the A-axis switch point stored in the kinematic chain ($NK_A_OFF, $NK_B_OFF, $NK_C_OFF in the kinematic chain configuration, or the equivalent $MC_TRAFO5_* machine data on older SW versions) is off by 0.5 mm in X, the controller will translate every commanded X motion by that amount when TRAORI is active. CYCLE800 does not use the same chain, which is why 3+2 is unaffected.

3.2 CYCLE996 measurement not performed (or performed on stale data)

CYCLE996 (Measure kinematics) is the only way to populate the switch-point numbers reliably on most machine builders' commissioning. If the machine was built with hand-typed values, or the values were inherited from a 3-axis option file and never re-measured when the A axis was added, the offsets are guesses. A 0.5 mm X error is exactly the kind of error introduced by measuring with a long test bar instead of a sphere-bar on the spindle, or by measuring in machine zero instead of the rotary-axis zero.

3.3 Orientation reference mismatch: ORIWKS vs ORIMKS

Just before TRAORI is called, the operator (or post-processor) should set the orientation reference:

Command Meaning When to use
ORIWKS Tool orientation referenced to the active workpiece coordinate system (WCS) Default for 5-axis CAD/CAM toolpaths; the orientation vector follows the part
ORIMKS Tool orientation referenced to the machine coordinate system (MCS) Head swivels that must stay in the same machine direction regardless of part rotation

Mixing ORIWKS with values in CYCLE800 that were captured under ORIMKS (or vice versa) causes the controller to interpret the orientation vector from a different reference frame, which on a head-A / table-C machine typically shows up as a constant X or Y shift of a few tenths of a millimeter at the tool tip.

3.4 Tool-length and tool-holder compensation loaded in TRAORI but not in CYCLE800

TRAORI can be configured (via the transformation machine data) to include or exclude the active tool length and the active orientable tool holder (TCARR). If the tool T6 in the program has a length that was last measured in a 3+2 context and the TCARR frame is set with an X component, that component will be added to every linear block under TRAORI and will be visible as an X shift. CYCLE800 reads from the same tool tables but does not apply the holder vector in the same way when 3+2 is selected, so the same tool produces no error in CYCLE800.

4. Diagnostic Procedure

Follow the steps in order. Each step produces a fact that rules in or out one of the four root causes.

Step 1 — Capture the offset precisely

  1. Run the part program to completion under TRAORI.
  2. Probe the actual machined feature center with the workpiece probe (CYCLE976 or equivalent on the controller).
  3. Compare the measured center with the CAD nominal in X. Confirm the offset is on X, is constant across Y/Z, and equals 0.5 mm within 10 µm.
  4. Repeat with the A axis at +30° and -30° to confirm the offset is independent of A position. If the offset grows with A angle, root cause is switch-point offset on A (3.1). If it is constant, continue.

Step 2 — Run the same toolpath under 3+2 only

  1. Disable TRAORI at N183011 and replace with the equivalent CYCLE800 call to bring the part into the orientation used at N183010.
  2. Re-execute.
  3. If the 0.5 mm X offset disappears, the problem is exclusively in the TRAORI chain. If it remains, the issue is in the tool frame, the work offset, or the CYCLE800 table.

Step 3 — Inspect the orientation reference

Open the part program header and confirm which orientation reference is active before the first TRAORI call. Insert the appropriate command if missing:

N183010 G00 X-195.0943 Y69.4763 A-24.4821 C=DC(144.4993)
N183010a ORIWKS            ; *** add this line for CAM-generated toolpaths ***
N183011 TRAORI
N183012 G00 X-17.4463 Y-292.3527 Z198.3922

If the post-processor omitted ORIWKS (or ORIMKS), the controller's default for the previous block state applies. The default is configurable and depends on the active G-code group, which is why the symptom can appear on one machine but not another with identical kinematics.

Step 4 — Check the kinematic chain

Display the active kinematic chain on the HMI. The path is operator-dependent on the Sinumerik, but the typical path is:

  1. Commissioning → Kinematics → Kinematic chain.
  2. Select the chain used by the active transformation (1, 2, 3 …, depending on MD20150 $MC_GCODE_RESET_VALUES and the TRAFO chain number).
  3. Note the OFFSET vector of the A-axis node and the C-axis node.

For a head-A / table-C configuration, the A-axis node must contain an OFFSET vector whose X component places the pivot at the spindle centerline. If the X component of that OFFSET differs from the geometric center of the A-axis trunnion, that is the shift.

Step 5 — Verify CYCLE996 has been run

On the HMI, look at the timestamp and "source" of each $NK_… vector in the kinematic chain. If the source is "default" or "from MD" rather than "from CYCLE996", the chain has never been re-measured and the offsets are theoretical, not empirical.

Step 6 — Compare CYCLE800 switch-point table

CYCLE800 stores its switch point in a different data block. The standard location is in the swivel data, parameter set under:

  • $SN_SWITCH_POINT_X, $SN_SWITCH_POINT_Y, $SN_SWITCH_POINT_Z (machine-specific setting data)
  • Or the equivalent GUD / frame variable used by the machine builder's CYCLE800 implementation.

Compare the CYCLE800 switch point with the kinematic-chain switch point. They must agree. If CYCLE800 reports the spindle face as the switch point but the kinematic chain uses the trunnion center, every toolpath will be offset by the difference between those two reference points. On a typical A-axis trunnion 150 mm in front of the spindle face, a 0.5 mm angularity of the trunnion cast iron projects to 0.5 mm at the spindle face — exactly the symptom.

5. Resolution Path A — Re-measure the kinematic chain with CYCLE996

This is the canonical fix. CYCLE996 is the Siemens standard cycle for measuring the kinematic switch point of each rotary axis on a 5-axis machine.

  1. Mount a calibrated sphere bar (or a sphere on a ground stud) in the spindle. Typical calibration: ±0.003 mm sphere eccentricity, with the sphere center known in the spindle coordinate frame.
  2. Set the A axis to mechanical zero, the C axis to mechanical zero, and bring the sphere into contact with a fixed probe in the working area (or use the workpiece probe on a known datum).
  3. Call CYCLE996 from MDI: CYCLE996(S1, "A", 1, 0) for the A-axis switch point. The arguments vary by SW version; the dialogue on the HMI prompts for the measuring strategy.
  4. Repeat for the C axis: CYCLE996(S1, "C", 1, 0).
  5. After the cycle completes, verify the new $NK_… vectors are populated and that the "source" field is "CYCLE996" with today's timestamp.
  6. Re-run the part program. The X offset must collapse to within ±0.02 mm.
Caution: CYCLE996 must be run at the same machine warm-up state as production. Run it after the spindle and axes have completed their warm-up cycle. A cold machine has different bearing preload, which introduces a 10–30 µm error in the switch point that is irrelevant on a precision grinder but visible on a finishing toolpath at 0.01 mm tolerance.

6. Resolution Path B — Align CYCLE800 and TRAORI switch points

If the kinematic chain was measured correctly but the X offset persists, the CYCLE800 switch-point data and the kinematic chain switch point are out of sync. The fix is to overwrite the CYCLE800 setting data so it matches the kinematic chain.

  1. Read the A-axis switch point from the kinematic chain on the HMI. Note the X, Y, Z components relative to the A-axis mechanical zero.
  2. Open the swivel data editor and edit $SN_SWITCH_POINT_X, $SN_SWITCH_POINT_Y, $SN_SWITCH_POINT_Z for each entry used by the active swivel table. (Most machines have 5 to 10 entries; the active one is selected by the swivel number passed to CYCLE800.)
  3. Enter the same values as the kinematic chain.
  4. Save, restart NC (or trigger the appropriate CFGRI / RESET action depending on the machine builder's boot file).
  5. Re-test.

7. Resolution Path C — Set the orientation reference explicitly

If the post-processor for the CAM system is not emitting ORIWKS or ORIMKS, add it as a permanent line in the NC program template just before TRAORI. For 5-axis CAM toolpaths, the correct value is virtually always ORIWKS:

; *** pre-TRAORI block, mandatory for CAM post-processors ***
N183010 G00 X-195.0943 Y69.4763 A-24.4821 C=DC(144.4993)
N183010a ORIWKS
N183011 TRAORI
N183012 G00 X-17.4463 Y-292.3527 Z198.3922

To make this permanent across all programs, configure it in the post-processor or, as an interim measure, override the default in the NC program header using a custom GUD or by editing the post to emit the line.

8. Resolution Path D — Tool and holder compensation audit

If Steps 1 through 6 do not eliminate the offset, the remaining cause is the tool length / tool holder. Perform the following audit:

  1. Read the active tool data for T6. Check the geometry lengths L1, L2, L3 in the tool list.
  2. Read the active orientable tool holder frame from the settings. Most post-processors emit a TCARR(n) call; check that the holder number matches the one referenced by the kinematic chain.
  3. Confirm the holder frame has zero X component. A non-zero X component on the TCARR frame is a frequent source of "phantom" 5-axis offsets.
  4. If the holder X component is non-zero but the user knows the holder is symmetric, zero it and re-test.

9. Machine Data and Setting Reference

The following identifiers are the ones to audit on a 5-axis machine that exhibits TRAORI-only offsets. The list is comprehensive; not every machine uses every identifier.

Identifier Type Purpose
$MC_TRAFO_TYPE_1 … 8 Machine data Transformation class (16, 24, 32, 40, 56, 72, 80 for the 5-axis types)
$MC_TRAFO_AXES_IN_1 Machine data Channel axes feeding the transformation
$MC_TRAFO_AXES_OUT_1 Machine data Cartesian output axes of the transformation
$MC_TRAFO5_BASE_TOOL_… Machine data Base-frame to tool offset (depending on SW version)
$MC_TRAFO5_JOINT_OFFSET_… Machine data Joint (rotary axis) offset vector in the chain
$MC_TRAFO5_PART_OFFSET_… Machine data Part-frame offset, applied before tool frame
$NT_PO_NAME[], $NT_PO[] Name table Transformation identifier (chain name)
$NK_NAME, $NK_AXIS, $NK_A_OFF, $NK_B_OFF, $NK_C_OFF Kinematic chain Switch-point offset vectors of each chain element
$SN_SWITCH_POINT_X / Y / Z Setting data CYCLE800 switch point (legacy / swivel table)
$MC_ORI_DEF_WITH_G_CODE Machine data Whether the controller expects an ORIWKS/ORIMKS before TRAORI
$MC_RESET_MODE_MASK Machine data Bit field controlling which G codes are reset on reset / end of program
$MC_GCODE_RESET_VALUES Machine data Default G codes for group 50 (orientation reference)
$MC_TRAFO5_ORI_ASSIGN_… Machine data Assignment of orientation vectors to physical axes
All identifiers prefixed with $MC_ are channel-specific machine data. All prefixed with $MN_ are NCK-global. All prefixed with $NK_ belong to a named kinematic chain. All prefixed with $SN_ are NCK-global setting data. Some identifiers are only present on Sinumerik ONE / 840D sl SW 4.7+; on older controllers, the equivalent is found in the legacy $MC_TRAFO5_* machine data set.

10. Diagnostic Flowchart

TRAORI 0.5 mm X shift observed Probe measured offset on X axis Offset grows with A angle? YES — switch-point error on ARe-run CYCLE996 on A axis ORIWKS/ORIMKS declared? NO — add ORIWKS or ORIMKSpost-processor + NC program CYCLE800 vs TRAORI switch-point audit YES NO YES NO

11. Verification Procedure

After applying any of the four resolutions, run the following acceptance test before releasing the machine to production.

  1. Warm the machine through the standard warm-up cycle.
  2. Load a calibration sphere in the spindle. Run the kinematic-sphere test program provided by the machine builder. The sphere center must be located within ±0.020 mm of the CAD nominal at A = 0°, A = +30°, A = -30° (with C compensating).
  3. Run a 5-axis test cut on a verification artefact (a cube with a sculpted 5-axis face). Measure with a CMM. The X, Y, Z deviation at every probed point must be within the test-cut tolerance, typically ±0.02 mm on the 0.01 mm finishing tolerance CYCLE832(0.01,…).
  4. Re-run the original part program. The 0.5 mm X shift must be gone.

12. Prevention and Best Practices

  • Always emit ORIWKS in the post-processor just before TRAORI. Treat it as a mandatory line, not an option.
  • Re-run CYCLE996 after any mechanical intervention on the rotary axes: bearing change, encoder replacement, collision, or trunnion re-shimming. Record the timestamp of the last measurement in the machine log.
  • Compare CYCLE800 and TRAORI switch points at every scheduled service. A divergence between the two is the earliest sign of mechanical drift.
  • Use SUPA (suppress all work offsets) only where the post-processor intends to. The original program uses SUPA D0 at the safe-position approach, which is correct, but the post-processor must not emit SUPA inadvertently inside the 5-axis block, which would clear the active frame and re-introduce an offset.
  • Document the tool-holder frame for every 5-axis tool. An orientable holder with an unintended X offset in the TCARR frame is a common, silent source of 0.3 to 0.8 mm offsets.
  • Keep a CYCLE832 default tolerance of 0.01 mm only for finishing. Roughing and semi-finishing passes can use looser tolerances (0.05 to 0.1) which reduce contouring load and surface-mark risk.

13. Frequently Asked Questions

Why does 3+2 (CYCLE800) work correctly while 5-axis (TRAORI) is offset by 0.5 mm on X?

3+2 machining positions the rotary axes but interpolates only linear axes, so the controller uses the CYCLE800 switch-point data and ignores the kinematic chain switch point. TRAORI activates the full 5-axis transformation, which uses the kinematic chain. If the kinematic chain switch point is wrong, only TRAORI shows the error. The two data sources must be in sync, and CYCLE996 is the only cycle that aligns them empirically.

Does the 0.5 mm offset being constant (not growing with A angle) rule out a mechanical issue?

It rules out gross mechanical looseness or trunnion offset, but it does not rule out a constant offset in the A-axis switch-point data. A constant offset between the measured and actual trunnion center produces a constant error at the tool tip, exactly the symptom. CYCLE996 must still be run.

What is the minimum set of NC commands to verify TRAORI is initialized correctly?

Use TRAORI followed by a single test block G01 X0 Y0 Z0 A0 C0 F500 and read the actual axis positions on the HMI position display. If the displayed machine positions for X, Y, Z are within ±0.02 mm of zero, the transformation is initialized correctly. The same block under TRAFOOF should display the same machine position; if not, the transformation is being applied on top of an offset.

Is ORIWKS or ORIMKS the correct choice for typical CAM-generated 5-axis toolpaths?

ORIWKS. CAM systems produce toolpaths in the workpiece coordinate system, so the orientation vector is naturally referenced to the WCS. Use ORIMKS only when the post-processor explicitly outputs MCS-referenced orientation vectors, which is rare outside specialized routines (e.g., drilling cycles on a swivel head).

Can a TCARR frame cause a 0.5 mm X offset under TRAORI but not under CYCLE800?

Yes. The TCARR (orientable tool holder) frame is included in the kinematic chain calculation, so a non-zero X component in the holder frame is added to every linear axis command under TRAORI. Under CYCLE800, the holder frame is treated as a static offset on the rotary axis position and does not propagate to the linear axes the same way. Audit the TCARR frame and zero out any unintended X component.

Back to blog