Types of CNC Machines And Their Codes

The CNC machines are divided in to four types they are

  • Based on type of motion
  • Based on control loop
  • Based on power supply
  • Based on the position of the system

Based on the type of the motion systems they are divided into two types, they are:

  1. Point to point system
  2. Continuous path

Point to point system


In the point to point system the work piece or tool must be moved from one place of the point to the other place of the point, this is to perform the required task. Based on the next position the tool must be moved to obtain shape. In this process there is no importance for the feed rate and the path of the cutting tool. The accuracy must depend on the basic length unit which generally ranges between the 0.001 to 0.0001 inches.

Continuous path system:

The continuous path system is also known as the contouring system. During the performance of the cutting operation the motion of the work piece with respect to the cutter, the cutting operation is takes place.

The machine tool includes the routing, milling etc. At the time of machining process the tool and the work piece must be controlled continuously. The control system must accept the information related to the position and velocities of the machine slides. Feed rates are to be programmed.


Based on the control loop are also divided in to two types they are

  1. Open loop system
  2. Closed loop system

Open loop system;

In the open loop control system there is no feedback controller and it uses the stepping motor for driving the lead screw.  Stepping motor is responsible for the input pulse whose output shaft rotates with a fixed angle. The accuracy of the system mainly depends upon the ability of the motor. Stepping motor frequency depends upon the load torque.
If the load torque is higher, the frequency would be lower. In the machine tools, due to the cutting forces the load torque is excessive. The open loop system is suitable for where the tool force does not exist.

The terms used in the system are

Step angle α =\frac{360}{N}


N = no of pulse required for one revolution.

Total angle A= n\frac{360}{N}

n= no of pulse

Closed loop system:

The closed loop control system consists of feedback subsystem. This is used to screen the actual output. The feedback system is to be in a digital or analog format. The digital system is used to screen the output variations with the help of the electrical pulses. The analog is used to measure the physical variables vibrations like velocity and the positions. The closed loop system must be very accurate, for the reason that the feedback system is to be automatically compensating the variations in real time.  They are able to provide resolution of 0.0001 inches. Closed system requires a control device. Compare with the open loop system the closed loop system is considered to be very expensive and more complex.

Based on the type of the power supply also they are divided in to three types they are

  1. Hydraulic power supply
  2. Pneumatic power supply
  3. Electric power supply

Comparison of three power supplies

  1. No
Parameters Hydraulic Pneumatic Electrical
1 Working speed 5 m/s 4 m/s 10 m/s
2 Achievable Force High Limited and nearly 20 kN High
3 Achievable Stroke High High High
4 Power Density High Low Low
5 Connections Simple Very simple Simple
6 Over load safety Complete Complete Complete
7 Explosion proof Available Yes Available
8 Change of forces Simple and accurate Simple and accurate Simple and complex
9 Efficiency Best Good Good


During the time of heavy loads for immediate requirement of the motion the hydraulic system is used. It allows the fuels to reach quickly.


For a wide range of easy and continuous reaction of the speed and forces the pneumatic system is used. The position of the fluid must be repeatable and accurate. For more than three positions they prefer pneumatic system.


The electrical system consists of both the contouring and positioning machines. For the requirement of the continuous motion the electrical system must be preferred. They need to control the torque and direction either by using the AC or DC motor. By varying the armature or field supply they controlled the speed of the DC motor. They are mainly used in the small machine tools, due to the heat losses in clutches.

Based on the type of the position of the system they are also divided in to two types they are

  1. Incremental system
  2. Absolute system


In the incremental system the distance is measured from one point to the other (next) point.

Absolute system:

In the absolute system all the moving commands are stated from a reference point.

Advantages of incremental system:

  • Inspection of the program is considered to be easier
  • By changing the signs of position commands mirror image programming is simple.

Advantages of Absolute system:

  • Interruption would not affect the position
  • Dimensional data should be change easily.

CNC parts Programming:

The design of the product must be initially performed manually with the help of the computer language. Part program must have knowledge of the machining process and abilities of machine tools.

G and M Codes

G Codes:

Preparatory Function– It involves actual tool moves

G Code Description Milling Turning
G00 Rapid positioning M T
G01 Linear Interpolation M T
G02 Circular interpolation clock wise M T
G03 Circular interpolation clock wise M T
G04 Dwell M T
G05P10000 High- precision Contour Control M
G05.1 Al Advanced preview control M
G06.1 Non uniform rational B-splines (NURBS) machining M
G07 Imaginary axis designation M
G09 Exact stop Check, non- modal M T
G10 Programmable Data input M T
G11 Data Write Cancel M T
G12 Full circle interpolation clock M
G13 Full circle interpolation counter clock M
G17 XY plane selection M
G18 ZX plane selection M T
G19 YZ plane selection M
G20 Programming in inches M T
G21 Programming in millimeters M T
G28 Return to home position M T
G30 Return to secondary home position M T
G31 Skip function M
G32 Single-point threading long hand style T
G33 Constant pitch threading M
G33 Single point threading long hand style T
G34 Variable pitch threading M
G40 Tool radius compensation off M T
G41 Tool radius compensation left M T
G42 Tool radius compensation right M T
G43 Tool height offset compensation negative M
G44 Tool Height offset compensation Positive M
G45 Axis Offset Single increase M
G46 Axis offset angle decreases M
G47 Axis Offset double increases M
G48 Axis Offset double decreases M
G49 Tool length offset compensation cancel M
G50 Define the maximum spindle speed T
G50 Scaling function Cancel M
G50 Position register T
G52 Local Coordinate system M
G53 Machine coordinate system M T
G54 to G59 Work coordinates M T
G54.1 to P1 to P48 Extended work coordinate system M T
G61 Exact stop check, modal M T
G62 Automatic corner override M T
G64 Default Cutting mode M T
G70 Fixed cycle, multiple repetitive cycle, for finishing T
G71 Fixed cycle, multiple repetitive cycle, for roughing  (Z-axis emphasis) T
G72 Fixed cycle, multiple repetitive cycle, for roughing (X-axis emphasis) T
G73 Fixed cycle, multiple repetitive cycle, for roughing, with pattern repetition T
G73 Peck drilling cycle for milling – high-speed (NO full retraction from pecks) M
G74 Peck drilling cycle for turning T
G74 Tapping cycle for milling, left-hand thread, M04 spindle direction M
G75 Peck grooving cycle for turning T
G76 Fine boring cycle for milling M
G76 Threading cycle for turning, multiple repetitive cycle T
G80 Cancel canned cycle M T
G81 Simple drilling cycle M
G82 Drilling cycle with dwell M
G83 Peck drilling cycle (full retraction from pecks) M
G84 Tapping cycle, right-hand thread,M03 spindle direction M
G84.2 Tapping cycle, right hand thread,M03 spindle direction, rigid tool holder M
G84.3 Tapping cycle, left hand thread,M04 spindle direction, rigid tool holder M
G85 boring cycle, feed in/feed out M
G86 boring cycle, feed in/spindle stop/rapid out M
G87 boring cycle, back boring M
G88 boring cycle, feed in/spindle stop/manual operation M
G89 Boring cycle feed M
G90 Absolute programming M T
G90 Fixed cycle, simple cycle, for roughing (Z-axis emphasis) T
G91 Incremental programming M T
G92 Position register (programming of vector from part zero to tool tip M T
G92 Threading cycle, simple cycle T
G94 Feed rate per minute M T
G94 Fixed cycle, simple cycle, for roughing (X-axis emphasis) T
G95 Feed rate per revolution M T
G96 Constant surface speed (CSS) T
G97 Constant spindle speed M T
G98 Return to initial Z level in canned cycle M
G98 Feed rate per minute (group type A) T
G99 Return to R level in canned cycle M
G99 Feed rate per revolution (group type A) T

M codes:

Miscellaneous functions- it involve actions necessary for machining.

M codes Description Milling Turning
M00 Compulsory stop M T
M01 Optional stop M T
M02 End of program M T
M03 Spindle on (clockwise rotation) M T
M04 Spindle on (counter clockwise rotation) M T
M05 Spindle stop M T
M06 Automatic tool change (ATC) M T
M07 Coolant on M T
M08 Coolant on M T
M09 Coolant off M T
M10 Pallet clamp on M
M11 Pallet clamp off M
M13 Spindle on (clockwise rotation) and coolant on (flood) M
M19 Spindle orientation M T
M21 Mirror, X-axis M
M21 Tailstock forward T
M22 Mirror, Y-axis M
M22 Tailstock backward T
M23 Mirror OFF M
M23 Thread gradual pull-out ON T
M24 Thread gradual pull-out OFF T
M30 End of program, with return to program top M T
M41 Gear select – gear 1 T
M42 Gear select – gear 2 T
M43 Gear select – gear 3 T
M44 Gear select – gear 4 T
M48 Feed rate override allowed M T
M49 Feed rate override NOT allowed M T
M52 unload last tool from spindle M T
M60 Automatic pallet change (APC) M
M98 Subprogram call M T
M99 Subprogram end M T


It gives an identification related to the numbers for each block. It is usually a good run through process to increment each block number by 5 or 10; this is to permit additional blocks to be introduced for the future changes if essential.

Letters used for milling and turning:

A Absolute or incremental position of A axis (rotational axis around X axis)
B Absolute or incremental position of B axis (rotational axis around Y axis)
C Absolute or incremental position of C axis (rotational axis around Z axis)
D Defines diameter or radial offset used for cutter compensation. D is used for depth of cut on lathes. It is used for aperture selection and commands on photo plotters.
E Precision feed rate for threading on lathes
F Defines feed rate
G Address for preparatory commands
H Defines tool length offset;
Incremental axis corresponding to C axis (e.g., on a turn-mill)
I Defines arc centre in X axis for G02 or G03arc commands.
Also used as a parameter within some fixed cycles.
J Defines arc centre in Y axis for G02 or G03arc commands.
Also used as a parameter within some fixed cycles
K Defines arc centre in Z axis for G02 or G03arc commands.
Also used as a parameter within some fixed cycles, equal to L address.
L Fixed cycle loop count;
Specification of what register to edit using G10
M Miscellaneous function
N Line (block) number in program;
System parameter number to be changed using G10
O Program name
P Serves as parameter address for various G and M codes
Q Peck increment in canned cycles
R Defines size of arc radius, or defines retract height in milling canned cycles
S Defines speed, either spindle speed or surface speed depending on mode
T Tool selection
U Incremental axis corresponding to X axis (typically only lathe group A controls)
Also defines dwell time on some machines (instead of “P” or “X”).
V Incremental axis corresponding to Y axis
W Incremental axis corresponding to Z axis (typically only lathe group A controls)
X Absolute or incremental position of X axis.
Also defines dwell time on some machines (instead of “P” or “U”).
Y Absolute or incremental position of Y axis
Z Absolute or incremental position of Z axis

Click Here To Know More About: Terms Used In CNC Machining