Basics of CNC Programming Milling.

Basics of CNC Programming Milling.

In previous article we discussed all about CNC machine; here we will discuss all about the basic of CNC Programming, how we can write a Programming for CNC Machine, CNC Programming for Milling machine. Before starting it is necessary to know what is CNC Programming.


What is CNC Programming ?

CNC Programming (Computer Numerical Control): A program which is used to control all movements all CNC Machines and their tools by using Numerical codes which is generated by computer. The CNC Programmer make this manually or with the help of CAM Software like CATIA, MasterCAM, Solidworks, Solid Edge, and many more CAM Software we will discuss later.


Things to be remember to write a CNC Program:

Knowledge of CNC Machine Axis (x,y, and z)


Basic Knowledge of CNC Machine.

Remember Some Basic Codes (G-Codes, M-Codes)

Tools and Tools Holder


Knowledge of CAM Software.

Importance Of Axis in CNC Programming Milling:-

Type of CNC Machine according to axis:

3 Axis CNC Machine: Generally 3 axis machine is most uses worldwide in this CNC Machine, the position CNC Machine is fixed whereas the cutting tool move along the axis xyz. There are Several operation which can be done smoothly by 3 Axis CNC Machine. Milling Slots, Drilling holes, Cutting sharp edges, etc.


4 Axis CNC Machine: This a similar as 3 axis machine, but there is a Rotary Axis around the X Axis is called A Axis. The purpose of axis is to remove materials of outer surface or holes sides in the direction of B Axis. Some importance roll of rotational axis, Engraving curved surface, Continuous cutting, intermittent cutting, etc

5 Axis CNC Machine: In a five axis CNC Machine, we can perform machining in five directions in a time. In this type of machine there are two or three rotational axis which moves automatically at the time of making finished products. 5 Axis machining used to make complex components and its programming is difficult and time taking..

Movements of CNC Axis

X axis – left to right


Y axis – front to back

Z axis – up and down

A axis – 180° rotation around the X axis


B axis – 180° rotation around the Y axis

C axis – 180° rotation around the Z axis

G- Codes and M- Codes of CNC Programming Milling Machine.

There are two types of code used in CNC Programming Milling or CNC Lathe


1. Preparatory Codes (G Code); G Code is a language in which people tell computerized machine tools how to make finished part products, it is also known as Preparatory Function, G Code is an ISO standard code means it will be same for all CNC Machine we can not change it. It is a main faction code for CNC Programming milling or lathe machine which control automated machine tools like tool path, speed of machine, the depth of cutting, finishing cut and many more.

There are most used G code for CNC Programming Milling and Lathe given bellow

Note: Remember Some g code may be changed, because at the time of manufacturing it divided into three categories A, B and C that means if category A is not working then we have to use another category B or C.


G Code

G Code 
G00G00G00Rapid Traverse
G01G01G01Linear Interpolation
G02G02G02Circular Interpolation clock wise
G03G03G03Circular Interpolation anti clock wise
G04G04G04Dwell, Mill Lathe
G09G09G61Exact Stop
G10G10G10offeset setting
G12G12G12Circular Pocket Milling for CNC Mill Machine clock wise
G13G13G13Circular Pocket Milling for CNC Mill Machine anticlock wise
G17G17G17Section of XY Plane, for arc amchining Mill and lathe both
G18G18G18Section of ZX Plane, for arc amchining Mill and lathe both
G19G19G19Section of ZY Plane, for arc amchining Mill and lathe both
G20G20G20Unit Change in Inch, Both mahine Mill and Lathe
G21G21G21Unit Change in Metric, Both mahine Mill and Lathe
G27G27G27Refrence return check, Mill and lathe both
G28G28G28Home position
G29G29G29Change Location fromrefrence point
G31G31G31Skip Function
G32G33G33Thread Cutting
G40G40G40Tool nose offest cancle for lathe and cancle diam. Offset in Mill
G41G41G41Tool/cutter compantation Left for both mill and lathe
G42G42G42Tool/cutter compantation right for both mill and lathe
G43G43G43Tool length Compontation for milling machine
G44G44G49Cancle tool length for milling
G50G50G50Set maximum RPM and set coordinate system in lathe machine
G52G52G52setting of local coordinate system for both lathe and mill
G53G53G53 Machine coordinate system setting; Mill and Lathe
G54G54G59machine coordinate systemsetting forboth
G65G65G65Miro Call Custom for both lathe and mill
G70G70G70Finishing Cycle for lathe 
G71G71G71Rough  turning Cycle for lathe
G72G72G72Rough  Facing  Cycle for lathe
G73G73G73Rough turning cycle irregular for lathe and drilling cycle chip break for mill
G74G74G74left hand tapping in milling as well as chip break in drilling or face grooving in lathe
G75G75G75Grooving in lathe
G76G76G76Boring Cycle in milling and threading in lathe machining
G80G80G80Cancle cycle lathe and mill both
G81G81G81Drillining cycle in both
G82G82G82Drill cycle with  dwell with milling
G83G83G83Peck drilling cycle for  Mill
G84G84G84Tapping both machine
G85G85G85Outer and inner boring In both machine 
G86G86G86Bore in, rapid out in both machine
G87G87G87Back Boring Cycle in milling
G90G90G90Absolute programming
G91G91G91 Incremental programming
G92G92G92Reposition origin point; Mill as well as thread cuttining cycle for lathe
G94G94G94feed per mint for milling
G95G95G95feed per revolution for milling
G96G96G96Constant surface speed for Lathe
G97G97G97Cancel Constant surface speed
G98G98G98Per minute feed; Lathe
G99G99G99 Per revolution feed; Lathe
M Code
M00Stop program
M01Optional Program Stop
M03End Program
M04Spindle on Clock wise
M05Spindle off
M06Tool Change for milling machine 
M08Coolant On
M09Coolant Off
M10chuck or rotary table clamp On
M11chuck or rotary table clamp Off
M19Orient spindle
M30End program and return to start point/refernce point
M97Local Sub routine call
M98Sub Program Call
M99End of sub program

Visit; CNC programming milling from Basic.


No Responses

Add Comment