0% found this document useful (0 votes)
14 views13 pages

CNC Machine Programming Guide

This document deals with CNC machine programming. It explains the procedure for manufacturing a part on a CNC machine, including planning, cutting parameter calculations, the structure of a CNC program, and common programming codes such as G, M, S, and T. It also covers topics like operation sheets, tool requirements, and canned cycles. The aim is to provide a comprehensive guide on how to program a CNC machine for part manufacturing.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views13 pages

CNC Machine Programming Guide

This document deals with CNC machine programming. It explains the procedure for manufacturing a part on a CNC machine, including planning, cutting parameter calculations, the structure of a CNC program, and common programming codes such as G, M, S, and T. It also covers topics like operation sheets, tool requirements, and canned cycles. The aim is to provide a comprehensive guide on how to program a CNC machine for part manufacturing.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TECHNOLOGICAL INSTITUTE

SUPERIOR OF MISANTLA

Engineering. Electromechanics

INTEGRATED SYSTEMS OF
MANUFACTURE

ING. ROBERTO CARLOS CABRERA JIMENEZ


CNC MACHINE PROGRAMMING
UNIT 2:
RESEARCH

Jose Roberto Campos Gonzalez

MISANTLA, VER. JUNE 30, 20014


Content
2.1. PROCEDURE FOR THE MANUFACTURE OF A PART ON A CNC MACHINE............... 2
2.2 CALCULATION OF CUTTING PARAMETERS............................................................................ 5
2.3. STRUCTURE FROM A CNC PROGRAM.................................................................................... 6
2.4. G CODES OF PROGRAMMINGN .7
2.5 CODES M, S, T, and F.
2.7 SUBROUTINE CODES .......................................................................................................... 11
2.8 CANNED CYCLES
2.1. PROCEDURE FOR THE MANUFACTURE OF A PART ON A CNC MACHINE.

Machine Programming

Program Planning

Reading Plans. Reading blueprints is a basic skill in the industry.


manufacturing, something that all engineers, managers, programmers, and CNC operators,
drivers and inspectors should know.

Choice of the Right Machine. The choice of an appropriate machine for a specific piece to
being manufactured is usually the responsibility of the production manager, the manager of the
machine shop, and / or the CNC manager. The manager must know:

The environment of each machine (work area)


2. The options of each machine (milling, drilling, etc.)
3. Cutting tools, rotational speeds, feed cups.
4. Design and assembly of fixtures.
5. Machine operations: Adjustment, installation, and execution of programs.

Operations sheet. The operations sheet, or installation sheet, is used to describe the
necessary processes to machine a part on a CNC machine. Each process is written in the
appropriate sequence of machining and includes the tool to be used and all cutting data.

The programming of the outer contour is an operation in the machining of a piece. To do


First, a source of the piece must be defined. Then, the required points for the
Machinations must be calculated for the center of the tool to be used, considering the radius.
from the tool, from the edge coordinates of the piece.

Operations Sheet

Operations Sheet
Machine: Electro -LI2 Workpiece: plate-1 Juanito
Pérez 1/7/2004

Step # Description Tool Rate of Depth Speed of


nutrition of Court (" ) Revolutions per minute (r.p.m.)
# /minute

1 Basic milling of the 1 25 0.5 500


plate

2 Final milling of the 2 12 0.5 750


plate

3 Center to drill 4 3 15 0.125 2500


holes

4 Drill 4 holes 4 12 0.75 1000


Tool Requirements. The requirements and selection of tools are based on
restrictions on parts and practices in the manufacturing industry. Many of these ideas are
matters of common sense. Good programmers and CNC operators must have them.
account.
Know the characteristics of the material to be machined.
Use a typical industrial tools catalog to reduce costs.
Make use of the technical services offered by tool manufacturers.
The quality of the fixation should be based on the number of pieces that will eventually be produced.
The right tool must always be used for the correct operation of the machine.
Keep replacement and spare tools in case it is necessary to sharpen one.
tool or if the tool breaks.
Keep a variety of tools in case a type does not perform the work as desired.
Use high-speed steel tools on easily machinable materials.
Use carbon tools on hard-to-cut materials.
Use tools with cobalt or oxide coating for exotic alloys.
Use insertion-type tools whenever possible to reduce costs.
Consider the use of reamers instead of drills in applications with a drill where the chip and
piece control can be a problem.
Please note the bending that occurs when using long tools. Multiple passes may be needed.
extras to eliminate scratches and chips.
2.2 CALCULATION OF CUTTING PARAMETERS
Data and Cutting Formulas.

Most common terms used to express cutoff data:


Axis Speed - it is the rotational speed of the axis and the tool. This value is expressed
normally in RPM (revolutions per minute).
Value of the Feeding Rate - it is the numerical value at which the tool will move a piece of
work. It is usually expressed in IPM (inches per minute) or IPR (inches per revolution).
Cutting Speed - the cutting speed is the rotational speed of the cutting tool or of the
workpiece. It is expressed in RPM or in SFM (Surface Feet per Minute).
Cut Depth - it is the distance that the tip of the tool penetrates into the workpiece
work. It incorporates the values X, Y, Z in a CNC program. Apart from the program, it can
expressed in inches or millimeters.
The calculation of the cutoff data is a very important step in the planning of a CNC program.
Below are some of the most common formulas.

• S.F.M = R.P.M. x Diameter x .262

Example: Find SFM of a 1" tool at 600RPM

SFM = RPM x 1 x 0.262

SFM = 600 x 1 x .262. SFM = 157.2

• R.P.M. = S.F.M. x 3.82 / Diameter

Example: Find the RPM of a 1" tool at 150 SFM.

RPM = SFM x 3.82 / Diameter

150 x 3.82 / 1. RPM = 573

• I.P.M. = R.P.M x T x F.P.T.

Example: Find the IPM value of a 1" drill at 500

RPM and with a value of FPT = 0.006. IPM = 500 x 1 x .006

3.0

• I.P.M. / R.P.M.

Example: Find the FPR value (in inches) of a cutter that advances at 200 RPM and with a value
IPM = 22.

FPR = 22 / 200. FPR = .11

• I.P.M. / T x R.P.M.

Example: Find the FPT value (feed per tooth, in inches) for a 4-flute end mill.
and of 2" that advances at 200 RPM and with an IPM value = 20. FPT = 20 / 4 x 200 FPT = .025
2.3. STRUCTURE OF A CNC PROGRAM
Sequence numbers or block numbers with the letter N are generally used.
In editing the program, they can be numbered in batches of 10, in batches of 5, in batches of 2, in case it is
it is necessary to insert programming blocks between this. In CNC lathe programming,
necessary when programming the turning cycles. The counting of the number of blocks goes up to
N 9999 and will continue with N0000 a new count if necessary. A symbol / is used when
needs certain programming blocks to have the possibility to execute or not
According to the needs. If the Block delete or block skip button is activated on the control panel, the
control does not execute programming blocks that start with the symbol / in this case no
I would execute block N10.

After the block number, the instruction codes G, M, F, S, T, X, Z are programmed, with which
You can activate several functions but only perform one movement for each block of
programming closed by the symbol * or by (;).

The structure of the program ends with the code M30 (end of program).

O1245 (PROGRAM STRUCTURE) *

N05 T0000 G40 G21 G97

/ N10 G28 U0 W0 *

N20 G54 *

N30 T0101 (CENTER DRILL)

N40 G0 X80. Z5. M4 S1200 *

N50 G1 Z-2. F0.12 M8 *

N60 G0 X81. Z2.

“ “ “

“ “ “

“ “ “

N250 M30 *
It is important to highlight that the description of some G and M codes may vary from one manufacturer to another.
from controls to another depending on the standard they work with, whether it's ISO or DIN standard, etc.
Above all, some M codes are assigned differently by each machine manufacturer.
CNC according to the options included in the machine.
The numerical control program must be introduced to the control system in such a way that it understands it.
The program consists of a sequence of blocks. Each block can contain several of the
following characters, accompanied by a code or value.

N: Block number.

G: Preparatory functions.

Axis quotas.

Headstock rotation speed.

Tool number.

Auxiliary function.

The construction of a block must be done following the order outlined, containing only
the new information.

At the end of the block, it is possible to write a comment that must be in parentheses. The number
maximum number of characters, including parentheses, is 43. The comment appears during execution
of the program and intermittently if the first character within the parentheses is an asterisk (*
An empty comment ( ), cancels the display of a previous one.

2.4. G CODES OF PROGRAMMING


ISO PROGRAMMING LANGUAGE

For the programming of the controls, ISO has standardized the programming language for
CNC machinery, apart from this, the manufacturers of each control design their own language for their
controls that are called conversational language, interactive in graphic form; but a
A programmer who masters the ISO language can manage well with any control, that is because
that we will focus on this programming format.

Like any language, programming language is also made up of words, every word
it means an order that the programmer gives to the control, the programming codes that are handled
they are the following:

G codes: initially created to describe the geometry of the workpiece, if the piece has
straight lines, arcs, etc.

Code M: Miscellaneous or also called auxiliary functions were created primarily to


automate the operational functions, functions that the operator would perform such as: turning on the spindle,
turn on the refrigerant, etc.
General Codes

G00: Rapid positioning (without machining)

G01: Linear interpolation (machining)

G02: Circular interpolation (clockwise)


G03: Circular interpolation (counterclockwise)

G04: Waiting compass

G10: Adjustment of the program offset value

G20: Beginning of the use of imperial units (inches)

G21: Start of use of metric units

G28: Return to the machine home

G32: Machining a thread in one pass

G36: Automatic tool compensation in X

G37: Automatic tool compensation in Z

G40: Cancel tool curvature radius compensation

G41: Tool radius compensation to the left

G42: Tool right curvature radius compensation

G70: Finishing cycle

G71: Machining cycle in turning

G72: Machining cycle in facing

G73: Pattern repetition

G74: Intermittent drilling, with output for chip removal

G76: Machine a thread in multiple passes

G96: Start of roughing at constant tangential speed

G97: End of roughing at constant tangential speed

G98: Feed rate (units/min)

G99: Feed rate (units/revolution)

Miscellaneous Codes

M00: Optional stop

M01: Optional stop


M02: Program reset

M03: Rotate the spindle clockwise

M04: Rotate the spindle counterclockwise

M05: Stop the spindle

M06: Change tool

M07: Open the coolant line B

M08: Open the coolant A passage

M09: Close the refrigerant passage

M10: Open jaws

M11: Close jaws

M13: Turn the spindle clockwise and open the cooling passage

M14: Rotate the spindle counterclockwise and open the coolant flow

M30: End program and set the execution pointer to its start

M31: Increase the parts counter

M37: Stop the spindle and open the guard

M38: Open the guard

M39: Close the guard

M40: Extend the parts feeder

M41: Retract the parts feeder

M43: Notify the conveyor belt to advance

M44: Notify the conveyor belt to reverse

M45: Notify the conveyor belt to stop

M48: Disable Spindle and Feed override (machine exclusively with the speeds)
programmed)

M49: Cancel M48

M62: Activate auxiliary output 1

M63: Activate auxiliary output 2

M64: Disable auxiliary output 1

M65: Deactivate auxiliary output 2


M66: Wait until input 1 is ON

M67: Wait until input 2 is ON

M70: Activate mirror in X

M76: Wait until input 1 is OFF

M77: Wait until input 2 is OFF

M80: Disable the mirror on X

M98: Call to subprogram

M99: Subprogram return

2.5 CODES M, S, T, and F.


Code S: Speed = spindle rotation speed in RPM. If we program S1200, the spindle will rotate at
1200 r.p.m.

Code F: Feed = Machining feed or advance, it is the speed at which it moves.


machine in the machining operation, generally in turning operations the used
machining advance in millimeters per revolution, if we program F0.1 the machine will move in
the machining operation at 0.1 millimeters per revolution or turn of the cup. (mm/rev).

In movements where machining is required without the spindle rotating, the feed is programmed.
machining F in millimeters per minute (in the case of lathes or milling machines with tool
If F80 is programmed, the machine will move at 80 millimeters per minute (mm/min).

Code T: Tool = Work tool, the programming of the tool number is done from
agreement with the operational order of the specific machining of a part, that is, if we are going to thread
a piece, the first tool T0101 will be the center drill, the second tool T0202 will be
the drill, the third tool T0303 the threading tap, and so on.

The first two digits of the T code refer to the tool position number in the
turrent, and the next two to the tool offset corrector. T0000 is programmed.
At the beginning of the program to cancel all the tool compensation that have remained
activated.

Codes X, Z, U, W: These codes are used to designate work coordinates on the lathe.
In a lathe, the X axis (U incremental coordinate X) is the displacement of the cross carriage.
determining the diameters of the workpiece, the Z axis (W incremental coordinate Z) is the
longitudinal displacement of the car, determining the lengths of the piece. In addition to these
codes we can find the C codes, (H incremental coordinate C)) to designate the third
axis, which is generally a rotating axis, used in milling lathes with tool
motorized (also called a living tool). The C axis is the cup that serves as a rotating axis.
indexing in degrees or interpolating with the axes
2.7 SUBROUTINE CODES
Functions G20, G21, G22, G23, G24 (Subroutines)

STANDARD.

PARAMETRICS.

STANDARD SUBROUTINE

A standard subroutine always starts with a block that contains the function G22 (Open
subprogram). N010 G22 N1 ; N1 is the subprogram number.

The subroutine always ends with the G24 function.

N050 G24

The call to a standard subroutine is made with the function G20.

N090 G20 N1.3; In this block the .3 means the number of times we want it to repeat the
subroutine N1.

PARAMETRIC SUBROUTINE

A parametric subroutine always starts with a block that contains the G23 function followed by the
number that identifies the subroutine.

N010 G23 N1

The subroutine always ends with the G24 function.

The call to a parametric subroutine is made with the G21 function followed by some parameters.
that I will explain next. The block format must follow this pattern:

N030 G21 N1.3 P1=K1; P1=K1 are the values assigned to the parameters.

Example of standard subroutine N010 G0 G90 X20 Y20 Z100 S1000 M03

N020 T1.1; Broca of Ø10 mm

N030 M06

N040 G22 N1; Start of subroutine

N050 G0 Z3

N060 G1 Z-10 F30

N070 G4 K1.0

N080 G0 Z100

N090 G24; End of subroutine


N100 G0 X40 Y75

N110 G20 N1.1; Call to subroutine

N120 M05; Head stop

N130 M30

This program makes two drills. The first is done at position X20 Y20 and the second drill
at position X40 Y75.

Example of parametric subroutine

N020 G54

N030 T8.8

N040 M06

N050 G0 G90 X12 Y20 Z10 S1500 M3

N060 G1 Z-1 F30

N070 G23 N3

N080 G1 G91 X P0 Y P1 F50

N090 X P2 Y P3

N100 X P4 Y P5

N110 X P6

N120 G24

N130 G21 N3.1 P0=K15 P1=K30 P2=K15 P3=K-30 P4=K-30 P5=K0 P6=K0

N140 G0 G90 Z100

N145 X52 Y20

N150 Z10

N160 G1 Z-1 F30

N170 G21 N3.1 P0=K0 P1=K30 P2=K30 P3=K0 P4=K0 P5=K-30 P6=K-30

N180 G0 G90 Z100

N190 M30

This program machines a triangle and a square. To do this, it will be enough to modify the parameters.
to create either a triangle or a square. We always use the same
program, that is, the subroutine N3, along with the different parameters.
It is a simple example in parametrics. In any case, it will be explored further later on.
parametric programming.

2.8 CANNED CYCLES


Just like the canned turning cycles, milling also uses cycles with the same
features with the purpose of avoiding the repetition of codes in the machining of a part
which requires several cuts. Below are some codes of this type used in the
Triac machining center.

a) Canned drilling cycle. It is used for the manufacture of holes in the triac.

Syntax G73 G99 X10 Y10 Z-20 Q3 R2 F2000

Where:

G73 Canned drilling cycle.

G99 Tool return point.

X10 Tool position on the X axis.

Y10 Tool position on the Y axis.

Z10 Drilling depth.

Q3 Cutting depth value.

R2 Value of the tool's retracement.

F Value of the advance speed.

You might also like