Monday, June 26, 2023

Step by step Turning Program

Writing a Turning operation program:

CNC turning programming differs from milling programming. In turning operations, machining is performed by rotating the workpiece while keeping the cutting tool stationary. Workpieces used in turning operations are typically cylindrical. The cutting tool contacts the rotating workpiece, removing material from its surface. Standard turning operations involve two axes: the X-axis, which controls the diameter, and the Z-axis, which controls the length. The X-axis moves toward the centerline of the spindle, while the Z-axis moves toward the work-holding device. This means that the X-axis moves vertically, while the Z-axis provides horizontal movements for machining. The image below illustrates the movement directions of the X and Z axes on a slant bed CNC turning machine, as well as the Tool Reference Point, Machine Zero Point, and Workpiece Zero Point.

Machining with turning operations

Machining with turning operations typically involves two steps. The first step, called "rough turning," removes most of the material from the blank. The second step, known as "finish turning," achieves the final shaping and surface quality of the workpiece. These machining operations use two different cutting tools: a rough turning tool and a finish turning tool. The images below explain the two types of cutting tools commonly used in turning operations. The rough turning tool removes the majority of the material from the workpiece through two, three, or more cycles, leaving a small amount of material (usually 0.2 mm) for the finish turning operation. The cutting load applied during rough turning is much higher than that of finish turning, and the angle of the cutting tool edge on the rough turning tool is larger to withstand the higher cutting load.

During turning operations, the X-axis movement removes material from the workpiece surface across the diameter. For example, a 1 mm X-axis movement reduces the workpiece diameter by 2 mm (1 mm from each side). The X-axis movement with a CNC turning machine only measures the workpiece diameter, not the reduction. So, to reduce a 2 mm diameter, the X-axis movement command will be X2.000, but the actual movement of the X-axis will be 1 mm.

In contrast, Z-axis movements do not have this complexity. Therefore, when programming turning operations, it's important to remember that the movement command for the X-axis is always double the actual physical change. Additionally, the axis feed command differs for turning operations compared to milling. In Turning, the axis feed command is specified as revolutions per minute (rpm) and depends on the spindle rpm. For example, if the spindle speed is 1000 rpm and the feed command is F0.1, the actual cutting feed will be 0.1 mm/rev.

Typically, CNC turning machines are always programmed with G95 mode, which specifies the feed per revolution. Sometimes, the G95 code is also used to provide the feed per minute command, usually when programming with CNC turn-mill machines. It's customary to have slower spindle speeds for rough turning operations and higher speeds for finish turning processes.

Different offsets in turning operation. 

The machine zero position refers to the X and Z-axis coordinate zero positions, while the workpiece zero or part zero always pertains to the workpiece. The tool reference point is the position where the cutting tool changes and aligns with the cutting line. The zero offsets of a particular workpiece are defined from the tool reference point or tooltip point. Before starting the turning program, it is mandatory to confirm the 'workpiece zero' position relative to the 'tool reference point.' This involves defining the distance of the cutting tooltip from the workpiece zero position and considering zero offsets like G54, G55, etc. For multiple tools, a standard tool offset is measured, and others are compensated accordingly and stored in tool offset data. Sometimes, the tool offset is measured directly from the zero offset point when no zero offsets are considered. The following pictures illustrate the work offset of a cutting tool.


In Picture-1, 'M' represents the machine zero, 'W' is the workpiece zero, and 'T' is the tool reference point. The positional values of the X and Z axes for the tool reference point are 300 and 550, respectively (considering machine zero). The zero offset values for the following workpiece with respect to the X and Y axes will be 0 and 400, respectively. With this setup, the cutting tool movements along the X and Y axes will be 200 mm and 100 mm, respectively, ending at the workpiece zero position. If G54 is used at the beginning of a program, the actual position of the cutting tool is shown in Picture-2.

Turning operation programming 

The step-by-step procedure for writing a simple turning operation program is illustrated with the following example. The next images show a cylindrical workpiece blank and the outcome after machining. The program will proceed based on the dimensions provided for the finished workpiece blank.

As discussed earlier, a turning operation can be divided into rough turning and finish turning. The first program presented here is for rough turning, while the second program is for finish turning. T1 tool is used for rough turning, while T2 is used for the finish operation. In this case, the workpiece zero position is set as 0,180, and the tool reference point is defined as 200,200. The value for G54 (zero offsets) will be 0,180.

Rough Turning Programming 

Programming for rough turning typically involves multiple stepped movements with a rough turning tool. After completing rough turning, a small amount of material (usually 0.2 to 0.3 mm) is left, which will be removed during the finish turning operation. The following program represents a simple way of writing the code for the SIEMENS controller (note that there may be minor differences with other controllers). The accompanying picture illustrates the movement paths of the rough cutting tool.

% 5555
(Rough Turning)
N5 G21 G90
N10 T1 D1
N15 M03 S1000 M08
N20 G0 G54 X60 Z0.2
N25 G01 X-4 F0.2
N30 Z0.5
N35 G0 X34
N40 G01 Z-79.8 F0.2
N45 X41
N50 G0 Z0.5
N55 X28
N60 G01 Z-79.8 F0.2
N65 X41
N70 G0 Z0.5
N75 X20.4
N80 G01 Z-79.8 F0.2
N85 X41
N90 G0 X53 Z220 M05 M09
N95 M30

Explanation of the program blocks:

% 5555 - Program Number 5555. The word "(Rough Turning)" within the brackets refers to the program name.

N5 G21 G90 - This block describes preparatory functions. G21 specifies that all measurements will be in millimeters, and G90 identifies the absolute measuring system.

N10 T1 D1 - The tool with the number T1 is brought to the cutting line, and the offset value D1 (not considered here) compensates for the next axis movement.

N15 M03 S1000 M07 - Here, S1000 represents the spindle rotating speed set to 1000 rpm, and the M03 command selects the clockwise direction. The M07 command activates the cutting coolant.

N20 G00 G54 X60 Z0.2 - The X and Z axes move to position A using rapid feed movement (G00) and considering the work offset value given at G54. Position A is defined as X30 and Z0.2. The movement of the X-axis always calculates with the workpiece diameter. Therefore, with the X60 command, the physical position of the X-axis according to the coordinates will be X30, and all X-axis movement commands in this program will be calculated accordingly.

N25 G01 X-4 F0.2 - The X-axis is positioned at location X-4 using linear movement (G01) and a feed rate of 0.2 millimeters per rotation (F0.2). This operation, called facing, removes excess material lengthwise from the workpiece.

N30 Z0.5 - The Z-axis moves from the previous location (Z0.2) to position Z0.5. There is no need to include a new feed command as it will move with the previously programmed feed rate (F0.2).

N35 G00 X34 - With rapid movement (G00), the X-axis reaches position X34, reducing the material by 3 mm from both sides.

N40 G01 Z-79.8 F0.2 - Using linear movement (G01) and a feed rate of 0.2 millimeters per rotation (F0.2), the Z-axis moves to position Z-79.8. This reduces the diameter by 3 mm, removing material from the surface area of the bar.

N45 X41 - The X-axis reaches position X41, following the previous feed rate (F0.2).

N50 G00 Z0.5 - The Z-axis returns to position Z0.5 using rapid feed movement (G00).

N55 X28 - The X-axis is brought to position X28 using rapid feed movement. This position is set for the successive cutting of the material to reduce another 3 mm from the bar's diameter.

N60 G01 Z-79.8 F0.2 - Using linear movement (G01) and a feed rate of 0.2 millimeters per rotation (F0.2), the Z-axis is positioned at Z-79.8. This further reduces the diameter by 3 mm, removing material from the surface area of the bar.

N65 X41 - The X-axis is positioned at X41, following the previous feed rate (F0.2).

N70 G00 Z0.5 - The Z-axis returns to position Z0.5 using rapid feed movement (G00).

N75 X20.4 - The X-axis is brought to position X20.4 using rapid feed movement, obtaining the final measurement of the bar after the rough turning operation, leaving 0.2 mm of material for finish turning.

N80 G01 Z-79.8 F0.2 - Using linear movement (G01) and a feed rate of 0.2 millimeters per rotation (F0.2), the Z-axis moves to position Z-79.8, reducing the diameter by another 3 mm from the surface area of the bar.

N85 X41 - The X-axis is positioned at X41 with the previous feed rate (F0.2).

N90 G00 G53 X200 Z220 M05 M09 - Using rapid feed movement (G00) and canceling the zero offset (G53), the X and Z axes are positioned at X200 and Z220. The spindle is turned off with M05, and the coolant is also turned off with the M09 command.

N95 M30 - The program ends with the M30 command


Programming with Finish Turning:

In the previous program, most of the material was removed from the workpiece through Rough Turning. Now, the finish tool program will shape the workpiece to its exact contour. Only 0.2 mm of material remains from the previous operation, which will be removed to achieve the required dimensions. In the finish turning process, the spindle speed is usually set higher, while the axis feed rate is kept lower to achieve an excellent surface finish. The following program, along with a schematic diagram, illustrates the finish turning operation according to SIEMENS controllers.

% 6666
(Finish Turning)
N5 G21 G90
N10 T2 D1
N15 M03 S2000 M08
N20 G0 G54 X25 Z0
N25 G01 X-2 F0.05
N30 X0 Z0
N35 G03 X20 Z-10 R10 F0.05
N40 G01 Z-80 F0.05
N45 X42
N50 G0 G53 X200 Z220 M05 M09
N55 M30

Explanation of the program blocks:

% 6666 - Program number 6666. The word "(Finish Turning)" within the brackets indicates the program name.

N5 G21 G90 - This block represents preparatory functions. G21 specifies that all measurements will be in millimeters, and G90 indicates the absolute programming system.

N10 T2 D1 - T2 selects the tool number for the cutting line, and D1 (offset value not considered here) compensates for the next axis movement.

N15 M03 S2000 M07 - Here, S2000 sets the spindle rotation speed to 2000 rpm, and M03 selects the clockwise direction. The cutting flash coolant is activated with M07.

N20 G00 G54 X25 Z0 - The X and Z axes rapidly move to position A using G00, considering the work offset value specified at G54. The position of point A is X25 and Z0.

N25 G01 X-2 F0.05 - The X-axis moves linearly (G01) to position X-2 with a feed rate of 0.05 millimeters per rotation (F0.05).

N30 X0 Z0 - The X and Z axes are positioned at the workpiece zero or point B.

N35 G03 X20 Z-10 R10 F0.02 - Starting from point B, the X and Z axes perform an anticlockwise circular interpolation (G03) with a path radius of 10 mm (R10). The final positions of the circular path are X20 and Z-10. The feed rate for the axes is 0.02 millimeters per rotation (F0.02).

N40 G01 Z-80 F0.05 - The Z-axis moves linearly (G01) downward to position Z-80 with a feed rate of 0.05 mm per rotation (F0.05).

N45 X42 - The X-axis moves to position X42, considering the previous feed rate (F0.05).

N50 G00 G53 X200 Z220 M05 M09 - The X and Z axes rapidly move to positions X200 and Z220 using G00. The zero offsets is canceled using G53. The spindle is turned off with M05, and the cutting coolant is also turned off with M09.

N55 M30 -The program ends with the M30 command.


No comments:

Post a Comment

Popular Posts