38
LEVEL 3 DIPLOMA IN ENGINEERING TECHNOLOGY CNC MACHINING CNC MILLING WORKBOOK L3 EAL Diploma in Engineering Technology Unit 007 & 041

CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

  • Upload
    others

  • View
    8

  • Download
    1

Embed Size (px)

Citation preview

Page 1: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

LEVEL 3 DIPLOMA IN ENGINEERING TECHNOLOGY

CNC MACHINING CNC MILLING WORKBOOK

L3 EAL Diploma in Engineering Technology

Unit 007 & 041

Learner Name:__________________________

THINK SAFETY!

Page 2: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

DON'T GET CAUGHT UP IN YOUR WORK

Safe operation

♦ Check for damaged parts and tools before operating the machine. Any part or tool that is damaged should be properly repaired or replaced by authorized personnel.

♦ Use appropriate eye and ear protection while operating the machine.

♦ Do not operate the machine unless the doors are closed and the door interlocks are functioning properly.

♦ The Emergency Stop button is the large, circular red switch located on the Control Panel. Pressing the Emergency Stop button will instantly stop all motion of the machine, the servo motors, the tool changer, and the coolant pump. Use the Emergency Stop button only in emergencies to avoid crashing the machine.

♦ The electrical panel should be closed and the key and latches on the control cabinet should be secured at all times except during installation and service. At those times, only qualified electricians should have access to the panel. When the main circuit breaker is on, there is high voltage throughout the electrical panel.

♦ It is the shop owner’s responsibility to make sure that everyone who is involved in installing and operating the machine is thoroughly acquainted with the installation, operation, and safety instructions provided with the machine

1

All milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC machines and their components, basic safety precautions must always be followed to reduce the risk of personal injury and mechanical damage.

Important machine to be operated only by trained personnel in accordance with the Operator's manual, safety decals, safety procedures and instructions for safe machine operation.

Page 3: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

BEFORE they perform any actual work. The ultimate responsibility for safety rests with the shop owner and the individuals who work with the machine.

The co- ordinate system.

2

Page 4: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Milling machine axis.

Alphabetical address codes.Below is a list of common word address letters.

D Tool Diameter SelectionD’s are used to define a tool diameter offset from the Tool Offset Page. We can choose a D value from D01-D200, which corresponds to the “Geometry” column in the Tool Offset Page. For example, D01=”ToolOffset Value Number 1”, D02=”Offset Number 2”, etc…..

F Feed RateF’s are used to define the speed of the movement of the spindle as it travels. Typically used while the tool is in the material, this is either defined as Inches Per Minute (IPM) or in Millimetres Per Minute (MMPM).

3

Page 5: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

G Preparatory Functions (G Codes)The G address character is used to specify the type of operation to occur in the block containing the G code. The G is followed by a two or three digit number.

For example, G83 is the code for a Drill Canned Cycle

H Tool Length Offset ValueThe H is used to tell the machine what tool length value to use from the Tool Offset page. If we define H01, we are telling the machine to use the value that is located under Tool Length #01.Eg H02 = Tool Length Value #2

I Canned Cycle and Circular Optional DataThe letter I is used two different ways. It can be used in canned cycles (Drilling Operations) and it is used in defining arcs, in that we tell the machine incrementally from the start point of an arc, where the centre of the arc is. I is used to tell the machine how far away the centre of the arc is in the X axis.

J Canned Cycle and Circular Optional DataThe letter J is used two different ways. It can be used in canned cycles (Drilling Operations) and it is used in defining arcs, in that we tell the machine incrementally from the start point of an arc, where the centre of the arc is. J is used to tell the machine how far away the centre of the arc is in the Y axis.

K Canned Cycle and Circular Optional DataThe letter K is used two different ways. It can be used in canned cycles (Drilling Operations) and it is used in defining arcs, in that we tell the machine incrementally from the start point of an arc, where the centre of the arc is. K is used to tell the machine how far away the centre of the arc is in the Z axis.

L Loop Count for Repeated CyclesThe L address character is used to specify a repetition count for some canned cycles and auxiliary functions. It is followed by an unsigned number between 0 and 32767.

M Miscellaneous Functions (M Codes)

4

Page 6: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

M codes are used to turn on and off functions specific to that of the machine. For example, M3 and M4 turn the spindle on, M5 turns the spindle off. M8 turns coolant on, M9 off. Think of it like M means “Machine Function”.

N Number of BlockThe N address character is entirely optional. It can be used to identify or number each block of a program.It is followed by a number between 0 and 99999. The M97 functions may reference an N line number.

O Program Number/NameThe O address character is used to identify a program. It is followed by a number between 0 and 99999.A program saved in memory always has an Onnnnn identification in the first block; it cannot be deleted.Altering the O in the first block causes the program to be renamed. A program can only have one O address.

P Delay Time or Program NumberP is another dual function letter in that it can be used to define a pause with a G04 code, or it is used with a M97 or M98 code to tell the machine to “jump” from its current place in a program to another place in the program (in the case of M97 P100 = Jump to line N100) or to another program entirely (with M98P520 = Jump to program O520).A length of a pause can be defined two different ways, in seconds (with adecimal point) or milliseconds (without a decimal).

Q Canned Cycle Optional DataThe letter Q is used in canned cycles, most often as the “Peck” distance in a drilling cycle.

R Canned Cycle and Circular Optional DataR is another dual role character. It can be used in canned (drilling) cycles to define the “Rapid Plane” (how far above the part to rapid the tool to), or it is used in defining an arc’s radius (replacing the I, J, and K method).

S Spindle Speed Command

5

Page 7: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

S defines the spindle rpm. We can use a value anywhere between S0 – S99999. If we define a speed higher than the capacity of the machines spindle, it will max out the machines RPM and start cutting.

T Tool Selection CodeA T code tells the machine what tool we want to put in the spindle.

X - Linear X Axis MotionThe X address character is used to specify motion for the X-axis. It specifies a position or distance along the X-axis. It is either in inches with four fractional positions or mm with three fractional positions.

Y - Linear Y Axis MotionThe Y address character is used to specify motion for the Y-axis. It specifies a position or distance along the Y-axis. It is either in inches with four fractional positions or mm with three fractional positions

Z - Linear Z Axis MotionThe Z address character is used to specify motion for the Z-axis. It specifies a position or distance along the Z-axis. It is either in inches with four fractional positions or mm with three fractional positions.

A - 4th Axis Rotary MotionThe letter A is used to specify motion for the optional rotary axis, it specifies an angle in degrees.

Preparatory Functions (G Codes)

The definition of “G” code is typically referred to as a “preparatory function”. They establish the mode of operation that the machine needs to be in to accomplish what the programmer intends.

Before considering the meaning and the use of codes, it is helpful to lay down a few guidelines:

6

Page 8: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

1) Codes come in groups. Each group of codes will have a specific group number.

2) A “G” code from the same group can be replaced by another code in the same group. By doing this, the programmer establishes modes of operation. The universal rule here is that codes from the same group cannot be used more than once on the same line.

3) There are Modal G codes (All G-Codes except for Group 00) whichonce established, remain effective until replaced with another G code from the same group.G01 for example will remain active until replaced by G00 (both from group 01).

4) There are non-modal G codes (Group 00) which, once called, are effective only in the calling block and are immediately forgotten by the control.

The rules above govern the use of all codes for programming Haas and other controls. The concept of grouping codes and the rules that apply will have to be remembered if we are to effectively program the machine tool.

Milling G codes.The following is a list of common / general G codes used whilst milling, the list is not exhaustive as some machine tool manufacturers will have G codes unique to themselves.

Code: Group: Function:G00 01 Rapid MotionG01 01 Linear Interpolation Motion

7

Page 9: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

G02 01 CW Interpolation MotionG03 01 CCW Interpolation MotionG04 00 DwellG10 00 Programmable Offset SettingG17 02 XY Plane Selection (circular interpolation)G18 02 ZX Plane Selection (circular interpolation)G19 02 YZ Plane Selection (circular interpolation)G20 06 Inch Programming SelectionG21 06 Metric Programming SelectionG28 00 Return to Machine Zero through Reference PointG40 07 Cutter Comp CancelG41 07 Cutter Compensation LeftG42 07 Cutter Compensation RightG43 08 Tool Length CompensationG54 12 Select Work Coordinate System lG55 12 Select Work Coordinate System 2G56 12 Select Work Coordinate System 3G57 12 Select Work Coordinate System 4G58 12 Select Work Coordinate System 5G59 12 Select Work Coordinate System 6G73 09 High Speed Peck Drill Canned CycleG74 09 Reverse Tap Canned CycleG76 09 Fine Boring Canned CycleG77 09 Back Bore Canned CycleG80 09 Canned Cycle CancelG81 09 Drill Canned CycleG82 09 Spot Drill Canned CycleG83 09 Peck Drill Canned Cycle (for deep holes)G84 09 Tapping Canned CycleG85 09 Boring Canned CycleG86 09 Bore/Stop Canned CycleG87 09 Bore/Manual Retract Canned CycleG88 09 Bore/Dwell Canned CycleG89 09 Bore Canned CycleG90 03 Absolute positioningG91 03 Incremental positioningG98 10 Initial Point ReturnG99 10 R Plane Return

Miscellaneous Function “M” Codes

8

Page 10: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

All M codes are activated or cause an action to occur after everything else on a block has been completed. Only one M code is allowed per block in a program.

Often Used Miscellaneous “M” Codes

M00 The M00 code is used for a Program Stop command on the machine. It stops the spindle, turns off coolant and stops look ahead processing. Pressing CYCLE START again will continue the program on the next block of the program.

M01 The M01 code is used for an Optional Program Stop command. Pressing the OPT STOP key on the control panel signals the machine to perform a stop command when the control reads an M01 command. It will then perform like an M00.

M03 Starts the Spindle FORWARD. Must have a spindle speed defined.

M04 Starts the Spindle REVERSE. Must have a spindle speed defined.

M05 STOPS the Spindle

M08 Coolant ON command

M06 Tool change command

M09 Coolant OFF command

M30 Program End and Reset to the beginning of program.

M97 Local Subroutine Call

M98 Subprogram Call

M99 Subprogram Return (M98) or Subroutine Return (M97), or a Program Loop.

NOTE: Only one "M" code can be used per line. And the "M" codes will be the last command executed in a line, regardless of where it's located in that line.Programming with CodesA program is just a set of written instructions given in the order they are to be performed.

Imagine if we could send the machine an “E-Mail” in plain English telling it what we wanted it to do. The program would look something like this:

9

Page 11: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

STEP #1 = SELECT CUTTING TOOLSTEP #2 = TURN THE SPINDLE ON AT A CERTAIN RPMSTEP #3 = TURN THE COOLANT ONSTEP #4 = RAPID TO OUR START POSITIONSTEP #5 = MAKE OUR CUTS AT A CERTAIN FEED RATESTEP #6 = TURN OFF THE SPINDLE AND THE COOLANTSTEP #7 = RETURN TOOL TO HOME AND SELECT NEXT TOOL…and so on.But our machine control only understands these messages when given in machine code.Why do we use G&M Code and not a different language (English for example)?CNC Machines were first built in the 1940’s and 50’s with the invention of computers. They were custom built, and several companies were trying to come to market with the first consumer available NC machine tools.It was the early 60’s before CNC machines became commercially available, and not only was the machine invented, so was the computer, and the software to run the computer. These first computers were limited and didn’t have enough memory to remember an entire language such as English. So “Code” had to beinvented, and was limited to words that had one letter and two numbers behind it (G00 for Example). Several inventors came out with machine and controls in the early days, and each one had to invent their own “code”. Soon there were several brands and several different kinds of code. This is when the ISO (International Standards Organization) said they were going to set a “Standard” code. They went with the code that was by far the most popular at the time, FANUC. This is why it is also referred to as “Fanuc G Code”The basics of this code remain the same to this day. Things get added from time to time, and it just adds new codes to the end of the G-Code list.The first G-Codes were G00, G01, G02, and G03. They were established in the50’s. As a new need for a new machine “mode” is invented, new G-Codes will get added on to the list.

Why do we stick with the code since technology has come so far? Standardization and Familiarity,

10

Page 12: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Operators and programmers trained on one machine can move to another brand, control, shop, etc… and with a little familiarization can get up to speed quickly.

Companies can share programs.

Program StructureCharacter: A single alphanumeric character value or the “+” and “-“ sign.

Word: A series of characters defining a single command such as “X” movement or “F” Feed rate.

Block: Series of words defining a single instruction. An instruction may consist of a single linear or circular motion, plus additional information such as a feed rate or stop command. A block of code is on one single line. After each block we need to end the block with a semi-colon (;). On the operator’s panel, the EOB key (End of Block) will generate this symbol. This is how the machine tells one line of code from the next.

Positive Signs: X, Z, positive moves do not need a positive sign. If the number value is negative, it must be programmed with a minus (-) sign.

Leading Zero’s: There is no need to program zero’s proceeding a number.

Example: G00 (G0) and M01 (M1).

Trailing zeros however must be programmed.Example: M30 not M3, G70 or G7.

Program Format.

There are NO positional requirements for a line CNC code. That means the different codes in a program may be in any order on a line of code.

However some standard rules are followed, so the code is easier to view.

11

Page 13: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

It will also make it easier for the machinist to understand when he runs the part if the program has a standard level of organization.

Some standard rules are followed: X and Z values are positioned in alphabetical order and grouped together. G and M codes may be placed anywhere on a line but convention is that the G

codes come first and the M codes come at the end of the block. This makes sense as the last thing to happen on a line is the M function.

On Haas machines only one M code is allowed on a block of code. Command codes are first given by a letter then a number. Some codes like X,Z

and F require decimal points. Others like S and G require a number with no fractional part.

ABSOLUTE & INCREMENTAL POSITIONING.In absolute positioning, all coordinate positions are given with regard to their relationship to a fixed zero, origin point, that is referred to as part zero. This is the most common type of positioning.Another type of positioning is called incremental positioning. Incremental positioning concerns itself with distance and direction from the last position. A new coordinate is entered in terms of its relationship to the previous position, and not from a fixed zero

12

Page 14: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

or origin. In other words, after a block of information has been executed, the position that the tool is now at is the new zero point for the next move to be made.

G90 ABSOLUTE POSITION COMMAND

When using a G90 absolute position command, each dimension or move is referenced from a fixed point, known as ABSOLUTE ZERO (part zero). Absolute zero is usually set at the corner edge of a part, or at the centre of a square or round part, or an existing bore. ABSOLUTE ZERO is where the dimensions of a part program are defined from.

G91 INCREMENTAL POSITION COMMAND

This code is modal and changes the way axis motion commands are interpreted. G91 makes all subsequent commands incremental.

Incremental dimensions are referenced from one point to another. This can be a convenient way to input dimensions into a program (especially for G81-G89, G73, G74, and G77 canned cycles) depending on the drawing.

When using a G91 incremental position command, each measurement or move is the actual distance to the next location (whether it is a hole location, end of arc, or end of line) and is always in reference from the current location.

When do we decide which to use?We switch between the two whenever it is more convenient.

Sometimes the drawing doesn’t call out the hole-locations, but will give the distance between the holes.

Example of difference between incremental and absolute programming.

13

Page 15: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Program to move the machine to these 4 hole locations using G90 (Abs.)X 1.0000 Y 1.0000X 9.0000 Y 1.0000X 9.0000 Y 9.0000X 1.0000 Y 9.0000

Program to move the machine to the same 4 hole locations using G91 (Incr.)X 1.0000 Y 1.0000X 8.0000Y 8.0000X -8.0000

Put the points in the above diagram in the above tables.

14

Page 16: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Program Start-Up Lines.

A typical program's first five lines could look like this:

15

G90 AbsoluteP1 X0 Y-2.5P2P3P4P5P6P7P8P9P10

G91 IncrementalP1 X0 Y-2.5P2P3P4P5P6P7P8P9P10

Page 17: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

G00 G17 G40 G49 G80 G90 ;

T1 M06;G00 G90 G54 X0 Y0 S2500 M03;G43 H01 D01 Z50. M08;

The first two lines are safety lines, they will FORCE the machine into what we want it to do. We do not want to assume the machine is already set the way we want it.

G00 G17 G40 G49 G80 G90 (Safety Line)G00 RapidG17 Selects X-Y Work PlaneG40 Cancels Cutter CompG49 Cancels Tool Length OffsetG80 Cancels Canned CycleG90 Absolute

G91 G28 Z0G28 - This preparatory function causes a return to machine zero of all specified axes. If an X, Y or Z are specified, only those axis move incrementally (G91) to machine home.

The next line we want to enter is a tool change. The correct tool may be in the spindle already, and we don’t need to do a tool change to run our part, but the next time we start our program, that tool may not be in the spindle. Force the machine to put the tool we want in the spindle. Never assume it is already there.

16

Page 18: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

T1 M06 T1 Selects tool number one to be loaded into the spindle. M06 Activates the tool change sequence.

The next line or block will contain a rapid command (G00), an absolute or incremental command (G90, G91), a work zero for X and Y (G54), a positioning X and Y coordinate, a spindle speed command (S---), and a spindle ON clockwise command (M03).

G00 G90 G54 X__ Y__ S1200 M03G00 Preparatory function for a Rapid Movement.G90 Activates control to be in ABSOLUTE.G54 Selects work coordinate system No. 1.X__ Axis move to initial “X” position.Y__ Axis move to initial “Y” position.S1200 Informs the control that 1200 has been selected as the RPM for this toolM03 Turns the spindle “ON” in a clockwise direction at a speed of 1200 RPM.

The next line will contain a "read tool length compensation" command (G43); a tool length offset number (H0l ), a Z-axis positioning move (Z50.), and an optional coolant ON command (M08).G43 H01 Z50. M08

G43 Activates the tool length stored in the “H” code offset number.H01 Informs control as to what the stored offset value is.Z50. Informs the control to move from full spindle retract to this “Z” value and apply the tool length offset.M08 Turns the coolant “ON.

Cutter Compensation.Cutter compensation is used to offset the centre of the cutter, and shift it the distance of the radius, to the specified side of the programmed path. Cutter

17

Page 19: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

compensation involves programming the part geometry directly instead of the tool centre. The cutter compensation commands are

Cutter Comp. Left (G41), Cutter Comp Right (G42) Cutter Comp Cancel (G40)

G40 Cutter Comp CancelG40 will cancel the G41 or G42 cutter compensation commands. A tool using cutter compensation will change from a compensated position to an uncompensated position. Be sure to cancel cutter compensation, when you're done with each milling cut series that's using compensation.G41 Cutter Compensation LeftG41 will select cutter compensation left; that is the tool is moved to the left of the programmed path to compensate for the radius of the tool. A "D" must also be programmed to select the correct tool size from the DIAMETER/RADIUS offset display register.G42 Cutter Compensation RightG42 will select cutter compensation right; that is the tool is moved to the right of the programmed path to compensate for the size of the tool. A "D" must also be programmed to select the correct tool size from the DIAMETER/RADIUS offset display register.D - Cutter Comp value - The actual offset amount must be input in the specified tool offset display number in the machine control. You have one cutter offset for each tool, and it is best to use the same offset number as is the tool number.

Advantages of Cutter Compensation.

18

Page 20: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

1. The mathematical computations for determining a tool path are greatly simplified.

2. Because the geometry and not the tool centre is programmed, the same program can be used for a variety of different cutter diameters.

3. When using cutter compensation you are then able to control and adjust for part dimensions using your cutter diameter/radius offsets register.

4. The same program path can be used for the roughing passes as well as finishing cuts by using different cutter offset numbers.

Some Restrictions With Cutter Compensation.1. A cutter compensation command (G41, G42 or G40) must be on the same

block with an X and/or Y linear command when moving onto or off of the part using cutter comp.

2. You cannot turn on or off cutter compensation with a Z axis move.3. You cannot turn ON or OFF cutter compensation in a G02 or G03 circular move,

it must be in a linear G00 or G01 straight line move.

When Activating Cutter Compensation, Care Must Be Taken To:1. Select a clearance point, without cutter compensation, to a start point in the X

and Y axis at least half the cutter diameter off the part before you start initiating cutter compensation.

2. Bring the Z axis down without cutter compensation in effect.3. Make an X and/or Y axis move with a G41 or G42 call-out on the same line,

with a diameter offset "D" command, which has the cutter diameter value in the offset display register being used.

When Deactivating Cutter Compensation, Care Must Be Taken To:1. Select a clearance point in X and/or Y axis, at least half the cutter diameter off

the part to move to when the cutting pass has finished.2. Do not cancel cutter compensation on any line that is still cutting the part.

19

Page 21: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

3. Important, make sure it is cancelled before taking cutter home or moving cutter to another part of job in rapid or up in Z.

** If forgotten can cause crashes**

G81 DRILL CANNED CYCLE (G81G99Z-12.R2.F150; - Programme line example)

X * Rapid X-axis locationY * Rapid Y-axis locationZ Z-depth (feed to Z-depth starting from R plane)R R-plane (rapid point to start feeding)F Feed rate in inches (mm) per minute* Indicates optional

This G code is modal so that it is activated every X and/or Y axis move, and it will rapid to that position and then cause this canned cycle to be executed again, until it's cancelled. Use G98 and G99 for the Z position clearance location for positioning between holes.

G83 DEEP HOLE PECK DRILL CANNED CYCLE(G83G99Z-12.R2.Q3.F150; - Programme line example)

X * Rapid X-axis location

20

Page 22: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Y * Rapid Y-axis locationZ Z-depth (feed to Z-depth starting from R plane)Q* Pecking equal incremental depth amount (if I, J and K are not used)I* Size of first peck depth (if Q is not used)J* Amount reducing each peck after first peck depth (if Q is not used)K * Minimum peck depth (if Q is not used)P Dwell time at Z-depthR R-plane (rapid point to start feeding)F Feed rate in inches (mm) per minute* Indicates optional

This G code is modal so that it is activated every X and/or Y axis move, and it will rapid to that position and then cause this canned cycle to be executed again, until it's cancelled. The depth for each peck in this cycle will be the amount defined with Q. Then the tool will rapid up to the R plane after each peck and then back in for the next peck until Z depth is reached. Use G98 and G99 for the Z position clearance location for positioning between holes.

G84 TAPPING CANNED CYCLE(G84G99Z-12.R2.F150; - Programme line example)

X* Rapid X-axis location

21

Page 23: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Y* Rapid Y-axis locationZ Z-depth (tapping Z-depth starting from R plane)J* Tapping Retract Speed R R-plane (rapid point to start feeding)F Feed rate in inches (mm) per minute* Indicates optional

You don't need to start the spindle with a M03 for a tap that's using G84 because this cycle will turn on the spindle for you automatically and it will do it quicker.

This G code is modal. Use G98 and G99 for the Z position clearance location. With Rigid Tapping, the ratio between feedrate and spindle speed must be

calculated for thread pitch being cut.

The calculation is pitch x rpm = tapping feedrate. • M10 x 1.5 tap at 200rpm = F300 for example (200 x 1.5 = 300)

Part program to mill the profile below (plate is 4mm thick);

22

Page 24: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

With Cutter Comp,T1M06 (10mm Dia Endmill); GOG90G54X-10.Y-10.S2000M03; G43H01D01Z50.M08;Z2.;G01Z-5.F1000;G1G41X0F500;Y80.;X160.;Y0;X-10.;G40Y-10.;GOG90Z50.M09;G91G28Z0M05;M30;

To add 4 12mm holes;

23

Page 25: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

T2M06 (Centre drill / spot drill); GOG90G54X25.Y25.S1200M03; G43H02Z50.M08;G81G99Z-2.R2.F150;Y55.;X135.;Y25.;GOG80G90Z50.M09;G91G28Z0M05;M01;M30;

T3M06 (12mm drill); GOG90G54X25.Y25.S1700M03; G43H03Z50.M08;G81G99Z-7.R2.F150;Y55.;X135.;Y25.;GOG80G90Z50.M09;G91G28Z0M05;M01;M30;

To mill profile with radii and chamfer;

T1M06 (10mm Dia Endmill);

24

Page 26: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

GOG90G54X-10.Y-10.S2000M03; G43H01D01Z50.M08;Z2.;G01Z-5.F1000;G1G41X0F500;Y60.;G02X20.Y80.R20.;G01X140.;G02X160.Y60.R20.;G1Y10.;X150.Y0;X-10.;G40Y-10.;GOG90Z50.M09;G91G28Z0M05;M01;M30;

T1M06 (10mm Dia Endmill); GOG90G54X-10.Y-10.S2000M03; G43H01D01Z50.M08;

25

Page 27: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Z2.;G01Z-5.F1000;G1G41X0F500;Y60.;G02X20.Y80.R20.;G01X140.;G02X160.Y60.R20.;G1Y10.;X150.Y0;X-10.;G40Y-10.;GOG90Z50.M09;G91G28Z0M05;M01;

T2M06 (Centre drill / spot drill); GOG90G54X25.Y25.S1200M03; G43H02Z50.M08;G81G99Z-2.R2.F150;Y55.;X135.;Y25.;GOG80G90Z50.M09;G91G28Z0M05;M01;

T3M06 (12mm drill); GOG90G54X25.Y25.S1700M03; G43H03Z50.M08;G81G99Z-7.R2.F150;Y55.;X135.;Y25.;GOG80G90Z50.M09;G91G28Z0M05;M30;

Create a program for the item below, use cutter comp and assume the top face / thickness has been milled to size;

26

Layout of final program showing typical CNC program layout.

Good practice to:

Leave space between individual tools,

Label tools where possible, Use M01 at end of each tool, Use X,Y,Z in that order, Put M codes at end of line, Put decimal point after every co-

ordinate, even if whole number,

Page 28: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Create a program for the item below, use cutter comp and assume the top face / thickness has been milled to size;

27

Page 29: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

Create a program for the item below, use cutter comp, mill the top face.

28

Page 30: CNC Milling programming  · Web viewAll milling machines contain hazards from rotating parts, belts and pulleys, high voltage electricity, noise, and compressed air. When using CNC

3 Holes drilled 8mm dia thru

Tools to be used:

T1 80mm face mill T2 10mm dia end mill T3 Spot drill T4 8mm drill

Create a program for the item below, use cutter comp, mill the top face.

29