CNC CODES EXPLAINED | 15 G&M CODES YOU MUST KNOW |CNC Programming Tutorials | VMC #2

Numerical Control Machine Ch5
1 follower
3 Video Views·Oct 7, 2024
Welcome to the another CNC Programming Tutorial from ScamForce.
The essential things to learn CNC Program are,
1. Coordinate System to simplify the tool positioning and calculations.
2. CNC Codes which is used for various program and machine functions.
3. Cutting Parameters which includes speed, feed, and tool engagements.
Coordinate system and types are explained in our previous video tutorial.
Link is given in the description.
This video will explain the CNC Codes detaily.
The CNC Codes are generally two types, G-Codes and M-Codes.
G-Codes are the preparatory codes which is used for programming functions.
And M-Codes are the miscellaneous codes which is used for machine functions.
Here we will explain the essential CNC Codes which you can start with for the basic programming.
1. G00
G00 is used for rapid positioning.
This function will produce the fast movement to the specified X, Y, Z position.
Rapid movements are used for non-cutting moves where tool and workpiece not in contact.
The format is G00, X, Y, Z coordinates.
2. G01
G01 is linear interpolation with feed rate.
This is used when the tool and workpiece in contact
and where tool need to move with a particular feed rate for the linear movement.
The format is G01, X, Y, Z coordinates and F.
F is the feed rate you can choose as per your cutting parameters.
This is the difference between G00 and G01.
G00 is used for non-cutting rapid moves and G01 used for cutting movements.
Profile needs any circular arc movements.
Then we use G02 and G03.
G02 is used for circular interpolation in clockwise direction.
And G03 is used for counterclockwise direction.
We can do circular interpolation in two methods that is arc radius method and arc center method.
According to arc radius method, the format is G02 or G03, X, Y, Z coordinates, R, F.
Here R is the radius value of arc.
These are the four types of interpolation or movement which is available on the CNC machine.
Hope it's clear.
Number 5, G17, XY plane selection
G17 is used for selecting XY plane for the machining.
In VMC, we have three axes and these three axes will give three planes possible for the machining.
Most of the time we use XY plane for the machining.
But very rarely for getting circular interpolation in vertical direction,
we may use G18, G19 for other planes.
Number 6, G21, metric input
When G21 is provided in our program, all the units will be taken in millimeters.
In case you need inch input, then you can use G20.
Number 7, G28, home position or machine zero
According to our requirement, we may set X0, Y0, Z0 on our different workpieces.
But machine having a fixed datum at one of its topmost position, that is called home position.
When the axes are moved to home position,
we can load and unload the workpiece's tools comfortably.
The distance between workpiece and tool will be very far.
So, this position is preferred for cleaning the machine too.
The format is G91, G28, Z0, first Z axis, then next block G91, G28, X0, Y0.
G91 is added for the incremental mode calculation.
Number 8, G54 to G59, work offsets
These are the position points X0, Y0, Z0 we can set for our workpiece or fixture.
For single workpiece, we use G54.
When we have multiple workpieces or fixtures, then additional work offsets are used.
Number 9, G90, absolute coordinate system
In absolute coordinate system, the coordinate calculations are done based on a fixed datum.
Number 10, G91, incremental coordinate system
In incremental coordinate system, axis movements are done based on previous positions.
Absolute and incremental coordinate calculation methods
are clearly explained in our previous video.
The tutorial link is on the description.
Now we look into M codes.
Number 1, M03 and M04 are used for spindle revolution in clockwise direction
and counterclockwise direction respectively.
The format is M03 or M04 and S.
S is RPM we can choose according to cutting parameters.
The unit is revolutions per minute.
M05
M05 is used for spindle stop.
M06, auto tool change
When the multiple tools are stored in the machine tool magazine,
you can choose tool number and M06.
Machine will change the specified tool to the spindle.
Number 4, M08 and M09 are used for coolant on and off respectively.
Number 5, M30, program end and rewind
This is used while end of the program, to communicate the machine that program is finished.
These are the 15 G and M codes you must know for creating a basic CNC program.
Some more codes will be explained during the application in coming tutorials.
The PDF note is available on the description.
For more CAD CAM CNC tutorials, subscribe CAMFORCE.
Happy learning.
Bye.
