CNC Milling Processing

by wanjuncnc1 on 2012-02-28 17:12:12

CNC Machining

CNC machining refers to the processing carried out using numerically controlled tools. CNC stands for Computer Numerical Control, which is programmed and controlled by a numerical machining language, typically G-code. The G-code language instructs the CNC machine on the Cartesian position coordinates for the cutting tool, controlling the feed rate of the tool, spindle speed, as well as functions like tool changers and coolant.

Compared to manual machining, CNC machining offers significant advantages such as producing highly precise and repeatable parts. CNC machining can also produce complex-shaped parts that are impossible to make manually. CNC technology is now widely used, and most machine shops have CNC machining capabilities. Common CNC machining methods in typical machine shops include CNC milling, CNC turning, and CNC EDM wire cutting (wire electrical discharge machining).

The tool used for CNC milling is called a CNC milling machine or CNC machining center. The lathe used for CNC turning is called a CNC turning center.

CNC machining G-code can be programmed manually, but typically, machine shops use CAM (Computer-Aided Manufacturing) software to automatically read CAD (Computer-Aided Design) files and generate G-code programs to control CNC machines.

Leading CNC machine brands include Hass, DMG (Deckel Maho Gildemeister), Mazak, Mori Seiki, Fadal, and Wasino.

Commonly Used CNC Machining Instructions

1. Pause Instruction

G04X(U)_/P_ refers to the tool pause time (feed stops, spindle does not stop). The value after address P or X is the pause time. The value after X must include a decimal point; otherwise, it will be calculated as one-thousandth of this value, in seconds (s). The value after P cannot have a decimal point (i.e., it must be an integer), in milliseconds (ms).

For example:

- G04 X2.0; or G04 X2000; pause for 2 seconds.

- G04 P2000;

In some hole-making instructions (such as G82, G88, and G89), to ensure the roughness of the bottom of the hole, there needs to be a pause when the tool reaches the bottom of the hole. In this case, only the address P can be used. If address X is used, the control system will interpret X as the X-axis coordinate value.

For example:

- G82X100.0Y100.0Z-20.0R5.0F200P2000; drill a hole at (100.0, 100.0) with a 2-second pause at the bottom.

- G82X100.0Y100.0Z-20.0R5.0F200X2.0; drill a hole at (2.0, 100.0) without pausing at the bottom.

2. Differences and Connections between M00, M01, M02, and M30

M00 is the unconditional program pause instruction. When the program executes to this point, feeding stops, and the spindle stops rotating. To restart the program, you must first return to the OG state, press CW (spindle forward rotation) to start the spindle, then return to AUTO mode, and press START to initiate the program.

M01 is the selective program pause instruction. Before executing the program, the OP STOP key on the control panel must be turned on. After execution, its effect is the same as M00, and restarting the program follows the same procedure.

M00 and M01 are often used for intermediate inspections of workpiece dimensions or chip removal during processing.

M02 is the main program end instruction. When this instruction is executed, feeding stops, the spindle stops, and the coolant is turned off. However, the program cursor remains at the end of the program.

M30 is the main program end instruction. It has the same function as M02, but the difference is that the cursor returns to the beginning of the program regardless of whether there are other program segments after M30.

3. Significance of Addresses D and H

Tool compensation parameters D and H have the same functionality and can be arbitrarily interchanged. They both represent the address names of the compensation registers in the CNC system, but the specific compensation values depend on the compensation numbers following them. However, in machining centers, to prevent errors, H is generally designated as the tool length compensation address, with compensation numbers ranging from 1 to 20, and D as the tool radius compensation address, with compensation numbers starting from 21 (for a tool library with 20 tools).

For example:

- G00G43H1Z100.0;

- G01G41D21X20.0Y35.0F200;

4. Mirror Instruction

Mirror processing instructions M21, M22, M23. When mirroring is applied to only the X-axis or Y-axis, the cutting sequence (climb milling vs. conventional milling), tool compensation direction, and circular interpolation direction will all be opposite to the actual program. When mirroring is applied to both the X-axis and Y-axis simultaneously, the cutting sequence, tool compensation direction, and circular interpolation direction remain unchanged.

Note: After using the mirror instruction, M23 must be used to cancel it to avoid affecting subsequent programs. In G90 mode, when using mirror or cancel instructions, you must return to the origin of the workpiece coordinate system before proceeding. Otherwise, the CNC system will be unable to calculate the subsequent motion trajectory, leading to random movement of the tool. At this point, a manual origin return operation must be performed to resolve the issue. The spindle rotation direction does not change with the mirror instruction.

5. Circular Interpolation Instruction

G02 is clockwise interpolation, and G03 is counterclockwise interpolation. In the XY plane, the format is as follows: G02/G03X_Y_I_K_F_ or G02/G03X_Y_R_F_, where X and Y are the coordinates of the arc endpoint, I and J are the incremental values from the arc start point to the center along the X and Y axes, R is the arc radius, and F is the feed rate.

When performing arc cutting, note that if q ≤ 180°, R is positive; if q > 180°, R is negative. The specification of I and K can also be replaced by R. When both are specified simultaneously, the R instruction takes precedence, and I and K become invalid. R cannot be used for full-circle cutting; full-circle cutting can only be programmed using I, J, and K because there are infinitely many circles passing through the same point with the same radius.

When I or K is zero, it can be omitted. Regardless of whether G90 or G91 mode is used, I, J, and K are always programmed in relative coordinates. During arc interpolation, tool compensation instructions G41/G42 cannot be used.

6. Advantages and Disadvantages Between G92 and G54~G59

G54~G59 are coordinate systems set before processing, while G92 is a coordinate system set within the program. If G54~G59 are used, there is no need to use G92, as G54~G59 will be replaced, which should be avoided.

Note:

(1) Once G92 is used to set the coordinate system, using G54~G59 will have no effect unless the system is restarted due to power loss or G92 is used again to set a new workpiece coordinate system.

(2) After using G92, if the machine does not return to the original point set by G92, and the program is started again, the current position of the machine becomes the new workpiece coordinate origin, which can easily cause accidents.

For more details: http://www.dgwanjun.com