PART PROGRAM FOR CIRCULAR INTERPOLATION AND SIMULATE
G02/03 Circular interpolation
Format
N__ G02/03 X__ Y__Z__ I__ J__K__ F__ using the arc center
OR
N__ G02/03 X__ Y__Z__ R__ F__ using the arc radius
G02 moves along a CW arc
G03 moves along a CCW arc
Arc center
The arc center is specified by addresses I, J and K. I, J and K are the X, Y and Z co-ordinates of
the arc center with reference to the arc start point.
Y
Arc
start
Arc end
- I
- J
Arc center
X
I = X coord. of center - X coord. of start point
J = Y coord. of center - Y coord. of start point
K = Z coord. of center - Z coord. of start point
I, J and K must be written with their signs.
RADIUS METHOD
3. To prepare a CNC part program to mill the component as per the
drawing
Assume thickness = 20 mm 10
R
20
20
20
2030 20
60
60
R
20
1. You can call subroutines (within the same program) and subprograms (separate file on disk)
using either M98 or M97 using the same syntax.
2. A subprogram can start with either N or O. Both codes are supported as a sub program
number.
3. Repetitions can be given using the L word or as the first digits of the P word (last four digits
are always program number).
4. If a subroutine number is missing in program the simulator will attempt to find a disk file
with the format O####.cnc in the same folder as the main program or in the user defined
CNC folder.
5. A subprogram can also be called with the alternative syntax M98 “mySubProgram.cnc” L…
6. Return from subprograms and subroutines can be done with either M17 or M99.
7. The L word is optional. If omitted, one call will be executed only.
Example program
Single call to subroutine, no repeats
M98 P1000
O1000
M17 (or M99)
Standard call to subroutine, repeating 4 times
M98 P1000 L4
Call to subroutine on line number 555, repeating 2 times
N100 M98 P555 L2
N555 ….
N565 M17 (or M99)
Call to subroutine with repeats in the P address
M98 P51001 (Call O1001 five times)
O1001
M17 (or M99)
Calling subprograms
If a subroutine within the same program is missing, the simulator will look for a separate program on disk.
M98 O1099 L2
If there is no O1099 or N1099 in the program, the block above will call subprogram O1099.cnc
File name syntax
M98 “DrillHoles.cnc” L2
The block above will look for subprogram DrillHoles.cnc in the same folder as the main program, or in the user
defined CNC programs folder.
Please remember to end all subprograms with either M17 or M99 for execution to continue in the main program.
SUBROUTINE (DIRECT METHOD)
7. Write a milling program for a given sketch using G-code and M-codes.60 90 60
60
90
60
O
60
15 15