Computer Aided Manufacturing Note
Computer Aided Manufacturing Note
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
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.
Examples:
G10 R10 C30 I25 J20
G10 C180
2
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.
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.
3
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.
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.
4
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.
Experiment 2 - Arches
5
Computer-Aided Design and Manufacturing (CAD/CAM) By: Engr. Adeleke, K.M.
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.
(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.
(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