What CNC Circular Interpolation Actually Computes
An animated, adjustable-segment view of G2/G3 circular interpolation — how arcs become line segments, and how segment count drives chord error.
A controller approximates an arc with many tiny line segments. Fewer segments mean larger chord error: e = R·(1 − cos(Δθ/2)).
READY
How it works
The article body below is currently available in full only in Chinese; the interface, titles, descriptions and FAQ follow your selected language.
从 G2 到一串直线
G2/G3 只给出终点与圆心增量 I/J。控制器不可能真的输出”一条理想圆弧”——它在一个插补周期(通常 1–2 ms)里算出下一个目标点,让各轴以微小直线段逼近圆弧。
上面的动画把段数 N 从 3 调到 48:工业蓝色带是理想圆弧,工业黄色带是实际插补刀路,中性色方块是圆心与当前刀具位置,右上角工业黄色块长度表示弦误差。拖动滑块就能看到刀路如何向圆弧收敛。
弦误差
每段对应的圆心角 Δθ = θ / N,弦中点到圆弧的最大偏差:
e = R · (1 − cos(Δθ / 2))
动画右上角实时显示这个值。以 R=50 mm、半圆为例:12 段时约 0.43 mm,48 段时降到约 0.027 mm——段数翻 4 倍,误差降到约 1/16(小角度下近似平方关系)。
段数不是越多越好
- 段数太少 → 轮廓精度差,圆变多边形。
- 段数太多 → 每个插补周期的位移极小,容易触发加减速频繁启停,反而让表面出现接刀痕;老控制器还会因程序段处理速度不足而降进给。
- 实际系统按允许弦误差 + 最大进给 + 插补周期共同决定段长,而不是固定 N。
与 G 代码查看器的关系
在 G 代码查看器 里,G2/G3 的 I/J 圆弧正是按 24 段折线采样绘制的。你可以把示例程序里的 G2 X20 Y0 I5 J0 改成其他终点,观察刀路如何变化。
动画是教学可视化,不替代 CAM 后处理与机床控制器的实际插补算法(含刀具半径补偿、加减速前瞻与象限过冲补偿)。
Tools for this topic
Paste G-code to resolve modal G0/G1/G2/G3 and G90/G91, preview the XY toolpath, and compute block counts, bounding box and path length.
TL-02 / CNC Cutting Data & Tap Drill CalculatorConvert cutting speed to spindle speed, feed per tooth to feed rate, plus metric tap drill size and theoretical surface roughness.