0% found this document useful (0 votes)
4 views

Computer Aided Manufacturing Note

The document provides an overview of Computer-Aided Manufacturing (CAM) with a focus on the G&M-Code language used for programming milling machines. It details the structure and examples of G-Code and M-Code instructions, including movement commands and spindle control. Additionally, it includes practical experiments for slot processing and arches, along with practice questions for simulation and coding exercises.

Uploaded by

jonathanoghomeh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Computer Aided Manufacturing Note

The document provides an overview of Computer-Aided Manufacturing (CAM) with a focus on the G&M-Code language used for programming milling machines. It details the structure and examples of G-Code and M-Code instructions, including movement commands and spindle control. Additionally, it includes practical experiments for slot processing and arches, along with practice questions for simulation and coding exercises.

Uploaded by

jonathanoghomeh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

COMPUTER AIDED MANUFACTURING (CAM)

1.0 THE MILLING MACHINES (S-MILL)

1.1 G&M-Code language

The G&M-Code language is a very simple programming language and this is the secret of its popularity. The
programming file is a text file written by a text editor (a simple word processing).
The programming rules are as follows:
 Every instruction to the machine should start with the letter G or M (this is the reason for the name G&M-
Code).
 The software ignores lines that do not start with the letter G or M.
For example, G1 X10 Y30 Z-15 F125 meaning:
Move in straight line to point X,Y,Z = 10,30,15 from the home position at feed of 125 millimeters per
minute. The movement is done in 3D dimensions.
 All the parameters should be given in millimeters.
 S-MILL software allows using a decimal point. i.e.: G1 X10.5 Y20.7

Important Note
S-MILL uses point as decimal point. Computers that are set to comma as decimal point must be changed to
point as decimal point. It is done in the 'Regional and language options' on the 'Control Panel'.
 The parameters are optional. It means that the current value of a parameter that is not indicated in an
instruction remains without change.
 We use the '/' sign to indicate relative values.
i.e.: G1 X/20.3 Y/-5, which means:
Move 20.3 millimeters forward on X and 5 millimeters backward on Y from the current location at
previous feed and without changing Z height.

1.2 The S-MILL G-Code instruction set:


(i) G0 Xxx Yyy Zzz:
Idle movement on straight line (in a Cartesic axes system) to point xx, yy, zz at maximum speed.
Examples:
G0 X10 Y25 Z-3
G0 Y15.2

1
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

(ii) G1 Xxx Yyy Zzz Fff:


Milling movement on straight line (in a Cartesic axes system) to point xx, yy, zz at ff speed.
Examples:
G1 X10 Y25 Z-3 F200
G1 Y15.2

(iii) G10 Rrr Ccc Iii Jjj:


Idle movement on straight line (in a Polar axes system) to point on a circle's perimeter at maximum
speed.
R is the circle radius.
C is the angle (in degrees) of the point.
I and J are the X,Y coordinates of the center of the circle.

Examples:
G10 R10 C30 I25 J20
G10 C180

(iv) G11 Rrr Ccc Iii Jjj Fff:


Milling movement on straight line (in a Polar axes system) to point on a circle's perimeter at ff
speed.
R is the circle radius.
C is the angle of the point.
I and J are the X,Y coordinates of the center of the circle.
Examples:
G11 R10 C30 I25 J20 F200
G11 C180

(v) G02 Iii Jjj Rrr Ccc Eee Fff:


Clockwise milling circular movement (arch) at ff feed.
R is the circle radius.
C is the angle (in degrees) of the starting point.
E is the angle (in degrees) of the ending point.

2
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

Note:
The instruction G02 means move in a straight line to the arch starting point (indicated by C) and
then to the arch ending point (indicated by E).
Example:
G02 I25 J20 R10 C30 E60 F200
(vi) G03 Iii Jjj Rrr Ccc Eee Fff:
Counter clockwise milling circular movement (arch) at ff feed.
(vii) G81 Zzz:
Z axis movement for drilling.
(viii) G4:
"Wait" instruction, usually applied for stopping in order to replace the milling cutter or the processed
material. A message appears on the screen and the PC waits for clicking OK to
continue.

1.3 M-Code instruction set:


a) M4 Sss - Command to start the spindle Motor CCW at ss speed in RPM.
b) M5 - Command to stop the spindle Motor.
Experiment 1 – Slot Processing

3
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

The symbol indicates the project home position. It is also the origin of the axes. The X, Y, Z absolute
values relate to this point.

The circle at point 1 indicates the milling cutter diameter and the milling starting point.

Step 1: Type the following G&M-Code milling program:


M4 S2000 start spindle motor at 2000 RPM
G0 Z3 move to clearance point (clearance = 3mm)
G0 X20 Y50 move to point 1 at maximum feed (clearance = 3mm)
G1 Z-1 F100 move to Z=-1mm at feed=100
G1 X20 Y60 move to point 2
G1 X30 Y70 move to point 3
G1 X50 Y70 move to point 4
G1 X60 Y60 move to point 5
G1 X60 Y40 move to point 6
G1 X50 Y30 move to point 7
G1 X30 Y30 move to point 8
G1 X20 Y40 move to point 9
G1 X20 Y50 move to point 1 back
G0 Z3 move to clearance point
G0 X0 Y0 move to HOME position
M5 stop spindle motor
Step 2: Compare the program with the drawing. Check each instruction.
Step 3: Select the function FILE and the SAVE AS sub-function. A dialog window is
opened requesting the file name.

4
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

Experiment 2 - Arches

Step 1: Type the following G&M-Code milling program:


M4 S2000 start spindle motor at 2000 RPM
G0 Z3 move to clearance point
G0 X10 Y50 move to point 1 at maximum feed
G1 Z-1 F100 feed=100 Z=-1mm
G02 I20 J70 R10 C180 E90 move to points 2 and 3
G02 I60 J70 R10 C90 E0 move to points 4 and 5
G02 I60 J30 R10 C0 E270 move to points 6 and 7
G02 I20 J30 R10 C270 E180 move to points 8 and 9
G1 Y50 move to point 1
G0 Z3 move to clearance point
G0 X0 Y0 move to HOME position
M5 stop spindle motor
Step 2: Compare the program with the drawing. Check each instruction.
Step 3: Select the function FILE and the SAVE AS sub-function. A dialog window is opened requesting the file
name.

5
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

PRACTICE QUESTIONS
(1) Write out the G & M codes and simulate the following slots and arches to be produced on CNC
milling machine. In each case save the simulated pattern as a figure.
(a) (b)

(c) (d)

6
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

(2) Write the G & M codes of the simulated patterns of the figures below:
(a)

(b)

7
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.

Department of Mechanical Engineering, Adeleke University, Ede

(3) Write out, at any convenient scale, the G & M codes of the following words:
(a) UNIVERSITY
(b) CAM
(c) COMPUTER
(d) STATE
(e) NIGERIA

You might also like