G21 Code For Milling

G21 CODE FOR MILLING WITH FANUC CONTROLLER



The G21 code is basically used to convert dimension to millimeter(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 millimeter dimension. All the X... Y... Z... coordinates are works upon millimeter dimension.
  • Now if the G21 Code is applied in the safety block of the CNC program. Then the whole program is working upon millimeter dimension.
  • In case, you want to change dimensional unit at any block from millimeter to inches. Then you just have to write G20 code in front of the desired block.
Learn About G81 Code For Milling
    Free cnc programming, g21 code
    G21 Code

    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 millimeter unit. 

    EXAMPLE-2:-

    Now, in this Program, we are going to change the dimension from millimeter 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 millimeter 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 01, 2018 Rating: 5

    2 comments:

    1. Toll milling service We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

      ReplyDelete

    Powered by Blogger.