How computer numerical control works
With CNC, each object to be manufactured gets a customized computer program, usually written in an international standard language called G-code, which is stored in the machine control unit (MCU) (a microcomputer connected to the machine) and run by its execution. The M-code language is also used in conjunction with G-code in CNC operations.
G codes control the movement and functionality of the machine, while M codes control the external movements of the operation. The program also contains instructions and parameters that the machine tool follows, such as the feed rate of the material and the positioning and speed of the tool components.
Early in the process, engineers create a computer-aided design (CAD) drawing of the part to be manufactured and then convert the drawing into G-code. The program is loaded onto the MCU and the machine operator performs a test run without raw material in place to ensure correct positioning and performance. This step is important because incorrect speed or positioning can damage the machine and parts.
When everything is ready, the CNC machine runs the program and completes the job exactly as instructed. These jobs can involve anything from creating something from scratch to cutting workpieces or printing something.