This is an educational explanation of a common Fanuc alarm, not operating instructions for your specific machine. Always follow your machine’s manual and supervisor when clearing an alarm.

Fanuc alarm 021, ILLEGAL PLANE AXIS COMMANDED, is an arc problem. The control was asked to cut a circular move (G02 or G03) using an axis that is not part of the plane it is currently set to. It stops rather than try to draw an arc it cannot define.

Arcs live in a plane

A circular move is a two-axis move, so the control has to know which two axes. That is the whole job of plane selection, explained in G17, G18, G19 plane selection. Each plane allows a specific pair of axes and a specific pair of arc-center words, as documented in the LinuxCNC reference:

Active planeArc axesArc-center words
G17 (XY)X, YI, J
G18 (XZ)X, ZI, K
G19 (YZ)Y, ZJ, K

Command anything outside the active row and you get alarm 021.

What triggers it

Active planeBad blockWhy it alarmsFix
G17 (XY)G02 X10. K5. ...K is the Z center word, not in XYUse I and J
G17 (XY)arc moving only X and Zthat arc is in the XZ planeSwitch to G18
G18 (XZ)G02 ... J5.J is the Y center word, not in XZUse I and K
G19 (YZ)G02 ... I5.I is the X center word, not in YZUse J and K

Most real cases are one of these: an arc meant for a vertical plane left running in G17, or the wrong center word (I, J, K) for the active plane. The Fanuc alarm code lists place 021 among the program alarms, and the Wikipedia G-code overview explains how the arc words map to each plane.

How to fix it

The alarm names the block, so the fix is quick: decide which plane the arc should be cut in, then make that plane active before the arc. An arc in the front face is G18; an arc in the side is G19; a normal flat arc is G17. Then check that the center words match the plane: I and J for G17, I and K for G18, J and K for G19. This is the same reasoning behind a clean G02 vs G03 move, just with the plane made explicit. Reading the block to spot the mismatch is the same skill as reading any CNC program.

Helical moves are the exception

One case looks like it should alarm but does not: a helix. In G17, a G02 or G03 that includes a Z move alongside the X, Y, I, J arc is helical interpolation, an arc in the plane with the Z axis feeding straight down at the same time. That is legal when the control supports helical interpolation, because the arc itself still lives in the XY plane and Z is just a linear move layered on top. So alarm 021 is about the arc being defined out of plane, not about a third axis ever appearing in the block. If you meant a helix and still get 021, check that your arc-center words are the in-plane pair (I and J), not K.

Alarm 021 is one of a family of program alarms beginners confuse:

AlarmMeaning
010Improper G-code
021Illegal plane axis commanded

The improper-code case has its own walkthrough in Fanuc alarm 010 improper G-code. Telling these apart quickly is exactly the pattern recognition a practice routine on the G-code practice hub builds.

Bottom line

Fanuc alarm 021 means an arc used an axis or center word outside the active plane. Pick the plane the arc belongs in with G17, G18, or G19, use the matching I, J, K words, and re-run from a safe point.

Sources

Frequently asked questions

What is Fanuc alarm 021?

It is a program alarm meaning ILLEGAL PLANE AXIS COMMANDED: a G02 or G03 arc used an axis or arc-center word that is not in the active plane, so the control stops at that block.

What causes illegal plane axis commanded?

Using an arc-center word from another plane, such as K while G17 is active, or commanding the arc in an axis pair that is not the active plane. A straight Z added to an XY arc is a helix and is allowed when supported, so the alarm is about the arc being out of plane, not simply about Z appearing.

How do you fix Fanuc alarm 021?

Select the plane the arc belongs in (G17, G18, or G19) before the arc, and use the matching center words: I J for G17, I K for G18, J K for G19. Then re-run from a safe point.

What is the best way to learn plane and arc codes?

Drill them with active recall. A free app like G-Code Sprint quizzes G17, G18, G19, and the arc codes as quick timed questions and repeats whichever ones you miss.

G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.