Key CNC Concept #6—Methods For CNC Programming

Presented here are three methods of developing CNC programs, manual programming, conversational (shop-floor) programming, and CAM system programming.


Facebook Share Icon LinkedIn Share Icon Twitter Share Icon Share by EMail icon Print Icon

This is the sixth article in a 10 part series about the key concepts of CNC. To start at the beginning, read this article.

To this point, we have exclusively stressed manual programming techniques at G-code level in order to ensure your understanding of basic CNC features.

In this key concept, however, we will explore the various methods of creating CNC programs. We will give applications for each method to determine which is best for a given company. While we do tend to get a little opinionated in this section, you should at least understand the basic criteria for deciding among the programming alternatives. We will discuss three methods of developing CNC programs, manual programming, conversational (shop-floor) programming, and CAM system programming. Keep in mind that no one of these alternatives is right for all companies. Each has its niche in the manufacturing industry.

Manual Programming

As you have seen, manual programming tends to be somewhat tedious. Admittedly, the words and commands involved with manual programming can be somewhat cryptic. However, all CNC programmers should have a good understanding of manual programming techniques regardless of whether or not they are used.

We relate this to performing arithmetic calculations longhand as opposed to on an electronic calculator. Math teachers unanimously agree that students must understand how to perform arithmetic calculations manually. Once the student possesses a firm understanding of how to perform calculations manually, a calculator can be used to expedite the calculation procedure.

For the right application, manual programming may be the best programming alternative. There are still a great number of companies who exclusively employ manual programming techniques. If, for example, only a few machine tools are used, and if the work performed by the company is relatively simple, a good manual programmer will probably be able to out-perform even a very good CAM system programmer. Or say a company dedicates the use of their CNC equipment to a limited number of jobs. Once these jobs are programmed, there will never be a need to create more programs. This is another time when manual programming may make the best programming alternative.

Even if a CAM system is used, there will be times when the CNC program (at G-code level) must be changed to correct mistakes during the verification of the program. Also, there will usually be an opportunity to optimize programs after running of the first few workpieces. If the programmer must use the CAM system to perform these very elementary changes to the CNC program, a great deal of production time can be wasted.

Conversational (Shopfloor) Programming

This form of programming has become quite popular in recent years. With conversational programming, the program is created at the CNC machine. Generally speaking, the conversational program is created using graphic and menu-driven functions. The programmer will be able to visually check whether various inputs are correct as the program is created. When finished, most conversational controls will even show the programmer a tool path plot of what will happen during the machining cycle.

Conversational controls vary substantially from one manufacturer to the next. In most cases, they can essentially be thought of as a single-purpose CAM system, and thus do provide a convenient means to generate part programs for a single machine. Be forewarned, though, that some of these controls, particularly older models, can only be programmed conversationally at the machine, which means you can't utilize other means such as off-line programming with a CAM system. However, most newer models can operate either in a conversational mode or accept externally generated G-code programs.

The Application For Conversational Controls

There has been quite a controversy brewing over the wisdom of employing conversational controls. Some companies use them exclusively and swear by their use. Others consider them wasteful. Everyone involved with CNC seems to have a very strong opinion (pro or con) about them.

Generally speaking, companies who employ a limited number of people to utilize their CNC equipment and run a wide variety of different workpieces tend to use and like conversational controls. In this kind of company, one person may be expected to perform many CNC-related tasks. In many job shops, for example, the CNC operator may be expected to set up tooling, make the workholding setup, prepare the program, verify and optimize the program, and actually run production. In this kind of company, anything that can be done to help the operator will streamline production. Conversational controls can dramatically reduce the time it takes the operator to prepare the program as compared to manual programming.

In many larger manufacturing companies, the goal is to keep the CNC machine running for as much time as possible. This kind of company employs a staff of support people to keep the CNC machines running. Down time for any reason will be perceived as wasted time. One person may be setting up tools for the next job while the current job is running. Another person may make the workholding setup. Yet another writes and verifies the program. In this case, the operator may only be expected to load and unload workpieces. The support staff minimizes the setup-related work that must be done on-line, while the machine is sitting idle. As you can imagine, this kind of company does not want their programs developed on-line, while the machine is not producing.

There are two other factors that contribute to whether a conversational control is a wise investment. The first has to do with operator incentive. The person running a conversational control must be highly motivated. This person has a great impact on the success of the company. With motivation, a conversational programmer can outperform a manual programmer by a dramatic margin. This is another reason why conversational controls are so popular among small companies like job shops. In small companies, the person programming conversationally usually has a high interest in the success of the company.

Another factor that affects the wisdom of employing conversational controls is the number of different work-pieces that must be programmed. If only a limited number of different workpieces are required of the CNC machine, conversational programming may not be the best programming alternative.

CAM System Programming

CAM systems allow CNC programming to be accomplished at a much higher level than manual programming and are becoming very popular. Generally speaking, a CAM system helps the programmer in three major areas. It keeps the programmer from having to do math calculations, makes it easy to program different kinds of machines with the same basic language, and helps with certain basic machining practice functions.

With a CAM system, the programmer will have a computer to help with the preparation of the CNC program. The computer will actually generate the G-code level program much like a CNC program created by manual means. Once finished, the program will be transferred directly to the CNC machine tool.

CAM systems fall into two basic categories, word address CAM systems and graphic CAM systems. Word address systems require that programs be written in a language similar to BASIC, C Language, or any other computer programming language. These CAM systems require that the program be written in much the same way as a manual program. While some of the most powerful CAM systems are word address systems, they also tend to be the more difficult to use.

Graphic CAM systems are commonly programmed interactively. The programmer will have visual feedback during every step of the programming task. Generally speaking, this makes graphic CAM systems easier to work with than word address systems.

Steps To CAM System Programming

While CAM systems vary dramatically from one system to the next, there are three basic steps that remain remarkably similar among most of them. First, the programmer must give some general information. Second, workpiece geometry must be defined and trimmed to match the workpiece shape. Third, the machining operations must be defined.

General Information

Information required of the programmer in this step includes documentation information like part name, part number, date, and program file name. The programmer may also be required to set up the graphic display size for scaling purposes. The workpiece material and rough stock shape may also be required.

Define And Trim Geometry

Using a series of geometry definition methods, the programmer will describe the shape of the workpiece. With graphic CAM systems, the programmer will generally be shown each geometric element as it is described. The programmer will have the ability to select from a series of definition methods, choosing the one that makes it the easiest to define the workpiece shape.

Once geometry is defined, most CAM systems require that the geometry be trimmed to match the actual shape of the workpiece to be machined. Lines that run off the screen in both directions must be trimmed to form line segments. Circles must be trimmed to form radii.

Bypassing The Geometry Creation

Keep in mind that most CAM systems allow geometry defined within CAD (computer-aided design) systems to be imported to the CAM system. This is especially helpful with very complicated parts, keeping the CAM system programmer from having to duplicate the effort of creating geometry. However, there are four warnings we give to companies who anticipate the need to do this.

First, the drawing created in the CAD system must be to scale. Design engineers are notorious for fudging dimensions on their drawings to make the print look nice. If they have a 0.005 inch step on the workpiece, they know the step of this size will not even show up on the drawing. In this case, they may draw the step as a 0.050 in step and dimension it as 0.005 in. If this is done, the drawing is not truly accurate, and the CAM system programmer will end up creating an incorrect program.

Second, there will be only a portion of the CAD system drawing that will be of use to the CAM system programmer. If the entire drawing is imported to the CAM system, a great deal of time can be spent deleting geometry elements within the CAM system. While most CAD systems allow the user to easily specify the section of the drawing to be exported, doing so does take time.

Third, the CAD system design engineer will give little consideration to the location of the CAM system pro-grammer's program zero point. The origin of the drawing may be the drawing's lower left hand corner. In this case, when the drawing is imported to the CAM system, it must be shifted accordingly. While most CAM systems allow this, this step does take time.

Fourth, most CAM systems expect geometry to be in a certain format for machining. For example, turning center CAM systems will expect threads to be defined in a certain manner. It is quite unlikely that the CAD system drawing for threads will match what the CAM system expects the threads to look like. In similar fashion, turning center CAM systems usually expect only the top half of the workpiece to be described. Again, this does not match what the design engineer does with the CAD system.

For these reasons, many CAM system users feel that it is sometimes easier to redefine the drawing within the CAM system (for simple workpieces) than it is to import drawings directly from the CAD systems. As workpieces get more complicated and more difficult to define (especially for 3D work) the ability to import geometry from the CAD system becomes more important.

Define The Machining Operations

In the third step to CAM system programming, the programmer tells the CAM system how the workpiece is to be machined. CAM systems vary dramatically with regard to how this step is handled. Many give a menu of machining operations to choose from and the programmer fills in the blanks as each operation is described.

During this step, usually a tool path or animation will be shown, giving the programmer a very good idea of what will happen as the program is run at the machine tool. This ability to visualize a program before it gets to the machine tool is a major advantage of graphic CAM systems. At the completion of all operations, the programmer can command that the G-code level CNC program be created.

What About Program Storage And Retrieval?

Regardless of how a CNC program is prepared, companies who run any repeat jobs are highly concerned with storing and retrieving CNC programs. (Even if a CNC machine is dedicated to running only one job, it will be necessary to back up the program in case of machine problems.) Of course, once a program is verified (at the machine), the user will want to store the program in its corrected state for future use. This can be done with a variety of techniques.

Program storage and retrieval devices used for this purpose include magnetic cassette tape recorders/players, paper tape reader/punches, portable floppy diskette drives, RAM (random access memory) devices, notebook and lap-top computers, and desktop computers. By far, personal computers (notebook, laptop, and desktop) are the most popular form of program transfer device. Let's briefly discuss how they can be used for program transmissions.

All current model CNC controls come with an RS-232-C communications (serial) port. All current model personal computers come with a serial communications port. By connecting a properly configured cable to the computer and CNC , the user can command that transmissions of CNC programs take place. Some form of communications software is required within the computer to allow transmissions. After invoking this software, the user can specify whether a CNC program is to be sent or received to or from the CNC. Note that most CAM systems come with this form of communications software to allow program transfer. Moreover, there are a number of vendors who specialize in these communications networks—usually referred to as "DNC systems."

Once transferred to the computer, the communications software will automatically store the program on the computer's hard drive (or floppy diskette). Once the program is transferred to the CNC, the program will be ready for activation within the control itself.

This is the sixth article in a 10 part series about the key concepts of CNC. To start at the beginning, read this article.

Next Article - Key Concept Number 7 - Know The Machine From An Operator's Viewpoint.