Application of Macro Program in CNC Milling Machine Parts Processing

CNC milling machine

In NC machining, the machining program is the key, and the machining program is easier to program under the function of CAM software programming. However, in some cases, the PC is powerless, so we have to dig deeper into manual programming to realize the potential of CNC machine tools and strive for greater economic benefits. The author has profound experience.

In a certain processing, due to the connection failure between the PC and the machine tool, the program could not be transmitted, and the workpiece requirements were completed on time. We used macro programming to solve the problem. The processing map is shown in Figure 1.

Figure 1 requires that an R5mm convex arc be poured out over a 50mm hole.

In the process of programming, the variable #1 is introduced, as shown in Fig. 2. Therefore, the coordinate of the point A along the R5mm over-plane generatrix can be expressed in the illustrated coordinate system as:

AX=-(25+5-5sin(#1))=5sin(#1)-30

AX=-(5-5cos(#1))=5cos(#1)-5

Using the conditional transfer statement IF-GOTO-loop, the programming procedure is as follows: (The FANUC 0i Mate C control system)

O1

N10 G54 G90 G17 G0 Z100;

(Create a workpiece coordinate system and make the tool quickly to Z100 height)

N20 X0 Y0 M3 S600;

(tool idling to X0 Y0 spindle forward rotation at 600r/min)

N30 Z0 M8; (tool quickly cools to Z0)

N40 #1=1; (Assign 1 to #1)

N50 G1 Z (5COS(#1)-5)F100; (Z feed)

N60 G42X-(5SIN(#1)-30)D1;(X infeed plus right knife offset)

N70 G2 X-(5SIN(#1)-30)Y01(30-5SIN(#1))J0;(Round clockwise milling)

N80 G40 G1 X0; (Cancel Tool Offset, Tool to X0 Y0)

N90 #1=#1+1; (Assign #1 to #1+1 and increase the angle)

N100 IF (#1LE90) GOTO 50; (#1 is less than 90 branches to N50 segment, loop)

N110 GO Z100; (lifting knife)

N120 M9; (Cooling off)

N130 M5; (Spindle stop)

N140 M30; (End of program)

CNC milling machine

Need to point out the problem:

(1) D1 of the program N60 can be set in the system according to the tool. We use ¢14mm end mill, so D1 is set to 7. After finishing the procedure, the processing result is satisfactory.

(2) If a better surface quality is required, the value "1" in #1+1 of N90 segment can be set smaller to increase the number of cycles.

At the same time, we also conducted further tests on the angle of collapse of the rectangular hole, with satisfactory results. See Figure 3.

The program is:

O2

N10 G54 G0 Z100;

N20 X0 Y0 M3 S600;

N30 Z0 M8;

N40 #1=1;

N50 G1 Z (6COS(#1)-6) F100;

N60 G42 Y (15+6-6SIN(#1) D1;

N70 X14;

N80 G2 X (20+6-6SIN(#1) Y9 R6;

N90 G1 Y-9;

N100 G2 X14 Y-(15+6-6SIN(#1) R6;

N110 G1 X-14;

N120 G2 X-(20+6-6SIN(#1)) Y-9 R6;

N130 G1 Y9;

N140 G2 X14 Y (15+6-6SIN(#1)) R6;

N150 G1 X0;

N160 G40 X0 Y0;

N170 #1=#l+1;

N180 IF (#1LE90) GOTO 50;

N190 G0 Z100;

N200 M9;

N210 M5;

N220 M30

Same as program O1, only need to find out the variable coordinates of R6mm arc busbar at the point where the arc and the straight line are connected in the plane.

hand water pump

hand water pump,High Quality hand water pump,hand water pump Details, CN

Botou Honghai Pump Co.,Ltd , https://www.pumphonghai.com