0% found this document useful (0 votes)
145 views19 pages

Description For M Codes3

The document describes M and G codes used in CNC programming. M codes control functions like spindle start/stop, coolant on/off, tool change. G codes specify motion like linear, circular interpolation and drilling cycles. Common codes include M03 to start spindle clockwise, M05 to stop spindle, G01 for linear interpolation, G02 for clockwise arc, and G90 for turning cycles. The codes control CNC machine functions and tool path.

Uploaded by

balabooks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views19 pages

Description For M Codes3

The document describes M and G codes used in CNC programming. M codes control functions like spindle start/stop, coolant on/off, tool change. G codes specify motion like linear, circular interpolation and drilling cycles. Common codes include M03 to start spindle clockwise, M05 to stop spindle, G01 for linear interpolation, G02 for clockwise arc, and G90 for turning cycles. The codes control CNC machine functions and tool path.

Uploaded by

balabooks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

DESCRIPTION FOR M CODES:

M00 Program stop


Cycle operation is stopped after a block containing M00 is executed.

M01 Optional stop


Cycle operation is stopped after a block containing M01 is executed.
This code is only effective when the optional stop switch on the machine
control panel has been pressed.
Example: M01

M02 End of program


M02 Halt program execution: The spindle speed is turned off and the
CNC program is terminated.

M03 Starts spindle


An M03 instruction starts forward spindle motion. It requires a speed
with in the range 100 to 3000 R.P.M
Example: M03 S2200

M04 Reverse Spindle


An M04 instruction starts reverse spindle motion. It requires a speed
with in the range of 100 to 3000 R.P.M
Eg: M04 S2200.

M05 Stop Spindle


An M05 instruction stops spindle.

M06 Tool Change


The M06 Instruction causes the Fanuc to change to different Tool.
The tool changing operation should be done in the home position only.
Eg: M06 T1.

M08 Coolant ON
M08 turns the Coolant on.

M09 Coolant OFF


M09 turns the Coolant OFF

M10/11 Work clamp open/close


M10 Opens the work clamp
M11 Closes the work clamp

M13 Coolant Spindle Forward


M13 turns the Coolant ON and starts Forward Spindle Motion.
Eg: M13 S1000.

M14 Coolant Spindle Reverse


M14 turns Coolant ON and starts a reverse Spindle Motion.

M25 Quill Extend


Extends the quill (tail stock)

M26 Quill Retract


Retracts the quill (tail stock)

M30 Program End & Rewind


Stops the spindle. Turns the coolant off. Terminates and resets the
CNC program. This command is used at the end of program to stop the
program and to bring the cursor to first line of program to repeat the
program once again.

M38/39 Door Open/Close


M38 Opens the door.
M39 Close the door.

Input /Output Commands for FMS


M62/65 Auxiliary output on.
M62 Sets Auxiliary output 1 on.
M63 Sets Auxiliary output 2 on.

M64 Sets Auxiliary output 1 off.


M65 Sets Auxiliary output 2 off.

COMMANDS DESCRIPTION
These commands are available in the machine side
The robot inputs can be switched on by sending the output signal
from machine side to robot side as a input signal.

M66/67 Waiting for Auxiliary Input 1/2 on


M66 Waiting for Auxiliary Input 1 on.
M67 Waiting for Auxiliary Input 2 on.

M76/77 Waits for Auxiliary 1/2 ON


M76 Waits for Auxiliary Input 1 to become off.
M77 Waits for Auxiliary Input 2 to become off.

Note: M66/67/77
These M codes are available in the machine side. The machine side
Inputs can be switched on by transferring the output signal from robot side
to machine side as an input signal.
The machine Inputs can be switched on by transferring the high
signal, which comes from the Robot side. The machine inputs can be
switched off by transferring the low signal, which comes from the robot
side.

M98 Sub Program Call


M98 Causes another program to be executed. The p Value
specifies the program number and the no. of times to execute it.
The right most 4 digits are the program Number.
The digits to the left are number of repetition.

There can be up to 999 repetitions, If the value is omitted it is called


once.
Examples: M98 p12 and M98 p0010012 both both execute CNC program
12 once.

M99 Sub program Exit


Returns control to the program that called the current program.

If a p value is specified then execution begins from the block with


the same N number otherwise it is the from the block after the
subprogram call.
If an M99 is specified in the main program then the execution is from
the start of the program. This is called Looping or Nesting of one more
programs.
Example: M99
Mp10

Returns to the block following the call.


Returns to the block with N value 10.

DESCRIPTION OF G CODES

G00 Rapid Traverse or fast Traverse


A G00 causes the tool to move to specified position at the maximum
speed.
Example: G00 X20 Z1

G02 Linear Interpolation or slow traverse


A G02 cause Linear Motion to the position at the last specified feed
rate from the current position. The feed rate for the linear motion should be
Example: G01 X20 Z1 F180

G02 Clockwise Circular Interpolation


A G02 causes a clockwise arc is cut. If the negative then the Longer
Arc is cut
Example: G02 X30 Z-20 R15 F80

GO3 Counter Clockwise Circular Interpolation


G03 causes counter clockwise circular motion

G04 Dwell
A Dwell of up to 500 seconds can be programmed.
Example: G04 X10

This causes a delay in machine of 10 seconds. This can be used for


drilling cycle.
Example: G04 P1500
This causes a delay in machine of 1500 milliseconds.

G20 Imperial Units


All future instruction parameters will be taken as imperial values. That
is, they will specify inches.

G21 Metric Units


All future instruction parameters will be taken as metric valuse.That is
they will specify millimeters. By default metric units will be taken for part
programming.

G28 Go to Reference Point


A G28 causes a fast traverse to the specified position and then
machine datum.
Example: G28 U0 W0

G40 Cancel Tool Radius Compensation


G40 Switched off any tool radius compensation activated by a G41
OR G42.

G41 Compensation Right

G41 enable tool nose radius compensation to the right of the


programmed path.

G42 Compensation Left


G42 enable tool nose radius compensation to the left of the
programmed path.

G50 Co-Ordinate Setting


G50 has two uses.
A co-ordinate setting block has X,Z,U or W upon it.
A maximum spindle speed block dose not.

G50 Clamp Spindle


G50 sets the maximum spindle speed for constant surface speed
control. An X, Z, U or W prefix must not be on the same block will be
interpreted as a coordinate setting block.
Example: G50 S2000
G50 creates a new coordinate system in which the tools current
position is set to the specified coordinates. The new coordinates can be in
absolute or incremental form.
Example: G50 X0 Z0 and G50 U-40

G70 Finishing cycle

A G70 causes a range of blocks to be executed, then the control


passes to the block after the G70.This will be used after the completion of
the roughing cycle.
The P and Q values specify the N block numbers at the start and end of
the profile.
Example: G70 P20 Q50
P-First block of the cycle
Q-Last block the cycle

G71 Multiple Turning Cycle


A G71 causes a range of blocks to be executed for turning operation.
G71 U R
G71 P Q U W F

G71 U R
U

-depth of cut in mm

-radial tool retraction in mm

G71 P Q U W F
P

-starting block number

-end block number

-finishing allowance in X direction in mm

-finishing allowance in Z direction in mm

-feed rate

G72 Multiple Facing Cycle


A G72 causes a range of blocks to be executed for facing operation.
G72 W R
G72 P Q U W F

G72 W R
W

-depth of cut in mm

-radial tool retraction in mm

G72 P Q U W F
P

-starting block number

-end block number

-finishing allowance in X direction in mm

-finishing allowance in Z direction in mm

-feed rate

G73 Pattern Repeating Cycle


A G73 causes a range of blocks to be executed for turning operation.
G73 U W R
G73 P Q U W F

G73 U W R
U

-difference in radius in mm

-axial relief amount, which is zero for turning

-total number of passes to be executed

G73 P Q U W F
P

-starting block number

-end block number

-finishing allowance in X direction in mm

-finishing allowance in Z direction in mm

-feed rate

G74 End Face Pack Drilling Cycle


A G74 is drilling cycle with in-built pecking action. After every peck of
the specified amount the tool will he retracted to the specified amount.
G74 R
G74 X Z P Q F

G74 R
R

-radial retraction of the tool in mm

G74 X Z P Q F
X

-center of the hole, always zero

-total depth of the hole in mm

-depth of cut for each peck in microns

-feed rate

G75 Grooving Cycle


This cycle is used to make an axisymmetric groove of desired depth
and thickness using grooving tool.
G75 R
G75 X Z P Q F

G75 R
R

-radial retraction of the tool in mm

G75 X Z P Q F
X

- target point, lower left corner of the groove

- target point, lower left corner of the grove

- depth of cut in X direction for each peck in micron

- axial shift of the tool in Z direction in microns when the groove


width is more than the tool width

G76 Multiple Threading Cycle


This cycle performs the multiple thread cutting operation in one call
G76 P Q R

G76 X Z P Q F

G76 P Q R
P

- the first two digit


Next two digit

- number of finishing cycles


- tool pull out angle, normally 15

- maximum depth of cut at start in microns

- finishing allowance in mm
Ex: G76 P031560 Q150 R0.15

G76 X Z R P Q F
X

- minor diameter of the thread in mm

- length of the thread in mm

- must be zero

- height of the thread in microns

- minimum depth of cut in microns

- lead of the thread in mm (lead = pitch; for single start thread)

G90 Turning Cycle


A G90 is the diameter cutting cycle. It is the equivalent of
Rapid to X position
Feed to Z position
Feed to start Z position

Feed to start Z position


If an R value is specified tapering will be performed. The initial
rapid move will be to the position plus the R value (Ratio)
Examples: G90 U-4.0 W-40
G90 X 20 Z-8.0

G92 Threading Cycle


G92 performs one threading pass.
The position specified is that of the end of the thread.
The F value specifies the pitch, NOT the feed.
Example: G92 U-0.25 W-20 f1.5

G94 Box Facing Cycle


A G94 is an end face cutting cycle.
It is the equivalent of
Rapid to Z position
Feed to X position
Feed to start Z position
Rapid to start X position
If an R value is specified tapering will be performed. The initial
rapid move will be to the Z position plus R value.
Example: G94 U-4.0 W-2.0 R-8.0 F140

G96 Constant Surface Speed


G96 enables constant surface speed.
Example: G96 S100
Sets the surface speed to 100 meters a minute.

G97 Normal Spindle


G97 enables constant surface speed.
The spindle speed will not change until the next S value is reached.
Example: G97

G98 Feed per Minute


G98 sets the feed per minute mode. This is the default.

G99 Feed per Revolution


G99 sets the feed per revolution of the spindle.

DIFINITION

Billet Definition
The directive allows the billet in the simulation window to be given a
size.

The billet definition should be placed at the start of the program, after the
measure has optionally been set.
Example: G21
Sets the measure to metric
[BILLET X30.0 Z50.0
Defines the billet as 50mm long with a diameter of 30mm.

Subprogram directive
This directive allows a program with a non-numeric name to be called as a
subprogram.
Example: [subprogram 2222
M987 P0012222

Clear Directive
This directive clears the tutorial message windows.
Example: [CLEAR

Step Directive
This directive switches over to single step execution on-screen and
when linked to the Fanuc machine.

Single step off Directive

This directive switches off single step execution on-screen and when
linked to the Fanuc machine.
Example : [NOSTEP

Show Directive
This directive allows the operations to be simulated.
Example : [SHOW

Enable simulation
This directive allows the operations to be simulated.
Example : [SHOW

Disable simulation
This directive stops the operations being simulated.
Example: [NOSHOW

Tutorial Message
Tutorial message instructions being with the ! Exclamation mark
which is followed by some text.
When the CNC program is executed your text will appear in the
Tutorial window at the bottom of the screen.
Example: ! Using tool 2

Tutorial pause.

Tutorial pause instructions begin with ? question mark which is followed


by some text.
When the CNC program is executed your text will appear in the Tutorial
window at the bottom of the screen. You will then be prompted to press a
key to continue.
Example: ? Check the position directive
There are a selection of Directives used within the CNC program for
controlling the simulation and the manual control select one of them from
the menu for more information.

Comments
Use the (as the first character to specify a comment)

Tutorials
Interactive lessons can be developed through the Tutorials facility,
messages and questions can be embedded within the CNC program.
! Displays message without stopping
? Displays message but stops for key press.

**********

You might also like