C A M S PART PROGRAMMER'S REFERENCE MANUAL Version 3 Modification 04 Copyright (C) 1990 by Computer Geometry Co. February 1, 1990 Computer Geometry Co. 26624 Whispering Leaves Newhall, CA 91321 (805) 252-4938 February 1, 1990 CAMS Part Programmer's Reference Manual CAMS comes with no warranties, expressed or implied, of any kind; it is available as-is. Computer Geometry Company would like to be informed of any problems that users of the program encounter, but makes no promise or guarantee that such problems will be fixed. In no event will Computer Geometry Company be liable for any damages, including any lost profits, lost savings, failure to perform, or other incidental or consequential damages arising out of the use, or inability to use, the program, even if Computer Geometry has been advised of the possibility of such damages, or for any claim by any other party. Page 2 Disclaimer February 1, 1990 CAMS Part Programmer's Reference Manual ------------------------------------------------- C A M S D I S T R I B U T I O N N O T I C E ------------------------------------------------- Computer Geometry Company is distributing CAMS via the "SHAREWARE" concept. If, after a reasonable trial period, you decide to use the product, we will TRUST you to send the requested $95.00 payment. You may obtain a copy of the latest CAMS evaluation system by sending $10.00 to Computer Geometry Company to cover the cost of diskettes, mailer, and postage. Computer Geometry Co. will send you the latest version of CAMS immediately by first class mail. You may also receive a copy of CAMS by sending $95.00. This will make you a "registered" owner. All registered owners of CAMS will receive a loose leaf copy of the Part Programmer's Manual that contains all of the information in this disk version of the manual, including the diagrams and illustrations that could not be included on the distribution diskette. In addition, registered owners receive notification of new program updates, releases, and additions, including the availability of new postprocessors. They also receive priority consideration when requesting postprocessors for machine tools not already covered by Computer Geometry products. If, after all this, you still decide not to send the payment, you are still encouraged to copy and distribute CAMS to your associates with the following restrictions: 1. CAMS is distributed as a complete set. Do not alter, or delete any program files from the distribution copies. 2. No charge is to be made for copying or distributing CAMS, other than a reasonable copying fee not to exceed $10.00. 3. Commercial sale of CAMS in any manner is prohibited without Computer Geometry Company's written permission. 4. The printed manual may not be copied or reproduced in any way. Computer Geometry Co. - 26624 Whispering Leaves - Newhall, CA 91321 (805) 252-4938 Page 3 Distribution Notice February 1, 1990 CAMS Part Programmer's Reference Manual TABLE OF CONTENTS DISTRIBUTION NOTICE 1. INTRODUCTION 1.1 CAMS System Description 1.1.1 The History Of CAMS 1.2 How To Read This Manual 1.3 The Distribution Disk 1.4 Execution 1.4.1 CAMS1.EXE 1.4.2 CAMS2.EXE 1.4.3 The XCAMS.BAT Procedure 2. LANGUAGE AND SYNTAX 2.1 Syntactic Elements 2.1.1 Major Words 2.1.2 Punctuation 2.1.3 Minor Words 2.1.4 Numbers 2.1.5 Symbols 2.2 Statement Limitations 2.3 Part Program Termination (FIN) 3. COMPUTING 3.1 Arithmetic Operators 3.2 Scalar Functions 3.2.1 Trigonometric Functions 3.2.2 Arithmetic Functions 3.2.3 The Obtain Statement (OBT/) 3.3 Arithmetic Expressions 3.4 Arithmetic Statements 4. GEOMETRY DEFINITION STATEMENTS 4.1 Canonical Form 4.1.1 Printing Canonical Forms 4.1.2 Canonical Replacement 4.2 Point Definition Patterns 4.2.1 A Point Defined By Rectangular Coordinates 4.2.2 A Point At The Intersection Of Two Lines 4.2.3 A Point Defined By Its Polar Coordinates 4.2.4 A Point On A Circle At A Given Angle To The X Axis 4.2.5 A Point On The Intersect Of A Circle And A Line 4.2.6 A Point At The Intersect Of Two Circles 4.2.7 A Point At The Center Of A Defined Circle 4.2.8 A Point At The Intersection Of Three Defined Planes 4.2.9 A Point At The Nth Intersection Of Line And Spline 4.2.10 A Point At The Nth Intersection Of Circle And Spline 4.3 Vector Definition Patterns 4.3.1 A Vector Defined By Its Components 4.3.2 A Vector Defined Between Two Points 4.3.3 A Vector The Cross Product Of Two Vectors 4.3.4 A Vector Defined As The Sum Of Two Vectors 4.3.5 A Vector Defined As The Difference Of Two Vectors Page 4 Table Of Contents February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.6 A Vector As The Scalar Product Of Another Vector 4.3.7 A Unit Vector With The Direction Of A Given Vector 4.3.8 A Vector Perpendicular To A Given Plane 4.3.9 A Vector Parallel To The Intersection Of Two Planes 4.4 Line Definition Patterns 4.4.1 A line Defined By Coordinate Values Of Two Points 4.4.2 A Line Defined Between Two Points 4.4.3 A Line Thru A Point Perpendicular To Another Line 4.4.4 A Line Thru A Point Parallel To Another Line 4.4.5 A Line Thru A Point At An Angle To The X Axis 4.4.6 A Line Thru A Point At An Angle To Another Line 4.4.7 A Line Parallel To Another Line At A Given Offset 4.4.8 A Line Thru A Point Tangent To A Given Circle 4.4.9 A Line Tangent To Two Defined Circles 4.4.10 A Line Through A Point Perpendicular To A Circle 4.4.11 A Line Through A Point Parallel To A Circle 4.4.11 A Line Through A Point Perpendicular To A Spline 4.4.13 A Line Through A Point Parallel To A Spline 4.5 Plane Definition Patterns 4.5.1 A Plane Defined By Three Points 4.5.2 A Plane Thru A Point Parallel To A Given Plane 4.5.3 A Plane Parallel To Another Plane At A Given Offset 4.5.4 A Plane Thru A Point Perpendicular To A Vector 4.5.5 A Plane Thru A Point Perpendicular To The Intersec- tion Of Two Planes 4.6 Circle Definition Patterns 4.6.1 A Circle Defined By The Coordinates Of Center And Its Radius 4.6.2 A Circle Defined By A Point At Center And Its Radius 4.6.3 A Circle Defined By Two Points 4.6.4 A Circle Defined By A Point At Center Tangent To A Defined Line 4.6.5 A Circle Defined By A Point At Center Tangent To A Defined Circle 4.6.6 A Circle Defined Thru A Point Tangent To A Defined Line 4.6.7 A Circle Tangent To Two Intersecting Lines 4.6.8 A Circle Tangent To A Line And A Circle 4.6.9 A Circle Tangent To Two Circles 4.7 Cylinder Definition Patterns 4.7.1 A Cylinder Defined By Its Canonical Form 4.7.2 A Cylinder Defined By Three Points And A Vector 4.8 Transformation Matrix Patterns 4.8.1 Matrix Archtypes 4.8.2 Examples 4.9 Spline Definition Patterns 4.9.1 A Spline Defined Thru Up To 25 Points 4.9.2 A Spline Defined Thru Up To 25 Points With End Control 4.9.3 A Spline Defined By An Offset To An Existing Spline 4.10 Point Pattern Definitions 4.10.1 A Linear Pattern Defined By A Point, An Angle, The Distance Between Points, And A Point Count 4.10.2 A Circular Pattern Defined By A Circle, A Starting Angle, An Angular Increment, And A Point Count 4.10.3 A Pattern Defined By A Random Set Of Points And Patterns Page 5 Table Of Contents February 1, 1990 CAMS Part Programmer's Reference Manual 5. POINT-TO-POINT PROGRAMMING 5.1 The Control Point 5.2 The Motion Initialization Statement (FROM/) 5.3 The Absolute Positioning Statement (GO/) 5.4 The Incremental Move Statement (GDL/) 6. CONTOUR PROGRAMMING 6.1 The Part Surface Statement (PS/) 6.2 Contouring Arcs (ARC/) 6.3 The Contour Startup (GO/) 6.4 Tool To Part Relationships (TLF, TON, TRG) 6.5 General Contour Motion (GFW/,GBK/,GLF/,GRT/) 7. TRANSFORMATIONS AND REPETATIVE PROGRAMMING 7.1 The Transform Cut Statement (TRA/) 7.2 The Index Statement (IDX/) 7.3 The Copy Statement (CPY/) 7.4 Reference Systems (REF/) 7.5 File Inclusion (GET/) 8. STANDARD CUTTING SEQUENCES 8.1 Standard cutting Sequences 8.2 Pocketing - The POC/ Statement 8.3 Helical Boring - The HLX/ Statement A. APPENDIX A - VOCABULARY B. APPENDIX B - SAMPLE PROGRAM C. APPENDIX C - GENERAL CONTOURING SAMPLE PROGRAM D. APPENDIX D - POSTPROCESSORS E. APPENDIX E - GLOSSARY Page 6 Table Of Contents February 1, 1990 CAMS Part Programmer's Reference Manual INTRODUCTION 1.1 CAMS SYSTEM DESCRIPTION CAMS is a language and a computer program designed for use in generating machine control data for numerically controlled machine tools. It will accept a sequence of statements in the language (called a "part program") which defines the absolute quantities (dimensions) and shape of a workpiece. It will use this information to calculate a cutter center location path. The cutter center path is then processed by another computer program (called a "postprocessor") into instructions for a specific machine tool which will accurately machine the workpiece. Thus, input to CAMS is a sequence of statements in the CAMS language read by the CAMS computer programs from an appropriate input device (e.g. terminal keyboard, floppy disk, etc.). Output from CAMS is a sequence of calculated cutter center locations written on an appropriate medium (floppy disk, terminal CRT, punched tape, etc.) to be used by the postprocessor to create machine control data, or to be read by a human for verification of the computations. CAMS has been developed to operate on any IBM/PC or PC compatible computing equipment that supports the MS-DOS or PC-DOS operating system. A minimum computer configuration consists of a central processing unit (CPU) containing at least 256K bytes of RAM memory, a keyboard, a CRT display, an 80-column system printer, and at least two floppy disks. While this configuration will work, performance of the CAMS system will be optimized if a hard disk and/or a minimum of 512K RAM-disk is available for the CAMS working file device. Typical output for NC is directly to a NC machine via RS232C interface, or to a paper tape punch. Hence it is necessary to have at least one serial or parallel port with the appropriate device attached. With the computer configuration mentioned above, CAMS will accept part program source input from the keyboard or from stored source in a file on one of the disks. CAMS will produce one or more optional output listings on the system printer, the CRT, or to designated files on floppy disk; and will write a complete CL (cutter location) file to floppy disk for later postprocessing. It is recommended that back-up copies of source files, CL files, and postprocessor output files produced by the system be made to prevent loss of valuable data. 1.1.1 THE HISTORY OF CAMS CAMS is not a new program. It was developed in 1975 for internal use by Computer Geometry Company. Then, as now, Computer Geometry provided NC programming services for small machine shops who either did not have in-house programming capability, or whose programming requirements temporarily Page 7 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual overflowed their capacity. Originally called "MICROAPT" (version 1.00), the program was written in assembly language for use on a Computer Automation, Inc., (CAI) LSI 2-20 minicomputer. The project was completed in 1976. From 1976 to 1982, the program was used to support some 12-15 machine shops for several hundreds of workpieces. A total of 7 postprocessors were written, also in assembler language. By 1982, the CAI equipment was aging, and it was obvious that a replacement for "MICROAPT" was needed. At that time, the program was re-written in FORTRAN for use on computers equipped with the CP/M operating system. The specific computer used at Computer Geometry is a Heathkit H89. It was discovered that, in the intervening time, another company had used and marketed another software package under the name "MICROAPT". Hence, the name was changed to "MINICAM" (version 2.00). The CP/M version had some enhancement over the original CAI version (specifically the GO/ and BMILL/ operations), but ran at about one fourth the speed of the earlier program. During the period between 1982 and 1987, a somewhat smaller group of machine shops were supported, and seven postprocessors were developed. Since 1984, Computer Geometry has become more active in commercial software development for Numerical Control purposes, focusing on IBM PCs and compatibles as the computing vehicle. By 1987, it became necessary to transfer the program into the PC environment. Again, in the intervening time, another company began marketing a program under the name "MINICAM." There was nothing else to do but change the name. Hence, CAMS. At the time of this writing, the PC version of CAMS (3.00) has been used on only a few parts. However, many verification tests have been run, producing program output identical to the CP/M version. At the time of this publication, three machine postprocessors have been converted to PC, and two plotting postprocessors have been prepared. One of these is the VIDEOPP that is included in this distribution. Incidently, all three versions of the program are still actively being used. 1.2 HOW TO READ THIS MANUAL This manual is intended to be used as a reference by NC parts programmers and as a specification of the CAMS language. Certain notational conventions are followed throughout the manual in exhibiting the CAMS statement formats and examples. These are... Page 8 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual <...> The < and > characters are used to enclose the description of a syntactic unit, such as a number, or a specific type of symbol. E.g. means that the symbol for a point is to be used at this place in the statement. [...] Anything enclosed in square brackets is optional to the statement. E.g. in the statement... PNT/=IO,,[,] the statement element... , is an optional parameter in the definition of the point, and may or may not be exercised by the part programmer. A...Z Capitalized elements in a CAMS statement are vocabulary words. They must be included in the statement exactly as written. 1.3 THE DISTRIBUTION DISK The distribution diskettes contain the files necessary to execute the CAMS NC parts programming system. The list of files on the diskettes are... DISKETTE #1: XCAMS.BAT A recommended batch submit file for CAMS. May not be altered for shareware distribution of CAMS. CAMS1.EXE The input translation phase of CAMS CAMS2.EXE The path generation phase of CAMS VIDEOPP.EXE A plotting postprocessor for the PC screen NUPAGE.LST A formfeed file used by XCAMS.BAT ????????.NC Sample CAMS part programs. CAMS.SCR A shareware identification screen. May not be removed for shareware distribution of CAMS. CAMS.TBL The vocabulary table for CAMS. Must be present on the default drive for CAMS to function. CAMSMAN.EXE Executing this program will generate the two Page 9 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual CAMS reference manuals included in this distribution, CAMSMAN.TXT and VIDEOPP.TXT. README.1ST Contains installation recommendations, last minute details, and a description of the terms and conditions under which this shareware distribution is made. It is strongly recommended that working copies of the distribution diskette be made. The original should be placed in archival storage, to be used to replace aging and defective working copies in the future. 1.4 EXECUTION The CAMS NC processor consists of two software modules, called CAMS1.EXE and CAMS2.EXE, and a vocabulary file called CAMS.TBL. At each installation, there is usually at least one more software module, called a machine postprocessor. CAMS uses a single file name for all of it's output files, both permanent and temporary. You establish the described below, and CAMS will automatically use that to define each of its working output files. Each such working file is identified by its file extension. The file extensions reserved for use by CAMS are as follows... .NC NC is always the part program source file. the is used by you to identify all CAMS files relating to a single part program. .PRO PRO is always the PROGRAM FILE (see below). .CAN CAN is always the CANON FILE (see below). .CLF CLF is always the CUTTER LOCATION FILE (see below). .PLT PLT is always the PLOT FILE. .PCH PCH is always the PUNCH (Postprocessor output) FILE. What follows is a brief description of how the CAMS NC part programming system operates... 1.4.1 CAMS1.EXE CAMS1 performs the input translation phase of NC processing. It reads a file of instructions, written in the CAMS NC language, Page 10 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual and converts that into two output files for later processing. The primary output, called the PROGRAM FILE, contains a list of instructions in computer readable form, derived from statements in the CAMS language that refer to machine motion and auxilliary function control. It also reduces all caculations, including geometry definitions, into their respective canonical forms, e.g. points, lines, circles, numbers, etc. These are placed in an output file which has the same as the input file and the file extension ".CAN". CAMS1 processes input statements until it reads a FIN statement, or until an end of file is reached on the source input. CAMS1 can also produce an output listing of the source and calculated canonical data on demand. The listing can be produced on the CRT screen, the system printer, or to a named file. The CAMS1 processor is invoked by using a DOS command line as follows... A>[d:\path\]CAMS1 . The optional control parameters on the command line are defined as follows... [d:\path\] This parameter specifies the DOS disk drive unit and/or path on which the file CAMS1.EXE (the executable processor) is located. If CAMS1.EXE is located on the currently active DOS disk, the parameter is optional. . Informs CAMS1 of the source input file that is to be read. If this option is omitted, then CAMS1 expects to read input data from the console keyboard, typed in one line at a time, after it displays the line number as a prompt. may optionally include a DOS drive\path\ specification, but it must be understood that the CAMS output files will also be sent using that drive\path\. Note that all CAMS1 printed output is always sent to the console. It may be redirected to file or printer using standard DOS redirection techniques. A command line example might be as follows... C>CAMS1 B:PART1053.NC >B:PART1053.PR1 The sample command line executes the CAMS1 processor, residing on disk drive C: (or on a device\path accessible in the Page 11 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual current path), establishes disk drive B: as the CAMS working device, which will also contain the three working files, reads source input from the file PART1053.NC residing on disk drive B:, and writes the listing file PART1053.PR1 to disk drive B:. 1.4.2 CAMS2.EXE CAMS2 is the path generator for the CAMS system. It requires the two files produced by CAMS1 as input, and produces a file of cutter locations and paths, called the CL FILE. As an option, it can produce a listing of cutter locations, on the CRT screen, the system printer, or to a file. The CAMS2 processor is invoked by using a DOS command line as follows... A>[d:\path\]CAMS2 .PRO The optional control parameters on the command line are defined as follows... [d:\path\] This parameter specifies the DOS disk drive unit and/or path on which the file CAMS2.EXE (the executable processor) is located. If CAMS2.EXE is located on the currently active DOS disk, the parameter is optional. .PRO Informs CAMS2 of the program input file that is to be read. may optionally include a DOS drive\path\ specification, but it must be understood that the CAMS2 output files will also be sent using that drive\path\. Note that all CAMS2 printed output is always sent to the console. It may be redirected to file or printer using standard DOS redirection techniques. A command line example might be as follows... C>CAMS2 B:PART1053.PRO >B:PART1053.PR2 The sample command line executes the CAMS2 processor, residing on disk drive C: (or on a device\path\ accessible in the current path), establishes disk drive B: as the CAMS working device, which will also contain the three working files, reads program input from the file PART1053.PRO residing on disk drive B:, and writes the listing file PART1053.PR2 to disk drive B:. NOTE: the input file .PRO must have been produced by the CAMS1 program module. Page 12 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual 1.4.3 THE XCAMS.BAT PROCEDURE To provide a more automatic way to submit CAMS NC part programs for complete processing, a batch procedure, XCAMS.BAT (for eXecute CAMS) has been included in the distribution package. XCAMS provides for full CAMS processing, with optional output listing to screen or file, and for optional plotting and postprocessing. XCAMS also provides fairly sophisticated error checking for improper submittals. Error checking includes 1) verification that the source input file exists in the specified data access path; 2) verification that the plotting and/or machining postprocessors exist in the specified program access path; and 3) verification that the specified processing options are correct. The correct command for the execution of the CAMS system is... C>XCAMS {name} [MLP/ML/MP/LP/M/L/P] [plotter] [machine] where... {name} The source file name (without extension) - required M Machine output --- [machine] name is required L Listing output --- produces {name}.LST P Plotter output --- [plotter] name is required Options omitting the "L" will print to the screen. If an "M" is included in the option specifior, then the machine name is required. Similarly, if a "P" is included in the option specifior, then the plotter name ([plotter]) is required. Note also that the specification of options and parameters is order dependent, which is to say that they must appear on the command line in precisely the order shown above. An example of a correct command line is as follows... C>XCAMS THINGMJ MLP VIDEO BANDIT This example executes the CAMS system, both CAMS1 and CAMS2, using as source the file THINGMJ.NC residing on the currently logged disk (C:) and producing a listing file THINGMJ.LST on C:. It further executes the VIDEOPP plotting postprocessor, and the BANDITPP machine postprocessor. VIDEOPP will produce a plot of the cutter path on the PC console. BANDITPP produces an output file called THINGMJ.PCH on drive C:, which is suitable for transmission to a BANDIT controlled NC machine tool. Page 13 Introduction February 1, 1990 CAMS Part Programmer's Reference Manual LANGUAGE AND SYNTAX 2. LANGUAGE AND SYNTAX Input to CAMS, called a Part Program, is a sequence of ordered statements from an input medium which constitute instructions to the CAMS computing system. Input media include the terminal keyboard, a punched paper tape in ASCII format, a file on floppy disk, etc. CAMS statements are used to... o define a scalar number o define a geometric entity o describe auxilliary machine tool functions o describe a tool motion o describe standard cutting sequences IMPORTANT: all input source programs to CAMS must be in upper case characters. 2.1 SYNTACTIC ELEMENTS Each CAMS statement is made up of one or more of the following syntactic elements... o A keyword describing the major function of the statement (also called a major word). o Punctuation characters. o Vocabulary words (also called minor words). o Numbers. o Symbols 2.1.1 MAJOR WORDS Every CAMS statement must begin with a major word followed by a slash (/), unless the statement consists only of the major word, in which case the slash is not required. The major word describes the major function of the statement to the system. Examples of major words are... #/ Tells CAMS that a scalar value is to be entered or calculated. PNT/ Tells CAMS that a point is to be defined. Page 14 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual GTO/ Tells CAMS that a move from the present position of the cutter to the point specified in the remainder of the statement is to be calcu- lated. 2.1.2 PUNCTUATION Certain characters on the terminal keyboard have been designated as valid punctuation for CAMS statements. Punctuation characters are used to separate other language elements (thus permitting computer recognition of the elements), and to specify certain operations to the CAMS system. A list of valid CAMS punctuation, and its meaning to CAMS follows... / The first slash in every CAMS statement is interpreted as a major word terminator. Every major word must be followed by a slash, unless it is the sole component of the CAMS statement. Subsequent use of the slash within any statement is interpreted as specifying the arithmetic operation of division, e. g. #/A0=1/3 * The asterisk character is used to specify the arithmetic operation of multiplication, e. g. #/A1=A0*7 + The plus character is used to specify 1) the arithmetic operation of addition or 2) the unary operation specifying positive, e. g. #/A2=A0+A1 #/A3=+3 Note: if the unary plus is omitted, it is assumed by CAMS. For example, the second statement listed above would be just as correct if it were written... #/A3=3 - The minus character is used to specify 1) the arithmetic operation of subtraction or 2) the unary operation of negation, e. g. #/A4=A2-A3 #/A5=-5 Page 15 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual Unlike the plus character, the minus character must always be used to specify negative numbers. ^ The carat character (on some keyboards this is an up arrow) is used to specify the arithmetic operation of exponentiation. For example... #/A6=A5^2 tells CAMS that the symbol A6 is to refer to the value represented by symbol A5 raised to the second power (squared). = The equals character is used to 1) assign a symbol, or name, to a geometric entity or 2) to assign a value to a scalar variable symbol. Examples are... PNT/P0=0,0,0 #/A7=7.5 () The left and right parentheses are used to 1) enclose the arguments of an arithmetic function or 2) to establish the precedence of arithmetic operations. Examples are... #/S250=SIN(250) #/A8=(A7+A4-5)/S250 . The period, or decimal point, character is used to specify the location of the decimal point in a number, e. g. #/A9=9.375 : The colon character is used to indicate a comparison operation within the MIN and MAX functions. , The comma character is used to separate elements of a CAMS statement where no other punctuation is appropriate. For example... PNT/P2=A9,A8,-.05 2.1.3 MINOR WORDS CAMS recognizes a set of specific minor vocabulary words which 1) indicate selections and choices to the system and 2) specify the use of certain arithmetic functions. Examples are... Page 16 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual PNT/P2=IO,L1,L2,.05 which specifies a point at the intersection of (IO) lines L1 and L2 with a Z value of .05, or... #/A70=ATN(.707107) which assigns the value arc-tangent (using the minor word ATN) of .707107 to the symbol A70. 2.1.4 NUMBERS All numbers, however specified, are considered to be real, or floating point, quantities by CAMS. The number range used for internal calculation purposes is 10E-38 to 10E37. Numbers may be entered only in their natural form, e. g., the number ten may be entered as... 10 10. 10.0 Numbers used to express angles are always input in decimal degrees. That is, the angle 30 degrees and 25 minutes is entered as 30.4167 when used in a CAMS statement. Angular dimensions are measured from a parallel to the positive X axis of the coordinate system. The angle is positive if it measures a counter-clockwise rotation, and negative if it measures a clockwise rotation. 2.1.5 SYMBOLS A symbol is used to define an entity, either geometric or scalar, in a CAMS statement which is to be referenced in subsequent statements of the part program. For example, the statement.. PNT/P7=COS(30),SIN(30),.5 defines a point whose coordinates are [.86603,.5,.5]. Subsequent part program statements can refer to this point by the symbol P7. The statement... GTO/P7 tells CAMS to move the cutter from wherever it is to the coordinates [.86603,.5,.5]. Symbols in the CAMS language are composed of one capitalized alphabetic character (e.g. A,B,...,Z) followed by a sequence of not more than three (3) numeric characters which express Page 17 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual a number (n) in the range 0 <= n <= 255. This symbol structure imposes an absolute upper bound of 26x256 or 6656 symbols in any part program. Leading zeroes in the symbol number are ignored by CAMS, hence... A3 A03 A003 all refer to the same entity, and are not separate, unique symbols. Since a symbol contains a numeric component, it is sometimes convenient to symbolically define the numeric component rather than explicitly define it. This is particularly true when defining repetative motion sequences and/or families of parts. For this reason, a special set of parentheses, the square brackets ("[" and "]") are used to define a numeric subscript which, coupled with an alphabetic character, can be used to specify a symbol. The following CAMS statement sequences serve to illustrate the use of subscripted symbols and are exactly equivalent: #/ I10= 100 PNT/ P[I10]= 1.25,0.5 LIN/ L[I10]= P[I10],ANG,30 PNT/ P100= 1.25,0.5 LIN/ L100= P100,ANG,30 Care must be exercised to be sure that the symbol used inside the square brackets has been assigned to a numeric value (n) in the range 0 <= n <= 255 prior to its use in as a symbol component. 2.2 STATEMENT LIMITATIONS All statements must be complete in a maximum of 256 meaningful input characters. Meaningful characters are any characters except the space. Any number of spaces may be included to make the CAMS statements more readable. CAMS ignores them. Continuation of a statement to the next line is indicated by entering an ampersand character (&) as the last character of the line. For example... MAT/M1=1,0,0,0,& 0,1,0,0,& 0,0,1,0 is exactly equivalent to the statement... MAT/M1=1,0,0,0,0,1,0,0,0,0,1,0 and accounts for 30 meaningful characters of the 256 Page 18 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual character maximum. Certain statements permit no continuation. A complete list of these statements are.. PNO/ which identifies a part program. PPR/ which permits operator instructions to be included in a part program. REM/ which permits the inclusion of non-executable remarks in the part program. INS/ which permits literal insertion into the punch tape output of a part program. 2.3 PART PROGRAM TERMINATION (FIN) Every part program must be terminated by a FIN statement. The FIN statement has no parameters and is always the last statement in the part program. For example... : PRT/ALL FIN exhibits a proper termination of the part program, after printing all of the canon table entries. Page 19 Language And Syntax February 1, 1990 CAMS Part Programmer's Reference Manual COMPUTING 3. COMPUTING One of the principal benefits of the CAMS language is its capability to perform indicated calculations within any appropriate statement. The computing feature permits a given quantity to be expressed as the result of one or more arithmetic operations. At any point in a CAMS statement where a number is required, an arithmetic expression may be substituted. For example, the statement... #/B3=7.+3*SQR(2) specifies that B3 is to be assigned the value 11.2426, which is the result of multiplying the square root of 2 by 3, then adding 7. Any combination of scalars, arithmetic operators, arithmetic expressions enclosed in parentheses, and scalar valued functions, so long as syntactically correct, may be used in an arithmetic expression. 3.1 ARITHMETIC OPERATORS The CAMS arithmetic operators are... + arithmetic addition or unary positive - arithmetic subtraction or unary negative * arithmetic multiplication / arithmetic division ^ arithmetic exponentiation 3.2 SCALAR VALUED FUNCTIONS CAMS provides the following set of scalar valued functions... 3.2.1 TRIGONOMETRIC FUNCTIONS Sine SIN(arg) arg = any arithmetic expression specifying an angle in decimal degrees. Cosine COS(arg) arg = any arithmetic expression specifying an angle in decimal degrees. Arctangent ATN(arg) arg = any arithmetic expression specifying the tangent of the Page 20 Computing February 1, 1990 CAMS Part Programmer's Reference Manual angle. 3.2.2 ARITHMETIC FUNCTIONS Absolute ABS(arg) arg = any arithmetic expression; Value returns the absolute value of "arg". Exponential EXP(arg) arg = any arithmetic expression; returns e (2.71828...) raised to the "arg" power. Base 10 LGD(arg) arg = any arithmetic expression; Logarithm returns the logarithm of "arg" to the base 10. Base e LOG(arg) arg = any arithmetic expression; Logarithm returns the natural logarithm of "arg". Square Root SQR(arg) arg = any arithmetic expression; returns the square root of "arg". Integer INT(arg) arg = any arithmetic expression; returns the integer part of the number "arg" as a floating point integer. Modulus MOD(a,m) a,m = any arithmetic expression representing floating point integers; returns a modulo m. Sign SGN(a,s) a,s = any arithmetic expression; returns sign of s times a. Minimum MIN(a:b) a,b = any arithmetic expression; Value returns the minimum value of a and b. Maximum MAX(a:b) a,b = any arithmetic expression; Value returns the maximum value of a and b. 3.2.3 THE OBTAIN STATEMENT (OBT/) Many geometric definitions produce, as part of their canonical forms, numeric values that are usable in other computations. CAMS provides the obtain statement to permit you to extract a number from the canonical form of any definable element and assign it to a symbol. The obtain statement format is as follows... Page 21 Computing February 1, 1990 CAMS Part Programmer's Reference Manual OBT/=, Where the is the symbolic name of the element you wish to retrieve from canon, and is the position of the desired number in the canonical form. For example, the statement... PNT/P1=IO,L5,L7 OBT/Y1=P1,2 will retrieve the second value in the canonical form for the point P1 and assign it to the symbolic name Y1. Y1 may then be used anywhere that a scalar value is acceptable. 3.3 ARITHMETIC EXPRESSIONS Symbols representing scalars, numbers, arithmetic operators, and scalar valued functions with their arguments may be combined to form an arithmetic expression in the CAMS language. Examples of well-formed expressions include... 3*S1-C2 7*SQR(2.4)/(A3^3) In the CAMS language, an arithmetic expression may be used at any point in a statement which requires entry of a scalar value. To avoid ambiguity, arithmetic operators and scalar functions are assigned priorities which establish the sequence of operations used to evaluate an arithmetic expression. These priorities are... 5 (highest) scalar function 4 unary + or - 3 exponentiation (^) 2 multiplication (*) and division (/) 1 addition (+) and subtraction (-) Parentheses are used to alter the priority of operations. For example, the result of... 10*2+3 is 23, whereas the result of... 10*(2+3) is 50. Page 22 Computing February 1, 1990 CAMS Part Programmer's Reference Manual 3.4 ARITHMETIC STATEMENTS Any valid symbol may be assigned to a scalar value by means of an arithmetic statement. An arithmetic statement consists of the major word #/; followed by a symbol; followed by the punctuation =; then followed by an arithmetic expression. Examples of well formed arithmetic statements are... #/A10=10 #/B255=2*SQR(2) The value of a symbol may be changed at will within the part program. For example... #/A10=10 #/A10=A10^2 represents a perfectly valid way to assign the value 100 to the symbol A10. Page 23 Computing February 1, 1990 CAMS Part Programmer's Reference Manual GEOMETRY DEFINITION STATEMENTS 4. GEOMETRY DEFINITION STATEMENTS The CAMS part programming system is designed to permit the definition of a variety of geometric entities, each in a variety of ways. The CAMS geometric entity classes are... PNT/ POINT VEC/ VECTOR LIN/ LINE PLN/ PLANE CIR/ CIRCLE CYL/ CYLINDER MAT/ TRANSFORMATION MATRIX SPL/ SPLINE (FREE-FORM CURVE) The format for a geometry defining statement is... /=[method of definition] Some of the methods of definition require minor vocabulary words when there needs to be a selection of more than one possible geometric entity for the input data. An example of this might be... LIN/L1=P1,LFT,C1 which uses the minor word "LFT" (LeFT) to permit CAMS to distinquish between the two possible resulting lines. LFT indicates that, looking from the point towards the circle, the leftmost of the two possible lines is the chosen line. 4.1 CANONICAL FORM There are a great many ways to define a point, or a line, or a circle, etc., which depend upon the known information about the specific geometry entity in question. To use all of these methods to store the information about a geometry entity would require prohibitive amounts of computer memory for both data and software. Therefore, for each geometry subtype, there is exactly one stored form which is used by CAMS for subsequent references. This stored format is called the canonical form. The canonical form for the geometric entities listed above are as follows... POINT (VECTOR) X, Y, Z The X, Y, and Z coordinates (components) of the point (vector). LINE (PLANE) A, B, C, D The direction cosines of a unit vector perpendi- Page 24 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual cular to the line (plane) [A, B, C] and the directed distance from the coordinate origin to the line (plane), [D]. This is also known as the "plane equation". CIRCLE (CYLINDER) X, Y Z, The coordinates of a I, J, K, point [X, Y, Z] on the R axis of the circle (cy- linder), the components of a unit vector along the axis of the circle (cylinder), and the radius of the circle (cylinder). TRANSFORMATION A1,B1,C1,D1 The twelve values of a MATRIX A2,B2,C2,D2 3x4 matrix that A3,B3,C3,D3 represents a combined rotation and translation in three-dimensional space. SPLINE CURVE X1,Y1,A1,B1,S1 For each defined point : : on the curve, the point Xn,Yn,An,Bn,Sn (Xn,Yn), the forward tangent vector (An,Bn), and the length of the chord between the point and its successor (Sn) is stored. SPLINE OFFSET NAME,offset The name and index of the parent spline and the signed offset value, positive for LFT, negative for RGT. 4.1.1 PRINTING CANONICAL FORMS (PRT/) Any or all of the canonical forms for the defined geometry and scalars may be printed at any point in the part program by means of the PRT/ statement. The formats for the PRT/ statement are... PRT/,...., or PRT/ALL The "ALL" minor word causes all canonical forms to be printed. Page 25 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.1.2 CANONICAL REPLACEMENT In general, every symbolically defined entity in CAMS must have a unique symbol. However, CAMS has a restricted symbol set consisting of 26 alphabetic characters, each permitted 256 instances. For this reason, provision has been made to permit replacement of any defined entity on an instance by instance basis. The vocabulary word "CAN" is used to accomplish this end, as follows... : PNT/ P12= 2.25,1.125 : : PNT/ P12= CAN,IO,L5,L6 : Canonical replacement must be made in kind; that is, a point can only be replaced by another point, a line/plane by another line/plane, and so forth. Since scalars may always be replaced, the vocabulary word "CAN" is meaningless in the assignment of a scalar, and hence is not allowed. 4.2 POINT DEFINITION PATTERNS A point is a unique position in three-dimensional space. It can be defined in a number of ways. In CAMS, any definition format for a point may include an optional, appended Z coordinate. Selection modifiors used by the point definitions are: XL XLARGE The point with the largest X coordinate XS XSMALL The point with the smallest X coordinate YL YLARGE The point with the largest Y coordinate YS YSMALL The point with the smallest Y coordinate In the case of spline intercept definitions for a point, it must be noted that multiple intersections can occur. When seeking such intercepts, CAMS finds ALL intercepts for the element up to and including the intercept number included in the definition. (See definitions 4.2.9 and 4.2.10.) It is important to remember that the spline is directed (see section 4.9), and that the intercepts are counted from the beginning of the curve. Page 26 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.2.1 A POINT DEFINED BY RECTANGULAR COORDINATES PNT/symbol=x,y,z 4.2.2 A POINT AT THE INTERSECTION OF TWO LINES PNT/symbol=IO,line,line[,z] Page 27 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.2.3 A POINT DEFINED BY ITS POLAR COORDINATES PNT/symbol=XYR,angle,radius[,z] 4.2.4 A POINT ON A CIRCLE AT A GIVEN ANGLE TO THE X-AXIS PNT/symbol=circle,ANG,angle[,z] Page 28 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.2.5 A POINT ON THE INTERSECT OF A CIRCLE AND A LINE PNT/symbol=modifior,circle,line[,z] 4.2.6 A POINT AT THE INTERSECTION OF TWO CIRCLES PNT/symbol=modifior,circle,circle[,z] Page 29 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.2.7 A POINT AT THE CENTER OF A DEFINED CIRCLE PNT/symbol=circle[,z] 4.2.8 A POINT AT THE INTERSECTION OF THREE DEFINED PLANES PNT/symbol=plane,plane,plane[,z] Page 30 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.2.9 A POINT AT THE Nth INTERCEPT OF LINE AND SPLINE PNT/symbol=IO,n,line,spline[,z] 4.2.10 A POINT AT THE Nth INTERCEPT OF CIRCLE AND SPLINE PNT/symbol=IO,n,circle,spline[,z] Page 31 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3 VECTOR DEFINITION PATTERNS A vector in CAMS is defined to be an ordered set of three numbers that represent both a direction and magnitude in three-dimensional space. Normally, a vector is not considered to be "anchored", that is to say, its position in space is irrelevant, only its attitude and length are relevant. One can think of a vector as an arrow, of specific length, that always points in the same direction, no matter where it is moved. If a vector is to be anchored with its tail on the coordinate origin, then the three numbers that represent the vector exactly correspond with the three numbers that represent the point at its tip. Thus we can see that a vector has the identical canonical format as a point. CAMS, in its canonical forms, does not distinguish between an entity defined as a vector an an entity defined as a point. Thus, given a point, a new point can be incrementally defined from that point by defining the incremental vector and (vector) adding it to the point. For example, the statement sequence... PNT/P1=1,1,1 VEC/V1=1,0,1 VEC/P2=ADD,P1,V1 will produce a geometric entity (P2) which can be considered, in subsequent statements, as either a point or a vector having component values [2,1,2]. Note that, even though we consider P2 a point, it was necessary to define it as a vector. Selection modifiors used by the vector definitions are: XL XLARGE The vector with the largest X component XS XSMALL The vector with the smallest X component YL YLARGE The vector with the largest Y component YS YSMALL The vector with the smallest Y component ZL ZLARGE The vector with the largest Z component ZS ZSMALL The vector with the smallest Z component Page 32 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.1 A VECTOR DEFINED BY ITS COMPONENTS VEC/symbol=x,y,z 4.3.2 A VECTOR DEFINED BETWEEN TWO POINTS VEC/symbol=point,point Page 33 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.3 A VECTOR THE CROSS PRODUCT OF TWO VECTORS VEC/symbol=CROS,vector,vector 4.3.4 A VECTOR DEFINED AS THE SUM OF TWO VECTORS VEC/symbol=ADD,vector,vector Page 34 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.5 A VECTOR DEFINED AS THE DIFFERENCE OF TWO VECTORS VEC/symbol=SUB,vector,vector 4.3.6 A VECTOR AS THE SCALAR PRODUCT OF ANOTHER VECTOR VEC/symbol=MPY,scalar,vector Page 35 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.7 A UNIT VECTOR WITH THE SAME DIRECTION AS A GIVEN VECTOR VEC/symbol=UNIT,vector 4.3.8 A VECTOR PERPENDICULAR TO A GIVEN PLANE VEC/symbol=PERP,plane,modifior Page 36 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.3.9 A VECTOR PARALLEL TO THE INTERSECTION OF TWO PLANES VEC/symbol=PARL,IO,plane,plane,modifior 4.4 LINE DEFINITION PATTERNS A line is normally considered the path of a moving point which has the shortest distance between two fixed points. This is not the case in CAMS. For purposes of machine tool control, it is more convenient to consider a line to be the edge view of a plane in three-dimensional space. Therefore, all lines in CAMS are defined to be planes which are perpendicular (i.e. in edge view) to the X-Y plane of the reference coordinate system in which they are defined. Selection modifiors used by the line definitions are: XL XLARGE The line farthest offset in increasing X XS XSMALL The line farthest offset in decreasing X YL YLARGE The line farthest offset in increasing Y YS YSMALL The line farthest offset in decreasing Y ZL ZLARGE The line farthest offset in increasing Z ZS ZSMALL The line farthest offset in decreasing Z LFT LEFT The leftmost of two possible conditions RGT RIGHT The rightmost of two possible conditions Page 37 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.1 A LINE DEFINED BY COORDINATE VALUES OF TWO POINTS LIN/symbol=x1,y1,x2,y2 4.4.2 A LINE DEFINED BETWEEN TWO POINTS LIN/symbol=point,point Page 38 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.3 A LINE THRU A POINT AND PERPENDICULAR TO ANOTHER LINE LIN/symbol=point,PERP,line 4.4.4 A LINE THRU A POINT AND PARALLEL TO ANOTHER LINE LIN/symbol=point,PARL,line Page 39 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.5 A LINE THRU A POINT AT A GIVEN ANGLE TO THE X AXIS LIN/symbol=point,ANG,angle 4.4.6 A LINE THRU A POINT AT A GIVEN ANGLE TO ANOTHER LINE LIN/symbol=point,ANG,angle,line Page 40 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.7 A LINE PARALLEL TO ANOTHER LINE AT A GIVEN OFFSET LIN/symbol=PARL,line,modifior,offset 4.4.8 A LINE THRU A POINT AND TANGENT TO A GIVEN CIRCLE LIN/symbol=point,modifior,circle Page 41 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.9 A LINE TANGENT TO TWO DEFINED CIRCLES LIN/symbol=modifior,circle,modifior,circle 4.4.10 A LINE THRU A POINT PERPENDICULAR TO A CIRCLE LIN/symbol=point,PERP,circle Page 42 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.11 A LINE THRU A POINT PARALLEL TO A CIRCLE LIN/symbol=point,PARL,circle Note: The resulting parallel line is perpendicular to a normal to the circle thru the point. 4.4.12 A LINE THRU A POINT PERPENDICULAR TO A SPLINE LIN/symbol=point,PERP,spline Page 43 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.4.13 A LINE THRU A POINT PARALLEL TO A SPLINE LIN/symbol=point,PARL,spline Note: The resulting parallel line is perpendicular to a normal to the spline thru the point. 4.5 PLANE DEFINITION PATTERNS Since CAMS regards a line as the edge view of a plane, there is no basic difference between a line and a plane except in their respective definition patterns. For example, to define a plane as the concurrence points requires three points. However, in the line definitions, only two points are required, since the desired "line" (i.e. plane) is known to be perpendicular to the X-Y plane of reference. This makes the line definitions a convenient shorthand to defining planes. The canonical forms are identical. Plane definitions are included in CAMS to provide the means of defining those part planes that are not perpendicular to the X-Y coordinate plane. Selection modifiors used by the plane definitions are: XL XLARGE The plane farthest offset in increasing X XS XSMALL The plane farthest offset in decreasing X YL YLARGE The plane farthest offset in increasing Y YS YSMALL The plane farthest offset in decreasing Y ZL ZLARGE The plane farthest offset in increasing Z ZS ZSMALL The plane farthest offset in decreasing Z A plane may be defined by its canonical form... PLN/symbol=a,b,c,d Page 44 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.5.1 A PLANE DEFINED BY THREE POINTS PLN/symbol=point,point,point 4.5.2 A PLANE THRU A POINT AND PARALLEL TO A GIVEN PLANE PLN/symbol=PARL,plane,point Page 45 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.5.3 A PLANE PARALLEL TO ANOTHER PLANE AT A GIVEN OFFSET PLN/symbol=modifior,plane,offset 4.5.4 A PLANE THRU A POINT AND PERPENDICULAR TO A VECTOR PLN/symbol=PERP,vector,point Page 46 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.5.5 A PLANE THRU A POINT, PERPENDICULAR TO THE INTERSECTION OF TWO PLANES PLN/symbol=PERP,IO,plane,plane,point 4.6 CIRCLE DEFINITION PATTERNS A circle is normally considered the locus of all points in a plane that are equidistant from a fixed point in the plane. For purposes of defining parts for NC machining, it is more convenient to regard a circle as the edge view of a right circular cylinder whose axis is perpendicular to the X-Y coordinate plane. This is the way it is done in CAMS. Thus, the canonical form of a circle is identical to that of a cylinder. Selection modifiors used by the circle definitions are: XL XLARGE The plane farthest offset in increasing X XS XSMALL The plane farthest offset in decreasing X YL YLARGE The plane farthest offset in increasing Y YS YSMALL The plane farthest offset in decreasing Y ZL ZLARGE The plane farthest offset in increasing Z ZS ZSMALL The plane farthest offset in decreasing Z IN The circle that lies inside the defining circle OUT The circle that lies outside the defining circle LGE LARGE The largest of two resulting circles SMA SMALL The smallest of two resulting circles Page 47 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.6.1 A CIRCLE DEFINED BY THE COORDINATES OF CENTER AND ITS RADIUS CIR/symbol=xc,yc,radius 4.6.2 A CIRCLE DEFINED BY A POINT ON ITS CENTER AND ITS RADIUS CIR/symbol=point,radius Page 48 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.6.3 A CIRCLE DEFINED BY THE TWO-POINT METHOD CIR/symbol=point,point 4.6.4 A CIRCLE DEFINED BY ITS CENTER POINT AND TANGENT TO A DEFINED LINE CIR/symbol=point,TGT,line Page 49 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.6.5 A CIRCLE DEFINED BY ITS CENTER POINT AND TANGENT TO A DEFINED CIRCLE CIR/symbol=point,LGE,line SMA 4.6.6 A CIRCLE DEFINED THRU A POINT AND TANGENT TO A LINE CIR/symbol=TGT,line,modifior,point,radius Page 50 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.6.7 A CIRCLE TANGENT TO TWO INTERSECTING LINES XL XL CIR/symbol=XS,line,XS,line,radius YL YL YS YS 4.6.8 A CIRCLE TANGENT TO A LINE AND A CIRCLE XL XL IN CIR/symbol=XS,line,XS,OUT,circle,radius YL YL YS YS Page 51 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.6.9 A CIRCLE TANGENT TWO TWO INTERSECTING CIRCLES XL IN IN CIR/symbol=XS,OUT,circle,OUT,circle,radius YL YS 4.6.10 A CIRCLE TANGENT TO THREE LINES XL XL XL CIR/symbol=XS,line,XS,line,XS,line YL YL YL YS YS YS Page 52 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.7 CYLINDER DEFINITION PATTERNS As mentioned in the section on circles (section 4.10), the canonical forms of the "circle" and cylinder are identical. The circle definitions make it convenient for the NC parts programmer to define cylinders (circles) whose axes are perpendicular to the XY coordinate plane. For all other cylinders, it is necessary to use the CYL/ keyword function. It should be noted that in CAMS, the term cylinder always means a right circular cylinder, unless otherwise specified. 4.7.1 A CYLINDER DEFINED BY ITS CANONICAL FORM x,y,z i,j,k CYL/symbol=point,vector,radius Page 53 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.7.2 A CYLINDER DEFINED BY THREE POINTS AND A VECTOR CYL/symbol=PT3,point,point,point,vector Where the three points are presumed to lie on the surface of the cylinder and the vector coincides with the cylinder axis. The three points must not be colinear. 4.8 TRANSFORMATION MATRIX PATTERNS Among the most useful features of CAMS are the functions that permit the NC parts programmer to 1) define geometric elements in one coordinate system and use them in another, or 2) progressively alter cyclic cutter paths in order to accomplish the same motion at different locations in the machining space (i.e. repetative programming). In order to accomplish these worthwhile goals, it is necessary to be able to define the manner in which geometry, or motion, is to be altered, that is, transformed. CAMS' internal calculations use sophisticated vector and matrix algebra techniques which provide flexibility, speed and accuracy of calculation. To be consistent with these methods, it is necessary to define geometry (or cutter path) transformations as 3 by 4 matrices which represent a combined rotation, translation and scale on the respective data. Not all users of CAMS, however, can be expected to be trained in the use of these advanced mathematical techniques. Therefore, CAMS provides the means for an unsophisticated user to define transformations as a finite sequence of translation, rotation and scaling operations that "happen" to the data in a specified order. Each of these operations is known as a matrix archtype. Matrix archtypes may be combined in unlimited sequence to form a complex transformation in a manner that is easy for the user to understand. Page 54 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual Each MAT/ statement can be either unary (having one matrix archtype) or binary (having two matrix archtypes). If it is binary, then the rightmost matrix archtype always "happens" first. Matrix archtypes are listed below. The MAT/ statement format is: MAT/symbol= or MAT/symbol=, 4.8.1 MATRIX ARCHTYPES: 4.8.1.1 DIRECT ENTRY a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3 4.8.1.2 CANONICAL REPLACEMENT 4.8.1.3 TRANSLATION TRN,x,y,z 4.8.1.4 XY ROTATION XYR,angle 4.8.1.5 YZ ROTATION YZR,angle 4.8.1.6 ZX ROTATION ZXR,angle 4.8.1.7 INVERSION INV, Inversion of a matrix produces another matrix which, if combined with the original matrix, completely cancels its effect. 4.8.1.8 SCALE SCL, 4.8.1.9 THREE PLANE METHOD PL3,,, The three planes become the coordinate planes of the Page 55 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual transformation. As such, they must be mutually perpendicular. 4.8.1.10 THREE POINTS PT3,,, will become the origin (or center) of the new coordinate system. is presumed to define the direction of the new X-axis. is presumed to lie in the positive Y half of the new XY coordinate plane. 4.8.2 EXAMPLES Some examples of matrix definitions are: MAT/M1=TRN,0,1.25,1,XYR,30 MAT/M2=YZR,45 MAT/M3=M1,M2 In these examples, M1 establishes a transformation that is composed of a counter-clockwise rotation in the XY coordinate plane of 30 degrees, followed by a translation of the origin of 1.25 units in Y and 1 unit in Z. M2 is a simple rotation in the YZ coordinate plane of 45 degrees, and M3 is a transformation composed first of M2, then followed by M1. Notice that M3 is actually composed of three matrix archtypes. 4.9 SPLINE CURVE DEFINITION PATTERNS CAMS is capable of defining and machining free-form curves. Called SPLINES, the curves consist of a sequence of slope continuous two dimensional parametric cubic equations passing thru a sequence of up to twenty-five (25) points. The minimum number of points for a spline is two (2). Splines are extremely flexible. They are used to fit continuous curves thru the tabular data that is sometimes found on the engineering drawing of a workpiece. They can be offset to account for wall thicknesses and/or stock allowances. Additional controls on the definition of a spline curve can be had by defining the end tangency conditions. This is done by describing either the end angle (ANG) or the end tangent vector (TGT) at either or both ends of the curve. In fact, if the end conditions are not specified on a two- point spline, the resulting curve will be a straight line between the points. Page 56 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual Splines in CAMS are directed curves. That is, the "forward" direction of the curve begins at the first point and flows thru the points in sequential order as defined. While this directed aspect is not important during machining of the spline, it is very important to the definition of offset splines and when using the spline in defining intercept points. Please keep this in mind when using the modifiors "LFT" and "RGT" while defining an offset spline. Selection modifiors used by the spline definitions are: LFT LEFT Describes an offset to the left of the curve when looking along the curve in the forward direction. RGT RIGHT Describes an offset to the right of the curve when looking along the curve in the forward direction. 4.9.1 A SPLINE DEFINED BY UP TO 25 POINTS SPL/symbol=x1,y1,...,xn,yn Page 57 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.9.2 A SPLINE DEFINED BY UP TO 25 POINTS WITH END CONTROL [ANG,a1, ] [ANG,an, ] SPL/symbol=[TGT,i1,j1,]x1,y1,...,[TGT,in,jn,]xn,yn 4.9.3 A SPLINE DEFINED BY AN OFFSET TO AN EXISTING SPLINE LFT SPL/symbol=RGT,, Page 58 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.10 POINT PATTERN DEFINITIONS A pattern is a set of one or more points. The maximum number of points in a single pattern is 42. The use of patterns allows you to define and manipulate groups of points in a simple and convenient manner. You can define a pattern as a linear, circular, or random array of points You can also define patterns as combinations of points and other patterns. Once defined, you can subsequently reference the symbol for a pattern in a GTO/ statement to move the cutter to each of its points in the sequence in which you defined them. A linear pattern is a set of points all of which lie on a straight line. A circular pattern is a set of points all of which lie on a given circle. A random pattern consists of points randomly distributed in the plane, but may also contain other patterns which were not randomly defined. In each pattern definition, except the random pattern, an optional Z coordinate may be appended which will be applied to all of the points in the pattern. 4.10.1 A LINEAR PATTERN DEFINED BY A POINT, AN ANGLE, THE DISTANCE BETWEEN POINTS, AND A POINT COUNT x,y PAT/symbol=ANG,point,angle,delta,count[,z] Page 59 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual 4.10.2 A CIRCULAR PATTERN DEFINED BY A CIRCLE, A STARTING ANGLE, AN ANGULAR INCREMENT, AND A POINT COUNT CCW PAT/symbol=CLW,circle,angle,increment,count[,z] 4.10.3 A PATTERN DEFINED BY A RANDOM SET OF POINTS AND PATTERNS point point PAT/symbol=pattern,pattern,... Page 60 Geometry Definition Statements February 1, 1990 CAMS Part Programmer's Reference Manual POINT-TO-POINT PROGRAMMING 5. POINT-TO-POINT PROGRAMMING CAMS provides the capability to explicitly move the cutting tool to any absolute position in the workpiece reference system. The technique of moving the cutter thru a sequence of explicit coordinate positions is called point-to-point programming. In CAMS, point-to-point programming is accomplished by means of the keywords FROM/, GTO/, and GDL/. Statements based on these keywords do not require additional information, such as cutter shape descriptions, in order to control cutter motion. You should not make the assumption that complex parts cannot be programmed using point-to-point methods. While a greater cutter path specification burden is placed on the parts programmer than with contouring methods, all NC programming systems produce sequences of absolute positions for postprocessing. 5.1 THE CONTROL POINT Even a simple drill bit has a complex shape. For point-to- point programming, a definition of the shape of the cutting tool is not required. What is needed for accurate positioning of the cutter is an agreed upon convention for a single point on the tool which will be used to control positioning. This point, called the control point, is defined to be on the axis of the tool, precisely at its tip. All CAMS calculated output positions are control point positions, irrespective of the actual shape of the cutter. 5.2 THE MOTION INITIALIZATION STATEMENT (FROM/) The FROM/ statement specifies the initial location at which the cutter is assumed to be positioned. A FROM/ statement must be the first motion statement in a part program. Use of the FROM/ statement does not produce any motion data on the machine control tape the first time it appears in the part program. Subsequent use of the FROM/ statement can result in a tool motion for some absolute positioning machine tools. On incremental positioning machine tools, subsequent uses of the FROM/ statement will not cause motion. In general, it is advisable to use only one FROM/ statement in a part program, unless circumstances warrent otherwise. As with most point-to-point motion keywords, the tool position entered in a FROM/ statement can also define and label a point. Thus, the format for a FROM/ statement is... FROM/[=] Page 61 Point-To-Point Programming February 1, 1990 CAMS Part Programmer's Reference Manual Some examples are... FROM/0,0,0 FROM/P1=IO,L1,L10,.5 5.3 THE ABSOLUTE POSITIONING STATEMENT (GTO/) The GTO/ statement is an absolute positioning, or "go to," statement. It is used to move the cutting tool from its present position to the absolute position specified in the body of the GTO/ statement. Except for the keyword, the format of the GTO/ statement is identical to that of FROM/. The absolute cutter position, in part coordinates, can be labeled and stored as a point in canon. The format of the GTO/ statement is... GTO/[=] Examples include... GTO/P5=XYR,30,2.6875,1.1 GTO/3,7,2 You can also substitute a new Z coordinate for a pre-defined point in the GTO/ statement. For example, the statements... PNT/P1=.125,1.5,2 GTO/P1,1 would produce motion to the coordinates [.125,1.5,1] instead of [.125,1.5,2]. This eliminates the necessity of defining a number of points with the same X,Y coordinates, but differing Z coordinates. In addition to generating motion to a single point, the GTO/ statement is also used to generate motion to all of the points in a pre-defined pattern. For example... PAT/B1=ANG,1,1,45,.5,3 GTO/B1 would produce motion to all three points of the pattern. 5.4 THE INCREMENTAL MOVE STATEMENT (GDL/) The GDL/ statement specifies an incremental vector value which is to be added to the present tool position to form a new tool position. Thus, it defines an increment of movement, in each of the machine's coordinate axes. It does not specify an absolute position at any time. The GDL/ statement takes two forms... Page 62 Point-To-Point Programming February 1, 1990 CAMS Part Programmer's Reference Manual GDL/,, GDL/ In the first form, an independent increment of motion is specified for each of the coordinate axes of the machine. In the second form, the single scalar () specifies the amount of motion required along the tool axis. A positive value for specifies motion up the tool axis (i.e.from the tool tip towards the spindle face). A negative value for specifies a move down the tool axis, away from the spindle face. Some examples of the GDL/ statement are... GDL/0,0,1 GDL/1 Note that both of these statements produce exactly the same result on a three axis machine. On a machine with tilt and rotational axes, the motions resulting from the two statements can be vastly different. Page 63 Point-To-Point Programming February 1, 1990 CAMS Part Programmer's Reference Manual CONTOUR PROGRAMMING 6.1 THE PART SURFACE STATEMENT (PS/) All contouring motion in CAMS must have an established part surface plane. In some cases (e.g. ARC/) the part surface plane may be established within the body of the command. For some cases (notably GO/) the part surface must be established in some other way before the command can be executed. The PS/ statement has been established to permit you to clearly define the part surface to be used by subsequent contouring statements. TO PS/ON,plane TO The TO modifior for the part surface informs CAMS that the tool end is to remain in tangent contact with the part surface plane at all times during the cut. ON The ON modifior for the part surface informs CAMS that the control point is to remain in contact with the part surface plane at all times during the cut. 6.2 CONTOURING ARCS (ARC/) The vast majority of contour operations involve contours of lines and circular arcs. To be effective, an NC programming system must provide adequate (and convenient) means for the parts programmer to specify contour machining along circular arcs. Arc calculations are invoked by the CAMS ARC/ statement. The basic Arc processor computes an arc from a starting angle (a) to an ending angle (b) along a specified circle. The cutter may be inside (IN), outside (OUT) or centered on (ON) the circle. Direction of rotation around the circle is specified by the sign of the difference between the two angles. I.e., if b-a is positive, the arc will be counterclockwise; if b-a is negative, the arc will be clockwise. A tolerance is required to produce accurate incremental motions in case the machine postprocessor must use linear interpolation to cut the arc. End control of the cutter is accomplished by requiring a defined plane for use as the part surface. The tool tip may be either TO or ON the part surface plane. The general ARC/ statement, showing all possible options, is as follows... Page 64 Contour Programming February 1, 1990 CAMS Part Programmer's Reference Manual [,CLW],a [,b ][,ON ],IN ARC/tol[,CCW],point [,point ][,TO,plane],OUT,circle ,CTR [,TGT,line ] ,ON ,LFT [,PARL,line] ,RGT ,TGT,line ,PARL,line tol: Tolerance. The tolerance input is required on all ARC/ statements. It is used to calculate accurate linear increments for use by 1) postprocessors that do not have circular interpolation, or 2) those situations where the postprocessor must produce linear motion. CLW The modifior CLW or CCW is optional. If present, CCW the modifior will guarantee the direction of rotation of the cutting arc, over-riding the sign rule as required. a The angles "a" and "b" represent the respective b start and end angles for the arc. Direction of rotation will be specified by the difference, b-a, unless one of CLW/CCW is present in the statement. If the difference is positive, rotation is CCW; if negative, rotation is CLW. All other options in the angle positions of the ARC/ statement permit the program to calculate the beginning and ending angles. If the ending angle (b) is completely omitted from the ARC/ statement, a full 360 degree arc will be machined. In this case, the rotational parameter (CLW or CCW) must be present in the ARC/ statement. CTR The minor word CTR (CenTeR) is used to specify that the starting angle corresponds to that of a straight line between the current cutter position and the center of the arc circle. CTR may only be used for a starting angle. LFT The minor words LFT (LeFT) and RGT (RiGhT) are RGT used to specify a starting angle that causes the cutter to move to either a left or a right tangency condition from the present cutter position. One of these words may only be used to specify a starting angle. TGT The TGT (TanGenT) minor word option permits calculation of a starting or an ending angle that is computed from the center of the motion arc to the point of tangency of the specified line. If the tangency is not geometrically possible, the ARC/ statement will fail. Page 65 Contour Programming February 1, 1990 CAMS Part Programmer's Reference Manual PARL The PARL (PARalleL) minor word option permits calculation of a starting or an ending angle that is computed from a vector thru the center of the motion arc and normal to the point of tangency of the specified line. If the vector is not geometrically possible, the ARC/ statement will fail. TO Tool end conditions with respect to the part ON surface plane (see below). A TO condition means that the end of the cutter is to remain in tangent contact with the part surface plane throughout the cut. An ON condition means that the tool control point is to lie in the part surface plane throughout the cut. plane A part surface must be in effect during the processing of an ARC/ statement. If a part surface is already in effect (thru a preceeding ARC/ statement or a PS/ statement), then the part surface plane and its attendant conditions are optional in the ARC/ statement. A part surface plane must always be preceeded by one of the tool end conditions, TO or ON. IN The arc may be driven with the tool inside the arc OUT (IN), the tool outside the arc (OUT), or the tool ON ON the arc. circle The final parameter of the ARC/ statement is the specification of the arc circle. This may be any form of circle definition (see chapter 4). By convention, all calculated angles will be computed within the range 0 to 360 degrees. of arc. In view of the processors method of calculating rotational direction of cut, it is advisable to specify CLW or CCW when using any of the calculation options in the ARC/ statement. 6.3 THE CONTOUR STARTUP (GO/) The contour startup command (GO/) is used to place the currently defined cutter into position with respect to three controlling geometry elements. The first of these is called the part surface, and must be must be defined prior to using the GO/ statement with a PS/ or ARC/ defined prior to using the GO/ statement statement. The second controlling surface is called the drive surface. The drive surface is the geometry element you want to be traversed in the next up-coming motion command. The drive surface must be the first of the two surfaces permitted in the GO/ command. Page 66 Contour Programming February 1, 1990 CAMS Part Programmer's Reference Manual The third controlling surface is called the check surface. The check surface is the geometry element you want to use for precise positioning of the cutter relative to the part and drive surfaces. TO TO GO/PAST,,PAST, ON ON TO Position the cutter tangent to the drive/check surface on the side nearest to the cutter's present position. PAST Position the cutter tangent to the drive/check surface on the side nearest to the cutter's present position. ON Position the cutter with the control point directly on the drive/check surface. Both the drive and check surface must always be present in a GO/ statement. Each must have the appropriate modifior present in the statement. Any combination of modifiors on the two surfaces is permissible. 6.4 TOOL TO PART RELATIONSHIPS (TLF, TON, TRG) The vocabulary words "TLF" (Tool LeFt), "TON" (Tool ON) and "TRG" (Tool RiGht) are used to specify the tool relationsip with respect to a drive surface. They are used to inform the motion generator as to which side of a drive surface the tool is to remain during a general contour motion (see the next section). 6.5 GENERAL CONTOUR MOTION (GFW/,GBK/,GLF/,GRT/) The contour motion commands (GFW/,GBK/,GLF/,GRT/) are used to perform continuous cutter offset calculations while traversing the defined surfaces of the part. These commands depend upon CAMS' sense of forward cutter motion. At every cutter motion in the part program, the forward direction of the cutter in the part space is calculated. This happens regardless of the type of statement used to produce the motion. The only time when this forward sense may be lost is immediately after a copy (CPY/) statement (see chapter 7). Even in this case, the forward sense can be re-established by the simple expedient of a point-to- point motion (e.g. GO/). The general motion statements are intended to provide the means to generate contour motion around a part boundary Page 67 Contour Programming February 1, 1990 CAMS Part Programmer's Reference Manual consisting of an arbitrary number and type of CAMS geometry elements. This is called a "motion sequence". A motion sequence should begin with a contour startup (GO/) command to place the cutter in contact with the drive surface. Note that that movement established a forward direction for the cutter. Then, depending on how the cutter approached the drive surface during the startup, one of the general motion statements is used to instruct the cutter to move along the drive surface until the desired tool condition (TO,ON,PAST) with respect to the check surface is reached. This establishes a new forward direction for the cutter. Another general motion statement is programmed to traverse the new drive surface (perhaps the same surface) until tool condition with its check surface is found. And so on... To better illustrate the principle, Appendix C contains the same part program illustrated in Appendix B, but with motion generated by the general contouring principles. Page 68 Contour Programming February 1, 1990 CAMS Part Programmer's Reference Manual TRANSFORMATIONS AND REPETATIVE PROGRAMMING 7. TRANSFORMATIONS AND REPETATIVE PROGRAMMING Among the major benefits derived from using a computer system to prepare programs for N/C machining are the system's capabilities to 1) perform rapid, accurate transformations on large quantities of cutter center positions, and 2) produce repeated cutting sequences under transformation. The CAMS system has facilities for both of these capabilities thru the TRA/ (TRAnsform cut) and the CPY/ (CoPY) keyword functions. Each of these keywords either make use of transformations previously defined in the part program by means of the MAT/ (MATrix) keyword function, or contain embeded information equivalent to a matrix definition. 7.1 THE TRANSFORM CUT STATEMENT (TRA/) The TRA/ statement provides the parts programmer with the flexibility of defining the part geometry and motion statements in a convenient coordinate system for the part, while producing CL file data for output motion in a convenient frame of reference for the machine. The tiresome, error prone chore of converting blue-print dimensions to the machine reference system is taken over by CAMS. A TRA/ statement can either make use of a pre-defined matrix, use an un-named matrix defined in the body of the statement, or name, store, and use a matrix defined in the body of the statement (see section 3.8). The TRA/ statement has two formats: TRA/[=][,] TRA/OFF TRA/ establishes a modal condition that can only be altered by another TRA/ statement. That means that once a TRA/ mode establishes a transformation matrix, all CL file records will be affected by the transformation until another TRA/ statement is entered. The TRA/OFF statement is used to permit the parts programmer to cancel any TRA/ transformations in effect. There are several cogent reasons for providing transformation capability such as TRA/. These include: 1. TRA/ can be used to transform cutter locations from the xy plane into any other plane. Thus allowing the use of all the LIN/, CIR/, and PNT/ definitions for canted faces of the workpiece instead of using the more complex PLN/ and CYL/ definition formats. Page 69 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual 2. TRA/ is useful for matching the coordinates of cutter positions to the special requirements of a particular machine tool. This might involve a simple translation to eliminate negative values, or a rotation to match the part program xy plane to the machine tool xy plane. 3. TRA/ will permit easy production of over-size or under- size parts through appropriate scaling matrices. This can be especially useful in the production of dies where shrinkage allowances must be provided. It can also be used to provide grind allowances, and the like. 4. TRA/ can be used to get around the "large number" problems encountered with floating point numbers. Sometimes a portion of the geometry of a part is located in the coordinate system such that the definitions involve numbers in the hundreds or thousands. Erroneous output can sometimes occur under these conditions due to the loss of significance as the computer manipulates these large numbers. In that event, it is practical to define the geometry and cutter path close to the origin, then use TRA/ to translate the cutter locations back to their proper location. 7.2 THE INDEX STATEMENT (IDX/) The index statement is used to establish numbered reference points on the CL file. It is used in conjunction with the copy (CPY/) statement described in section 7.3. The two forms of the index statement are: IDX/ON, IDX/OFF, If the IDX/OFF form of the statement is used, it is always paired with an IDX/ON statement with a corresponding index number. Each index number must be a unique integer identifying the cutting sequence referenced. If the number is not entered in the statement as an integer, the number is truncated to an integer. In effect, the IDX/ON - IDX/OFF pair "traps" a sequence of CL file records for copy purposes, permitting the "trapped" sequence to be repeated under any appropriate transformation matrix. The index numbers must be used in a monotonically increasing sequence in your part program. That is, each IDX/ON,... statement must use an index number larger then any preceeding IDX/ON,... in the part program. Index regions in a part program may not overlap. However, an index region may totally contain another. This is called Page 70 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual "nesting." Nesting may be carried out to a maximum depth of three. For example... : IDX/ON,10 IDX/ON,20 IDX/ON,30 GTO/P3 IDX/OFF,30 CPY/30,2,TRN,.5,0,0 IDX/OFF,20 CPY/20,1,TRN,0,.5,0 IDX/OFF,10 : shows a collection of index regions which are nested to a depth of three. The example shows how IDX/ and CPY/ can work together to drill a rectangular pattern of six holes, three holes wide by two holes high, at .500 spacing between holes. 7.3 THE COPY STATEMENT (CPY/) The copy statement is used to repeat sequences of CL file records, transforming or changing the motion specified according to an appropriate transformation matrix. The proper form of the copy statement is: CPY/,, where refers to an index reference number established by an IDX/ON statement, is the number of progressively transformed copies to be processed, and refers to any matrix archtype described in section 3.8.1. Note that if the of copies is more than 1, the transformation matrix is progressively applied. For example, the statement sequence: : PNT/P1=0,0,0 IDX/ON,1 GTO/P1 CPY/1,2,TRN,1,0,0 : will produce the following output: 1. a move to the point 0,0,0 2. a move to the point 1,0,0 (the first copy) 3. a move to the point 2,0,0 (the second, progressive, copy) Another thing to notice about this example is that the CPY/ statement itself may serve in the capacity of an IDX/OFF statement. The IDX/OFF statement is used when there are CL Page 71 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual records between the copy master and the copy statement that should not be copied. For example, the statement sequence: : IDX/ON,2 GTO/P2=1,0,0 IDX/OFF,2 GTO/P3=2,0,1 CPY/2,2,XYR,90 : will produce the output: 1. a move to the point 1,0,0 2. a move to the point 2,0,1 3. a move to the point 0,1,0 (the first copy) 4. a move to the point -1,0,0 (the second, progressive, copy) Note that in this manner, the move to P3 was not made a part of the copy master. Further examples of the copy capability may be seen in the programmed examples of appendix a. Some typical copy pitfalls are listed as follows. 1. Rotational copies always rotate about the coordinate origin. This means that it is not possible to use the progressive copy feature to drill a bolt circle whose center of rotation does not coincide with the coordinate origin by copying it's first point. 2. Copy can be used in conjunction with TRA/ quite successfully, except when mirrored image TRA/s are attempted. The mirror TRA/ matrix will not change a positive translation factor in a copy statement to a negative translation factor in the mirror image, hence the mirrored part will not be correct. 7.4 REFERENCE SYSTEMS - THE REF/ STATEMENT The REF/ statement is used to establish an auxilliary coordinate system which is used for the sole purpose of defining geometric elements. Geometry which is defined under a reference system is immediately transformed into the base coordinate system of the part program. As such, the action of a reference system occurs before cutter paths are calculated from the geometry. By contrast, the TRA/ statement acts on completed cutter paths to transform them from the base coordinate system into some other system, presumably into machine coordinates. Geometry entities that are defined outside the range of a reference system are transformed when they are retrieved Page 72 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual from canonical storage for use in other definitions. This keeps the entire geometry of the part consistent with the base coordinate system. The formats of the REF/ statement are: : REF/ [=] : : REF/ OFF : The first statement establishes a reference system controlled by the matrix archtype used (or defined) in the REF/ statement. The second statement turns off the reference system so that subsequent geometry definitions will be defined in the base coordinate system. It is not necessary to close a reference system with the REF/ OFF statement if you wish to use more than one reference system to define your part geometry. Simply establish the new reference system with a new REF/ statement, and it will supercede the previously active reference system, as follows: : REF/ [=] : REF/ [=] : REF/ OFF : Any matrix archtype as described in section 4.8 may be used in the REF/ statement. The "range" of a reference system is all of the statements between the "REF/ " and the next REF/ statement, or the end of the program (FIN), whichever comes first. If a PRT/ statement is included in the range of a reference system, the geometry specified by the PRT/ statement will be printed in reference system coordinates. If the PRT/ statement is outside the range of any reference system, the geometry specified will be printed in base coordinates. Certain geometric entities are not affected by a reference system. These are the more complex geometry types, specifically matrices (as defined by MAT/ statements) and spline curves (as defined by SPL/ statements). To define a transformed spline, you must define the points under a reference system, then define the spline with the transformed points. In the following example, splines S1 and S2 have exactly the same shape, but lie in different positions and orientations in the base coordinate system. Page 73 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual 1 PNT/ P1= 1,0 2 PNT/ P2= 2,0.5 3 PNT/ P3= 3,0 4 PNT/ P4= 4,0.5 5 SPL/ S1= P1,P2,P3,P4 6 PRT/ S1 S1 052A 1.00000 .00000 .70711 .70711 1.11803 2.00000 .50000 .93189 -.14142 1.11803 3.00000 .00000 .93189 -.14142 1.11803 4.00000 .50000 .70711 .70711 .00000 7 REF/ M1= TRN,1,1,0,XYR,30 8 PNT/ P5= 1,0 9 PNT/ P6= 2,0.5 10 PNT/ P7= 3,0 11 PNT/ P8= 4,0.5 12 REF/ OFF 13 SPL/ S2= P5,P6,P7,P8 14 PRT/ S2 S2 052A 1.86603 1.50000 .25882 .96593 1.11803 2.48205 2.43301 .87775 .34347 1.11803 3.59808 2.50000 .87775 .34347 1.11803 4.21410 3.43301 .25882 .96593 .00000 15 FIN In general, CAMS does not distinguish between entities that are defined as points and entities that are defined as vectors. The one exception to this rule is when entities are defined or used under a reference system. Points are considered fixed locations in the part space, and hence are affected by translation. Vectors are considered to specify a direction, and hence are rotated but NEVER TRANSLATED, since translation would destroy their directional sense. Another way to view a point is that it is a vector with its tail anchored to the origin, whereas a true vector does not have an anchor. Sometimes it is convenient to define a point by means of a vector definition, such as adding an incremental displacement to an existing point. Beware of using this technique under a reference system, or of using the resultant "vector" under a reference system. For example: 1 PNT/ P1= 1,1 2 VEC/ V1= 1,0,0 3 VEC/ P2= ADD,P1,V1 4 PRT/ P1,P2 P1 0008 1.00000 1.00000 .00000 P2 0308 2.00000 1.00000 .00000 Page 74 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual 5 REF/ M1= TRN,-1,0,0 6 PRT/ P1,P2 P1 0008 2.00000 1.00000 .00000 P2 0308 2.00000 1.00000 .00000 7 REF/ OFF 8 FIN The above part program fragment illustrates the fundamental difference between points and vectors under reference system transformations. Notice that the relationship between P1 and P2 of "1 unit apart," established by their original definition, NO LONGER HOLDS UNDER THE REFERENCE SYSTEM. The correct way to accomplish the desired end is to redefine the computed vector as a point, as follows: 1 PNT/ P1= 1,1 2 VEC/ V1= 1,0,0 3 VEC/ V2= ADD,P1,V1 4 PNT/ P2= V2 5 PRT/ P1,P2 P1 0008 1.00000 1.00000 .00000 P2 0008 2.00000 1.00000 .00000 6 REF/ M1= TRN,-1,0,0 7 PRT/ P1,P2 P1 0008 2.00000 1.00000 .00000 P2 0008 3.00000 1.00000 .00000 8 REF/ OFF 9 FIN Every transformable entity will be converted into local coordinates under a reference system, regardless of how it was defined. This means that if you obtain (using OBT/) values from the canonical form of an entity, you will get those values in local coordinates. The following example of obtaining the coordinates of the normal vector to a line will illustrate this point. 1 LIN/ L1= 1,.5,4,1.5 2 OBT/ A= L1,1 3 OBT/ B= L1,2 4 OBT/ C= L1,3 5 PRT/ A,B,C A0 2104 .31623 B0 2104 -.94868 C0 2104 .00000 6 REF/ M1= XYR,30 7 OBT/ A= L1,1 Page 75 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual 8 OBT/ B= L1,2 9 OBT/ C= L1,3 10 PRT/ A,B,C A0 2104 -.20048 B0 2104 -.97970 C0 2104 .00000 11 REF/ OFF 12 FIN Reference system matrices involving scale factors may yield incorrect results (with no diagnostic message) for several reasons. If a scale factor is used, the unit vectors of certain geometry types (line, plane, circle, cylinder) will be scaled, and could produce cutter path calculation errors in CAMS2. Furthermore, the radii of circles and cylinders will not be scaled at all. CAMS passes geometry entities to the path generator (CAMS2) by symbolic name, and not by canonical form. This means that the calculation of cutter paths ALWAYS occurs with respect to the base coordinate system. CUTTER PATHS ARE NORMALLY UNAFFECTED IN ANY WAY BY REFERENCE SYSTEMS. The exception to this rule is geometry that is defined in a cutter motion statement when a reference system is in effect. To avoid ambiguity and cutter motion failures it is strongly recommended that all motion statements be outside the range of any reference system. 7.5 FILE INCLUSION (GET/) CAMS normally reads part program statements from the specified input file. It is sometimes convenient to be able to read a portion of the program from a different source. For example, a standard tool change program sequence may be established that is use in several places in a part program, or, for that matter, it may be used in many part programs. It is undesirable to program this many times because it uses time that could be better spent elsewhere in the part programming process. An alternative source of input statements can be specified at any time in the part program by means of the GET/ statement. This statement includes the DOS file name of the part program fragment that is to be included in the primary part program. The format of the GET/ statement is as follows: GET/ The file name may optionally include a DOS path. As an example, suppose the tool change sequence is contained Page 76 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual in the current directory under the filename "BANDIT.INC" as follows: REM/ T255= TOOL NUMBER TO BE LOADED REM/ D255= TOOL DIAMETER REM/ U255= CHIP LOAD PER CUTTING EDGE REM/ N255= NUMBER OF FLUTES #/ T[T255]= D255 #/ S[T255]= INT(MIN(3525:MAX(100:12*S100/(3.1416*T[T255])))) #/ F[T255]= S[T255]*U255*N255 LTL/ T255 SPN/ S[T255] FED/ F[T255] PRT/ S[T255],F[T255] CUTR/T[T255] RPD The following main part program segment shows how the tool change sequence would be used: : #/ T255= 1 #/ D255= 0.5 #/ U255= 0.0025 #/ N255= 2 PPR/ (LOAD 1/2 DIA. 2-FLUTE END MILL) GET/ BANDIT.INC : #/ T255= 2 #/ D255= 0.25 #/ U255= 0.0015 #/ N255= 2 PPR/ (LOAD 1/4 DIA. 2-FLUTE END MILL) GET/ BANDIT.INC : Page 77 Transformations And Repetative Programming February 1, 1990 CAMS Part Programmer's Reference Manual STANDARD CUTTING SEQUENCES 8. STANDARD CUTTING SEQUENCES Certain macnining operations are sufficiently standard and repeated often enough to in the course of NC programming as to warrent development of special cutting algorithms. The cutting out of straight sided pockets is an excellent example of often repeated cutting operations with many variations. CAMS has the capability to automatically hog- out a pocket. Other standard cutting sequences may be added to CAMS from time to time as their utility and frequency of use become apparent. 8.1 POCKETING - THE POC/ STATEMENT The CAMS pocketing procedure can remove stock from an area bounded by up to twenty straight line sides. The straight line sides must form a convex polygon. That is to say, the internal angle between any two successive sides must always be less then 180 degrees. The parts programmer, by means of the POC/ statement, defines certain parameters used to calculate bottom coverage, rough cut stepovers, cutter offsets from the pocket sides, and feedrates. He also provides a list of pre-defined points which describe the vertices of the pocket polygon. The POC/ statement is... plane POC/re,c,fin,f1,f2,f3,type,i,j,k,d,point,...,point where: re The effective cutter radius for pocket bottom coverage testing. Note that a .75 diameter end mill with a .125 corner radius has a maximum value for re of .250. c An upper bound for the roughing cut step over for successive cutter paths around the pocket. The pocketing procedure may reduce the step over to maintain control of bottom coverage, but it will never exceed this programmed step over value. fin The programmed finish cut step over. The last cut around the pocket polygon will always remove this amount of material from the pocket sides. f1 The feed rate in inches/minute for the plunge cut into the pocket. f2 The feed rate in inches/minute for the rough cutting of the pocket area. Page 78 Standard Cutting Sequences February 1, 1990 CAMS Part Programmer's Reference Manual f3 The feed rate in inches/minute for the finish cut around of the pocket polygon. type The point type indicator. If type = 0 then the points specified in the pocket statement are the cutter center points of the finish cut around the pocket polygon. Any value for type other than zero indicates that the points specified in the POC/ statement are the vertices of the sides of the pocket. plane The symbolic name of a CAMS plane (the numeric i,j,k,d parameters of the plane equation) for the pocket bottom. A restriction on the pocketing procedure is that the tool axis vector and the normal vector to the pocket bottom plane must describe an angle greater than 12 degrees between them. point A minumum of three (3) to a maximum of twenty (20) points describing a convex polygon may be used. Depending on the value of "type," these are interpreted by CAMS as either the cutter center locations of the finish cut, or as the vertices of the pocket sides. Some programming considerations for pocketing should be noted... 1. Step over, both c and fin, are always measured in the plane of the pocket bottom. The parts programmer must determine adequate step over to maintain part tolerances when using ball end mills, radiused end mills, barrel shaped cutters, and when using canted pocket floor planes. 2. Unlike the point-to-point statements, a cutter must be defined in a CUTR/ statement prior to using the POC/ statement. This is necessary to allow the system to calculate the sequence of offsets from the pocket sides. 3. The points describing the pocket polygon need not be co-planar. The parts programmer should be aware that their projections onto the pocket floor plane, in a direction parallel to the tool axis are actually used for all pocket calculations. 8.2 HELICAL BORING - THE HLX/ STATEMENT To provide the means for controlled plunging and ramp cutting into confined volumes, the helical boring procedure has been developed and implemented into CAMS. In using the Page 79 Standard Cutting Sequences February 1, 1990 CAMS Part Programmer's Reference Manual HLX/ statement, the parts programmer provides the information necessary to compute the cutter offset bore diameter, bore depth, ramp angle, starting angular position, and the angular increment to be used to calculate the helical path. The HLX/ statement format is... HLX/,,,,, The radius of the cutter. By including this parameter, the user may define a fictitious cutter for the helical bore. The depth of the bore along the tool axis from the point at center of the circle. The tolerance used to compute incremental moves along the helical path. The starting angle, measured positive couterclockwise from a parallel to the positive X axis, for the helical path. The ramp angle, or helix angle, for the helical path. Either a symbol for a circle, or the definition of a circle. Care must be taken that the point at the center of the circle has the correct Z coordinate for beginning the helical bore sequence. Z should represent the surface of the part plus any clearance that may be required. The first move of a helical bore is to the defined point at circle center. Next is a move to the first point on the helical path, as specified by the angle. The helical path will ensue, followed by a full 360 degree cut around the bottom to clean out the bore. Page 80 Standard Cutting Sequences February 1, 1990 CAMS Part Programmer's Reference Manual APPENDIX A - VOCABULARY The complete CAMS vocabulary is shown in the following tables. Each entry shows the vocabulary word, its hexadecimal recognition code, the APT equivalent word (where appropriate), and a brief description of the word's usage. Not all the vocabulary is needed for a given installation. Many of the words are postprocessor words, and may not apply to your machine tools. Detailed descriptions of the usage of postprocessor vocabulary words will be found in the appropriate postprocessor manual. Vocabulary words may be added from time to time to support new machine tools and/or new CAMS functions. Those words with the "***" at the right margin are reserved words, and are not in use by CAMS at this time. *** MAJOR WORD TABLE *** PNT :00 POINT Definition LIN :01 LINE Definition CIR :02 CIRCLE Definition VEC :03 VECTOR Definition MAT :04 MATRIX Definition SPL :05 SPLINE Definition CNC :06 CONIC Definition *** PLN :07 PLANE Definition REF :08 REFSYS Define Modal Reference System TRA :09 TRACUT Define Modal Path Transformation CPY :0A COPY Specify Path Replication IDX :0B INDEX Path Replication Delimiter GTO :0C GOTO Specify Absolute Cutter Position GDL :0D GODLTA Specify Incremental Cutter Position FROM :0E FROM Specify Initial Cutter Position END :0F END Terminate Post Processing IFO :10 IFRO AUX Internal Feedrate Override OPS :11 OPSTOP AUX Optional Program Stop RPD :12 RAPID AUX One-shot Rapid Traverse Move RTR :13 RETRCT AUX Spindle Retract STP :14 STOP AUX Mandatory Program Stop AUX :15 AUXFUN AUX Machine Auxilliary Function (M) PRE :16 PREFUN AUX Machine Preparatory Function (G) GO :17 GO Specify Relative Motion Startup GLF :18 GOLFT Specify Relative Motion LEFT GRT :19 GORGT Specify Relative Motion RIGHT GFW :1A GOFWD Specify Relative Motion FORWARD GBK :1B GOBACK Specify Relative Motion BACKWARD POC :1C POCKET Specify Pocketing Path HLX :1D ---- Specify Helical Boring Motion SPN :1E SPINDL AUX Spindle Control CLN :1F COOLNT AUX Coolant Control TNO :20 TOOLNO AUX Machine Cutter Parameters Page 81 Appendix A - Vocabulary February 1, 1990 CAMS Part Programmer's Reference Manual # :21 ---- Scalar Definition PRT :22 PRINT Print Canonical Elements FIN :23 FINI Terminate CAMS PNO :24 PARTNO Program Identifier PPR :25 PPRINT Post Processor Comment MCH :26 MACHIN Specify Machine Post Processor FED :27 FEDRAT AUX Specify Cutting Feed Rate LDR :28 LEADER AUX Punched Tape Leader MCT :29 MCHTOL AUX Post Processor Path Tolerance SEQ :2A SEQNO AUX Tape Sequence Number TLF :2B TLLFT Tool Motion Condition LEFT TRG :2C RIGHT Tool Motion Condition RIGHT TON :2D TLON Tool Motion Condition ON CUTR :2E CUTTER Specify Cutter Calculation Parameters PS :2F PSIS Specify Part Surface OFST :30 OFFSET Tool Position Offset *** IDV :31 INDIRV In Direction Vector IDP :32 INDIRP In Direction Point PCH :33 PUNCH *** ARC :34 ---- Specify Arc Motion CYL :35 CYLNDR Define A Right Circular Cylinder DWL :36 DWELL AUX Machine Time Delay LTL :37 LOADTL AUX Load Cutting Tool CYC :38 CYCLE AUX Calculated Or Machine Cycle JIG :39 ---- AUX Accurate Position Approach OBT :3A OBTAIN Obtain Values From Canonical Form CLP :3B CLPRNT Print Cutter Location File PAT :3C PATERN Define Point Pattern PLT :3D PLOT Plot Cutter Location File REM :3E REMARK Program Listing Remark INS :3F INSERT Direct Insert Of Machine Control Data CCO :40 CUTCOM Cutter Compensation RTB :41 ROTABL Rotate Machine Table TMK :42 TMARK Tape Mark TLO :43 ---- Tool Offset BMILL :44 ---- Boundary Milling *** THK :45 THICK Stock Allowance GET :46 ---- File Inclusion *** MINOR WORD TABLE *** XL :00 XLARGE Directional Modifior XS :01 XSMALL Directional Modifior YL :02 YLARGE Directional Modifior YS :03 YSMALL Directional Modifior ZL :04 ZLARGE Directional Modifior ZS :05 ZSMALL Directional Modifior IO :06 INTOF Intersection Of TGT :07 TANTO Tangency Indicator CTR :08 CENTER RGT :09 RIGHT Directional Modifior LFT :0A LEFT Directional Modifior ANG :0B ATANGL Angular Modifior Page 82 Appendix A - Vocabulary February 1, 1990 CAMS Part Programmer's Reference Manual PERP :0C PERPTO Perpendicularity Indicator PARL :0D PARLEL Parallel Indicator RAD :0E RADIUS TRN :0F TRANSL Translation Indicator ROT :10 ROTABL Rotate Table UNIT :11 UNIT DOT :12 DOTF Vector Dot Product XYR :13 XYROT X-Y Rotation YZR :14 YZROT Y-Z Rotation ZXR :15 ZXROT Z-X Rotation SCL :16 SCALE Scale Factor ALL :17 ALL LGE :18 LARGE Largest Item Indicator SMA :19 SMALL Smallest Item Indicator INV :1A INVERS Inversion Operator PL3 :1B ---- 3-Plane Format PT3 :1C ---- 3-Point Format OFF :1D OFF ON :1E ON TO :1F TO CLW :20 CLW Clockwise CCW :21 CCW Counterclockwise PAST :22 PAST CROS :23 CROSS Vector Cross Product ADD :24 PLUS Vector Addition Operator SUB :25 MINUS Vector Subtraction Operator MPY :26 TIMES Vector Multiplication Operator IN :27 IN OUT :28 OUT PEK :29 ---- Peck Drill Cycle DRL :2A DRILL Drill Cycle TAP :2B TAP Tap Cycle BOR :2C BORE Boring Cycle IPM :2D IPM Inches Per Minute IPR :2E IPR Inches Per Revolution CSS :2F RPM :30 RPM Revolutions Per Minute CRC :31 CIRCUL Circular Interpolation VCR :32 Vector CBOR :33 CBORE Counterbore DRAG :34 DRAG Cycle Bore Dragout OFS :35 Offset REV :36 Revolutions RET :37 Cycle Retract DLY :38 DELAY Cycle Dwell UP :39 UP DWN :3A DOWN SPS :3B STOPS Spindle Stop HI :3C HIGH LO :3D LOW PCH :3E PCH Punch CLAMP :3F CLAMP GRID :40 GRID CAN :41 CANON Canonical Replacement Page 83 Appendix A - Vocabulary February 1, 1990 CAMS Part Programmer's Reference Manual *** SCIENTIFIC FUNCTION TABLE *** ABS :00 ABSF Absolute Value SQR :01 SQRTF Square Root SIN :02 SINF Sine COS :03 COSF Cosine ATN :04 ATANF Arctangent EXP :05 EXPF Exponential LGD :06 Base 10 Logarithm LOG :07 Natural Logarithm INT :08 Greatest Integer SGN :09 Sign MOD :0A Remainder MIN :0B Minimum MAX :0C Maximum Page 84 Appendix A - Vocabulary February 1, 1990 CAMS Part Programmer's Reference Manual APPENDIX B - SAMPLE PROGRAM This appendix contains a sample part program illustrating CAMS part programming techniques. It should be noted that this example does not show the only "right" way to program the part. Just one of the many ways. The CAMS language is sufficiently rich to adapt to most machining techniques. The "THINGAMAJIG" was selected in order to illustrate how the contour machining techniques may be used. A statement by statement account of the sample program follows the listed output. Page 85 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual ======================================== C A M S Section 1 Version 3, Mod 00 Copyright 1987 by Computer Geometry Co. All Rights Reserved ======================================== Date: 07-Dec-87 Source File: THINGMJ.NC 1 PNO/ CAMS TEST CASE #1 - THINGAMAJIG - 12/17/86 2 #/S0=185 3 #/R1=.25 4 #/Z1=.625+.25 5 #/Z2=-.05 6 #/Y0=1.725-.4+2 7 #/X0=3 8 PLN/Q1=0,0,1,Z2 9 LIN/L1=0,-Y0,1,-Y0 10 LIN/L2=-X0,0,-X0,1 11 LIN/L3=-X0,2-Y0,COS(15)-X0,SIN(15)+2-Y0 12 LIN/L4=PARL,L1,YL,1.725 13 LIN/L5=PARL,L2,XL,6 14 CIR/C1=0,0,2 15 REM/ ** COMPUTE SPINDLE RPM (S1) SUCH THAT 100 <= S1 <= 4000 16 #/S1=MAX(100:MIN(4000:(S0*12/(3.1416*R1*2)))) 17 REM/ ** COMPUTE FEEDRATE; .004 PER EDGE FOR 2 FLUTE CUTTER 18 #/F1=.004*S1*2 19 PRT/S1,F1 S1 2104 1413.29300 F1 2104 11.30634 20 FROM/P255=-(X0+1),-(Y0+1.125),Z1 21 FED/F1 22 CUTR/2*R1 23 RPD 24 PS/Q1 25 GO/TO,L2,TO,L1 26 GO/PAST,L3,TO,L2 27 GO/PAST,C1,TO,L3 28 REM/ *** GEOMETRY TO COMPUTE ARC END ANGLE USING A CIRCLE 29 CIR/C100=YL,L4,XL,IN,C1,R1 30 ARC/.003,CCW,CTR,C100,IN,C1 31 GO/PAST,L5,TO,L4 32 GO/PAST,L1,TO,L5 33 GO/PAST,L2,TO,L1 34 RPD 35 GTO/P255 36 PRT/ALL Page 86 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual S0 2104 185.00000 R1 2104 .25000 Z1 2104 .87500 Z2 2104 -.05000 Y0 2104 3.32500 X0 2104 3.00000 Q1 010A .00000 .00000 1.00000 -.05000 L1 010A .00000 -1.00000 .00000 3.32500 L2 010A 1.00000 .00000 .00000 -3.00000 L3 010A .25882 -.96593 .00000 .50339 L4 010A .00000 -1.00000 .00000 1.60000 L5 010A 1.00000 .00000 .00000 3.00000 C1 0210 .00000 .00000 .00000 .00000 .00000 1.00000 2.00000 S1 2104 1413.29300 F1 2104 11.30634 P255 0008 -4.00000 -4.45000 .87500 C100 0210 1.11355 -1.35000 .00000 .00000 .00000 1.00000 .25000 37 FIN **** 0 ERRORS **** 0 ======================================== C A M S Section 2 Version 3, Modification 00 Copyright 1987 by Computer Geometry Co. All Rights Reserved ======================================== Date: 07-Dec-87 CL Data File: THINGMJ.CLF 1 1 PNO/ CAMS TEST CASE #1 - THINGAMAJIG - 12/17/86 2 20 FROM/ -4.00000 -4.45000 .87500 3 21 FED/ 11.30634 4 23 RPD/ 5 25 GTO/ -3.25000 -3.57500 -.05000 6 26 GTO/ -3.25000 -1.13317 -.05000 7 27 GTO/ -1.60697 -.69292 -.05000 8 30 ARC/ .00000 .00000 .00000 .00000 .00000 1.00000 1.75000 9 30 GTO/ -1.60697 -.69292 -.05000 -1.51612 -.87401 -.05000 -1.40494 -1.04338 -.05000 -1.27493 -1.19877 -.05000 -1.12784 -1.33809 -.05000 -.96562 -1.45948 -.05000 -.79047 -1.56130 -.05000 -.60472 -1.64220 -.05000 Page 87 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual -.41086 -1.70109 -.05000 -.21150 -1.73717 -.05000 -.00930 -1.74998 -.05000 .19302 -1.73932 -.05000 .39276 -1.70536 -.05000 .58723 -1.64853 -.05000 .77383 -1.56961 -.05000 .95006 -1.46966 -.05000 1.11355 -1.35000 -.05000 10 31 GTO/ 3.25000 -1.35000 -.05000 11 32 GTO/ 3.25000 -3.57500 -.05000 12 33 GTO/ -3.25000 -3.57500 -.05000 13 34 RPD/ 14 35 GTO/ -4.00000 -4.45000 .87500 15 37 FIN/ **** 0 ERRORS **** 0 What follows is a statement-by-statement account of the THINGAMAJIG part program and its CAMS1 output... 1 PNO/ CAMS TEST CASE #1 - THINGAMAJIG - 12/17/86 Establishes identifying information about the program and instructs the postprocessor to create an identifying leader for the machine control tape. 2 #/S0=185 The value 185 is assigned to the symbol S0. 185 is the cutting speed chosen in surface feet/minute. Assigning surface speed to a variable at the beginning of the part program, subsequently using it to calculate spindle RPM, is good programming technique. It allows all the feeds and speeds of the part program to be automatically altered by the simple expedient of changing this statement. 3 #/R1=.25 The value .25 is assigned to the symbol R1. .25 is the cutter radius used in the contour operation. Assigning a symbol to this value, then using the symbol in all subsequent statements, permits the cutter radius to be changed by altering only this one statement. 4 #/Z1=.625+.25 Establishes the machine orientation point Z coordinate as .875. Notice that the part programmer used only blueprint dimensions and left the calculation for the computer. This makes checking and engineering changes much easier to Page 88 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual incorporate into the part program. 5 #/Z2=-.05 Establishes the Z coordinate for depth of cut as .05 below the locating surface (Z=0) of the part. 6 #/Y0=1.725-.4+2 Establishes the dimension from the 2.000 radius arc center to the lower edge of the part. 7 #/X0=3 Establishes the dimension from the 2.000 radius arc center to the left edge of the part. 8 PLN/Q1=0,0,1,Z2 Defines a plane at Z=Z2. This plane will later be used as a part surface in contour machining operations. 9 LIN/L1=0,-Y0,1,-Y0 Defines the line representing the bottom edge of the part. 10 LIN/L2=-X0,0,-X0,1 Defines the line representing the left edge of the part. 11 LIN/L3=-X0,2-Y0,COS(15)-X0,SIN(15)+2-Y0 Defines the 15 degree angle line at the top edge of the part. 12 LIN/L4=PARL,L1,YL,1.725 Defines the horizontal line at the top edge of the part. 13 LIN/L5=PARL,L2,XL,6 Defines the vertical line at the right edge of the part. 14 CIR/C1=0,0,2 Defines the circle representing the 2.000 radius at the top of the part. 15 REM/ ** COMPUTE SPINDLE RPM (S1) SUCH THAT 100 <= S1 <= 4000 A comment used to describe the next calculation. 16 #/S1=MAX(100:MIN(4000:(S0*12/(3.1416*R1*2)))) The computation of spindle speed from surface speed, using Page 89 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual the radius of the cutter. Note the use of the MAX and MIN functions to guarantee that the resulting spindle speed is within the machine tool's range (100 <= spindle speed <= 4000). This is good programming practice, since the next computation will be for feedrate, and it will need the actual spindle speed to be effective. 17 REM/ *** COMPUTE FEEDRATE; .004 PER EDGE FOR 2 FLUTE CUTTER A comment used to describe the next calculation. 18 #/F1=.004*S1*2 Establishes the symbol F1 as containing the calculated feedrate for the part program. 19 PRT/S1,F1 Prints the calculated spindle speed and feedrate at the point in the program at which they are calculated. This is good for debugging purposes, later. 20 FROM/P255=-(X0+1),-(Y0+1.125),Z1 Initializes motion for both CAMS and the machine postprocessor. Establishes the pick-up point for the part program. On an incremental machine, for example, the operator would have had to manually set the machine at the specified position before start-up. 21 FED/F1 Establishes F1 as the feedrate for subsequent motion statements. 22 CUTR/2*R1 Define the cutter to be 2*R1 (.500) in diameter. This value is used on all subsequent contouring motion statements. 23 RPD Over-rides the established feedrate on a one-shot basis, and establishes the feed rate for the next motion statement at maximum, or rapid traverse, for the machine tool. 24 PS/Q1 Establishes the part surface plane as Q1 for subsequent contouring motion. 25 GO/TO,L2,TO,L1 From the initial position (line 20, above), compute a cutter Page 90 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual offset position that is in contact with both L2 and L1 on the respective side nearest to the present cutter location. 26 GO/PAST,L3,TO,L2 From the most recent cutter location, compute a cutter offset position that is in contact with L3 on the far side, and in contact with L2 on the near side. 27 GO/PAST,C1,TO,L3 From the most recent cutter location, compute a cutter offset position that is in contact with C1 on the far side, and in contact with L3 on the near side. 28 REM/ *** GEOMETRY TO COMPUTE ARC END ANGLE USING A CIRCLE 29 CIR/C100=YL,L4,XL,IN,C1,R1 Define a construction circle, equivalent to a cross section of the cutter, that is in contact with circle C1 at the desired end angle of the upcoming ARC/ statement. 30 ARC/.003,CCW,CTR,C100,IN,C1 Contour an arc, using a .003 tolerance for linear interpolation, to be traversed in a counterclockwise direction, beginning at the present position of the cutter (CTR), ending at an angle coincident with the center of C100, and traversing inside of circle C1. 31 GO/PAST,L5,TO,L4 From the most recent cutter location, compute a cutter offset position that is in contact with L5 on the far side, and in contact with L4 on the near side. 32 GO/PAST,L1,TO,L5 From the most recent cutter location, compute a cutter offset position that is in contact with L1 on the far side, and in contact with L5 on the near side. 33 GO/PAST,L2,TO,L1 From the most recent cutter location, compute a cutter offset position that is in contact with L2 on the far side, and in contact with L1 on the near side. 34 RPD 35 GTO/P255 Return to the coordinate position of the "FROM" point at rapid traverse feed rate. 36 PRT/ALL Page 91 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual Print all canonical forms computed in the part program. 37 FIN Terminate the CAMS part program. We're done! (With CAMS1.) The CAMS2 output listing contains a substantial amount of diagnostic information for the experienced user. Each record begins with its unique and sequential CL record number at the left margin. The number second from the left is the CAMS1 statement sequence number. It is used to correlate the CL record with the source statement that produced it. You may note that some CAMS source statements are capable of generating more than one CL record. Finally, a representation of the CL record data is reproduced in a man-readable form. Notice that there are several classes of CL record. Some (e.g. 1, 2, and 4) simply carry forward their data for later use by the postprocessor. (In the case of CL record number 4, the feedrate computation has been resolved into a number.) Others, e.g. 2, 5, and 6) are resolved into point-to-point cutter motion. Still others, e.g. 8 and 9, are linked records which completely specify a motion ARC. Record 8 specifies the circle on which the arc is measured, and record 9 contains all the linear moves necessary to cut the arc in linear interpolation while maintaining the specified tolerance (0.003 as seen in statement number 30) Page 92 Appendix B - Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual APPENDIX C - GENERAL CONTOURING SAMPLE PROGRAM This appendix contains a sample part program illustrating the CAMS general contouring techniques. It should be noted that this example does not show the only "right" way to program the part. Just one of the many ways. The CAMS language is sufficiently rich to adapt to most machining techniques. To show the different programming techniques used, the "THINGAMAJIG" example from Appendix B is shown re-programmed here. This will provide you with an illustration of how the general contour machining techniques may be used. The resulting cutter location file is not exactly the same as, but is equivalent to, that of Appendix B. Those statements that differ from the example in Appendix B are described in detail following the listed output. ======================================== C A M S Section 1 Version 3, Mod 00 Copyright 1987 by Computer Geometry Co. All Rights Reserved ======================================== Date: 03-May-88 Source File: THINGMJ.NC 1 PNO/ CAMS GENERAL CONTOURING TEST CASE #1 - THINGAMAJIG 3 #/S0=185 4 #/R1=.25 5 #/Z1=.625+.25 6 #/Z2=-.05 7 #/Y0=1.725-.4+2 8 #/X0=3 9 PLN/Q1=0,0,1,Z2 10 LIN/L1=0,-Y0,1,-Y0 11 LIN/L2=-X0,0,-X0,1 12 LIN/L3=-X0,2-Y0,COS(15)-X0,SIN(15)+2-Y0 13 LIN/L4=PARL,L1,YL,1.725 14 LIN/L5=PARL,L2,XL,6 15 CIR/C1=0,0,2 16 REM/ ** COMPUTE SPINDLE RPM (S1) SUCH THAT 100 <= S1 <= 4000 17 #/S1=MAX(100:MIN(4000:(S0*12/(3.1416*R1*2)))) 18 REM/ ** COMPUTE FEEDRATE; .004 PER EDGE FOR 2 FLUTE CUTTER 19 #/F1=.004*S1*2 20 PRT/S1,F1 Page 93 Appendix C - General Contouring Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual S1 2104 1413.29300 F1 2104 11.30634 21 FROM/P255=-(X0+1),-(Y0+1.125),Z1 22 FED/F1 23 CUTR/2*R1 24 RPD 25 PS/Q1 26 GO/TO,L2,TO,L1 27 TLF 28 GLF/L2,PAST,L3 29 GRT/L3,PAST,C1 30 GRT/C1,ON,L4 31 IDV/0,1,0 32 GRT/C1,PAST,L4 33 GRT/L4,PAST,L5 34 GRT/L5,PAST,L1 35 GRT/L1,PAST,L2 36 RPD 37 GTO/P255 38 PRT/ALL M1 041A 1.00000 .00000 .00000 .37500 .00000 1.00000 .00000 2.22500 .00000 .00000 1.00000 -.41250 S0 2104 185.00000 R1 2104 .25000 Z1 2104 .87500 Z2 2104 -.05000 Y0 2104 3.32500 X0 2104 3.00000 Q1 010A .00000 .00000 1.00000 -.05000 L1 010A .00000 -1.00000 .00000 3.32500 L2 010A 1.00000 .00000 .00000 -3.00000 L3 010A .25882 -.96593 .00000 .50339 L4 010A .00000 -1.00000 .00000 1.60000 L5 010A 1.00000 .00000 .00000 3.00000 C1 0210 .00000 .00000 .00000 .00000 .00000 1.00000 2.00000 S1 2104 1413.29300 F1 2104 11.30634 P255 0008 -4.00000 -4.45000 .87500 39 FIN **** 0 ERRORS **** Return code 0 Page 94 Appendix C - General Contouring Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual ======================================== C A M S Section 2 Version 3, Modification 00 Copyright 1987 by Computer Geometry Co. All Rights Reserved ======================================== Date: 03-May-88 CL Data File: THINGMJ.CLF 1 1 PNO/ CAMS GENERAL CONTOURING TEST CASE #1 - THINGAMAJIG 2 21 FROM/ -4.00000 -4.45000 .87500 3 22 FED/ 11.30634 4 24 RPD/ 5 26 GTO/ -3.25000 -3.57500 -.05000 6 28 GTO/ -3.25000 -1.13317 -.05000 7 29 GTO/ -1.60697 -.69292 -.05000 8 30 ARC/ .00000 .00000 .00000 .00000 .00000 1.00000 1.75000 9 30 GTO/ -1.60697 -.69292 -.05000 -1.55628 -.80032 -.05000 -1.49841 -.90402 -.05000 -1.43365 -1.00357 -.05000 -1.36228 -1.09850 -.05000 -1.28464 -1.18836 -.05000 -1.20108 -1.27275 -.05000 -1.11199 -1.35128 -.05000 -1.01778 -1.42359 -.05000 -.91889 -1.48934 -.05000 -.81576 -1.54824 -.05000 -.70887 -1.60000 -.05000 10 32 ARC/ .00000 .00000 .00000 .00000 .00000 1.00000 1.75000 11 32 GTO/ -.70887 -1.60000 -.05000 -.59659 -1.64517 -.05000 -.48145 -1.68247 -.05000 -.36401 -1.71172 -.05000 -.24483 -1.73279 -.05000 -.12448 -1.74557 -.05000 -.00353 -1.75000 -.05000 .11743 -1.74606 -.05000 .23784 -1.73376 -.05000 .35710 -1.71318 -.05000 .47466 -1.68440 -.05000 .58994 -1.64756 -.05000 .70241 -1.60285 -.05000 .81151 -1.55047 -.05000 .91674 -1.49067 -.05000 1.01758 -1.42374 -.05000 1.11355 -1.35000 -.05000 12 33 GTO/ 3.25000 -1.35000 -.05000 13 34 GTO/ 3.25000 -3.57500 -.05000 Page 95 Appendix C - General Contouring Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual 14 35 GTO/ -3.25000 -3.57500 -.05000 15 36 RPD/ 16 37 GTO/ -4.00000 -4.45000 .87500 17 39 FIN/ **** 0 ERRORS **** Return code 0 What follows is a statement-by-statement account of the THINGAMAJIG part program statements that differ from the sample program in Appendix B... : : 27 TLF For the upcoming motion sequence, the tool will remain on the left side of each drive surface during the drive. 28 GLF/L2,PAST,L3 Based on the last preceeding motion, the tool is to go to the left along the drive surface (L2) untill it moves PAST the check surface (L3). 29 GRT/L3,PAST,C1 Based on the last preceeding motion, the tool is to go to the right along the new drive surface (L3) untill it moves PAST the check surface (C1). Notice that the new drive surface was the check surface for the preceeding motion. This is a common pattern. 30 GRT/C1,ON,L4 Based on the last preceeding motion, the tool is to go to the right along the new drive surface (L3) untill it moves PAST the check surface (C1). Our objective for the C1 drive surface is to eventually go PAST L4. However, the cutter will not fit into the space between L4 and C1, so we will first go ON L4, then continue the motion in the next motion statement. 31 IDV/0,1,0 Since we are now ON the line L4, there are two possibilities for a PAST condition for L4. We must set up a forward motion sense for going PAST L4. This is best accomplished by defining the forward direction for the next move with a vector. In this case, the vector pointing straight up will give us a PAST condition. Page 96 Appendix C - General Contouring Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual 32 GRT/C1,PAST,L4 Based on the last preceeding motion, the tool is to go to the right along the continuing drive surface (C1) untill it moves PAST the check surface (L4). 33 GRT/L4,PAST,L5 Based on the last preceeding motion, the tool is to go to the right along the new drive surface (L4) untill it moves PAST the check surface (L5). 34 GRT/L5,PAST,L1 Based on the last preceeding motion, the tool is to go to the right along the new drive surface (L5) untill it moves PAST the check surface (L1). 35 GRT/L1,PAST,L2 Based on the last preceeding motion, the tool is to go to the right along the new drive surface (L1) untill it moves PAST the check surface (L2). : : We're done! (Showing the differences in the part programs.) A quick examination of the CAMS2 output will demonstrate the equivalence of the two methods in terms of the generated tool paths. The general contouring method is the preferred method for several reasons. Since no additional geometry needs to be calculated in order to control the arc contour, less effort is needed on the part of the parts programmer. In addition, the generated tool path automatically accounts for the tool radius offsets. Dimensional engineering changes in the shape of the part will have little or no effect on the motion statements. The proper path will automatically be calculated despite the change. Page 97 Appendix C - General Contouring Sample Program February 1, 1990 CAMS Part Programmer's Reference Manual APPENDIX D - POSTPROCESSORS Postprocessing is the final computer operation in the CAMS system. The postprocessor is yet another computer program that converts the machine-independent tool path and auxilliary function records in the CL data file (as calculated by CAMS2) into the machine-specific control instructions necessary to cut out the workpiece. Cut vectors (i.e. motion command records in the CL file) together with feedrates are utilized to establish the axial motions, accelerations and velocities within the capability of the machine tool. Where necessary (usually on older NC machines), accelerations and decelerations are calculated to avoid overshoot and/or undershoot of the axes, thereby avoiding part and machine damage. Since each machine control system has its own language and characteristics, it is necessary to treat seperately that portion of the CAMS vocabulary which directly refers to the machine control system. Therefore, the machine postprocessor has a seperate manual. Furthermore, each class of machine postprocessor frequently uses the vocabulary in different ways. Because of the wide diversity of machine tool / controller combinations, postprocessing of CL data usually requires a unique program to prepare the necessary machine control data. Indeed, one of the most difficult aspects of setting up a computer aided NC system in your shop may be the specification and obtaining of the appropriate machine postprocessors, regardless of the NC programming system you select. This diversity of machines/controller combinations makes the preparation of a library of postprocessors an order of magnitude larger task than the development of an NC programming system. In other words, THIS IS WHERE ALL THE PRODUCT DEVELOPMENT WORK IS. A class of postprocessors designed to alleviate these problems has been developed in recent years. These are called the G-POSTs (for Generalized POSTprocessor). Indeed, some of the G-POSTs are capable of supporting a good variety of machine tool controllers. In general, they tend to be very large, complex beasts as compared to the smaller "custom" postprocessors. Both their output and their operation tend to be less efficient than that of a "custom" postprocessor for a given machine/controller combination. Nevertheless, in those shops that have a large number of diverse machines and controllers, they have proven their worth. It is expected that the average user of CAMS only has a small handfull of NC machines in its shop inventory. For this situation, the "custom" postprocessor is most likely to be the most effective and least costly solution to the dilemma. Page 98 Appendix D - Postprocessors February 1, 1990 CAMS Part Programmer's Reference Manual COMPUTER GEOMETY'S POSTPROCESSOR POLICY Computer Geometry regards postprocessor development as a major segment of our business. It is our policy to apply our best efforts to providing high quality, low cost postprocessing capability to all of the CAMS users that request it. If a postprocessor is not currently available for a registered user's need, we will bend every effort to prepare one in a timely and cost-effective manner. As a registered user with a need, however, you must recognize that you have a responsibility to provide the necessary data, manuals, and acceptance testing necessary to produce a good postprocessor. This team approach is necessary to preparing the best possible NC programming system for your machine shop. Please read the README.1ST file on your distribution diskette for a list of the machine postprocessors already available. Page 99 Appendix D - Postprocessors February 1, 1990 CAMS Part Programmer's Reference Manual APPENDIX E - GLOSSARY alphanumeric code: Code using numbers, letters, and special characters. APT: (Automatic Programmed Tool) A numerical control programming language. auxiliary function: Numerical control function other than those that control cutter motion (e.g., starting and stopping a spindle). batch processing: Automatic sequential execution of computer programs, controlled by the facilities and dynamic demands of the computer system. BCD: (Binary Coded Decimal) A character representation code, now obsolete. channel: The path in punch tape along which holes are punched, also known as tracks or levels. Standard NC tape has eight channels. CL data: (Cutter location data) The coordinate locations of the cutter centerline motion as it moves to machine the part. CL file: (Center location file) A data set containing CL data. CL path: (Cutter location path) The path taken by the center of the cutter. CL print: (Center location print) A printout of the CL file data. CL tape: (Cutter location tape) The tape that contains CL file data. CNC: Computer Numerical Control. column binary: The binary representation of character punches as represented in columns on a punched card image. As used in this manual, each row of the punched card image represents a channel on a punched tape. Page 100 Appendix E - Glossary February 1, 1990 CAMS Part Programmer's Reference Manual dataset: The major unit of data storage and retrieval in the operating system consisting of a collection of data. DNC: Direct Numerical Control or Distributed Numerical Control. EBCDIC: (Extended Binary Coded Decimal for Interchange Code) A character representation code still in extensive use. FROM point: The initializing position for CAMS' cutter path generator. Many postprocessors require a FROM point before generating machine motion commands. INDEX number: Number used to mark the beginning and end of a part program segment that is to be copied. interface: The communication between two separate elements, as between machine control unit and machine tool. level: See CHANNEL. major word: The CAMS vocabulary word that immediately preceeds the slash (/) in a statement. minor word: The CAMS vocabulary word(s) that appear in a statement following the slash (/). NC: Numerical Control. NC data: NC part program data. Part program: A complete set of machine control data used for manufacturing a part on an NC machine. POST: To post process an NC part program. post processing: Transforming the format of a data file (CL FILE) output by a processor into machine motion commands using the proper format required by a particular machine control unit/machine tool combination. Page 101 Appendix E - Glossary February 1, 1990 CAMS Part Programmer's Reference Manual post processor: A computer program that takes a generalized or centerline output and adapts it to the particular machine control unit/machine. processor: A computer program that performs the compiling, assembling, translating, and related functions for a specific programming language. record: A general term for any unit of data that is distinct from all others when considered in a particular context. spline: The term used for a free-form curve generated thru a defining sequence of coordinate data (points). The term originates from the long, thin wooden beam used by draftsmen to draw curved lines. tool centerline data: The centerline of the cutter path of a cutting tool at the tip end (see CL FILE and CL DATA). The absolute position of the machine tool at the cutter centroid. track: (See CHANNEL.) volume: Storage media such as tape reels, disk packs, and drums. Page 102 Appendix E - Glossary  (see CL FILE and CL DATA). The absolute position of the machine tool at the cutter centroid. track: (See CHANNEL.) v