POST is the post processor program that creates the N/C code for machining the part on a turning machine. The two data files necessary for the POST to do this are the geometry file ( GEO.CAM) and the source file (SOURCE.CAM). The geometry file holds all of the geometry defined in CAM including points, lines, circles, rectangles, slots, and shapes. This data should represent all necessary part geometry needed to machine the part. Once the programmer has defined the geometry, he/she must run SOURCE by typing " SOURCE". The editor then allows the user to enter the instructions which will be interpreted by POST in order to create the N/C code.
There is a machine definition file for each machine supported by this system. The post processor is executed automatically by the source editor (SOURCE) when the RUN-POST function is executed. At that point, the editor reads a file named MACH.CAM to determine what post program to run (MILL, LATHE, PUNCH, EDM), and which machine definition file to use. To run POST, the name of that machine must be included in the first line of source code. This line should also have a brief description of the part such as part number and operation number. This first line must be a comment which is designated by the " (" character at the beginning of the line.
As with the geometry program, numeric expressions can be imbedded in the source code and will be evaluated at run time (when POST is called). The post processor is a source code compiler and is not designed to be interactive. However, there are a number of simple one keystroke commands that can be given during the execution of POST.
The display created by the post processor is a two window listing of the code conversion. The source code is listed on the left, and the resulting tape is displayed in the right hand window. Each line in the source is highlighted as it is executed, showing the code it creates in the right hand window. This format allows the programmer to easily determine what code is being generated by each instruction, as well as which lines in the SOURCE are executed and in what order. In general more code will be created by the system than will be written by the programmer.
CTRL-C is a one keystroke command that will return program execution back to the source editor. This allows the programmer to return to the editor to make changes to the source code if he/she notices a mistake in the source code without having to wait for POST to interpret all of the instructions in the source code.
CTRL-S and CTRL-Q are two keystrokes that will suspend program execution for the code being generated by the system to be examined by the programmer in relation to the instructions given.
There are many different operating modes for the post processor. The modal commands are used to turn on and off these modes. Some of the modes are not fully supported by some machines and settings of these modes will have no effect on the code generated for these machines. The modalcommands are:
There are many different operating modes for the post processor. The modal commands are used to turn on and off these modes. Some of the modes are not fully supported by some machines and settings of these modes will have no effect on the code generated for these machines.
The modal commands are:
"TRIM ON" and "TRIM OFF" - used to turn on and off the automatic trim function that eliminates code redundancy.
"COMP ON" and "COMP OFF" - used to turn on and off the automatic generation of cutter comp moves in machining instructions.
"COOL ON" and "COOL OFF" - used to turn on and off the automatic generation of machine codes associated with coolant (M8/M9)
Different values used by the post processor can be changed using modal commands. These commands consist of the naming of those values followed by a colon ":" and a numeric expression evaluating to the desired value:
OFFSET: nn - tells POST what amount to use for the tool radius in its calculation of the tool offset.default value=tool radius
CLEARANCE:nn - tells POST what clearance distance to use for entering and exiting a cut. default value=.05
ROUGH:nn - tells POST what amount to be left on roughing cuts. default value=.03
PASS_WIDTH:nn - tells POST what distance to use when making a multiple pass cut. default value=.062
Comments can be imbedded in the source code for the programmers and/or machine operators convenience. These comment lines must begin with "(" or "{" characters. Comments beginning with "(" will be included just as they appear, in the N/C code generated by this system. Comments beginning with "{" will not be included in the N/C code.
The cutting spindle speeds and feed rates will automatically be calculated by the program using information stored in a file called "MATL.CAM". This file contains a list of material descriptions and the associated cutting speeds and feed rates to be used for that material along with other information about how to set parameters for cutting that material. The data in this file can be altered by running the MATERIAL program. This program will ask the user for the required information and store that information in the " MATL.CAM" file. This information can be viewed by using the standard MS-DOS " TYPE" command, or listed on the printer using the MS-DOS "PRINT" command.
Both the values used from this file and the values calculated for spindle speeds and feed rates can be changed using simple commands. The speeds and feeds can directly be overridden by using the manual codes Snn and Fnn in the source code. The commands for changing the material cutting parameters are:
SFM:nn - designates the surface feet per minute.
Geometry files can be read and re-read using the " READ" and " RESTORE" commands. these commands read in geometry data files created by CAM to be used by the POST for creating the N/C code. The "READ" command is used to read a geometry file. Unlike the same command in CAM, the "READ" command in POST will simply read the file and not append it to the geometry that has already been read in. The restore command is used to read the last file read in. This has the effect of restoring any geometry that has been modified by POST. The reasons for these commands will become apparent to the user who programs POST using the structured programming elements discussed later.
The MOVE, INV, and ROT commands used in CAM can also be used inside of POST. These commands make it possible to machine extremely complex parts with similar elements as well as three dimensional parts. The only restriction to these commands in POST as opposed to CAM is that the " 'N" parameter cannot be used. This is because the programmability of POST allows extremely complex parts to be programmed without the need for extensive geometry data. When used inside of a LOOP with variables, these commands can be very powerful.
A tool list can appear at the beginning of the program. This tool list must be included in comments (either "(" or "{"). The tool list consists of a listing of tool numbers and their descriptions. The tool list for one tool has the following syntax:
( TOOLn = TURNING TOOL Rnn )
( TOOLn = nn DRILL )
( TOOLn = BORING TOOL Rnn )
( TOOLn = THREADING TOOL Rnn )
( TOOLn = GROOVING TOOL )
The tool description string will be used to determine the type of tool ( "TURNING TOOL", "BORING TOOL", " THREADING TOOL" ) used and will effect the spindle speed and feed rate generated at the tool change. The value after the "R" character is taken as being the tool radius. The tool descriptions above will be recognized by the system, and the tool path will be calculated according to the tool radius unless the tool is a drill or grooving tool. Other descriptive terms can be used in the tool description to make tool identification easier.
The tool change command is the most complex command in POST. This command causes any code for the tool change sequence to be generated. This can include recalculation of speeds and feeds based on the new tool geometry and type, code for handling coolant, and cancelation of any machine modes in effect that would prevent the tool change sequence from taking place.
The "TOOL" command has the following syntax:
TOOLn FnSn {'S} {CCW/CW}
At the tool change, POST will recalculate the default spindle speed, feed rate, and tool radius offset. These values will depend on the last values for SFM, FTOOTH, and the tool description for that tool that was read from the tool list at the beginning of the program source. The values for spindle speed and feed rate can be overridden in the "TOOL" command using the "S" and " F" parameters. Tool offsets can only be overridden in a line after the tool change is commanded.
"'S" can also be commanded in the tool change command. If " 'S" is used, POST will insert a program stop at the tool change. This allows the programmer to have the machine operator rotate parts, take measurements, or do any other setup operations without the need to insert manual codes if the program stop is to take place at the tool change.
Finally, the tool direction can be commanded as " CW" or " CCW". A default value is taken if neither of these are specified. That value depends on the particular N/C machine being programmed.
The "DRILL" command is used to drill a hole at X0 to a Z dimension. Drilling, positions at X0 and generates the proper code or canned cycles depending on the N/C machine being programmed. The rapid levels and Z dimension of drilling can be changed using the " R" and " Z" parameters respectively. If the " Z" parameter is left out, then the last commanded " Z" is used. If the " R" parameter if left out then a default value is used depending on the machine being programmed. The " DRILL" command syntax is:
DRILL Rnn ZnnFnn
The "TURN DIA" command allows the programmer to turn a part to the specified diameter with a Z start and stop dimension. If the first Z is left out, then the first Z is taken as Z0. The programmer can specify any number of passes which can be set using the " PASS WIDTH:" command. The syntax of the "TURN DIA" command is as follows:
TURN_DIA:nn ZnnZnn
The "FACE" command allows the programmer to face off a part to a specified diameter(s) with an X start and stop dimension. If the second X is left out, then the second X is taken as X0. The Z dimension the part is to be faced off to is given as " Z"; if this dimension is left out, then the Z dimension defaults to Z0. The programmer can specify any number of passes which can be set using the "PASS WIDTH:" command. The syntax of the " FACE " command is as follows:
FACE Znn XnnXnn
The "THREAD" command allows the programmer to cut a standard 60 degree thread either internal or external. The n is the O.D. of the thread and nn represents the threads per inch. This command will generate canned cycles (G76) where appropriate. If the first Z is left out, then the first Z is taken as Z0. The syntax of the " THREAD" command is as follows:
THREAD n-nn Znn Znn
Turning commands can be used for turning point to point or turning shapes. The syntax of these commands are as follows:
TURN_Pn {Pn} Xnn Znn Xnn Znn Fnn
TURN_SHAPEn {SHAPEn} Xnn Znn XnnZnn Fnn {PASSn}
BORE_Pn {Pn} Xnn ZnnXnn Znn Fnn
BORE_SHAPEn {SHAPEn} Xnn Znn XnnZnn Fnn {PASSn}
In creating the code for turning, POST calculates the cutter offset and number of passes. If the number of passes is left out of the command, this number defaults to one. The word "ROUGH" can also be included in these commands to cause a roughing cycle to be generated using standard codes or canned cycles depending on the N/C machine being programmed. In point to point turning, the POST creates a tool path with the programmed point of the tool going from one point to the next. If only one point is specified in the "TURN_P" command, then the tool is left there until the next turn, drill, tool change,... etc. command is given. This makes it possible for the programmer to describe a tool path in pseudo-manual codes with POST taking care of rapid moves.
If "BORE" is used in place of "TURN" then the POST creates a tool path offset to the inside of the part (toward X0).
In all cases except for point to point milling, the POST can automatically generate cutter comp moves for each milling cycle. This mode can be turned on/off using the "COMP ON" and "COMP OFF" commands depending on the machine being programmed.
The CAM-Wizard POST processor is a fully programmable language. It includes looping, conditional branching, and user defined variables. These features along with the "MOVE", "ROT", and " INV" functions and " READ", " RESTORE", "OFFSET", "CL:", and " PASSWIDTH:" commands, make it possible to program three dimensional parts and parts that can only be described in mathematical formulas. The programming structures available in POST are "IF", " ELSE", " END IF", "LOOP", "END LOOP", and " VAR:". The syntax of the program control statements is as follows:
LOOPn
Commands...
END_LOOP
IF expression
commands...
ELSE
commands...
END_IF
VAR:varname
varname=nn
Looping in POST is accomplished by setting a series of command lines in the source code between the two commands " LOOP" and " END LOOP". The statements between these two lines will be executed in succession the number of times specified in the "LOOP" statement. If no loop number is given, then the loop will be continuously. The " EXIT" statement causes looping to stop.
Conditional program execution is performed by setting commands between the statements "IF", "ELSE", and "END IF". The expression after the word "IF" is evaluated every time the " IF" statement is encountered. If the expression evaluates to a non-zero value then the statements immediately following the "IF" statement are executed until an "ELSE" or "END IF" statement is encountered. If the expression evaluates to zero, then commands after the "ELSE" are executed, unless there is no "ELSE" statement, in which case the commands after the " END IF" are executed.
User variables in CAM-Wizard are some of the most powerful features of the system. When used properly, they can replace many calculations and control the execution flow of the program. User variables are defined using the "VAR:" command above. The programmer can make up his/her own variable names and insert them where the varname appears in the syntax definition above. User variables can have any name, which means that they can have names like zdepth or radius1. It is strongly recommended that these variable names be lower case since it is the users responsibility to determine how these variables will be interpreted by the system.
Variables are assigned values with the "=" statement User variables can have any numeric value, which means that they can have values like .218 or 100. These values are inserted in place of the variable before command interpretation; therefore the variables could be given the value of a valid command, and CAM-Wizard would act like the command had been typed in the source code editor. Also, the value "?" can be assigned to a variable, which will cause that line of the source to be displayed on the screen and the variable's value to be input by the user at run time. This feature could be used to program a family of parts in which certain parameters, such as the number of holes and their point to point distance, change with each part. There are some predefined variables. They are "tr", which is set equal to the tool radius at each tool change, and " cl", which is set equal to the clearance distance.
Send mail to webmaster@swe-eng.com with questions or comments about this web site.
Please read our Usage Rules before using any information from this site.
Copyright © 2000 SWE Engineering
Last modified: June 10, 2002