Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Introduction to G-code and M-code for CNC Machines
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
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.
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:
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
17. • G02: Clockwise circular interpolation
• G03: Counterclockwise circular interpolation
There are 2 ways to define the paths for radius cutting
The First way:
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.