In CNC programming, small letters such as i and j in g-code define precise lateral offsets for arcs, helping you control the start position of a circular move. These incremental values are essential for accurate profiling, drilling cycles, and complex contouring on mill and lathe tools.
You can quickly verify how i and j shift the arc center with many CAM outputs and machine simulations, reducing trial cuts and setup time. Understanding their exact behavior in plane selection and coordinate systems prevents miscuts and dimension drift.
| Parameter | Plane XY | Plane YZ | Plane XZ | Typical Use Case |
|---|---|---|---|---|
| i | Offset from arc start to center along X | Not used | Offset along X | Hole milling, pocket arcs |
| j | Offset from arc start to center along Y | Offset along Y | Not used | Contour arcs, radius features |
| k | Not used | Offset along Y | Offset along Z | 3D sculpt, tilt surfaces |
| Arc Address | G02 / G03 | G02 / G03 | G02 / G03 | Consistent across planes |
How i and j define arc center in XY
On the XY plane, the center of an arc is calculated by adding i to the start X coordinate and j to the start Y coordinate. This lets you describe arcs relative to their beginning point, which is ideal for subprogram calls and repeating routines.
Using incremental i and j avoids the need to switch between incremental and absolute programming unless your macros require it. Keep in mind that i and j remain linear values, not radii, so the controller computes the actual center dynamically during block execution.
Many CAM programs generate i and j for consolidation, and you should verify toolpath directions with a simulator to catch sign errors before loading the machine. Correct sign handling in quadrants reduces manual edit time and prevents unexpected cutter motion.
Radius format versus center formats
While some older controls rely on radius definitions, modern systems prefer i and j because they directly express the vector from arc start to center. This format supports full NURBS-style moves and simplifies interpolation on multi-axis heads.
Radius moves can become ambiguous for large arcs exceeding 180 degrees, whereas i and j maintain a consistent directional relationship to the start point. You gain more predictable behavior across different machine configurations when you standardize on center format inputs.
Always check your machine control documentation, because some older turn centers or legacy lathes may require polar definitions rather than incremental center offsets. Mapping legacy code to i and j often reduces confusion during production edits.
Common plane selections and sign conventions
Plane selection with G17, G18, or G19 determines which pair of axes the i and j offsets apply to. For example, G18 treats offsets as X and Z deltas, while G19 uses Y and Z deltas for vertical milling arcs.
Sign conventions follow the right-hand rule for the chosen plane, so positive i moves the center in the positive axis direction from the start point. Misaligned signs are a common source of oversized or undersized radii, especially during multi-pass finishing routines.
Use consistent sign logic across similar operations, and document your standards in setup sheets so that programmers and machine setters interpret offsets the same way. Consistent sign handling supports smoother transitions between roughing and finishing cycles.
Programming tips and verification steps
To reduce potential errors, treat i and j as part of your core toolpath hygiene, especially when importing geometry from multiple sources. A few disciplined habits go a long way toward maintaining control integrity.
- Verify arc center coordinates in the simulator before posting to the machine.
- Use consistent incremental notation rather than mixing absolute and center formats within the same routine.
- Apply cutter radius compensation cautiously, because i and j describe geometry, not the cutter center path directly.
- Document sign rules and plane mappings in your programming handbook to avoid miscommunication between shifts.
FAQ
Reader questions
Why does my arc using i and j cut in the wrong direction on the mill?
Check the G02 versus G03 selection and confirm that your i and j signs match the intended center location. Small sign flips can reverse clockwise versus counterclockwise motion, leading to unexpected stock removal.
Can i and j be used with polar or rotational indexing on turn centers?
Most lathes using i and j operate in incremental center-offset mode on the XZ plane, but true polar interpolation may require different address words. Consult your lathe control guide to avoid programming mismatches.
How do G02 and G03 react to negative i or j values in the subprogram?
Negative i or j simply places the arc center behind the start point along the respective axis, and G02/G03 still define direction based on the overall block. Simulators are helpful for visualizing these positions before machining.
What happens if i and j are omitted while G02 or G03 is still active?
The controller may hold previous offset values or default to a zero offset, causing the arc to pivot around the current start point. Always include explicit i and j when the geometry is center-based to ensure deterministic motion.