Вы находитесь на странице: 1из 8

Lesson Two: Documenting in the Program

Documenting in the Program


Most basic CNC classes teach you that almost all current model CNC controls allow you
to include messages within your CNC programs for documentation purposes. Even if this
feature is introduced in the basic CNC course, most instructors will not describe the
various times when documenting messages should be used.
Fanuc and Fanuc-compatible controls use parentheses [()], which are also called control
in and control out, for the purpose of including messages in the program. When the
control reads a left parenthesis, it ignores any characters it sees until it comes to a right
parenthesis. At this point it goes back to executing CNC commands in the normal
fashion. Though some controls allow both upper and lower case characters, most Fanuc
and Fanuc-compatible controls require that the message included within the parentheses
be in upper case only (all capital letters).
Some controls use different characters to designate that messages are being given (some
use a dollar sign, for example). Regardless of how messages are labeled, almost all
current model CNC controls allow some way for the programmer to include documenting
messages right in the CNC program that will appear on the display screen when the setup
person or operator views the program.
Older controls may not have the ability to actually display messages on the display
screen, but at least they can be included on the programs print out (hard copy). Also
note that some controls do have the ability to display messages on the display screen but
do not have the parentheses characters (or all letters of the alphabet) on the control panel
keyboard. For this kind of control, messages cannot be entered or modified at the
machine.
You will notice that just about every command of every example program given in this
course will have a message within parentheses to help you understand what is going on
within the command. Admittedly, our usage of messages is extreme (documenting every
command) and we do not recommend that you do so. Also, we include upper and lower
case characters for the sake of clarity (which many controls do not allow). While this
feature is not at all advanced, many programmers do not document nearly as extensively
as they should. In this discussion, we intend to expose the most important applications
for including messages within CNC programs.
Program headers
A well documented CNC program begins with a series of messages that remove any
doubt about the programs use. Here is a sample program beginning that includes
sufficient documentation for this purpose.
O0001
(*** PROGRAM QUALIFIED 2/12/99 ***)
(
MACHINE: MORI SEIKE SL4)
( PART NUMBER: A-2355-2C)
( PART NAME: BEARING FLANGE)
(
REVISION: F)
(
CUSTOMER: ABC COMPANY)
( OPERATION: 20, MACHINE BORED END OF PART)

Lesson Two: Documenting in the Program


( PROGRAMMER: MLL)
(DATE FIRST RUN: 4/11/98)
(PROGRAM REVISION: C)
( LAST PROGRAM REVISION: 1/30/98 BY CRD)
(
RUN TIME: 00:05:25)
N005 T0101 M41
N010 G96 S400 M03
N015 G00 X3. Z.1 M08
.
.
.
Notice that anyone viewing this header information can easily tell which CNC machine
the program is for, the workpiece and operation the program is machining, who wrote the
program, who last changed it, and three important dates. Though this kind of information
may seem quite basic, remember that many companies eventually accumulate thousands
of CNC programs. Without this basic documentation in each program, it can be next to
impossible to keep track of which programs are used for a given job.
Notice that the first documenting line deals with whether the program is qualified, or
proven. When they have many repeated jobs, most companies strive to minimize the
number of changes required after the job is first run. Indeed, many companies do not
allow their setup people and operators to modify what they consider to be qualified or
proven programs without getting the approval of the CNC programmer. This message
specifies to the operator that the program is qualified, and should run without the need for
modification.
Also of importance in our example header are the current revisions for workpiece and
program. Remember that the designs for production workpieces are commonly changed,
meaning changes in CNC programs. These changes can wreak havoc with the
organization and maintenance of CNC programs. In the event that a revision may not be
permanent (the design engineer may delete the revision), many companies maintain a
master copy of each CNC program for every revision, meaning a given operation for one
workpiece may eventually have several CNC programs. The setup person and/or CNC
operator must be very cautious to confirm that the CNC program they are about to run
will machine the workpiece to its most recent revision. Documenting and maintaining
the revision information at the beginning of every CNC program makes this checking
easy.
Process changes may also occur. Even if the workpiece revision stays the same, the
programmer may elect to incorporate new tooling, workholding devices, or machining
order to improve quality or cycle time. The program revision should be documented on
the setup sheet and in the CNC program so the setup person can confirm they are running
the most recent version of the program.
Also notice the specification of run time. Once the program has run, it can be helpful to
document its run time right in the CNC program (especially for a repeating job). Anyone
looking at the program in the future, while the program is not currently running, can
easily determine how long the program takes to run. Additionally, there are things that

Lesson Two: Documenting in the Program


occur in setup that may affect the run time. If for example, tools are loaded in a
machining centers tool magazine in sequential order, tool changing time will be
minimized (even with random access tool changers if machining time is very short for a
given tool). When the job does run again, the setup person can confirm that it is running
as efficiently as it has in the past if the run time is included in the program header.
Tool information
A CNC program, especially a long one, can be quite difficult to read, even for
experienced CNC setup people and operators. Since the CNC operator will be having to
rerun tools often, the CNC programmer can make it much easier to find critical restart
positions in the program by documenting the beginning of every tool. By having this
documentation available in the program, the CNC operator can easily confirm that they
have found the correct position within the CNC program from which to start a given tool.
Here is an example turning center program which illustrates this technique.
O0001
(*** PROGRAM QUALIFIED 2/12/99 ***)
(
MACHINE: MORI SEIKE SL4)
( PART NUMBER: A-2355-2C)
( PART NAME: BEARING FLANGE)
(
REVISION: F)
(
CUSTOMER: ABC COMPANY)
( OPERATION: 20, MACHINE BORED END OF PART)
( PROGRAMMER: MLL)
(DATE FIRST RUN: 4/11/98)
(PROGRAM REVISION: C)
( LAST PROGRAM REVISION: 1/30/98 BY CRD)
(
RUN TIME: 00:05:25)
N005 T0101 M41 (ROUGH TURNING TOOL)
N010 G96 S400 M03
N015 G00 X3.040 Z0.1
N020 G01 Z-1.995 F0.017
N025 X3.25
N030 G00 X6.0 Z5.0
N035 M01
N040 T0303 M41 (2" DRILL)
N045 G97 S300 M03
N050 G00 X0 Z0.1
N055 G01 Z-2.6 F.009
N060 G00 Z0.1
N065 G00 X6.0 Z5.0
N070 M01
N075 T0404 M41 (1.5" ROUGH BORING BAR)
N080 G96 S400 M03
N085 G00 X2.085 Z0.1
N090 G01 Z-1.995 F0.010
3

Lesson Two: Documenting in the Program


N095 X2.0
N100 G00 Z0.1
N105 X6.0 Z5.0
N110 M01
N115 T0505 M42 (1.5" FINISH BORING BAR)
N120 G96 S600 M03
N125 G00 X1.125 Z0.1
N130 G01 Z-2.0 F0.006
N135 X2.0
N140 G00 Z0.1
N145 G00 X6.0 Z5.0
N150 T0202 M42 (FINISH TURNING TOOL)
N155 G96 S600 M03
N160 G00 X3. Z0.1
N165 G01 Z-2.0 F0.006
N170 X3.25
N175 G00 X6.0 Z5.0
N180 M01
N185 M30
Notice how in lines N005, N040, N075, N115, and N150, the message makes it clear as
to which tool is being used. Also notice how the programmer skips a line (by including
an additional end-of-block character) at the beginning of each tool to nicely separate one
tool from the next. An operator wishing to rerun the finish boring bar, for example, could
easily confirm that line N115 is the correct block from which to start.
At every program stop
Depending upon the machining operations being performed, there may be times when the
CNC operator must perform a special (manual) task during the CNC programs execution
at a program stop, commonly commanded by an M00. For example, a vertical machining
center program may be performing several tapping operations. Due to chips building up
inside the holes, the CNC programmer may include a program stop just before the
tapping operations. During this program stop, the operator is expected to brush away the
chips and add tapping compound to the holes. In order to confirm that the CNC operator
knows what it is they are supposed to do, the CNC programmer should place a message
in the program close to the program stop command.
.
.
N095 M00 (CLEAR CHIPS AND ADD TAPPING COMPOUND)
.
.
Other instances of when the CNC operator may be expected to perform manual
operations in this fashion that should be well documented include breaking certain
clamps loose on machining centers for finishing operations, reducing chuck pressure on
turning centers for finishing operations, and turning a workpiece around in the chuck of a

Lesson Two: Documenting in the Program


turning center to machine the opposite end of the workpiece. Truly, any time a
programmer includes a program stop in the program, a message should be included closeby to tell the operator what it is they are supposed to do.
Messages used for this purpose assume the operator is monitoring the program page of
the controls display screen. In this case, when the machine stops due to the M00, the
message will be visible. However, if the operator is monitoring another page of the
display screen, say the position page, the message will not be visible. The operator can,
of course, simply activate the program page to see the message. However, this assumes
the operator knows that the machine stopped due to an M00 (the machine isnt hung up
for an unexplained reason).
Some controls allow a more fail-safe method of displaying messages during a program
stop. At the program stop, the display screen of the control will automatically switch to a
special message page and display the message, regardless of what display screen page the
operator happens to be monitoring. The example command we show is given in the
format used with the most popular version of parametric programming, custom macro B.
#3006 = 101 (TURN PART AROUND)
In custom macro B language, #3006 is a stop-with-message system variable. When this
command is executed, the display screen of the control will automatically switch to the
message page. Message number MC101 that states TURN PART AROUND will be
shown. After the part is turned around in the chuck and the operator reactivates the cycle,
the message will disappear (though the display will still be showing the message page).
Simple setup instructions
With simple setups, some programmers like to include messages at the very beginning of
the program to tell the operator how to setup the job. The programmer can be as verbally
specific as necessary, letting the operator know exactly what is expected in the setup.
Note that most CNC controls limit the number of characters that can be included per
message to about 80 characters. Also, to keep a message from breaking in the middle of
a word at the end of a line, it is necessary to keep each line of the program within
parentheses as this example program shows.
Program:
O0001 (Program Number)
(PART NUMBER 3504857, OPERATION NUMBER 10)
(TO BE RUN ON VERTICAL MACHINING CENTER)
(OPERATOR: SET THE VISE IN THE MIDDLE OF THE TABLE AND)
(PLACE FIXED STOP ON LEFT SIDE OF FIXED JAW. PLACE)
(WORKPIECE IN SETUP FOR TOUCH OFF. PROGRAM ZERO IS THE)
(LEFT SIDE OF THE PART IN X, THE LOWER SURFACE OF THE)
(PART IN Y, AND THE TOP SURFACE OF THE PART IN Z.)
(SET THE MEASURED PROGRAM ZERO DIMENSIONS IN FIXTURE)
(OFFSET NUMBER ONE.)
(TOOLS REQUIRED:)
(STATION: DESCRIPTION:)
( 1 1" DRILL)
( 2 .500 DRILL)
5

Lesson Two: Documenting in the Program


( 3 6" FACE MILL)
( 4 .427 DRILL)
( 5 1/2-13 TAP)
( 6 1" END MILL)
(OFFSETS: LENGTH VALUES TO BE STORED IN OFFSET NUMBERS)
(CORRESPONDING TO TOOL STATION NUMBERS. RADIUS VALUES)
(TO BE STORED IN OFFSET NUMBERS EQUAL TO 30 PLUS TOOL)
(STATION NUMBERS.)
N005 G54 G90 S400 M03 T02 (Select coordinate system, absolute mode, turn
spindle on CW at 400 RPM)
N010 ...
.
.
.
M30 (End of program)
Though a set of written instructions can be very helpful, many CNC machine setups are
quite complicated, and require a drawing for better clarification. For this reason, most
programmers prefer to include a separate setup sheet with the program to instruct the
operator with regard to how the setup should be made. On this setup sheet, the
instructions are written and a drawing of the setup is given.
Describing changes made after a dispute
You may not always agree with program changes you are asked to make. If you must
make changes based upon someone elses request, its wise to document the change (and
your objection to it) right in the program. This way you can easily explain why the
change was made and who requested it at some future date if problems arise from the
change.
Documenting something out of the ordinary
If you do something very special or unusual in a program, something that you seldom do,
and especially if it requires the setup persons or operators knowledge, it is wise to
include a message right at the beginning of the program to alert everyone involved.
Possibly you have a particularly troublesome turning center workpiece with which your
setup people and operators are having trouble sizing. Possibly tool pressure is causing a
grooving tool to machine differently in different diameters of the workpiece. Possibly a
groove close to the chuck end (with good support) is coming out smaller than a groove in
the middle of the workpiece (without as much support).
To handle this problem, you decide to use two offsets for the grooving tool (one for the
chuck end groove and the other for the middle groove). The setup person and operator
must, of course, understand that this is being done. While you would probably include
this information in the setup documentation (setup sheet), it is a good idea to make a
special note of this right at the beginning of the program. Here is an example.
O0002 (Program number)
(SPECIAL NOTE! TWO OFFSETS ARE USED FOR GROOVING)
(TOOL IN STATION FIVE. USE OFFSET FIVE TO CONTROL)
(GROOVE AT HEADSTOCK END AND OFFSET TWENTY-FIVE)

Lesson Two: Documenting in the Program


(TO CONTROL GROOVE IN MIDDLE OF WORKPIECE.)
N005 T0101 M41 (Index to station one, select low range)
N010 G96 S500 M03 (Start spindle at 500 sfm)
.
.
Getting documentation into programs for controls that do not display messages
Just because your (probably older) CNC control does not display messages in
parentheses, it doesnt mean you cannot place some rudimentary documentation in your
program. For important numerical values, like dates, use sequence numbers. For
example, its easy to tell that the date in this command is February 2, 2000.
N020400
If multiple messages are to be included, the programmer must be very consistent with the
order of messages. Also, the setup people and operators may have to have a key that
helps them understand some of the code numbers. But you can be pretty explicit with
these special documenting sequence numbers. Consider this example program header.
O0001
N0
N2
N23552
N6
N3
N20
N3
N020900
N3
N030400
N000525
N005 T0101 M41
N010 G96 S400 M03
N015 G00 X3. Z.1 M08
.
At first glance this series of N words probably doesnt make much sense. But now look
at the key:
1) Proven? 0:no, 1:yes
2) Machine number. 1: Okuma LB10, 2:Mori Seike SL4
3) Numbers in part number
4) Revision. 1:A, 2:B, 3:C, 4:D, etc.
5) Customer. 1:ABC Company, 2:DEF Company, 3:GHI Company
6) Operation number
7) Programmer. 1:Steve Thoms, 2:Larry Hassik, 3:John Smith
8) Date first run
9) Program revision. 1:A, 2:B, 3:C, etc.
10) Last program revision date
11) Run time in hours minutes seconds format.
7

Lesson Two: Documenting in the Program


Just about everything given in the previous example program header (except the part
name) is documented. Admittedly, it takes some study to understand, but at least you can
get important documenting information into your program.

Вам также может понравиться