top of page
  • Writer's pictureAbhi Shejul

CNC and Machining!

How are the machines controlled?


Earlier we have taken a look at the machining operations part of manufacturing. Machining is the process wherein material is removed from the workpiece by means of sharp cutting tool. The workpiece or job is mounted on a bench, the assembly of all these components will form a machine. This machine is powered by either a electric motor or a gasoline engine.

The direction in which the tool moves to make the cut or to chip the material can be controlled manually i.e. by the means of feed and lead screws handled mechanically. This movement of the tool can also be controlled with the help of computer.

The Computerized numerical control (CNC) machine is an automated device which controls both the 3D printer and machining tools with a computer via programming. The machine processes a material piece to meet certain parameters according to the coded instruction, without any manual effort.

There are three conventional CNC machining technologies that you must understand in order to appreciate the fundamentals of how material is removed from stock in a CNC machine.

What is a CNC Machine ?

The drills come first. The drills work by spinning a drilling bit and moving it into contact with the stationary stock of a CNC machine.

Then there are the lathes, which work in the opposite direction of drilling. To pull out the material in a fluid or circular route, the lathes rotate the piece of material against the cutter or stationary drill bit. Lathe shapes are significantly more constrained than the other two CNC machine approaches. Lathe machines, on the other hand, may be used to manufacture non-circular forms and square holes, thanks to contemporary technology.

Milling is the third technique. This is a very frequent CNC machine type. In milling machines, rotary cutting tools are used to separate the material component from the stock. These devices work in a similar way to drills and have a variety of tool shaping capabilities.

CNC machines can work with almost any form of material, from fiber to titanium. Because each material has its own set of qualities, machinists and engineers will adjust the machining variables such as RPM, coolant flow, tool selection, feed rate, and other variables to meet these unique problems.

How does a CNC machine work ?

The CNC machine is made out of a computer that feeds the programming to cut the metal job according to the specs or criteria. Every cutting operation, as well as the final parameters, are supplied into the computer using G-code programming.

So the whole operation is basically controlled by the computer, which knows exactly what to do and executes the cutting process accordingly. This machine is more like a robotic system because it is completely manipulated and controlled by computer programming. The machine then operates according to the instructions coded in the program.

CNC equipment is to extract a part of the metal block or workpiece and give it a specific shape, such as a circle, a square, a rectangle, and so on. In traditional machining technology, CNC machines are controlled by skilled operators during machine operation.

Almost all material work needs to be processed with extremely high precision and precision. In addition, the operator or mechanic must have sufficient experience to manage precision work. However, the manual application of controlling CNC machines has been minimized today. Today, the only job of most operators is to input specific instruction programs into the computer, install the necessary tools on the machine, and let the computer automatically handle the entire process.

The computer interprets the program sent to it, and therefore instructs the machine tool to perform different machining operations established in the program by the operator.

What is CNC machining ?

CNC machining is a manufacturing method in which factory machinery and tools are moved by pre-programmed computer programming software. It is a method of shaping and processing a material such as titanium, aluminum, or steel into a completed part or product.

This technology can be used to handle complex machinery ranging from lathes and grinders to routers and milling machines. With CNC machining, 3D cutting work becomes easier. CNC machines use digital commands in the form of modal G-code.

Before the advent of modern computer-aided design (CAD) or computer-aided manufacturing (CAM) programming (such as Autodesk’s Fusion 360), engineers and mechanics had to manually write G-code to operate machines. The CAM code used today supports 3D models and generates automatic modal G-code to control the machine with minimal input.

When comparing manual alternatives such as drilling or other machining processes with automated CNC machining, the advantages of the latter can be clearly seen. CNC machines run quickly with high precision and increased precision, while continuing to turn computer designs into finished physical products.

How to write a CNC code?

It's critical for every CNC enthusiast to understand the important letter codes used in CNC programming. Even so, you'll see that the majority of the codes in the table below are for CNC mills. G code and M code are only part of CNC machine programming. CNC machining is dependent on these two codes, as previously stated. What are the specific functions of these codes though? What effect do they have on the CNC machine? This section will provide answers to these queries as well as a comparison of the two codes.

What is G-Code?

Although the code's official name is RS-274D, most people call it G code. This is due to the fact that the majority of the commands in this code begin with the letter G. Geometry is represented by the letter ‘G' in G code. Although this seems simple enough, G code programming can be quite complicated for machinists. This is because different machines read G codes in different formats.

The difference between most machines is whether there are spaces between commands and the number of zeros between letters and numbers in the commands. For example, one machine can use G3, and another machine can use G03. Machinists should always be familiar with the type of machine they use. This is because command errors can cause serious part production problems.

Although G is the most common letter in G code CNC programming, it is not the only letter used. Other letters also have functions in the code, and these letters often have the same function regardless of the company format. Some examples of letters in the G code include:

A: Guides the tool around the x-axis.

R: Gives the radius of the arc produced by the machine.

X, Y, Z: These three values ​​indicate the position of the tool in three dimensions: X and Y represent the horizontal and vertical dimensions, respectively, and Z represents the depth.

I and J: These two values ​​both specify the incremental center of any arc made by the machine.

N: N gives the line number. The

code also uses other letters, depending on the capabilities of the machine.

What is M-Code?

Like G codes, M codes also begin with the letter "M". The M code is a set of auxiliary instructions used to control all non-geometric actions of the machine. Machinists refer to these codes as miscellaneous codes because they control non-cutting operations such as stopping the program, flooding the machine with coolant, and turning it off after the temperature drops.

When using G and M codes to configure the CNC program, each information block of the M code can only have one command. This is because they mainly turn the machine on and off. Therefore, using them multiple times in a block may cause problems in the program.

Same as G code, M code is different for different machines. Some machines allow the omission of zeros between letters and numbers, while others do not.


CNC machining code outline
G - code


The CNC machine was first developed in (1940-50s) and is mainly based on "punched tape" data storage technology. The machine control program code will be manually keyed into the data card, and then entered into the system, where the data written out will be interpreted. It goes without saying that these early developed machines are only at an elementary level and have limited functions.


That was the thorough description of the CNC machine and its operation. CNC machining is, without a doubt, the most widely used manufacturing process in the twenty-first century.

42 views0 comments

Related Posts

See All


bottom of page