Programming of CNC Machines. Ken Evans
The language described in this book is used for controlling machine tools is known informally as “G-Code”. This language is used worldwide and is reasonably consistent. The standard it is governed by was established by the Electronics Industries Association and the International Standards Organization called EIA/ISO for short. Because of this standardization a program created for a particular part on one machine may be used on other similar machines with minimal changes required.
Each program is a set of instructions that controls the tool path. The program is made up from blocks of information separated by the semicolon symbol (;). This symbol (;) is defined as the end of the block (EOB) character. Each block contains one or more program words. For example:
Word | Word | Word | Word | Word |
N02 | G01 | X3.5 | Y4.728 | F8.0 |
Each word contains an address, followed by specific data. For example:
Address | Data | Address | Data | Address | Data |
N | 02 | G | 01 | X | 3.5 |
The following chart is a list for all of the letter addresses that are applicable in programming, along with brief explanations for each:
Address Characters
CHARACTER | MEANING |
A | Additional rotary axis parallel and around the X axis |
B | Additional rotary axis parallel and around the Y axis |
C | Additional rotary axis parallel and around the Z axis |
D | Tool radius offset number(Turning) Depth of cut for multiple repetitive cycles |
E | User macro character |
F | Feed rate(Turning) Precise designation of thread lead |
G | Preparatory function |
H | Tool length offset number |
I | Incremental X coordinate of circle center or parameter of fixed cycle |
J | Incremental Y coordinate of circle center |
K | Incremental Z coordinate of circle center(Turning) parameter of fixed cycle |
L | Number of repetitions (subprogram, hole pattern)Fixed offset group number |
M | Miscellaneous function |
N | Sequence or block number |
O | Program number |
P | Dwell time, program number, and sequence number designation in subprogram(Turning) Sequence number start for multiple repetitive cycles |
Q | Depth of cut, shift of canned cycles(Turning) Sequence number end for multiple repetitive cycles |
R | Point R for canned cycles, as a reference return valueRadius designation of a circle arcAngular displacement value for coordinate system rotation |
S | Spindle-speed function |
T | Tool function |
U | Additional linear axis parallel to X axis |
V | Additional linear axis parallel to Y axis |
W | Additional linear axis parallel to Z axis |
X | X coordinate |
Y | Y coordinate |
Z | Z coordinate |
Common Symbols Used in Programs
SYMBOL | MEANING |
− | Minus Sign, Used for Negative Values |
/ | Slash, Used for Block Skip Function |
% | Percent Sign, Necessary at program beginning and end for communications only |
( ) | Parentheses, Used for comments within programs |
: | Colon, Designation of Program Number |
. | Decimal Point, Designation of fractional portion of a number |
1. Programming is a method of defining tool movements through the application of numbers and corresponding coded letter symbols.
T or F
2. A lathe has the following axes:
a. X, Y & Z
b. X & Y only
c. X & Z only
d. Y & Z only
3. Program coordinates that are based on a fixed origin are called:
a. Incremental
b. Absolute
c. Relative
d. Polar
4. On a two axis turning center the diameter controlling axis is:
a. B
b. A
c. X
d. Z
5. The letter addresses used to identify axes of rotation are:
a. U, V & W
b. X, Y & Z
c. A, Z & X
d. A, B & C
6. The acronym TLO stands for:
a. Tool Length Offsets
b. Total Length Offset
c. Taper Length Offset
d. Time Length Offset
7. When referring to the polar coordinate system, the clockwise rotation direction has a positive value
T or F
8. In Figure 15 of Part 1, which quadrant is the part placed in?
9. A program block is a single line of code followed by an end-of-block character
T or F
10. Each block contains one or more program words
T or F
11. Using Figure 13 in Part 1, list the X and Y absolute coordinates for the part profile where Workpiece Zero is at the upper left corner. (The corner cutoff is at a 45° angle).
12. Using Figure 13 in Part 1, list the X and Y incremental coordinates for the part profile where Workpiece Zero is at the upper left corner.
13. How often should the machine lubrication levels be checked?
Figure 1 Common Operators Panel
1. To become familiar with common CNC Machine Operation Panel functions.
2. To become familiar with common Machine Control Panel functions.
3. To learn common operations performed at the Machine Control.
4. Learn how to use the Controls to input setup data including Tool and Work Offsets.
5. Learn how to use the Control to edit programs.
6. Examine some common cases of problem situations and learn how to solve them.
Every CNC Machine Tool has an Operation Panel and a Control Panel that are the interface between the Operator and or Programmer and the Machine Tool, sometimes referred to as the