SlideShare a Scribd company logo
Lab 2:
Introduction to G-code and M-code
Eng Mohammed Al-Obaidi
University of Sana’a
Facility of Engineering
Mechatronics Department
I
ndustrial Automation CADCAM
MT308
▶ Objective:
To understand the basics of G-code and M-code,
their functions, and common examples.
CNC: Computer Numerical Control
CNC machines are used to automate various
machining processes.
G-code and M-code are programming
languages used to instruct CNC machines.
Thefollowing termsare usedin different
typesof machines:
▶ Cartesian Coordinates:
• When pointsare located on a workpiece, two
straight intersecting lines, one vertical and one
horizontal,areused
• These linesmustbe at rightangles to
each other,and the pointwhere they
crossiscalled the origin,orzeropoint
• Theplus(+)andminus(-)signsindicatethe
directionfromthezeropoint(origin)along
theaxismotion.
HowdoesthisdiagramlookinCNC
programming
• It looks like this:
 G-code:Geometriccode
 G-codeinstructionsdefinethemovementofthemachine'stool.
 CommonG-codecommands:
 G00:Rapidpositioning
 G01:Linearinterpolation
 G02:Clockwisecircularinterpolation
 G03:Counterclockwisecircularinterpolation
 G04:Dwell
 G20:ImperialUnit
 G21:MetricUnits
 G-code:Geometriccode
 G-codeinstructionsdefinethemovementofthemachine'stool.
 Differencebetween:
 G00:Rapidpositioning
 G01:Linearinterpolation
Write the CNC code to mill the following profile:
 Cutter compensation:
 There are two different G codes
that we use to tell a machine the
size of a cutter so the machine can
workout the diameter and the
radius of the cutter so we can
program directly to drawing
dimensions and not have to add
the radius to all the profiles.
 G40: ends cutter compensation
 There are three ways to program cutter compensation in CNC programming:
 For our previous example:
 G90: Absolute programming, all dimensions taken from the datum.
 G91: Incremental programming, dimensions taken from the position of the cutter.
• M-code: Miscellaneous functions code
• M-code instructions control auxiliary functions of the CNC machine.
• Common M-code commands:
• M00: Program stop
• M01: Optional stop
• M02: End of program=M30:end program and return to start
• M03: Spindle on (clockwise)
• M04: Spindle on (counterclockwise)
• M05: Spindle stop
• M06: Tool Change
• M08: Coolant on
• M09: Coolant off
 O - Program number (Used for program identification)
 N - Sequence number (Used for line identification)
 G - Preparatory function
 X - X axis designation
 Y - Y axis designation
 Z - Z axis designation
 R - Radius designation
 F – Feed rate designation
 S - Spindle speed designation
 H - Tool length offset designation
 D - Tool radius offset designation
 T - Tool Designation
 M - Miscellaneous function
 Remember our previous example
• G02: Clockwise circular interpolation
• G03: Counterclockwise circular interpolation
 There are 2 ways to define the paths for radius cutting
The First way:
• Incase of counterclockwise cutting
• The second way is by defining the radius point.
• Incase of counterclockwise cutting
• Write the CNC code in absolute programming
LAB2_Gcode_Mcode.pptx
LAB2_Gcode_Mcode.pptx
LAB2_Gcode_Mcode.pptx

More Related Content

Similar to LAB2_Gcode_Mcode.pptx

INDUSTRIAL TRAINING CIHT
INDUSTRIAL TRAINING CIHTINDUSTRIAL TRAINING CIHT
INDUSTRIAL TRAINING CIHTASHISH ACHARJEE
 
Cnc pgrming seminar-
Cnc pgrming   seminar-Cnc pgrming   seminar-
Cnc pgrming seminar-
abhipawar123
 
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASHCNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
Ved Prakash
 
CNC machine
CNC machineCNC machine
CNC machine
Shubham Jaiswal
 
Computer numerical control ( CNC )
Computer numerical control  ( CNC )Computer numerical control  ( CNC )
Computer numerical control ( CNC )
BhaveshChaudhari21
 
NC pogramming
NC pogrammingNC pogramming
NC pogramming
illpa
 
CNC PROGRAMMING.pdf
CNC PROGRAMMING.pdfCNC PROGRAMMING.pdf
CNC PROGRAMMING.pdf
AbhiKarn2
 
9. part program
9. part program9. part program
9. part program
Amirul Jelani
 
CNC.ppt
CNC.pptCNC.ppt
Navjot Singh Thakur.pptx
Navjot Singh Thakur.pptxNavjot Singh Thakur.pptx
Navjot Singh Thakur.pptx
ThakurNavjotSingh
 
Me3m02 expt p3
Me3m02 expt p3Me3m02 expt p3
Me3m02 expt p3
Hanip MasyaAllah Aright
 
CNC Training.ppt
CNC Training.pptCNC Training.ppt
CNC Training.ppt
Aniket Verma
 
CNC1 (1).ppt
CNC1 (1).pptCNC1 (1).ppt
CNC1 (1).ppt
WondererBack
 
A project report of map of india made by the CNC SIMULATOR PRO software Mech...
A  project report of map of india made by the CNC SIMULATOR PRO software Mech...A  project report of map of india made by the CNC SIMULATOR PRO software Mech...
A project report of map of india made by the CNC SIMULATOR PRO software Mech...
Jayant Tailor
 
2D Plotter Presentation
2D Plotter Presentation2D Plotter Presentation
2D Plotter PresentationMahmoud Kandil
 
CNC PART PROGRAMMING.pptx
CNC PART PROGRAMMING.pptxCNC PART PROGRAMMING.pptx
CNC PART PROGRAMMING.pptx
AtharvaJagtap15
 
CNC1.ppt
CNC1.pptCNC1.ppt
CNC1.ppt
WondererBack
 

Similar to LAB2_Gcode_Mcode.pptx (20)

INDUSTRIAL TRAINING CIHT
INDUSTRIAL TRAINING CIHTINDUSTRIAL TRAINING CIHT
INDUSTRIAL TRAINING CIHT
 
Cnc pgrming seminar-
Cnc pgrming   seminar-Cnc pgrming   seminar-
Cnc pgrming seminar-
 
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASHCNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
CNC(COMPUTER NUMERICAL CONTROL MACHINE) By-Er. VED PRAKASH
 
CNC machine
CNC machineCNC machine
CNC machine
 
Computer numerical control ( CNC )
Computer numerical control  ( CNC )Computer numerical control  ( CNC )
Computer numerical control ( CNC )
 
NC pogramming
NC pogrammingNC pogramming
NC pogramming
 
CNC PROGRAMMING.pdf
CNC PROGRAMMING.pdfCNC PROGRAMMING.pdf
CNC PROGRAMMING.pdf
 
9. part program
9. part program9. part program
9. part program
 
CNC.ppt
CNC.pptCNC.ppt
CNC.ppt
 
Navjot Singh Thakur.pptx
Navjot Singh Thakur.pptxNavjot Singh Thakur.pptx
Navjot Singh Thakur.pptx
 
Me3m02 expt p3
Me3m02 expt p3Me3m02 expt p3
Me3m02 expt p3
 
CNC1.ppt
CNC1.pptCNC1.ppt
CNC1.ppt
 
CNC Training.ppt
CNC Training.pptCNC Training.ppt
CNC Training.ppt
 
Cnc1
Cnc1Cnc1
Cnc1
 
CNC1 (1).ppt
CNC1 (1).pptCNC1 (1).ppt
CNC1 (1).ppt
 
A project report of map of india made by the CNC SIMULATOR PRO software Mech...
A  project report of map of india made by the CNC SIMULATOR PRO software Mech...A  project report of map of india made by the CNC SIMULATOR PRO software Mech...
A project report of map of india made by the CNC SIMULATOR PRO software Mech...
 
CNC1.ppt
CNC1.pptCNC1.ppt
CNC1.ppt
 
2D Plotter Presentation
2D Plotter Presentation2D Plotter Presentation
2D Plotter Presentation
 
CNC PART PROGRAMMING.pptx
CNC PART PROGRAMMING.pptxCNC PART PROGRAMMING.pptx
CNC PART PROGRAMMING.pptx
 
CNC1.ppt
CNC1.pptCNC1.ppt
CNC1.ppt
 

More from MohammedAlobaidy16

cnc_codes_and_letters.ppt
cnc_codes_and_letters.pptcnc_codes_and_letters.ppt
cnc_codes_and_letters.ppt
MohammedAlobaidy16
 
1684424.ppt
1684424.ppt1684424.ppt
1684424.ppt
MohammedAlobaidy16
 
Lab 4 (1).pdf
Lab 4 (1).pdfLab 4 (1).pdf
Lab 4 (1).pdf
MohammedAlobaidy16
 
Lab 3.pptx
Lab 3.pptxLab 3.pptx
Lab 3.pptx
MohammedAlobaidy16
 
Lab 3.pptx
Lab 3.pptxLab 3.pptx
Lab 3.pptx
MohammedAlobaidy16
 
ch22.ppt
ch22.pptch22.ppt
ch07.ppt
ch07.pptch07.ppt
LAB3_CADCAM_using_MasterCam.pptx
LAB3_CADCAM_using_MasterCam.pptxLAB3_CADCAM_using_MasterCam.pptx
LAB3_CADCAM_using_MasterCam.pptx
MohammedAlobaidy16
 
oopusingc.pptx
oopusingc.pptxoopusingc.pptx
oopusingc.pptx
MohammedAlobaidy16
 
MS Office Word.pptx
 MS Office Word.pptx MS Office Word.pptx
MS Office Word.pptx
MohammedAlobaidy16
 
MT 308 Industrial Automation.ppt
MT 308 Industrial Automation.pptMT 308 Industrial Automation.ppt
MT 308 Industrial Automation.ppt
MohammedAlobaidy16
 
ch25.ppt
ch25.pptch25.ppt
ch05.ppt
ch05.pptch05.ppt
ch02.ppt
ch02.pptch02.ppt
Lab1 - Introduction to Computer Basics Laboratory.pdf
Lab1 - Introduction to Computer Basics Laboratory.pdfLab1 - Introduction to Computer Basics Laboratory.pdf
Lab1 - Introduction to Computer Basics Laboratory.pdf
MohammedAlobaidy16
 
lab3&4.pdf
lab3&4.pdflab3&4.pdf
lab3&4.pdf
MohammedAlobaidy16
 
4_5931536868716842982.pdf
4_5931536868716842982.pdf4_5931536868716842982.pdf
4_5931536868716842982.pdf
MohammedAlobaidy16
 
ch01.ppt
ch01.pptch01.ppt
Lab 1.pptx
Lab 1.pptxLab 1.pptx
Lab 1.pptx
MohammedAlobaidy16
 

More from MohammedAlobaidy16 (19)

cnc_codes_and_letters.ppt
cnc_codes_and_letters.pptcnc_codes_and_letters.ppt
cnc_codes_and_letters.ppt
 
1684424.ppt
1684424.ppt1684424.ppt
1684424.ppt
 
Lab 4 (1).pdf
Lab 4 (1).pdfLab 4 (1).pdf
Lab 4 (1).pdf
 
Lab 3.pptx
Lab 3.pptxLab 3.pptx
Lab 3.pptx
 
Lab 3.pptx
Lab 3.pptxLab 3.pptx
Lab 3.pptx
 
ch22.ppt
ch22.pptch22.ppt
ch22.ppt
 
ch07.ppt
ch07.pptch07.ppt
ch07.ppt
 
LAB3_CADCAM_using_MasterCam.pptx
LAB3_CADCAM_using_MasterCam.pptxLAB3_CADCAM_using_MasterCam.pptx
LAB3_CADCAM_using_MasterCam.pptx
 
oopusingc.pptx
oopusingc.pptxoopusingc.pptx
oopusingc.pptx
 
MS Office Word.pptx
 MS Office Word.pptx MS Office Word.pptx
MS Office Word.pptx
 
MT 308 Industrial Automation.ppt
MT 308 Industrial Automation.pptMT 308 Industrial Automation.ppt
MT 308 Industrial Automation.ppt
 
ch25.ppt
ch25.pptch25.ppt
ch25.ppt
 
ch05.ppt
ch05.pptch05.ppt
ch05.ppt
 
ch02.ppt
ch02.pptch02.ppt
ch02.ppt
 
Lab1 - Introduction to Computer Basics Laboratory.pdf
Lab1 - Introduction to Computer Basics Laboratory.pdfLab1 - Introduction to Computer Basics Laboratory.pdf
Lab1 - Introduction to Computer Basics Laboratory.pdf
 
lab3&4.pdf
lab3&4.pdflab3&4.pdf
lab3&4.pdf
 
4_5931536868716842982.pdf
4_5931536868716842982.pdf4_5931536868716842982.pdf
4_5931536868716842982.pdf
 
ch01.ppt
ch01.pptch01.ppt
ch01.ppt
 
Lab 1.pptx
Lab 1.pptxLab 1.pptx
Lab 1.pptx
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 

LAB2_Gcode_Mcode.pptx

  • 1. Lab 2: Introduction to G-code and M-code Eng Mohammed Al-Obaidi University of Sana’a Facility of Engineering Mechatronics Department I ndustrial Automation CADCAM MT308
  • 2. ▶ Objective: To understand the basics of G-code and M-code, their functions, and common examples.
  • 3. CNC: Computer Numerical Control CNC machines are used to automate various machining processes. G-code and M-code are programming languages used to instruct CNC machines.
  • 4. Thefollowing termsare usedin different typesof machines: ▶ Cartesian Coordinates: • When pointsare located on a workpiece, two straight intersecting lines, one vertical and one horizontal,areused • These linesmustbe at rightangles to each other,and the pointwhere they crossiscalled the origin,orzeropoint • Theplus(+)andminus(-)signsindicatethe directionfromthezeropoint(origin)along theaxismotion.
  • 6.  G-code:Geometriccode  G-codeinstructionsdefinethemovementofthemachine'stool.  CommonG-codecommands:  G00:Rapidpositioning  G01:Linearinterpolation  G02:Clockwisecircularinterpolation  G03:Counterclockwisecircularinterpolation  G04:Dwell  G20:ImperialUnit  G21:MetricUnits
  • 7.  G-code:Geometriccode  G-codeinstructionsdefinethemovementofthemachine'stool.  Differencebetween:  G00:Rapidpositioning  G01:Linearinterpolation
  • 8. Write the CNC code to mill the following profile:
  • 9.  Cutter compensation:  There are two different G codes that we use to tell a machine the size of a cutter so the machine can workout the diameter and the radius of the cutter so we can program directly to drawing dimensions and not have to add the radius to all the profiles.  G40: ends cutter compensation
  • 10.  There are three ways to program cutter compensation in CNC programming:
  • 11.  For our previous example:
  • 12.  G90: Absolute programming, all dimensions taken from the datum.
  • 13.  G91: Incremental programming, dimensions taken from the position of the cutter.
  • 14. • M-code: Miscellaneous functions code • M-code instructions control auxiliary functions of the CNC machine. • Common M-code commands: • M00: Program stop • M01: Optional stop • M02: End of program=M30:end program and return to start • M03: Spindle on (clockwise) • M04: Spindle on (counterclockwise) • M05: Spindle stop • M06: Tool Change • M08: Coolant on • M09: Coolant off
  • 15.  O - Program number (Used for program identification)  N - Sequence number (Used for line identification)  G - Preparatory function  X - X axis designation  Y - Y axis designation  Z - Z axis designation  R - Radius designation  F – Feed rate designation  S - Spindle speed designation  H - Tool length offset designation  D - Tool radius offset designation  T - Tool Designation  M - Miscellaneous function
  • 16.  Remember our previous example
  • 17. • G02: Clockwise circular interpolation • G03: Counterclockwise circular interpolation  There are 2 ways to define the paths for radius cutting The First way:
  • 18. • Incase of counterclockwise cutting
  • 19. • The second way is by defining the radius point.
  • 20. • Incase of counterclockwise cutting
  • 21. • Write the CNC code in absolute programming

Editor's Notes

  1. The first term is "Axis Relationships." In machining, different axes (x, y, and z) are used to specify the position of a cutting tool relative to the workpiece. The relationships between these axes are important for accurate and efficient machining.