Professional Documents
Culture Documents
INTRODUCTION TO CNC MACHINES & AXES DIMENSIONING SYSTEM G-CODES & M-CODES FEATURES OF CNC TRAIN SIMULATION SOFTWARE PROCEDURE FOR EXECUTING A PROGRAM SAMPLE PROGRAMS EXERCISE
CNC axis may be either a linear axis in which movement is in a straight line, or a rotary axis with motion following a circular path. Depending on the machine type there are commonly two to five axes. Rotary axes The rotary motion about the X,Y and Z-Axis are identified by a, b and c respectively. Clockwise is designated as +ve.
Z Axis The Z Axis of motion is always the axis of the main spindle of the machine. It doses not matters whether the spindle carries the work piece or the cutting tool. On vertical machining centers Z axis is vertical and on horizontal machining center and turning centers Z axis is horizontal. Positive Z Movement is away from the spindle. X-Axis It is always horizontal and parallel to the work holding surface. Positive X Axis movement is identified as being to the right, when looking from the spindle towards its supporting column. Y- Axis It is at right angle to both X-Axis and Z-Axis
Y -
DIMENSION SYSTEM
Dimensional information in a work piece drawing can be stated in two ways Absolute Dimension System or Incremental Dimension System.
DIMENSION SYSTEM
30
P6 P5 P4
20
P3 P2
10
P1 (0,0)
ABSOLUTE DIMENSIONING
POINTS
INCREMENIAL DIMENSIONING
POINTS
X 10 10 20 20 30 30
U 10 0 10 0 10 0
P1 P2 P3 P4 P5 P6
P1 P2 P3 P4 P5 P6
10
15
10
100 70 P9 P8
P7 70 40 P3 20 P1 20 Reference Point POINTS P1 P2 P3 P4 P5 P6 P7 P8 P9 X VALUE 0 20 20 70 70 100 100 70 0 Y VALUE 0 0 20 20 0 0 40 70 70 P2 P5 70 100 POINTS P1 P2 P3 P4 P5 P6 P7 P8 P9 XVALUE 0 20 0 50 0 30 0 -30 -70 Y VALUE 0 0 20 0 -20 0 40 30 0 P6 P4
Click Start menu - Programs - CNC simulation CNCTRAIN (or) Double click icon on the desktop
SCREEN DESCRIPTION
Main Menu
Simulation Screen
Combo Box
CNC Editor
Click Control Type For Turning select Fanuc O Turning For Milling select Fanuc O Milling
Click file on the main menu and click new CNC program and type the program in the CNC editor screen .
1.Click file on the main menu and click load CNC program 2.Select a program and click open
click save as - enter file name - click save button - click yes to save The existing program can also be saved by clicking - save CNC program
Sample Program
O0007 G21 G98 G28 U0 W0 M06 T02 (Roughing tool ) M03 S2000 G00 X33 Z1 G71 U0.5 R1 G71 P1 Q2 U0.2 W0.0 F100 N1 G01 X5 G01 Z0 G01 X10 Z-10 G01 X10 Z-15 G02 X20 Z-25 R10 G01 X20 Z-30 G03 X25 Z-37 R7 G01 X25 Z-42 G01 X32 Z-47 N2 G01 X33 G70 P1 Q2 S2500 F50 G28 U0 W0 M06 T0404 (Grooving tool) M03 S650 G00 X21 Z-28 G75 R1 G75 X10. Z-30 P100 Q1000 F20 G28 U0 W0 M05 M30
Edit Program
Click File - new CNC Program from the main Click Edit on the combo box
SETTING TOOL
Step 1
Tool setting is done by clicking Job/Tooling - Tool Offset
Step 2
Click the corresponding tool
Step 3
Click Select Tooling
Step 5
Click Tool offsets
Step 7
Step 6 Step 8 click ok Verify that left-hand tool is displayed on the tool 2 position Likewise select the Tool4 (Grooving tool)by following step 2 to 8
Click ok
SIMULATION
Click RESET
Left-hand Tool
Grooving Tool
Finished Program
CNC Programming
Information needed by a CNC
1. 2. 3. 4. 5. 6. 7. Preparatory Information: units, incremental or absolute positioning Coordinates: X,Y,Z, RX,RY,RZ Machining Parameters: Feed rate and spindle speed Coolant Control: On/Off, Flood, Mist Tool Control: Tool and tool parameters Cycle Functions: Type of action required Miscellaneous Control: Spindle on/off, direction of rotation, stops for part movement These information is conveyed to the machine through a set of instructions arranged in a desired sequence Program.
Each may contain only one tool move. Each may contain any number of non-tool move G-codes. Each may contain only one feed rate. Each may contain only one specified tool or spindle speed. The block numbers should be sequential. The data within a block should follow the sequence shown in the above sample block
O1024 G21/G20 G98/G99 G40 G28 U0 W0 M06 T0101 M03 S1500 G00 X(VALUE) Z(VALUE)
G21 This code specifies that program is done in metric units G20 - This code specifies that program is done in Imperial units G98 Feed in mm/min G99 - Feed in mm/rev G40 Cutter radius compensation cancel G28 U0 W0- Makes the tool to go to home position. M06 T0101 Tool change. The first two digits after T specify the tool position in the turret and last two digits denotes the tool offset number. M03 Makes the spindle rotate in clockwise direction S1500 Spindle rotates at 1500 rpm G00 -Gives rapid position of the too to a point specified in the X and Z address
SIMPLE TURNING
( Using G00 and G01 )
30
27
15.0
50
ALL DIMENSION IN 'mm' BILLET SIZE :30 X 75 G CODES USED - G00,G01
O1000 N1 G21 G98 N2 G28 U0 W0 N3 M06 T0101 N4 M03 S2000 N5 G00 X30 Z1 N6 G00 X29 Z1 N7 G01 X29 Z-50 F50 N8 G01 X30 Z-50 N9 G00 X30 Z1 N10 G00 X28 Z1 N11 G01 X28 Z-50 N12 G01 X30 Z-50 N13 G00 X30 Z1 N14 G00 X 27 Z1 N15 G01 X27 Z-50 N16 G01 X30 Z-50 N17 G00 X30 Z1 N18 G28 U0 W0 N19 M05 N20 M30
SIMPLE FACING
( Using G00 and G01 )
40
10
20
O1002 G21 G98 G28 U0 W0 M06 T0101 M03 S2000 G00 X41 Z1 G00 X41 Z-1 G01 X10 Z-1 F30 G01 X10 Z1 G00 X41 Z1 G00 X41 Z-2 G01 X10 F30 G01 Z1 G00 X41 Z-3 G01 X10 F30 G01 Z1 G00 X41 Z-4 G01 X10 F30 G01 Z1 G00 X41 Z-5 G0I X10 F30 G01 Z1 G28 U0 W0 M05 M30
30
70
10
22
Rapid
Rapid
15
70
25
32
Dwg.No:09 PROGRAM USING MULTIPLE TURNING CYCLE G71 - MULTIPLE TURNING CYCLE
22 R5 15
O1006
G21 G98 G28 U0 W0 M06 T0404 M03 S1200
10
R5
G00 X22 Z1 (Multiple turning cycle G71 U0.5 R1 G71 P10 Q20 U0.1 W0.1 F50 N10 G01 X0 Z0
15 70
15
10
G03 X10 Z-5 R5 G01 Z-15 G01 X15 Z-30 G01 Z-45 N20 G03 X22 Z-50 R5 (Finishing cycle G70 P10 Q20 S2000 F30 G28 U0 W0 M05 M30
G74 G74
R X0 Z
R Retract value of each peck, in mm Z Final hole depth, in mm Q Peck increment in micron without sign F Feed rate
G75 G75
R X
R Retraction, in mm X Required Diameter, in mm Z Left end point of Groove in Z axis, in mm P Peck increment in each cut in X axis, in micron Q Z Axis stepping distance, in micron F Feed rate
G21 G98 G28 U0 W0 M06 T0404 (2mm Groove tool width) M03 S 800 G00 X33 Z-17 G75 R1 G75 X28 Z-20 P200 Q1000 F20
15
G28 U0 W0
70
M05 M30
G76 G76
Block 1
P X
Q Z
R P
P A(02)B(15)C(60), A-First 2 digit No of times to call the finishing cycle B-Second 2 digit Pullout angle, in deg C-Last 2 digit Thread angle, in deg Q depth of cut, in micron R Finishing allowance, in mm Block 2 X Core Diameter of thread, in mm Z End of the Thread, in mm P Thread Height, in micron Q depth of first cut, in micron F Pitch of the thread, in mm
15
O1008 G21 G98 G28 U0 W0 M06 T2 M03 S400 G00 X12 Z1 G76 P031560 Q50 R0.1 G76 X9.853 Z-15 P1073 Q100 F1.75 G28 U0 W0 M05 M30
1X45
15
M12 X 1.75
File Menu
Options Menu
Graphics Options
View Options
Billet Setting
Tool Offset
Select Tooling
N170 G00 Z5 N180 G00 X-15 Y0 N190 G01 Z-1 F50 N200 G03 X15 Y0 R15 N210 G03 X-15 Y0 R15 N220 G00 Z5 N230 M05 N240 G91 G28 Z0 N250 G28 X0 Y0 N260 M30
X__ Y__ : defined as the hole position, in absolute or incremental values. Z__ : Distance from the reference point to the bottom of the hole in incremental
mode, or the position of the hole bottom in absolute mode. R__ Q__ K__ F__ : Reference point in Z direction. : defined as the Cut-in distance value or peck value. (Incremental only) : defined as the number of repeats, for a series of holes. When not specified K=1. : Feed rate
Circular Pocketing
G17 block, R defines the position of the tool to start cycle ie. 0 (surface of job). P defines roughing/ finishing cycle. (P is 0 for roughing cycle & 1 for finishing) Q defines the peck increment. Syntax : X defines the pocket centre in X axis. Y defines the pocket centre in Y axis. N10 G170 R0 P0 Q3 X0 Y0 Z-6 I0 J0 K-24 ; Z defines the pocket base (depth) from job surface. N20 G171 P75 S30 R75 F250 B3500 J200 ; I defines the side finish allowance. J defines the base finish allowance. K defines the radius of pocket. (Negative value - cut in CCW direction). G171 block, P defines the cut width percentage. S defines the roughing spindle speed. R defines the roughing Feed in Z. F defines the roughing feed for X and Y. B defines the finishing spindle speed. (Not applicable for roughing only). J defines the finishing feed. (Not applicable for roughing only). When setting offsets the value R must be included, R being the radius of the cutter. The direction of the cutter path is controlled by K, a negative value for K means the cutter path is in a CCW direction and if the K value is positive the cutter path is in a CW direction. The Q value is always positive.
O 0002 ; N10 G91 G28 X0 Y0 Z0 ; N20 M06 T01 ; N30 G90 G00 X0 Y0 Z10 N40 M03 S3000; N50 G01 Z0 F300 ; N60 G170 R0 P0 Q3 X0 Y0 Z-6 I0 J0 K-24 ; N70 G171 P75 S3000 R75 F250 B3500 J200 ; N80 G00 Z25 ; N90 M05 ; N100 G91 G28 X0 Y0 Z0 ; N110 M30 ;
Rectangular Pocketing
Syntax: N10 G172 I-50 K0 P0 Q3 R0 X-25 Y-25 Z-6 N20 G173 I0 K0 P75 T1 S300 R75 F250 B3500 J200 Z5
For G172 block, I defines the pocket X length. J defines the pocket Y length. K defines the radius of corner roundness. P defines that 0 = roughing cycle. Q defines the pocket Z increment. R defines the Absolute Z reference point. X defines the pocket corner X (Absolute position relative to the X datum position). Y defines the pocket corner Y (Absolute position relative to the Y datum position). Z defines the absolute Z base of pocket (depth). For G173 block, I defines the pocket side finishing allowance. K defines the pocket base finishing allowance. P defines the cut width percentage (% of tool dia.). T defines the pocket tool. S defines the spindle speed for roughing. R defines the roughing feed for Z . F defines the roughing feed X and Y . B defines the finishing spindle speed. J defines the finishing feed. Z defines the safety Z position above 'R' point.
M98 - Subprogram Call M98 causes another program to be executed. The "P" value specifies the program number and the number of times to execute it. The right most 4 digits are the program number. The digits to the left are the number of repetitions. There can be up to 999 repetitions, if the value is omitted it is called once. Examples: M98 P12 and M98 P10012 both execute CNC program 12 once. M99 - Subprogram Exit Returns control to the program that called the current program. If a "P" value is specified then execution begins form the block with the same "N" number, otherwise it is form the block after the subprogram call. If an M99 is specified in the main program then the execution is from the start of the program. This is called looping (or) nesting of one or more programs Example: M99 Returns to the block following the call. M99 P10 Returns to the block with "N" value 10.
O 0008 Subprogram N010 G90 G00 X10 Y10 N020 G01 Z -1 F50 N030 X40 N040 X10 Y40 N050 Y10 N060 G00 Z6 N070 G00 X0 Y0 N080 M99
EXERCISE ON MIRRORING