G21 CODE FOR MILLING

G21 CODE FOR MILLING WITH FANUC CONTROLLER



The G21 code is basically used to convert dimension to millimetre (mm).
G20 Code For Milling

APPLICATION:-


  • In CNC Milling machine, we use both G21 and G20 Code. These codes are used to declare the dimension in our program. Because in our program we never consider dimensional units after X... Y... Z... co-ordinates. So this G21 and G20 Codes are used to declare dimensions to our program. 
  • As per the G21 Code, this Code is used to declare that our program works upon the millimetre dimension. All the X... Y... Z... coordinates are works upon millimetre dimension.
  • Now if the G21 Code is applied in the safety block of the CNC program. Then the whole program is working upon millimetre dimension.
  • In case, you want to change dimensional unit at any block from millimetre to inches. Then you just have to write G20 code in front of the desired block.
Learn About G81 Code For Milling

EXAMPLE-1:- 

In this example, we are going to add G21 Code in the safety block of the program. 
G17G21G54G90
MO6T01
M08
M03S1000
G00X0Y0F40
G01Z-5
G01X40
Y50
Y60
X70
Y80
Z10
G28X0Y0Z0
M05
M09
M30
So, in this program, we add G21 code in the safety block of the program. so the G21 code is applicable for all the coordinate units. Now all the units in this program work upon the millimetre unit. 

EXAMPLE-2:-

Now, in this Program, we are going to change the dimension from millimetre to inches.

G17G21G54G90
MO6T01
M08
M03S1000
G00X0Y0F40
G01Z-5
G20G01X40
Y50
Y60
X70
Y80
G21Z10
G28X0Y0Z0
M05
M09
M30
So as we can see the G21 code is written in the safety block. So that the millimetre dimension is applicable upon all the program. But I just add G20 code in front of G01 code before starting the cutting procedure. Now the cutting procedure works upon the inches dimensions as we required. 
So, in this way, we can use both the G21 Code and G20 Code in a single program.
G21 CODE FOR MILLING G21 CODE FOR MILLING Reviewed by Avtar Jassal on November 10, 2018 Rating: 5

No comments:

Powered by Blogger.