Presentation on theme: "General 1- Composition of a part programs. 2- Block Configuration."— Presentation transcript:
1 General 1- Composition of a part programs. 2- Block Configuration. 3- Part programming Block format:N G X(u) Y(w) Z F M S TN (block number):Each block of information must be allocated a number.Ex: N0010, N0020,It is recommended that the blocks are programmed in increments of 10 to allow for further block insertion.G (code for preparatory function):A G code is a command to the control unit to perform some specific task or function.G code is made from the G address letter and a two digit number: G00, G01Some G codes remain active till replaced or cancelled. These are called modal (retained) G codes.G code from group 0 are non-modal.XYZ (position co-ordinate data):These letters refer to movement along the designated axes.Use XYZ when absolute mode is intended.Use U,W when incremental mode is intended.F (feed function):The movement of the tool at a specified speed for cutting is called the feedrate.The feedrate is defined using the F address letter followed by a numerical value: F256Feedrates can be specified as either millimetre or inches movement per minute or revolution.Incorrect feedrates may result in damage to the cutting tool or the work piece.
2 M code (miscellaneous functions): are (non-standard) commands to the control unit to perform special tasks.M codes are defined using the M address letter and a two digit number EX: M03 spindle forwardS (spindle speed function):The rotational speed of the tool with respect to the work piece being cut is called the spindle speed.Four digit number following the S code specifies the speed in RPM.When a move command and a S code is specified in the same block a simultaneous execution of the command is performed.T (tool function):A tool from the ATC is selected using the address letter T followed by a number in ATC magazine position.To command a tool change the M06 code would precede the number of the “new” tool required. Ex: M06 T01Point-to-PointThis is a rapid traverse movement that moves the slide to the next position required.Axes movements are not co-ordinated with each other so care must be taken to avoid collision with clamps.This is used for tool positioning and no cutting should be undertaken.Line Motion (Linear interpolation)Tool moves along the specified straight line with a given feed rate.Line motion is used when the tool is to cut in a straight line under co-ordinated axis movement.ContouringThis involves programming that is similar to line motion in that the next position is specified and a feed rate is given but an arc movement is achieved.4- Tool Movement
3 Make sure you know how to stop the machine in case of an emergency. De to the great cutting forces that these machines are capable of producing and the increased feed rates over conventional machines, great care must be taken at all times as any fault in the program may have disastrous effects on the machine and the operator.5- SAFETYSafety Rules:Make sure you know how to stop the machine in case of an emergency.Make sure that the machine guards are in position when machining.If you suspect something is going wrong, STOP the machine immediately.Isolate the machine before any adjustments.Do not attempt to use the machine until you are sure you can use it correctly.Part programs should be proved prior to machining using a dry run or computer simulation.6- Program Proving
4 Methods of checking/verification Graphical simulation: computer graphics are used to simulate the workipece and the cutting tool movements. Any errors in the program will be highlighted prior to the program being entered into the machine and therefore the programmer is able to edit/correct his program.
5 Dry Run: this method of program proving is done on the machine tool but the component or billet to be cut is not installed. As the tool or cutter moves in air the operator looks to see that the cutting tool will not collide with proposed clamping and fixture arrangements or the part.A dry run can be done in single step mode which means that the part program can be run block by block under the control of the operator. All CNC machine controllers have this facility.DATUM:Machine datum: defines the zero point of all axes which is fixed by the manufacturer. We can use zero offset facility to move this datum.Program/work datum is specified by the programmer when the program is written. All subsequent measurements are then made relative to this new “program” datum.YZX
6 Co-Ordinate Dimensioning: There are two types of co-ordinate dimensioning systems used in CNC programming:Incremental: where next position measurements are taken relative to the current position.- an error made in one dimension will effect subsequent measurements- if a dimension changes then the rest of dimension will have to bechangedAbsolute: Dimensions are always measured from the same datum position therefore there are no build-up or accumulation of errors between dimensions.YX213456AbsoluteIncremental
8 G&N programming for CNC lathe 6- Absolute and Incremental Co-ordinates The addresses X and Z within a program relate to a co-ordinate position from the workpiece datum.The address U and W within a program relate to the individual axis movements required to reach the new position, from the last position reached by the tool. The address U refers to the X axis and the address W refers to the Z axis.Dia 30X axisZ axisDia 2050Four different ways can be used to write a block within a program:Absolutes/ absolutes G01 X30 Z-50;Incremental/incremental G01 U10 W-50;Absolutes/incremental G01 X30 W-50;Incremental/absolutes G01 U10 Z-50;
9 List of G Codes (Turning machine) G00 positioning (rapid traverse)G01 liner interpolation (feed)G02 circular interpolation CWG03 circular interpolation CCWG04 dwellG20 inch data inputG21 metric data inputG28 reference point returnG40 tool nose radius compensation cancelG41 tool nose radius compensation leftG42 tool nose radius compensation rightG50 work coordinate change/Max spindle speed settingG70 finish cycleG71 stock removal in turning –XG72 stock removal in facing-ZG73 pattern repeatingG74 Peck drilling in Z axisG75 Grooving in X axisG76 multiple thread cutting cycleG81 deep hole drillingG90 diameter cutting cycle A (outer/inner)G92 thread cutting cycleG94 cutting cycle B (end face cycle)G96 assessed surface speed controlG97 Assessed surface speed control cancelG98 feed per minuteG99 feed per revolution
10 G Codes G00 /Rapid positioning & traverse (modal) Executes a non cutting movement at a rapid feedrate to a specific coordinate position in the working area (absolutes mode) or a certain distance from previous position (increment mode).The two axes move completely independent off each other at the maximum feedrate along a non vector path.Dia.X 302.0Non vector movementG00 X30 Z2P1Z 0.0G00 Z2X30G00 is modal2.0G01 /Linear interpolation (modal)The G01 executes a cutting movement following a straight line at a set feedrate. G01 X(or U) Z(or W) FThe feedrate value programmed into the G01 command is the actual feedrate along the proposed tool path, not the feed rates of the slide.On two axis movements, the machine controller will calculate the separate feedrates for both the X and Z slides, enabling the actual vector feedrate to equal that stated in the G01 command.The coordinates can be programmed in absolutes values as X and Y, or incremental values as U and W.The coordinates may be programmed in mixed modes.to
11 Feedrate values are modal. Absolute:G01 Z-25 F0.1;X40 -Z50;Incremental:G01 W-25 F0.1;U15 W-25;Mixed:X40 W-25;Feedrate values are modal.P3P2P125 Dia255040 DiaG02/G03 circular interpolation (modal)G02 executes a cutting movement following a clockwise circular path at a set feedrate.G03 executes the cutting movement following an anticlockwise circular path at a set feedrate.When using absolute position, X & Z values are the dimensions of the end point of the arc in relation to the datum position of the component.In incremental mode, U & W are the distance the tool moves from the start position of the arc. This can either be a plus value or a minus value depending on the direction of the movement relative to the start position.G02 X Z R Absolute G03 X Z RG02 +/-U +/-W R Incremental G03 U W REnd+Z+XRG02 X30 Z-30 R FG02 X30 W-20 R FStart30 Dia2010
12 G04 X-- (Integer time in seconds) G04 X10 When you do not know the radius: A case for I and KTo program an arc when only the arc center is given use the address letter I and K.I relates to the address X and is the incremental value and direction from the start point of the arc in the X axis to the arc center.K relates to the address Z and is the incremental value and direction from the start point of the arc in the Z axis to the arc center.Center of ARC+Z+XIEndAbsolute G02 X Z I K F;Incremental G02 U W I K F;StartKFinishStartIZG04 /DwellG04 X-- (Integer time in seconds) G04 X10G04 U- (Real time in seconds) G04 X10.5G04 P-- (time in milliseconds) G04 P2500Used to enter a set time delay into the program.No decimal points can be used with address PDwell is performed at the start of the block in which it is programmed.G04 is non-modal
13 G20-G21 / Inch-Metric Data input unit The machine controller can be programmed in either inch unit input or metric unit input.G20 Imperial/Inch lowest valueG21 Metric/Millimeter lowest value 0.001Do not switch between G20/G21 during a programThe offsets must be set according to the units of measurement being used.Offsets !!!!!!!!!!!????!!There are two parameters that are different from tool to tool. These are radius and length.The offset compensation table is a useful means of overcoming this problem.40601005010G28 /Reference point returnG28 X(U) Y(W)The reference point is a fixed position on the machine to which the tool can be moved. (home position)G28 instructs the tool to automatically move to this reference point.X/Y/ can be used to indicate an intermediate point through which the tool will pass before continuing to the reference point.
14 G50 / 1- Clamping maximum spindle speed. 2- Coordinate system setting. G28 moves are performed at rapid traverse rates (non-vector tool path)Reference PointCollisionPointP2G28 U0 W0when no intermediate points are required U&W are set to zero.P1P3Reference PointP2P1G28 X100 Z-40To avoid this collision the tool is sent on a path through the intermediate point P2.Dia 8040G50 / 1- Clamping maximum spindle speed.2- Coordinate system setting.3- Coordinate system shift.1- Clamping maximum spindle speed. G50 S____The value in word address S specifies the maximum spindle speed measured in RPM.this command can be used in conjunction with G96 (Constant surfaces speed control) to clamp the spindle speed to the given value.This command can be used to specify a user coordinate value to register as the current position of the tool. The tool will think it is at the specified coordinates although it has not actually moved.
15 3- Coordinate system shift. 10203040+Z20201010G50 X10 Z103- Coordinate system shift.If incremental word addresses are used to specify the values then this command shifts the coordinate axes by the specified values.10203040+Z20101020G50 U10 W10G71 / Stock removal in X axis.G71 is a canned cycle that generates the roughing cuts needed to make a component profile.RR = retract escaping amount.F= feedrate for roughing.U1= depth of cut in X axis (Radius value)U2=finishing allowance in X axis (sign & Mag)W=finishing allowance in Z axis (sign & Mag)BrU1FFU2ProgrammedPathAW
16 should a different tool be required to perform the finishing pass: Prior to writing this command the tool is positioned at the start point. The sequence of tool moves are as follows:A- roughing cycle.1- From the start position, the tool moves a distance U2 along the X axis and W along the Z axis at a rapid feed rate.2- the tool moves the distance U1 along the X axis towards the billet centerline at a feed rates corresponding to the G code in the ns block.3- the tool moves along the Z axis towards the spindle. The feedrate used is a stated in the second block of G71.4- at this point the tool retracts in the X and Z axis away from the work at an angle of 45 degrees at a rapid traverse. feedrates. The amount R is stated in the first block of the G71.5- the tool then retracts along the Z axis at a rapid feedrate until it reaches the start point of that same diameter.6- from this point the above cycle is repeated until the programmed shape between ns and nf has been roughed out.7- after all the roughing passes are completed a singled roughing profile pass is performed at G71stated feedrate. when this single pass is complete the tool will retract to the original starting position of the G71.B-finishing cycle.8- if the next block contains G70 the same tool will be used to perform the finishing pass at feedrate and spindle speed contained between ns and nf.should a different tool be required to perform the finishing pass:a) The block after nf would instruct the machine to move to a tool change position.The next block would instruct the machine to change to the tool required for the finishing pass.The next block would move the tool back to the original G71 starting position.At this point the finishing pass block would be read into the machine and executed.9- When the finishing pass ends the tool will retract to original G71 start position.G71 command is written in the following format: N ns …………F…..;G71 U(1) R__; ……….;G71 P ns Q nf U(2) W_ F_; F …….;S …….;Any F or S commands between ns to nf block N nf ……………….;numbers will only be effective on the finishing pass.Move commands are specified between program blocknumbers ns to nf.
17 N0050 G00 X38 Z2; start & finished position N0060 G71 U1.5 R0.5; In canned cycle G71 only an X axis move is permitted in the first block of the finished profile.Only G00, G01, G02, G03 and G04 can be programmed between ns and nf blocks.12353038 Dia30 Dia25 Dia20 Dia1.5 Chamfer1 Rad3 RadN0050 G00 X38 Z2; start & finished positionN0060 G71 U1.5 R0.5;N0070 P80 Q170 U2 W0.1 F0.15;N0080 G01 X16 F0.3; (ns)N0090 Z0.5;N0100 X20 Z-1.5 F0.05;N0110 Z-30 F0.075;N0120 X23;N0130 G03 X25 Z-31 R1;N0140 G01 X30 Z-65;N0150 Z-74;N0160 G02 X36 Z-77 R3;N0170 G01 X38.5; (NF)N0180 G70 P80 Q170; Finish passG70 /Finishing Cycle G70 Pns QnfAfter part profile rough cutting has been competed using G71-G72-G73 codes the G70 can be used to perform a finishing pass/cut.ns = the sequence number of the start block for the finishing pass.nf = the sequence number of the last block for the finishing pass.When the finished pass is ended the tool returns to the position it was originally at before G70 was commanded.F and S between the sequence numbers ns and nf will be effectively in the G70 operation.
18 G72 /Stock removal in Z axis 20 Dia1.5 Rad32 Dia1.5 Chamfer151515N0070 G00 X16 Z2;N0080 G71 U1.25 R0.5;N0090 G71 P100 Q170 U-1.5 W0.07 F0.075;N0100 G01 X36 F0.3;N0110 Z0.5;N0120 X32 Z-15 F0.05;N0130 Z-15 F0.07;N0140 X20 Z-30;N0150 Z-43.5;N0160 G03 X17 Z-45 R1.5 F0.05;N0170 G01 X15.8;N0180 G70 P100 Q170;G72 /Stock removal in Z axissimilar to G71except that the cut is applied in the Z axes.G72 W(1) R__;G72 Pns Qnf U__ W(2) F__;W1F= feedrate.r= rapid traverse.W1= depth of cut.U= finishing cut allowance in X axis.R=escaping amount.ns= sequence number of the first block of the programmed finished shape.nf= sequence number of the last block of the programmed finished shape.U= distance and direction of the finished allowance in the X axis.W(2)= finishing cut allowance in Z axis.F=feedrate for roughing.AFrRProgrammedPathUBW(2)
19 Only a Z axis move is allowed in the ns block. If the finishing pass is required to block G70 Pns Qnf is placed after the G72 command has been completed.U80Dia60Dia60Dia40Dia20Dia1010102010N0050 G00 X81 Z2;N0060 G72 W2 R0.5;N0070 G72 P80 Q150 U0.5 W1 F0.1;N0080 G00 Z-60;N0090 G01 X80 F0.2;N0100 X60 W10 F0.075;N0110 W10;N0120 X40 W10;N0130 W20;N0140 X180 W11;N0150 W1;N0160 G70 P80 Q150;
20 G75 permits grooving in the X axis. G75 R(1); G75 / grooving cycle.G75 permits grooving in the X axis.G75 R(1);G75 X(U) Z(W) P__ Q__ R(2) F__;QR(2)PR1 peck return amount.X(U) the diameter of the depth of the groove.Z(W) the width of the groove.P stepover in the X axis measured in microns.Q pecking debt in the Z axis measured in microns.X(U)R(1)z(w)The retract amount R(2) at the base of the groove may be impossible unless a clearance amount has been provided. If no clearance amount has been left the R(2) value must be set to zero or omitted from the block.3mm wide grooving toolStar position X52 Z-10.520 Dia50 Dia540N0060 G00 X52 Z-8;N0070 G01 X20 F0.075;N0080 G00 X52;N0090 W-2.5;N0100 G75 R0.5;N0110 G75 X20 Z-40 P5000 Q2500 R0.5 F0.075;
21 G90 /outer diameter cutting cycle The command G90 performs the one pass cutting cycle where the cut is applied in the x axis.G90 is modal.G90 can also be used to cut tapers.To sign of R depends on thedirection of path P1. In this exampleİt is entered as a minus value.WP4(R)G90 X(U)_ Z(W)_ F_;P3(F)P1(R)U/2P2(F)X/2In this example both U and W are minus.ZWP4(R)G90 X(U) Z(W) R_ F_;P3(F)U/2P1(R)P2(F)X/2RZ25 Dia840DiaN0060 G00 X41 Z2;N0070 G90 X35 Z-45 F0.1;N0080 X30;N0090 X25 Z-25;N0100 X20;N0110 X20 R-3.512;20 Dia2025
22 G94 /end face turning cycle This command performs a one pass face cutting cycle.The cut is applied in the Z axis.G94 can also be used for cutting taper profiles.If repetition of the move is required only the values that changed needs to be entered into the next block.WP1(R)P2(F)U/2P4(r)P3(F)XG94 X(U) Z(W) F_ZWP1(R)G94 X(U) Z(W) R_ F_P2(F)RP3(F)U/2To sign of R depends on the direction of path P1. In this example It is entered as a minus value.XRZN0060 G00 X61 Z2;N0070 G94 X20 Z-2.5 F0.1;N0080 Z-5;N0090 Z-7.5;N0100 Z-10;N0110 Z-12.5;N0120 Z-15;N0130 G00 X21 Z5;N0140 Z-2.5;N0150 Z-5;N0160 G94 X10 Z-7.5 R-2.5;N0150 Z-11 R-6;10 Dia20 Dia60 Dia555
23 Spindle speedthis spindle speed specified by the word address S in any block of a program may be interpreted in two ways depending on the mode selected. these are:G96 / constant surface speed G96 S___;The spindle speed is calculated so that the surface speed is always the specified value (in S) in relation to the tool position.The units used will depanned on whether the machine is operating using metric or Imperial measurements.G96 units can therefore be meters pair minutes, or feet per min.When using G96, the work datum point must be set so that the center of rotation meets the Z axis.G50 code defining clamping off maximum spindle speed must be used in conjunction with G96, so as not to overrun the safe maximum spindle speed off the chuck.G96 is modal.G97 / spindle speed in Rev Per Minute G97 S__;Once G97 is entered all subsequent spindle speeds are defined in revolution per minutes.G97 is the default mode at power up.G98 / Fee per Minute G98 F__;This command allows a feedrate written in the units, millimeters per minute or inches per minute to be entered into the machine controller.G98 is modal therefore if a change to the feedrate is required within a program, only the F value needs to be entered.G98 is the default condition at power up.G99 / Per Revolution Feed G99 F__;G99 results in feed rate of millimeters or inches per revolution depending on the previously selected units.G99 is modal
24 M Codes: M??Miscellaneous functions, called M codes, are used by the CNC control to command on/off signals to the machine functions.The functions allocated are constant in most CNC machines however some can vary from one make of the machine to the next.Only one M code can be programmed within each block.M00 program stopM01 optional stopM02 end of programM03 spindle forward (clockwise)M04 spindle reverse (counter clockwise)M05 spindle stopM06 automatic tool changeM08 coolant onM09 coolant offM10 chuck openM11 chuck closeM13 spindle forward and coolant onM14 spindle reverse and coolant onM25 tailstock quill extendM26 tailstock quill retractM30 program stop and resetM38 door openM39 door closeM40 parts catcher extendM41 parts catcher retractM98 sub program callM99 sub program end and returnMain prog.O0001N0020 ……;N0030 ……;N0040 M98 P1000;N0090 ……;N0100 ……;N0110 M30;Sub prog. 1O1000N0020 ……;N0030 ……;N0040 M98 P2000;N0090 ……;N0100 ……;N0110 M99;Sub prog. 2O2000N0020 ……;N0030 ……;N0040 ……;N0090 ……;N0100 ……;N0110 M99;
25 We can use zero offset facility to move this datum. 7- G&N programming for CNC Milling MachineDATUM:Machine datum: Sometimes referred to as the zero datum defines the zero point of all axes which is fixed by the manufacturer.We can use zero offset facility to move this datum.Program datum is specified by the programmer when the program is written. All subsequent measurements are then made relative to this new “program” datum.YZX
26 Co-Ordinate Dimensioning: There are two types of co-ordinate dimensioning systems used in CNC programming:Incremental: where next position measurements are taken relative to the current position.- an error made in one dimension will effect subsequent measurements- if a dimension changes then the rest of dimension will have to bechangedAbsolute: Dimensions are always measured from the same datum position therefore there are no build-up or accumulation of errors between dimensions.YX213456AbsoluteIncremental
27 2 holes on CL, 8 Dia x 10 deep9814711825122030X8X5 deep
28 O0001N0010 G21; metric measure[BILLET X98 Y147 Z36; size of work piece[TOOLDEF T3 D8 Z20; define tool[EDGEMOVE X0 Y0 Z0; force billet datum to be at workpiece datum/ for simulation set X datum to 20/ this means we have room to move to the left the billetN0015 M6 T3; pick toolN0020 G90; Go home - absoluteN0040 G00 X-4 Y4 Z-25; 1st moveN0050 M03 S1500; Spindle onN0060 G01 X94 F120; 2nd cutN0070 Y143; 3nd cutN0080 X-4; make sure no corner remainsN0090 Y139;N0100 X93; 4rd cut completeN0110 G00 Y140;N0120 X4; ready for last cutN0130 G01 Y4; last cut round/N0140 G00 Z10; lift clearN0150 X49 Y20; position over 1st holeN0150 G01 Z-10;N0160 G00 Z10;N0170 Y127; Over 2nd holeN0180 G01 Z-10;N0190 G00 Z10; RetractN0200 Y73.5; Over the slot centerN0210 G01 Z-5;N0220 G91; incremntalN0230 X30;N0240 X-60;N0250 G00 z10;N0260 G90;N0270 M02;N0280 M30
29 G00 /Rapid positioning & traverse G00 X10 Y20 Z30Executes non cutting movement (point-to-point) at a rapid feed rate.Axis co-ordinate moves can be absolute or incrementalG00 freezes tool radius compensation and axis movement are independent of each other.G00 is modalG01 /Linear interpolation G90 G01 X100 Y50 F170Executes cutting movement along a straight line at a given feed rateAxis co-ordinate moves can be absolute or incrementalG01 is modalF is modal and is specified as inches per minute (G20) or millimeters per minute (G21)G02-G03 /Circular interpolationG02 (CW) and G03(CCW) executes a cutting movements in circular path.There are four ways to program a CW/CCW circular path:G90 G02/03 X-- Y-- R-- F-- [can use G91]arc end point in X&Y (absolute/incremental). R length of arc radius. F feed rate.G90 G02/G03 X-- Y-- I-- J-- F-- [can use G91]I-- J-- defines the signed distance of the arc start point from the centre point of the arc.For arcs exceeding 180 degree the radius value R-- must be specified as negative.When X or Y are omitted the arc end point is located at the same position as the arc start point and the arc center is commanded by I or J, an arc of 360 degree is assumed.
30 G04 /DwellG04 X-- (time in seconds) G04 X1.5G04 P-- (time in 1 milliseconds) G04 P2500Used to enter a set time delay into the program.No decimal points can be used with address PDwell is performed at the start of the block in which it is programmed.G04 is non-modalG20-G21 /Data input unitG20 Imperial/Inch lowest valueG21 Metric/Millimeter lowest value 0.001Do not switch between G20/G21 during a programG28 /Reference point returnG28 X-- Y-- Z--the reference point is a fixed position on the machine to which the tool can be moved. (home position)X/Y/Z can be used to indicate an intermediate point through which the tool will pass before continuing to the reference point.G28 is non-modalG40-G41-G42 /Cutter compensationG41/42 the tool is positioned on the left/right hand side of the part (programmed path) as seen following the direction of movement from behind the tool.G40 cancels cutter compensationThe radius of the tool (amount compensated by) should have been set in the machine controller.
31 G40-G41-G42 /Cutter compensation G41/42 the tool is positioned on the left/right hand side of the part (programmed path) as seen following the direction of movement from behind the tool.G40 cancels cutter compensationThe radius of the tool (amount compensated by) should have been set in the machine controller.A start-up or ramping on block must be used to allow the tool time to change from moving along he programmed path line to following either side of the path line. Therefore:G41/42 must be contained in the block or specified in the previous block and A G01 is specified in the block and the distance of the linear move must be greater than the tool compensationThe tool offset store in the table must not be 00G02 or G03 can not be specified in the start-up blockG40/41/42 are modalG40 can only be performed in a block in which a linear move (G00-G01-G28) is performed2 holes on CL, 8 Dia x 10 deep9814711825122030X8X5 deep
32 G98 - initial point return G99 - R point level return Caned cycles (G73-G89) simplifies the program by replacing a number of complex machine sequence blocks with just one block.G98 - initial point returnG99 - R point level returnG81 /Drilling- spot boringG90/G91 G98/G99 G81 X-- Y-- Z-- R-- K-- F--;G G81 X10 Y30 Z-17 R2 F75;G91 G99 G81 X10 Y6 Z-10 R-8 K4 F100;Rapid position to XY (initial level)Rapid traverse to R point levelFeed to depth ZRapid traverse to initial Z level (G98) or R point (G99).K defines the number or repeatsG90-G91-G42 /Absolute/incremental data formatZ defines the distance from the R point to the bottom of the hole in incremental mode or the position of the hole bottom in absolute mode.R defines the distance from the initial level to the R point level in incremental mode or the position of the R point level in absolute mode.XYZ=0ZRG99G98XYZ=0ZRG99G98
33 G82 /Drilling- counter boring G90/G91 G98/G99 G82 X-- Y-- Z-- P-- R-- K-- F--;Rapid position to XY (initial level)Rapid traverse to R point levelFeed to depth ZDwell for value PRapid traverse to initial Z level (G98) or R point (G99).K defines the number or repeatsG80 /Canned cycle cancelThe data specified (ZPQR) is retained until it is either changed or the canned cycle cancelled.G73 /high speed peck drillingG90/G91 G98/G99 G73 X-- Y-- Z- Q-- R-- F--;Move rapid to XYMove rapid to RFeed to a depth of QRetract a small distanceRe-feed to a further depth of QRetract and repeat till Z is reachedRetract to R or initial level as specifiedG 83/deep hole peck drillingRapid position to XYRetract rapid to RRapid traverse back to within 1mm depth of Q cutFeed to a further depth of QRetract to R and repeat till a depth of Z is reachedG 84 /Tapping G74 /Counter TappingG76 /Fine Boring G 85-G86-G89 /BoringG 87 /Back boring
34 G170 - G171 /circular pocket canned cycle The canned cycle required two blocks G170&G171There are three ways to program these canned cyclesG170 R0 P0 Q3 X0 Y0 Z- nI0 J0 K-24; rough cut no allowanceG171 P75 S3000 R75 F250 B J;For 1st blockR defines the position of the tool to start cycleP =0 means a roughing cycleQ defines the peck (vertical cut) incrementXY defines the hole centreI defines the side finish allowanceJ defines the base finish allowanceK defines the radius of the pocket (- means CCW)For 2nd blockP defines the cut width percentageS roughing spindle speedR roughing feed in ZF roughing feed in XYB finished spindle speed (ignored when P=0)J finish feed (ignored when P=0)When the tool has finished cutting the tool retracts 1mm in the Z axis, moves to the centre of the circular pocket at rapid traverse, retracts again in the Z axis.G170 R0 P0 Q3 X0 Y0 Z-- I0.5 J0.1 K-24; rough cut WITHG171 P75 S3000 R75 F250 B3500 J200; finishing allowanceG170 R0 P1 Q3 X0 Y0 Z-6 I0.5 J0.1 K-24; One step finishing cycleG171 P75 S3000 R75 F250 B3500 J200I&J are ignored when P=1S&R&F must be entered but ignored for finishing cycle
35 G172 - G173 /Rectangular pocket canned cycle The canned cycle required two blocks G170&G171G172 I-50 J-50 K0 P0 Q3 R0 X-25 Y-25 Z-6; Roughing cutG173 I0 K0 P75 T1 S3000 R75 F250 B3500 J200 Z5;For 1st blockI defines the pocket X length (+ CW/ - CCW)J defines the pocket Y lengthP=0 roughing cycleQ defines Z peck incrementR defines the absolute Z R pointXYZ absolute position of the pocket corner pointsFor 2nd blockI pocket side finish allowance (=0 when P=0)K Pocket base finish allowance (=0 when roughing)P is the cut width percentageT is the pocket toolS roughing spindle speedR roughing feed for ZF Rouging feed for X and YB finish spindle speedJ finish feedZ safety Z above R.G172 I-50 J-50 K0 P0 Q3 R0 X-25 Y-25 Z-6; rough cut WITH finishG173 I0.5 K0.1 P75 T1 S3000 R75 F250 B3500 J200 Z5;G172 I-50 J-50 K0 P1 Q3 R0 X-25 Y-25 Z-6; One step finishing cycle
36 List of G Codes (Milling machine) G90 /Absolute commandActive when machine is first switched onG91 /Incremental commandG94 /Feed per minute(G29) F6= 6 inches/min(G21) F150= 150 mm/minuteG95 /Feed per revolution of spindleList of G Codes (Milling machine)G00 positioning (rapid traverse)G01 liner interpolation (feed)G02 circular interpolation CWG03 circular interpolation CCWG04 dwellG20 inch data inputG21 metric data inputG28 reference point returnG40/G41/G73-G89 Canned cyclesG73 High speed peck drillingG74 Counter tappingG76 Fine boringG80 Canned cycle cancelG81 Drilling – counter boaringG83 Deep hole peck drillingG84 TappingG85 BoringG86 BoringG87 Peck boringG89 BoringG90 Absolute zero commandG91 Incremental commandG94 feed per minuteG95 feed per revolutionG98 Return to initial levelG99 Return to R pointG170-G173 Cirular/Rect pockets