The meaning of common address characters
Detailed explanation of programming instruction codes of CNC FANUC machining center
Auxiliary function M command
Note: There can only be one M command in a block. If two or more M commands appear in a program, only the last M command is valid, and the rest are invalid!
Other instructions
(1) F—feed speed command
F and the following numbers indicate that when the command is G94, the unit is mm/min, when the command is G95, the unit is mm/r.
(2) S—spindle speed command
S and the following numbers indicate that the unit is r/min.
(3) T—Tool command
T and the following three digits indicate the tool number.
(4) H and D-tool length compensation value and tool radius compensation value
H and D and the following three digits indicate that the three digits are the memory address (number) where the tool compensation amount is stored.
Detailed explanation of G command code
1. Machine function setting
1. G53—Select the machine coordinate system
Format: G53 X Y Z; (X Y Z is the machine coordinate value)
Note: When the G53 command is specified, the radius compensation, tool length compensation and tool offset value of the tool will be cleared. Generally, the Z axis is designated for tool change.
2. G54~G59—Select the workpiece coordinate system
Note: After the power is turned on and the reference point is returned, the system automatically selects G54.
3. G54.1 P1~P48—Select additional workpiece coordinate system
4. G52—local coordinate system
Format: G52X Y Z;
Format meaning: For the convenience of programming, set the sub-coordinate system of the workpiece coordinate system. The value of X Y Z in G52 is the position coordinate in the workpiece coordinate system G54~G59.
Cancel local coordinate system——G52 X 0 Y 0 Z 0;
Note: When the G52 local coordinate system is commanded or the local coordinate system is canceled, the tool offset values such as tool length compensation and tool radius compensation will be cancelled. In the subsequent program, the specified tool length compensation, tool radius compensation and other tool offset values must be reset.
5. G90—Absolute Programming
Absolute programming means that the tool moves to a certain position away from the origin of the workpiece coordinate system.
6. G91—Incremental programming
In the incremental programming, the distance of the tool movement is calculated based on the previous point, which is the increment of the previous point.
7. G21—mm input G20—inch input
8. G16—Enable polar coordinate command G15—Cancel polar coordinate command
2. Interpolation function instruction
1. G00—Quick positioning instruction
Format: G00 X Y Z;
Format meaning: G00 command makes the tool move from the current point of the tool to another point at the fastest speed in the point-position control mode. The trajectory is not necessarily two points and one line, it may be a broken line.
Note: (1) When the tool moves from top to bottom: G00 X Y; Z; Set the XY plane first, and then the Z axis descends. (2) When the tool moves from bottom to top: G00 Z; X Y; Z axis rises first, and then XY plane is set.
2. G01—Linear interpolation command
Format: G01 X Y Z F;
Format meaning: G01 command makes the tool move from the current to the specified point according to F command.
3. G02—clockwise interpolation, G03—counterclockwise interpolation
Format: G17 {G02 /G03}X Y (R /I J )F;
G18 {G02 /G03}X Z (R /I K )F;
G19 {G02 /G03}Y Z (R /J K )F;
Format meaning:
Note: 1. It can be omitted when I J K is zero; in the same program, if I J K and R appear at the same time, R is valid.
2. When machining with R, the whole circle cannot be machined, and the whole circle can only be programmed with the center coordinate I J k.
3. Program pause instruction
1. G04—Pause instruction
Format: G04 X; or G04 P;
Format meaning: X is followed by the extension time, the unit is s, and there must be a decimal point after it. The number after P is an integer, and the unit is ms.
Fourth, the call instruction of the subroutine
1. M98 P ×××;
Format meaning: P× × × refers to the subprogram number of the calling program, the 0 before the program cannot be omitted, it refers to the number of repeated calls.
2. The writing of the subprogram is basically the same as the general program, except that the end of the program is M99, which means that the subprogram ends and returns. M99 does not need to be a block independently, but can be placed at the end of the last block.
Five, tool compensation instructions
1. G43, G44, G49—tool length compensation command
Format: G43 Z H; indicates the positive compensation of the tool length, the Z-axis reaching distance Z is the specified value plus the compensation value H.
G44 Z H; Represents the negative compensation of the tool length, the Z-axis reaching distance Z is the specified value minus the compensation value H.
G49 Z; or H00 means cancel tool length compensation
Note: G43 G44 command has nothing to do with G90 G91, the offset value corresponding to H command can be negative or positive. When H is 0, the tool length compensation is cancelled. The range of H value is 00~200.
Since the compensation value ranges from -999.999 to 999.999mm or -99.9999 to 99.9999 inches, the sign of the compensation value changes, and all the work can be done using G43.
2. G41, G42, G40—tool radius compensation command
Format: {G17 G18 G19} [G41 G42] (G00 G01) (X Y, X Z Y Z) D F;
G40 G00 (G01) X Y F; or D00
Format meaning: G17 G18 G19 is the selection plane,
G41 tool radius left compensation, G42 tool radius right compensation, and G40 tool radius compensation are cancelled.
Note:
1. When entering the tool radius compensation state from the no tool compensation state, or when canceling the tool radius compensation, the tool must be moved out a certain distance, otherwise the tool will directly offset a tool radius in the normal direction of motion, and the tool will collide if there is no turning space.
2. When D is 0, the tool radius compensation is cancelled. The range of D value is 0~200.
Because the range of the compensation value is -999.999~999.999mm or -99.9999~99.9999 inches.
3. The left and right compensation judgment of the tool radius is based on the tool feed direction, the contour of the tool center, especially the left and right offset values of G41 and G42 when executing G18 G19.
4. When executing G41, G42 and G40, the movement command can only use G00 G01, but not G02 G03.
5. In order to ensure the integrity and smoothness of the contour, generally use: G41 G42 command to carry out tool radius compensation, go through the transition section (circle or straight line), contour cutting go through the transition section (circle or straight line), use G40 to cancel the tool radius compensation .
6. During programming, if the program for introducing and canceling the radius compensation of the tool is in the main program of the block (it must be done when processing the boss), then when the number of times of calling the subroutine (processing contour program) exceeds one time, it will be cut in the second time. There will be overcutting phenomenon.
Six, canned cycle instructions
List of fixed cycle command functions
The usual six basic actions of a fixed cycle command are:
1. Action 1—X and Y axis positioning (initial point)
2. Action 2—Quickly reach the point R plane (the position to be cut
3. Action 3-Hole processing. The hole machining is executed in the cutting feed mode.
4. Action 4—The action at the bottom of the hole. Such as pause, spindle stop, tool shift, etc.
5. Action 5—return to the R plane.
6. Action 6—Quickly return to the beginning





