FANUC G68 Coordinate Rotation, G51 Scaling, G51.1 Mirror Image and G16 Polar Coordinates (Milling)

23 October 2026

Mentor CNC Editorial Team

FANUC machining centers have four command groups for programming the same profile again rotated, enlarged or reduced, mirrored or arranged on a circle: G68/G69 coordinate system rotation, G50/G51 scaling, G50.1/G51.1 programmable mirror image and the G15/G16 polar coordinate command. This guide explains the format, addresses, related parameters, alarms and the order of combined use for each command, based on the FANUC 0i-MB (B-63844TR), 0i-MD (B-64304EN-2) and 0i-MF (B-64604EN-2, B-64610EN) manuals. The commands are for milling (M series); the lathe equivalents are noted at the end of the page.

Control and Series Compatibility

All four functions are in the FANUC M series G-code table: G15/G16 in group 17, G50/G51 in group 11, G50.1/G51.1 in group 22, G68/G69 in group 16. On the 0i-MB scaling is enabled per axis with 5401#0 (SCLx); on the 0i-MD and 0i-MF additionally with 8132#5 (SCL). Whether rotation, mirror image and the polar command are available depends on the machine configuration; if a G code is not recognised, check the machine builder’s option list.

G68 / G69 Coordinate System Rotation

Command format

G17 (G18, G19) G68 α_ β_ R_ ;   (rotation starts)
  ...
G69 ;                           (cancel)
  • α_ β_: the two axes of the selected plane (X and Y in G17); the absolute coordinates of the rotation centre. If omitted, the tool position at the G68 block becomes the centre.
  • R_: angle; a positive value is counter-clockwise. Least input 0.001°, range −360000 to 360000 (−360.000° to 360.000°). If R is omitted, the angle in parameter 5410 is used.
  • 5400#0 (RIN): 0 = R is always an absolute angle; 1 = absolute or incremental according to G90/G91. With incremental R the same profile can be rotated repeatedly in a loop.
  • The plane (G17/G18/G19) is selected before the G68 block; the plane cannot be changed in rotation mode.
  • Cutter radius compensation, tool length compensation and offsets are applied after rotation. G68 and G69 may be commanded in compensation mode, but the manual recommends commanding G68 before G41/G42, not inside it.
  • On the 0i-MF, G68 with I, J, K is processed as three-dimensional coordinate conversion, without them as two-dimensional rotation; 11630#0 (FRD) = 1 sets the angle unit to 0.00001°.

Restrictions and alarms

  • G27–G30 and G52–G59/G92 are not commanded in rotation mode; the 0i-MD manual states alarm PS0412. Cancel with G69 first.
  • The first move after G69 must be absolute; an incremental move is calculated incorrectly.
  • The rotation plane must be the same as the arc or cutter compensation plane; otherwise PS0144 (P/S 144 on 0i-MB) “illegal plane selected” is issued.
  • G68/G69 cannot be commanded in the same block as G53.
  • On the 0i-MD/0i-MF, 11600#5 (AX1) decides whether a single-axis absolute command is calculated before or after rotation. Manual example: in G68 X0 Y0 R45 mode a lone Y14.142 goes to X−2.929 Y17.071 with AX1 = 0 and to X0 Y20 with AX1 = 1. The 0i-MB has no such parameter.

Example: machining the same profile rotated in 45° steps (0i-MD manual, RIN = 1)

G92 X0 Y0 G69 G17 ;
G01 F200 H01 ;
M98 P2100 ;          (original profile)
M98 P072200 ;        (O2200 seven times: +45° each call)
G00 G90 X0 Y0 M30 ;

O2200 G68 X0 Y0 G91 R45.0 ;   (RIN=1: R incremental)
G90 M98 P2100 ;
M99 ;

O2100 G90 G01 G42 X0 Y-10.0 ;
X4.142 ;
X7.071 Y-7.071 ;
G40 ;
M99 ;

Each call of O2200 adds R45.0 incrementally; G90 returns to absolute mode and O2100 machines the profile in the rotated coordinate system. M98 P072200 calls the subprogram seven times.

G50 / G51 Scaling

Command format

G51 X_ Y_ Z_ P_ ;          (same factor on all axes; 5400#6 XSC = 0)
G51 X_ Y_ Z_ I_ J_ K_ ;     (factor per axis; XSC = 1; negative value = mirror)
  ...
G50 ;                       (cancel)
  • X_ Y_ Z_: scaling centre, treated as absolute even in G91 mode. If omitted, the tool position at the G51 block is the centre. The first move after G51 must be absolute.
  • P_: magnification for all axes; if omitted, parameter 5411 is used. I_ J_ K_: separate magnification for X, Y, Z; for an axis not specified, the per-axis parameter 5421 is used, and 5421 must not be zero.
  • Magnification unit 5400#7 (SCR): 0 = 0.00001, 1 = 0.001. P, I, J, K are written without a decimal point. The manual example I750 J250 means X×0.75, Y×0.25 in the SCR = 1 unit; check SCR on your own machine before copying values.
  • A factor taken from a parameter is fixed at the G51 block; a later parameter change does not affect the mode.
  • G51 is commanded in a separate block and cancelled with G50 when the work is done.

Alarms

  • PS0142 (0i-MB: P/S 142) ILLEGAL SCALE RATE: factor is 0 or outside the permitted range (outside 1–999999 on 0i-MB).
  • PS0006: negative P. PS0007: P, I, J or K written with a decimal point.
  • PS0143 (0i-MB: P/S 143): scaled motion data overflow.
  • 0i-MB P/S 141: G51 commanded in cutter compensation mode.
  • G27–G30 and G52–G59/G92 are not commanded in scaling mode (0i-MD: PS0412).

What is not scaled, and circular motion

Cutter radius compensation, tool length compensation and tool offset values are not scaled. In canned cycles the cut-in Q and retract d of G83/G73, the G76 fine boring shift and the G87 shift amount Q are not scaled; manual moves are not affected either. With different factors per axis the tool does not cut an ellipse: because the end point of the arc command no longer lies on the arc, the motion becomes spiral interpolation. Manual example: with X×2 and Y×1, the command G02 X100.0 Y0.0 I0 J-100.0 is executed as the equivalent of G02 X200.0 Y0.0 I0 J-100.0. In a plane where a negative I/J/K applies a mirror, the direction of circular motion, the cutter compensation side and the sense of the rotation angle are reversed.

Example: per-axis scaling (0i-MD / 0i-MF manual)

O1 ;
G51 X20.0 Y10.0 I750 J250 ;   (centre X20 Y10; X×0.75, Y×0.25; SCR=0, XSC=1)
G00 G90 X60.0 Y50.0 ;
G01 X120.0 F100 ;
G01 Y90 ;
G01 X60 ;
G01 Y50 ;
G50 ;
M30 ;

G50.1 / G51.1 Programmable Mirror Image

Command format

G51.1 X_ Y_ Z_ ;   (mirror starts; X_ Y_ Z_: point and axis of symmetry)
  ...
G50.1 X_ Y_ Z_ ;   (cancel; only the axis of symmetry is written, no point)
  • If a mirror image is also selected by an external switch or CNC setting, the programmable mirror image is applied first.
  • When the mirror is applied on one axis of the plane, G02 ↔ G03, G41 ↔ G42 and, in coordinate rotation, clockwise ↔ counter-clockwise are swapped.
  • Order: mirror (G51.1) → scaling (G51) → rotation (G68); cancel in reverse order. G50.1/G51.1 is not commanded while scaling or rotation mode is active.
  • G27–G30 and G52–G59/G92 are not commanded in mirror mode (0i-MD: PS0412); not in the same block as G53.
  • On the 0i-MF, G50.1/G51.1 is described in the common operator manual (B-64604EN); in polar mode the G51.1 axes are not converted.

Example: mirror in four quadrants with negative scaling (0i-MB manual)

The manuals do not contain a complete example program written with G51.1; the same figure is given in the 0i-MB manual with negative-magnification G51. XSC = 1 is required; I1000/J1000 mean 1.000 according to the SCR setting.

O9000 ;                          (subprogram: triangle)
G00 G90 X60.0 Y60.0 ;
G01 X100.0 F100 ;
G01 Y100.0 ;
G01 X60.0 Y60.0 ;
M99 ;

N10 G00 G90 ;
N20 M98 P9000 ;                        (original)
N30 G51 X50.0 Y50.0 I-1000 J1000 ;     (mirror in X)
N40 M98 P9000 ;
N50 G51 X50.0 Y50.0 I-1000 J-1000 ;    (mirror in X and Y)
N60 M98 P9000 ;
N70 G51 X50.0 Y50.0 I1000 J-1000 ;     (mirror in Y)
N80 M98 P9000 ;
N90 G50 ;

G15 / G16 Polar Coordinate Command

Command format

G17 (G18, G19) G90 (G91) G16 ;   (polar mode starts)
G00 X_ Y_ ;                     (X: radius, Y: angle — in the G17 plane)
  ...
G15 ;                           (cancel)
  • The first axis of the selected plane is the radius, the second axis is the angle.
  • G90: the polar centre is the origin of the workpiece coordinate system. G91: the centre is the current tool position. If a G52 local coordinate system is active, the centre is the local origin.
  • The positive direction of the angle is counter-clockwise from the plus direction of the first axis. Radius and angle may be absolute or incremental; with the G90 centre an incremental angle is added to the previous angle.
  • In polar mode arcs (G02/G03) are commanded with radius R.
  • The axis values of these commands are not interpreted as polar: G04, G10, G52, G92, G53, G22, G68, G51 (on the 0i-MF also G10.6, G92.1, G72.1/G72.2, G07.1, G51.1). Optional angle chamfering and corner R cannot be used in polar mode.
  • On the 0i-MF the behaviour when the radius or angle address is omitted is selected with 10351#5 (PCC) (0 = 0i-F behaviour, 1 = 0i-C compatible).

Example: bolt hole circle (0i-MD / 0i-MF manual)

N1 G17 G90 G16 ;
N2 G81 X100.0 Y30.0 Z-20.0 R-5.0 F200.0 ;  (radius 100, angle 30°)
N3 Y150.0 ;                               (radius 100, angle 150°)
N4 Y270.0 ;                               (radius 100, angle 270°)
N5 G15 G80 ;

The same holes can be programmed with an incremental angle: N3 G91 Y120.0 ; N4 Y120.0 ; adds 120° each time.

Order of Combined Use and Interactions

CaseRule
Scaling + rotationG51 → G68 → … → G69 → G50. Scaling is applied first; the rotation centre is scaled, the angle R is not.
With cutter compensation(G40) → G51 → G68 → … → G41/G42 → … → G40 → G69 → G50. Rotation always before compensation.
With mirror imageG51.1 → G51 → G68; cancel in reverse order. G50.1/G51.1 is not commanded in scaling or rotation mode.
With polar coordinatesAxis values in G68 and G51 blocks are not treated as polar; arcs in polar mode use R.
Reference and coordinate commandsG27–G30, G52–G59, G92 are not commanded in any of the three modes; cancel first.
Single block and displayThe position display shows the converted value; a block whose motion rounds to zero can affect cutter compensation.

Common Mistakes

  • Omitting the centre in the G68 or G51 block and letting the tool position become the centre.
  • Continuing with an incremental move after G69 or G50; the first move must be absolute.
  • Writing the magnification with a decimal point (P1.5) → PS0007; writing P1500 without knowing the SCR unit (it means 0.015 when SCR = 0).
  • Returning to reference with G28 in rotation mode → PS0412 on the 0i-MD.
  • Arc or cutter compensation in a different plane → PS0144.
  • Forgetting that G02/G03 and G41/G42 swap on a mirrored axis and compensating to the wrong side.
  • Using these formats in a lathe program; on a lathe G50 and G68 mean something else.

Differences by Series

Item0i-MB0i-MD0i-MF
Scaling enable5401#0 SCLx8132#5 SCL + 5401#0Same
Magnification parameters5400#6 XSC, 5400#7 SCR, 5411, 5421SameSame
Alarm formatP/S 141, 142, 143, 144, 006, 007PS0142, 0006, 0007, 0412PS0142, 0143, 0144, 0006, 0007
Rotation angle unit0.001°0.001° (0.00001° with FRD 11630#0)Same
Single-axis command 11600#5 AX1NoneYesYes
G68 with I J K (3D conversion)Not described in the sectionNot in the sectionDescribed explicitly
Polar PCC 10351#5NoneNoneYes
Where G50.1/G51.1 is describedM manualM manualCommon (T/M) manual

Lathe Equivalents

In the FANUC lathe (T series) G-code table, G50 is the coordinate system setting and maximum spindle speed limit in G-code system A, and G68/G69 is the mirror image / balance cut command for twin-turret machines. Coordinate rotation on a lathe is done with G68.1/G69.1, and polar machining with G12.1/G13.1 polar coordinate interpolation. The formats on this page are not used in lathe programs.

Frequently Asked Questions About G68, G51, G51.1 and G16

Why did my G68 rotation not come out where I expected?

The three most common reasons: the rotation centre (X_ Y_) was omitted, so the control used the tool position at the G68 block as the centre; the sign of R was confused (positive is counter-clockwise); or 5400#0 (RIN) = 1 and R was interpreted incrementally in G91 mode. Also remember that the first move after G69 must be absolute.

Does G51 scaling also scale cutter radius compensation?

No. Cutter radius compensation, tool length compensation and tool offset values are not scaled. In canned cycles the Q cut-in and d retract of G83/G73, the G76 fine boring shift and the G87 shift Q are not scaled either. Scaling applies only to programmed coordinates.

What changes when I use I J K instead of P?

With P all axes are scaled by the same factor (5400#6 XSC = 0). With I, J, K separate factors are given for X, Y and Z (XSC = 1) and a negative value applies a mirror image on that axis. In both forms the magnification is written without a decimal point; the unit is 0.00001 or 0.001 according to 5400#7 (SCR). A decimal point gives PS0007, a negative P gives PS0006 and a zero factor gives PS0142.

In which order are G68, G51 and G51.1 commanded together?

Command order: G51.1 (mirror) → G51 (scaling) → G68 (rotation) → G41/G42 (cutter compensation); cancel in reverse order G40 → G69 → G50 → G50.1. The manual asks that G68 is not commanded inside cutter compensation and that rotation always comes before compensation. With scaling plus rotation, scaling is applied first; the rotation centre is scaled, the angle is not.

In G16 polar coordinates, which address is the radius and which is the angle?

The first axis of the selected plane is the radius and the second axis is the angle: in G17, X is the radius and Y is the angle. With G90 the centre is the origin of the workpiece coordinate system, with G91 it is the current tool position. The positive direction of the angle is counter-clockwise from the plus direction of the first axis. In polar mode arcs are commanded with R, not I/J.

Do these commands also apply to a CNC lathe?

No. The formats on this page come from the FANUC machining center (M series) manuals. On a lathe G50 is the coordinate system setting and maximum spindle speed limit, and G68/G69 is the balance cut command on twin-turret machines; coordinate rotation on a lathe is G68.1/G69.1, and instead of polar coordinates there is G12.1/G13.1 polar coordinate interpolation.

Safety Warning and Disclaimer

Rotation, scaling and mirror commands change the toolpath in ways that are not visible in the program text; a centre or sign error can send the tool outside the part or into the vice. Prove every new program on the graphic screen first, then in dry run and in single block at reduced feed. This page is based on the FANUC 0i-MB (B-63844TR), 0i-MD (B-64304EN-2) and 0i-MF (B-64604EN-2, B-64604EN, B-64610EN) manuals; parameter numbers and alarms are given as printed there. The machine builder’s manual and parameter list take precedence; option status and parameter settings vary by machine. Mentor CNC cannot be held liable for damage or loss arising from the use of this information.