Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program...

101
User's Guide Servo CNC System for Windows® Programming and Operation SW Version 5.0 Manual Version 1.1b Form 0800-80821

Transcript of Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program...

Page 1: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

User's Guide

Servo CNC System for Windows®

Programming and Operation

SW Version 5.0 Manual Version 1.1b

Form 0800-80821

Page 2: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Copyright © 2006 ServoSource. All rights reserved

The software contains proprietary information of ServoSource; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited.

Due to continued product development, this information may change without notice. The information and intellectual property contained herein is confidential between ServoSource and the customer and remains the exclusive property of ServoSource. If you find any problems in the documentation, please report them to us in writing. ServoSource does not warrant that this document is error-free.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise without the prior written permission of ServoSource.

Servo II® is a registered trademark of ServoSource. Microsoft®, Windows® and Windows NT® are registered trademarks of Microsoft Corporation. VenturCom's Real-time Extension (RTX) for Windows NT® and for Windows® XP Professional are distributed under a licensing agreement with VenturCom Inc, now Ardence, a Citrix Company. RTX® is a registered trademark of VenturCom, Inc. Adobe® and Acrobat® Reader™ are either registered trademarks or trademarks of Adobe Systems Incorporated. Gibbs SFP®, Virtual Gibbs®, and GibbsCAM® are registered trademarks of Gibbs and Associates. All other companies and product names may be trademarks or registered trademarks of their respective holders.

This document was created using AuthorIT™, Total Document Creation (See http://www.author-it.com).

ServoSource 1224 Main Street

Stockton, Kansas 67669 USA

Phone: +1 (785) 425 6835 Fax: +1 (785) 425 6505

E-Mail: [email protected] Web: http://www.ServoSource.com

Document 0800-80821 Assembly 58988 SW 5.01.87

Page 3: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

1

Typographical ConventionsBefore you start using this guide, it is important to understand the terms andtypographical conventions used in the documentation.

For more information on specialized terms used in the documentation, see theGlossary at the end of this document.

The following kinds of formatting in the text identify special information.

Formatting convention Type of InformationTriangular Bullet( ) Step-by-step procedures. You can follow these

instructions to complete a specific task.

Special Bold Items you must select, such as command buttons oritems in a list. Also used for variables.

Emphasis Used to emphasize the importance of a point and forfield names in status displays.

CAPITALS Names of keys on the keyboard and pendant, forexample, CTRL, ALT, F11, or MANUAL.

KEY+KEY Key combinations for which the user must press andhold down one key, then press another, and thenrelease both, for example, ALT+F4, orMANUAL+SET.

KEY KEY Key combinations on the pendant for which the usermust press and release the first key and then pressand release the second key, for example,RAPID SET.

MENU | OPTIONS Menu choices required to initiate an action orprocedure.

WARNING A warning alerts you to a situation or action that could resultin personal injury.

CAUTION A caution provides information about a situation or actionthat could damage the Servo System or result in lost work or time.

Introduction

Page 4: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

2 Servo CNC System User's Guide

NOTE A note presents information that is important enough to requireemphasis.

TIP A tip provides suggestions and pointers on techniques, usage, and "goodpractices" based on the experiences of CNC and manufacturing experts.

Contacting Servo Products CompanyWe hope the answers to all your questions are in the Servo CNC System forWindows NT® User's Guide and Help System or the Servo CNC System:Installation, Operation and Maintenance manual for your machine. If yourproblem is not listed or the suggested solutions do not clear the problem,contact your dealer or Servo Products Technical Support.

Servo Products CompanyTechnical Support433 North Fair Oaks AvenuePasadena CA 91103 USA

Phone: 1.626.796.2460 or 1.800.521.7359Fax: 1.626.796.3845E-mail: [email protected]: http://www.servoproductsco.com

NOTE If you are having a programming problem, be prepared to email, mailor fax the cnc file, a sketch of the geometry you are trying to program, theservont.ini file and tool.ini file tool table listing.

NOTE DO NOT return any item to Servo Products Company without firstreceiving a Return Authorization (RA) number from Servo ProductsCompany. Include the RA#, company name, address, telephone number,name of contact, and reason for return. Package the item properly to avoidADDITIONAL damage. See the appendix "Axis Motor Removal andInstallation" in the machine manual for how to package a Servo II motor.

Page 5: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

87

Manual part programming requires the programmer to describe the detailedoperations that the machine is to perform using codes and numeric values thatthe machine control can understand. The part program directs the motion ofthe cutting tool around the workpiece to generate the desired geometricshape. The part programmer uses the part dimensions, cutting tool geometry,feed and speed calculations, and fixture design to create the instructions tocut the workpiece. Writing a CNC Program (page 71) lists steps to follow.

In This ChapterFile & Code Formats ..........................................................87Sequence Number (N word)...............................................88Axis Commands (XYZC IJK words) .................................89Feed Rate Commands (DEF words)...................................95Preparatory Functions (G Codes) .......................................96Canned Cycles ....................................................................123Machine Functions (M Codes) ...........................................152Subroutines (P Cycle).........................................................154Spindle Speed Commands (S word)...................................156Tool Select Commands (T word) .......................................157Program Comments ( and !.................................................160Block Delete Code / ...........................................................161

File & Code FormatsFiles must use ASCII character coding, which is automatic if you are usingthe Servo editor to create your programs. If you are using a different editor,word processor, or a CAD/CAM or other programming system, check theoutput for compatibility.

Numerical Values

Numerical values are read as integers, unless they contain a decimal point.For example, in G70 Inch mode, X2 is read as 2 inches. In G71 Metric mode,X2 is read as 2 millimeters. A word address without a value has an assumedvalue of zero, for example, Y is read as Y zero. Leading zeros are notrequired, except for P cycle labels. For example, G02 and M00 are the sameas G2 and M0, but P02 defines subroutine 2; P2 causes an error.

C H A P T E R 6

Programming

Page 6: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

88 Servo CNC System User's Guide

Block Format - CNC Mode

The program codes are in word address format, meaning that the letter infront of a number indicates how the control interprets the data. The letter maybe upper or lower case (capital or small). Letters used to identify variables incanned cycles are described in the section on the canned cycle. The basic dataformat for CNC is as follows

N5 G3 XYZCIJK-4.8 DEF4.2 T2 M3 P7 S4

Block Format - Pendant Mode

The program codes are in word address format, meaning that the letter infront of a number indicates how the control interprets the data. The letter maybe upper or lower case (capital or small). Pendant mode programs created onthe PC/SOC have the following basic data format:

N5 G2 XYZC-4.8 DF4.2 M3 P7

NOTE N words and comments are stripped out when the program istransferred to the pendant. See Codes valid for Pendant transfer (page 69).

Sequence Number (N word)The N word is used as a sequence number for a block (line, command). Theletter N is followed by one to five digits (1-99999). It is used to identifyblocks of information. Sequence numbers are not required. They are usefulwhen searching for information in a program or to keep track of what portionof a program is currently being run.

In CNC Run and Verify, the most recent N word is displayed as Sequence# on the first line of the CNC Status tab.

In Teach or Pendant modes, programs transferred from the pendant to thePC contain sequence numbers added by the system. In programstransferred to the pendant from the PC, any sequence numbers arestripped out.

Page 7: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 89

Axis Commands (XYZC IJK words)Cutter motion can be made along any of three axes, all of which are mutuallyperpendicular; that is, they are at exact right angles to each other. These axesof motion are identified by the letters X, Y, and Z. This is known as theCartesian coordinate system. By common practice, the X, Y, Z and C wordsidentify the following slide movements.

Axis Slide MovementX Table left and right

Y Saddle forward and back

Z Quill, knee, or column slide (head) up and down

C Rotary table clockwise and counterclockwise rotation

The I, J and K words are used in circular interpolation to define the signeddistance from the arc start point to the arc center along the X, Y and Z axesrespectively.

NOTE If you have a unique Servo II CNC System installation, you may beusing these codes in a non-standard manner. For example, if you have bothknee and quill, the quill should be C and the knee Z.

The Coordinate System

Let's start with the two-dimensional Cartesian coordinate system. If youdefine the intersection of the two base lines as the origin (that is, zero foreach value), the X values to the right of the origin are positive (indicated by aplus + sign), and X values to the left of the origin are negative (indicated by aminus - sign). Similarly, Y values above the origin are plus, and Y valuesbelow the origin are minus. All values falling in the upper right-handquadrant are positive. In the lower right-hand quadrant, values of X arepositive, whereas values of Y are negative, and so-on around the graph.

Figure 4: Two-dimensional Cartesiancoordinate system.

Page 8: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

90 Servo CNC System User's Guide

3-D Coordinate System

Now add the third, or Z, axis. The Z axis represents vertical tool motion.With a negative Z axis value, the quill moves down and/or the knee moves up(decrease the distance between the head and the table). With a positive Z axisvalue, the quill moves up and/or the knee moves down (increase the distancebetween the head and the table).

The relationship of the three axes is shown in the figure. If you define thenearest lower left-hand corner of the solid as the origin, then all values of X,Y, and Z lying within the solid are positive. If you project each axis outsidethe solid as shown in the figure, you include negative values of X, Y, and Z.This follows the same concept as datum line dimensioning. This also allowsyou to establish an absolute zero reference or datum at any convenient placeand then represent the dimensions with positive and negative numbers.

On the milling machine, there are three degrees of the motion: table left-right, saddle in-out, and quill, knee or head up-down. These axes arerespectively labeled X, Y, and Z. Although the tool remains stationary andthe part moves, programs are written as though the tool itself had threedegrees of freedom. For example, a move of the table to the right is labeled anegative (-) move, since the result is as though the tool were moving to theleft. This may seem confusing at first, but writing the program as though thetool were moving simplifies matters, since the signs come out to beconsistent with the part drawings.

Positive and Negative Motion Defined

On the milling machine, there are three degrees of the motion: table left-right,saddle in-out, and quill, knee or head up-down. Although the tool remainsstationary and the part moves, programs are written as though the tool itselfhad three degrees of freedom.

For example, a move of the table to the right is labeled a negative (-) move,since the result is as though the tool were moving to the left. This may seemconfusing at first, but writing the program as though the tool were movingsimplifies matters, since the signs come out to be consistent with the partdrawings.

Figure 5: Three-dimensional coordinatesystem.

Page 9: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 91

Absolute & Incremental

Each axis position is defined as either absolute G90 or incremental G91. Theabsolute position is based on the "datum" or zero origin of the program. Theincremental position is based on the current position of the tool.

An example of an absolute system would be mail delivery from the PostOffice. Streets all have a "0" starting number that are east and west or northand south, the positive and negative of our system. Then each house has itsown number. So each location has its own address.

Incremental systems are prone to error. If one increment is missing orincorrect, all the others that follow are in the wrong location.

Example: Absolute & Incremental coordinate positionsAbsolute and incremental positions for Point 1 through Point 4 are listedbelow.

Absolute All coordinate positions are written with respect to the datum.

Pt1 X.5 Y.55

Pt 2 X1.5 Y.55

Pt 3 X2.5 Y.55

Pt 4 X3.5 Y.55

Figure 6: Absolute andincremental coordinatepositions.

Page 10: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

92 Servo CNC System User's Guide

Incremental All coordinate positions are written with respect to the positionat the start of the move - also called the current position.

from Datum To

Pt 1 X.5 Y.55

Pt 2 X1

Pt 3 X1

Pt 4 X1

to Datum X-3.5 Y-.55

Angles

Angles in canned cycles and the G22 rotation command are measured inabsolute decimal degrees. The absolute zero for an angle is at 3 o'clock. Anegative value is clockwise from the 3 o'clock position.

Example: Converting to decimal degreesTo convert from degrees/minutes/seconds to decimal degrees:

Remember:

1° degree = 60' minutes = 3600" seconds

So: 45° 30' = 45.5°

Problem: Convert to decimal degrees

62° 45' 30"

Solution: = 62 + (45/60) + (30/3600)

= 62 + 0.75 + 0.00833

= 62.7583°

Figure 7: Angleconventions.

Page 11: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 93

Programming the Rotary Table

In Pendant and CNC modes, the rotary table is programmed with a C codefollowed by the angular value in decimal degrees (page 92). The feed rate(page 95) uses a D code for degrees per minute. The rotary axis can beprogrammed in absolute or incremental modes.

NOTE The examples given here are based on a Servo II with the rotary tablemounted horizontally on the left end of the table. The C axis pitch in themachine configuration table is .25". Clockwise and counterclockwise aredefined looking at the face of the turntable, with the Servo II motor to theleft.

NOTE You can change the direction of rotation of the rotary table. On theConfigure menu, select Machine, and enter a negative pitch value for the Caxis, for example, -.25.

NOTE On the pendant, the left DIRECTION< key rotates the turntableCCW. The right DIRECTION> key rotates the turntable CW.

NOTE The Run and Verify graphics do not support the C axis. All viewsreflect the XYZ axes only.

TIP When you create a program using the rotary C axis, "dry run" theprogram on the machine to check that the positive and negative angularcoordinates are indeed going in the expected direction. See the NOTESabove.

In absolute mode beginning at zero degrees, the command

G90 C350

rotates the turntable 350 degrees clockwise. Again beginning at zero, thecommand

G90 C-10

Figure 8: Rotary tabledirections for positivepitch.

Page 12: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

94 Servo CNC System User's Guide

rotates the turntable 10 degrees counterclockwise to the absolute 350 degreeposition. In incremental mode, a negative value rotates the turntablecounterclockwise and a positive value rotates the turntable clockwise. Inincremental mode, the command

G91 C40

rotates the turntable 40 degrees clockwise beginning from the currentposition.

Commands of greater than 360 degrees are allowed. If you "wind-up" therotary axis, that is, use values of greater than 360 degrees, the PositionRegister shows the number of turns. In a rapid move, the turntable goesdirectly to the commanded position without "unwinding". For example, if thetable is at 380 degrees (Position shows 1T 20.0000), and you enter,

G90 G00 C0

the turntable will rotate 20 degrees to zero at the rapid feed rate.

Example: Converting linear feed to rotary feedThe formula for converting a linear feed rate to a rotary feed rate is:

D = 360 ( F / π d ) where: D = rotary feed rate (dpm)F = linear feed rated = diameter of workpieceπ = pi = 3.141592

D = 360 ( 10 / π 4 )D = 286.5 dpm

when: F = 10 ipmd = 4"

Example: Rotary index for drilling holesThis program drills three holes, 120 degrees apart.

G0 G90 X0 Y9 Z1 C0 (Start-upF5 (Set Z feedrateG81 C.05 T0 D-.3 (Set drill variablesY0 C0 (Drill at 0 degreesC120 (Drill at 120 degC240 (Drill at 240 degG0 G90 Z1 (Move Z upX0 Y9 C0 (Go to startM30

Page 13: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 95

Example: Rotary table cuttingAll four axes can move and cut simultaneously using G01 linearinterpolation. These programs, for parts such as turbines, are frequently longand complex, requiring CAD/CAM for proper position calculations. A simplespiral "thread" with a lead of .25" by 1" long, cut at a linear feed rate of 2ipm, is shown in this example. (4 x 360 = 1440)

G1 X-1 C1440 D230 F2

Feed Rate Commands (DEF words)The XYZ feed rate is programmed in inches per minute (ipm) in G70, ormillimeters per minute (mmpm) in G71. XY feed rates are programmed usingan F code. For Pendant or Teach mode, Z feed rates are also programmedusing an F word. In CNC mode, the Z feed rate is programmed using an Eword. The C axis rotary table is programmed in degrees per minute (dpm)using a D word. The default feed rate value is the power on state for thecontrol. In the event that several feed rates apply to a command, the slowestone is used. For example, if F = 32 and E = 10, an XZ cut will be at 10 ipm.

Feed rate values in the table are given for a Servo SAM mill or Servo IIretrofit control each with the standard 5 pitch lead screw and Impact Mini-Mills. For a 10 pitch lead screw, such as is typical for a standard Bridgeportknee, divide by 2.

Axis Code Feed Rate Range Configurationipm mmpm

XY F .01 - 100.01 - 175.01 - 50.01 - 100

.25 - 2540

.25 - 4445

.25 - 1270

.25 - 2540

SAM mill or Servo II with 5 pitch lead screwImpact acme screwImpact ball screw

Z E .01 - 50.01 - 50.01 - 100

.25 - 1270

.25 - 1270

.25 - 2540

Servo II 10 pitch lead screwImpact acme screwImpact ball screw

C D 4 - 1000 dpm.01 - 4000 dpm

Servo II (.25 pitch)Impact (.1 pitch)

The default E and F feed rate is 5 ipm or 127 mmpm. The default D feed rateis 100 dpm. (Note: The maximum feed rate that can be taught on the pendantis 50 ipm for a 5 pitch lead screw.)

Page 14: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

96 Servo CNC System User's Guide

Preparatory Functions (G Codes)A preparatory function, known as a G code, is required to change theprogrammed mode of operation of the control. The preparatory functionconsists of the letter G followed by one, two or three digits. The leading zerois not required. More than one G code can be programmed in one block ofinformation as long as the codes do not cancel each other, such as G90 andG91 programmed in the same block.

G code commands are either modal or non-modal.

Modal commands stay in effect until changed or cancelled.

Non-modal commands are valid only in the block in which they appear.

The Reference section has a comprehensive list of G codes in the G CodeTable (page 202).

G00 Rapid Positioning MovesThe G00 (G zero) function causes the machine to operate in rapid positioningmode with absolute or incremental data input. The starting point of the pathis defined by the XYZC coordinate position at the end of the previous blockor command. The end point is the programmed coordinates contained in theblock of data. All programmed axes will move simultaneously, but not in astraight line. G00 cancels G01, G02, and G03. The previously programmedfeed rates (DEF values) are not cancelled.

Axis Rapid ConfigurationXY 190 ipm

400 ipm100 ipm200 ipm

SAM mill or Servo II with 5 pitch lead screwImpact acme screwImpact ball screw

Z 95 ipm100 ipm200 ipm

Servo II 10 pitch lead screwImpact acme screwImpact ball screw

C 3800 dpm9000 dpm

Servo II (.25 pitch)Impact (.1 pitch)

CAUTION When programming a rapid move, it is important to be surethat the path of the tool will clear the work and any fixtures or hold-downs. The speed cannot be overridden by the feed rate overridecontrol, except for the zero position, which stops all motion. All axesmove simultaneously, but not in an interpolated path.

Page 15: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 97

Example: G00 Rapid moves

Using the figure above, you are at A and wish to move at rapid to B. Thecommand is:

G90 G00 X19 Y10

To move in incremental mode from A to B, the command is:

G91 G00 X16.5 Y5.5

To stop at B to change a tool or manually drill a hole using the quill, thecommand is:

G90 G00 X19 Y10 M00

G01 Linear Interpolation at Feed RateThe G01 function causes the machine to operate at the programmed feed rateas the axes travel along a straight line with absolute or incremental data input.The starting point of the path is defined by the XYZC coordinates of theprevious block. The end point is the programmed coordinates contained inthe block of data. All programmed axes will move simultaneously (usinglinear interpolation). G01 cancels G00, G02, and G03.

Example: G01 one axis cut

Figure 9: Path of a rapidmove.

Figure 10: G01 singleaxis move.

Page 16: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

98 Servo CNC System User's Guide

Using the figure above, suppose you are positioned at A and wish to make acut to B at a feed rate of six inches per minute. In absolute mode, thecommand is:

G90 G01 X30 F6

To return to A in absolute mode, the command is:

X8.5

From A to B in incremental mode, the command is:

G91 G01 X21.5 F6

To return to A in incremental mode, the command is:

X-21.5

Note that in the absolute example, the X value is written with respect to thezero datum. In the incremental example, the X value is the distance betweenA and B. Also note that there is no Y dimension in the block, since you arenot changing the Y value.

Example: G01 two axis cut

Using the figure above, make a diagonal cut in the XY plane. Assume thatthe tool is positioned at A and you want to cut from A to C at a feed rate offifteen inches per minute. In absolute mode, the command is:

G90 G01 X30 Y12.5 F15

In incremental mode, the command is:

G91 G01 X21.5 Y7.5 F15

Figure 11: G01 in the XYplane.

Page 17: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 99

Since the destination C represents a change in both axes, the block mustcontain both X and Y coordinates. Now make a cut back along the same linefrom C to A. In absolute mode, the command is:

X8.5 Y5

In incremental mode, the command is:

X-21.5 Y-7.5

In incremental, the coordinates are written with respect to the tool location atthe start point of the cut. Since the tool is moving in a negative direction inboth axes to arrive at A, both coordinates (X and Y) are negative.

Example: G01 three axis cut

Using the rectangular solid in the figure above, suppose you need to make aramp cut from A to B. The data block written in the absolute mode with a teninch per minute feed rate is:

G90 G01 X3.25 Y0 Z-1.62 F10 E10

In the incremental mode, the command is:

G91 G01 X3.25 Y-2.75 Z-1.62 F10 E10

You can also make moves in selected planes. For example, returning from Bto datum in absolute:

G90 G01 X0 Z0

or incrementally:

G91 G01 X-3.25 Z1.62

Figure 12: G01 in threeaxes XYZ.

Page 18: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

100 Servo CNC System User's Guide

A single Z axis move is a plunge cut, for example, from C to B:

G90 G01 Z-1.62

or incrementally:

G91 G01 Z-1.62

G02, G03 Circular InterpolationThe G02 function indicates that the axes motions will generate a full arc or asegment of an arc in the clockwise direction. The plane in which the arc isgenerated is defined by the G17/18/19 code. The arc radius is defined by theend point and the incremental coordinates from the start point to the center ofthe arc (I,J,K). G02 cancels G00, G01, and G03. (See examples.)

The G03 function is the same as G02 except in the counterclockwisedirection. G03 cancels G00, G01, and G02.

Notice that the circle on the XZ plane appears to be going counterclockwisein response to the G02 code. This is because the view is shown as though wewere standing in front of the mill, and in order to view the XZ planecorrectly, we would have to stand behind the mill. The rotations are valid fora view of the plane from the positive end of the axis perpendicular to theplane (in this case, the positive end of the Y axis). The problem doesn'tappear in our illustration of the YZ plane since we are viewing it from thepositive end of the X axis.

NOTE If your entire program is in the XY plane, you do not have to specifyG17.

Figure 13: G02 referencein XY, XZ and YZ planes.

Page 19: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 101

Example: Arcs begin and end on an axis

The simplest case is a full 360 degree circle in the XY plane starting on anaxis. Using the figure above, suppose you wish to make a full circleclockwise (G02) from point A on the circumference of the intended circleand lying on the X axis of the part. The command is:

G02 I1.25

Since you are making a full circle, the end point is the same as the start point.J is 0 because you are starting on the X axis of the circle. No J value isrequired since J is 0. Note that the sign of I is plus (+). I and J define thecenter of the arc with respect to start point. Since the center of the arc ispositive (to the right) with respect to the start point, I is positive. If you startat B, A clockwise full circle is:

G02 I-1.25

Starting at C (on the Y axis), the incremental coordinate of the radius is - J,so the command is:

G02 J-1.25

starting at D, the command is:

G02 J1.25

In all cases above, you could have made the circle in the CCW rotation byreplacing G02 with G03.

To make a 90 or 270 degree arc from A to C, since the illustration does notindicate the absolute coordinates of the circle, you have to define the endpoint C, using incremental X and Y coordinates (G91):

G91 G02 I1.25 X1.25 Y1.25

Figure 14: Full circle orbegin and end on an axis.

Page 20: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

102 Servo CNC System User's Guide

Now, return along the same arc path from C to A, still without knowing theabsolute coordinates of the circle:

G91 G03 J-1.25 X-1.25 Y-1.25

If the center of the circle is the (0,0) datum, the 90 degree arc from A to C is:

G90 G02 I1.25 X0 Y1.25

and the 90 degree arc from C to A is:

G90 G03 J-1.25 X-1.25 Y0

Example: Arcs begin or end at an angle

You can begin at any angle on a circle and end at any angle. Using the figureabove, make a full circle CW, beginning at D, a point on a 1.25 radius whichlies at a 45 degree angle from the X axis of the circle. Since you are notbeginning on an axis, you have to define both the I and J components of theradius. Since the angle is 45 degrees, I and J have the same size as found by:

1.25 cos 45 degrees = .8839

To get the signs of I and J right, remember that they define the center of thearc with respect to the start point D. The command is:

G02 I.8839 J-.8839

No end points (X and Y) are required, since you are making a full circle andno G91 is required, since the control interprets all I and J dimensions asincremental.

If you want to make an arc clockwise, beginning at D and ending at E. Youhave to put in coordinates of E. In incremental mode, the command becomes:

G91 G02 I.8839 J-.8839 X1.7678 Y-1.7678

Figure 15: Arcs beginand end at any angle.

Page 21: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 103

Suppose the center of the circle is the (0,0) datum. The same move written inabsolute is:

G90 G02 I.8839 J-.8839 X.8839 Y-.8839

From D and ending at F:

G90 G02 I.8839 J-.8839 X0 Y-1.25

Example: Arcs in the XZ or YZ plane (G18/G19)

Using the figure above, make a clockwise arc from A to B. Since we don'tknow the absolute location, the block would read:

G91 G19 G02 J1.5

starting at B and returning to A.

G91 G19 G03 Y-1.5 Z-1.5 K-1.5

Now program the circle on the XZ plane starting at C and going clockwise(as viewed) to D. Remember there is an apparent reversal of rotation when inthe XZ plane is viewed from the front of the mill! The block would be:

G91 G18 G03 X1.067 Z-2.5607 I1.0607 K-1.0607

Starting at D and returning to C:

G91 G18 G02 X-1.0607 Z2.5607 K1.5

Figure 16: G18 and G19programming examples.

Page 22: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

104 Servo CNC System User's Guide

If we know the coordinate system datum point, we could write any of theabove examples in absolute notation. For example, if the coordinates ofposition D are X3 and Z.5, the data block in absolute for an arc from D to Cwould be:

G90 G18 G02 X1.9393 Z3.0607 K1.5

In a practical case, D would also have a Y coordinate, but it wouldn't showup in the data block because it wouldn't change for a contour in the XZ plane.

Example: Helical interpolationIn the XY plane, this cut creates a spiral ramp or, with appropriate tooling,can be used to cut threads. A Z axis value is added to a G02 or G03 datablock. The Z axis value is distributed evenly as the arc is cut. For example,using a circle with a 1.25 radius and adding .25 lead for a full circle, thecommand is:

G91 G02 I1.25 Z-.25

This will machine a spiral ramp down .25 in 360 degrees of arc. To do athread with, for example four turns, use the command above in a subroutineand call it four times.

NOTE Cutter diameter compensation cannot be used with helicalinterpolation.

G04 DwellThe G04 function sets a dwell time from .05 seconds to 999 seconds. Theformat is

G04 Fn

where n is the number of seconds.

NOTE The maximum dwell time for programs run on the pendant isapproximately 65 seconds.

Example: G04 Dwell per revolutiondwell in seconds = desired # of revolutions / [spindle RPM / 60]

If the desired dwell time is 3 revolutions and

If the spindle speed is 1500 revolutions per minute

# of seconds = 3 revs / [ (1500 rev/min) / (60 sec/min) ]

= 3 / 25 = .12 seconds = G04 F.12

Page 23: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 105

G17, G18, G19 Modal Plane SelectThese functions select the plane for circular interpolation (G02 and G03).The G17/18/19 code can be in the same block with a G02 or G03 code butmust be before the G2 or G3 code, for example

G19 G2 X.3 Z.4 I.6

Clockwise and counterclockwise direction is determined by looking towardthe selected plane from the positive axis normal to the plane.

G17 selects the XY plane and is the power on default. G17 is modal andcancels G18 and G19.

G18 selects the ZX plane. G18 is modal and cancels G17 and G19.

G19 selects the YZ plane. G19 is modal and cancels G17 and G18.

NOTE Cutter compensation (G41/42) is valid in G17 only. A G40 isrequired before programming a G18 or G19.

NOTE The C axis used as Z is not supported.

Example: Arcs using a ball nose endmillA ball nose endmill is best to use when cutting an arc in the XZ or YZ plane.Program to the center of the ball as shown in the figure below. The toolmaintains a tangent relationship with the arc.

Figure 17: G02 and G03directions for G17, G18,and G19.

Figure 18: G18 cylinderusing ball nose endmill.

Page 24: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

106 Servo CNC System User's Guide

The program below cuts a 2" long cylinder in the XZ plane using a .250"diameter ball nose endmill.

N010 G90 X3 Y2.5 Z1.2N015 E6 F6N020 G0 X2.2 Y0N025 Z.4N030 G1 X1.8N035 P0110 (LENGTH 2"N040 G90 G1 X2.2N045 Z1.2N050 M25N055 G0 X3 Y2.5 M30( P01 (SR CYLINDER + ADVANCEN100 G90 G18 G2 X.3 Z.4 I-.75N105 G91 G1 Y.1N110 G90 G3 X1.8 Z.4 I.75N115 G91 G1 Y.1 M12

Example: Arc using a flat endmill When a flat bottom endmill is used, program a clockwise and counter-clockwise cut to the "edge" of the tool.

The program below cuts a 2" long cylinder in the XZ plane using a .250" flatbottom endmill.

N010 G90 X3 Y2.5 Z2N015 E6 F6 T0N020 G0 X2.15 Y0N025 Z.4N035 P0120 (LENGTH 2"N040 G90 G1 X2.15N045 Z2N050 M25N055 G0 X3 Y2.5 M30

Figure 19: G18 cylinderusing flat bottom endmill.

Page 25: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 107

( P01 (SRN095 G1 X2.025 (CUT TO CYL STARTN100 G18 G2 X1.4 Z1.025 I-.625N105 G1 X1.3 (CUT .1 ACROSS TOPN110 G0 X.65 (MOVE TO SAFE PLACEN115 Z.4 (Z START LEVELN120 G1 X.775 (CUT TO CYL STARTN125 G3 X1.4 Z1.025 I.625N130 G1 X1.5 (CUT .1 ACROSS TOPN135 G0 X2.15 (MOVE TO SAFE PLACEN115 G91 Y.1 (MOVE TO NEXT CUTN140 G90 Z.4 (Z START LEVEL M12

G21 Scaling and Mirror ImageG21 is used for both scaling and mirroring. The G21 code allows theprogram, or section of the program to be mirrored on each axis, or scaled.The format is

G21 Xn Yn Zn

where n is +1 or -1 to mirror or some other value if the part is also scaled, forexample .5 for 1/2 scale. To return to normal polarity and 1:1 scale program

G21 X1 Y1 Z1

When G21 is active, the "Scaling" values are displayed on the G-Code statustab (page 24).

CAUTION For safety, it is good practice to cancel the G21 code in thefirst block of any program using G21.

Guidelines for G211 For safety, it is good practice to cancel the G21 code in the first block of

any program using G21. This is done by programming: G21 X1 Y1Z1.

2 The mirror centerline, also known as the mirror or reflection plane, ismost easily programmed using a G94, which is an absolute X, Y, or Zoffset from the program datum point (absolute zero). The programexample (page 110) shows two methods for defining the mirrorcenterline.

3 If the part is programmed in absolute mode, the scale origin is absolutezero, unless moved by a G94 code. If the part is programmed inincremental mode, the scale origin is the tool position when the G21 iscommanded. See the example (page 112).

Page 26: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

108 Servo CNC System User's Guide

4 Scaling can cause some cuts to equal zero. This can affect cuttercompensation and generate various error messages. If cut comp is aproblem, try using a smaller diameter tool, change the lead-in cut toincrease the distance, or put the lead-in before you set the scale.

5 Unequal scale values can be used, for example G21 X.8 Y.9, however,circular interpolation will not work properly. The X and Y values must bethe same to make a circle, however, not necessarily the same sign.

6 When the mirror image of an axis is set, the control simply changes thesign of every coordinate read for that axis. Also, if only one of the axesfor an arc or circle is reversed, the direction of the arc (clockwise orcounterclockwise) is reversed. If only one axis is reversed, the directionof motion around the part is also reversed. That is, climb cuts becomeconventional cuts and vice versa.

7 The Z axis can also be mirrored, however care should be taken whenapproaching and retracting from the workpiece. A Z axis mirror imageturns the concave (female) half of a mold into the convex (male) half of amold. Make sure the tool approach and retract are not mirrored or the toolwill collide with the part!

Example: G21 right- and left-hand parts

To machine these parts, the program is written for the right-hand part. Then,the mirror of the Y axis is the left-hand part. Typically, a subroutine is usedfor the basic program. A program to machine a right-hand and then a left-hand part can be done as follows:

G21 X1 Y1 (Cancel mirror imagingP0101 (Machine the right-hand partG21 X-1 (Mirror image the X axisP0101 (Machine the left-hand partM30(P01 (The program for the : (right-hand partM12 (goes here

Figure 20: Mirroringabout the Y axis.

Page 27: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 109

Example: G21 symmetrical about 0,0Parts that are symmetrical about 0,0 include both wheel-like parts and partswith right-left symmetry. Suppose a part is symmetrical top-to-bottom andside-to-side. Rather than programming each of the four quadrants separately,the program might be written as shown below the figure.

G21 X1 Y1 (Cancel mirror imageP0101 (Machine the upper rgt-hand quadG21 X-1 (Mirror XP0101 (Machine the upper lft-hand quadG21 Y-1 (Mirror X and YP0101 (Machine the lower lft-hand quadG21 X1 Y1 (Cancel mirror X and YP0101 (Machine the lower rgt-hand quadM30(

P01 (The program for the upper : (right-hand quadrant goes hereM12

Figure 21: Mirroringabout the X and Y axis.

Page 28: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

110 Servo CNC System User's Guide

Example: G21 multiple part fixtureWhen machining several identical parts on one fixture, you can sometimesmachine more parts per machining cycle if some are turned 180 degrees, asshown in the figure below. A convenient way to do this is to first write asubroutine for one part. Then, define another subroutine that reverses boththe X and Y axes and then calls the first subroutine. This example shows twoprograms, one in incremental mode and one in absolute more that also usesG94.

This program uses incremental mode for the subroutines and programs anabsolute move to each start point to position properly for the incrementalmove.

G21 X1 Y1 Z1 (Cancel mirror imageG0 G90 X0 Y1 Z1 (Go to start part 1Z.05 (Z to clear planeP0101 (Machine part 1G0 G90 X1.7 Y-.2 (Move to part 2P0201 (Machine reverse partG21 X1 Y1 (Set normal symmetryG0 G90 X1.9 Y1 (Move to part 3P0101 (Machine part 3G0 G90 X3.6 Y-.2 (Move to part 4P0201 (Machine part 4G21 X1 Y1 (Set normal symmetryG0 G90 X0 Y1 Z1 (Go to start ptM30 (End of main program(P01 (SR to mach normal partG91 G1 Z-.2 E2 (Incremental modeY-1 F10X1Y.3X-.5Y.4X-.5G0 Z.2Y.3M12 (End SR for normal part(

Figure 22: Using G21 ona multiple part fixture.

Page 29: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 111

P02 (SR to machine reverse partG21 X-1 Y-1 (Mirror partP0101 (Machine partM12 (End SR for reverse part

This program uses absolute mode for the subroutines and a G94 code totemporarily move the datum for each part. The subroutine has an absolutemove to the start point.

G21 X1 Y1 Z1 (Cancel mirror imageG0 G90 X0 Y1 Z1 (Go to start part 1Z.05 (Z to clear planeP0101 (Machine part 1G94 X1.7 Y.8 (Set origin for part 2P0201 (Machine reverse partG21 X1 Y1 (Set normal symmetryG94 X1.9 Y0 (Set origin for part 3P0101 (Machine part 3G94 X3.6 Y.8 (Set origin for part 4P0201 (Machine part 4G21 X1 Y1 (Set normal symmetryG94 X0 Y0 (Set origin to datumG0 G90 X0 Y1 Z1 (Go to start ptM30 (End of main program(P01 (SR to mach. normal partG90 G0 X0 Y1 (Absolute mode start ptG1 Z-.15 E2Y0 F10X1Y.3X.5Y.7X0G0 Z.05Y1M12 (End SR for normal part(P02 (SR to mach. reverse partG21 X-1 Y-1 (Mirror partP0101 (Machine partM12 (End SR for reverse part

Page 30: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

112 Servo CNC System User's Guide

Example: G21 scalingThe scaling feature allows the position of each axis to be proportionallyincreased or reduced under program control. This can be used to adjust forshrink factors in molds. It can also be used to run a scaled prototype of alarger part that would otherwise be cut on a larger machine. When G21 isactive, the "Scaling" values are displayed on the G-Code status tab (page 24).

The figure shows the scale origin. If the part is programmed in absolute mode(G90), the scale origin is absolute zero, unless moved by a G94 code. If thepart is programmed in incremental mode (G91), the scale origin is the toolposition when the G21 is commanded.

N010 F10 E2 T0 G40 (Start-upN020 G90 G0 Z1N030 X0 Y0N040 T13 (.187 dia endmillN050 G94 X2.1 Y.5(Set scale originN060 G21 X.5 Y.5 (Set scaleN070 P0101 (Cut PartN080 G21 X1 Y1 (Cancel scaleN090 G94 X0 Y0 (Set origin to datumN100 G90 G0 Z1N110 X0 Y0 T0 M30( P01 (Basic part at datumN301 G90 G0 X-.2 Y-.2N302 Z.1N303 G41 (CutComp ON leftN304 G1 X-.2 Y-.2 Z-.05N305 X0N306 Y.8028N307 G2 I.25 J0 X.4415 Y.9635N308 G1 X1.25 Y0N309 X-.2N310 G40 (CutComp OFFN311 Z.1 M12

Figure 23: Scaling andscale origin.

Page 31: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 113

A program that allows for a 3% shrink factor in a mold might be done asfollows:

G90 G0 X Y Z (Program start-upG21 X1.03 Y1.03 (Set scaleP0101 (Machine moldG21 X1 Y1 Z1 (Cancel scaleG90 G0 X Y Z (Return to start-upM30(P01 (The basic program for theG90... (mold goes here :M12

G22 RotateThe G22 code allows the program, or section of the program to be rotatedaround the datum point or around an offset datum defined using G94. Theformat is

G22 Xn

where n is an absolute angle (page 92) of rotation in decimal degrees (page92). At the end of the program, reset the angle to zero by programming

G22 X0

NOTE The G94 point is not identical to the center of rotation for a rotatedpattern.

Example: G22 toolpath rotation

Figure 24: Rotatetoolpath example.

Page 32: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

114 Servo CNC System User's Guide

The tool path is defined in its "original" location in subroutine P01. Thesubroutine is in absolute. G94 and G22 are used to reposition and rotate thepath. For example, to find the G94 coordinates of Part 2,

side = 1.5 x sin 45 = 1.5 x .70711 = 1.0607X = -3 +1.0607 = -1.9393Y = -2 + 1.0607 = -.9393

Notice that the T code for cutter compensation is defined before any G94.This is because the XYZ offset values associated with a T commandsupersede the offset values of the G94 command. The cutter compensation isdefined within the subroutine. It is turned off before positioning to a newlocation, otherwise that move will also be a compensated move.

N1 F10 E2 T0 G40 (Program start-upG90 G0 Z1X-0.5 Y2T4 (T4=.250 dia endmillG94 X-1.5 Y-2 (Position to Part 1G22 X0 (Set rotationP0101 (Cut Part 1N2 G94 X-1.9393 Y-.9393 (Position to Part 2G22 X45 (Set rotationP0101 (Cut Part 2N3 G94 X-3 Y-.5 (Position to Part 3G22 X90 (Set rotationP0101 (Cut Part 3N4 G94 X-4.067 Y-.9393 (Position to Part 4G22 X135 (Set rotationP0101 (Cut Part 4N5 G94 X-4.5 Y-2 (Position to Part 5G22 X180 (Set rotationP0101 (Cut Part 5N6 G94 X0 Y0 (Return to original 0G22 X0 (Set rotation to 0G90 G0 Z1 (Return to Z homeX-.5 Y2 (Return to XY start ptM30 (End main program

P01 (Basic part at datumN301 G90 G0 X-.2 Y-.2 (Move to start cutN302 Z.1N303 G41 (Cut comp Left T4N304 G1 X-.2 Y-.2 Z-.05N305 X0 Y-.2N306 X0 Y.8028N307 G2 I.25 X.4415 Y.9635N308 G1 X1.25 Y0N309 X-.02 Y0N310 G40N311 Z.1M12

Page 33: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 115

G40, G41, G42 Cutter Diameter CompensationThe G40 code cancels cutter diameter compensation left or right.

The G41 and G42 codes allow you to program the edge of the part withoutbeing concerned about the actual diameter of the tool. The tool diameter isthen supplied from the Tool Table. Left or right are defined as follows: whenlooking in the direction of the cut, for G41 the tool is on the left hand side ofthe material, for G42 the tool is on the right hand side of the material. G40 orG42 cancel G41. G40 or G41 cancel G42.

TIP Pretend the tool is a car and you are sitting in the car driving along inthe direction you want the tool to cut. Where is the tool in relation to thematerial to be cut? Choose LEFT if the tool is to the left of the material,choose RIGHT if the tool is to the right of the material.

Cutter Comp Rules & Guidelines1 The G41 or G42 codes must be followed by a linear move that begins

without compensation and ends with compensation as shown in example"Lead in (page 117)". The G40 code must be followed by a linear movethat begins with compensation and ends without compensation as shownin example "Lead out (page 118)".

Figure 25: G41 and G42cutter diametercompensation.

Page 34: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

116 Servo CNC System User's Guide

2 If you need to change to the opposite cutter compensation direction, thatis from left G41 to Right G42 or vice versa, use the G40 command tocancel first. Then start the opposite direction. You may want to make thestartup or ending moves "in air."

3 The compensated tool "rolls around" sharp corners with a zero radius tokeep the tool in contact with the workpiece.

4 New T codes are not allowed inside a compensated path.

5 G21 used for mirror image causes cutter comp to cut the "wrong" side.G21 used as a scale factor can be used with cutter comp.

6 Canned cycle G codes automatically turn cutter compensation off (G40).If you had cutter comp on (G41 or G42) before you programmed apocket, frame, face, or drill pattern canned cycle, it will be OFF whenyou exit the canned cycle.

7 When used with subroutine calls (P codes) and returns (M12), programthe G41/G42 and cancel G40 entirely within the subroutine as shown inthe G22 example or entirely outside. Do not turn it on outside thesubroutine and off inside the subroutine; the results can be bizarre.

8 In cutter compensation, the system "looks ahead" to see where the tool isgoing in order to plan the appropriate end point for each cut. Because ofthis, cutter comp does not allow a 180° change in direction. For example,if you try to move from X1 to X0 and back to X1, the system displaysERROR: Tool is too large. When cutting a slot that is the width of thetool, follow the example (page 120).

9 Cutter compensation can not be used with circular interpolation in the XZand YZ planes (G18 and G19).

10 Cutter compensation does not support different lead screw pitches for theX and Y axes.

11 The cutter compensation look-ahead can not prevent gouging when a toolenters or exits a confined space as shown below. It is up to theprogrammer to verify that the tool can fit through the required openings.

Figure 26: Tight spotsfor cutter compensation.

Page 35: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 117

Cutter Comp Tips

TIP One T code can be used for a roughing tool and another for a finishingtool. Or, you may program for the nominal tool diameter and use thecompensation function to adjust for the difference between the programmedtool and the actual tool. For example, if you write the program for a .156diameter endmill, and the tool is actually .154 diameter, enter -.002 for thediameter in the Tool Table.

TIP In some cases, it may be necessary to "fool" the system in order for thebeginning and ending of cuts to work exactly as the machinist would like.For example, you may have to program two XY approach moves to get thetool to the desired position. One of these moves can be "in the air" followedby a Z move to the cut plane, before the second XY move. The best approachis perpendicular to the line to be cut.

TIP Make sure cutter compensation is OFF before positioning for drilling orgoing to the Start Point or tool change position. Otherwise the tool will moveto the compensated position.

TIP Program your tool path without cutter compensation first, but allow for"starts'n'ends" as stated in the rules. Then turn cutter compensation on (Leftor Right) to see and debug the compensated path. Sometimes errors occurwith cutter compensation on that don't happen when it is off.

Example: Starting cutter compThe G41 or G42 code must be followed by a linear move that begins withoutcompensation and ends with compensation.

Figure 27: Startingcutter compensation.

Page 36: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

118 Servo CNC System User's Guide

Example: Ending cutter compWhen cutter comp is turned off, the G40 code must be followed by a linearmove that begins with compensation and ends without compensation.

Figure 28: Ending cuttercompensation.

Page 37: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 119

Example: G41 ToolpathThe first figure shows the toolpath for no cutter comp. The second figureshows the toolpath for G41. The tool (T4) is a .250 diameter endmill. Theprogram is shown below the figures.

N10 E2 F10 T0N15 G90 G0 X-.5 Y1 Z1 (Start upN20 X.2 Y-.75 (Position XYN25 Z.05 T4 (Call T4N30 G1 Z-0.1 (Plunge ZN35 G41 (Comp on leftN40 Y-.5N45 X0N50 G2 J.5 X0 Y0.5N55 G1 X0.634N60 X1.5 Y0N65 Y-0.3N70 G2 I-0.2 X1.3 Y-0.5N75 G1 X-.1N80 Y-0.75N85 Z.05N90 G40 (Turn Comp offN95 G0 X-.5 Y1 Z1 M30

Figure 29: G41 ExamplePart with cutter comp offand cutter comp left.

Page 38: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

120 Servo CNC System User's Guide

NOTE The "Engineering Drawing" for dimensions and a manual programcan be found here (page 210).

Example: G42 "The slot solution"In this example, the tool is .250 diameter and the slot is .25 wide. The normalsolution is to program the tool to cut up the center of the slot. When usingcutter diameter compensation, you program the edge of the part. However, toprevent cutter compensation from choking on the 180° turn at the end of theslot, program the slot width .0001" wider than the tool as shown in programbelow.

N10 G90 G0 X0 Y0 T4N20 G1 X-.15 Y-.15N30 G42N40 X0 Y0N50 X.5N60 Y.625N70 G91 X.2501N80 G90 Y0N90 X1 : :

G70, G71 Inch, Metric ProgrammingThe G70 code is the default or power on state for the control. All data areinterpreted as being in the inch dimension system with X1 read as 1 inch.G70 cancels G71.

After a G71 code, all data are interpreted as being in the metric dimensionsystem with X1 read as 1 millimeter. G71 cancels G70.

G90, G91 Absolute, Incremental ProgrammingThe G90 code causes the control to read all XYZC values as absolutecoordinates, that is, all coordinates are written with respect to the zero datum.G90 is the default power on state for the control. G90 cancels G91.

Figure 30: G42 the "slot"solution.

Page 39: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 121

The G91 code causes the control to read all XYZC values as incrementaldistance commands, that is, all coordinates are written with respect to theposition at the start of the move. If the direction of motion is minus, theincremental distance value must be preceded by a minus sign. If the directionof motion is plus, no sign need be entered; absence of a sign is interpreted tobe a plus by the control. G91 cancels G90.

Go here to see an example (page 91).

TIP The choice of programming in absolute or incremental is usuallydictated by the drawing you are using to write the program. Sometimes ashop drawing has all the dimensions referenced to a single datum so that G90absolute is the appropriate choice. At other times, the program requires anumber of repetitive moves, in which case G91 incremental is the betterchoice.

G92 Position PresetThe G92 code provides the ability to preset XYZC absolute position registersto any desired dimension. The machine slides will not move in response tothis block. The G92 command allows the translation of an original coordinatesystem to a new part coordinate system. This is convenient if multiple partson a fixture are made. However, since the G92 preset command replaces theprevious contents of the absolute registers, a new G92 preset command and apositioning move will be necessary to return to the original coordinatesystem.

When setting up a new part, G92 can be used in MDI mode to set the partdatum as shown in the example (page 54).

CAUTION G92 destroys the previous contents of the absolute registers.This means that if you interrupt the run with a STOP that resets theprogram or Emergency Stop, the program does not know where theoriginal datum (X0 Y0 Z0 C0) is.

Page 40: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

122 Servo CNC System User's Guide

G93 Reference to Machine ZeroThe G93 function defines the XYZC location of a program in relation tomachine zero (the machine "home" position). The G93 "zero" is an arbitraryposition on the table that does not change unless an MCI is done. In Pendantor Teach modes, G93 is automatically placed in a file stored in the pendantwhen the Start Point is set. If the SP is moved (reset), a new G93 command isstored.

CAUTION The G93 zero changes when you do an MCI or if youremove and re-install an axis motor and the lead screw has changedposition. The encoders do not know that the lead screw is in a differentplace. If you run an "old" program with a G93 in it, it is best to checkthat it is in the expected location.

G94 Coordinate System OffsetThe G94 code defines a temporary coordinate system as an absolute offsetfrom the program datum (zero or G92 position). An absolute move isrequired to position the table after a G94 command. Return to the originalprogram datum by programming

G94 X0 Y0 Z0

This command is especially useful with G21 and G22.

NOTE If you are using G94 for repeats or fixture offsets, program aG94X0Y0Z0 before commanding a new coordinate system offset or useVerify to be sure you are getting the results you expect.

For examples of G94: used for deep pockets and frames (page 155); used forrepeat and rotation (page 113); used for scale origin and mirror centerline(page 107).

G98 Standard In-Position DetectionThe G98 code requires each axis to be at the commanded end point beforecontinuing. Rapids are always in-position. "In-position" means that the motorcontroller checks that the commanded position has actually been reached atthe end of every move, essentially a test that the servo lag has "caught up"and the axis is indeed at the commanded position. This is the power on statefor the control. G98 cancels G99.

Page 41: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 123

G99 Continuous Contouring ModeThe G99 code bypasses the G98 in-position test. G99 is used to achievesmoother finishes in the case of lines tangent to arcs, since the controller willnot pause for the in-position test, and therefore no tool dwell mark will bemade. At a fast feed rate, this can also cause loss of accuracy. G99 cancelsG98.

Canned CyclesA canned cycle is a pre-programmed sequence of operations called by a Gcode. These include pocket, frame, face, bolt circle, rectangle fill, andrectangle frame. Canned cycles, as a group, have some commoncharacteristics.

Cutter compensation is automatically turned Off (G40) at the start of thecanned cycle. If you had cutter compensation on (Left or Right) beforeyou programmed the canned cycle, it will be Off when you exit thecanned cycle. You must restart cutter compensation.

Feed rates must be specified before programming a canned cycle.

When a canned cycle is programmed, the first movement of the tool is atrapid feed from the Calling Point to the Plunge or Start Point (or firsthole) of the cycle. If the tool is already at the Start Point, there is nomovement. The Calling Point is where the tool is located at the end of thelast move before the canned cycle. At the end of the canned cycle, thetool returns to the Calling Point from the Retract or End Point of thecycle.

The "anchoring" point of the canned cycle (for example the center of thepocket) is either absolute or incremental depending on the G90 or G91code in effect when the cycle is specified. When incremental, it is thedistance from the Calling Point.

Before programming a pocket or frame canned cycle, you must programa tool (T code) that has a non-zero tool diameter entered in the ToolTable.

These rules are somewhat different for drill cycles, which are modal. TheZ feed rate must be programmed before initiating the drill cycle and thetool does not return to the XY Calling Point.

TIP To minimize excess motion, make sure the tool is near the plunge orstart point, retract or end point, or center when a canned cycle isprogrammed. The tool returns to the Calling Point at the end of the cycle.

Page 42: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

124 Servo CNC System User's Guide

Drill Cycles G80'sG72, G73, G81, G82, G83, G85, G89

The fixed Z axis drill cycles are modal. They are valid until cancelled byG80, G00, G01, G02, or G03. They are also cancelled by M30 or M02. The Zaxis feed rate (E code) must be set before calling the drill cycle. The blocksetting up the drill cycle can not contain XYZC axis positions. After theblock setting up the drill cycle, each block containing an axis position causesthe slides to move at rapid to the position and then initiate the Z axis cycle.The following table and figures define the variables and characteristics of thedrill cycle codes.

NOTE If used, G92, G93, G94, G21, G22, and G40/41/42 must beprogrammed outside the drill cycle. G90/91 and G70/71 can be inside thedrill cycle.

DescriptionGCode

-ZDown

Dwell atbottom

+ZRetract

Drill G81 feed rapid

C'bore, spotface G82 feed yes rapid

Peck, clear chip G83 intermittent feed rapid

Peck, break chip G73 intermittent feed rapid

Bore G85 feed feed

Bore with dwell G89 feed yes feed

Manual G72

Custom G72 feed orintermittent feed

bottom&/or top

feed orrapid

A drill cycle follows this sequence:1. Rapid to X and Y position.2. Rapid to Clear Plane.3. Machine the hole.4. Move out of the hole in Z.5. Rapid to the next hole or cancel cycle.

Page 43: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 125

Variables: Drill Cycle

NOTE Not all variables are valid for all cycles. See the syntax examples.

NOTE When using drill cycle variables (M1 for automatic) with G72 (page130) and drill pattern cycles (page 146), CTD are required. If any othervariable is used, all must be listed or you'll get an error: Illegal parameter list.

M Manual = 0Auto = 1

When = 0, manual quill operation orWhen = 1, use variables below

G72

C Clear plane Absolute Z height at which downfeedbegins

all

T Top of hole Absolute Z height at the top of the hole all

D Depth A negative increment from the top of thehole

all

G 1st peckincrement

Used for the initial cut into the hole ifdifferent from the peck increment

G72,G73, G83

I Peck increment The distance to feed into the work beforeretracting

G72,G73, G83

P Peck clearincrement

Distance the tool retracts when it hasreached the peck increment depth.

G72, G73

E Dwell at top 0.05-999 seconds at the clear planebetween peck increments

G72

B Dwell at bottom 0.05-999 seconds at final depth G72,G82, G89

F Retract at feed When = 1, uses E feedrate to retractWhen = 0, uses rapid

G72

The Manual/Auto variable determines whether the operator uses the quill orwhether the Z axis slide controls the cycle. If M=1, the variables for drillfixed cycles are required to program the drill cycle. For manual drilling(M=0), the slides move to the XY position and then stop (M52) to allow thequill to be used to drill the hole. Restart the run cycle by pressing F8 or Run.The slides then move to the next position.

The Clear Plane is the absolute Z level at which the cycle downfeed begins.On retract, the tool moves at rapid to the Clear Plane, unless F=1.

If the Initial Z Height is above the Clear Plane, Z moves at Rapid fromthe Clear Plane to the Initial Z. The move between all holes is at theInitial Z Height. Then the tools returns to the Clear Plane at Rapid.

If the Initial Z Height is at the Clear Plane, the move between all holes isat the Clear Plane.

The Initial Z Height is the last position in Z before you program the drillcycle command. See the drilling program example (page 126) for aposition-by position description.

Page 44: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

126 Servo CNC System User's Guide

NOTE If there are walls or clamps between holes, make sure the Initial ZHeight clears all obstructions!

The Depth of the hole is a negative increment from the Top of Hole. The Topof Hole is always an absolute value.

The First Peck Increment is used for the initial cut into the hole if you want itto be less than or greater than the "Peck Increment." If you want the initialcut to be the same as all the peck increments, you need only specify a "PeckIncrement."

The Peck Increment is the distance to feed into the work before retracting,either to the Clear Plane for a chip clear cycle, or the Peck Clear Incrementfor a break chip cycle.

The Peck Clear Increment is the distance the tool retracts when it has reachedthe Peck Increment depth. For example, you may want it to back up 0.05"just to break the chip. If a Peck Increment is specified and no Peck Clear isspecified, the Rapid retract goes to the Clear Plane. Otherwise it retracts thePeck Clear Increment at Rapid.

The dwell variable can be from 0.05-999 seconds. The Dwell at Top variableindicates a dwell at the Clear Plane between Peck increments to allow forbrushing off chips or applying lubricant. Dwell at Bottom is only when thefinal depth is reached. To convert revolutions of the tool into seconds, seedwell per revolution (page 104) example.

The Retract at Feed variable specifies how the tool withdraws from the holeto the Clear Plane. When F=1, the tool retracts from the hole at the E feedrate used to enter the hole. F=0 causes the tool to retract at Rapid.

Example: Drill cycle programsThis example shows a G81 drill program and what happens as each block ofthe program is performed on the machine.

N1G90G0X-5Y1Z1E5 Start up & set Z feedrateInitial Z Height Z=1 abs

N2G81C.05T0D-.5 Set drill variables (no axis values allowed)No machine movement

N3X1Y0 Rapid to X=1 abs, Y=0 absRapid to Z=.05 absDrill to Z=-.5 absRetract to Clear Plane Z=.05 absRapid to Initial Z=1 abs

N4Y2 Rapid to X=1 abs, Y=2 absRapid to Z = .05 absDrill to Z=-.5 absRetract to Z=.05 absRapid to Z=1 abs

Page 45: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 127

N5G91X2.5Y.5 Rapid to X=3.5 abs, Y=2.5 absRapid to Z=.05 absDrill to Z=-.5 absRetract to Z=.05 absRapid to Initial Z=1 abs

N6G90X0Y0 Rapid to X=0 abs, Y=0 absRapid to Z=.05 absDrill to Z=-.5 absRetract to Z=.05 absRapid to Initial Z=1 abs

N7G80 Cancel Drill CycleNo machine movement

N8 Continue with program

When you need to perform more then one drill cycle operation on the sameset of holes, you can use a subroutine to define the holes. Then you call thesubroutine after setting the drill cycle parameters, as shown below.

N101 G90 G0 T0 X-5 Y1 Z1N102 T1 E20( SPOT DRILLN103 G81 C.05 T0 D-.05N104 P0101N105 G0 G80 G90 T0 Y1 Z1N106 M00N201 G90 G0 T0 Y1 Z1N202 T2 E16( PECK DRILLN203 G73 C.1 T0 D-1.1 I.25 P.025N204 P0101N205 G0 G80 G90 T0 Y1 Z1N206 M00N301 G90 G0 T0 Y1 Z1N302 T3 E15( COUNTERSINKN303 G82 C.1 T0 D-.25 B.1N304 P0101N305 G0 G80 G90 T0 X-5 Y1 Z1 M30 P01( HOLESN1 X1 Y0N2 Y2N3 G91 X2.5 Y.5N4 G90 X0 Y0 M12

Page 46: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

128 Servo CNC System User's Guide

G81/G82 Syntax

G81 Drill Cycle feed down, rapid retractRequired variables: C, T, D

G82 Counterbore/spotface Cycle feed down, dwell at bottom, rapid retractRequired variables: C, T, D, B

G83 Syntax

G83 Peck, Clear Chip Cycle feed to peck increment, retract to clear plane,rapid retractRequired variables: C, T, D, IOptional variables: G

NOTE This cycle not only breaks chips as in G73, but also prevents themfrom packing.

Figure 31: G81 and G82drill cycles syntax.

Figure 32: G83 peckdrill cycle syntax.

Page 47: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 129

G73 Syntax

G73 Peck, Break Chip Cycle feed to peck increment, retract peck cleardistance, rapid retractRequired variables: C, T, D, P, IOptional variables: G

NOTE This cycle is used for materials, such as steel, which tend to makestringy chips that may form a "rats nest."

G85/G89 Syntax

G85 Bore Cycle feed down, feed retractRequired variables: C, T, D

G89 Bore/Dwell Cycle feed down, dwell at bottom, feed retractRequired variables: C, T, D, B

Figure 33: G73 peckdrill cycle syntax.

Figure 34: G85 and G89boring cycles syntax.

Page 48: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

130 Servo CNC System User's Guide

G72 Syntax

The G72 cycle has two major features:

It allows you to program drill cycles for two axes (XY) machines.

It allows a combination of variables to be set for a "custom" cycle.

G72 Custom Automatic Cycle allows you to customize use of variablesRequired variables: M=1, C, T, DOptional variables: G, I, P, E ,B, F

G72 Manual Cycle uses manual quillRequired variables: M=0

For manual drilling on machines with a quill, the command

G72 M0X1 Y1

causes the slides move to the XY positions commanded in the followingblocks and then stop at each position to allow the quill to be used to drill thehole. The comment "Perform manual drilling operation, Then press RUN"appears in the Comments on the G-Code view tab (page 24).

Pocket Cycles G101, G102, G103The Pocket canned cycles are used to clear the material out of the inside of arectangle, circle, or polygon shape with the option of cutting a finishing pass.The variable lists and figures define the characteristics of pocket cannedcycles. (See Using Canned Cycles (page 123).)

Figure 35: G72 specialdrill cycle syntax.

Page 49: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 131

A tool defined by a T code with the tool diameter listed in the Tool Table isrequired before programming a pocket. Stepover P is a percent of the tooldiameter. For example, 75% of a .500" diameter endmill is .375". The FinishCut C is optional. When entered, it must be less than the stepover value,otherwise the value defaults to the stepover value. Choose "climb" (Q1) or"conventional" (Q-1) as the Cut Direction Q. Climb cuts counter-clockwise(CCW) around the inside of the pocket, conventional cuts clockwise (CW).

The tool moves from the Calling Point to the Plunge Point and returns to theCalling Point after the Retract Point. With a controlled Z axis (M1), the toolplunge cuts to Depth D. The pocket floor is an absolute value. The two axisXY system (M0) outputs an Axes Stop code (M52) and "Manual operation"comment to allow the operator to do the manual quill movement.

G101 Rectangle Pocket Syntax

The G101 Rectangle Pocket cycle allows you the clean the material out of arectangular pocket located by the X and Y center coordinates. The W and Hvariables or X and Y dimensions must be parallel to the X and Y axes. Whenthe Cut Direction is climb (Q0), the stepover cut P is toward the right wall.When the Cut Direction is conventional (Q-1), the stepover cut is toward theleft wall. The corner radius R must be less than or equal to half the shortestside. When the corner radius is less than the tool radius, the system uses thetool radius for the inside corner radius. The Plunge Point is calculated by thesystem using the XY dimensions, stepover, and finish cut.

N100 G101 X Y W H R P Q C M D

Cut 1 is the initial cut down the center of the pocket from the Plunge Point.The line shows the path of the center of the tool.Cuts 2, 3, and 4 are defined by the Stepover. The box patterns show the pathof the center of the tool.Cut 5 is what's left before the Finish Cut, and is less than or equal to theStepover.Cut F is the Finish Cut.

Figure 36: Rectanglepocket syntax.

Page 50: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

132 Servo CNC System User's Guide

Variables: Rectangle Pocket G101M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

XX center X and Y values must both be absolute or an

increment from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

W Width X dimension for the width

H Height Y dimension for the height

R Corner radius Must be less than or equal to half the shortestside. When the corner radius is less than the toolradius, the tool radius is used for the inside cornerradius.

P Stepoverpercent of tooldiameter

Requires previously defined T code and value forthe diameter in the Tool Table

Q Cut direction Q1 for Climb (ccw around the inside), Q-1 forConventional (cw around the inside)

C Finish cut Optional - When entered, it must be less than thestepover value, otherwise the value defaults to thestepover value.

D Depth Absolute value. For deep pockets, see example(page 155).

Example: G101 Mill Rectangle Pocket

Figure 37: G101 millrectangle pocketexample.

Page 51: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 133

The example shows a rectangle pocket with the Calling Point outside thepocket. The tool travels from the Calling Point to the Plunge Point to start thecycle. At the end, the tool retracts at the midpoint on the right wall andreturns to the Calling Point.

TIP A stepover of 70% or greater will cause ridges to be left in the corners.This is simple trigonometry to prove!

G102 Circle Pocket Syntax

The G102 Circle Pocket cycle allows you to clean the material out of acircular pocket with a radius R located by the X and Y center coordinates. ThePlunge Point is at the circle center. When the Cut Direction is climb (Q0), thestepover cut P is toward zero degrees absolute (3 o'clock). When the CutDirection is conventional (Q-1), the stepover is toward 180 degrees absolute(9 o'clock). When finish cut C is specified, the tool makes a half circle path tolead into and pull out of the finish cut. This minimizes tool marks on thewall.

N100 G102 X Y R P Q C M D

Figure 38: Circle pocketsyntax.

Page 52: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

134 Servo CNC System User's Guide

Variables: Circle Pocket G102M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

XX center X and Y values must both be absolute or an

increment from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

R Radius Radius of circle pocket

P Stepoverpercent of tooldiameter

Requires previously defined T code and value forthe diameter in the Tool Table

Q Cut direction Q1 for Climb (ccw around the inside), Q-1 forConventional (cw around the inside)

C Finish cut Optional - When entered, it must be less than thestepover value, otherwise the value defaults to thestepover value.

D Depth Absolute value. For deep pockets, see example(page 155).

Example: G102 Circle Pocket with lead-in/out

The example shows a circle pocket with lead in and lead out. Note that thecenter is an incremental distance from the Calling Point.

Figure 39: G102 circlepocket example.

Page 53: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 135

G103 Polygon Pocket Canned Cycle

The G103 Polygon Pocket cycle allows you to clean the material out of aregular N sided figure, where N equals 3 to 999, located by the X an Y centercoordinates. The Plunge Point is the center with the stepover cut P in thedirection of the Start Angle (page 92) E. The Start Angle is the first "point" ofthe polygon and always specified in absolute decimal degrees (page 92). Theorientation of the polygon is dependent on the Start Angle. The size isdetermined by the radius R of the circle which is either inside the polygonand tangent to the sides F0, or outside the polygon and touching the points F1as shown in the figure below.

N100 G103 X Y R N F E P Q C M D

Polygon Definition

Figure 40: Defining apolygon.

Page 54: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

136 Servo CNC System User's Guide

Variables: Polygon Pocket G103M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

N Number ofsides

3 to 999

R Radius The circle is either inside the polygon and tangentto the sides (flats), or outside and touching thepoints

F Flats/Points Flats = 0, Points = 1 for defining relationship tocircle

E Start angle The absolute angle of the first point in decimaldegrees

P Stepoverpercent of tooldiameter

Requires previously defined T code and value forthe diameter in the Tool Table

QCut direction Q1 for Climb (ccw around the inside), Q-1 for

Conventional (cw around the inside)

C Finish cut Optional - When entered, it must be less than thestepover value, otherwise the value defaults to thestepover value.

D Depth Absolute value. For deep pockets, see example(page 155).

Page 55: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 137

Example: G103 Polygon Pocket

The example shows a polygon pocket. Note that the stepover is toward thepoint defined by the start angle.

Face Cycle G108The G108 Face canned cycle is used to define a zigzag path that is normallyused to clean off a part surface. The variable list and figure define thecharacteristics of face canned cycle. (See Using Canned Cycles (page 123).)

The X and Y center coordinates locate the center of the part surface to face.The W variable or X Dimension is the distance the center of the tool travelsfrom left to right. The H variable or Y Dimension is the minimum distancethe center of the tool travels forward. The tool radius travels beyond the Xand Y dimensions. The Stepover S is the Y distance cut after the X cut.

NOTE The center of the tool can travel up to the stepover distance beyondthe Y dimension value.

Figure 41: G103 polygonpocket example.

Page 56: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

138 Servo CNC System User's Guide

The tool moves from the Calling Point to the Plunge Point, which is theupper left corner as calculated from the X and Y dimensions and the X and Ycenter. With a controlled Z axis (M1), the tool moves to the XY position atthe current Z height and then plunge cuts to the specified Depth D. The EndPoint is determined by the number of zigzag passes required to cover the Ydimension. At the Retract Point, the tool lifts to the initial Z value and thenreturns to the XY coordinates of the Calling Point. The two axis system (M0)outputs an Axes Stop code (M52) and "Manual operation" comment to allowthe operator to do the manual quill movement.

N100 G108 X Y W H S M D

Variables: Face G108M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

XX center X and Y values must both be absolute or an

increment from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

W Width X dimension is the distance traveled by the toolcenter from left to right zigzag

H Height Y dimension is the forward (-Y) distance traveledby the tool center

S Stepoverdistance

-Y distance cut after the X cut

D Depth Absolute value.

Page 57: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 139

Example: G108 Face unoptimized

Both examples are facing a 1.50" by 2.00" rectangular surface. The exampleabove is using a 1.0" diameter endmill following an inefficient tool path. Thefirst cut "wastes" the tool radius and the last "zag" cut is actually "cutting air"since the previous cut has cleaned up the surface.

The optimized example uses a .75" diameter endmill to follow a tool paththat has been calculated for a minimum number of efficient zigzags, asshown by the difference between the "Part" outline and the "toolpath" outlinein the two examples.

Figure 42: G108 facingexample, unoptimized.

Page 58: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

140 Servo CNC System User's Guide

Example: G108 Face optimized

Both examples are facing a 1.50" by 2.00" rectangular surface. The exampleabove uses a .75" diameter endmill to follow a tool path that has beencalculated for a minimum number of efficient zigzags, as shown by thedifference between the "Part" outline and the "toolpath" outline in the twoexamples.

The unoptimized example is using a 1.0" diameter endmill following aninefficient tool path. The first cut "wastes" the tool radius and the last "zag"cut is actually "cutting air" since the previous cut has cleaned up the surface.

Frame Cycles G111-G116The Frame canned cycles are used to cut the inside or outside outline of arectangle, circle, or polygon shape with the option of cutting one or twopasses, depending on whether a finishing pass is specified. The variable listsand figures define the characteristics of frame canned cycles. (See UsingCanned Cycles (page 123).)

A tool defined by a T code with the tool diameter listed in the Tool Table isrequired before programming a frame. The Finish Cut C is optional. Choose"climb" (Q1) or "conventional" (Q-1) as the Cut Direction Q. Climb isclockwise (CW) on the outside and counter-clockwise (CCW) on the inside;conventional is CCW on the outside and CW on the inside. On rectangle andcircle shapes, the E variable allows the tool to Lead in and Lead out of the cut.This is used to minimize tool marks on the wall of the part. "No lead" can beused for O-ring type grooves.

Figure 43: G108 facingexample, optimized.

Page 59: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 141

The tool moves from the Calling Point to the Plunge Point and returns to theCalling Point after the Retract Point. With a controlled Z axis (M1), the toolplunge cuts to Depth D. The floor of the frame is an absolute value. The twoaxis XY system (M0) outputs an Axes Stop code (M52) and "Manualoperation" comment to allow the operator to do the manual quill movement.

G111, G112 Rectangle Frame Syntax

The G111 Rectangle Frame cycle outlines the inside of the rectangle. TheG112 Rectangle Frame cycle outlines the outside of the rectangle. The centerof the rectangle is located by the X and Y center coordinates. The W and Hvariables or X and Y dimensions must be parallel to the X and Y axes. Thecorner radius R must be less than or equal to half the shortest side. When thecorner radius is less than the tool radius, the system uses the tool radius forthe inside corner radius. The E variable sets Lead In/Out. Without Lead In(E0), the Plunge Point is the center of the bottom wall. With Lead In and Out(E1), the tool cuts at a shallow angle with a length two times the tooldiameter (or less for inside if this gouges the wall). The location of thePlunge Point depends on the cut direction.

N100 G111 X Y W H R E C Q M DN100 G112 X Y W H R E C Q M D

Variables: Rectangle Frame G111, G112M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

W Width X dimension for the width

H Height Y dimension for the height

R Corner radius Must be less than or equal to half the shortestside. When the corner radius is less than the toolradius, the tool radius is used for the inside cornerradius.

E Lead in/out E0 for no lead in/out, E1 for lead in/out

Q Cut direction Q1 for Climb (cw on outside, ccw on inside), Q-1 for Conventional (ccw on outside, cw on inside)

C Finish cut Optional

D Depth Absolute value

Page 60: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

142 Servo CNC System User's Guide

Example: G111 Mill Rectangle Frame, inside

The example shows an inside rectangle frame without lead in and lead out.The corner radius R (.18) is larger than the tool radius (.125) so the programgenerates the corner using a G03 command.

Example: G112 Mill Rectangle Frame, outside

The example shows an outside rectangle frame with lead in and lead out.Since no corner radius is specified, the tool "rolls around" the outside cornersto maintain contact with the workpiece. The radius used is the tool radius.

Figure 44: G111 millinside rectangle frame.

Figure 45: G112 milloutside rectangle frame.

Page 61: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 143

G113, G114 Circle Frame Syntax

The G113 Circle Frame cycle outlines the inside of the circle. The G114Circle Frame cycle outlines the outside of the circle. The center of the circleis located by the X and Y center coordinates with a radius R for size. The Evariable sets Lead In/Out. Without Lead In (E0), the Plunge Point is at zeroor 180 degrees absolute 3 or 9 o'clock on the circle) depending on the cutdirection. On the inside circle with Lead In/Out (E1), the tool arcs in and outfrom the center of the frame. On the outside circle, the Lead In/Out cut is aline tangent to the frame at 0 or 180 degrees absolute, depending on the cutdirection. The inside circle frame is used to mill counterbores.

N100 G113 X Y R E C Q M DN100 G114 X Y R E C Q M D

Variables: Circle Frame G113, G114M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

R Radius Radius of circle frame

E Lead in/out E0 for no lead in/out, E1 for lead in/out

Q Cut direction Q1 for Climb (cw on outside, ccw on inside), Q-1 for Conventional (ccw on outside, cw on inside)

C Finish cut Optional

D Depth Absolute value

Example: G113 Circle Frame, inside

Figure 46: G113 millinside circle frame.

Page 62: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

144 Servo CNC System User's Guide

The example shows a simple counterbore, a single cut on the inside of acircle with lead in and lead out.

Example: G114 Circle Frame, outside

The example shows an outside circle frame with lead in and lead out. Thecenter is an incremental distance from the Calling Point.

G115, G116 Polygon Frame Syntax

The G115 Polygon Frame cycle outlines the inside of the polygon. The G116Polygon Frame cycle outlines the outside of the polygon. The center of thepolygon is located by the X and Y center coordinates. The Plunge Point is atthe Start Angle (page 92) E, which is the first "point" of the polygon andalways specified in absolute decimal degrees (page 92). The orientation ofthe polygon is dependent on the Start Angle. The number of sides N is from 3to 999. The size is determined by the radius R of the circle, which is eitherinside the polygon and tangent to the sides F0, or outside the polygon andtouching the points F1 as shown in the polygon definition (page 135) figure.

N100 G115 X Y N R F E C Q M D

Figure 47: G114 milloutside circle frame.

Page 63: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 145

Variables: Polygon Frame G115, G116M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires D variable

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

N Number ofsides

3 to 999

R Radius The circle is either inside the polygon and tangentto the sides (flats), or outside and touching thepoints

F Flats/Points Flats = 0, Points = 1 for defining relationship tocircle

E Start angle The absolute angle of the first point in decimaldegrees

Q Cut direction Q1 for Climb (cw on outside, ccw on inside), Q-1 for Conventional (ccw on outside, cw on inside)

C Finish cut Optional

D Depth Absolute value

Example: G115 Polygon Frame, inside

The example shows an inside polygon frame with a finish cut. The PlungePoint is defined by the start angle, which also orients the polygon. The centeris defined as an incremental distance from the Calling Point.

Figure 48: G115 millinside polygon frame.

Page 64: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

146 Servo CNC System User's Guide

Example: G116 Polygon Frame, outside

The example shows an outside polygon frame. The plunge point does nottouch the walls so effective lead in/out is automatic.

Drill Pattern Cycles G121, G122, G123The Drill Pattern Canned Cycles are used to drill arrays of holes withouthaving to calculate and program the position of each hole in the array. Thetool moves from the Calling Point to the First Hole of the pattern and returnsto the Calling Point after the Last Hole. The variable lists and figures definethe characteristics of the drill pattern canned cycles. (See Using CannedCycles (page 123).)

NOTE When using drill cycle variables (page 125) (M1 for automatic) withdrill pattern cycles, CTD are required. If any other variable is used, all mustbe listed or you'll get an error: Illegal parameter list.

G121 Drill Bolt Circle Syntax

The G121 Bolt Circle cycle allows you to drill a circular array of holes with aradius R located by the X and Y center coordinates. The tool moves from theCalling Point to the First Hole, which is located by the absolute Start Angle(page 92) A (in decimal degrees (page 92)), and proceeds counter clockwise.The maximum number of holes in the full circle (360°) is 99. To drill theentire bolt circle, the N variable "Total number of holes" equals the H variable"number of holes to drill." A partial bolt circle can be drilled by entering howmany holes you want to drill and what the start angle is.

N100 G121 X Y R A N H M

Figure 49: G116 milloutside polygon frame.

Page 65: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 147

Variables: Drill Bolt Circle G121M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires Drill Cycle variables (page125)

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

R Radius The radius of the bolt circle

A Start angle An absolute value in decimal degrees

N Total number ofholes

Maximum holes allowed = 99

H Number of holesto drill

To drill all holes, H=N. Or enter how manyholes you want to drill and what the start angleis.

Example: G121 Bolt Circle, full

The example shows a full bolt circle for a manual quill. For automaticoperation, M=1. Then add the needed drill cycle variables (page 125).

Figure 50: G121 drill acomplete bolt hole circle.

Page 66: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

148 Servo CNC System User's Guide

Example: G121 Bolt Circle, partial

The example shows a partial bolt circle using automatic cycle (M=1) with therequired drill cycle variables. The holes numbered 1-7 are drilled. This alsoshows the tool starting at a Calling Point outside the pattern with the center atan incremental distance from the Calling Point (note the G91 in block 60).Also notice that the Z feedrate (E) is set in the startup block.

NOTE To skip non-sequential holes within the pattern, you must programtwo (or more) bolt circles. For example, if you want to drill holes 1-4 and 7-10, programN100 G121 X1 Y1 R1 A90 N12 H4 M0N105 G121 X1 Y1 R1 A270 N12 H4 M0

G122 Drill Rectangle Fill Syntax

The G122 Rectangle Fill cycle allows you to drill a rectangular array ofholes. The tool moves from the Calling Point to the First Hole, which is theupper left corner of the pattern located by the X and Y coordinates of the hole.The L and W variables are the distance between hole centers in the X and Ydirections respectively. Variable N is the number of holes in the X axis andvariable O is the number of holes in the Y axis. The maximum number ofholes in each axis is 999. The S variable allows alternate rows to be offset orstaggered either left or right by 1/2 the X distance between the holes (left = -1, none = 0, right = 1). The tool moves in a zigzag path through the rows.

N100 G122 X Y N O L W S M

TIP To drill a single row of holes in the X direction, the number of holes inY equals one (O=1). To drill a single column of holes in the Y direction, thenumber of holes in X equals one (N=1).

Figure 51: G121 drill apartial bolt hole circle.

Page 67: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 149

Variables: Drill Rectangle Fill G122M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires Drill Cycle variables (page125)

X X top left hole X and Y values must both be absolute or anincrement from the calling point

Y Y top left hole X and Y values must both be absolute or anincrement from the calling point

N Number ofholes in X

Maximum holes allowed = 999

O Number ofholes in Y

Maximum holes allowed = 999

L X betweenholes

Distance between hole centers in X

W Y betweenholes

Distance between hole centers in Y

S Stagger rows Allows alternate rows to be offset by 1/2 the Xdistance between holes.-1 = Left, 0 = None, 1 = Right

Example: G122 Rectangle Fill

The example shows drilling a rectangle fill pattern for a manual quill. Forautomatic operation, M=1. Then add the needed drill cycle variables (page125).

Figure 52: G122 drill arectangular array ofholes.

Page 68: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

150 Servo CNC System User's Guide

Example: G122 Stagger Rectangle Fill

This example shows stagger right.

This example shows stagger left.

G123 Drill Rectangle Frame Syntax

The G123 Rectangle Frame cycle allows you to drill a rectangular frame ofholes. The tool moves from the Calling Point to the First Hole, which is inthe lower left corner of the pattern located by the X and Y coordinates of thehole. The tool moves clockwise around the frame. The W and H variables arethe width (X dimension) and height (Y dimension) of the frame, from thecenter of the first hole to the center of the last hole on the axis. The maximumnumber of holes in each axis is 999. The X and Y dimensions are parallel totheir respective axes. N is the number of holes along X and O is the numberof holes along Y. The system then computes the distance between holes: theX dimension and Y dimension are divided by the number of holes minus 1.

N100 G123 X Y N O W H M

Figure 53: G122rectangular drill patternwith stagger right.

Figure 54: G122rectangular hole patternwith stagger left.

Page 69: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 151

Variables: Drill Rectangle Frame G123M Manual=0

Auto=1When = 0, manual quill operationWhen = 1, requires Drill Cycle variables (page125)

X X center X and Y values must both be absolute or anincrement from the calling point

Y Y center X and Y values must both be absolute or anincrement from the calling point

N Number ofholes in X

Maximum holes allowed = 999

O Number ofholes in Y

Maximum holes allowed = 999

W Width X dimension from center of first hole to center oflast hole

H Height Y dimension from center of first hole to center oflast hole

Example: G123 Drill Rectangle Frame

The example shows a rectangle frame drill pattern for a manual quill. Forautomatic operation, M=1. Then add the needed drill cycle variables (page125).

Figure 55: G123 drillrectangular framepattern.

Page 70: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

152 Servo CNC System User's Guide

Machine Functions (M Codes)The machine function or miscellaneous code consists of the letter M followedby one, two, or three digits. The leading zero is not required. More than onemachine function can be programmed in one block of information as long asthey do not cancel each other (such as M3 and M5 programmed in the sameblock). An M command takes effect at either the beginning or end of theblock execution.

The Reference section has a comprehensive M Code Table.

M00 Program Stop (Stop Motion & Hold Position)A program stop is used whenever the programmer requires the program cycleto stop and allow the operator to perform a manual function such as toolchange, inspection, fixture adjustment, etc. Adequate operator instructionsshould accompany the program. The HOLD status light turns ON and theActivity Status shows PAUSED. Continue the cycle by pressing the RUN,the F7 or F8 key. In Teach mode, the M00 code is stored for a HOLDprogram step. M00 cancels M03/M04 (spindle off) and M07.

M02 Return to Start of Program and Continue RunningThe M02 code is used to allow the program to run in a continuous loopinstead of stopping at the end of the program. Press and release HOLD orSTOP to interrupt continuous motion. Use with caution. M02 cancelsM03/M04 and M07.

WARNING Operator safety must be evaluated when continuous motionis programmed. Safe operating conditions should be verified beforeproceeding.

Page 71: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 153

M03, M04, M05 Spindle On Forward, On Reverse, OffThe M03 and M04 codes are used to turn the spindle on forward or reversewhen the machine has the spindle control feature installed. In backgear, M03and M04 are reversed. See additional information on the S code (page 156).

With the spindle control feature, the M05 code is used to turn the spindle off.

NOTE These codes do not work on all systems because they requirehardware that may not be installed on your system. See your machine manualfor hardware options installed.

M07, M09 Coolant On, Coolant OffWith coolant control, the M07 code is used to turn the coolant on.

With the coolant control, the M09 code is used to turn the coolant off.

NOTE These codes do not work on all systems because they requirehardware that may not be installed on your system. See your machine manualfor hardware options installed.

M12 End of Subroutine (P Cycle) DefinitionA subroutine or P cycle ends with an M12 code. The M12 must be the lastentry on the last line of the subroutine. As a convenience, it is often the onlyinformation on the last line of the subroutine. M12 is ignored when enteredon the MDI line.

M25 Retract Z AxisThe M25 command causes the Z axis (quill or head) to move at rapid to theupper axis travel limit or the knee to move at rapid to the lower axis travellimit. On the quill, the upper axis travel limit should be set at the correctposition to engage the manual or power draw bar for a physical tool change.The M25 code should be in a block by itself.

M30 Return to Start of Program and StopThe M30 code signals the end of the main program. The memory is reset tothe start of the program. M30 cancels M03, M04, M07, G00, G02, G03, G18,G19, G21, G22, G41, G42 and G91.

Page 72: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

154 Servo CNC System User's Guide

M50 Stop (Motors Released)In Teach mode, the M50 code is stored for a STOP program step. It can beused if the motors need to be released for manual operation of a servocontrolled axis.

M52 Axis StopThe M52 code is an M00 without turning off any I/O function such as thespindle or coolant. This is used by the manual drill cycle and the cannedcycles to allow for lowering and raising the quill for plunge cutting.

NOTE The Low-Level Input/Output Interface option commands arediscussed in the Servo II User's Guide Appendix - Low-level I/O Interface.They allow you to customize your Servo II System.

Subroutines (P Cycle)Programmable cycles or subroutines are identified by a P word and end witha M12 code. The identifier is a P followed by two digits from 00 to 99. Thesubroutine is called from the main program. The calling block contains theidentifier and the number of times the cycle will be repeated (for example,P0202). A cycle can be repeated up to 32000 times. All subroutines followthe M30 block of the main program. Subroutines cannot be embedded in themain program.

In Teach or Pendant modes, when a program is transferred from the pendantto the PC, the main program starts with a P code indicating the programlocation in which it was stored. Since one program location is needed for themain program, only three subroutines are allowed. Also, subroutines for thependant must be in G91 incremental mode (page 91).

NOTE It is good practice to put calls to P cycles on a line without axismoves. This is because of how the search function (page 47) steps intosubroutines.

TIP Subroutines make it possible to use a single command to do an entiremachining sequence. By using P cycles, the program is easier to write, takesless time to enter, and requires less memory. Also, if you find that adimension is wrong, it is easier to change only the P cycle program sequencethan to change a dimension that occurs throughout the program.

Page 73: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 155

Example: Deep pockets or framesFor a deep pocket or frame that requires more that one depth cut, you can usea subroutine and G94.

N010 G90 G0 X0 Y2 Z5 T4 E2.5 F5N015 X0 Y0 Z.05N020 P0101 (-.5 DEEPN025 G94 Z-.3 P0101 (-.8 DEEPN030 G94 Z-.6 P0101 (-1.1 DEEPN035 G94 Z0N040 G90 G0 X0 Y0 Z5N045 M30

P01N100 G102 M1 D-.5 C.02 P80 X0 Y0 R.5 Q1M12

Example: Subroutine for custom peck drilling

N1 P01 (SR identifierN2 G0 G91 Z-.05 (Inc moveN3 G1 E5 Z-.51 (Feed down @ 5 ipmN4 G0 Z.05 (Rapid up .05"N5 G1 E3 Z-.4 (Feed down @ 3 ipmN6 G4 F.5 (Dwell 1/2 secondN7 G0 Z.05 (Rapid up .05"N8 G1 E1 Z-.3 (Feed down @ 1 ipmN9 G4 F1 (Dwell 1 secondN10 G0 Z1.15 (Retract to startM12 (End SR

The first block indicates that the operations for subroutine number 02 are inthe following blocks. The second block moves the tool down an increment of.05" at rapid, essentially to the top of the hole. Block N3 feeds the tool anincrement of .5" at 5 ipm. N4 raises the tool .05" to break the chip. N5-N9peck drill at decreasing depth, decreasing feed rate and a dwell. N10positions the Z axis back to the starting level at rapid. The last block indicatesthe end of the subroutine definition.

Page 74: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

156 Servo CNC System User's Guide

We can now use this subroutine in our main program. The part we aredrilling requires ten drilled holes spaced .1 apart along the X axis, starting atX0 Y0. Subroutine 2 below commands the X axis to move .1 and then causessubroutine 1 to be performed once. In the main program, block N110 drillsthe first hole in the part. Block N115 drills the next 9 holes.

N100 G0 G90 X0 Y0 Z5N105 Z.06N110 P0101N115 P0209M30

P02N20 G0 G91 X.1 P0101M12

NOTE The P cycles are in incremental mode, so that this program can betransferred to the pendant and run.

Spindle Speed Commands (S word)The spindle speed code consists of the letter S with the appropriate rpms forthe motor. The range is from minimum rpm to maximum rpm. Values lowerthan the minimum cause the spindle to turn at minimum. Values greater thanmaximum cause the spindle to turn at maximum.

If your machine has backgear, M3 and M4 are reversed and the S value isapproximately 10 times the desired spindle speed, for example, 200 rpm isprogrammed S2000.

NOTE The S code does not work on all systems because they requirehardware that may not be installed on your system. See your machine manualfor hardware options installed.

Page 75: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 157

Tool Select Commands (T word)The tool select code consists of the letter T with a number ranging from 0 to99. It is valid in CNC mode only. The T code causes the values stored in theTool Table to be used by the program. The value stored for the diameter iscalled into effect by programming a G41 or G42 cutter diametercompensation code or the pocket and frame canned cycles. The XYZCoffsets are put in effect in the motion command immediately following thecommand containing the T code call. The default tool is T0 (zero) which hasdiameter and X, Y, Z, and C offsets set to zero. T0 cannot be deleted orchanged.

XYZC offsets are used to align the actual work surface with the programmedwork surface. The XYC offsets are also known as work or fixture offsets. TheZ offset is also known as the tool length offset. The offset value stored in theTool Table is the signed distance from the programmed position to the actualposition.

The block containing the T code should not contain XYZC moves. More thanone T code can apply to the same physical tool; if a tool is used in severaldifferent tool paths requiring different offset values, a different T code isused for each appropriate tool path.

TIP It is a good practice to cancel a T code with T0 (zero) before calling anew T code and to have a T0 at the end of a program.

TIP For safety when using tool length offsets, it is a good practice to checkthe Z axis moves at reduced feed before programming rapid moves. Or runthe program at a known height above the part to make sure machinecomponents, tools, fixtures, and clamps do not collide.

Example: Tool length offset

Figure 56: Setting toolsto use tool length offsetvalues in the Tool Table.

Page 76: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

158 Servo CNC System User's Guide

The program below shows you what you see in the Z axis position registerand when the Z axis actually moves. (In a "real" program, the tool changepositions would allow clearance for physically changing the tool, that is,moving the XY axes so that the part is not under the spindle and the Z axis isat the top of the slide.)

Tool Dia X Ax Y Ax Z Ax C Ax

01234

0"0"0"0"0"

0"0"0"0"0"

0"0"0"0"0"

0"0"-.45"-.75"0"

00000

The values above are from the Tool Table. The program below also showsthe Z axis position at the end of each program block and the Z axis motionthat occurs with each block.

Program Z Position Z Motion

N05G90X0Y0Z0T0N10 G1 E10N15 T1N20 Z-.1N25 T0N30 Z0

0.00.00.0-0.100-0.1000.0

no movementmove down .1no movementmove up .1

N35 T2N40 Z0N45 Z-.1N50 Z0N55 T0N60 Z0

0.0-0.450-0.550-0.450-0.4500.0

no movementmove down .45move down .1move up .1no movementmove up .45

N65 T3N70 Z0N75 T0N80 Z0N85 M30

0.0-0.750-0.7500.0

no movementmove down .75no movementmove up .75

Page 77: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 159

Example: Offsets used for multiple part setupIf multiple parts or fixtures are setup on the table, each part or fixture can beassigned a T code. This is used to "move" the program from part to part. Italso allows for variances in alignment, which must otherwise be edited intothe program. The figure shows the part for this example. The Tool Tableentries are listed below.

Values stored in the Tool Table are below. Then comes the program listingwith comments indicating what action is taking place.

Tool Dia X Ax Y Ax Z Ax C Ax

0616263

0"0.25"0.25"0.25"

0"0"1.0"2.0"

0"0"-0.5"-1.0"

0"-0.4"-0.2"0.0"

0000

G90 X3 Y0 Z1.5 F20 T0 (Main program startupT61 (Dia & offset for Part 1P0101 (C'bore Part 1T62 (Dia & offset for Part 2P0101 (C'bore Part 2T63 (Dia & Offset for Part 3P0101 (C'bore Part 3G90 X3 Y0 Z1.5 (Return to start ptM30(P01 (SR/ Move to c'bore pts

Figure 57: Axis offsetsused for multiple partsetup.

Page 78: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

160 Servo CNC System User's Guide

G90 G0 X.3 Y-.3 (Move to hole 1 XYZ.03 (Move to clear planeP0201 (Call c'bore SRG90 G0 X.7 (Move to hole 2P0201 (Call c'bore SRG90 G0 X.5 Y-.7 (Move to hole 3P0201 (Call c'bore SRT0 (Cancel tool offsetG90 G0 Z.1 (Move to safe ZM12(P02 (SR/ C'bore frame cycleG91 G1 E.2 Z-.03G113 M1 D-.1 C X Y R.15 E1 Q1G90 G0 Z.03M12

Program Comments ( and !Comments are used as instructions to the operator and set up person, forexample, "Load .25 dia endmill with 1" flute length" or "Z 0 = top of part".They can also describe the operations that are taking place, such as "Firstroughing cut."

Comments are placed in a program using the open parenthesis ( followed bythe text string. A comment can be on a line by itself or at the end of a datablock. The program ignores everything after the open parenthesis in the line.Comments are shown in the program sequence listing on the G-Code tab asthey appear in the program. When a comment is on a line by itself, the mostrecent three lines of comments are in the Comments section.

The ! comment appears on the fourth line of the Comments section on the G-Code tab and does not scroll off until a new ! comment is found.

Comments are stripped out of the program when the program is transferred tothe pendant from the PC/SOC.

Example: Comments!PART #09876, OP 5

(SET .033 DIA DRILL TO TOP OF PART

G90 G0 X0 Y0 Z0 (ESTABLISH PART ZERO

Page 79: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Chapter 6 Programming 161

Block Delete Code /In CNC mode, the block delete function allows you the option to carry out ablock (line, command) or parts of the block.

Place a slash / at the beginning of the block to have the option to bypass theentire block or place the slash / before the information in the block which youwant to be able to bypass.

If you set Block Delete ON, the system will not act on any informationfollowing a slash.

If you set Block Delete OFF, the system carries out all blocks, regardlessof whether they contain a slash.

Do not block delete an M12 code. The block delete toggle is ALT+F3. InCNC Run and Verify, the block delete toggle is displayed in the CNC Statustab .

TIP This feature could be used, for example, where a trial cut might berequired, such as sizing a cast part where the amount of stock may vary fromone casting to the next. Each block of information within the trial cutsequence would be preceded by a / block delete code. The trial cut could thenbe taken or bypassed at the operator's discretion (after measuring the casting),or as directed by the written instructions from the programmer.

TIP A /M00 code can be used as an optional stop. Remember to turn ONM03 and M07 after an M00.

Page 80: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates
Page 81: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

209

NOTE Also check the Index under "Examples" for sample programs using specific codesor constructs.

In This AppendixProgram Sample 1, Lines & Arcs ......................................210Program Sample 2, Lines & Arcs ......................................211Program Sample 3, Canned Cycles....................................213Program Samples 4, 5 & 6 .................................................214

A P P E N D I X F

Sample Programs

Page 82: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

210 Servo CNC System User's Guide

Program Sample 1, Lines & ArcsThe first figure below shows a part, which we will program for a CW outside contour (aclimb cut). The part would have to be held down somehow, but we will ignore thatproblem for now.

The center of the large arc is chosen as the XY datum, and the top surface is the Z datum.A .125" diameter cutter is used. The second figure shows the path of the cutter as a dottedline. We arbitrarily choose a location outside the contour line (X0, Y-.750) to lower the Zaxis to cutting height. The coordinates are determined using basic geometry andtrigonometry. The following program cuts the contour. The tool path is a dashed line. Thecircle indicates a .125" diameter endmill.

G70 G90 G0 X0 Y-0.75 Z1 F5Z0 M3G1 Z-0.1 E2Y-.5625G2 J0.5625 X0 Y0.5625G1 X0.6507X1.5625 Y0.03608Y-0.3G2 I-0.2625 X1.3 Y-0.5625G1 X0G0 Y-0.75 Z1M30

Page 83: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 211

TIP Instead of computing the path taken by the center of the tool, you can use cutterdiameter compensation (page 115) and program the edge of the part. See explanation andthe example (page 119) that uses the same part geometry shown here.

Program Sample 2, Lines & ArcsThis is an example of a program using mostly incremental programming. The first figureshows a sketch of the part and also illustrates the data blocks for the outside contour. TheXY datum is set at the lower left-hand corner of the part and the Z datum is the top surfaceof the part. A .050" diameter cutter is used, typical for the Impact Mini-Mill.

N010 G70 G90 G0 X-.5 Y1 Z1N020 X-.1 Y.525N030 Z-.1N040 G91 G1 X.4439 F3N050 G2 J-.15 X.1171 Y-.0563N060 G3 I.039 J.0313 X.078N070 G2 I.1171 J-.0937 X.1171 Y.0563N080 G1 X.3064N090 G2 J-.0625 X.0625 Y-.0625N100 G1 Y-.425N110 G2 I-.0625 X-.0625 Y-.0625

Page 84: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

212 Servo CNC System User's Guide

N120 G1 X-.925N130 G2 J.0625 X-.0625 Y.0625N140 G1 Y.425N150 G2 I.0625 X.0625 Y.0625N160 G1 X-.1N170 G0 Z.15N180 G90 X.25 Y.25N190 G91 G1 X-.125 Z-.15N200 G2 I.125N210 G0 X.125 Z.15N220 G0 X.5N230 G1 X-.125 Z-.15N240 G2 I.125N250 G0 X.125 Z.15N260 G90 X-.5 Y1 Z1N270 M30

TIP Note the use of sequence numbers and the fact that they increase by ten. This allowsplenty of room for editing, that is, blocks may be entered anywhere and given a number insequence.

TIP A useful way to check an incremental program is to add all the X coordinates and Ycoordinates of the outside contour. Since the entire periphery is contoured, the algebraicsums of the coordinates should be zero. If you add blocks N040 though N160, you willfind this to be true. Also, the I values and the J values of circles add algebraically to zerofor 360 degrees of arc. Here, the four corners of the part make a complete circle in 90degree increments in blocks N090, N110, N130, and N150.

Page 85: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 213

Program Sample 3, Canned CyclesThis program uses only canned cycles (page 123) - rectangular pockets, inside and outsidecircular frames, and a bolt circle drill pattern - to complete the part. The tools required area 3/16" diameter endmill and a .250" diameter drill. Enter .1875" for Tool 2 in the ToolTable (page 32).

This shows a plan view of the tool path on the Verify screen. The tool path is the trace ofthe center of the tool.

N05 G70 G90 G0 X0 Y0 Z1 T0N10 T2 Z.05N15 G114 M1 D-.2 C.03 X0 Y0 R1.56 E1 Q1N20 G101 M1 D-.2 C.03 X0 Y0 W2.1 H.5 R.15 P50 Q1N25 G101 M1 D-.2 C.03 X0 Y0 W.5 H2.1 R.15 P50 Q1N30 G113 M1 D-.2 C.03 X.6 Y.6 R.2 E1 Q1N35 G113 M1 D-.2 C.03 X-.6 Y.6 R.2 E1 Q1

Page 86: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

214 Servo CNC System User's Guide

N40 G113 M1 D-.2 C.03 X-.6 Y-.6 R.2 E1 Q1N45 G113 M1 D-.2 C.03 X.6 Y-.6 R.2 E1 Q1N50 Z1 M52 T4N55 G121 M1 X0 Y0 R1.35 A11.25 N16 H16 C.05 T0 D-.3N60 G90 G0 X0 Y0 Z1 T0 M30

Program Samples 4, 5 & 6This program is shown using three methods of programming:Sample 4 - CNC canned cycles (page 123)Sample 5 - "Computed" for transfer to the pendantSample 6 - Taught on the pendant and then transferred from the pendant to the PCThe "computed" program was "manually" programmed "the hard way" with computedradius offsets instead of cutter diameter compensation and typed into the editor. CNCcanned cycle codes and cutter comp can not be transferred to the pendant.

Page 87: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 215

A "Program Plan and Outline" is included as a reference. This is also a good method fordocumenting your programs. The Start Point is 1.5" above the center of the part. Toolsrequired are .250 diameter endmill (entered as Tool 4 in the Tool Table for the CNCprogram) and .250 diameter drill.

Page 88: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

216 Servo CNC System User's Guide

Sample 4 CNC Canned Cycles

This program takes advantage of the canned cycles (page 123) that simplify manualprogramming. A single G code block creates many program steps. Note how the Insideand Outside Frame codes were used to clear the material around the boss in Subroutine 1.

Program Plan & OutlineMAIN PROGRAMcut slotsmove to pocket 1 centercall SR 1 - pocketmove to pocket 2 centercall SR 1 - pocketchange tool to drilldrill 2 holes in pocket bossesmove to center of bolt hole circle 1call SR 2 - bolt hole circlemove to center of bolt hole circle 2call SR 2 - bolt hole circlereturn to start of main programSUBROUTINE 1 - POCKETtool at center of boss, Z+1.5rough cut pocket with framefinish pocket wallframe around bossSUBROUTINE 2 - BOLT HOLE CIRCLEtool at center of pat, Z+1.5call bolt circle drill pattern

N002 G70 G90 G0 Z1.5 T0 (CLEAR ABOVE PARTN004 X0 Y0 (START POINT CENTERN006 X3.125 Y-3N008 Z-.2N010 G1 F20 X0 Y0 Z0

Page 89: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 217

N012 X-3.125 Y3 Z-.2N014 G0 Z1.5N016 X-3.125 Y-3N018 Z-.2N020 G1 X0 Y0 Z0N022 X3.125 Y3 Z-.2N024 G0 Z1.5N026 X2 Y0 (MOVE TO POCKET 1N028 P0101N030 G90 G0 Z1.5N032 X-2 Y0 (MOVE TO POCKET 2N034 P0101N036 G90 G0 X0 Y0 Z1.5 M00(CHANGE TO .25 DRILLN038 G90 G0 Z.1N040 G81 C.1 T0 D-1N042 X-2 Y0N044 X2 Y0N046 G80N048 X0 Y1.875 (MOVE TO PAT 1N050 P0201N052 G90 G0 Z1.5N054 X0 Y-1.875 (MOVE TO PAT 2N056 P0201N058 G90 G0 Z1.5N060 X0 Y0 M30((POCKET SUBROUTINE P01N100 G91 X0 Y0 E5 F20 T4N105 G0 Z-1.48N110 G111 X0 Y0 C.12 W1.5 H1.5 R.13 E0 Q1 M1 D-.25N115 G112 X0 Y0 C0 W.25 H.25 R0 E0 Q1 M1 D-.25 M12((BOLT HOLE P02N205 G91 X0 Y0 E2N210 G121 X0 Y0 R.75 A0 N4 H4 M1 C.1 T0 D-1 G90 M12

Sample 5 "COMPUTED" PROGRAM FOR PENDANT TRANSFER

The P cycle label indicates where the program will be stored on the pendant. Note thedifferences between the numbers that were taught (Sample 6 below) and those that were“computed” in this program.

Page 90: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

218 Servo CNC System User's Guide

Program Plan & OutlineMAIN PROGRAMcut slant slotsmove to pocket 1 centercall SR 1 - pocketmove to pocket 2 centercall SR 1 - pocketmove to center of bolt hole circle 1call SR 2 - holesmove to center of bolt hole circle 2call SR 2 - holesreturn to start of main programSUBROUTINE 1 - POCKETtool at center of boss, Z+1.5rough cut pocketfinish around bossfinish pocket wallmove to holecall SR 3 - drillSUBROUTINE 2 - BOLT HOLE CIRCLEtool at center of pat, Z+1.5move to hole 1 - call SR 3move to hole 2 - call SR 3move to hole 3 - call SR 3move to hole 4 - call SR 3SUBROUTINE 3 - DRILLtool at clear Z+.1move to top of partcut .5 deepretract to clear (.1 above part)

N002 G70 G90 G0 Z1.5 (CLEAR ABOVE PARTN004 X0 Y0 (START POINT CENTERN006 X3.125 Y-3N008 Z-.2N010 G1 F20 X0 Y0 Z0N012 X-3.125 Y3 Z-.2N014 G0 Z1.5N016 X-3.125 Y-3N018 Z-.2N020 G1 X0 Y0 Z0N022 X3.125 Y3 Z-.2N024 G0 Z1.5N026 X2 Y0 (MOVE TO POCKET 1N028 P0201N030 G90 G0 Z1.5N032 X-2 Y0 (MOVE TO POCKET 2N034 P0201N036 G90 G0 Z1.5N038 X0 Y1.875 (MOVE TO PAT 1N040 P0301N042 G90 G0 Z1.5

Page 91: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 219

N044 X0 Y-1.875 (MOVE TO PAT 2N046 P0301N048 G90 G0 Z1.5N050 X0 Y0M30((POCKET SUBROUTINEP02N200 G91 G0 X.5 Y.5N202 Z-1.48N205 G1 F5 Z-.27N210 F20 Y-1N215 X-1N220 Y1N225 X1N230 Y.125N235 X.125N240 Y-1.25N245 X-1.25N250 Y1.25N255 X1.25N260 X-.125 Y-.125N265 Y-.125N270 X-.875N275 Y-.75N280 X.75N285 Y.75N290 G0 Z.35N295 X-.375 Y-.375N299 P0101M12(P01 (DRILL SUBROUTINEN105 G91 G0 Z-.1N110 G1 F5 Z-.5N120 G0 Z.6M12(P03 (BOLT HOLE POSITIONS CALL DRILLN305 G91 G0 Y.75N310 Z-1.4N315 P0101N320 G0 X-.75 Y-.75N325 P0101N330 G0 X.75 Y-.75N335 P0101N340 G0 X.75 Y.75N345 P0101N350 G0 Z1.4M12

Page 92: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

220 Servo CNC System User's Guide

Sample 6 "TAUGHT" & TRANSFERRED PROGRAM

Note the differences between the numbers that were “taught” and stored using the pendantand dials, and those that were “computed” in Sample 5 above. The G93 values are basedon the Start Point. When the program is transferred to the pendant for a new setup, youmust reset the Start Point to locate the new zero for the program.

(P04) G70 G01 F47.39 G93 X4.4782 Y-4.7263 Z1.3574N01 X0 Y0 Z0N02 G00 X3.1206 Y-2.9935 Z-1.5004N03 Z-1.6993N04 G01 X3.1206 Y-2.9935 F50N05 X-0.0001 Y0.0001 Z-1.5020 F20.8N06 X-3.1198 Y2.9926 Z-1.7027 F20.6N07 G00 X-3.2456N08 X-3.2375 Y-3.0531N09 G01 X-3.1316 Y-3 F50N10 X0.0003 Y-0.0001 Z-1.5044 F20.8N11 X3.1414 Y2.9956 Z-1.7023 F20.6N12 G00 Z-0.0003N13 X1.9999 Y-0.0001N14 G01 P0201N15 G90 G00 Z0.0002N16 X-1.9996 Y-0.0001N17 G01 P0201N18 G90 G00 Z0.0001N19 X0.0004 Y1.8753N20 G01 P0301N21 G90 G00 Z0.0015N22 X0.0004 Y-1.8748N23 G01 P0301N24 G90 G00 X0.0001 Y-0.0001 Z-0.0001 M30

G70 G01 F47.39 G93 X4.4782 Y-4.7263 Z1.3574N01 X0 Y0 Z0P02 G91N02 G00 X0.5001 Y0.499N03 Z-1.4806N04 G01 Z-0.2761 F4.3N05 Y-0.9992 F19.8N06 X-1.0003N07 X0.0008 Y1.0039N08 X1.0097N09 Y0.1246N10 X0.1253N11 Y-1.248N12 X-1.2538N13 Y1.2495N14 X1.2498

Page 93: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Appendix F Sample Programs 221

N15 X-0.1238 Y-0.1248N16 Y-0.1262N17 X-0.8726N18 Y-0.7646N19 X0.765N20 Y0.7538N21 G00 Z0.3498N22 X-0.3756 Y-0.3767N23 G01 P0101 M12

G70 G01 F47.39 G93 X4.4782 Y-4.7263 Z1.3574N01 X0 Y0 Z0P03 G91N02 G00 Y0.7501N03 Z-1.4009N04 G01 P0101N05 G00 X-0.7498 Y-0.7519N06 G01 P0101N07 G00 X0.7499 Y-0.7487N08 G01 P0101N09 G00 X0.7496 Y0.7476N10 G01 P0101N11 G00 Z1.4001 M12

G70 G01 F47.39 G93 X4.4782 Y-4.7263 Z1.3574N01 X0 Y0 Z0P01 G91N02 G00 Z-0.1009N03 G01 Z-0.4992 F5.4N04 G00 Z0.6013 M12

Page 94: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates
Page 95: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

227

!

! comment code • 24, 160

(

( comment code • 24, 160

/

/ block delete code • 161

2

2-D Coordinate System • 89

3

3-D Coordinate System • 90

A

About Servo CNC • 36About Verify • 36Abs/Inc or F4 • 49, 65absolute • 223Absolute & Incremental • 91absolute G90 • 120accuracy • 223Action Menu - CNC • 13, 45, 46, 66, 67, 72, 74,

76Action Menu - Pendant • 54, 64Action Menu - Verify • 57Additional Help • 3, 73Angles • 92, 113, 135, 144, 146arcs, see circular interpolation • 100arrays • 146, 148, 150ASCII • 223ASCII character format • 87axis • 223Axis Commands (XYZC IJK words) • 89axis stop M52 • 154axis travel limits • 82, 83, 84

B

backlash • 223ball screw • 223

block • 223Block Delete Code / • 48, 57, 161Block Delete or ALT+F3 • 48Block Format - CNC Mode • 88Block Format - Pendant Mode • 88bolt circle drill pattern G121 • 146Bookmark commands • 19, 22Button Bar

turn on/off in CNC • 35Usage warning • 45use in CNC • 45use in Verify • 57

C

C code • 89Calibrating the SELECTOR KNOB • 63, 84calling point • 223calling point in canned cycles • 123canned cycle • 223Canned Cycles • 123, 130, 137, 140, 146, 173,

178, 196, 198, 213, 214, 216Capturing Tool Offsets • 78ccw • 223Center command • 30character format • 87Choosing a Menu Option using the Keyboard • 7Choosing a Menu Option using the Mouse • 7Circle • 100

bolt circle drill pattern G121 • 146CW/CCW circular interpolation • 100frame mill, circle • 143pocket mill, circle • 133

circular interpolation • 224G02/G03 defined • 100plane select G17/18/19 • 105

Clear axis travel limits • 83clear plane • 125Clearing Axis Travel Limits • 63, 83climb cut • 130, 140, 224CNC Button bar • 35, 45CNC mode block • 88CNC Operations • 41CNC Status Bar • 25, 74, 76

Index

Page 96: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

228 Index

CNC Status Tab • 25, 26, 66, 78codes

/ block delete code • 161absolute G90 • 120axis stop M52 • 154block delete • 161C defined • 89circular G02/G03 • 100comment ( ! • 160continuous contouring G99 • 123continuous run M02 • 152coordinate system offset G94 • 122cutter comp G40/G41/G42 • 115drill cycles G72/73, G80's • 124dwell • 104, 125feed rates DEF • 95G code table • 96IJK defined • 89inch G70 • 87, 120incremental G91 • 120in-position detect G98 • 26, 122linear G01 • 97M code table • 82, 205machine functions • 152metric G71 • 87, 120mirror image G21 • 107N sequence number • 88P cycle/subroutine • 154plane select G17/18/19 • 105position preset G92 • 121program stop M00 • 152rapid G00 • 96rectangle fill drill pattern G122 • 148rectangle frame drill pattern G123 • 150reference machine zero G93 • 122rotate G22 • 113S spindle speed • 156scale G21 • 107stop M50 • 154T tool select • 157XYZ defined • 89

Codes valid for Pendant transfer • 52, 68, 69, 88,185

COM ports • 42comment code ( ! • 160compensation • See cutter diameter

compensationConfigure Machine Axes Properties Tab • 43Configure Machine Selection in Verify mode • 3Configure Machine Selection Tab CNC • 42

Configure Menu - CNC • 13, 41, 66Configure Menu - Verify • 55Configure Spindle • 44Connect • 41Contacting Gibbs Technical Support • 3, 190,

191Contacting Servo Products Company • 2continuous contouring G99 • 123continuous run M02 • 152conventional cut • 130, 140, 224coolant off code M09 • 153coolant on code M07 • 153coordinate systems • 89, 90

2-D Coordinate System • 893-D Coordinate System • 90coordinate system offset G94 • 122position preset G92 • 121

counterbore drill cycle • 128counterbore mill • 143Cutter Comp Rules & Guidelines • 115Cutter Comp Tips • 117cutter diameter compensation • 115, 117, 119,

120, 224ending cutter comp examples • 118G41/G42 defined • 115Guidelines for Cutter Comp • 115, 117, 118starting cutter comp examples • 117

cw • 224

D

D code • 94, 95datum • 224default • 224Diagnostics in Pendant Mode • 46, 70dial • See SELECTOR KNOBDim or gray menu commands • 7DIRECTION keys on pendant • 60, 61, 79dpm • 224Dragging Axis Travel Limits • 63, 79, 84Draw Speed command • 30drill arrays • 146Drill Cycle Table • 204Drill Cycles G80's • 124, 204Drill Pattern Cycles G121, G122, G123 • 125,

146DRO View Tab • 32, 74dwell • 104, 125

E

E code • 95, 124

Page 97: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Index 229

Edit Bar • 19, 20, 22Edit Menu • 13, 20, 22, 55Edit View Tab • 19, 23end of program M30 • 153end subroutine M12 • 153Error Messages 1000 Series • 163Error Messages 2000 Series • 167Error Messages 3000 Series • 189Error Messages 4000 Series • 193Example

Absolute & Incremental coordinate positions• 91, 121, 154, 185

Arc using a flat endmill • 106Arcs begin and end on an axis • 101Arcs begin or end at an angle • 102Arcs in the XZ or YZ plane (G18/G19) • 103Arcs using a ball nose endmill • 105Comments • 160Converting linear feed to rotary feed • 94Converting to decimal degrees • 92, 93, 113,

135, 144, 146Deep pockets or frames • 122, 132, 134, 136,

155Drill cycle programs • 125, 126Ending cutter comp • 115, 118, 171, 193,

198, 199G00 Rapid moves • 97G01 one axis cut • 97G01 three axis cut • 99G01 two axis cut • 98G04 Dwell per revolution • 104, 126G101 Mill Rectangle Pocket • 132G102 Circle Pocket with lead-in/out • 134G103 Polygon Pocket • 137G108 Face optimized • 140G108 Face unoptimized • 139G111 Mill Rectangle Frame, inside • 142G112 Mill Rectangle Frame, outside • 142G113 Circle Frame, inside • 143G114 Circle Frame, outside • 144G115 Polygon Frame, inside • 145G116 Polygon Frame, outside • 146G121 Bolt Circle, full • 147G121 Bolt Circle, partial • 148G122 Rectangle Fill • 149G122 Stagger Rectangle Fill • 150G123 Drill Rectangle Frame • 151G21 multiple part fixture • 107, 110G21 right- and left-hand parts • 108G21 scaling • 107, 112

G21 symmetrical about 0,0 • 109G22 toolpath rotation • 113, 122G41 Toolpath • 119, 211G42 • 116, 120Helical interpolation • 104MDI - Cutting using MDI • 53MDI - Moving an axis in rapid • 52MDI - Using G92 for axis position preset •

54, 77, 121Offsets used for multiple part setup • 32, 159Rotary index for drilling holes • 94Rotary table cutting • 95Starting cutter comp • 115, 117, 171, 193,

198, 199Subroutine for custom peck drilling • 155Tool length offset • 32, 77, 157

F

F code • 95Face Cycle G108 • 137facing cycle • 137Feed Rate Commands (DEF words) • 93, 95,

171, 172, 184, 185, 186, 194feedrate • 224Feedrate Override or F6 • 49, 65File & Code Formats • 87file format • 87File Menu and File Bar • 13, 15, 66, 67, 74file transfer • 66, 67Find command • 20, 22Fit command • 30fixed cycles • 124fixture offsets • 32, 122, 157, 159format • 87, 88, 224

ASCII character format • 87CNC mode block • 88Playback mode block • 88word address • 88

Frame Cycles G111-G116 • 140

G

G Code Table • 96, 171, 194, 202G codes • 96G00 Rapid Positioning Moves • 96G01 Linear Interpolation at Feed Rate • 97G02, G03 Circular Interpolation • 100G04 Dwell • 104G101 Rectangle Pocket Syntax • 131G102 Circle Pocket Syntax • 133G103 Polygon Pocket Canned Cycle • 135

Page 98: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

230 Index

G108 Face Syntax • 137G111, G112 Rectangle Frame Syntax • 141G113, G114 Circle Frame Syntax • 143G115, G116 Polygon Frame Syntax • 144G121 Drill Bolt Circle Syntax • 146G122 Drill Rectangle Fill Syntax • 148G123 Drill Rectangle Frame Syntax • 150G17, G18, G19 Modal Plane Select • 105G21 Scaling and Mirror Image • 107, 207G22 Rotate • 113G40, G41, G42 Cutter Diameter Compensation •

32, 115, 193, 197, 198, 199, 211G70, G71 Inch, Metric Programming • 120G72 Syntax • 125, 130G73 Syntax • 129G81/G82 Syntax • 128G83 Syntax • 128G85/G89 Syntax • 129G90, G91 Absolute, Incremental Programming •

68, 120G92 Position Preset • 121G93 Reference to Machine Zero • 122G94 Coordinate System Offset • 122G98 Standard In-Position Detection • 122G99 Continuous Contouring Mode • 123G-Code View Tab • 24, 47, 74, 75, 107, 112, 130Good Practices • 207Graph Menu and Graph Bar • 13, 29, 30, 55, 58,

72Graph View Tab • 29, 58, 72, 74Guidelines for Cutter Comp • 115, 117, 118Guidelines for G21 • 107, 122Guidelines for PC to Pendant Transfer • 68

H

helical interpolation • 224Help Menu • 3, 13, 36, 178Help on Help • 36, 38HELP! • 36, 38

Can't display on-line Help • 36error listings • 163, 167, 189, 193Help Menu • 36reference library • 3Technical Support • 3Write a CNC program • 71

Hold • 51, 65, 75Hot keys • 10, 11, 206How To... • 7, 8, 66, 67, 71, 74, 76, 77, 78, 82,

83Capture tool offsets • 78

Clear axis travel limits • 83Drag axis travel limits • 84Move an axis • 52, 53, 79Run a CNC program • 74Set axis travel limits • 82Set tool length offsets • 77, 157, 159Set zero position • 76Transfer from PC to pendant • 67Transfer from pendant to PC • 66Use the pendant • 61, 64, 79, 81, 82, 84Write a CNC program • 71

hysterical reasons • 224

I

I code • 89Ignore Holds command • 30inch G70 • 87, 120Inch/Metric or ALT+F10 • 51, 57, 65incremental • 225incremental G91 • 120interpolation • 225Introduction • 1ipm • 225

J

J code • 89Jog mode on pendant • 79

K

K code • 89Keyboard, using • 7, 8, 10, 11, 38, 206knob • See SELECTOR KNOB

L

lead in/outcircle frame examples • 143, 144cutter diameter compensation examples •

117, 118mill rectangle frame example • 142

leading zeros • 87limits • 82, 83, 84linear interpolation • 97, 225

M

M Code Table • 205M00 Program Stop (Stop Motion & Hold

Position) • 152M02 Return to Start of Program and Continue

Running • 152

Page 99: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Index 231

M03, M04, M05 Spindle On Forward, OnReverse, Off • 153

M07, M09 Coolant On, Coolant Off • 153M12 End of Subroutine (P Cycle) Definition •

153M25 Retract Z Axis • 153, 178M30 Return to Start of Program and Stop • 153M50 Stop (Motors Released) • 154M52 Axis Stop • 154Machine Functions (M Codes) • 152Machine Selection in CNC and Pendant modes •

42main program • 225main screen, CNC and Verify • 6manual data input • 225Manual mode on pendant • 79manual programming • 225MDI • 225MDI or CTRL+M • 52, 65Menu Bar • 7, 13metric G71 • 87, 120mirror image G21 • 107mmpm • 225modal • 225modal commands defined • 96Motor dump • 70Motor torque • 70Motors Status Tab • 25, 27mouse

Choosing a menu option using the mouse • 7Graph view functions with the mouse • 30

N

N code • 88Navigating the Interface • 6non-modal • 225non-modal commands defined • 96numbers • 87Numerical Values • 87

O

offsets • 157, 159programming offsets • 157Setting Tool Length Offsets • 77, 78

Open and Save As dialog boxes • 15, 16, 17origin • 225

P

P codes • 154P cycle/subroutine • 154

Page Setup dialog box • 16, 18Pan commands • 30part programming function • 71, 87Part Status Tab • 25, 28peck drill • 128, 129Pendant • 61, 64, 79, 81, 82, 83, 84Pendant Functions • 61Pendant Keypad • 60Pendant Keys Used with CNC • 75Pendant M Code Mode Table • 82pendant mode • 88pendant mode block • 88Pendant Operations • 59Pendant or ALT+F2 • 54Plane command • 30plane select G17/18/19 • 105plunge cut • 99Pocket Cycles G101, G102, G103 • 130Polygon

frame mill, polygon • 144pocket mill, polygon • 135

Polygon Definition • 135, 144position preset G92 • 121Positive and Negative Motion Defined • 90potentiometer (pot) • See SELECTOR KNOBprecision • 225Preparatory Functions (G Codes) • 96program • 225Program Comments ( and ! • 76, 160Program Sample 1, Lines & Arcs • 120, 210Program Sample 2, Lines & Arcs • 211Program Sample 3, Canned Cycles • 213Program Samples 4, 5 & 6 • 214program stop M00 • 152Programming • 87Programming the Rotary Table • 93

R

ramp cut • 99rapid code

G00 defined • 96rapid example • 97

Rapid or F5 • 49, 65, 75Rectangle

fill drill pattern • 148frame drill pattern • 150frame mill, rectangle • 141pocket mill, rectangle • 131

reference machine zero (G93) • 122reference machine zero G93 • 122

Page 100: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

232 Index

Reference Tables • 201repeatability • 225resolution • 226restart a CNC program • 75retract Z axis M25 • 153ROM versions • 36rotary feed rate

convert from linear • 94D code • 94, 95

Rotary Table • 93C axis programming • 93D code • 94, 95rotary axis pitch • 43rotary index for drilling • 94rotary thread cutting • 95

rotate G22 • 113Run • 50, 75Running a CNC Program • 74

S

S codes • 156Sample Programs • 209Save As dialog box • 17scale G21 • 107Search or F3 • 47, 57, 58, 76, 154Searching to Restart a CNC Program • 75SELECTOR KNOB • 61, 64, 84SELECTOR KNOB Table • 64sequence number • 226Sequence Number (N word) • 76, 88Servo CNC Interface • 5Setting Axis Travel Limits • 63, 82, 84, 174Setting Tool Length Offsets • 77Setting Zero Position • 50, 74, 76, 78Shortcut keys • 10, 11, 206Single step • 49spindle off code M05 • 153spindle on code M03/M04 • 153spindle speed • 226Spindle Speed Commands (S word) • 153, 156SR • 226start point • 226Starting CNC • 73Status Bar • 13Step • 49, 57, 75, 76Stop • 46, 65, 75STOP key • 61

axis stop M52 • 154M50 equivalent • 154

subroutine • 226

Subroutines (P Cycle) • 154end P cycle code M12 • 153P code use • 154, 155

syntax • 226

T

T code • 157tabs • 19, 24, 26, 27, 28, 29, 32The Coordinate System • 72, 89Title Bar • 7, 11, 66, 67, 74tool length offset • 226tool offsets • 32, 157Tool Select Commands (T word) • 157, 172,

195, 207Tool Table • 32, 41, 55, 74, 77, 78, 178, 198,

213Capturing Tool Offsets • 78Tool Table data entry • 32

tooling • 226Transfer Menu • 65Transferring from PC to Pendant • 66, 67, 69Transferring from Pendant to PC • 66, 67travel limits • 82, 83, 84Typographical Conventions • 1

U

Unconnected in Title bar • 11, 41units • 51, 87, 120Untitled in Title bar • 11Using shortcut keys for menu commands • 10Using shortcut keys in CNC/Verify... • 206Using shortcut keys in dialog boxes • 11Using the Menu Bar • 7Using the Pendant in M Code Mode • 63, 75, 81Using the Pendant to Move an Axis • 63, 79Using the Toolbars • 8Using Verify • 55

V

VariablesCircle Frame G113, G114 • 143Circle Pocket G102 • 134Drill Bolt Circle G121 • 147Drill Cycle • 125, 146, 147, 149, 151, 204Drill Rectangle Fill G122 • 149Drill Rectangle Frame G123 • 151Face G108 • 138Polygon Frame G115, G116 • 145Polygon Pocket G103 • 136Rectangle Frame G111, G112 • 141

Page 101: Servo CNC System - Autodesk...88 Servo CNC System User's Guide Block Format - CNC Mode The program codes are in word address format, meaning that the letter in front of a number indicates

Index 233

Rectangle Pocket G101 • 132Verify Operations • 55Verify or F8 • 57, 58View Menu • 8, 13, 35, 45, 47, 50, 51, 206

W

word address format • 88, 226Writing a CNC Program • 71, 87

X

XY feed rates • 95XY offsets • 78, 157, 159XYZ codes • 89

Z

Z axis • 89, 153clear plane • 125fixed cycles • 124knee and quill • 89retract Z axis M25 • 153

Z axis feed rate • 95, 124zero point • 226Zero Position or F9 • 50, 65, 75, 76zero reset • 50, 76

ALT+XYZC • 76on CNC Action menu • 50using G92 • 54, 121

Zoom commands • 30