Circular Interpolation
Circular arcs can be programmed in a number of ways. Two types must be distinguished. One of these is an arc in the working plane (e.g. the XY plane), and the other is an arc that can be freely located in space (a CIP circle).
Clockwise arc interpolation
Command | G2 or G02 |
Cancellation |
Function G2 describes the path of a circular arc clockwise. This function requires the working plane to have already been defined (G17 is standard).
In order to describe the circle unambiguously, further parameters are required in addition to the end point. A choice is available between center point programming and radius programming.
Radius programming
In radius programming the radius of the circle is programmed as well as the end point. Either of the letters 'B' or 'U' may be used for the radius.
Since the direction is prescribed with G2, the circle is also unambiguously described. The starting point is determined by the foregoing geometrical movements.
Sample 1:
N10 G01 G17 X100 Y100 F6000
N20 G02 X200 B200
Angle programming for angles >180° If an angle of more than 180° is to be traversed, the radius must be stated negatively. |
Full circle programming The start and the end points must be different, so that the center can be calculated. Radius programming can therefore not be used for programming a full circle. Centre point programming can be used for this purpose. |
Centre point programming
Centre point programming represents an alternative to the method that has just been described. The advantage of center point programming is that complete circles can also be described in this way.
Under the standard settings, the center point is always given relatively to the starting point of the arc. The parameters I, J and K are used for this purpose, with
- I for the X-component
- J for the Y-component and
- K for the Z-component.
At least one of these parameters is 0, and does not therefore have to be programmed.
Sample 2:
N10 G01 G17 X100 Y100 F6000
N20 G02 I50 J0 (J is optional) X200
N30 M30 (program end)
Sample 3:
N10 G01 G18 X100 Y100 Z100 F6000
N20 G02 I0 K50 X150 Z150 (quarter circle in ZX plane)
N30 M30
By programming an item of machine data it is however also possible to enter the center point absolutely. The command @402 is required for write access to a machine data bit.
In the following example, the circle from the first example is programmed using the absolute circle center.
Sample 4:
N10 G01 G17 X100 Y100 F6000
N20 @402 K5003 K5 K1 (center point programming absolute)
N30 G02 I150 J100 X200
N40 @402 K5003 K5 K0 (center point programming relative)
N50 M30
Anticlockwise Circular Interpolation
Command | G3 or G03 |
Cancellation |
The function G3 describes a circular arc anticlockwise. The parameters and entry possibilities are the same as under G2.
Circular accuracy
from TwinCAT V2.9 Build 1022
Command | #set paramRadiusPrec(<param>)# |
Parameter | param: maximum allowed radius tolerance |
The 'set paramRadiusPrec' function is used to parameterize the required circular accuracy. This parameter affects circles programmed with G02 or G03.
With center point programming, an error is generated if the difference in radius length is greater than <param>.
Centre point correction
from TwinCAT V2.10, Build 1243
Command |
CPCON (standard setting) |
Cancellation |
CPCOF |
In centre point programming the circle is overdetermined. For data consistency, the centre point is usually corrected. Normally only a marginal modification of the centre point is required. After the centre point correction, the magnitude of the input radius equals the output radius.
It the start and end point are very close together, the centre point offset may be large. This may lead to problems with automatically generated G-Code (postprocessor). For manually written G-Code, the CPCON setting (centre point correction on) is recommended.
CIP circle
Command | CIP |
Cancellation | End of block |
The circles discussed so far can only be used in the principal planes. The CIP circle can also be used to program an arc anywhere in space. For this purpose it is necessary to program not only an end point but also some other point on the path.
So that the circle can be described unambiguously, it is necessary that the 3 points (the starting point is given implicitly) must not be collinear. It is thus not possible to program a full circle in this way.
I, J and K are available as path point parameters. By default their values are relative to the starting point of a circular path.
Sample 5:
N10 G01 X100 Y100 F6000
N20 CIP X200 Y200 I50 J50 K50
In order to be able to follow a CIP circle it is necessary that the cutter radius compensation is not active. |