1. Differences and connections between M00, M01, M02 and M30
When students first learn machining center programming, they are easily confused by the above M codes. The main reason is that students do not understand the processing of machining centers, and the descriptions of some textbooks are not detailed. Their differences and connections are as follows:
M00 is the program pause command. When the program is executed, the feed stops and the spindle stops. After pressing the start button again, continue to run the following program segments. It is mainly used when programmers want to pause the machine tool during processing (part inspection, adjustment, chip removal, etc.).
M01 is a selective program pause instruction. This function can only be effective when the “Select Stop” button on the control panel is in the “ON” state when executing the program, otherwise the command is invalid. The effect after execution is the same as that of M00 and is often used for critical dimension inspection or temporary suspension.
M02 is the main end-of-program instruction. When this command is executed, the feed stops, the spindle stops, and the coolant is cut off. But the program cursor stops at the end of the program.
M30 is the main end of program command. The function is the same as M02, the difference is that the cursor returns to the position of the start of the program whether or not there are other program segments after M30.
2. Application of tool compensation parameter addresses D and H
In some CNC systems (such as FAUNC), the tool compensation parameters D and H have the same function and can be interchanged as desired. They both represent the address names of the compensation registers in the CNC system, but the key to the specific compensation. the value is determined by what follows them. Determined by the value in the compensation number address. Therefore, in machining centers, in order to avoid errors, it is generally artificially specified that H is the tool length compensation address, the compensation number is 1 to 20, D is the tool radius compensation address and compensation number starts at No. .21 (a tool magazine with 20 tools).
For example: G00G43H1Z60.0;
G01G41D21X30.0Y45.0F150;
3. Application of G92 and G54~G59
G54~G59 is the coordinate system set before calling machining, and G92 is the coordinate system set in the program. After using G54~G59, there is no need to use G92, otherwise G54~G59 will be replaced and should be avoided.
Note: (1) After G92 is used to set the coordinate system, using G54~G59 again will have no effect unless the system is powered off and restarted, or G92 is used to define the new required part coordinate system. (2) After the program using G92 is completed, if the machine tool does not return to the origin set by G92 and the program is restarted, the current position of the machine tool will become the new origin of the workpiece coordinates , which is prone to accidents. . It must therefore be used with caution.
4. Pause command
G04X_/P_? refers to the tool pause time (feed stops, spindle does not stop), and the value after the P or X address is the pause time. The value afterwards?
For example, G04?X2.0 or G04?X2000;
Pause 2 seconds
G04-P2000;
However, in some hole processing instructions (such as G82, G88 and G89), in order to ensure the roughness of the bottom of the hole, a pause time is required when the tool processes to the bottom of the hole. it can only be expressed by address P. If address is used, X means that the control system thinks that X is the coordinate value of the X axis and executes it.
For example, G82X80.0Y60.0Z-20.0R5.0F200P2000;
Drill (80.0, 60.0) to the bottom of the hole and pause for 2 seconds
G82X80.0Y60.0Z-20.0R5.0F200X2.0;
Drilling (2.0, 60.0) to the bottom of the hole will not stop.
5. In the same program segment, the same instruction (same address character) or the same group of instructions, whichever appears later, will take effect.
For example: G01G90Z30.0Z20.0F200;? Z20.0 is executed and the Z axis directly reaches Z20.0, not Z30.0.
G01G00X30.0Y20.0F200;? G00 is executed (although there is an F value, G01 is not executed).
However, if different groups of instruction codes are executed in the same program segment by swapping the order, the effect will be the same.
For example: G90G54G00X0Y0Z60.0; is the same as G00G90G54X0Y0Z60.0;.
6. Program segment sequence number
The sequence number of the program segment is represented by the address N. Typically, the CNC device itself has limited memory space (64 KB). To save storage space, the sequence numbers of program segments are omitted. N only represents the program segment label, which can make it easier to find and edit the program. It has no effect on the machining process. The sequence number can be increased or decreased and continuity of values is not required. However, it cannot be omitted when using certain loop instructions, jump instructions, subroutine calls and mirror instructions.
Daguang focuses on providing solutions such as precision CNC machining services (3-axis, 4-axis, 5-axis machining), CNC milling, 3D printing and rapid prototyping services.


















