NC G-code programming and management: 6 key rules

g-code programming management

In this current article, we analyze some of the most basic and important rules which should be followed during the programming of a CNC machine for machining and is recommended to be considered in every workshop.

These rules concern the correct structure and writing of a CNC program providing information which renders the utilization and intertemporal operation not only easy but also effective.

These rules concern the correct structure and writing of a CNC program providing information which renders the utilization and intertemporal operation not only easy but also effective.

The modern controllers (MCUs) of CNC machine tools besides the possibilities that provisions regarding the programming, have in addition some abilities which could make more effective not only the writing of programs of numerical control but also their operation and facilitate the flow of working in every company.

It has been observed the fact that many workshops define a prearranged manner of writing and operation of the programs of numerical control so as conform with the flow of their processes.

Regardless of the method which follows each workshop, there are specific rules that when are applied correctly, eliminate malfunctions regarding the reuse of ready programs of numerical control, complete the phase of production and improve the time of writing.

The most important of these are:

1. Listing the design number or other unique attributes in the NC file name

This is the first step in facilitating the search for this program in the event of repetition by an operator, and not solely by the originator of the program. It is suggested that either the project number followed by the company or the corresponding customer plan number be entered as the name of the file of the NC program.

2. Listing of the phase of the machining

Besides, the name should be also clarified the phase of the machining. For example, in case that the design is named as DRAWING 1 and we are in phase 2, we could write on the name or in the information of the document: DRAWING – F2.

3. Listing of tools and custom fixtures

The individual tools should be written on in every tool use. Ideally, if a machining operation was successful the exact type of tool with the manufacturer's details can also be noted. Additionally, it is useful to write on any device which has been used.

4. Determination of radial compensation value

If compensation is used (G41, G42), in the corresponding block must be specified in the form of comments, the value which must be entered in the corresponding position in the Tool Offset of the Controller. For example, in the case of pre-finishing where it is normal to state a larger tool radius than the actual in order to leave finishing material by using the same tool in the following machining operation where the tool radius value will be actual.

5. Using subroutines

Prefer the use of subprogram when a repeat processing is performed. Subprograms are provided as a utility by the most controllers for such cases. When we want to repeat a series of cutting paths with a specific step of axial or radial cutting to a particular machining axis, alternating between the relative and the absolute coordinate system. This enables the use of a small number of programming blocks to achieve the desired result and the program to be not only smaller in size but also more readable and alterable.

6. Determination of the type of machining performed

Each machining (face milling, contour milling, chamfering, parting off, etc.), must be accompanied by all necessary comments and remarks which are helpful in optimizing the program management by different operators and programmers.

It has been observed that whether these rules combined with the use of assistive tools provided by modern controllers are followed by all programmers of workshops, regardless of the type of machine they work on, they have a catalytic effect in eliminating any malfunctions in relation to the reuse of ready NC numerical control programs.

The effect from the compliance with the previous rules to the management of NC documents

Obviously, after the successful completion of the machining part, the numerical control program is stored in order to be available for the future.

Another issue that arises is how each company will manage the electronic documents in relation to the flow of its work. This is something that basically concerns the available file management software in every company.

For example, it can be either an available PDM (Product Data Management) file management system, or simply every company could keep an electronic file on its network.

In any case, the most important thing is whether the above rules are followed, when a specific order has already been completed, once a specific filename and file type has been engaged, the programmer simply searches through the available systems and procedures the corresponding file.

The next day in the NC file management

Finally, it is worth mentioning that in relation to file management has now been provided a complete solution by the machine tool makers.

Especially in the last 5 years there is a tendency for modern CNC machines to be connected to the company's network (wireless or wired) and as a result enormous possibilities have been unlocked, not only in relation to the machine tool communication with the company's individual systems and the management of produced files, but also for the full control of:

  • the operation of CNC machine and their programs,
  • the productivity but also any problems that may arise during the production process,
  • the general monitoring and coordination of the whole product lifecycle,

as determine the 4th Industrial Revolution (Industry 4.0) that is ongoing, namely the automatic and bi-directional communication of information and data in production processes.