SlideShare a Scribd company logo
1 of 8
Download to read offline
Title
Theory of CNC
Submitted to:
Sir Tayyab Quershi
Submitted by:
Roll no# 18-MT-21
Punjab Tianjin University Of Technology Lahore
G code
G stands for geometry, and it's the alphanumeric format the system uses to tell
the parts what to do. It indicates where to start, how to move and when to stop.
For machinists, the problem with using G codes is different machines use
variations on a standard set of alphanumeric numbers
M code
M-code (for “miscellaneous function”) is an auxiliary command; descriptions
vary. Many M-codes call for machine functions like “open workstation door,”
which is why some say “M” stands for “machine”, though it was not intended
to.
G-code is a type of function used in Numerical Control programming language
that contains the information to position a tool to do the actual work Since
G-codes are preparatory codes, in a CNC
program they begin with the letter G and direct the machine. Typical actions
G-code directs include: Changing a pallet.
Difference
1. GCodeisaGeometricCode,whichisusedformakeageometry/profileofa
component havingcylinder/barinCNCLatheorRectangularPlatesinCNC
Milling andCNCWEDM.
2. McodeisaMachineCodeorMiscellaneusCode,whichisusedformachinefunctions
inall CNCmachines.i.e.Coolanton/off,SpindleSpeedon/off,toolchange,
machinestop permanent/temporary etc.
M code G code
• M00: Program stop
• M01: Optional program
stop
• M02: End of program
• M03: Spindle on
clockwise
• M04: Spindle on
counterclockwise
• M05: Spindle stop
N: Line
number G:
Motion
X: Horizontal
position Y:
Vertical
position Z:
Depth
F: Feed rate
S: Spindle speed
T: Tool selection
M: Miscellaneous functions
I and J: Incremental
center of an arc R:
Radius of an ar
Nevertheless, after reading all of this, now we are able to manually make a real,
actual code. Here’s an example:
1. %
2. G21 G17 G90 F100
3. M03 S1000
4. G00 X5 Y5 ; point B
5. G01 X5 Y5 Z-1 ; point B
6. G01 X5 Y15 Z-1 ; point C
7. G02 X9 Y19 Z-1 I4 J0 ; point D
8. G01 X23 Y19 Z-1 ; point E
9. G01 X32 Y5 Z-1 ; point F
10. G01 X21 Y5 Z-1 ; point G
11. G01 X21 Y8 Z-1 ; point H
12. G03 X19 Y10 Z-1 I-2 J0 ; point I
13. G01 X13 Y10 Z-1 ; point J
14. G03 X11 Y8 Z-1 I0 J-2 ; point K
15. G01 X11 Y5 Z-1 ; point L
16. G01 X5 Y5 Z-1 ; point B
17. G01 X5 Y5 Z0
18. G28 X0 Y0
19. M05
20. M30
21. %
Impotance
Application of M codes
• Other letter designations (or, “words”) are used to specify feed rate (F),
spindle speed (S), tool addresses (T), etc.
• A full CNC program will be peppered with these letters as well as the
G and M-codes. Several M-codes are used to reference the control
panel for operator input. M01, an optional program stop, temporarily
halts the program and awaits input from the operator if the Opt Stop
button on the control panel is on. Otherwise, the M01 command is
ignored.
• This function might be used to allow the operator to remove chips.
• Another panel button labeled Block Skip will make the programs
skip over any code blocks that are preceded by a forward slash. This
is useful for auto-feeding operations as it can be used to skip over
the program stop command.
Need of G code and M code
• Technically a machine operator doesn’t need to know G-code. If the
CAM software has already created a cutting program, it feeds that
information to the CNC machining center. The software has already
determined the “speed and feed”, the tool path and all the other
variables needed to make the part. The operator can simply press the
start button and watch the part being made, but there are many
problems to this approach
• CAM programs seldomproduce the optimal tool path for the fastest
and most efficient cutting of a part, especially for complex geometries.
This is because, as mentioned above, it is “thinking” point-by-point
and step-by-step, not thinking globally. Only a human machinist with
real-world experience is capable of determining the ideal function of
the machine tool to meet the expectations of the customer’s design
intent. CAM is also optimized for maximum safety and machine tool
life, which translates as slow. Sometimes very slow.
G code and M code

More Related Content

What's hot (20)

CNC Turning and Milling centres
CNC Turning and Milling centresCNC Turning and Milling centres
CNC Turning and Milling centres
 
CNC part programming
CNC part programmingCNC part programming
CNC part programming
 
Numerical control machines tool
Numerical control machines toolNumerical control machines tool
Numerical control machines tool
 
Jig and fixture
Jig and fixtureJig and fixture
Jig and fixture
 
Types of jigs and fixtures
Types of jigs and fixtures Types of jigs and fixtures
Types of jigs and fixtures
 
Lathe – turning machine
Lathe – turning machineLathe – turning machine
Lathe – turning machine
 
Drill bushes
Drill bushesDrill bushes
Drill bushes
 
Drilling jig
Drilling jigDrilling jig
Drilling jig
 
Automatic lathes
Automatic lathes Automatic lathes
Automatic lathes
 
Drill jig
Drill jigDrill jig
Drill jig
 
Shaper Machine Ppt
Shaper Machine PptShaper Machine Ppt
Shaper Machine Ppt
 
Group Technology
Group TechnologyGroup Technology
Group Technology
 
Geometry of Milling cutter's and Twist drills
Geometry of Milling cutter's and Twist drillsGeometry of Milling cutter's and Twist drills
Geometry of Milling cutter's and Twist drills
 
COORDINATE MEASURING MACHINE
COORDINATE MEASURING MACHINECOORDINATE MEASURING MACHINE
COORDINATE MEASURING MACHINE
 
Jigs and there application
Jigs and there applicationJigs and there application
Jigs and there application
 
Canned cycle
Canned cycleCanned cycle
Canned cycle
 
Broaching machine
Broaching machineBroaching machine
Broaching machine
 
Auto collimator angle dekkor
Auto collimator angle dekkorAuto collimator angle dekkor
Auto collimator angle dekkor
 
Chapter 2 constructional feature of cnc machine
Chapter 2 constructional feature of cnc machineChapter 2 constructional feature of cnc machine
Chapter 2 constructional feature of cnc machine
 
Uint 1 locating and clamping devices
Uint 1 locating and clamping devicesUint 1 locating and clamping devices
Uint 1 locating and clamping devices
 

Similar to G code and M code

Similar to G code and M code (20)

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
 
Mach4 mill-g code-manual
Mach4 mill-g code-manualMach4 mill-g code-manual
Mach4 mill-g code-manual
 
Nc part programming
Nc part programmingNc part programming
Nc part programming
 
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
 
3-Axis Motion Control of CNC Machine based on G-Code, M-Code using FPGA and a...
3-Axis Motion Control of CNC Machine based on G-Code, M-Code using FPGA and a...3-Axis Motion Control of CNC Machine based on G-Code, M-Code using FPGA and a...
3-Axis Motion Control of CNC Machine based on G-Code, M-Code using FPGA and a...
 
CNC(computerized Numeric Coding) Lecture.pptx
CNC(computerized Numeric  Coding) Lecture.pptxCNC(computerized Numeric  Coding) Lecture.pptx
CNC(computerized Numeric Coding) Lecture.pptx
 
Cam presentation..
Cam presentation..Cam presentation..
Cam presentation..
 
CNC.ppt
CNC.pptCNC.ppt
CNC.ppt
 
Cnc
CncCnc
Cnc
 
G AND M
G AND MG AND M
G AND M
 
AMT PPT.pptx
AMT PPT.pptxAMT PPT.pptx
AMT PPT.pptx
 
CADM4.pptx
CADM4.pptxCADM4.pptx
CADM4.pptx
 
The Rang Bot - CNC Rangoli Maker
The Rang Bot - CNC Rangoli MakerThe Rang Bot - CNC Rangoli Maker
The Rang Bot - CNC Rangoli Maker
 
Cnc pgrming seminar-
Cnc pgrming   seminar-Cnc pgrming   seminar-
Cnc pgrming seminar-
 
cnc milling.pdf
cnc milling.pdfcnc milling.pdf
cnc milling.pdf
 
The NC Machining Post-Processing Technology Based on UG
The NC Machining Post-Processing Technology Based on UGThe NC Machining Post-Processing Technology Based on UG
The NC Machining Post-Processing Technology Based on UG
 
cadcampart11.ppt
cadcampart11.pptcadcampart11.ppt
cadcampart11.ppt
 
CNC Milling
CNC MillingCNC Milling
CNC Milling
 
CNC(KAPIL)
CNC(KAPIL)CNC(KAPIL)
CNC(KAPIL)
 

Recently uploaded

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

G code and M code

  • 1. Title Theory of CNC Submitted to: Sir Tayyab Quershi Submitted by: Roll no# 18-MT-21 Punjab Tianjin University Of Technology Lahore
  • 2. G code G stands for geometry, and it's the alphanumeric format the system uses to tell the parts what to do. It indicates where to start, how to move and when to stop. For machinists, the problem with using G codes is different machines use variations on a standard set of alphanumeric numbers M code M-code (for “miscellaneous function”) is an auxiliary command; descriptions vary. Many M-codes call for machine functions like “open workstation door,” which is why some say “M” stands for “machine”, though it was not intended to. G-code is a type of function used in Numerical Control programming language that contains the information to position a tool to do the actual work Since G-codes are preparatory codes, in a CNC program they begin with the letter G and direct the machine. Typical actions G-code directs include: Changing a pallet. Difference 1. GCodeisaGeometricCode,whichisusedformakeageometry/profileofa component havingcylinder/barinCNCLatheorRectangularPlatesinCNC Milling andCNCWEDM. 2. McodeisaMachineCodeorMiscellaneusCode,whichisusedformachinefunctions inall CNCmachines.i.e.Coolanton/off,SpindleSpeedon/off,toolchange, machinestop permanent/temporary etc. M code G code • M00: Program stop • M01: Optional program stop • M02: End of program • M03: Spindle on clockwise • M04: Spindle on counterclockwise • M05: Spindle stop N: Line number G: Motion X: Horizontal position Y: Vertical position Z: Depth
  • 3. F: Feed rate S: Spindle speed T: Tool selection M: Miscellaneous functions I and J: Incremental center of an arc R: Radius of an ar
  • 4. Nevertheless, after reading all of this, now we are able to manually make a real, actual code. Here’s an example: 1. % 2. G21 G17 G90 F100 3. M03 S1000 4. G00 X5 Y5 ; point B 5. G01 X5 Y5 Z-1 ; point B 6. G01 X5 Y15 Z-1 ; point C 7. G02 X9 Y19 Z-1 I4 J0 ; point D 8. G01 X23 Y19 Z-1 ; point E 9. G01 X32 Y5 Z-1 ; point F 10. G01 X21 Y5 Z-1 ; point G 11. G01 X21 Y8 Z-1 ; point H 12. G03 X19 Y10 Z-1 I-2 J0 ; point I 13. G01 X13 Y10 Z-1 ; point J 14. G03 X11 Y8 Z-1 I0 J-2 ; point K 15. G01 X11 Y5 Z-1 ; point L 16. G01 X5 Y5 Z-1 ; point B 17. G01 X5 Y5 Z0 18. G28 X0 Y0 19. M05 20. M30 21. %
  • 6. Application of M codes • Other letter designations (or, “words”) are used to specify feed rate (F), spindle speed (S), tool addresses (T), etc. • A full CNC program will be peppered with these letters as well as the G and M-codes. Several M-codes are used to reference the control panel for operator input. M01, an optional program stop, temporarily halts the program and awaits input from the operator if the Opt Stop button on the control panel is on. Otherwise, the M01 command is ignored. • This function might be used to allow the operator to remove chips. • Another panel button labeled Block Skip will make the programs skip over any code blocks that are preceded by a forward slash. This is useful for auto-feeding operations as it can be used to skip over the program stop command. Need of G code and M code • Technically a machine operator doesn’t need to know G-code. If the CAM software has already created a cutting program, it feeds that
  • 7. information to the CNC machining center. The software has already determined the “speed and feed”, the tool path and all the other variables needed to make the part. The operator can simply press the start button and watch the part being made, but there are many problems to this approach • CAM programs seldomproduce the optimal tool path for the fastest and most efficient cutting of a part, especially for complex geometries. This is because, as mentioned above, it is “thinking” point-by-point and step-by-step, not thinking globally. Only a human machinist with real-world experience is capable of determining the ideal function of the machine tool to meet the expectations of the customer’s design intent. CAM is also optimized for maximum safety and machine tool life, which translates as slow. Sometimes very slow.