Created and Maintained by the Real World Software Developers and Machinists at www.KentechInc.com ... click here to check it out !!

Wednesday, August 5, 2015

Canned Cycles in Turning - What You Need to Know - Part #2

This post is continuing with the important feature of programming canned cycles for rough turning. In Part 1 we discussed the general outline, format and command lines for the cycles ... in Part 2 we want to illustrate some examples using Fanuc ( and therefore Haas ) programming that hopefully we give an even clearer picture of the uses and commands for these cycles. We do have some Okuma Programming Notes at the bottom of this post.

The examples will use the same shape ... but will illustrate the to main Fanuc cycles for bar stock roughing ... G71 -Turning and G72 - Facing.

G71 will produce a cutting motion along the Z axis ... generally referred to as a turning motion. The G72 cycle will produce a cutting motion along the X axis ... or a facing type motion.

The way we position our Points A - B - C will also determine the motion as illustrated below. The general rule of thumb is to describe the cutting motion through the finish contour code in a motion that moves from A to B along the contour to C. This description will assist you in placing Points A - B - C in their correct location in relation to the part and the contour.

___________________________________________________________

Example #1 : 
OD Cutting Along the Z axis - Turning
(1) First we established our points A - B - C and using a clearance amount of .100 in X and .050 in Z.
(2) In our program ... the first step is to rapid to point A ... N1000 = our P call in the canned cycle block.
(3) Then command the Canned Cycle Call
(4) Then rapid to point B and proceed around the part contour to point C ... N1100 = our Q call in the canned cycle block.

G96S650M03
G00X11.0Z1.0M08
G00X10.3408Z0.05
G71P1000Q1100U0.01W0.01D0.1F0.012
N1000G00X4.8729.0Z0.05
G01X4.8729.0Z0.0F0.012
G01X4.8729Z-1.2967F0.012
G01X6.9769Z-1.998F0.012
G01X6.9769Z-3.4277F0.012
G01X10.2409Z-3.4277F0.012
N1100G00X10.3408Z-3.4277
G00X10.3408Z0.05

___________________________________________________________

Example #2 :
OD Cutting Along the X Axis - Facing

By re-arranging Points A - B - C ... and using the G72 cycle ... we can change the cutting direction from turning to facing. The basics of the format and steps in the program are the same ... move from A to B along the contour to C ... and this will help us position Points A - B - C.

G96S650M03
G00X10.1000Z1.0M08
G00X10.3408Z0.05
G72P2000Q2100U0.01W0.01D0.1F0.012
N2000G00X10.3408Z-3.4277
G01X10.2408Z-3.4277F0.012
G01X6.9769Z-3.4277F0.012
G01X6.9769Z-1.998F0.012
G01X4.8729Z-1.2967F0.012
G01X4.8729Z0.0F0.012
N2100G00X4.8729Z0.05
G00X10.34Z0.05

___________________________________________________________

Example #3 :
ID Rough Cutting Along the Z Axis Turning

Now let's turn things to focus on ID cutting. Again ... the same procedures and rules apply ... flip Points A - B - C to reflect cutting the ID rather than the OD. The same rule applies ... move from A to B along the contour to C.

G96S650M03
G00X.9717Z1.0M08
G00X0.9717Z0.05
G71P1000Q1100U-0.01W0.01D0.05F0.012
N1000G00X2.7117Z0.05
G01X2.7117Z0.0F0.012
G01X2.7117Z-0.8633F0.012
G01X1.7622Z-1.6563F0.012
G01X1.0717Z-1.6563F0.012
N1100G00X0.9717Z-1.6563
G00X0.9717Z0.05

___________________________________________________________

Example #4 :
ID Rough Cutting Along the X Axis - Facing

And again ... by re-positioning Points A - B - C and using G72 ... we can perform the rough cutting using cutting from the centerline out in a facing motion.

G96S650M03
G00X1.0Z1.0M08
G00X0.9617Z0.05
G72P2000Q2100U-0.01W0.01D0.05F0.012
N2000G00X0.9617Z-1.6563
G01X1.0717Z-1.6563F0.012
G01X1.7622Z-1.6563F0.012
G01X2.7117Z-0.8633F0.012
G01X2.7117Z0.0F0.012
N2100G00X2.7117Z0.05
G00X0.9617Z0.05

___________________________________________________________

Okuma Programming Notes :

Okuma OSP controls refer to the cycles as illustrated above as LAP cycles. The format and use is pretty basically the same as described for Fanuc / Haas controls with some modifications. If you can understand the outlines above ... the notes below should get you through the differences between the Fanuc / Haas format and that required by OSP controls.

  1. For motion for both turning and facing ... command a G85 as the canned cycle command. The variables in the G85 line are outlined in Part 1 of this series.
  2. On the line immediately following the G85 call ... command a G81 for turning or G82 for facing. This G code should appear on a line by itself with no other code on the line.
  3. The N number command on the G85 line should refer to the N number of the line where the G81 / G82 is commanded.
  4. At the end of the sequence that describes the finish contour ... command a G80 on a line by itself to signify the end of the finish profile sequence.

The Fanuc / Haas code from example #1 above has been transposed for the Okuma OSP format below :

G96S650M03
G00X11.0Z1.0M08
G00X10.3408Z0.05
G85 N1000 U0.01 W0.01 D0.1 F0.012
N1000 G81
G00X4.8729.0Z0.05
G01X4.8729.0Z0.0F0.012
G01X4.8729Z-1.2967F0.012
G01X6.9769Z-1.998F0.012
G01X6.9769Z-3.4277F0.012
G01X10.2409Z-3.4277F0.012
G00X10.3408Z-3.4277
G80
G00X10.3408Z0.05


___________________________________________________________

They say a picture is worth a thousand words ... hopefully the illustrations here will help you solidify your programming of these powerful and important canned cycles.

If anyone notices any errors in this post ... please leave a Comment below and straighten it out ... to benefit anyone stopping by ... and Thanks in advance.

Happy Chip Making in 2013 !!



Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!

Wednesday, June 10, 2015

Canned Cycles in Turning - What You Need To Know - Part #1

Canned cycles in CNC controls are powerful features that when used correctly can reduce programming commands and increase program efficiency dramatically. There are a variety of cycles available on most controls, the most powerful are stock removal or roughing cycles. In most of these type of cycles, the user can define the roughing process and cutting parameters, then simply describe the finish shape using G codes. The control will then auto-calculate start and end points as it removes the material to leave the workpiece with the finish shape profile.


Let's start out by explaining WHY THIS IS IMPORTANT !!!

  1. No depth of cut or point calculations required ... all you need to do it describe the finish profile and the control does all the work.
  2. Cutting conditions in the real world are dictated by the actual process of stock removal. Sure you're sitting in your office and writing the program ... everything looks great ...  inevitably when you start to actually do the cutting, things change. When using a canned cycle ... to change the depth of cut ... finish allowance ... feedrate ... they are all just edits to one variable in the canned cycle line. What could be easier !!! If you wrote the code long hand ... you have to re-generate the code each time you want to make any of these changes.
  3. ENUF said ... the CORRECT way to program any rough cutting is to use a canned cycle ... period. Whether through a CAD/CAM system or whatever. Anybody who tells you different is a poor programmer.

The cycle will will outline in this blog post is the G71 cycle in Fanuc / Haas controls ... and the G85/G81 cycle in Okuma OSP controls. This cycle will remove the material along the Z axis, taking depth of cut along the X axis. The command line will define the cutting parameters such as depth of cut, feedrate and finish material to leave as well as telling the control where to look for the finish profile of the part. Usually the command line includes (2) N numbers or some other start / end variables. The control looks between these start / end variables to see what the finished shape looks like. The user uses what amount to a standard finish cut G code program to define that finished shape and places that G code in-between those start / end variables.

For the CNC controls covered here, the same basic programming format  and programming steps should be observed. The first steps are to establish three points that are required to help describe to the CNC control the finished shape desired. These are outlined in more detail in the ANIMATION sequence for this code.

A) Pt. A  : Clearance point in the X axis
  Clearance point in the Z axis

B)  Pt. B  : Along the X plane established by Pt. A, last X diameter of the profile
  Same Z axis plane as Pt. A.

C) Pt. C : Same X plane as Pt. A.
  Along the Z plane as established by Pt. A, last Z face along the contour.



Once the three points above are calculated, the following programming sequence can be used :

a) Start the tools process as normal which means index the tool and start the spindle.

b) Rapid the tool to point A using the normal format rapid approach.

c) Command the CANNED CYCLE block as explained below.


FADAL, HAAS & Fanuc Controls ( Models 6,10,11,12,15 ) :
G71 Pxxxx Qxxxx Uxxxx Wxxxx Dxxxx Fxxxx ;
P = Sequence (N) number of the first block of the finish shape program.
Q = Sequence (N) number of the last block of the finish shape program.
U = Amount and direction of the finish allowance in the X axis ( diameter value in diameter
programming ).
W = Amount and direction of the finish allowance in the Z axis.
D = Depth of cut (radius value) - no decimal point allowed (format = xxx.xxxx) - no sign allowed.
F = Feedrate in roughing - this value overrides any feedrate commanded between P and Q.

Option : S and T commands - Good programming practice would place these commands active earlier in the programming sequence.

Fanuc Controls :
( Models 0,16,18,20,21 )
G71 Uxxxx Rxxxx ;
G71 Pxxxx Qxxxx Uxxxx Wxxxx Fxxxx ;
U = Depth of cut - radius value
R = Retract Amount - the amount the tool will retract before returning to the start for next depth
of cut.
P = Sequence (N) number of the first block of the finish shape program.
Q = Sequence (N) number of the last block of the finish shape program.
U = Amount and direction of the finish allowance in the X axis ( diameter value in diameter
programming ).
W = Amount and direction of the finish allowance in the Z axis.
F = Feedrate in roughing - this value overrides any feedrate commanded between P and Q.

Option : S and T commands - Good programming practice would place these commands active earlier in the programming sequence.

OSP Controls :
G85 Nxxxx Dxxxx Fxxxx Uxxxx Wxxxx ;
N = Sequence (N) number of the first block of the finish shape program. Last sequence is  described as the line containing the G80 command.
D = Depth of cut (radius value).
F = Feedrate in roughing - this value overrides any feedrate commanded between P and Q.
U = Amount and direction of the finish allowance in the X axis ( diameter value in diameter
programming ).
W = Amount and direction of the finish allowance in the Z axis.

Option : S and T commands - Good programming practice would place these commands active earlier in the programming sequence.

d) Continue the program by programming the finish shape starting with a rapid move from Pt. A to Pt. B.. The type of command used here (G00 or G01) will determine the roughing cycle move as it moves in this direction during the roughing process. This block must be labeled with the start sequence number specified in the call in the CANNED CYCLE block.

Fanuc control's have two types of canned cycles called TYPE I and TYPE II. The TYPE I cycle only allows for finished shapes where the axis are moving in one direction ... which basically means that no type of "pockets" can be included in the contour. TYPE II cycles are generally an option but do allow for non-continuous type contours.

Initiating a TYPE I or TYPE II cycle takes place in this block ... the move from POINT A to POINT B. If a two axis move ... both X and Z or U and W are included in this block ... than a TYPE II cycle is initiated if available. If the option is not present ... an alarm is usually generated alerting the user that the option is not available.

In the above example ... and since the Z axis plane of Point A and Point B should be the same ... an incremental move of zero in the axis is usually included just to get the cycle initiated. For example :
G00X1.250W0;
... this move will not effect the movement but since both an X and Z move are commanded ... the TYPE II cycle will be initiated.

e) Complete the program for the tool path to go all around the part contour from Pt. B around the part and ending at Pt. C. You may use G01, G02 or G03 for tool movement as long as the shape is always vertical in the X axis and horizontal in the Z axis. No pocketing is allowed in the shape (Type I only - Type II canned cycles do have this capability). This block must be labeled with the end sequence number specified in the call in the CANNED CYCLE block.

f) Finish the program with a rapid move from Pt. C back to Pt. A. The type of command used here (G00 or G01) will determine the roughing cycle move as it moves in this direction (retract) during the roughing process.

g) Return the tool, like normal, to the indexing position or, while the tool is at Pt. A, call the FINISHING CANNED CYCLE using the same P and Q sequence numbers to finish the part with the same tool.

This outline is fairly complete ... but it may take a little trying and testing for you to get the hang of it ... but the benefits are worth the effort. The ease of editing the cutting conditions and changing or altering the profile make this cycle powerful and real world. If you can master the use of this cycle ... you will reap the benefits for the rest of your programming life. If someone tells you different ... don't believe them.  And if you run across someone who never uses it or doesn't know how to use it ... consider them a poor programmer.

Until next time ... Happy Chip Making !!

At Kentech Inc. we are MACHINISTS who create Real World Machine Shop Software.
Who creates the machine shop software guiding your shop's future ??
Check out all our REAL WORLD CNC & MACHINE SHOP titles at