Professional Documents
Culture Documents
NC Code System
NC Codes
NC codes: the functional characters recognized by the NC controller. It is composed by: Characters Bit Address Word (Collection of characters) Block (Collection of words) Program
Character
NC coded instructions are carefully arranged by letters (A, B, Z), numbers (0, 1,9) and symbols (+,-,/)
Example1: G00 X0. Y0. Example2: G01 X2. Y2. Example3: G02 X4. Y0.
Bit
A representation of one of two possible states (on or off, high or low, 1 or 0). It is signified by the presence or absence of a punched holes in a raw.
Character
A collection of 8 bits across a raw on the tape uniquely representing a number, letter or symbol
Character
A 1 %
5
Address
The letter used at the beginning of each word to define the meaning of the numerical data that follow.
A, B, C = Angular dimension around X, Y, Z F = Feed function G = Preparatory function I, J, K = X, Y, Z motion dimension for circular arc center M = Miscellaneous function N = Sequence number
Address (cont.)
S = Spindle speed (S1500) T = Tool function (T0101) X, Y, Z = Primary dimension U, V, W = Secondary motion dimension parallel to X, Y, and X
Word
A collection of characters arranged in a certain order to cause a special action by the NC machine.
Example:
N10 G01 X1. F20 T01 M06 sequence number linear interpolation X coordinate Feed rate Tool number Tool change command
Block
A collection of word. It can be a single word or a combination of words. Ended by EOB (end of block, ; ) Example: N01 G00 X1.5 Y 2.0 Four-word block N02 T0101 M06 Three-word block
10
Program
Collection of blocks Contains a complete set of coded instruction needed to machine a workpiece Depending on the function, a program may comprise following features:
Safety, tool change, Coordinate offset, Tool length offset, tool motion, cutter diameter compensation, misc. function
Example of program
N10 O334 N20 G90 G17 G70 S2000 F50. N30 M6 T12 N40 G0 E12 X0. Y0. Z0.5 M3 offset setup E12 (change) N50 G0 X0.5 Y0.5 N60 G01 Z-0.1875 N70 X2.5 N80 Y2.5 N90 X0.5 N100 G0 Z0.5 N120 G91 G28 X0. Y0. Z0. N130 M02 Program #334 Safety features Move to origin at
11
12
NC functions
Eight type of NC functions:
Sequence (N) Preparatory function (G) Dimension addresses (words) (X,Y,Z) Circular arc center address (words) (I,J,K) Spindle speed function (S) Tool Function (T) Feed rate (F) Miscellaneous (M)
13
14
Y Current location
Commanded location
X
15
X
16
Appropriate movement
Wrong movement
17
X 18
Arc Start position X, Y, Z Rotation direction G02, G03 Arc end position Arc center coordinate
G03
19
20
R (Radius) Method
G02 Xx Yy Rr Ff Require the end point and the radius value Positive R - for the arc less than 1800 Negative R - for the arc larger than 1800 The arc must less 359.90 Arc 359 to 360 degrees required 2 consecutives arc interpolation
I = Xc - Xs J = Yc - Ys K = Zc - Zs
J C I B
Cut from A to B
21 22
Other G-Code
G90 G91 - Positioning System G70 G71 - Unit Selection G94 G95 - Feed Unit G17 G18 G19 - Plane Selection G92 Absolute zero setting
workpiece
Defined origin 6
5 X
25
26
workpiece
28
29
30
Dimension Code X, Y, Z
Xx, Yy, Zz For metric system input 053 (unit: mm)
XXXXX.XXX (with decimal point) X55125~X55.125 mm Y7100~Y7.1 mm Z125~Z0.125 mm
Dimension Code X, Y, Z
About decimal points
Do not omit the required decimal point; it will result in an error value
X1.~X1 (if inch system is used) X1~X0.0001 inch
Any input digits exceeding the level of precision of the system will be neglected
3.49667 inch ~ 3.4966 inch
A dimension word cannot exceed eight digits, otherwise, an error message will be issued.
X1.23456789 will generate error message
32
Program Structure
N # O#### N# G90 G17 G70 S# F# N# M6 T12 N40 G00 E12 X0. Y0. Z0.5 M3 N50 G00 X0.5 Y0.5 N60 G01 Z-0.1875 N70 X2.5 N80 Y2.5 N90 X0.5 N100 G0 Z0.5 N120 G0 X0. Y0. Z0. N130 M02
N Incremental #, O Program id. G90 Positioning System, G17 Plane selection XY, G70 inch unit, S- spindle speed, F- feed rate M6- Tool change E offset setup T- tool number G00 Movement M02 end of program Returning tool to (0,0,0) position
34
Case Study I
The figure shown in next slide indicates the geometry of the material (solid line) and tool path (dash line). We assume that we will use Fadal Machine to cut this material, and the following parameters will be used: Tool:
tool # 5 with " end mill. Fixture offset: E12 Feed rate: 20 in/min Spindle speed: 1500 RPM depth of cut: 0.25 inch
Case Study I
Y 2.5 2.0 1.2 0.5 B A 0.5 2.0 4.0 F 4.5 X C D R=0.5 E
X A B C D
35
Z E F 4.5 4.5
X 2.0 0.5
Y -0.25 -0.25
36
Case Study I
% N5 O21 N10 G90 G40 G80 G70 G17 G94 N20 E12 G00 X0.5 Y0.5 Z.25 N25 S1500 M3 N30 G1 Z-.25 F20 N50 Y1.2 N60 X2.0 Y2.5 N70 X4.0 N80 G2 X4.5 Y2.0 R0.5 N90 G1 Y0.5 N100 X0.5 N110 Z0.25 N140 G28 G91 Z0. N150 G28 G91 X0. Y0. N160 M30 % program # safety feature fixure offset #12, move to A set spindle, and spindle on feed to desired depth move to B move to C move to D move to E move to F move to A lift tool up to z=0.25 reference return end program
37