Motion is controlling multiple axes, normally at least two (X and Y),5 and a tool spindle that moves in the Z (depth). The position of the tool is driven by direct-drive stepper motors or servo motors to provide highly accurate movements, or in older designs, motors through a series of step-down gears. Open-loop control works as long as the forces are kept small enough and speeds are not too great. On commercial metalworking machines, closed-loop controls are standard and required to provide the accuracy, speed, and repeatability demanded.
As the controller hardware evolved, the mills themselves also evolved. One change has been to enclose the entire mechanism in a large box as a safety measure (with safety glass in the doors to permit the operator to monitor the machine's function), often with additional safety interlocks to ensure the operator is far enough from the working piece for safe operation. Most new CNC systems built today are 100% electronically controlled.
CNC-like systems are used for any process that can be described as movements and operations. These include laser cutting, welding, friction stir welding, ultrasonic welding, flame and plasma cutting, bending, spinning, hole-punching, pinning, gluing, fabric cutting, sewing, tape and fiber placement, routing, picking and placing, and sawing.
Main article: History of numerical control
The first NC machines were built in the 1940s and 1950s, based on existing tools that were modified with motors that moved the tool or part to follow points fed into the system on punched tape.6 These early servomechanisms were rapidly augmented with analog and digital computers, creating the modern CNC machine tools that have revolutionized machining processes.
Now the CNC in the processing manufacturing field has been very extensive, not only the traditional milling and turning, other machines and equipment are also installed with the corresponding CNC, which makes the manufacturing industry in its support, greatly improving the quality and efficiency. Of course, the latest trend in CNC7 is to combine traditional subtractive manufacturing with additive manufacturing (3D printing) to create a new manufacturing method8 - hybrid additive subtractive manufacturing (HASM).9 Another trend is the combination of AI, using a large number of sensors, with the goal of achieving flexible manufacturing.10
EDM can be broadly divided into "sinker" type processes, where the electrode is the positive shape of the resulting feature in the part, and the electric discharge erodes this feature into the part, resulting in the negative shape, and "wire" type processes. Sinker processes are rather slow as compared to conventional machining, averaging on the order of 100 mm3/min,11 as compared to 8 million mm3/min for conventional machining, but it can generate features that conventional machining cannot. Wire EDM operates by using a thin conductive wire, typically brass, as the electrode, and discharging as it runs past the part being machined. This is useful for complex profiles with inside 90 degree corners that would be challenging to machine with conventional methods.
Many other tools have CNC variants, including:
In CNC, a "crash" occurs when the machine moves in such a way that is harmful to the machine, tools, or parts being machined, sometimes resulting in bending or breakage of cutting tools, accessory clamps, vises, and fixtures, or causing damage to the machine itself by bending guide rails, breaking drive screws, or causing structural components to crack or deform under strain. A mild crash may not damage the machine or tools but may damage the part being machined so that it must be scrapped. Many CNC tools have no inherent sense of the absolute position of the table or tools when turned on. They must be manually "homed" or "zeroed" to have any reference to work from, and these limits are just for figuring out the location of the part to work with it and are no hard motion limit on the mechanism. It is often possible to drive the machine outside the physical bounds of its drive mechanism, resulting in a collision with itself or damage to the drive mechanism. Many machines implement control parameters limiting axis motion past a certain limit in addition to physical limit switches. However, these parameters can often be changed by the operator.
Many CNC tools also do not know anything about their working environment. Machines may have load sensing systems on spindle and axis drives, but some do not. They blindly follow the machining code provided and it is up to an operator to detect if a crash is either occurring or about to occur, and for the operator to manually abort the active process. Machines equipped with load sensors can stop axis or spindle movement in response to an overload condition, but this does not prevent a crash from occurring. It may only limit the damage resulting from the crash. Some crashes may not ever overload any axis or spindle drives.
If the drive system is weaker than the machine's structural integrity, then the drive system simply pushes against the obstruction, and the drive motors "slip in place". The machine tool may not detect the collision or the slipping, so for example the tool should now be at 210mm on the X-axis, but is, in fact, at 32mm where it hit the obstruction and kept slipping. All of the next tool motions will be off by −178mm on the X-axis, and all future motions are now invalid, which may result in further collisions with clamps, vises, or the machine itself. This is common in open-loop stepper systems but is not possible in closed-loop systems unless mechanical slippage between the motor and drive mechanism has occurred. Instead, in a closed-loop system, the machine will continue to attempt to move against the load until either the drive motor goes into an overload condition or a servo motor fails to get to the desired position.
Collision detection and avoidance are possible, through the use of absolute position sensors (optical encoder strips or disks) to verify that motion occurred, or torque sensors or power-draw sensors on the drive system to detect abnormal strain when the machine should just be moving and not cutting, but these are not a common component of most hobby CNC tools. Instead, most hobby CNC tools simply rely on the assumed accuracy of stepper motors that rotate a specific number of degrees in response to magnetic field changes. It is often assumed the stepper is perfectly accurate and never missteps, so tool position monitoring simply involves counting the number of pulses sent to the stepper over time. An alternate means of stepper position monitoring is usually not available, so crash or slip detection is not possible.
Commercial CNC metalworking machines use closed-loop feedback controls for axis movement. In a closed-loop system, the controller monitors the actual position of each axis with an absolute or incremental encoder. Proper control programming will reduce the possibility of a crash, but it is still up to the operator and programmer to ensure that the machine is operated safely. However, during the 2000s and 2010s, the software for machining simulation has been maturing rapidly, and it is no longer uncommon for the entire machine tool envelope (including all axes, spindles, chucks, turrets, tool holders, tailstocks, fixtures, clamps, and stock) to be modeled accurately with 3D solid models, which allows the simulation software to predict fairly accurately whether a cycle will involve a crash. Although such simulation is not new, its accuracy and market penetration are changing considerably because of computing advancements.13
Within the numerical systems of CNC programming, the code generator can assume that the controlled mechanism is always perfectly accurate, or that precision tolerances are identical for all cutting or movement directions. While the common use of ball screws on most modern NC machines eliminates the vast majority of backlash, it still must be taken into account. CNC tools with a large amount of mechanical backlash can still be highly precise if the drive or cutting mechanism is only driven to apply cutting force from one direction, and all driving systems are pressed tightly together in that one cutting direction. However, a CNC device with high backlash and a dull cutting tool can lead to cutter chatter and possible workpiece gouging. The backlash also affects the precision of some operations involving axis movement reversals during cutting, such as the milling of a circle, where axis motion is sinusoidal. However, this can be compensated for if the amount of backlash is precisely known by linear encoders or manual measurement.
The high backlash mechanism itself is not necessarily relied on to be repeatedly precise for the cutting process, but some other reference object or precision surface may be used to zero the mechanism, by tightly applying pressure against the reference and setting that as the zero references for all following CNC-encoded motions. This is similar to the manual machine tool method of clamping a micrometer onto a reference beam and adjusting the Vernier dial to zero using that object as the reference.
In numerical control systems, the position of the tool is defined by a set of instructions called the part program. Positioning control is handled using either an open-loop or a closed-loop system. In an open-loop system, communication takes place in one direction only: from the controller to the motor. In a closed-loop system, feedback is provided to the controller so that it can correct for errors in position, velocity, and acceleration, which can arise due to variations in load or temperature. Open-loop systems are generally cheaper but less accurate. Stepper motors can be used in both types of systems, while servo motors can only be used in closed systems.
The G & M code positions are all based on a three-dimensional Cartesian coordinate system. This system is a typical plane often seen in mathematics when graphing. This system is required to map out the machine tool paths and any other kind of actions that need to happen in a specific coordinate. Absolute coordinates are what are generally used more commonly for machines and represent the (0,0,0) point on the plane. This point is set on the stock material to give a starting point or "home position" before starting the actual machining.
G-codes are used to command specific movements of the machine, such as machine moves or drilling functions. The majority of G-code programs start with a percent (%) symbol on the first line, then followed by an "O" with a numerical name for the program (i.e. "O0001") on the second line, then another percent (%) symbol on the last line of the program. The format for a G-code is the letter G followed by two to three digits; for example G01. G-codes differ slightly between a mill and lathe application, for example:
[Code Miscellaneous Functions (M-Code)]. M-codes are miscellaneous machine commands that do not command axis motion. The format for an M-code is the letter M followed by two to three digits; for example:
Having the correct speeds and feeds in the program provides for a more efficient and smoother product run. Incorrect speeds and feeds will cause damage to the tool, machine spindle, and even the product. The quickest and simplest way to find these numbers would be to use a calculator that can be found online. A formula can also be used to calculate the proper speeds and feeds for a material. These values can be found online or in Machinery's Handbook.
"Definition of numerical control". https://www.pcmag.com/encyclopedia/term/numerical-control ↩
"What Is A CNC Machine?". CNC Machines. Retrieved 2022-02-04. https://cncmachines.com/what-is-a-cnc-machine ↩
Groover, Mikell P. (2024-10-28). "Automation - Numerical Control, Robotics, Manufacturing". Encyclopædia Britannica. Retrieved 2025-03-18. https://www.britannica.com/technology/automation/Numerical-control#ref390752 ↩
"What is CNC Milling and How Does it Work: Everything You Need to Know". 3ERP. 2022-06-24. Retrieved 2025-03-18. https://www.3erp.com/blog/cnc-milling-everything-you-need-to-know/ ↩
Mike Lynch, "Key CNC Concept #1—The Fundamentals Of CNC", Modern Machine Shop, 4 January 1997. Accessed 11 February 2015 http://www.mmsonline.com/articles/key-cnc-concept-1the-fundamentals-of-cnc ↩
CapableMaching. "CNC Machining Industry: new & important trend". https://capablemachining.com/cnc-machining-industry/ ↩
Chang Y C, Pinilla J M, Kao J H, et al. Automated layer decomposition for additive/subtractive solid freeform fabrication[C]. 1999 International Solid Freeform Fabrication Symposium, 1999. ↩
W. Grzesik/ (2018). "Hybrid Additive and Subtractive Manufacturing Processes and Systems: A Review" (PDF). Journal of Machine Engineering. 18 (4): 5–24. doi:10.5604/01.3001.0012.7629 (inactive 10 April 2025).{{cite journal}}: CS1 maint: DOI inactive as of April 2025 (link) https://bibliotekanauki.pl/articles/99525.pdf ↩
L.C. Moreira, W. Li, X. Lu, M.E. Fitzpatrick Supervision controller for real-time surface quality assurance in CNC machining using artificial intelligence Comput. Ind. Eng., 127 (2019), pp. 158-168 ↩
Klocke, F.; Schwade, M.; Klink, A.; Veselovac, D. (2013-01-01). "Analysis of Material Removal Rate and Electrode Wear in Sinking EDM Roughing Strategies using Different Graphite Grades". Procedia CIRP. Proceedings of the Seventeenth CIRP Conference on Electro Physical and Chemical Machining (ISEM). 6: 163–167. doi:10.1016/j.procir.2013.03.079. ISSN 2212-8271. https://doi.org/10.1016%2Fj.procir.2013.03.079 ↩
"Multi Spindle Machines - An In-Depth Overview". Davenport Machine. Retrieved 2017-08-25. https://www.davenportmachine.com/multi-spindle-machines/ ↩
Zelinski, Peter (2014-03-14), "New users are adopting simulation software", Modern Machine Shop. http://www.mmsonline.com/blog/post/new-users-are-adopting-simulation-software ↩