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

Visit for Details of CNC Machine
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 |
A | B | C | Functions |
G00 | G00 | G00 | Rapid Traverse |
G01 | G01 | G01 | Linear Interpolation |
G02 | G02 | G02 | Circular Interpolation clock wise |
G03 | G03 | G03 | Circular Interpolation anti clock wise |
G04 | G04 | G04 | Dwell, Mill Lathe |
G09 | G09 | G61 | Exact Stop |
G10 | G10 | G10 | offeset setting |
G12 | G12 | G12 | Circular Pocket Milling for CNC Mill Machine clock wise |
G13 | G13 | G13 | Circular Pocket Milling for CNC Mill Machine anticlock wise |
G17 | G17 | G17 | Section of XY Plane, for arc amchining Mill and lathe both |
G18 | G18 | G18 | Section of ZX Plane, for arc amchining Mill and lathe both |
G19 | G19 | G19 | Section of ZY Plane, for arc amchining Mill and lathe both |
G20 | G20 | G20 | Unit Change in Inch, Both mahine Mill and Lathe |
G21 | G21 | G21 | Unit Change in Metric, Both mahine Mill and Lathe |
G27 | G27 | G27 | Refrence return check, Mill and lathe both |
G28 | G28 | G28 | Home position |
G29 | G29 | G29 | Change Location fromrefrence point |
G31 | G31 | G31 | Skip Function |
G32 | G33 | G33 | Thread Cutting |
G40 | G40 | G40 | Tool nose offest cancle for lathe and cancle diam. Offset in Mill |
G41 | G41 | G41 | Tool/cutter compantation Left for both mill and lathe |
G42 | G42 | G42 | Tool/cutter compantation right for both mill and lathe |
G43 | G43 | G43 | Tool length Compontation for milling machine |
G44 | G44 | G49 | Cancle tool length for milling |
G50 | G50 | G50 | Set maximum RPM and set coordinate system in lathe machine |
G52 | G52 | G52 | setting of local coordinate system for both lathe and mill |
G53 | G53 | G53 | Machine coordinate system setting; Mill and Lathe |
G54 | G54 | G59 | machine coordinate systemsetting forboth |
G65 | G65 | G65 | Miro Call Custom for both lathe and mill |
G70 | G70 | G70 | Finishing Cycle for lathe |
G71 | G71 | G71 | Rough turning Cycle for lathe |
G72 | G72 | G72 | Rough Facing Cycle for lathe |
G73 | G73 | G73 | Rough turning cycle irregular for lathe and drilling cycle chip break for mill |
G74 | G74 | G74 | left hand tapping in milling as well as chip break in drilling or face grooving in lathe |
G75 | G75 | G75 | Grooving in lathe |
G76 | G76 | G76 | Boring Cycle in milling and threading in lathe machining |
G80 | G80 | G80 | Cancle cycle lathe and mill both |
G81 | G81 | G81 | Drillining cycle in both |
G82 | G82 | G82 | Drill cycle with dwell with milling |
G83 | G83 | G83 | Peck drilling cycle for Mill |
G84 | G84 | G84 | Tapping both machine |
G85 | G85 | G85 | Outer and inner boring In both machine |
G86 | G86 | G86 | Bore in, rapid out in both machine |
G87 | G87 | G87 | Back Boring Cycle in milling |
G90 | G90 | G90 | Absolute programming |
G91 | G91 | G91 | Incremental programming |
G92 | G92 | G92 | Reposition origin point; Mill as well as thread cuttining cycle for lathe |
G94 | G94 | G94 | feed per mint for milling |
G95 | G95 | G95 | feed per revolution for milling |
G96 | G96 | G96 | Constant surface speed for Lathe |
G97 | G97 | G97 | Cancel Constant surface speed |
G98 | G98 | G98 | Per minute feed; Lathe |
G99 | G99 | G99 | Per revolution feed; Lathe |
M Code |
M00 | Stop program |
M01 | Optional Program Stop |
M03 | End Program |
M04 | Spindle on Clock wise |
M05 | Spindle off |
M06 | Tool Change for milling machine |
M08 | Coolant On |
M09 | Coolant Off |
M10 | chuck or rotary table clamp On |
M11 | chuck or rotary table clamp Off |
M19 | Orient spindle |
M30 | End program and return to start point/refernce point |
M97 | Local Sub routine call |
M98 | Sub Program Call |
M99 | End of sub program |
Visit; CNC programming milling from Basic.
No Responses