CNC machining center programming introduction
Common address character meaning
The programming instruction code of the CNC FANUC processing center is explained in detail
Accessibility M instruction
Note: There can only be one M instruction in a program segment, and if two or more M instructions appear in one program, only the last M instruction is valid and the rest is invalid!
Other instructions
(1) F - In-in speed command
F and several subsequent numbers indicate that when the instruction G94 unit is mm/min, when the instruction G95 unit is mm/r.
(2) S-spindle speed command
S and a number of subsequent numbers indicate that the unit is r/min.
(3) T-tool instruction
T and the next three digits indicate the knife number.
(4) H and D - tool length compensation value and tool radius compensation value
H and D and the three digits that follow indicate that the three digits are the memory address (pan number) where the tool is stored.
The G instruction code is explained in detail
First, the machine function settings
1, G53 - Select the machine coordinate system
Format: G53 X Y Z ;(X Y Z is machine coordinate value)
Note: When the G53 instruction is specified, the radius compensation of the tool, tool length compensation and tool bias values are cleared, generally in the change of knife is the specified Z-axis.
2, G54 to G59 - select the workware coordinate system
Note: The system automatically selects G54 when the power is on and the reference point is returned.
3, G54.1 P1 to P48 - select the additional workware coordinate system
4, G52 - Local coordinate system
format:G52X AND Z ;
Format meaning: In order to set the sub-coordinate system of the workware coordinate system for programming convenience, the value of X Y Z in G52 is the position coordinate in the workware coordinate system G54 to G59.
Cancel local coordinate system——G52 X 0 Y 0 Z 0 ;
Note: Tool length compensation, tool radius compensation and other tool bias values are eliminated when instructing G52 local coordinate system or canceling local coordinate system, and tool bias values such as specified tool length compensation and tool radius compensation must be reset in subsequent programs.
5, G90 - absolute programming
Absolute programming is when the tool moves to a position away from the origin of the work piece coordinate system.
6, G91 - incremental programming
The distance moved by the incremental programming tool is calculated as a baseline at the previous point and increments at the previous point.
7, G21-mm input G20-inch input
8, G16 - Enable polar command G15 - cancel polar command
Second, interpolation function instructions
1, G00 - quick positioning instructions
format:G00 X Y Z ;
Format meaning: The G00 instruction allows the tool to move from the current point of the tool to another point at the fastest speed in point control. Its trajectory is not necessarily a two-point line, it may be a line.
Note:(1) When the tool moves from top to bottom: G00 XZ Y; (2) When the tool moves up from the bottom: G00 Z;X Y;Z axisrises first, then set XY face.
2, G01 - straight-line interpolation instructions
format:G01 X Y Z F ;
Format meaning: The G01 instruction enables the tool to move from the current motion to the specified point according to the F instruction.
3, G02 - clockwise interpolation, G03 - counterclockwise interpolation
format:G17 - G02 /G03-X Y (RR /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, I J K is zero can be omitted, in the same program, such as I J K and R at the same time, R is valid.
2, with R processing, can not process the whole circle, processing the whole circle can only use the center coordinates I J k, programming.
Third, the program pause instructions
1、G04—Pause instruction
format:G04 X ;orG04 P ;
Format meaning: X followed by extended time, in s, followed by a number of points. The number after P is an integer in ms.
The call instruction of the sub-program
1、M98 P × × × ;
Format meaning: P × × × refers to the sub-program number of the calling program, 0 before the program can not be omitted, refers to the number of repeated calls.
2, sub-program writing and the general program is basically the same, but the program end character is M99, indicating that the sub-program ended and returned, M99 can not have to be independent of the program segment, can be placed at the end of the last program segment.
Fifth, tool compensation instructions
1, G43, G44, G49 - tool length compensation instructions
Format: G43 Z H, which represents positive compensation for tool length, and Z-axis reach distance Z is the specified value plus compensation value H.
G44 Z H;
G49 Z, or H00, means that tool length compensation is canceled
Note: The G43 G44 instruction is independent of the G90 G91, and the H directive can have a negative value and a positive value. When H is 0, the tool length compensation is cancelled. The H value ranges from 00 to 200.
Due to the value range of the compensation value -999.999 to 999.999mm or -99.9999 to 99.9999 inches, the compensation value of the positive and negative sign changes, the use of G43 can complete the whole work.
2, G41, G42, G40 - tool radius compensation instructions
format:'G17 G18 G19 'G41 G42' (G00 G01) (X Y ,X Z Y Z )D F;
G40 G00 (G01)X and F ;orD00
Format meaning: G17 G18 G19 is the selection plane,
G41 tool radius left compensation, G42 tool radius right compensation, G40 tool radius compensation cancelled.
Note:
1, from the toolless compensation state into the tool radius compensation state, or undo the tool radius compensation, the tool must move out of a distance, otherwise the tool will be directly offset along the motion method of a tool radius, the tool no swing space will hit the knife.
2, when D is 0 is the tool radius compensation cancellation. The value of D ranges from 0 to 200.
Due to the compensation value range -999.999 to 999.999mm or -99.9999 to 99.9999 inches.
3, the tool radius of the left and right compensation judgment is based on the direction of tool infed, tool center contour, especially in the implementation of G18 G19 pay attention to the G41 G42 left and right bias.
4, the implementation of G41 G42 and G40, its mobile instructions can only use G00 G01, not G02 G03.
5, in order to ensure the integrity of the contour, smoothness, generally used: G41 G42 instruction tool radius compensation→ through the transition segment (ring or straight line) → contour cutting→ through the transition section (ring or straight line→ with G40 to cancel the tool radius compensation.
6. When programming, if the tool's radius compensation is introduced and cancelled in the main program of the program segment (which must be the case when machining the boss), then when the number of times the subprogram (machining contour program) is called more than 1 time, there will be over-cutting when 2 cuts occur.
Six, fixed cycle instructions
A list of fixed loop instruction functions
Fixed loop instructions typically consist of six basic actions:
1, action 1-X, Y-axis positioning (initial point)
2, action 2 - quickly reach the point R plane (ready to cut the position).
3, action 3 - hole processing. Perform hole machining in a cutting-in manner.
4, action 4 - the action at the bottom of the hole. Such as pause, stop of spindle, shift of tool, etc.
5, action 5 - return R plane.
6, action 6 - quickly return to the initial
Location | function | Meaning |
A | The coordinate word | Rotate around the X axis |
B | The coordinate word | Rotate around the Y axis |
C | The coordinate word | Rotate around the Z-axis |
D | Compensation number | Tool radius compensation instruction |
And | —— | Second-in-the-right function |
F | The speed of the injinding | The in-in speed command |
G | Prepare the function | The way the instructions are acted upon |
H | Compensation number | Compensation number instruction |
I | The coordinate word | X axial coordinates at the center of the arc |
J | The coordinate word | Y axial coordinates at the center of the arc |
K | The coordinate word | Z axial coordinates at the center of the arc |
L | The number of repetitions | Fixed number of cycles and sub-programs |
M | Accessibility | Machine on/off instructions |
Location | function | Meaning |
N | The order number | The segment sequence number instruction |
The | The program number | The program number and sub-program number are specified |
P | —— | Pause the time or the sequence number in which a feature in the program begins to use |
Q | —— | Fixed cycle termination segment number or fixed distance in a fixed cycle |
R | The coordinate word | The specified distance or arc radius in a fixed loop |
S | Spindle function | Spindle rotation instructions |
T | Tool function | Tool number instructions |
U | The coordinate word | The incremental coordinate value of an additional axis parallel to X |
V | The coordinate word | The incremental coordinate value of an additional axis parallel to Y |
W | The coordinate word | The incremental coordinate value of the additional axis parallel to Z |
X | The coordinate word | X-axis absolute coordinates or pause time |
And | The coordinate word | Absolute coordinates of the Y-axis |
Z | The coordinate word | Z-axis absolute coordinates |
The programming instruction code of the CNC FANUC processing center is explained in detail
Accessibility M instruction
Instructions. | function | The type of instruction execution |
M00 | The program stops | Post-instructions |
M01 | The program chooses to stop | |
M02 | The program ends | |
M03 | The spindle is turning forward | The previous instruction |
M04 | The spindle is reversed | |
M05 | The spindle stops | Post-instructions |
M06 | The tool is automatically exchanged | The previous instruction |
M08 | Cutting fluid open (or M07) | |
M09 | Cut fluid off | Post-instructions |
M19 | Spindle orientation | A separate segment |
M29 | Rigid tap thread | |
M30 | The program ends and returns | Post-instructions |
M63 | The chip drain starts | A separate segment |
M64 | The chip removal stops | |
M80 | Knife library forward | |
M81 | Knife library back | |
M82 | The tool is released | |
M83 | Tool clamping | |
M85 | The library rotates | |
M98 | Call the sub-program | Post-instructions |
M99 | The call sub-program ends and returns |
Other instructions
(1) F - In-in speed command
F and several subsequent numbers indicate that when the instruction G94 unit is mm/min, when the instruction G95 unit is mm/r.
(2) S-spindle speed command
S and a number of subsequent numbers indicate that the unit is r/min.
(3) T-tool instruction
T and the next three digits indicate the knife number.
(4) H and D - tool length compensation value and tool radius compensation value
H and D and the three digits that follow indicate that the three digits are the memory address (pan number) where the tool is stored.
The G instruction code is explained in detail
First, the machine function settings
1, G53 - Select the machine coordinate system
Format: G53 X Y Z ;(X Y Z is machine coordinate value)
Note: When the G53 instruction is specified, the radius compensation of the tool, tool length compensation and tool bias values are cleared, generally in the change of knife is the specified Z-axis.
2, G54 to G59 - select the workware coordinate system
Note: The system automatically selects G54 when the power is on and the reference point is returned.
3, G54.1 P1 to P48 - select the additional workware coordinate system
4, G52 - Local coordinate system
format:G52X AND Z ;
Format meaning: In order to set the sub-coordinate system of the workware coordinate system for programming convenience, the value of X Y Z in G52 is the position coordinate in the workware coordinate system G54 to G59.
Cancel local coordinate system——G52 X 0 Y 0 Z 0 ;
Note: Tool length compensation, tool radius compensation and other tool bias values are eliminated when instructing G52 local coordinate system or canceling local coordinate system, and tool bias values such as specified tool length compensation and tool radius compensation must be reset in subsequent programs.
5, G90 - absolute programming
Absolute programming is when the tool moves to a position away from the origin of the work piece coordinate system.
6, G91 - incremental programming
The distance moved by the incremental programming tool is calculated as a baseline at the previous point and increments at the previous point.
7, G21-mm input G20-inch input
8, G16 - Enable polar command G15 - cancel polar command
Second, interpolation function instructions
1, G00 - quick positioning instructions
format:G00 X Y Z ;
Format meaning: The G00 instruction allows the tool to move from the current point of the tool to another point at the fastest speed in point control. Its trajectory is not necessarily a two-point line, it may be a line.
Note:(1) When the tool moves from top to bottom: G00 XZ Y; (2) When the tool moves up from the bottom: G00 Z;X Y;Z axisrises first, then set XY face.
2, G01 - straight-line interpolation instructions
format:G01 X Y Z F ;
Format meaning: The G01 instruction enables the tool to move from the current motion to the specified point according to the F instruction.
3, G02 - clockwise interpolation, G03 - counterclockwise interpolation
format:G17 - G02 /G03-X Y (RR /I J )F;
G18 {G02 /G03}X Z (R /I K )F;
G19 {G02 /G03}Y Z (R /J K )F;
Format meaning:
Refers to the contents of the order | orders | Meaning | |
Plane specified |
G17 | Specify the XY plane | |
G18 | Specify the XZ plane | ||
G19 | Specify the YZ plane | ||
The direction of rotation | G02 | Rotate clockwise | |
G03 | Rotate counterclockwise | ||
The end position | G90 way | 2 value in XYZ | The end point of the workman coordinate system |
G91 way | 2 value in XYZ | The coordinate increment of the end point relative to the start point | |
The center coordinates of the arc | 2 value in IJK | The coordinate increment of the center of the circle relative to the starting point, independent of G90 | |
Arc radius | R | Arc radius. A positive value < at 180 degrees <, and a negative value at 180 degrees ≤ at 360 degrees < the center of the circle | |
The speed of the injinding | F | The speed of movement along the arc |
2, with R processing, can not process the whole circle, processing the whole circle can only use the center coordinates I J k, programming.
Third, the program pause instructions
1、G04—Pause instruction
format:G04 X ;orG04 P ;
Format meaning: X followed by extended time, in s, followed by a number of points. The number after P is an integer in ms.
The call instruction of the sub-program
1、M98 P × × × ;
Format meaning: P × × × refers to the sub-program number of the calling program, 0 before the program can not be omitted, refers to the number of repeated calls.
2, sub-program writing and the general program is basically the same, but the program end character is M99, indicating that the sub-program ended and returned, M99 can not have to be independent of the program segment, can be placed at the end of the last program segment.
Fifth, tool compensation instructions
1, G43, G44, G49 - tool length compensation instructions
Format: G43 Z H, which represents positive compensation for tool length, and Z-axis reach distance Z is the specified value plus compensation value H.
G44 Z H;
G49 Z, or H00, means that tool length compensation is canceled
Note: The G43 G44 instruction is independent of the G90 G91, and the H directive can have a negative value and a positive value. When H is 0, the tool length compensation is cancelled. The H value ranges from 00 to 200.
Due to the value range of the compensation value -999.999 to 999.999mm or -99.9999 to 99.9999 inches, the compensation value of the positive and negative sign changes, the use of G43 can complete the whole work.
2, G41, G42, G40 - tool radius compensation instructions
format:'G17 G18 G19 'G41 G42' (G00 G01) (X Y ,X Z Y Z )D F;
G40 G00 (G01)X and F ;orD00
Format meaning: G17 G18 G19 is the selection plane,
G41 tool radius left compensation, G42 tool radius right compensation, G40 tool radius compensation cancelled.
Note:
1, from the toolless compensation state into the tool radius compensation state, or undo the tool radius compensation, the tool must move out of a distance, otherwise the tool will be directly offset along the motion method of a tool radius, the tool no swing space will hit the knife.
2, when D is 0 is the tool radius compensation cancellation. The value of D ranges from 0 to 200.
Due to the compensation value range -999.999 to 999.999mm or -99.9999 to 99.9999 inches.
3, the tool radius of the left and right compensation judgment is based on the direction of tool infed, tool center contour, especially in the implementation of G18 G19 pay attention to the G41 G42 left and right bias.
4, the implementation of G41 G42 and G40, its mobile instructions can only use G00 G01, not G02 G03.
5, in order to ensure the integrity of the contour, smoothness, generally used: G41 G42 instruction tool radius compensation→ through the transition segment (ring or straight line) → contour cutting→ through the transition section (ring or straight line→ with G40 to cancel the tool radius compensation.
6. When programming, if the tool's radius compensation is introduced and cancelled in the main program of the program segment (which must be the case when machining the boss), then when the number of times the subprogram (machining contour program) is called more than 1 time, there will be over-cutting when 2 cuts occur.
Six, fixed cycle instructions
A list of fixed loop instruction functions
G instruction | Drill-Z direction | Hole bottom action | Fallback and Z direction | Use. |
G73 | Intermittent indmissity | Move quickly | High-speed deep hole recirculation chip drill cycle | |
G74 | Cut into the ins giving | Spindle: Stop → turning forward | Cut into the ins giving | Reverse the left-hand thread cycle |
G76 | Cut into the ins giving | The spindle direction stops → the tool shift | Move quickly | Fine boring cycle |
G80 | Unseloy the loop | |||
G81 | Cut into the ins giving | Move quickly | Point drilling, drilling cycle | |
G82 | Cut into the ins giving | The in-progress pauses for a few seconds | Move quickly | Sudden hole, boring ladder hole cycle |
G83 | Intermittent indmissity | Move quickly | Deep hole recirculation chip drill cycle | |
G84 | Cut into the ins giving | Spindle: Stop → turning forward | Cut into the ins giving | Forward to the right-hand thread cycle |
G85 | Cut into the ins giving | Cut into the ins giving | Fine boring cycle | |
G86 | Cut into the ins giving | The spindle stops | Move quickly | The pupil cycle |
G87 | Cut into the ins giving | The spindle is turning forward | Move quickly | Anti-boring cycle |
G88 | Cut into the ins giving | The in-progress pauses for → stops the spindle | Move manually | The pupil cycle |
G89 | Cut into the ins giving | The in-progress pauses for a few seconds | Cut into the ins giving | Fine boring step hole cycle |
Fixed loop instructions typically consist of six basic actions:
1, action 1-X, Y-axis positioning (initial point)
2, action 2 - quickly reach the point R plane (ready to cut the position).
3, action 3 - hole processing. Perform hole machining in a cutting-in manner.
4, action 4 - the action at the bottom of the hole. Such as pause, stop of spindle, shift of tool, etc.
5, action 5 - return R plane.
6, action 6 - quickly return to the initial