| Phone: +27 12 541-3211 | Fax: +27 12 541-2953



CNC Programming


CNC is a computer-controlled tool for working metal. It can be applied to various  forms of metal working, such as CNC turning, CNC bending, CNC milling, CNC laser cutting etc.

Automated machines began to be developed from the 19th century onwards, when machines with turntables were used for making repetitive movements with tools. A distinct disadvantage of this form of production is that it takes quite some time to make a turntable, which can only be used for one particular operation. Converting it to produce different movements is complicated.

In addition to the turntable, other methods for automated production began to be developed as well, such as the machine with a tracer, whose position was copied to  the machining tool. In this way, products could be copied. Moreover, there was a lso a system that could store and play back the movements of an operator. These forms of automated production, however, cannot be programmed as the data are stored physically rather than numerically.

The first serious steps towards CNC programming were taken in the 1950s. At the time, efforts were made to develop NC milling machines that could be used for machining complex geometrical forms that could not be produced using conventional machining methods. NC is short for numerical control, where manual operations are replaced by numerical values. The first NC machines that were ready for use, were controlled by punchcards and solved a complex problem: milling 3D contours. 

Working with punchcards is a time-consuming activity. For that reason, the programming language APT was developed in the 1960s. This programming language is used in completely computer-controlled NC systems. NC technology was further developed in the seventies and eighties. This development was spurred by economic developements in the 1960s, when labour costs rose as a consequence of an increased standard of living. Moreover, the the 1970s and 1980s,  competition from abroad gave rise to a greater demand for variation. 

When computers  became more powerful and programming languages were standardized, programming NC programs was made a lot easier. Programming NC programs using a computer is called CNC. 

Advantages of CNC

CNC operations are an alternative to conventional CNC operations. Users always have to choose between manual and CNC production. There are two elements influencing this choice: the complexity/accuracy and the size of the series/repetitiveness. It is very time-consuming to write a complete program for products that are easy to reproduce. However, CNC programming is the right option for producing complex products in large numbers because of its reliability. There is also a third option for simple products that are produced in large series. Manual and CNC production are too expensive in this case, fully automated production is the best option. 

CNC production is characterized by high accuracy, little non-productive time, few rejects and constant quality. CNC nevertheless has a number of disadvantages. CNC machines are very expensive and staff needs additional training for programming and executing the software. Moreover, values are entered manually, so mistakes may be made and incorrect values may strongly affect the quality of the product.

CNC Machining

CNC has also strongly influenced the development of automated production. CNC milling machines can be fitted with an automatic tool changer and product transport system, so that tools can be changed automaticallly and the product is automatically delivered, positioned and taken away again.

The tool changer system, which may contain as many as 120 different tools, considerably increases the versatility of the machining centre. The machine may change the tools between two different operations and in this way produce complex products. 

This means that numerous, complex operations can be can be performed without any production staff. Various machines can also be combined to form one group, so that different machines can work on a single product without any human interference. 

CNC Coordinate System

CNC control is based on a three-axis co-ordinate system. These three axes are called X, Y and Z. Products are positioned on the basis of these axes.  Advanced CNC machines can also perform angle rotations, indicated by the letters A (rotation around the X axis) and B (rotation around the Y axis). 

Positioning Measurement System

The positioning measurement system is used for determining the right position of the tools. The system measures the movement in the direction of the three axes and sends this information to the program. Measuring systems can be distinguished on the basis of measuring location, measuring method and measuring reference.

Measuring Position

The measuring position may be either direct or indirect. A direct measuring position means that the distance is determined using a tracer, that is linked directly to the object that needs  positioning (the table or chisel). This is not without risk as chips of metal or dirt may cause inaccuracies. An indirect measuring position is based on  another reference object, such as the spindle; this method may be inaccurate in case of thermal deformation. 

Measuring Method

The measuring method may be either analogue or digital. Analogue means that the position is measured continuously; digital means that the position is measured  at short intervals. 


The reference may be either absolute or incremental. An absolute reference has zero as its starting point. An incremental reference works with reference counts, and the exact position is calculated on the basis of these.

This means that there are eight combination, two of which are most commonly used: indirect/Analogue/Absolute and secondly Indirect/Digital/Incremental.


The operations are powered by a servo motor. The number of rotations required can be controlled in this servo motor, and by comparing the measured values of the positioning system with the values required by the program, the desired power can be calculated. The speed of the rotations can be controlled using a variable-frequency drive. 

Servo motors can be fitted to each axis so that they can be used in combination, which increases the number of possible movements.

Line Control

Line control is a linear movement along one axis. This is the simplest movement used for simple operations. 

Point-to-Point Control

Point-to-point control is a movement between two point in one plane (XY plane). Communication between the controls of the two axes is not required. This form of control is suitable for drilling holes, where the NC system can be used to determine the right position. 

Continuous Path Control

Continuous-path control requires the various servo motors to communicate. This can easily get very complex. It requires a computer that is sufficiently powerful to execute this movement correctly. 

CNC Programming

Programming CNC programs is a specialist task. This technique can be best explained using a CNC machining program as an example. CNC programs can also be used for bending, laser cutting, etc. 

CNC Machining

CNC machining means that a computer is used for controlling the main spindle, positioning the tool and positioning the table. It can be applied to produce products quickly and accurately. The CNC machine is controlled by th CNC program, which is a series of lines that are parsed one after the other. Every line consists of a number of commands as well as a series of values that are transmitted to the CNC machine, which subsequently executes these commands one by one. The accurate measuring systems enables quick and accurate production. 

Set up of a CNC program

A CNC program is a series of lines that are parsed and exectued one by one. A line consists of a number of commands and additional values. Commands  consist of a single letter indicating the type of command; they are followed by a numerical value, indicating how the command should be executed. 


N: Every line starts with the letter N. The N command indicates the line number. A program start with N0001, which indicates that this is the first line. After the N command, any other command can be entered in a line. In CNC programs, this value will increase by 10 for every line, so the second line is N0011. This means that  ten programable lines are skipped, so that later on additional lines can be added if the program does not yet meet the requirements. 

G: G commands are used for geometric functions. There are two categories: motions and offset values.G0, G1, G2, G3 are commands indicating motions. G90,G91,G56 are commands for offset values. X,Y,Z…A,B,C are commands indicating which X, Y and Z co-ordinates are important for the commands. These are used for positioning tools. 

F: Defines the feed rate. In G94 mode, the feed rate is defined in mm/min; in G95 mode, it is mm / rotation.

S: Defines the spindle or surface speed. In G 96 mode, the rotational speed is calculated for a specific cutting speed, which is important for tapered turning, as this  technique changes the diameter during the operation. In G97 mode, the rotational speed is fixed.

T: Defines which tool must be used. The value is useful when automatically changing tools. In addition, every tool has its own numerical value, such as chisel radius, tool diameter or cutting speed. When a tool is selected using the T command, these values are automatically retrieved from a table. 

M: Various auxiliary commands, such as a command for controlling the cooling water and similar matters.


Tubecon Laser Future
Tubecon Laser History