1.11k likes | 1.75k Vues
CNC Programming “Turning”. Module Objectives: To know the structure of an NC Program. To know the main instructions and their functions. To create NC programs for different turning operations. NC Program.
E N D
CNC Programming“Turning” • Module Objectives: • To know the structure of an NC Program. • To know the main instructions and their functions. • To create NC programs for different turning operations.
NC Program The NC program consists of a series of commands with which the CNC machine tool is instructed to manufacture a certain work part.
ExampleNC-Program (%TP0147) N10 G54 N15 G92 S2000 N20 T1 D1 M6 N25 G96 S200 F0.2 M4 N30 G0 X43 Z0 N35 G1 X-2 N40 G1 Z2 N45 G0 X150 Z150 N50 M30
Structure A complete NC-program consists of the following elements:
Part Program Block Each line of a part program is called a Block. Example N35 G01 X-2 The above block can be explained as follows: N35 Block (Line) Number G01 G- command (Code) to move the cutting tool in linear movement. X-2 The coordinate at X = -2
Instructions (Commands) Four groups of instructions can be differentiated: 1. G – Functions 2. Coordinates 3. Additional Functions 4. Cycles
G Functions G functions are codes that determine the geometric part of the NC program.
2. Coordinates (X,Y and Z) They are used in a block to locate the target point where the tool should go. In turning machines, tools follow 2 axes only, X & Z.
4. Cycles • A cycle allows performing a complete machining operation by specifying just one code.
G00 – Rapid PositioningN10 G00 X30 Z5 Moves the cutting tool rapidly to the point X30 Z5.
G01 – Feed Rate PositioningN20 G01 X38 Z-20 F0.4 The cutting tool moves in linear motion at feed rate (F) = 0.4 mm/revolution to the point X38 Z-20
G90 and G91 • G90 :The machine controller works on absolute dimensioning mode • G91 :The machine controller works on incremental dimensioning mode.
Example 1: Write two blocks of NC-program to move the tool in rapid traverse to the point shown, using absolute positioning mode? G00 X30 Z5 N10 N20 G90
Example 2: Write two blocks of NC-program to move the tool in rapid traverse to the point shown, using incremental positioning mode? N10 N20 G91 G00 X-12.5 Z-35
Example 3: Write two blocks of NC-program to move the tool in feed rate traverse to the point shown, using absolute positioning mode? N10 N20 G90 G01 X140 Z-90
Example 4: Write two blocks of NC-program to move the tool in feed rate traverse to the point shown, using incremental positioning mode? N10 N20 G91 G01 X20 Z-60
G03 Arc counterclockwise N10 G03 X60 Z-10 I0 K-10
G02 (Arc Clockwise) N15 G02 X140 Z-106 I 45 K-20 This example is just to show the motion. Cutting tool, depth of cut, values of coordinates and parameters are not taken into consideration.
G2, G3, I, J, and K When an arc is to be machined, the interpolation parameters I, J & K must be specified. These parameters are used to define the center of a circle for circular movements.
G2, G3, I, J, and K • "I" is the distance between the starting position and the circle center in the X-direction. • "J" is the distance between the starting position and the circle center in the Y-direction. • "K" is the distance between the starting position and the circle center in the Z-direction. • Since in turning there is no Y-axis, then J is always zero and no need to mention it in the block;
Example 5 Write two blocks of NC program to cut the arc shown below using absolute positioning mode? G01 X80 Z-50 N10 N20 G03 X140 Z-80 I-15 K-45
Example 6: Write two blocks of NC program to cut the arc shown below using absolute positioning mode? N10 N20 G01 X80 Z-40 G02 X140 Z-106 I 45 K-20
G95 / G94 • G95 and G94 specify the unit of feed rate (F). • G95: Feed rate (F) in mm/revolution (Main application for turning) • G94: Feed rate (F) in mm/min. (Main application for milling)
G20 / G21 • G20: The controller of the CNC turning machine reads the input values in imperial system (inch). • G21: The controller of the CNC turning machine reads the input values in metric system (mm)
G54 / TRANS • G54 defines workpiece zero point. Zero points are used to indicate the position of the workpiece on the machine. • The coordinate system is displaced from a fixed point on the machine called machine zero point (M) to the workpiece zero point (W) by G54.
G54 / TRANS • Normally the coordinate system is shifted with G54 to a stop point (W1) at the clamping device (chuck), then the following shift to the workpiece zero points occurs with TRANS. • Example • N10 G54 X0 Z50 • N20 TRANS Z150
G04 – Dwell Time • The tool movement is halted for specified dwell time. • Example : G04 X5 The tool stop moving (feed) for 5 seconds. This is required in some operations, e.g. in drilling, dwell time is used to allow the chip removal, or clean the hole ground. • Note: Different controllers have different dwell time formats.
G92 / G96 / G97 • During turning, the diameter of the workpiece is getting smaller and smaller. In order to have a good machining results, it is advisable to keep the cutting speed (Vc) constant (specially when the difference between the starting and final diameters is large).
G92 / G96 / G97 Vc (cutting speed) = πd n Where d = diameter of the workpiece n = spindle speed revolutions (RPM) • From the above equation, to keep “Vc” constant while “d” is getting smaller, the value of “n” must increase to compensate for the decrease in diameter (d) value. This could be achieved automatically by using G96Command. • Example • N20 G96 S300(Constant cutting speed = 300 m/min)
G92 / G96 / G97 • It is important and safe to set a limit for the increase of spindle speed while the diameter is getting smaller. G92code is used to limit max. spindle speed. • Example:N10 G92 S2000 • (The spindle speed is limited to 2000 RPM). • G97: To cancel constant cutting speed. Use constant spindle speed
M7, M8 and M9 • M7 and/or M8 : Coolant ON. • M9: Coolant OFF • Why coolant is important? • Cutting Steel with Coolant.avi • PLG-42XL Cutting Steel with Coolant.flv
T : Tool PositionT3 D1M6 Select tool number 3
Example of CNC Programming • Write an NC-program to reduce the diameter of a workpiece 1 mm to 20 mm length. (Parallel turning)? • Use the following information: • THE BLANK SIZE OF THE WORKPIECE φ40 X 60 mm • Absolute Coordinate system • Constant Spindle Speed at 1000 RPM and in counterclockwise direction • Tool in Position Number 1 on the turret, and it will move at feed rate 0.4 mm/rev. • Metric System of measurement.
Note: Topturn is defaulted with absolute coordinate system, metric system of units, constant rotational speed and feed rate in mm/rev., so it is not necessary to write the corresponding codes in your program.
Solution:Answer the following questions writing your answers as program codes: • How to locate the workpiece zero point? G54 • What is the dimensioning system that should be used? G90 • What will be the spindle speed and in which direction? G97 S1000 M4 • Which tool you will use? T1D1 M6
What is the unit system that should be used? G21 • How to move the cutting tool? • G00 and G01 (Why not G02 and G03)? • How to stop machine spindle? • M5 • How to end your program? • M30
φ 40 60 Workpiece before machining
Solution 1. Name your NC Program: %turning_01 2. Set workpiece zero point N10 G54 3. Use absolute dimensioning N20 G90 4. Spindle speed = 1000 in counterclockwise direction N30 G97 S1000 M4 5. Use tool e.g. in position number 1. N40 T1D1 M6
X Z -20 X φ 39 W Z X φ 40 Z -20 Z 5 6. Move the cutting tool rapidly to be ready for cutting.N50 G00 X39 Z5 • Drawing is not to scale • In absolute mode the value of X is the diameter value
X X φ 39 Z X φ 40 Z 5 Z -20 7. Move the cutting tool slowly at cutting feed rate 0.4 to Z=-20 N60 G01 Z-20 F0.4
X X φ 39 Z X φ 40 Z 5 Z -20 8. Move the cutting tool up to a point outside the workpieceN70 G01 X42