Escolar Documentos
Profissional Documentos
Cultura Documentos
CNC PROGRAMMING
SECRETS REVEALED
“Author holds a degree in CNC Engineering and have been proudly working with
CNC programming, operating, setting and supervising CNC teams for decades. He
is bringing directly real world of International CNC machining experience into his
courses. This is not just another theoretic E-book, it is rather book written on
basis of many years of real CNC experience from machining of metal, plastics,
seal manufacturing… and managing CNC programming teams in automotive mass
production environments. It makes his courses so popular. If you work around
CNC machines, you will find this course very useful and will help you to get
comfortable very quickly with real problems in everyday programming and
practical applications. Ross’s courses are available on www.cnc-academy.com -
and you are able to order or download it from the comfort of your own home or
office!”
“CNC Machining News”
Thank you and congratulations!
Thank You for buying the “CNC Programming-Secrets revealed” CNC Course, and
congratulations, for taking a positive step towards your future as an CNC
Programmer, CNC Setter, CNC Operator...
The purpose of this E book is to show and teach how you can use newest CNC
technology tools to improve productivity, efficiency, and at the same time to
improve your life. We are in an “Information age” and when people want
information about new technology, they want it RIGHT NOW. So this is an easy
and affordable way to achieve your goals with lower costs and shorter time to
develop required skills. This is one of the most recession-proof jobs in the
industry today. Highly skilled computer numerical control personnel can expect to
earn an excellent salary.
2
Polar coordinates,……………………………………………………………………………………….24
Motion types,……………………………………………………………………………………………….25
G - codes (preparatory function),……………………………………………………………..25
M - codes (miscellaneous function),…………………………………………………………..28
Absolute command (G90),………………………………………………………………………...30
Incremental command (G91),…………………………………………………………………….31
Understanding of interpolation,…………………………………………………………………..32
Rapid motion (G00),…………………………………………………………......................33
Linear interpolation - Feeding (G01),………………………………………………………..33
Feed rate (F function),………………………………………………………………………………..33
Circular interpolation - circular motion (G02 and G03),……………………………33
Difference between R & I,J,K……………………………………………………………………..35
Other interpolation types, ………………………………………………………………………...37
Program zero, workpiece zero – positions of zero points,………………………..39
Z axis zero……………………………………………………………………..........................40
Metric/Imperial dimensions G70, G71, G700, G710,………………………………..40
4. TOOL OFFSETS…………………………………………………………40
What are offsets,…………………………………………………………………………………………40
Why we need offsets……………………………………………………………………………………40
Organizing offsets………………………………………………………………………………………..41
Types of compensation,……………………………………………………...………………………41
Tool length compensation) - G43 (machining centres),…………………………….42
Tool offset measuring sample……………………………………………………………………..44
How to consider tool length compensation………………………………………………….45
Cutter radius compensation G40-G42 (machining centres),………………… ….46
Reasons for cutter radius compensation,…………………………………………………….46
How to program cutter radius compensation, example,…………………………….47
Setting tool offsets………………………………………………………………………………………49
Dimensional tool (wear) offsets,…………………………………………………………………51
Tool nose radius compensation,………………………………………………………………….51
Other types of compensation……………………………………………………………………...52
5. LANGUAGE ELEMENTS OF PROGRAMMING LANGUAGE..53
Address, Data, Word, Block, Sequence, Program №,………………………………..53
Types of programs……………………………………………………………………………………….54
6. PROGRAM FORMATING……………………………………..…….55
Reasons to format CNC programs ………………………………………………………………55
Types of program format (program start-up, tool ending, tool start-up, and
program ending),……………………………………………………………………………………..55
Program configuration, structure and contents of an CNC program,………..56
7. LET’S START WRITING CNC PROGRAMS…………………….57
Prepare the work piece drawing,………………………………………………………………..57
Steps to prepare (mark up print, machining process, calculate coordinates,
select tooling, plan setup), ……………………………………………………………………57
Define machining sequences,………………………………………………….………………….57
Create a machining plan,…………………………………………………………………………….57
Translate the work steps into the machining language,…………………………….58
Combine all individual steps in a program,………………………………………………..58
Simple programming examples,………………………………………………………………….60
Program sample for circular arc………………………………………………………………….61
Program sample for machining a groove,…………………………………………………..63
CNC programs with three types of motion,………………………………………………..63
Typical mistakes………………………………..………………………………………………………..65
CNC program examples……………………………………………………………………………...66
8. SPECIAL PROGRAMMING FEATURES………………………..83
Canned cycles,…………………………………………………………………………………………….85
G73 –G89……………………………………………………………………………………………………..87
3
Grinding cycles…………………………………………………………………………………………..110
Constant surface speed control………………………………………………………………...115
Probe tips…………………………………………………………………………………………………...117
Geometric dimensioning an tolerancing…………………………………………………....118
After Word………………………………………………………………...122
Prerequisites
We assume students enrolling in these classes currently possess certain basic
machining practice skills, including the ability to read and interpret drawings, the
ability to interpret tolerances, the ability to use shop tools and measuring
devices, and the ability to perform arithmetic calculations.
Target group
This CNC programming course is aimed at tool machine users, CNC beginners,
skilled machine operators with the appropriate expertise in drilling, milling and
turning operations. It contains all the necessary information on how to
successfully make CNC programs for lathes and machining centres. Theoretic part
of the course is particularly helpful for NC beginners. Fanuc is the control of
choice in most shops in the World today we will learn their system and you will
have the best chance for a good job. That knowledge can be easily applied on
other CNC controls like Siemens, Heidenhain, Fadal…
Introduction
There is quite a shortage of skilled people to utilize CNC machines, more
and more skilled machinists jobs, require CNC knowledge. And the shortage
worldwide is growing. Everywhere we can hear manufacturing people claiming
that they cannot find skilled people. So you can make a good wage and develop
a rewarding career working with CNC machines. So, learn the skills you need for
a better paying job.
Here are some of the job titles of people working with CNC machine tools and job
opportunities related to CNC:
With knowing CNC you will be able to work for manufacturing companies
as:
4
CNC programmers
CAD-CAM system programmers
CNC maintenance personnel working for companies that sell CNC machines
CNC service technicians
CNC applications engineers
CNC school instructors
CNC instructors…
5
The Basics of Computer Numerical Control
WHAT IS CNC?
CNC meaning: Computer Numerical Control and has been around since the early
1970's. Prior to this, it was called NC, for Numerical Control. (At the beginning
1970's computers were introduced to these controls, hence the name change.)
While people in most walks of life have never heard of this term, CNC is widely
used in almost every form of manufacturing process in one way or another. If
you'll be working in manufacturing, it's likely that you'll be dealing with CNC on a
regular everyday basis.
History before CNC?
While there are exceptions to this statement, CNC machines typically replace (or
work together with) some existing manufacturing process/as. Take one of the
simplest manufacturing processes, drilling holes, for example.
A drill press can of course be used to machine holes. (It's likely that almost
everyone has seen some form of drill, even if you don't work in manufacturing.) A
person can place a drill in the drill chuck that is secured in the spindle of the drill
press. They can then (manually) select the desired speed for rotation (commonly
by switching belt pulleys), and activate the spindle. Then they manually pull on
the quill lever to drive the drill into the workpiece being machined.
As you can easily see, there is a lot of manual intervention required to use a drill
press to drill holes. A person is required to do something almost every step along
the way! While this manual application may be acceptable for manufacturing
companies if but a small number of holes or workpieces must be machined, as
quantities grow, so does the likelihood for fatigue due to the repetitiveness of the
operation. And do note that we've used one of the simplest machining operations
(drilling) for our example. There are more complicated machining operations that
would require a much higher skill level (and increase the potential for mistakes
resulting in scrap workpieces) of the person running the conventional machine
tool. (We commonly refer to the style of machine that CNC is replacing as the
conventional machine.)
By comparison, the CNC equivalent for a drill press (possibly a CNC machining
centre or CNC drilling & tapping centre) can be programmed to perform this
operation in a much more automatic fashion. Everything that the drill press
operator was doing manually will now be done by the CNC machine, including:
placing the drill in the spindle, activating the spindle, positioning the workpiece
under the drill, machining the hole, and turning off the spindle.
How CNC works?
We have another Course available on Internet that explains how to program,
setup, and operate CNC machines in greater detail. Additionally, we offer a series
of products aimed at helping you learn how to properly use CNC machines. Here
we're relating how CNC works in very general terms.
As you already have some experience with different machinery you can guess
that everything that an operator would be required to do with conventional
machine tools is programmable with CNC machines. Once the machine is set
up and running, a CNC machine is quite simple to keep running, and it is
an easy job for somebody who previously worked hard on conventional
machines. In fact CNC operators tend to get quite bored during lengthy
production runs because there is so little to do. With some CNC machines,
even the workpiece loading process has been automated. CNC operators are
commonly required to do other things related to the CNC operation like
measuring workpieces and making adjustments to keep the CNC machine running
good quality workpieces.)
Let's look at some of the specific programmable functions.
Motion control and axes
6
All CNC machine types and CNC controls share this commonality: They all have
two or more programmable directions of motion called axes. An axis of motion
can be linear (along a straight line) or rotary (along a circular path). One of the
first specifications that imply a CNC machine's complexity is how many axes it
has. Generally speaking, the more axes, the more complex the machine.
The axes of any CNC machine are required for the purpose of causing the motions
needed for the manufacturing process. In the drilling example, these (3) axis
would position the tool over the hole to be machined (in two axes) and machine
the hole (with the third axis). Axes are named with letters. Common linear axis
names are X, Y, and Z. Common rotary axis names are A, B, and C.
7
Once the program is developed (either manually or with a CAM system), it must
be loaded into the CNC control. Though the setup person could type the program
right into the control, this would be like using the CNC machine as a very
expensive typewriter. If the CNC program is developed with the help of a CAM
system, then it is already in the form of a text file. If the program is written
manually, it can be typed into any computer using a common word processor
(though most companies use a special CNC text editor for this purpose). Either
way, the program is in the form of a text file that can be transferred right into the
CNC machine. A distributive numerical control (DNC) system is used for this
purpose.
A DNC system is nothing more than a computer that is networked with one or
more CNC machines. Until only recently, rather crude serial communications
protocol (RS-232c) had to be used for transferring programs. Newer controls
have more current communications capabilities and can be networked in more
conventional ways (Ethernet, etc.). Regardless of methods, the CNC program
must of course be loaded into the CNC machine before it can be run.
Types of CNC machines
As we said before, CNC has touched almost every segment of manufacturing.
Many machining processes have been improved and enhanced through the use of
CNC. Let's look at some of the specific fields and place the emphasis on the
manufacturing processes enhanced by CNC machine usage:
In the metal removal industry:
Machining processes that have traditionally been done on conventional machine
tools that are possible (and in some cases improved) with CNC machining centres
include all kinds of milling (face milling, contour milling, slot milling, etc.), drilling,
tapping, reaming, boring, grinding and counter boring.
In similar fashion, all kinds of turning operations like facing, boring, turning,
grooving, grinding, and threading are done on CNC turning centres.
There are all kinds of special "off-shoots" of these two machine types including
CNC milling machines, CNC drill and tap centres, and CNC lathes.
Grinding operations of all kinds like outside diameter (OD) grinding and internal
diameter (ID) grinding are also being done on CNC grinders. CNC has even
opened up a new technology when it comes to grinding. Contour grinding
(grinding a contour in a similar fashion to turning), which was previously
infeasible due to technology constraints is now possible (almost commonplace)
with CNC grinders.
In the metal fabrication industry:
In manufacturing terms, fabrication commonly refers to operations that are
performed on relatively thin plates. For example take cisterns... All of the primary
components are made of steel sheets. These sheets are sheared to size, holes are
punched in appropriate places, and the sheets are bent (formed) to their final
shapes. Again, operations commonly described as fabrication operations include
shearing, flame or plasma cutting, punching, laser cutting, forming, and welding.
Truly, CNC is heavily involved in almost every facet of fabrication.
CNC back gages are commonly used with shearing machines to control the length
of the plate being sheared. CNC lasers and CNC plasma cutters are also used to
bring plates to their final shapes. CNC turret punch presses can hold a variety of
punch-and-die combinations and punch holes in all shapes and sizes through
plates. CNC press brakes are used to bend the plates into their final shapes.
In the electrical discharge machining industry:
Electrical discharge machining (EDM) is the process of removing metal through
the use of electrical sparks which burn away the metal. CNC EDM comes in two
forms, vertical EDM and Wire EDM. Vertical EDM requires the use of an electrode
(commonly machined on a CNC machining centre) that is of the shape of the
cavity to be machined into the workpiece. Picture the shape of a plastic bottle
that must be machined into a mould. Wire EDM is commonly used to make punch
and die combinations for dies sets used in the fabrication industry. EDM is one of
8
the less known CNC operations because it is so closely related to making tooling
used with other manufacturing processes.
In the woodworking industry
As in the metal removal industry, CNC machines are heavily used in woodworking
shops. Operations include routing (similar to milling) and drilling. Many
woodworking machining centres are available that can hold several tools and
perform several operations on the workpiece being machined.
Other types of CNC machines
Many forms of lettering and engraving systems use CNC technology. Water jet
machining uses a high pressure water jet stream to cut through plates of
material. CNC is even used in the manufacturing of many electrical components.
For example, there are CNC coil winders, and CNC terminal location and soldering
machines.
9
be like trying to learn how to fly an airplane without understanding the basics of
aerodynamics and flight. Just as a beginning pilot will be in for a great number of
problems without understanding aerodynamics, so is the beginning CNC user
have difficulty learning how to utilize CNC equipment without an understanding of
basic machining practice.
Machine components
While you do not have to be a machine designer to work with CNC equipment, it
is important to know how your CNC machine is constructed. Understanding your
machine's construction will help you to gauge the limits of what is possible with
your machine. Just as the race car driver should understand the basics of
suspension systems, breaking systems, and the workings of internal combustion
engines (among other things) in order to get the most out of a given car, so must
the CNC programmer understand the basic workings of the CNC machine in order
to get the most from the CNC machine tool.
For a universal style slant bed turning centre, for example, the programmer
should know the most basic machine components, including bed, way system,
headstock & spindle, turret construction, tailstock, and work holding device.
Information regarding the machine's construction including assembly drawings is
usually published right in the machine tool builder's manual. As you read the
machine tool builder's manual, here are some of the machine capacity and
construction questions to which you should find answers.
10
What way construction does the machine incorporates (usually square ways,
dovetail, and/or linear bearing ways)?
What is the machine's rapid rate (fastest traverse rate)?
What is the machine's fastest cutting feedrate?
These are but a few of the questions you should be asking yourself as you begin
working with any new CNC machine. Truly, the more you know about your
machine's capacity and construction, the easier it will be to get comfortable with
the machine.
An "S" word is used to specify the spindle speed (in RPM for machining centres).
An M03 is used to turn the spindle on in a clockwise (CW, forward) manner. M04
turns the spindle on in a counter clockwise (CCW) manner. M05 turns the spindle
off. Note that turning centres also have a feature called constant surface speed
which allows spindle speed to also be specified in surface feet per minute (or
11
meters per minute). It calculates spindle speed so the surface speed is kept as
specified with a tool position change. It then supplies a voltage, corresponding to
the calculated spindle speed, to the spindle control to rotate the spindle at the
correct surface speed when the surface speed is specified after S.
Coolant control
Many machining operations require coolant for lubrication and cooling purposes.
Coolant can be turned on and off from within the machine cycle.
M08 is used to turn ON flood coolant. If available M07 is used to turn ON mist
coolant. M09 turns OFF the coolant.
12
move the X axis to a position of 3.5 inches from the program zero point in X
(assuming the absolute mode of programming is used.
Diagram above shows how it is look like complete process, when we have to
machine a part on CNC machine tool. In first place programmer has to read and
understand drawings, what is required to be machined. Secondly, programmer
has to prepare and make CNC program based on that drawing. That is why we
are here, to learn how to make good economically productive CNC program. We
assume students taking this course currently possess certain basic machining
practice skills, including the ability to read drawings. Older CNC machines used
paper tapes with punched programs on them. Then tape would be translated into
CNC program by a reader and stored into CNC system.
How a programmer will compose a program we will learn later in programming
chapter. But when program is finished and ready for transfer into CNC system,
today programmers using mostly direct transfer from PC to CNC system, or do
programming directly on CNC machine computer. Of course, today we are using
different CAD-CAM systems which make all programming process easy, more
creative and faster.
Next step is to mount work piece and required tools on machine. Tools have to be
set into tool magazine (machining centres) or turret (turning centres) as program
we made require. This part of job is called Setting CNC machines, which we are
going to learn in separate course with CD video help.
Last step is most exciting, actually then we can see how our idea from CNC
program
transforming into real part, and that is when we execute the machining.
13
3. CNC PROGRAMMING
This course describes the general CNC programming regardless of the type of the
machine, standard, or kind of CNC control. Explanation is made for necessary
items on programming, such as the programming words, methods…
Programming means the preparation of process sheet while looking at diagram
and drawings. CNC Programmer decides which combination of sequences,
symbols, numerals and other commands in program language he will use, and he
directly influences on productivity.
COORDINATE SYSTEMS
Programmer has to understand fundamental geometrical principles, same as
principles of NC programming. He is going to use those principles in his job all
the time.
When the position to be reached by the tool is given, the CNC moves the tool to
that position. The position to be reached by the tool is given as a coordinate value
in a coordinate system. The following three types of coordinate systems are
available:
We distinguish between the following coordinate systems:
# Machine coordinate system with machine zero point
# Work coordinate system with workpiece zero point
# Local coordinate system (This can also be current workpiece coordinate
system)
14
Axis:
Standard axis Z,Y,Z
Swivel axis A,B,C
Auxiliary axis U,V,W
There are many basic coordinate systems familiar to students of geometry and
trigonometry. These systems can represent points in two-dimensional or three-
dimensional space. René Descartes (1596-1650) introduced systems of
coordinates based on orthogonal (right angle) coordinates. These two and three-
dimensional systems used in analytic geometry are often referred to as Cartesian
systems. Similar systems based on angles from baselines are often referred to as
polar systems.
15
Plane designation
A plane is defined by means of two coordinate axes. The third coordinate axis is
perpendicular to this plane and determines the infeed direction of the tool (e.g.
for 2D machining).
When programming, it is necessary to specify the working plane in order that the
control can calculate the Tool offset values correctly.
The plane is also relevant to certain types of circular programming and polar
coordinates.
16
Plain designation milling:
X/Y G17 Z
Z/X G18 Y
Y/Z G19 X
17
The Machine Coordinate System
Each of the axes is assigned a value depending on how far you want the machine to move
in a particular direction. Setting the X, Y and Z values is the first step in writing a CNC
program. Depending on the direction of each movement and the value of each movement,
each movement is expressed as axes (X+, X-, Y+, Y-, Z+ or Z-).
18
”Three finger rule” (Doesn’t apply on lathes)
The axis directions follow so-called ,,three-finger rule‖ of the right hand. Standing
in front of machine, the middle finger of the right hand points away from the in
feed direction of the main spindle (doesn‘t apply on lathes). Following then
applies:
The second coordinate system is called the Part Coordinate System where the 3
axes relate to the datums or features of the workpiece.
19
What is Alignment?
With today's CMM software, the CMM measures the workpiece's datums (from the
part print), establishes the Part Coordinate System, and mathematically relates it
to the Machine Coordinate System.
The process of relating the two coordinate systems is called alignment (Figure
4). With a street map, we do this automatically by turning the map so that it is
parallel to street (datum) or to a compass direction (i.e., north). When we do
this, we're actually locating ourselves to the "world's coordinate system".
20
Datum is a location. It is a feature on a work-piece such as a hole, surface or
slot. We measure a work-piece to determine the distance from one feature to
another
The distance between the two holes on the work-piece can be measured once the
original origin is translated to the smaller hole and the part coordinate system is
mathematically rotated 45°. Now both of the holes lie along the new Y axis and
the distance can be calculated automatically.
21
-With command G53 cutting radius correction and tool correction are switched
off.
-G53 must be indicated in absolute dimension. With incremental dimension values
the command G53 are ignored.
22
Axis direction
Work-piece coordinate system
It was briefly described earlier. In order for the machine to control and operate
specified positions, these data must be made in a reference system that
corresponds to the direction of motion of the axis slides. A coordinate system with
axes X,Y and Z is used for this purpose. They are called Cartesian coordinate
systems.
The work piece zero position (W) is the origin of the work piece coordinate
system. Sometimes it is advisable or even necessary to work with negative
positional data. Positions to the left of the origine are prefixed by a negative sign
(-).Pic. below shows six different work-piece coordinate systems established,
each with separate coordinate values in CNC program.
23
Fixture Offsets (G54-G59.3) (See pic bellow)
Fixture offset are used to make a part home that is different from the absolute,
machine coordinate system. This
allows the part programmer to set up home positions for multiple parts. A typical
operation that uses fixture offsets
would be to mill multiple copies of parts on "islands" in a piece, similar to the
figure bellow:
To use fixture offsets, the values of the desired home positions must be stored in
the control, prior to running a program that uses them. Once there are values
assigned, a call to G54, for instance, would add 2 to all X values in a program. A
call to G58 would add 2 to X values and -2 to Y values in this example.
G53 is used to cancel out fixture offsets. So, calling G53 and then G0 X0 Y0
would send the machine back to the actual coordinates of X=0, Y=0.
24
Definition of workpiece positions
To specify a position, imagine that a ruler is placed along the coordinate axes.
You can now describe every point in the coordinate system by specifying the
direction (X,Y and Z) and three numerical values. The workpiece zero always has
the coordinates X0, Y0, and Z0. (See drawings below)
Example:
For the sake of simplicity, we will only use one plane of the coordinate system in
this example, i.e. the X/Y plane. Points A to D than have the following point
coordinates:
A coordinates: X50. Y30.
B coordinates: X-20. Y70.
C coordinates: X-60. Y-60.
D coordinates: X20. Y-40.
25
In feed depth must also be described in milling operations. To program this, we
need to specify a numerical value for the third coordinate (Z in this case).
Example pic. bellow:
Points A1 to A2 are defined by the following coordinates:
A1 is defined by X20. Y20. Z-10.
A2 is defined by X50. Y70. Z-20.
26
Polar coordinates system commands
(G15, G16)
The coordinates used up to this point to specify points in the coordinate system
are called ,,Cartesian coordinates”.
However. There is another way to specify coordinates, namely as ,,polar
coordinates‖. The end point coordinate can be input in polar coordinates (radius
and angle). The plus direction of the angle is counterclockwise of the selected
plane first axis + direction, and the minus direction is clockwise. Both radius and
angle can be commanded in either absolute or incremental command(G90, G91).
Polar coordinates make sense when a workpiece or part of a workpiece has a
radius and angle. The point from which the dimensions are taken is called the
,,pole‖.
Example:
The points P1 and P2 can then be described-with reference to the pole - as
follows:
P1 corresponds to radius =100 + angle=30deg
P1 corresponds to radius = 60 + angle=75deg
When the radius is specified with absolute command ¸the zero point of local
coordinate system becomes the centre of the polar coordinate system.
Motion types
You Must Understand the Motion Types Available on Your CNC machine.
During discussion about ― Definition of work-piece positions‖
we discussed how end points for axis motion are commanded utilizing the
rectangular coordinate system. During that presentation, however, we were only
concerned with describing how the CNC machine determines the END POINT
position for each motion. To effectively command motion on most CNC machines
requires more than just specifying end points for positioning movements.
CNC control manufacturers try to make it as easy as possible to make movement
commands within the program. For those styles of motion that are commonly
needed, they give the CNC user interpolation types. We are going to learn about
it, but firstly we have to get used with G & M codes which are crucial in CNC
programming:
27
G – CODES (preparatory functions)
It shows the meaning of command for the concerned block. G following by the
number of 3 digits (usually 2 digits) address:
G codes are divided into following two types:
Type Meaning
One-shot G code The G code is effective only in the block in which
it is
Specified
Modal G code The G code is effective until another G code of the
same group is specified
Modal Codes
Many G codes and M codes cause the machine to change from one mode to
another, and the mode stays active until some other command changes it
implicitly or explicitly. Such commands are called "modal".
Modal codes are like a light switch. Flip it on and the lamp stays lit until someone
turns it off. For example, the coolant commands are modal. If coolant is turned
on, it stays on until it is explicitly turned off. The G codes for motion are also
modal. If a G1 (straight move) command is given on one line, it will be executed
again on the next line unless a command is given specifying a different motion
(or some other command which implicitly cancels G1 is given).
"Non-modal" codes effect only the lines on which they occur. For example, G4
(dwell) is non-modal.
Modal commands are arranged in sets called "modal groups". Only one member
of a modal group may be in force at any given time. In general, a modal group
contains commands for which it is logically impossible for two members to be in
effect at the same time. Measurement in inches vs. measure in millimetres are
modal. A machine tool may be in many modes at the same time, with one mode
from each group being in effect. The modal groups used in the interpreter are
shown in Table bellow:
28
NC Programming as per ISO (DIN 66025) and RS274
29
G71 Metric format active
G72 Interpolation with precision stop "off"
G73 Interpolation with precision stop "on"
G74 Move to home position
G75 Curvature function activation
G76 Curvature acceleration limit
G78 Normalcy function "on" (rotational axis orientation)
G79 Normalcy function "off"
G80 Canned cycle "off"
G81 Drilling to final depth canned cycle
G82 Spot facing with dwell time canned cycle
G83 Deep hole drilling canned cycle
G84 Tapping or Thread cutting with balanced chuck canned cycle
G85 Reaming canned cycle
G86 Boring canned cycle
G87 Reaming with measuring stop canned cycle
G88 Boring with spindle stop canned cycle
G89 Boring with intermediate stop canned cycle
G90 Absolute programming
G91 Incremental programming
G92 Position preset
G93 Constant tool circumference velocity "on" (grinding wheel)
G94 Feed in mm / min (or inch / min)
G95 Feed per revolution (mm / rev or inch / rev)
G96 Constant cutting speed "on"
G97 Constant cutting speed "off"
G98 Positioning axis signal to PLC
G99 Axis offset
G100 Polar transformation "off"
G101 Polar transformation "on"
G102 Cylinder barrel transformation "on"; Cartesian coordinate system
G103 Cylinder barrel transformation "on," with real-time-radius compensation (RRC)
G104 Cylinder barrel transformation with centre line migration (CLM) and RRC
G105 Polar transformation "on" with polar axis selections
G106 Cylinder barrel transformation "on" polar-/cylinder-coordinates
G107 Cylinder barrel transformation "on" polar-/cylinder-coordinates with RRC
G108 Cylinder barrel transformation polar-/cylinder-coordinates with CLM and RRC
G109 Axis transformation programming of the tool depth
G110 Power control axis selection/channel 1
G111 Power control pre-selection V1, F1, T1/channel 1 (Voltage, Frequency, Time)
G112 Power control pre-selection V2, F2, T2/channel 1
G113 Power control pre-selection V3, F3, T3/channel 1
G114 Power control pre-selection T4/channel 1
G115 Power control pre-selection T5/channel 1
G116 Power control pre-selection T6/pulsing output
G117 Power control pre-selection T7/pulsing output
G120 Axis transformation; orientation changing of the linear interpolation rotary axis
G121 Axis transformation; orientation change in a plane
G125 Electronic gear box; plain teeth
G126 Electronic gear box; helical gearing, axial
G127 Electronic gear box; helical gearing, tangential
G128 Electronic gear box; helical gearing, diagonal
G130 Axis transformation; programming of the type of the orientation change
G131 Axis transformation; programming of the type of the orientation change
G132 Axis transformation; programming of the type of the orientation change
30
G133 Zero lag thread cutting "on"
G134 Zero lag thread cutting "off"
G140 Axis transformation; orientation designation work piece fixed coordinates
G141 Axis transformation; orientation designation active coordinates
G160 ART activation
G161 ART learning function for velocity factors "on"
G162 ART learning function deactivation
G163 ART learning function for acceleration factors
G164 ART learning function for acceleration changing
G165 Command filter "on"
G166 Command filter "off"
G170 Digital measuring signals; block transfer with hard stop
G171 Digital measuring signals; block transfer without hard stop
G172 Digital measuring signals; block transfer with smooth stop
G175 SERCOS-identification number "write"
G176 SERCOS-identification number "read"
G180 Axis transformation "off"
G181 Axis transformation "on" with not rotated coordinate system
G182 Axis transformation "on" with rotated / displaced coordinate system
G183 Axis transformation; definition of the coordinate system
G184 Axis transformation; programming tool dimensions
G186 Look ahead; corner acceleration; circle tolerance
G188 Activation of the positioning axes
G190 Diameter programming deactivation
G191 Diameter programming "on" and display of the contact point
G192 Diameter programming; only display contact point diameter
G193 Diameter programming; only display contact point actual axes center point
G200 Corner smoothing "off"
G201 Corner smoothing "on" with defined radius
G202 Corner smoothing "on" with defined corner tolerance
G203 Corner smoothing with defined radius up to maximum tolerance
G210 Power control axis selection/Channel 2
G211 Power control pre-selection V1, F1, T1/Channel 2
G212 Power control pre-selection V2, F2, T2/Channel 2
G213 Power control pre-selection V3, F3, T3/Channel 2
G214 Power control pre-selection T4/Channel 2
G215 Power control pre-selection T5/Channel 2
G216 Power control pre-selection T6/pulsing output/Channel 2
G217 Power control pre-selection T7/pulsing output/Channel 2
G220 Angled wheel transformation "off"
G221 Angled wheel transformation "on"
G222 Angled wheel transformation "on" but angled wheel moves before others
G223 Angled wheel transformation "on" but angled wheel moves after others
G265 Distance regulation – axis selection
G270 Turning finishing cycle
G271 Stock removal in turning
G272 Stock removal in facing
G274 Peck finishing cycle
G275 Outer diameter / internal diameter turning cycle
G276 Multiple pass threading cycle
G310 Power control axes selection /channel 3
G311 Power control pre-selection V1, F1, T1/channel 3
G312 Power control pre-selection V2, F2, T2/channel 3
G313 Power control pre-selection V3, F3, T3/channel 3
31
G314 Power control pre-selection T4/channel 3
G315 Power control pre-selection T5/channel 3
G316 Power control pre-selection T6/pulsing output/Channel 3
G317 Power control pre-selection T7/pulsing output/Channel 3
Note that some of the above G-codes are not standard. Specific control features,
such as laser power control, enable those optional codes.
32
M99 End of subprogram, rewind function
M101-M108 Turn off fast output byte bit 1 (to 8)
M109 Turn off all (8) bits in the fast output byte
M111-M118 Turn on fast output byte bit 1 (to 8)
M121-M128 Pulsate (on/off) fast output byte bit 1 (to 8)
M140 Distance regulation “on” (configured by G265)
M141 Distance regulation “off”
M150 Delete rest of distance using probe function, for a probe input (one of 16,
M151-M168)
M151-M158 Digital input byte 1 bit 1 (to bit 8) is the active probe input
M159 PLC cannot define the bit mask for the probe inputs
M160 PLC can define the bit mask for the probe inputs (up to 16)
M161-M168 Digital input byte 2 bit 1 (to bit 8) is the active probe input
M170 Continue the block processing look ahead of the part program (cancel the
M171)
M171 Stop the block processing look ahead of the probe input part program
segment (like a G10)
M200 Activate the hand-wheel operation in the automatic mode (to introduce an
offset in the program)
M201-M208 Select the axis (by number from 1 to 8) for the hand-wheel operation
M209 Activate the hand-wheel operation in the automatic mode, with PLC control
of the axis selection
M210 Deactivate the hand-wheel input while in the automatic mode
M211 Deactivate this hand-wheel feature and also remove the hand-wheel offset (if
any)
M213 Spindle 2 clockwise
M214 Spindle 2 counter-clockwise (CCW)
M215 Spindle 2 stop
M280 Switchable spindle/rotary axis, rotary axis on, first combination
M281 Switchable spindle/rotary axis, rotary axis on, second combination
M290 Switchable spindle/rotary axis, spindle enabled, first combination
M291 Switchable spindle/rotary axis, spindle enabled, second combination
Note: Other machine functions, like tool change (usually M06) or coolant control,
have their M-code value specified by the PLC application not by the CNC software.
Other M-codes (up to M699) can be handled by the PLC application based on the
particular machine requirements.
33
Command is made at the position (absolute coordinate value) from program zero
point. There is one zero point.
N1 G90 Z50. Y30.
N2 X200.Y30.
N3 X200.Y90.
N4 X50.Y90.
N5 X0 Y0
See pic. Below:
Explanation:
N1 G90 hereafter moving command is
absolute command. Moving to P1.
N2 Moving from P1 to P2.
N3 Moving from P2 to P3.
N4 Moving from P3 to P4.
N5 Movement from P4 to program zero
point.
Absolute dimensions refer to the origin of
the active coordinate system. Programmer
has to program the point to which the tool
is to travel , e.g. in the the workpiece
coordinate system.
34
Incremental command (incremental value) – G91
Is done by G91 command. (Pic Bellow) Locations are always given as the distance
and direction from the immediately preceding point. A ―X plus‖ (X+) command
will cause the cutting tool to be located to the right of the last point.
1. A ―X minus‖ (X-) command will cause the cutting tool to be located to the left
of the last point.
2. A ―Y plus‖ (Y+) command will cause the cutting tool to be located toward the
column.
3. A ―Y minus‖ (Y-) will cause the cutting tool to be located away from the
column.
4. A ―Z plus‖ (Z+) command will cause the cutting tool or spindle to move up or
away from the work-piece.
5. A ―Z minus‖ (Z-) moves the cutting tool down or into the work-piece.
In incremental programming, the G91 command indicates to the computer and
MCU (Machine Control Unit) that programming is in the incremental mode.
Explanation:
N1 G91 hereafter-moving command is
incremental (value) command.
Moving to P.
N2 with P1 as zero point moving to P2.
N3 with P2 as zero point moving to P3.
N4 with P3 as zero point moving to P4.
N5 with P4 as zero point moving to the start
point.
35
Understanding of interpolation
Say for example, you wish to move only one linear axis in a command.
Say you wish to move the X axis to a position one inch to the right of program
zero. In this case, the command X1. would be given (assuming the absolute
mode is instated). The machine would move along a perfectly straight line during
this movement (since only one axis is moving). Now let's say you wish to include
a Y axis movement to a position one inch above program zero in Y (with the X
movement). We'll say you are trying to machine a tapered or chamfered surface
of your work-piece in this command.
For the control to move along a perfectly straight line to get to the programmed
end point, it must perfectly synchronize the X and Y axis movements. Also, if
machining is to occur during the motion, a motion rate (feed-rate) must also be
specified. This requires linear interpolation.
36
This motion type allows the programmer to command perfectly straight line
movements as discussed earlier during our discussion of linear interpolation. This
motion type also allows the programmer to specify the motion rate (feed-rate) to
be used during the movement. Straight line motion can be used any time a
straight cutting movement is required, including when drilling, turning a straight
diameter, face or taper, and when milling straight surfaces. The method by which
feed-rate is programmed varies from one machine type to the next. Generally
speaking, machining centres only allow the feed-rate to be specific in per minute
format (inches or millimetres per minute). Turning centres also allow feed-rate to
be specified in per revolution format (inches or millimetres per revolution).
A G01 word is commonly used to specify straight line motion. Within the G01, the
programmer will include the desired end point in each axis.
Clockwise G02 and counter-clockwise G03 on the Xp Yp plane are defined when
the Xp Yp plane is viewed in the positive–to-negative direction of the Zp axis (Yp
or Xp axis respectively) in the Cartesian coordinate system, see pic above. The
arc centre is specified by addresses I, J, and K for the Xp, Yp and Zp axes. The
numerical value following I,J,K however is a vector component in which the arc
centre is seen from the start point, and is always specified in an Incremental
value irrespective of G90 and G91 as shown below. I, J, and K must be signed
according to the direction.
37
Arc on X-Y plane:
G17 (G02, G03) Xp…Yp…(R…)I…J…F…
Arc on Z-X plane:
G18 (G02, G03) Xp…Zp…(R…)I…K…F…
Arc on Y-Z plane:
G19 (G02, G03) Yp…Zp…(R…)J…K…F…
_________________________________________________________________
__
Arc radius R Arc radius
5. Feed rate F Feed rate along arc.
1) In absolute programming:
G92 X200. Y40. Z0
G90 G03 X140. Y100. I-60. F300
G02 X120. Y60. I-50.
Or
38
G92 X200. Y40. Z0
G90 G03 X140. Y100. R60. F300
2. In incremental programming:
G91 G03 X-60. Y60. I-60. F300
G02 X-20. Y-40. I-50.
Or
G91 G03 X-60. Y60. R60. F300
G02 X-20. Y-40. R50.
G02 G03
Using R:
G1 X1. Y-5.
G3 X0 Y5. R1.
Using I & J:
G1 X1. Y-5.
G3 X0 Y5. I-1. J0
Sample program (R & J):
39
G01 Y1.25 F12
X1.5 (to start point)
G02 X2.25 Y0.5 J-0.75 or R0.75
40
N60 X2 Y1.5 (RAPID OVER TO X2 AND Y1.5)
N65 G01 Z-0.25 (FEED DOWN TO Z-0.25)
N70 G02 X2 Y1.5 I0.25 J-0.25 (FULL CIRCLE ARC FEED MOVE)
N75 G00 Z1 (RAPID UP TO Z1)
N80 X0 Y0 (RAPID OVER TO X0 AND Y0)
N85 M05 (SPINDLE OFF)
N90 M30 (PROGRAM END)
41
Example of a Cylindrical interpolation program:
On this basic drawing below we can see position of program zero point and
coordinate system. In case of program be sure to decide the program-zero point
is decided by programmer by looking at the machining diagram.
42
Another, newer and better way to assign program zero is through some form of
offset. Commonly machining center control manufacturers call offsets used to
assign program zero fixture offsets. Turning center manufacturers commonly call
offsets used to assign program zero for each tool geometry offsets.
Turning Centre:
Diagrams show zero points and reference points for turning and drilling/milling
machines.
Z - axis zero point
Program is generally made by deciding the standard face at the machining
diagram as zero, namely
1. machining surface with face milling,
43
2. surface regarded as standard by the description of dimension even without
machining.
With 1. and 2. decided as Z 0 (zero point), program is performed.
Z value on the program is always tool nose position.
Tool length compensation will be mentioned later.
Instruction of Z0 (zero) to machine side is made with one touch by the use of W-
setter (Sensor).
Metric/Inch input
Metric/ inch input can be selected by G code in CNC program:
G20 inch input
G21 metric input
G code should be specified in an independent block before setting the coordinate
system at the beginning of the program.
Switching off m/c doesn‘t change status was before.
G20 & G21 must not be switched during a program.
The inch/metric input can also be switched using settings.
4. TOOL OFFSETS
What are offsets?
All forms of compensation work with offsets. CNC offsets are like memories on an
electronic calculator. If your calculator has memories, you know you can store a
constant value into each memory for use during a calculation. This keeps you
from having to enter the number over and over again with redundant
calculations. Latter in program if programmed for example T1 D1, that means
program will use value of offset No.1 in offset file.
Like the memories of an electronic calculator, offsets in the CNC control are
storage locations into which numerical values can be placed. Just as the value
within the memory of a calculator has no meaning until referenced by its user
within a calculation, neither does the value within an offset of the CNC control
have any meaning until it is referenced by a CNC program.
Why we need tool offsets
Tool offsets can be used for several purposes depending on the style of machine
tool and type of compensation being used. Here are some of the more common
applications for offsets.
*To specify tool each tool's length
44
For machining centre applications, it would be very difficult for the programmer to
predict the precise length of each tool used in the program. For this reason, the
feature tool length compensation allows the programmer to ignore each tool's
length as the program is written. At the time of setup, the setup person measures
the length of each tool and inputs the tool length value into the corresponding
offset.
*To specify the radius of the cutting tool
When milling on the periphery of the cutter (contour milling), it can be
cumbersome and difficult for the programmer to program the cutter's path based
on the size of the milling cutter being used. Also, if the cutter size must change
(possibly due to re-sharpening), it would be infeasible to change the program
based on the new cutter size. For this reason, the feature cutter radius
compensation allows the programmer to ignore the cutter size as the program is
written. The setup person inputs the size of each milling cutter into its
corresponding tool offset. In similar fashion, turning centres have a feature called
tool nose radius compensation. With this feature, an offset is used to specify the
radius of the very tip of the turning or boring tool.
*Assigning program zero
Machining centres that have fixture offsets (also called coordinate system
shifting) allow the user to specify the position of the program zero point within
offsets, keeping the assignment of program zero separate from the program. In
similar fashion many turning centres allow the assignment of program zero with
offsets (this feature is commonly called geometry offsets).
*To allow sizing on turning centres
Tool offsets are used on all turning centres to allow the operator to hold size with
tools used within their programs. This allows the operator to adjust for
imperfections with tool placement during setup. It also allows the operator to
adjust the tool's movements to allow for tool wear during each tool's life.
Organizing offsets
With some CNC controls, the organization of offsets is very obvious. Some
machining centre controls, for example, automatically make the offset №
correspond to the tool station №. With this kind of machine, when tool station
number one is commanded, the control will automatically invoke offset number
one. Within offset number one, the operator can store a tool length value as well
as a tool radius value.
Unfortunately, not all controls make it this simple. In many controls, each offset
contains only one value and the offset number has no real relationship to the tool
station number. In this case, the programmer must cautiously organize which
offset/s are used with each tool.
For example, the tool length compensation offset numbers can be made the same
as tool station numbers. Cutter radius compensation offset numbers can be made
equal to the tool station number PLUS a constant value larger than the number of
tools the machine can hold. If the machine can hold 25 tools, tool station number
one could be made to use offset number one to store its length compensation
value and offset number thirty-one could be used to store its cutter radius
compensation value. With this method of offset organization, the programmer
and operator are constantly in sync.
The offset table on most turning centres incorporate at least two values per
offset. Generally speaking, the programmer will instate the offset number
corresponding to the tool station number for each tool offset used. That is, tool №
one will use (only) offset № one, tool two will use offset two, and so on.
Additionally, most turning centre offset tables allow the user to enter data related
to the tool's radius (for tool nose radius compensation). Typically the radius (R
column of the offset table) and the tool type (the T column of the offset table)
can be specified within the turning centre‘s offset table.
Types of compensation
45
Now let's discuss the compensation types for the two most popular forms of CNC
machine tools, machining centres and turning centres. Keep in mind that while
the actual use of these functions varies dramatically from one machine to the
next, the basic reasoning behind each compensation type remains remarkably
similar. With an understanding of why the compensation type is required, and
with an elementary understanding of how it is applied to one specific control, you
should be able to adapt to any variations that you come across.
Tool length compensation - G43 (machining centres), Wear offsets
(turning centres)
In this chapter we are going to learn and understand the forms of compensation.
All types of CNC machine tools require some form/s of compensation. Though
applied for different reasons on different machine types, all forms of
compensation allow the CNC user to allow for unpredictable conditions related to
tooling as the program is developed. Before discussing how compensation applies
to CNC usage, let's look at compensation in general terms.
Different types of compensation are used in many facets of everyday life. The
airplane pilot must compensate for wind velocity and direction as a heading is set.
The race car driver must compensate for weather and track conditions as a turn is
negotiated. A bowler must compensate for the spin of the bowling ball as the ball
rolls down the alley.
46
CUTTER COMPENSATION
It‘s the ability of the machine to compensate for tool size whilst milling profiles to do this
we have to tell the machine what 1/2 the size of the cutter is and this is achieved by
setting an offset number we wish to use with this tool - we call this offset in the program
by specifying a ‗D‘ value.
The ‘D’ number we use is our choice and as programmers we normally select a number
that can easily be associated with the tool number we are using so if you have 30 tools on
your machine then it would make sense to start your ‘D’ numbers at say ‗D31‘ for tool-1,
‗D32‘ for tool-2, etc. as the possibility exists that you may have all 30 tools in the
magazine thus requiring 30 tool length offsets.
To utilise the compensation, we are asking the machine to calculate the intersections of
the cutter path, whereas normally we would have to calculate these intersections ourselves
To make the system work then we have to follow some rules.
The rules that follow are made up from the requirements of the control and a lot of
experience and are not set in stone however IF YOU FOLLOW THE RULES YOU WON‘T GO
FAR WRONG?
FIRST - THERE ARE THREE G CODES USED IN CUTTER COMPENSATION AND THESE ARE
47
This machining centre compensation type allows the programmer to forget about
each tool's length as the program is written. Instead of having to know the exact
length of each tool and tediously calculating Z axis positions based on the tool's
length, the programmer simply instates tool length compensation on each tool's
first Z axis approach movement to the workpiece.
At the machine during setup, the operator will input the tool length compensation
value for each tool in the corresponding offset. This, of course, means the tool
length compensation value must first be measured.
If tool length compensation is used wisely, the tool length compensation value
can be measured off line (in a tool length measurement gage) to minimize setup
time. With this method, the tool length compensation value is simply the length
of the tool.
This value compensates for the differences in length between the tools used. The
tool length is the distance between the tool holder ref. point and the tip of the
tool. This length is measured and entered in CNC control together with wear
values. On basis of this data the CNC control calculates the traversing movements
in the feed direction.
Many CNC controls allow the length of the tool to be used as the offset value. One
popular command to instate tool length compensation is G43. Within the G43
command, the programmer includes an H word that specifies the number of the
offset containing the tool's length.
Here is an example program that utilizes tool length compensation with two
tools. The program simply drills two holes (one with each tool). Notice that tool
length compensation is being instated in lines N015 and N055.
And program would be:
O0001 (Program №)
N005 T01 M06 (Place tool № one in the spindle)
N010 G54 G90 S400 M03 T02 (Select coordinate system, absolute mode, start
spindle CW at 400 RPM, get tool № two ready)
N013 G00 X1.0 Y1.0 (Rapid to first XY position)
N015 G43 H01 Z.1 M08 (Instate tool length compensation on first Z move, turn
on coolant)
N020 G01 Z-1.5 F4. (Drill hole)
N025 G00 Z.1 M09 (Rapid out of hole, turn off coolant)
N030 G91 G28 Z0 M19 (Return to tool change position, orient spindle)
N035 M01 (Optional stop) N040 T02 M06 (Place tool № two in spindle)
N045 G54 G90 S400 M03 T01 (Select coordinate system, absolute mode, start
spindle at 400 RPM, get tool № one ready)
N050 G00 X2. Y1. (Rapid to first XY position)
N055 G43 H02 Z.1 M08 (Instate tool length compensation on tool's first Z move,
turn on coolant)
N060 G01 Z-1.2 F5.5 (Drill hole)
48
N065 G00 Z.1 M08 (Rapid out of hole, turn off coolant)
N070 G91 G28 Z0 M19 (Return to tool change position, orient spindle)
N075 M30 (End of program)
To turn compensation on, the machine must move at least the distance of the
nose radius in X and Z. For easy calculations, back away from the start point 0.1
in Z and 0.2 in X. Remember X is diameter based, so 0.2 in X is actually 0.1
radially.
A G42 Example
We will program ONLY the finish pass on this part using G42 right tool nose
radius compensation. We are given 800fpm cutting speed and 0.006ipr feed.
Finish Pass:
49
As stated, this feature varies dramatically in use from one control model to the
next. You must reference your control manufacturer's programming manual to
learn more about how tool length compensation applies to your particular
machining centre. Sizing with tool length compensation.
In similar fashion, the CNC operator will not know for certain whether the tool
length compensation value is perfectly correct until the first workpiece is
machined. Say for example, the tool length measurement was made incorrectly.
During the measurement, the operator finds the tool to be 6.5372 in long. But the
actual tool length is 6.5355 in. In this case, the tool would machine slightly
shallower in Z that it is supposed to. After machining, the minor depth change
can be made by adjusting the offset, NOT THE PROGRAM.
In some cases, even if the tool length value is measured perfectly, other
problems may cause the tool not to machine to the proper depth. If, for example,
the workpiece or setup is quite weak, tool pressure may cause the workpiece to
tend to push away from the tool doing the machining.
For critical surfaces or when tool pressure is unpredictable, the operator can even
trial cut the workpiece under the influence of an offset slightly LARGER than the
measured value to ensure that some excess stock will be left. After machining,
the operator can measure the surface to determine precisely how much offset
change is necessary to machine the workpiece to size.
50
TLO's. Below lists just one method.
TLO's are measured using the M96 or M97 codes. M96 moves to the Tool Sensor
Location defined in menu Setup - Machine Setup - Digitizing Probe. M97 does not
move to location but rather moves directly 'down' to the tool sensor. M97 is used
when the tool sensor is manually moved/placed under the tool for measurement.
M96 is used when the tool sensor is semi-permanently mounted to a fixed
location on the machines table.
Measuring TLO's:
1. If using M96, set the tool sensor location in menu Setup - Machine Setup - Tool
Sensor - X/Y Location along with the Tool Sensor Height. The Sensor Height is
relative for this method of calculating TLO's so it does not have to be entered
exactly. Make certain that the Default Lim Polarity is set to Normally Closed when
using the Digitizing Probe or Tool Sensor.
2. Tool Changes are executed using a Tx M6 combination. A tool needs to be
loaded for the M96/M97 commands to function. Enter T1M6 in the MDI box and
press Enter. The Tool 1 'Tool Change Script' will be executed (Tool Change
Scripting). Tool 1 should now be in the Spindle.
3. Place the Tool Sensor under the tool and Enter M97 in the MDI box. TLO's are
measured using the current feedrate. Enter a new feedrate (F) if warranted.
4. The Spindle will lower the Tool to the Sensor and record the TLO. The TLO will
be active. The TLO for Tool 1 will NOT be saved in the Tool Library until you save
the Tool Library from menu Setup - Tool Library - Save. You can measure all tools
and then save the entire table.
5. Once a TLO has been measured, it will need to be active when machining. This
is done with the G43 Hx command where x is the tool number. The G43 Hx may
be placed in the Tool Change Script.
6. When the Spindle is Zeroed, the Active TLO is used.
Using TLO's when machining:
1. Place the first tool used in your GCode file in the Spindle. Do this be entering
T1M6 (assumes Tool 1) in the MDI box. The tool change script for Tool 1 will be
executed. The Tool Change Script should include the G43 H1 command to make
the TLO for tool 1 active. The TLO readout in DeskCNC will display the current
TLO.
2. Zero the tool to the part material. The Z
Coordinate will reflect the active TLO.
3. Run the GCode file. All subsequent tool calls will
place the tip of each tool at the proper Z Height
according to their TLO.
51
Activation and deactivation tool radius compensation:
Turning. G41 causes the tool to be offset to the left of the programmed tool-path
and G42 directs the tool to be offset to the right. Cutter compensation activates
on the first linear move after the compensation code is called. Compensation is
cancelled with G40 code.
STAND ON THE TOOL, OR DRAW AN EYEBALL BEHIND THE TOOL. LOOK IN THE
DIRECTION THE TOOL TRAVELS WHILST CUTTING AND ASK YOUR SELF IS THE
TOOL TO THE LEFT OF THE WORK PIECE OR TO THE RIGHT OF THE WORK
PIECE?
52
DO NOT LET THE COMPENSATION DECIDE THE DIRECTION OF CUT FOR YOU.
53
match the new cutter size. With cutter radius compensation, handling this
problem is as simple as changing an offset value.
3. Easy sizing
As with tool length compensation, the operator can use the cutter radius
compensation offset to help with sizing. If the contour is not coming out to size
(possibly due to tool pressure), an offset can be changed to allow for the
imperfection.
4. Roughing and finishing
This is also a manual programming related reason for using cutter radius
compensation. If contours must be rough and finish milled, cutter radius
compensation allows the programmer to use the same programmed coordinates
needed to finish mill the workpiece to rough mill the workpiece. This keeps the
programmer from having to calculate to sets of milling coordinates (one for
roughing and one for finishing). To leave stock for finishing during the rough
milling, the operator will simply make the cutter radius compensation offset value
slightly larger than the cutter's actual size. This will keep the cutter away from
the surface being milled and leave the desired finishing stock. Tip: When chips
start to change colour, always reduce speed-not feed!
How to program cutter radius compensation
This is example of assignment of tools and tool offsets in a circular tool magazine
The usage of cutter radius compensation does vary from one control to the next.
Additionally, each control will have a set of strict rules that specify how cutter
radius compensation is instated, used, and cancelled. Here we just show the
basics of how it is programmed and give an example for how it is used on one
popular control model. You must refer to your CNC control manufacturer's manual
for more on your particular control.
Most controls use three G codes with cutter radius compensation. G41 is used to
instate a cutter left condition (climb milling with a right hand cutter). G42 is used
to instate a cutter right condition (conventional milling). G40 is used to cancel
cutter radius compensation. Additionally, many controls use a D word to specify
the offset number used with cutter radius compensation.
To determine whether to use G41 or G42, simply look in the direction the cutter
is moving during machining and ask yourself if the cutter is on the left or right
side of the surface being machined. If on the left, use G41. If on the right, use
G42.
Pictures above shows some examples that should help you understand how to
determine whether to use G41 or G42 to instate. Drawings show how to
determine whether to use G41 or G42 to instate cutter radius compensation.
Once cutter radius compensation is properly instated, it the cutter will be kept on
the left side or right side (depending on whether G41 or G42 is used to instate) of
all surfaces until the G40 command to cancel compensation.
Example of tool diameter compensation program:
Tool No T01 when D21 = 15000
The radius of end mill becomes the same dimension as that of the offset vector
(arrow mark).
Absolute values:
T01 M06
G90 G54 G00 X0 Y0 S300
(G43) Z3. (H01)
M03
G90 G17 G00 G41 X100. (D01) Start up left side offset
G01 Z-25. F2000 The radius value of end mill offset has been
set to
Y60. F120 D01
X140. Y80. This block is either G00 or G01
G02 X180. Y40. R40.
X160.Y20. R20.
54
G01 X99.
G00 Z30.
G40 X0 Y0 Cancel mode
M05
M91 G28 Z0
Haas: Cutter compensation can only be turned on and off in G00 (rapid) or G01
(linear) mode. After you‘ve turned it on and before you start cutting, you must
make a linear move that is the same or greater than the radial compensation
value in your offset. If your radial cutter comp is set at 0.5‖, for instance (for a 1‖
diameter tool), then you must make a linear cut of at least that length before you
start cutting. Here‘s how the program would look:
T01 M06
G54 G00 X3.6 Y0.0 S500 M03 (X = 3.6)
G43 Z1. H01
G01 Z-0.25 F50.0
(X = 3.0, a move of 0.6, allowing
G01 G41 X3.0 D01 F10.0
Y-1.0 cutter comp of 0.5 to be established)
G01 G40 X3.6
G91 G28 Z0
M30
Setting Tooloffsets
You need to determine the offsets for the tools you are using in the tool library.
1. Select the tool by commanding a tool change in MDI mode by either writing code or
pressing ATC/FWD or ATC/REV to load the first tool into the spindle.
55
Slowly jog the tool in the Z-Direction and stop when you get close to the top of the stock
or the vise, or wherever you have programmed the z-zero coordinate location for your
part. (CAUTION: DO NOT have the spindle rotating while setting tool offsets!)
Switch to 0.001" or 0.0001" increment and place a slip of paper between the tip of the
tool and the surface you are setting for the z-zero. The next step takes some eye-hand
coordination and very small increments when jogging. You will now move the tool tip in
the Z-direction while constantly sliding the paper back and forth on the face. You want to
stop jogging the tip down when you just feel the tip "grabbing" the paper.
4. At this point you know that the tool tip is offset from the surface by the thickness of your
sheet of paper.
Press the OFSET button and page up or down to the tool offsets page.
56
Highlight the tool number you are setting and press the TOOL OFSET MEASURE button.
You will see a new number appear in the column "GEOMETRY". With the number
highlighted, type in " - 0.003" and hit ENTER. The number will decrement by that
amount.
This is the same thing we did when we subtracted the radius of the edge finder. (0.003"
is an approximate thickness of a sheet of paper, but you may want to measure it to be
sure).
Jog the tool in the POSITIVE z-direction away from the face to move on to the next tool.
(NOTE: If you accidentally jog in the negative z direction, you will very quickly break the
tool. If you want to avoid this DO NOT USE THE JOG HANDLE to move the tool up. Simply
push and hold the "+Z" arrow above the JOG LOCK button and the tool will safely move
up from the surface(or just press the ATC FORWARD button while in the MDI mode. If the
spindle is down it will automatically go up to the tool change position height).
Before setting up a job, be sure that the workpiece, table, the taper
in the spindle, and the arbor or cutter shank are free from chips,
nicks, or burrs.
Do not select a milling cutter of larger diameter than is necessary.
Check the machine to see if it is in good running order and properly
57
lubricated, and that it moves freely, but not too freely in all
directions.
Consider direction of rotation. Many cutters can be reversed on the
arbor, so be sure you know whether the spindle is to rotate clockwise
or counterclockwise.
Feed the workpiece in a direction opposite the rotation of the milling
cutter (conventional milling).
Do not change feeds or speeds while the milling machine is in
operation.
When using clamps to secure a workpiece, be sure that they are tight
and that the piece is held so it will not spring or vibrate under cut.
Use a recommended cutting oil liberally.
Use good judgment and common sense in planning every job, and
profit from previous mistakes.
Set up every job as close to the milling machine spindle as
circumstances will permit.
Material aluminium
Mill the profile 8.0mm deep
Machine in a clock wise direction
Program
O0003
G21
G40 G80 G49 G17 cancellations
G91 G28 Z0 reference return to be able to tool change
N1 T1 M6 (20 Dia end mill) select tool -1 and put it in the spindle
G0 G90 G56 X-15.0 Y-15.0 move to the start position to machine
S3000 M3 start the spindle
G43 Z-8.0 H01 M8 advance the tool in Z
G41 X0 D31 apply comp to the left on this move
G1 Y44.0 F400 cut to pos.-1
G2 X60.0 Y50.0 R6.0 cut circle to pos.-2
G1 X64.0 cut to pos.-3
G2 X70.0 Y44.0 R6.0 cut circle to pos.-4
58
G1 Y6.0 cut to pos.-5
G2 X64.0 Y0 R6.0 cut circle to pos.-6
G1 X6.0 cut to pos.-7
G2 X0 Y6.0 R6.0 cut circle to pos.-8
G0 G40 X-15.0 Z10.0 M9 cancel comp an lift in Z
G91 G28 Z0 reference return the Z axis
G49 H00 M01 cancel the tool length offset
G28 Y0 reference the Y axis (park the table)
M30 end of program reset & rewind
Pictorially as shown in here we positioned the cutter after tool change at X-15.0 Y-15.0
We then applied the compensation in a move command (rapid) to X0.
We offset this move of 15 mm to the left of the next program move which was to cut up
the Y axis.
The offset amount contained in offset 31 would be 1/2 the size of the tool (10mm).
So the resultant move the machine will make is 5 mm.
By adjusting the value in the offset we can adjust the size of the component being
machined to take care of broken tools or tool wear.
We can use any size of tool up to 30 mm diameter which when used in conjunction with
this program would result in no move being made when the comp is applied.
But should we set an offset that is 0.001 mm bigger than 15.0 mm then the machine says
I have to move in the opposite direction to what is required RESULT = ALARM
59
the second two digits command the offset number to be instated. The command
T0101, for example, rotates the turret to station № 1 and instates offset № 1. It
is wise to always make the number of the primary offset used with a tool the
same as the tool station №.
NOTE: When a tool offset is instated, the control actually shifts the entire
coordinate system by the amount of the offset. It will be as if the operator could
actually move the tool in the turret by the amount of the offset.
Each dimensional offset has two values, one for X and one for Z. The operator will
have control of what the tool does in both axes as the workpiece is being
machined. Here's an example that should help you understand how dimensional
tool offsets work. Say you have written a program to use tool number one (with
offset number one) to turn a three inch diameter. After machining the three inch
diameter, it is measured and found to be 3.005 in. That is, the workpiece is 0.005
in oversize. In this case, the X value of offset number one will be reduced by
0.005 in. When the program is run again, tool number one will machine the
workpiece 0.005 smaller.
How to guarantee your first workpiece comes out on size
If working on an engine lathe, manually turning a precise diameter, you would
first allow the tool to skim cut to find out exactly where the tool is located. After
skim cutting, you can determine precisely how much to turn the crank or handle
to make the tool turn the desired diameter.
In the same way, you can use dimensional tool offsets to ensure that any tool will
not violate the workpiece on its first cut. Outside diameter turning tools, for
example, could be offset slightly plus in X to ensure that some excess stock is
left. Inside diameter bored holes could be offset slightly minus in X for the same
purpose. In either case, the first time the tool is run, the operator can rest
assured that the workpiece will come out with some excess finishing stock (it will
NOT be scrapped). After machining the first time, the surface can be measured.
The operator will then adjust the corresponding offset accordingly and re-machine
with the tool this time the surface will be machined perfectly to size. Using this
technique on each tool in the program will almost guarantee that the first
workpiece will not be scrapped.
60
Notice that the tool nose radius will cause
deviations from the required work surface if not considered during programming.
To determine G41 or G42, simply look in the direction the tool is moving
during the cut and ask yourself which side of the workpiece the tool is on. If the
tool is on the left, use G41 (this would be the case when boring toward the
chuck). If the tool is on the right, use G42 (turning toward the chuck). Once you
determine which to use, include the proper G code in the tool's first approach to
the workpiece. Once tool nose radius compensation is instated, it remains in
effect until cancelled.
Keep in mind that the tool nose radius is quite small (usually 1/64, 1/32, 3/64,
or 1/16 inch), meaning the deviation from the work surface caused by the tool
radius will also be quite small. It is possible that if you are only chamfering
corners to break sharp edges, you may not need tool nose radius compensation.
However, if the surfaces being machined are critical (morse taper, for example),
you must compensate for the radius of the tool. Also, you should only need tool
nose radius compensation when finishing. It can cause problems if used during
roughing operations due to the constant reversals in direction.
Keep in mind that the tool nose radius is quite small (usually 1/64, 1/32, 3/64, or
1/16 in); meaning the deviation from the work surface will also be quite small. It
is possible that if you are only chamfering corners to break sharp edges, you may
not need tool nose radius compensation. However, if the surfaces being machined
are critical (Morse taper, for example), you must compensate for the radius of the
tool. NOTE: you should only need tool nose radius compensation when finishing.
You should not use it for roughing operations.
61
can easily specify the direction of the taper (left or right) and the angle desired.
The operator fills in some offsets to tell the control the position of the upper guide
relative to the workpiece and the control does the rest.
Laser cutting machines also have a feature like cutter radius compensation to
keep the laser the radius of the laser beam away from the surface being
machined. CNC press breaks have a form of compensation to allow for bend
allowances based on the workpiece material and thickness. Generally speaking, if
the CNC user is faced with any unpredictable situations during programming, it is
likely that the CNC control manufacturer has come up with a form of
compensation to deal with the problem.
Word
NC programs are made up of blocks and each block is made up of words.
A word in the NC language consists of an address character and a digit or
sequence of digits representing an arithmetic value. The address character of the
word is usually a letter. The sequence of digits can contain a leading sign and
decimal point. The leading sign always appears between the address letter and
the sequence of digits. The positive leading sign(+) does not have to be specified.
Address + data is called ,,word‖:…G90 is a word…X-12.354 is a word.
Block №
An NC program consists of individual blocks. A block generally consists of several
words. A block should contain all the data required for performing an operation
step and is terminated with the end of block character (EOB).
In order to keep the block structure as clear as possible, the words in a block
should be arranged as follows:
N10 G…X…Y…Z…F…S…T…D…M…H…
The interval between EOB (CR) and EOB is expressed as a block:
G90 G00 X-12.354 all this is a block or
G01 Y11.20 F45 ,,
M08 ,,
Sequence №
Initial part of block can be attached with number by numerals within 8 digits
following the address №
It is called ,,Sequence №. It is not related with machining but only to help us
when look for some sequence №.
Program №
62
Be sure to use max. 8 digit numeral, after inputting O which is mark for head of
program. It is always on beginning of program. Don‘t forget the program without
Program № cannot be registered in CNC memory.
Example: O1111
Main program means that there is Program № on the head and M30 at the end.
Sub-program means that there is Program № at the head, and that there is M99
on the end of program.
63
G01X…Y…
G41X…Y…D………………………………..G41, G42, D Tool dia. compensation
M98P98
M30…………………………………………..M30 Program end
6. FORMATING PROGRAMS
Reason for formatting of programs
Before start writing programs we have to know how to how to format it.
As stated during key concept number one, the CNC control will execute a CNC
program in sequential order exactly as it is written. All commands necessary to
make the machine do the required operations must be included in the CNC
program in the proper order. And of course, part of learning how to program is
understanding the program structure a CNC machine requires.
To this point, you have been exposed to several features and programming
functions related to programming. With all the new ideas and commands
introduced, you may be getting somewhat confused trying to keep them all
straight. You may be worried about how you're going to memorize all of this.
1. One of the main reasons to strictly format CNC programs has to do with
making it easy to write your first few programs. When writing your first program,
the related commands will by no means be memorized. However, if you have
good example formats to go by, writing your first few programs will be much
easier.
We relate this to driving a car. It is unlikely that any driver can recite from
memory all road signs used to direct traffic. However, when a driver sees a road
sign, it is quite likely the driver will recognize its meaning. In the same way, it is
unlikely that even an experience CNC programmer could recite every word used
with CNC programming. But when even a relative newcomer to CNC sees a
command, it is likely its meaning will be remembered. One of our intentions with
program formatting is to keep you from having to memorize all commands
needed for programming. Instead, you will be looking at an example and simply
recollecting the function of each command.
2. A second reason for strict program formatting is consistency. Once you have
a format that works, use it. If you use the same format (or structure) for all
programs you write, you will be able to repeat past successes. If all programmers
in you company use the same format for a given CNC machine, each programmer
will be easily able to work on another's program.
3. The third (and most important) reason for strictly formatting programs is
related to multi tool jobs. Almost all CNC machining centre and turning centre
programs require that more than one tool in the program. For this kind of
program, there will be MANY times when it will be necessary to rerun only one
tool in the program a second, third, or fourth time.
Say for example, you have a machining centre program that uses ten tools. After
running a work-piece, you determine that the fifth tool in the program did not go
quite deep enough. After fixing the problem (changing tool offset or Z position in
program), you will need to run the fifth tool again. However, you would NOT want
to run the entire program just to get to tool number five. Doing so would be a
waste of time and may actually cause unwanted problems with workpiece
accuracy and finish. Instead, you will want to be able to run ONLY tool five a
second time.
To do so will require that ALL information necessary to get the machine running
(just like at the beginning of the program) is included at the beginning of tool
five. If the programmer makes certain assumptions related to modal information
from a previous tool, it may not be possible to run tool number five by itself.
64
Here is an example of a time when the programmer must include some redundant
information at the beginning of a tool in order to give the ability to rerun the tool.
In our previous ten tool example, we still wish to run tool number five a second
time. Say that tools four and five both run at 500 RPM. Say the last tool in the
program (tool number ten) runs at 1500 RPM. Spindle speed is modal. The
programmer may decide to leave out the S500 word at the beginning of tool five,
expecting it to carry over from tool four. After running the entire program, it is
determined that tool number five did not go deep enough. The operator fixes the
problem and intends to run only tool number five. In this case, tool number five
will start at the same spindle speed as the last tool in the program (1500 RPM),
not 500 RPM! This is but one time when redundant information must be
programmed from tool to tool in order to give the capability to rerun tools.
At the beginning of each tool, the programmer MUST include all information
necessary to begin the tool, even if it means including some redundant
information. In essence, the programmer must treat each tool as a mini-program
that can run separate from the rest of the program. When you think about it, this
actually simplifies the programming task, allowing the programmer to break a
seemingly complicated multi-tool program into smaller and easier to handle
pieces. Each tool makes up one piece of the program.
65
The best way is to take an example program that is currently running successfully
and break it up in the manner shown above. When doing this, analyse just what
each tool is doing to determine the various types of format. Ensure that each tool
contains all information needed to run independently.
Program configuration
A program is composed of following sections:
-Leader
-Program start
-Program section
-Comment
-Program end
NOTE: If you are working from scratch with a new CNC machines and have no
examples to go by, contact your machine tool builder to gain an understanding of
how your programs should be formatted. You may also find example programs
given within your machine tool builder's programming manual.
66
Were is it advisable or necessary to perform zero offset, rotation, mirroring or
scaling?
3. Create a machining plan
Define all the machining processes in steps:
-Rapid traverse movements for positioning
-Tool change positions
-Tool retractions for recalibrations
-Switching the spindle and coolant on and off
-Calling tool data
-In-feed (feeding)
-Path correction
-Approach to the contour
-Retract from the contour
-etc.
4. Translate the work steps into the programming language
Enter each individual step in an NC block or more blocks.
5. Combine all the individual steps in a program
One very good analogy to what happens in a CNC program is found in any set of
step by step instructions. Say for example, you have some visitors coming in
from out of town to visit your company. You need to write down instructions to
get from the local airport to your company. To do so, you must first be able to
visualize the path from the airport to your company. You will then, in sequential
order, write down one instruction at a time. The person following your
instructions will perform the first step and then go on to the next until he or she
reaches your facility.
Though slightly off the subject at hand, we wish to make a strong point about
visualization. Just as the person developing travel directions MUST be able to
visualize the path taken, so MUST the CNC programmer be able to visualize the
movements the CNC machine will be making BEFORE a program can be
successfully developed. Without this visualization ability, the programmer will not
be able to develop the movements in the program correctly. This is one reason
why machinists make the best CNC users. An experienced machinist should be
able to easily visualize any machining operation taking place.
Just as each concise travel instruction will be made up of one sentence, so will
each instruction given within a CNC program be made up of one command. Just
as the travel instruction sentence is made up of words (in English), so is the CNC
command made up of CNC words (in CNC language).
67
The person following your set of travel instructions will execute them explicitly. If
you make a mistake with your set of instructions, the person will get lost on the
way to your company. In similar fashion, the CNC machine will execute a CNC
program explicitly. If there is a mistake in the program, the CNC machine will not
behave correctly.
Program:
O0001 (Program number)
N005 G54 G90 S400 M03 (Select coordinate system, absolute mode, and
turn spindle on CW at 400 RPM)
N010 G00 X1. Y1. (Rapid to XY location of first hole)
N015 G43 H01 Z.1 M08 (Instate tool length compensation, rapid in Z to
clearance position above surface to drill, turn on coolant)
N020 G01 Z-1.25 F3.5 (Feed into first hole at 3.5 inches per minute)
N025 G00 Z.1 (Rapid back out of hole) N030 X2. (Rapid to second hole)
N035 G01 Z-1.25 (Feed into second hole)
N040 G00 Z.1 M09 (Rapid out of second hole, turn off coolant)
N045 G91 G28 Z0 (Return to reference position in Z)
N050 M30 (End of program command)
While the words and commands in this program probably do not make much
sense to you (yet), remember that we are stressing the sequential order by which
the CNC program will be executed. The control will first read, interpret and
execute the very first command in the program. Only then will it go on to the
next command. Read, interpret, execute. Then on to the next command. The
control will continue to execute the program in sequential order for the balance of
the program. Again, notice the similarity to giving any set of step by step
instructions.
As you can see, many of the letter addresses are chosen in a rather logical
manner (T for tool, S for spindle, F for feed-rate, etc.). A few require
memorizing.
68
There are two letter addresses (G and M) which allow special functions to be
designated. The preparatory function (G) specifies is commonly used to set
modes. We already introduced absolute mode, specified by G90 and incremental
mode, specified by G91. These are but two of the preparatory functions used. You
must reference your control manufacturer's manual to find the list of preparatory
functions for your particular machine.
To a beginner, all of this may seem like CNC programming requires a great deal
of memorization. But rest assured that there are only about 30-40 different words
used with CNC programming. If you can think of learning CNC manual
programming as like learning a foreign language that has only 40 words, it
shouldn't seem too difficult.
Certain letter addresses (CNC words) allow the specification of real numbers
(numbers that require portions of a whole number). Examples include X axis
designator (X), Y axis designator (Y), and radius designator (R). Almost all
current model CNC controls allow a decimal point to be used within the
specification of each letter address requiring real numbers. For example, X3.0625
can be used to specify a position along the X axis.
On the other hand, some letter addresses are used to specify integer numbers.
Examples include the spindle speed designator (S), the tool station designator
(T), sequence numbers (N), preparatory functions (G), and miscellaneous
functions (M). For these word types, most controls do NOT allow a decimal point
to be used. The beginning programmer must reference the CNC control
manufacturer's programming manual to find out which words allow the use of a
decimal point.
Programming samples:
Experience and judgment are extremely valuable in selecting the correct milling
feeds. Even though suggested rate tables are given. remember that these are
suggestions only. Feeds are governed by many variable factors, such as the
degree of finish required. Using a coarse feed, the metal is removed more rapidly
but the appearance and accuracy of the surface produced may not reach the
standard desired for the finished product. Because of this fact, finer feeds and
increased speeds are used for finer, more accurate finishes, while for roughing, to
use a comparatively low speed and heavy feed. More mistakes are made on over-
speeding and underfeeding than on under-speeding and overfeeding.
69
Next Sample:
70
Point Commanded coordinates
1&7 X80000 Z20400
2 X18500 Z20400
3 X18500 Z12000
4 X19000 Z12000
5 X19000 Z10000
6 X20000 Z10000
In this example, sample programming for straight line cutting is executed. The
machining origin (work-piece or program zero point) can be established as
desired.. It is desirable, however, to set it at the centre of the chucked side face
of the work-piece as shown for easy programming and to minimize programming
errors.
When the machining origin is established at the point as mentioned above,
dimensions of diameter are directly designated as X value, and the longitudinal
dimensions are programmed as the distance from the origin in Z value.
71
Programming sample for circular arc cutting
72
Programming example:
73
Milling a groove
74
Example program showing three types of motion.
G01 X ( ) ( ) ( ) ( ) ( ) ( ) Y ( ) ( ) ( ) ( ) ( ) Z ( ) ( ) ( ) ( ) ( ) ( ) F ( ) ( ) ( ) ( )
CR
By commands as programmed in the above format, a cutting tool will be moved
at a specified federate (f word) along a straight line path to a specified coordinate
point (X, Z).When programming use claiming way of tool motion.
In this particular example, we are milling around the outside of a workpiece
contour. Notice that we are using a one inch diameter endmill for machining the
contour and we are programming the very centre of the end mill. Later, during
the course, we will discuss a way to actually program the workpiece contour (not
the cutter centreline path). While you may not understand all commands given in
this program, concentrate on understanding what is happening in the motion
commands (G00, G01, and G02/G03). With study, you should be able to see what
is happening. Messages in parentheses are provided to document what is
happening in each command.
Sample of program:
O0002 (Program number)
N005 G54 G90 S350 M03 (Select coordinate system, absolute mode, and start
spindle CW at 350 RPM)
N010 G00 X-.625 Y-.25 (Rapid to point 1)
N015 G43 H01 Z-.25 (Instate tool length compensation, rapid tool down to work
surface)
N020 G01 X5.25 F3.5 (Machine in straight motion to point 2)
N025 G03 X6.25 Y.75 R1.0 (CCW circular motion to point 3)
N030 G01 Y3.25 (Machine in straight motion to point 4)
N035 G03 X5.25 Y4.25 R1.0 (CCW circular motion to point 5)
N040 G01 X.75 (Machine in straight motion to point 6)
N045 G03 X-.25 Y3.25 R1.0 (CCW circular motion to point 7)
N050 G01 Y.75 ((Machine in straight motion to point 8)
N055 G03 X.75 Y-.25 R1.0 (CCW circular motion to point 9)
N060 G00 Z.1 (Rapid away from work piece in Z)
N065 G91 G28 Z0 (Go to the machine's reference point in Z)
N070 M30 (End of program)
Keep in mind that CNC controls do vary with regard to limitations with motion
types. For example, some controls have strict rules governing how much of a full
circle you are allowed to make within one circular command. Some require
directional vectors for circular motion commands instead of allowing the R word.
Some even incorporate automatic corner rounding and chamfering, minimizing
the number of motion commands that must be given. Though you must be
prepared for variations, and you must reference your control manufacturer's
programming manual to find out more about your machine's motion commands,
at least this presentation has shown you the basics of motion commands and you
should be able to adapt to your particular machine and control with relative ease.
75
N6 G71 P7 Q9 U.05 W.005 F.015(P7 tells the control to look at N7 and Q9 to
look at N9, this is
how we give the motions describing the part.
U is the amount of stock left for finishing on the OD, W is the amount left on
the shoulder.
N7 G0 X2.0
N8 G1 Z-1.0
N9 X4.0
N10 G0 X6.0 Z6.0 M9(Rapid back to a position clear of the part, turn coolant
off)
N11 M30( End of program)
Notes: The 6T version has a single line and so do various Yasnac controls,
they look like this:
N5 G71 P7 Q9 U.05 W.005 D1500 F.015(D= depth of each pass and has to be
given as a value
without a decimal point)
This cycle is normally followed by G70( Finish Cycle) after tool change to a
finish tool. Rapid to the
same position for the start of the G71, then program G70 P7 Q9.
Typical mistakes:
Typical mistakes made by the programmer and how you can diagnose these
problems as they occur are:
1. Syntax mistakes are made when the control is not able to execute the
command given to the machine and it‘s usually made when a program is
entered manually.
2. Motion mistakes are harder to diagnose and since they deal with motion
they‘re generally caused by incorrect coordinates. Even if a CNC program
is perfectly written, there can still be errors made during the set-up
calculations.
3. Measurements, like tool lengths and diameters, may have to be made
regarding the setup and numbers entered into the control before the
program is executed.
4. Omission mistakes are forgetful mistakes when a manual programmer
leaves a decimal point out or forgets to put in the feed rate.
Another procedure used to verify programs has to do with the feed hold button.
Always having a finger on the feed hold button is a good idea in case an
unexpected rapid motion takes place. Also the machine lock and dry run switches
allow the control to scan the program for syntax mistakes. During the program,
the spindle will come on, the turret will index, and the control will appear to be
actually running the program. A free flowing dry run is a check for motion
problems. During this procedure, the operator will turn the machine lock switch to
its lowest position and set the rapid override switch to its slowest motion rate.
Sometimes this procedure may be repeated several times to make sure the
motions are correct. Before running the first workpiece, the operator must
execute the cycle once more with the dry run switch turned off. This allows the
operator to see one thing that could not be seen during a free flowing dry run.
There are some procedures that can help ensure the tool will machine precisely to
size:
76
2. Adjust the tool offsets for the tool to machine to size and check to see what
direction it‘s leaving excess stock.
3. Allow the tool to completely machine the workpiece.
Measure what the tool has done, rerun the tool, and confirm measurements that
the new offset values are correct.
Even though these safety and verification procedures seem like a great deal of
work, it is easily justified when compared to the possible losses and
consequences of down time.
77
Selecting cutting conditions for each particular tool is crucial in process of
programming. It requires knowledge and experience.
Mounting method
Clamp with vice-mouth piece by taking a step:
78
Relation with Work-coordinate system
By the specified procedure and work standard face (manual), make touch sensor
contact with P1>P2>P3 thereby –X, _Y can be set automatically to the desired
work coordinate (G54~G59)
Make touch sensor contact to 1 point (top face of workpiece), thereby, Z- is set at
work coordinate (G54~G59) of CRT screen. Z0 face is memorized in machine.
Before machining is started, the automatic running check of created program
should be done by, DRY RUN” function, if program can operate.
79
G00 G17 G40 G49 G64 G80 G90 G98 Set the inside of NC head at initial state.
M01 Optional stop
N101 (95 dia. cutter T01 H01) Sequence number, memo writing
T01 M06 Tool no 1 to spindle by tool change
G54 Work coordinates G54
G68 Coordinate rotation automatic setter
effective.
G90 G00 X260.Y115.S320 T02 Absolute spindle rotation320, calling next tool T02
G43 Z30. H01 Tool length compensation No.H1 is effective. Tool
nose is positioned to Z30.
M03 Spindle starts forward turn.
G01 Z0 F3000 Tool nose reach to Z0 face (finishing face)
G00 X-60. Y115. F320 Cutting, feeding 320 m/min to column side of chip
G00 Z30. Escape of Z axis up to the height of approach once
X260. Y35. X…Y…positioning with rapid traverse
G01 Z0 F3000 Reaching Z axis Z0 face with speed 3000mm/min
G01 X-60.Y35. F320 Cutting
G69 Coordinate rotation cancel
M01 Stop with switch ON (optional stop) while
passing with OFF
Boring 30dia
N102 (30mm BORING T02 H02) the inside ( ) of sequence No means memo.
T02 M06 Toolchange T2 to spindle by ATC operation
G54 Work coordinates G54
G68 Coordinate rotation automat. Setter active
G90 G00 X30.Y75.S800 T03 Absolute, X,Y, Spindle speed selection800prm,
Calling T03 in waiting position,
G43 Z30. H02 Tool length compensation H02 plus side offset, tool
nose position Z30.
M03 Spindle forward turn ON
G98 G81 R3.0 Z-22. F160 Boring canned cycle, initial point return, cutting
start position 3mm frontward, 22 depth
X100.Y75. XY positioning, other operations are the same as
those of previous block.
X170. Y75. XY same as the above
G69 Cord. Rotation cancel
G80 Canned cycle cancel
M01 Optional stop
80
Centre 18mm
N103 (CENTER 18MM T03 H03)
T03 M03 With ATC T03 to spindle
G54
G68
G90 G00 X50. Y125. S1200 T04 During X…Y… positioning operation, spindle
speed is selected, 1200rpm, T04 call
G43 Z30. H03 Offset of tool length H03 alone to Z plus side
M03
G99 G81 R3.0 Z-5.5 F120 L0 With R point return, and drill canned cycle L0,
no operation is made by this block
M98 P100 To subprogram of hole position coordinate
G69
G80
M01
Drill 8.5mm
N104 (DRILL 8.5MM T04 H04)
T04 M06
G54
G68
G90 G00 X50. Y125. S820 T05 Coordinate rotation effective 820rpm selection
and T05 call during the movement of work
coordinate G54.
G43 Z30. H04 Offset of H04 value to Z axis plus side, tool
nose to Z30. position
81
M03
G99 G81 r0 Z-24. F164 L0 With R point return and drill canned cycle L0,
no operation is made by this block
M99 P100 To subprogram of hole pos. coordinate
G69
G80 Canned cycle cancel
M01 Optional stop
Tapping M10
N105 (TAP M10xP1.5 T05 H05)
T05 M06
G54
G68
G90 G00 X50.Y125. S320 T06 Spindle speed selection 320rpm, next tool
T06 Call
G43 Z30. H05
M03
G98 G84 R10. Z-25. F480 L0 Initial point return, with tap canned cycle L0, in
this block no tapping operation is done.
M98 P100 Tap canned cycle hole position to the same
subprogram as in lower hole.
G69
G80
M01
82
Boring finishing 30mm
N106 (BORING FINISHING 30MM T06 H06)
T06 M06
G54
G68
G90 G00 X30. Y75. S1600 T01 Initial tool T01 call
G43 Z30. H06
M03
G99 G76 R2. Z-22. Q0.5 F96 R point return with canned cycle of
finishing Boring.
X100.Y75. The above operation XY positioning,
after the boring operation is done
X170.Y75. Same as the above
G69
G80
M01
G91 G28 Z0 M05 Z axis point return. spindle turn stop
G28 X0 Y0 X, Y axis zero point return
M30 End of program
83
Example G03
%:1004
N05 G90 G20 G17
N10 M06 T2
N15 M03 S1200
N20 G00 X2 Y0.5
N25 Z0.125
N30 G01 Z-0.125 F5
N35 X3 F15
N40 G03 X3.5 Y1 R0.5 (G03 ARC USING R VALUE)
N45 G01 Y3
N50 G03 X3 Y3.5 I-0.5 J0 (G03 ARC USING I AND J)
N55 G01 X2
N60 G03 X2 Y1.5 I0 J-1 (180 DEGREE ARC USING I AND J)
N65 G01 Y0.5
N70 G00 Z0.1
N75 X1.5 Y2.5
N80 G01 Z-0.25 F5
N85 G03 X1.5 Y2.5 I0.5 J0 (FULL CIRCLE USING I AND J)
N90 G00 Z1
N95 X0 Y0
N100 M05
N105 M30
Tips:
Rectangular coordinate system for X-Y plane. The program zero point
establishes the point of reference for motion commands in a CNC program. This
allows the programmer to specify movements from a common location. If
program zero is chosen wisely, usually coordinates needed for the program can
be taken directly from the print.
84
Drilling centre
85
Sample of program for CNC lathe:
O 185 (Program №)
N1111 M02
N1 G00 G97 S1500 M03 T500
M98 P1111 (subprogram call for geometry offsets)
X45. Z50. T5
Z34.2 M08
G01 X-1.5 F0.1
G00 Z35. X45.
Z33.125
G01 X-1.5 F0.1
G00 Z34. X40.
G01 X34.5 F.1
X23. F0.1
G00 X35.5 Z34.
X31.7
G01 X33.25 Z32. F0.1
Z26.62
G00 X100. Z200. T0
86
G01 Z-37. F0.12
G00 Z50.
X200. Z200. T0
N2 G91 G28 Z0
N4 M61 (PALLET 1 IN)
N6 M98 P0058
N8 M01
N10 G91 G28 Z0
N12 M62 (PALLET 2 IN)
N14 M98 P0059
N16 M01
N20 M99
O 0058
N2 G10 G90 L2 P1 X-119.8 Y103.8 Z-613.4
N4 G10 G90 L2 P2 X120.8 Y103.5 Z-613.4
N6 G10 G90 L2 P3 X-120.45 Y103.3 Z-613.7
N8 G10 G90 L2 P4 X121.2 Y103.4 Z-613.7
N10 M98 P0098 (tool change pos)
87
B90
/G00 G90 G54 G43 X21. Y130. Z60.2 S250 M3 H31 T33
M47
/M98 P101
G00 G90 G55 G43 X21. Y130. Z60.2 S250 M3 H31 T33
M98 P101
G00 G91 G28 Z0
B270
/G00 G90 G56 G43 X21. Y130. Z60.2 H31
/M98 P101
G00 G90 G57 G43 H31 X21. Y130. Z60.2
M98 P101
M98 P0098 (tool change pos)
T33 M6 (T33 R/BORE)
B270
G00 G90 G57 G43 X0 Y150. Z6. S350 M03 H33 T34
M47
M98 P103
/G00 G90 G56 G43 X0 Y150. Z6. H33
/M98 P103
G00 G91 G28 Z0
B90
G00 G90 G54 G43 X0 Y150. Z6. H33 S350 M3 T34
M98 P103
G00 G90 G55 G43 X0 Y150. Z6. H33
M98 P103
M98 P0098 (tool change pos)
T34 M6 (T34 STAGE B/BAR)
B90
/G00 G90 G54 G43 X0 Y100. Z25. S420 M03 H34 T35
M47
/M98 P104
G00 G90 G55 G43 X0 Y100. Z25. S420 M03 H34 T35
M98 P104
G00 G91 G28 Z0
B270
G00 G90 G57 G43 X0 Y100. Z25. H34
M98 P104
/G00 G90 G56 X0 Y100. Z25.
/M98 P104
M98 P0098
T35 M06 (T35 CENTRE DEX)
B270
/G00 G90 G56 G43 X-115. Y-8.95 Z120. S1000 M03 H35 T36
M47
/M98 P105
G00 G90 G57 G43 X-115. Y-8.95 Z120. S1000 M13 H35 T36
M98 P105
G00 G91 G28 Z0
B90
/G00 G90 G54 G43 X-115.Y-8.95 Z120. H35 S1000 M03 T36
/M98 P105
G00 G90 G55 X-115. Y-8.95 Z-13. H35 M08
M98 P105
M98 P0098
T36 M06 (T36 8.2MM DRILL)
B90
88
/G00 G90 G54 G43 X-83. Y-8.85 Z120. S2300 M03 H36 T37
M47
/M98 P106
G00 G90 G55 G43 X-83. Y-8.95 Z120. S2300 M03 H36 T37
M98 P106
G00 G91 G28 Z0
B270
/G00 G90 G56 G43 X-83. Y-8.95 Z120. H36
/M98 P106
G00 G90 G57 X-83. Y-8.95 Z120. H36
M98 P106
M98 P0098
T37 M06 (T37 ROUGH SEAL GROOVE)
B270
/G00 G90 G56 G43 X0 Y100. Z25. S700 M03 H37 T38
M47
/M98 P107
G00 G90 G57 G43 X0 Y100. Z25. S700 M03 H37 T38
M98 P107
G00 G91 G28 Z0
B90
G00 G90 G55 G43 X0 Y100. Z25. H37 S700 M03 T38
M98 P107
/G00 G90 G54 X0 Y100. Z25.
/M98 P107
M98 P0098
T38 M6 (T38 FINISH BOOT GROOVE)
B90
/G00 G90 G54 G43 X0 Y150. Z30. S960 M03 H38 T39
M47
/M98 P108
G00 G90 G55 G43 X0 Y150. Z30. S960 M03 H38 T39
M98 P108
G00 G91 G28 Z0
B270
G00 G90 G57 G43 X0 Y150. Z30. H38
M98 P108
/G00 G90 G56 X0 Y150. Z30.
/M98 P108
M98 P0098
T39 M6 (T39 FINISH BORE)
B270
/G00 G90 G56 G43 X0 Y150. Z5. S650 M03 H39 T40
M47
/M98 P109
G00 G90 G57 G43 X0 Y150. Z5. S650 M03 H39 T40
M98 P109
G00 G91 G28 Z0
B90
/G00 G90 G54 G43 X0 Y150. Z5. H39 S650 M03 T40
/M98 P109
G00 G90 G55 X0 Y150. Z5. H39
M98 P109
M98 P0098
T40 M6 (T40 FINISH SEAL GROOVE)
B90
/G00 G90 G54 G43 X0 150. Z20. S1450 M03 H40 T2
89
M47
/M98 P110
G0 G90 G55 G43 X0 Y150. Z20. S1450 M03 H40 T2
M98 P110
G00 G91 G28 Z0
B270
G00 G90 G57 G43 X0 Y150. Z20. H40
M98 P110
/G00 G90 G56 X0 Y150. Z20.
/M98 P110
M98 P0098
T2 M6 (T2 289MM DIA S&F CUTTER)
B90
/G00 G90 G54 G43 X0 Y200. Z59.19 S200 M03 H41 T31
M47
/M98 P112
G00 G90 G55 G43 X0 Y200. Z59.19 S200 M03 H41 T31
M98 P112
G00 G91 G28 Z0
B270
/G00 G90 G56 G43 X0 Y200. Z59.19 S200 M03 H41
/M98 P112
G00 G90 G57 X0 Y200. Z59.19 S200 M03 H41
M98 P112
M98 P0098 (tool change pos)
G90 M99
O 0059 (SUBPROGRAM)
90
M98 P103
G00 G90 G55 X0 Y150. Z6. H33 S350 M03
M98 P103 M98 P0098
T34 M06 (T34 STAGE B/BAR)
B90
G00 G90 G54 G43 X0 Y100. Z25. S420 M03 H34 T35
M47
M98 P104
G00 G90 G55 G43 X0 Y100. Z25. S420 M03 H34
M98 P104
G0 G91 G28 Z0
/B270
/G00 G90 G57 G43 X0 Y100. Z25. H34
/M98 P104
/G00 G00 G56 X0 Y100. Z25.
/M98 P104
M98 P0098
T35 M06 (T35 CENTRE DEX)
/B270
/G00 G90 G56 G43 X-115. Y-8.95 Z120. S1000 M03 H35 T36
M47
/M98 P105
/G00 G90 G57 G43 X-115. Y-8.95 Z120. M03 S1000 H35 T36
/M98 P105
/G0 G91 G28 Z0
B90
G0 G90 G54 G43 X-115. Y-8.95 Z120. H35 S1000 M03 T36
M98 P105
G00 G90 G55 X-115.Y-8.95 Z120. H35 S1000 M03
M98 P105
M98 P0098
T36 M06 (T36 8.2MM DRILL)
B90
G00 G90 G54 G43 X-83. Y-8.85 Z120. S2300 M03 H36 T37
M47
M98 P106
G00 G90 G55 G43 X-83.Y-8.95 Z120. S2300 M03 H36
N126 M98 P106
N128 G00 G91 G28 Z0
/N130 B270
/N132 G00 G90 G56 G43 X-83.Y-8.95 Z120.H36
/N134 M98 P106
/N136 G00 G90 G57 X-83.Y-8.95 Z-13.
/N138 M98 P106
N140 M98 P0098
N142 T37 M6 (T37 ROUGH S/GROOVE)
/N144 B270
/N146 G00 G90 G56 G43 X0 Y100.Z25.S700 M03 H37 T38
M47
/N148 M98 P107
/N150 G00 G90 G43 G57 X0 Y100.Z25.H37 M03 S700 T38
/N152 M98 P107
/N154 G00 G91 G28 Z0
N156 B90
N158 G00 G90 G55 G43 X0 Y100.Z25.H37 S700 M03 T38
N160 M98 P107
N162 G00 G90 G54 X0 Y100.Z25.S700 M03
91
N164 M98 P107
N166 M98 P0098
N168 T38 M6 (T38 FINISH B/GROOVE)
N170 B90
N172 G00 G90 G54 G43 X0 Y150.Z30.S960 M03 H38 T39
M47
N174 M98 P108
N176 G00 G90 G55 G43 X0 Y150.Z30.S960 M03 H38
N178 M98 P108
N180 G00 G91 G28 Z0
/N182 B270
/N184 G00 G90 G57 G43 X0 Y150.Z30.H38
/N186 M98 P108
/N188 G00 G90 G56 G56 X0 Y150.Z30.
/N190 M98 P108
M47
/N200 M98 P109
/N202 G00 G90 G43 G57 X0 Y150.Z5.M03 S650 H39 T40
/N204 M98 P109
/N206 G00 G91 G28 Z0
N208 B90
N210 G00 G90 G54 G43 X0 Y150.Z5.H39 S650 M03 T40
N212 M98 P109
N214 G00 G90 G55 X0 Y150.Z5.H39 S650 M03
N216 M98 P109
N218 M98 P0098
N220 T40 M6(T40 FINISH S/GROOVE)
N222 B90
N224 G00 G90 G54 G43 X0 Y150.Z20.S1450 M03 H40 T2
M47
N226 M98 P110
N228 G00 G90 G55 G43X0 Y150.Z20.S1450 M03 H40
N230 M98 P110
N232 G00 G91 G28 Z0
/N234 B270
/N236 G00 G 90 G57 G43 X0 Y 150.Z20.H40
/N238 M98 P110
/N240 G00 G90 G56 X0 Y150.Z20.
/N242 M98 P110
N244 M98 P0098
N272 T2 M6(289 DIA S & F CUTTER)
N274 B90
N276 G00 G90 G54 G43 X0 Y200.Z59.19 S200 M03 H41 T31
M47
N278 M98 P112
N280 G00 G90 G55 G43 X0 Y200.Z59.19 S200 M03 H41 T31
N282 M98 P112
N284 G00 G91 G28 Z0
/N286 B270
/N288 G00 G90 G56 G43 X0 Y200.Z59.19 S200 M03 H41
92
/N290 M98 P112
/N292 G00 G90 G57 X0 Y200.Z59.19 S200 M03
/N294M98P112
N296 M98 P0098
N298 G90 M99
DRILLING CENTER
0001 ( HOUSING MAIN PRG.)
93
G57 X60. Y-14
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T3 19MM CORE DRILL)
G0 G90 G54 G43 X-60. Y14. Z0 S1300 M03 H03 T04
G98 G73 Z-104.5 R-48. Q15. F150 M08
G55 X-60. Y-14.
G56 X-60. Y14.
G57 X-60. Y-14.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T4 16.05 MM REAMER)
G0 G90 G54 G43 X60. Y14. Z0 S750 M03 H04 T05
G98 G81 Z-104. R-48. F300 M08
G55 X60. Y-14.
G56 X60. Y14.
G57 X60. Y-14.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T5 5.6 B. DRILL)
G0 G90 G54 G43 Y-12.983 X-9.352 Z0 S4000 M3 H05 T06
G98 G81 Z-56.25 R-40. F500 M08
G55 Y12.983 X-9.352
G56 Y12.983 X-9.352
G57 Y12.983 X-9.352
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T6 40.MM CENTRE DEX)
G0 G90 G54 G43 X-60. Y14. Z0 S2000 M3 H06 T07
G98 G81 Z-61. R-48. F100
G55 X-60. Y-14.
G56 X-60. Y14.
G57 X-60. Y-14.
G57 X60. Y-14. Z-52. R-48.
G56 X60. Y14.
G55 X60. Y-14.
G54 X60. Y14.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T07 32.0MM CENTREDEX)
G0 G90 G54 G43 Y-3. X23.3 Z0 S2000 M3 H07 T08
G98 G81 Z-41. R-35. F180 M08
G55 Y3. X23.3
G56 Y-3. X23.3
G57 Y3. X23.3
G57 Y21. X-7. Z-46.6 R-40. F70
G56 Y-21. X-7.
G55 Y21. X-7.
G54 X-21. X-7.
G54 Y-17.5 X-59.5 Z-80. R-73.
G55 Y17.5 X-59.5
G56 Y-17.5 X-59.5
G57 Y17.5 X-59.5
G57 Y17.5 X59.5
G56 Y-17.5 X59.5
G55 Y17.5 X59.5
G54 Y-17.5 X59.5
94
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T8 45‘ CENTRE DRILL)
G0 G90 G54 G43 X-9.352 Y-12.983 Z0 S2000 M3 H08 T09
G98 G81 Z-49.5 R-45. F200 M08
Y-17.9 X9. Z-53.5 R-45.
Y3. X23.3 Z-45.8 R-38.
G55 Y3. X23.3 Z-45.8 R-38.
Y17.9 X9. Z-53.5 R-45.
Y12.983 X-9.352 Z-49.5 R-45.
G0 G90 G56 G43 X-9.352 Y-12.983 Z0 S2000 M3 H08
G98 G01 Z-49.5 R-45. F200 M08
Y-17.9 X9. Z-58.5 R-45.
Y-3. X23.3 Z-45.8 R-38.
G57 Y3. X23.3 Z-45.8 R-38.
Y17.9 X9. Z-53.5 R-45.
Y12.983 X-9.352 Z-49.5 R-45.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T9 ROUGH C/BORE)
G0 G90 G54 G43 X60. Y14. Z0 S800 M3 H09 T10
G98 G81 Z-55.5 R-48. F70 M08
G55 X60. Y-14.
G56 X60. Y14.
G57 X60. Y-14.
G58 X0 Y0
G59 X0 Y0
G59 X0 Y108.
G59 X0 Y172.08
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T10 FINISH SPOT TOOL)
G0 G90 G54 G43 X60. Y14. Z0 S500 M3 H10 T11
G98 G81 Z-56. R-50. F50 P300 M8
G55 X60. Y-14.
G56 X60. Y14.
G57 X60. Y-14.
G58 X0 Y0
G59 X0 Y0
G59 X0 Y108.
G59 X0 Y172.08
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T11 9MM CARBIDE DRILL)
G0 G90 G54 G43 Y-17.9 X9. Z0 S3000 M3 H11 T12
G98 G81 Z-66. R-45. F300 M08
G54 Y-3. X23.3 Z-52.8 R-40.
G55 Y3. X23.3 Z-52.8 R-40.
G55 X17.9 X9. Z-66. R-45.
G56 Y-17.9 X9. Z-66.8 R-45.
G56 Y-3. X23.3 Z-52.8 R-40.
G57 Y3. X23.3 Z-52.8 R-40.
G57 Y17.9 X23.3 Z-66. R-45.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T12 23.MMSPOT FACE)
G0 G90 G54 G43 Y-17.9 X9. Z0 S300 M3 H12 T13
95
G0 Z-37. M8
G01 Z-48.5 F40
G04 P300 (dwelling)
G0 G90 Z0
G0 G55 X9. Y17.9
G0 Z-37.
G01 Z-48.5 F40
G04 P300
G0 G90 Z0
G0 G56 Y-17.9 X9.
G0 Z-37. M08
G01 Z-48.5 F40
G04 P300
G0 G90 Z0
G0 G57 X9. Y17.9
G0 Z-37.
G01 Z-48.5 F40
G04 P300
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T13 3.2MM DRILL)
G0 G90 G54 G43 Y-3. X23.3 Z0 S2000 M3 H13 T14
G98 G81 Z-67. R-45. F200 M08
G55 Y3. X23.3
G56 Y-3. X23.3
G57 Y3. X23.3
Nedostaje…
G30Y0
M06 (T14 M10X1 TAP)
G0 G90 G54 G43 Y-17.9 X9. Z0 S300 M3 H14 T15
G98 G84 Z-66. R-40. F300 P0 M8
Y-3 X23.3 Z-50.8 R-35.
G55 Y3. X23.3
Y17.9 X9. Z-66. R-40.
G56 Y-17.9 X9.
Y-3 X23.3 Z-50.8 R-35
G57 Y3. X23.3
Y17.9 X9. Z-66. R-40.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M06 (T15 6.6 CARBIDE DRILL)
G0 G90 G54 G43 Y-22.5 X-39. Z0 S3500 M3 H15 T01
G98 G81 Z-103. R-87. F400 M08
G54 Y22.5 X39.
G55 Y22.5 X39.
G55 Y22.5 X-39.
G56 Y-22.5 X-39.
G56 Y-22.5 X-39.
G57 Y22.5 X39.
G57 Y22.5 X-39.
G0 G91 G80 G28 Z0 X0 M09
G30 Y0
M99
96
Other programmable functions
All but the very simplest CNC machines have programmable functions other than
just axis motion. With today's full blown CNC equipment, almost everything about
the machine is programmable. CNC machining centers, for example, allow the
spindle speed and direction, coolant, tool changing, and many other functions of
the machine to be programmed. In similar fashion, CNC turning centers allow
spindle speed and direction, coolant, turret index, and tailstock to be
programmed. And all forms of CNC equipment will have their own set of
programmable functions. Additionally, certain accessories like probing systems,
tool length measuring systems, pallet changers, and adaptive control systems
may also be available that require programming considerations.
The list of programmable functions will vary dramatically from one machine to the
next, and the user must learn these programmable functions for each CNC machine to
be used. In key concept number two, we will take a closer look at what is typically
programmable on different forms of CNC machine tools.
Canned cycles (G73 ~ G89) - Functions to simplify
programming
Canned cycles:
-----------------------------------------------------------------------------------------------------
G code Drilling Operation at the Retraction Application
(-Z direction) Bottom of a hole (+ Z
direction)_________________________________________________________________
___ -----------------------------------------------------------------------------------------------
------
G73 Intermittent _ Rapid traverse High speed peck
feed drilling cycle
G74 Feed Spindle CW Feed Left-hand
tapping cycle
G76 Feed Oriented spindle Rapid traverse Fine boring cycle
Stop
G80 _ _ _ Cancel
G81 Feed _ Rapid traverse Drilling cycle,
Spot drill.
cycle
G82 Feed Dwell Rapid traverse Drilling cycle,
Counter
boring c.
G83 Intermittent _ Rapid traverse Peck drill. cycle
feed
G84 Feed Spindle CCW Feed Tapping cycle
___________________________________________________________________
G85 Feed _ Feed Boring cycle
G86 Feed Spindle stop Rapid traverse Boring cycle
G87 Feed Spindle stop Manual/Rapid Boring cycle,
traverse Back boring
cycl
G88 Feed Dwell > spindle Manual/Rapid Boring cycle
Stop traverse
G89 Feed Dwell Feed Boring cycle
97
It extends to the several blocks, but by using canned cycles it is enabled by
command of one block. It explains what elements a canned cycle consists of.
Movement details:
With canned cycle, movement of 1~6 can be executed as one cycle.
1. Positioning to the hole position
2. Rapid traverse to R point
3. Hole-machining to Z point
4. Operation at hole bottom
5. Return up to R point
6. Rapid traverse up to the initial point
After finishing step 6. cycle goes back to step 1.
98
Data type:
99
Canned cycle (G73, G74)
Detail of movement:(see next drawings)
G74 – this cycle performs left-handed tapping cycle, when the bottom of the hole is
reached, the spindle rotates clockwise for retraction.
M3 S2000
G90 G99 G73 X300. Y-250. Z-150. R-100.Q15. F120
Y-550.
Y-750.
X1000.
Y-550.
G98 Y-750.
G80 G28 X0 Y0 Z0
M5
100
Example 1 - Use of a canned cycle as a modal motion code
101
n140 x3
n150 x4
n160 y1 z0.5
n170 x3
n180 x2
n190 x1
n200 g80 (turn off canned cycle)
n210 g0 x0 (rapid home moves)
n220 y0
n220 z0
n220 m2 (program end)
The use of G80 in line n200 is optional because the G0 on the next line will turn
off the G81 cycle. But using the G80. as example 1 shows, will provide for an
easily readable canned cycle. Without it, it is not so obvious that all of the blocks
between n120 and n200 belong to the canned cycle.
If you use G80 and do not set another modal motion code soon after, you may
get one of the following error messages.
G81 Cycle
Suppose the current position is (1, 2, 3) and the following line of NC code is
interpreted.
102
3. a feed parallel to the Z-axis to (4,5,1.5)
4. a traverse parallel to the Z-axis to (4,5,3)
Example 3
- Relative
Position
G81
Suppose the current position is (1, 2, 3) and the following line of NC code is
interpreted.
The first preliminary move is a traverse along the Z axis to (1,2,4.8), since
OLD_Z < clear Z.
103
1. a traverse parallel to the XY-plane to (13,17,4.8)
2. a feed parallel to the Z-axis to (13,17, 4.2)
3. a traverse parallel to the Z-axis to (13,17,4.8)
Example 4 - Absolute G81 R > Z
Now suppose that you execute the first g81 block of code but from (0, 0, 0)
rather than from (1, 2, 3).
G82 Cycle
104
Would be equivalent to example 2 above with a dwell added at the bottom of the
hole.
G83 Cycle
The G83 cycle is intended for deep drilling or milling with chip breaking. The dwell
in this cycle causes any long stringers (which are common when drilling in
aluminium) to be cut off. This cycle takes a Q value which represents a "delta"
increment along the Z-axis. Machinists often refer to this as peck drilling.
G84 Cycle
G85 Cycle
G86 Cycle
105
4. Retract the Z-axis at traverse rate to clear Z.
5. Restart the spindle in the direction it was going.
This cycle is very similar to G82 except that it stops the spindle before it retracts
the tool and restarts the spindle when it reaches the clearance value R.
G87 Cycle
The situation is that you have a through hole and you want to counter bore the
bottom of hole. To do this you put an L-shaped tool in the spindle with a cutting
surface on the UPPER side of its base. You stick it carefully through the hole when
It is not spinning and is oriented so it fits through the hole, then you move it so
the stem of the L is on the axis of the hole, start the spindle, and feed the tool
upward to make the counter bore. Then you stop the tool, get it out of the hole,
and restart it.
This cycle uses I and J values to indicate the position for inserting and removing
the tool. I and J will always be increments from the X position and the Y position,
regardless of the distance mode setting. This cycle also uses a K value to specify
the position along the Z-axis of the top of counterbore. The K value is an absolute
Z-value in absolute distance mode, and an increment (from the Z position) in
incremental distance mode.
106
Example 6 - Backbore
Example six uses a incremental distances from (0, 0, 0) so the preliminary moves
look much like those in example five but they are done using the G87 backbore
canned cycle.
Next it increments that location by the I and J values. I offsets X with a plus
value being added to the current X. J does the same for the Y axis.
For our example block both I and J are negative so they move back from the hole
axis along the path just made by the tool. The amount of offset required should
be just enough that the tool tip will slide down through the bore.
Next the canned cycle moves the tool down in z and at the bottom location
represented in the block by the Z 0.4 value it moves the tool back to the center
of the bore.
Now the G87 canned cycle turns the spindle on and moves back up into the bore
at the programmed feedrate. This is the real cutting action of this canned cycle.
With the proper tool in a boring bar this cycle will produce a chamfer on the
bottom side of the bore. G87 can also be used to produce a larger diameter bore
on the bottom side of the bore.
107
When the tool has reached the K position it is returned to the bottom location,
the spindle is stopped and oriented and follows the earlier path back out of the
bore to the initial position above.
This canned cycle assumes spindle orientation which has not been implemented
in the EMC to date. The proper alignment of the tool tip to the oriented spindle is
critical to the successful insertion of the tool through the hole to be backbored.
G88 Cycle
The G88 cycle is intended for boring. This cycle uses a P value, where P specifies
the number of seconds to dwell.
G89 Cycle
The G89 cycle is intended for boring. This cycle uses a P value, where P specifies
the number of seconds to dwell.
108
2. Dwell for the given number of seconds.
3. Retract the Z-axis at the current feed rate to clear Z.
This cycle is like G82 except that the tool is drawn back at feedrate rather than
rapid.
These codes are treated together because they behave very much alike. You will
recall that when Z is above R the preparatory move is from the current location to
the X, Y values. If G98 is not specified, then the canned cycle will return to the R
value rather than the Z value that was used on the approach.
N01 G0 X1 Y2 Z3
N02 G90 G81 X4 Y5 Z-0.6 R1.8
Adding G98 to the second line above means that the return move will be to the
value of OLD_Z since it is higher that the R value specified.
Neither code will have any affect when incremental moves with a positive R value
are specified because the R value is added to OLD_Z and that result is used as
the initial level for a G98. The same value is the computed R value so G99 will
also return to the same place.
When the value of R is less than OLD_Z and incremental distance mode is turned
on, G98 will return the tool to the value of OLD_Z. Under those conditions G99
will retract the tool to OLD_Z plus the negative R value. The return will be below
OLD_Z.
There are at least two reasons for using canned cycles. The first is the economy
of code. A single bore would take several lines of code to execute.
109
Example 1 above demonstrated how a canned cycle could be used to produce 8
holes with ten lines of nc code within the canned cycle mode. The program below
will produce the same set of 8 holes using five lines for the canned cycle. It does
not follow exactly the same path nor does it drill in the same order as the earlier
example. But the program writing economy of a good canned cycle should be
obvious.
This example demonstrates the use of the L word to repeat a set of incremental
drill cycles for successive blocks of code within the same G81 motion mode. Here
we produce 12 holes using five lines of code in the canned motion mode.
G73 - peck drilling cycle. G73 X1. Y1. Z-1. R.1 Q.1 F10 G99
The extra word you need for this canned cycle is Q. The Q word sets the length of each peck. In
the above example the peck distance is set to .100. After each peck the Z axis backs off .005
momentarily to break the chip. The amount of the retraction to break the chip can be adjusted
by changing a controller parameter. Usually .005 is acceptable. As in all pecking cycles the
programmer does not need to calculate the number of pecks and peck distance that will equal
the Z Depth. The controller will calculate the distance of the last peck to coincide with the Z
depth.
Note: for many machines there is an optional K word which - after an accumulation of K depth -
will rapid the drill to the R plane to clear accumulated chips. If K.3 was inserted in the above
line of code the drill would make three .1 pecks then rapids to R to clear the accumulation and
then rapids back to about .005 short of the last depth to continue with the pecking.
110
G74 - left hand tapping cycle: G74 X1. Y1. Z-.3 R.4 F100
This cycle is for a left hand tap to machine left hand threads. The spindle must be running in
reverse (M4). When the tap is at its' programmed depth then the spindle reverses and the tap
will feed back out of the hole.
This cycle requires a tension/compression tap holder. This type of tool holder allows the tap to
"float" up and down the spindle centerline a short distance (usually about .400). The need for
this type of tool holder is based on the fact that, with many machines, you can not program a
feed rate that is perfectly equivalent to the pitch of a thread. This is because the spindle can
not be programmed to turn in relation to the Z axis feed (an exception is rigid tapping
mentioned a few pages later).
The example given will tap a 1/4 -20 thread .300" inch deep: G74 X1. Y1. Z-.3 R.4 F100
Tapping cycles are more complex to program and have special rules to follow. The above
example requires the rapid plane to be at a .400" minimum so that the tap fully retracts prior
to movement to the next position.
The feed rate of 100 is calculated with the spindle speed in mind. For a 1/4 -20 tap at
2000RPM,
Feed rate= 1/threads per inch * RPM, = 1/20 * 2000, or .05 *2000, = 100.
It is extremely important to make sure the RPM is programmed to reflect the RPM used in the
calculation. Remember! this is an approximation which requires much experience to program
safely.
G76 - fine boring cycle: G76 X1. Y1. Z-1.R.1 I-.002 F5 G98
This cycle leaves no witness mark in the hole by moving the tool away from the bored surface
before retracting. The tool feeds down to the bottom of the bore and the spindle stops and
orients itself (to the M19 position). Next, the tool retracts from the wall of the bore and rapids
out of the hole.
New words are I and J. Depending on how the tool orients itself will determine which new word
to use to move the tool away from the bored surface.
In other words I-.002 tells the controller to move the tool .002 in the -X direction. J.002 tells
the controller to move the tool .002 in the +Y direction.
G81 - standard drilling cycle : G81 X1. Y1. Z-.2 R.1 F3 G99
This cycle can be used for center drilling, drilling, reaming, and rough boring. The cycle travels
down at the set feed rate and then rapids out of the hole.
Notice that the depth is somewhat shallow. For drilling deeper holes, another cycle is
111
recommended, like the G73 or G83. Chips can clog in the flutes and break or overheat a drill.
G82 - counter boring cycle: G82 X1. Y1. Z-1. R.1 P500 F7 G98
This cycle causes the tool to feed to the bottom, pause if desired, and then rapid out of the
hole.
Note the new word. P=Pause (or dwell) and is programmed in milliseconds. A millisecond is
1/1000 of a second so 500/1000 is 1/2 second of pause. It is important to allow the tool time
to cut the bottom of the hole.
A pause relieves tool pressure. For counter bore depths that have tight tolerance, this time is
necessary.
G83 - deep hole drilling cycle: G83 X1. Y1. Z1. R.1 Q.1 F6 G99
This cycle is used for deeper holes where it is required to clear chips and curls from the hole.
Too many chips in a deep hole can cause breakage. This cycle drills at the set feed rate then
retracts at rapid speed back to the rapid plane to clear out chips. It then it rapids back into the
hole, just short of the last depth, and begins another feed. After getting to the specified Z
depth, it retracts at rapid speed.
A rule of thumb about drill depths. If the drill depth is more than 3 times the diameter of the
drill, then a G83 should be used. Like G73, the "Q" word is necessary to set the amount of
drilling per peck.
A parameter in the controller will control the distance between the end of the rapid plunge and
the new material to be drilled after each completed peck.
G84 - right hand tapping cycle: G84 X1. Y1. Z-.3 R.4 F100
This cycle is for a right hand tap to machine right hand threads. The spindle must be running in
forward (M3). When the tap is at its' programmed depth then the spindle reverses and the tap
will feed back out of the hole.
This cycle requires a tension/compression tap holder. This type of tool holder allows the tap to
"float" up and down the spindle centerline a short distance (usually about .400).
The need for this type of tool holder is based on the fact that, with many machines, you can not
program a feed rate that is perfectly equivalent to the pitch of a thread. This is because the
spindle can not be programmed to turn in relation to the Z axis feed (an exception is rigid
tapping mentioned a few pages later).
The example given will tap a 1/4 -20 thread .300" inch deep: G84 X1. Y1. Z-.3 R.4 F100
Tapping cycles are more complex to program and have special rules to follow. The above
example requires the rapid plane to be at a .400" minimum so that the tap fully retracts prior
112
to movement to the next position.
The feed rate of 100 is calculated with the spindle speed in mind. For a 1/4 -20 tap at
2000RPM,
Feed rate= 1/threads per inch * RPM, = 1/20 * 2000, or .05 *2000, = 100.
It is extremely important to make sure the RPM is programmed to reflect the RPM used in the
calculation. Remember! this is an approximation which requires much experience to program
safely.
This cycle is used when reaming and feeds in and out at the set feed rate.
Many programmers will use G81 or G86 to ream and not waste time feeding back out of the
hole. However rapid extraction of a reamer from a hole can produce unwanted scoring.
This cycle feeds the tool in and at the bottom it stops the spindle. The spindle then orients and
rapids out.
If you are using a boring tool with this cycle it will probably scrape the side of the bore wall
when it exits the hole.
Many programmers use this cycle for reaming because it will produce a tighter hole. A G85
reaming cycle may cut on the way out of the hole and make it bigger, .0001"-.0003" or more
depending on the material.
G89 - counter boring cycle for a boring bar: G89 X1. Y1. Z-1. R.1 P800 F10
This cycle is half G82 and half G86 canned cycle. The tool will feed into the hole and pause at
the bottom. Then the spindle will stop and the tool will rapid out.
This cycle will leave a witness mark. Again, the pause is necessary for very accurate depths to
relieve tool pressure.
Rigid Tapping
It should be noted that different manufacturers of CNC controllers have different rules for
tapping. It is a good idea to review the machine center's programming manual.
There are different ways to tap. One way is to use a compression tap holder, an expensive
accessory device already mentioned..
A more accurate, efficient, and convenient way to tap is rigid tapping. Rigid tapping is an
optional control feature available on many CNC machining centers. Rigid tapping controls the
113
speed of the spindle in exact proportion to the Z feed.
There are different formats for compression tapping and rigid tapping. Many manufacturers
have slightly modified G codes to enable their use properly.
Metric threads require the use of a Q word and a different formulation for the feed rate. Again,
it is a good idea to read at the machine centers' programming manual to be sure.
Drilling canned Cycle Drilling canned Cycle with dwell Simple deep hole drilling Tapping canned cycle
Reaming canned cycle Boring cycle with withdrawal in rapid Rectangular pocket canned cycle Circular
pocket canned cycle Boring cycle with withdrawal at feedrate
G69 G98/G99 X Y Z I B C D H J K L R G81 G98/G99 X Y Z I K
G82 G98/G99 X Y Z I K G83 G98/G99 X Y Z I J G84 G98/G99 X
Y Z I K R G85 G98/G99 X Y Z I K G86 G98/G99 X Y Z I K G87
G98/G99 X Y Z I J K B C D H L V G88 G98/G99 X Y Z I J B C D H
L V G89 G98/G99 X Y Z I K
G8? or G69 G98/G99 X Y Z I K have the standard meaning for all the cycles.
I= total depth ***exception G83, I = drilling step K= dwell time *** exception G87 K= distance from
center to edge of pocket
114
MULTIPLE MACHINING
General considerations:
Multiple functions are defined as a series of functions which allow a machining operation to be
repeated along a given path.
The programmer will select the type of machining which can be a canned cycle or a modal
subroutine.
These functions must be defined every time they are used. These functions will only make
sense if they are under the influence of a canned cycle or modal subroutine
The following operations will be done under the same working conditions defined by the canned
cycle
To perform multiple machining, follow these steps:
1) move the tool to the first point of the multiple machining operation
2) define the canned cycle or modal subroutine to be repeated at all the points
3) defined the multiple operation to be performed
115
Oriented spindle stop
Q (Shift at the bottom of the hole ) is a modal value retained within canned cycles. It must be
specified carefully because it is also used as the depth of cut for G73 and G83.
When the bottom of the hole has been reached, the spindle stoped at the fixed rotation
position, and the tool is moved in the direction opposite to the tool tip and retracted. This
ensures that the machined surface is not damaged and enables precise and efficient boring to
be performed.
Before specifying G76, use a miscellaneous function (M code) to rotate the spindle.
When the G76 command and a M code are specified in the same block, the M code is executed
at the time of the first positioning operation. The system then proceeds to the next operation.
When K is used to specify the number of repeats, the M code is executed for the first hole only;
For the second and subsequent holes, the M code is not executed. When a tool length offset
(G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of
positioning to point R.
Example:
M3 S500 Cause the spindle start rotating
G90 G99 G76 X300. Y-250. Position, bore hole1, then return to point R
Z-150. R-120. Q5. Orient at the bottom of the hole, then shift by 5mm
P1000 F120 Stop at the bottom of the hole for 1 sec.
Y-550. Position, drill hole 2, then return to point R
116
Y-750. Position, drill hole 3, then return to point R
X1000. Position, drill hole 4, then return to point R
Y-550. Position, drill hole 5, then return to point R
G98 Y-750. Position, drill hole 6, then return to initial level
G80 G28 G91 X0 Y0 Z0 Return to the reference position
M5 Spindle stops
This cycle is used for normal drilling. Cutting feed is performed to the bottom of the hole in
rapid traverse.
After positioning along the X- and Y- axes, rapid traverse is performed to point R. Drilling is
performed from point R to point Z.
The tool is then retracted in rapid traverse.
This cycle is used for normal drilling. Cutting feed is performed to the bottom of the hole, At the
bottom, a dwell is performed, then the tool is retracted in rapid traverse. This cycle is used to
drill holes more accurately with respect to depth.
After positioning along the X- and Y- axes, rapid traverse is performed to point R. Drilling is
then performed from point R to point Z.
When the bottom of the hole has been reached, a dwell is performed.
The tool is then retracted in rapid traverse.
117
Peck drilling cycle G83
This cycle performs peck drilling. It performs intermittent cutting feed to the bottom of a hole
while removing shavings from the hole.
118
Q represents the depth of cut for each cutting feed. It must always be specified as an
incremental value.
In the second and subsequent cutting feeds, rapid traverse is performed up to a point just
before where the last drilling ended, and cutting feed is performed again.
EXAMPLE:
M3 S2000
G90 G99 G83 X300. Y-250. Z-150. R-100. Q15. F120
Y-550.
Y-750.
X1000.
Y-550.
G98 Y-750.
G80 G28 G91 X0 Y0 Z0
M5
119
G80 G28 G91 X0 Y0 Z0
M05
120
The only difference between G88 and G89 is dwell on bottom of the hole in G89 cycle.
G80 Cancels canned cycles
Rigid Tapping G84
Rigid Tapping (When the spindle motor is controlled in rigid mode as if were a servo motor, a
tapping cycle can be speed up).
Rigid mode can be specified using any of following methods:
a) …M29 S… before a tapping command
b) …M29 S… in a block which contains a tapping command
c) …G84… for rigid tapping
Thread lead:
a) In feed per min….feedrate x spindle speed
b) In feed per revolution mode…thread lead equals federate speed
In the canned cycle tool offsets are ignored.
121
Left-handed rigid tapping cycle G74
122
The plunge grinding cycle consists of six operation sequences. Operations
1 to 6 are repeated until the depth reaches the total depth of cut specified
at address K. In the single block stop mode, operations 1 to 6 are
performed every cycle start.
Cutting is performed along the axis 1 to 6 are repeated until the depth
reaches the total depth of cut specified at address K. In the single block
stop mode, operations 1 to 6 are performed every cycle start.
Cutting is performed along the axis Y in cutting feed mode for the amount
specified by I (depth of cut1). The federate is specified by R.
Dwell is performed for the time specified by P.
Programming samples
123
More programming samples on next page:
124
125
Grinding wheel cutting: Cutting is performed
along Y axis in cutting feed mode for amount
specified by I (depth of cut). The federate is
specified by R.
Continuous- feed surface grinding cycle
G78
X, (Z), I, J and K must all be specified in
incremental mode.
126
Intermittent- feed surface grinding cycle G79
X, (Z), I, J and K must all be specified in incremental mode.
This surface speed unit may change according to machine tool builders.
For the constant surface speed control, specify the following G codes.
Command constant surface speed as follows:
G96 PÞ S……; S- Surface speed (m/min or feet/min)
P0 Axis set in the parameter(No. 041#4, #5)
P1 X axis, P2; Y axis, P3; Z axis, P4; 4th axis
Note: This surface speed may change according to machine tool builder‘s specification. If a
surface speed is omitted, the S value specified in the previous G96 is used.
To execute the constant surface speed control, it is necessary to set the work coordinate
system so the coordinate value at the center of the rotary axis, for instance, Z axis (Axis to
which the constant surface speed control applies) becomes Zero.
127
G96 (constant surface speed control command) is a modal G code. After a G96 command is
specified, the program enters the constant surface speed control mode (g96 mode) and
specified S values are assumed as a surface speed.
A G96 command must specify the axis along which constant surface speed control is applied. If
address P is omitted, P0 is assumed. G97 command cancels the G96 mode. If an S value is
omitted in a G97 block, the last speed specified in the G96 mode remains valid.
When constant surface speed control is applied, a spindle speed higher then the value specified
in G92S… (max spindle speed) is clamped at the max spindle speed. When the power is turned
on, the max spindle speed is not yet set and the speed is not clamped.
S(surface speed) commands in the G96 mode are assumed as S=0 (the surface speed is 0)
until M03 (rotating the spindle in the positive direction) or M04 (rotating the spindle in the
negative direction) appears in the program.
128
CONSTANT SURFACE SPEED CONTROL FOR THREADING
The constant surface speed control is also effective during threading. Accordingly, it is
recommended that the constant surface speed control be invalidated with G97 command before
starting to scroll threading and tapper threading , because the response problem in the servo
system may not be considered when the spindle speed changes.
129
Clearance levels
CMMs generally gather their data by touching the workpiece with a probe (either a solid probe
or an electronic touch trigger probe) attached the machine's measuring axis. Although the tip
of the probe is very accurate, once the probe is attached to the CMM, the location of the tip to
the machine's coordinate system must be determined prior to measuring. Since it's the tip's
circumference that touches the part, the probe's center and radius are determined by
measuring a very accurate sphere (requalification sphere).
Once the center and radius of the tip are known, when the probe contacts a workpiece, the
coordinates of the tip are mathematically "offset" by the tip's radius to the tip's actual point of
contact (Figure 14). The direction of the offset is automatically determined by the alignment
procedure.
We do a similar procedure when we park a car. The better we can estimate our offset from the
exterior of the car, the closer we can park it to the curb.
You can reduce the likelihood of shanking by using a larger diameter tip to increase the
clearance between the ball/stem and the workpiece surface. Generally, the larger the tip
diameter, the deeper the stylus can go before it touches the workpiece feature. This is called
130
the effective working length of the probe (Figure 21). Also, the larger the tip, the less effect it
has on the surface finish of the workpiece since the contact point is spread over a larger area of
feature being measured. However, the largest tip that can be used is limited by the size of the
smallest holes to be measured.
Measurement points taken with an electronic probe are recorded when the stylus is deflected
enough to either break mechanical contacts or generate enough force to trigger pressure-
sensitive circuitry. The physical arrangement of the contacts causes slight errors in accuracy,
although these are reduced during probe qualification. However, the longer the probe tip
extension, the larger the pre-travel error and the more residual error is left after probe
qualification. Longer probes are not as stiff as shorter ones. The more the stylus bends or
deflects, the lower the accuracy. You should avoid using probes with very long stylus/
extension combinations.
Geometric Dimensioning and Tolerancing (GD&T) is a universal language of symbols, much like
the international system of road signs that advise drivers how to navigate the roads. GD&T
symbols allow a Design Engineer to precisely and logically describe part features in a way they
can be accurately manufactured and inspected. GD&T is expressed in the feature control
frame (Figure 22). The feature control frame is like a basic sentence that can be read from left
to right. For example, the feature control frame illustrated would read: The 5 mm square
shape (1) is controlled with an all-around (2) profile tolerance (3) of 0.05 mm (4), in
relationship to primary datum A (5) and secondary datum B (6). The shape and tolerance
determine the limits of production variability.
There are seven shapes, called geometric elements, used to define a part and its features.
The shapes are: point, line, plane, circle, cylinder, cone and sphere. There are also certain
geometric characteristics that determine the condition of parts and the relationship of features.
These geometric symbols are similar to the symbols used on maps to indicate features, such as
131
two and four lane highways, bridges, and airports. They are like the new international road
signs seen more frequently on US highways. The purpose of these symbols is to form a
common language that everyone can understand.
Straightness — A condition where all points are in a straight line, the tolerance
specified by a zone formed by two parallel lines.
Flatness — All the points on a surface are in one plane, the tolerance specified by a
zone formed by two parallel planes.
Position — A positional tolerance defines a zone in which the center axis or center
plane is permitted to vary from true (theoretically exact) position. Basic dimensions
establish the true position from datum features and between interrelated features.
A positional tolerance is the total permissible variation in location of a feature about
its exact location. For cylindrical features such as holes and outside diameters, the
positional tolerance is generally the diameter of the tolerance zone in which the axis
of the feature must lie. For features that are not round, such as slots and tabs, the
positional tolerance is the total width of the tolerance zone in which the center plane
of the feature must lie.
132
Circular Runout — Provides control of circular elements of a surface. The
tolerance is applied independently at any circular measuring position as the part is
rotated 360 degrees. A circular runout tolerance applied to surfaces constructed
around a datum axis controls cumulative variations of circularity and coaxiality.
When applied to surfaces constructed at right angles to the datum axis, it controls
circular elements of a plane surface.
Total Runout — Provides composite control of all surface elements. The tolerance
applied simultaneously to circular and longitudinal elements as the part is rotated
360 degrees. Total runout controls cumulative variation of circularity, cylindricity,
straightness, coaxiality, angularity, taper, and profile when it is applied to surfaces
constructed around a datum axis. When it is applied to surfaces constructed at right
angles to a datum axis, it controls cumulative variations of perpendicularity and
flatness.
133
MACHINE SEQUENCE:
134
After Word
Ross Vas
3.CNC PROGRAMMING “FANUC” method - Almost everyone in the world of CNC knows, Fanuc is the control of
choice in most shops in the US and the world. Learn their system and you will have the best chance for a good
job.
4.CNC MACRO PROGRAMMING + Macro calculator FREE - Learn the best kept secret of CNC! One of our most
popular courses!!! Certainly many in this industry have never even heard of parametric programming!!!
5. CNC SEAL-Mastering – Sought after skill - Learn how to make premium machined seals!!!
6. Mastercam for beginners
7. Autocad for beginners
8. Ecoca lathe
9. CNC Programming – Heidenhain control ...
CNC-ACADEMY®
Sydney NSW Australia
Customer service:
Tel: +61 401 461 791
www.cnc-academy.com
support@cnc-academy.com
Copyright© 2005-2011
135
136