TwinCAT CNC: Overview 
G02 Circular interpolation clockwise circle (CW) (modal)
G03 Circular interpolation counterclockwise circle (CCW) (modal)
When G02 (clockwise circle, CW) or G03 (counterclockwise circle, CCW) is selected, the programmed path is traversed with a feedrate given by the Fword, on a circular movement to the target position. Circular movements can be run in the three main planes of the spatial coordinate system (XY, ZX, YZ). The selection of the main plane is done using the functions G17, G18, G19 (see also Chapter4.4: Selection of planes).
All programmed tracking axes are moved with linear velocity in such a manner that the start and the end of their movement take place simultaneously to that of the main axes.
Fig. 4.3: Elucidation of circle functions G02 and G03
For defining the circle, the starting point of the circle "Ka" (determined through the previous block), the end point of the circle "Ke" and the center point of the circle "Km" are taken. The specification of the center point of the circle is done through the interpolation parameter I, J, K relative to the starting point of the circle under a valid G162. Absolute under a valid G161.
G162: (basic settings)
I  relative position of Km in the Xdirection
J  relative position of Km in the Ydirection
K  relative position of Km in the Zdirection
G161:
I  absolute position of Km in the Xdirection
J  absolute position of Km in the Ydirection
K  absolute position of Km in the Zdirection
In case of a wrong definition of the circle center point, an error message is output, if center point correction is not switched on (G165). Under an active G165, a centerpoint is determined in a way that a circle can be traversed. This also means that if the interpolation parameters are not programmed, the circlecenterpointcorrection originates from I, J, K = 0. Moreover, the circle center point coordinates are "nonmodal.
If under active G02/G03 the interpolation parameters are programmed without the circle ending point, then a full circle is traversed.

The maximum permissible circle radius is 10^{9} mm. However the end point of the circular arc may not exceed the maximum traverse range + 2,14*10^{5} mm of the axes. 
Syntax example for G17 plane:
G02  G03 [X<expr>Y<expr>] I<expr>J<expr>  R<expr>
G02  G03 Circular interpolation CW / CCW
X<expr> Y<expr> End point in XY plane
I<expr> J<expr> Position of circle center point of the interpolation in XY plane (I in X, J in Y), according to G161/G162
R<expr> Radius of the circle (alternative to I,J)

Programming example 
N10 G01 X10 Y10
N20 G02 X30 Y30 I10 J10 (Semicircle, circle end point X30 Y30)
N30 I10 J10 (Full circle)
N40 X50
Y50 (Error message, since no center point or)
(radius was specified)
Syntax according to the selected interpolation plane:
Plane 
Interpolation type 
End point in plane 
Center point /Radius 
G17 
G02/G03 
X..Y.. 
I..J../R 
G18 
G02/G03 
Z..X.. 
K..I../R 
G19 
G02/G03 
Y..Z.. 
J..K../R 
Absolute dimensional input:
Nnn G90 F1000 (Absolute dimension, feedrate)
Nnn G17 (Selection of XYplane)
Nnn G03 G161 X60 Y50 I60 J30 U90 (Circle: Ka > Ke and)
(linear interpolation: P1 > P2)
Incremental dimensional input:
Nnn G91 F1000 (Incr. dimension, feedrate)
Nnn G17 (Selection XYplane)
Nnn G03 G162 X20 Y20 I20 U50 (Circle : Ka > Ke and)
(linear interpolation: P1 > P2)
Fig. 4.4: Example for circle interpolation
Alternatively, circles can also be programmed through radius specification. This is possible by G163=" " or also using the address character R=" value of radius". Also, the definition through R1=" value of radius" is possible with identical results (see also chapters 4.19  4.21)
812_start