Manual Part Programming Methods
It is necessary to have a specified format or language that should be used to write the part programs. It would be preferable to use a language that is close to English, but that would make the language interpretation more difficult. Hence, the part programming language used universally by the CNC controllers is the 'Word Address Format' that relies on providing a character address for each of the number that is specified in the part program block. Prior to this a number of formats such as fixed sequential and tab sequential format have been tried that are no more in use. A typical block in the word address format is given below:
N050 G01 X10.45 Y75.0 Z-8.0 F150 M3;
The meaning of these parameters is described below:
N050 refers to the block number 50
G01 refers to a preparatory function 1 for linear interpolation
X10.45 refers to X coordinate value 10.45 units
Y75.0 refers to Y coordinate value 75.0 units
Z-8.0 refers to Z coordinate value -8.0 units
F150 refers to a feed rate of 150 units/min
M3 refers to a miscellaneous function value of 3 that starts the spindle in the clockwise direction
; refers to the end of block
The complete part program is broken down into a number of blocks each of which consists of a number of words as given above. Each of the blocks refers to a set of instructions that can be simultaneously executed. Each block generally starts with a block number that can be used as a label and is programmed with a N word address. This may be followed by a number of words as required.
From the beginning of the CNC era, standardisation played an important role in simplifying the programming where a large number of manufacturers are involved. The EIA (Electronics Industries Association) and ISO (ISO 2539) have carried out the standardization and most of the manufacturers follow these. As per the ISO standard, all the 26 letters of the English alphabet were standardised and given meaning as follows:
Character Address For
A Angular dimension around X axis
B Angular dimension around Y axis
C Angular dimension around Z axis
D Angular dimension about special axis or third feed function*
E Angular dimension about special axis or second feed function* F Feed function
G Preparatory function
H Unassigned
I Distance to arc centre or thread lead parallel to X
J Distance to arc centre or thread lead parallel to Y
K Distance to arc centre or thread lead parallel to Z
L Do not use
M Miscellaneous function
N Sequence number
O Reference rewind stop
P Third rapid traverse dimension or tertiary motion dimension parallel to X*
Q Second rapid traverse dimension or tertiary motion dimension parallel to Y*
R First rapid traverse dimension or tertiary motion dimension parallel to Z*
S Spindle speed function
T Tool function
U Secondary motion dimension that is parallel to X*
V Secondary motion dimension i.e parallel to Y*
W Secondary motion dimension i.e parallel to Z*
X Primary X motion dimension
Y Primary Y motion dimension
Z Primary Z motion dimension
* Where D, E, P, Q, R, U, V, and W are not used as indicated, they may be used elsewhere. The ISO format for a typical block is shown below:
N5 G2 X±53 Y±53 Z±53 U..V...W...I...J...K..F5 S4 T4 M2;
N5 This refers to an integer value with a maximum of 5 digits, the maximum value will be 99999 while the minimum is 1.
G2 This also refers to an integer value with a maximum of 2 digits, the maximum value will be 99 while the minimum is 0.
X±53 This refers to a real value with a maximum of 5 digits before decimal and 3 digits after the decimal with an optional sign before the value. The maximum value will be 99999.999 while the minimum is 0.
Y±53 Same as above Z±53 Same as above U...V...W...I...J...K... Same as above
F5 This refers to an integer value with a maximum of 5 digits; the maximum value will be 99999 while the minimum is 0.
S4 This refers to an integer value with a maximum of 4 digits; the maximum value will be 9999 while the minimum is 0.
T4 This refers to an integer value with a maximum of 4 digits; the maximum value will be 9999 while the minimum is 0.
M2 This also refers to an integer value with a maximum of 2 digits, the maximum value will be 99 while the minimum is 0.
; This refers to the end of block character
It is not necessary that all these characters are to be used in every block. The sequence of the characters can also be changed. Here are a few examples that will clarify the use of these words.
N010 G90 G71;
N020 G92 X-50.0 Y-50.0 Z50.0;
N030 G00 X8.0 Y8.0 Z2.0;
For the sake of simplicity we will be following the ISO format in this course. However, the programmer should refer the individual CNC machine program manual to follow the correct procedures and formats.
The co-ordinates are a major part of a typical part program. The various word addresses used for specifying coordinates are X, Y, Z, U, V, W, I, J, K, A, B, C, etc. They can be specified using a direct decimal format as we normally do in algebra. Some examples are:
N035 T01 M03 S1000;
N040 G01 X15.450 Y35.540 Z-2.0 F120;
N055 X-25.500 Y55.545;
N065 X15.450 Y35.540;
Generally, the feed rate is specified with F word address and specified in mm per minute. The value specified normally is the speed with which the spindle moves along the specified path. For example, F120 in the above statement means that the feed rate is specified as 120 mm per minute (assuming metric units are used in the program). However, it is also be possible to specify using the mm per revolution units, with a special preparatory function as described later. The feed rate specified in any block remains modal, meaning that it will remain in force till it is altered by another F word. Generally, it is expected that the axes will be moving at the specified rate. However, it is possible to change this by the use of feed rate override switch on the machine tool control panel.
The spindle speed can be set using the S word address. The number after the S is the speed of the spindle specified directly in revolutions per minute. For example, S1000 in the above statement means that the spindle speed is specified as 1000 revolutions per minute. Though this is the normal usage, it is also possible to specify the spindle speed in cutting speed units as meters per minute using a special preparatory function, which is described later.
The tool to be used for an operation is to be identified by the T word address. For example, T01 in the above statement means that the tool number 1 is to be placed in the spindle. The tool number is considered in this book as the tool magazine position in the case of machines with automatic tool changers. The actual case may have to be verified with the programming manual of the individual machine tool. In some cases the tool number may also have to be combined with the tool offset register number, which is described later.