CNC vs PLC – What Do They Stand For and What Is The Difference?
PLCs and CNCs are two major categories of digital controllers employed in different industrial control applications. On a surface level, it’s easy to group them together since they are both run by programs, digital processors, and they both interface with input and output devices. For example, if you ask a systems programmer whether a CNC controller can be used in place of a PLC system, the answer could be a frustrating variation of “Yes or No.” It’s therefore important to identify the differences between the two control systems, as discussed in this article.
What Does PLC Stand For?
In electrical terms, PLC stands for Programmable Logic Controller. It is a compact, special-purpose computer designed to perform logic operations to control different electro-mechanical systems. Initially, PLCs were developed to perform the functionalities of hard-wired relays in the automotive industry.
Today, Programmable Logic Controllers (PLCs) are widely used to automate manufacturing processes, assembly lines, and different types of industrial machinery that require ease of programming, high levels of reliability, and advanced fault diagnosis. They are built as rugged control systems that can operate reliably under extreme industrial environments.
Components of a PLC System
The basic components of a typical PLC system are as shown below:
- Processor: A PLC processor consists of a microprocessor-based Central Processing Unit (CPU) and Memory. The CPU has the Arithmetic and Logic Unit (ALU) that is responsible for arithmetic functionalities, data manipulation, and logic operations. The PLC memory consists of Read Only Memory (ROM) and Random-Access Memory (RAM). ROM stores fixed data and programs that cannot be altered such as the operating system (OS) of the PLC. While RAM stores operational data and programs involved in the logic execution of the PLC program.
- Input/Output Section: This includes the I/O modules which interface the PLC system with input and output field devices. The input module connects the CPU with input field devices like sensors, meters, start/stop pushbuttons, and contact switches. The CPU uses the output module to control the output field devices by triggering specific outputs. Examples of field output devices include solenoid valves, motors, pumps, relays, and electric heaters.
- Power Supply: This module powers the internal circuitry of the PLC by converting 120V/240V AC line voltage to DC voltage, mainly to 24V DC-that is useable by the other PLC components.
- Programming Device: It is used to download the PLC program written by the user onto the PLC memory. It’s connected to the CPU module using a LAN (Local Area Network) cable. This device also facilitates the creation and modifying of PLC programs, as it can be used to monitor and edit values stored in the programs. Hand-Held Monitors (HHM), desktop computers, and laptops are examples of commonly used PLC programming devices.
- Communications: PLCs use binary buses as internal communication lines. Also, the PLC system provides multiple communication protocols and ports (i.e. Serial or Ethernet ports) to connect with input/output field devices and other control systems like a Supervisory Control and Data Acquisition (SCADA).
In addition to the above components, a PLC system can also incorporate operator-interface devices like the Huma-Machine Interface (HMI). HMI devices leverage Graphical User Interfaces (GUIs) thereby allowing operators to easily monitor and control processes or equipment being controlled by the PLC system. They achieve this by enabling operators to review and modify PLC operational data in real-time. Common HMI devices used with PLCs include LCD touchscreen panels, keypads, and text readouts.
What Does CNC Stand For?
With regards to machinery, “CNC” stands for Computerized Numerical Control. It is an automated method of controlling the movement of machining equipment using pre-programmed software and code. The concept of CNC is better understood in the context of CNC machining and CNC machines.
Also known as CNC manufacturing, CNC machining is a subtractive manufacturing process that utilizes computerized controls to operate and manipulate machine tools (like mills and lathes) to remove layers of material from a workpiece, producing custom-designed products. It is a suitable method of manufacturing custom shapes and designs from a wide range of workpiece materials, including plastics, metal, composites, glass, wood, and foam.
What Is a CNC Machine?
A Computerized Numerical Control machine is an automated machining system operated by a computer that executes pre-programmed sequences of control commands. CNC machines utilize integrated Computer-Aided Design (CAD) and Computer-Aided Manufacturing (CAM) software to replace the traditional machines that were manually controlled by levers, handwheels, or mechanically automated using cam systems.
Modern CNC machines are controlled using a CNC programming language called G-code. G-code is a CNC machining language that directs the cutting tool to achieve precise measurements for production like Cartesian coordination, tool location, feed rate, and speed. As a result, CNC-powered machines can perform a wide variety of manufacturing tasks with greater accuracy. They also allow for more automation, which increases productivity, eliminates the risk of human error, and reduces production waste.
Basic Components of a CNC Machine
At the most basic level, CNC machines consist of three main sections, namely:
- The Software: The CNC software is installed on the CNC machine. Its main function is to interpret CAD design models and translate them into two machine codes that can be understood by the CNC control unit. The two codes are Geometric Code (G-code) and Miscellaneous Code (M-Code). Often, these codes are referred to as CNC machining language or CNC programming language.
- The Machine Control Unit (MCU): This is the control unit of the CNC machine that executes the G-code and M-code programs. The programming provides the MCU with the required tool paths, speed of cutting tools, workpiece feed rates, and other relevant information such as tool change, use of coolant, and when to stop the running program.
- The Processing Equipment: This represents the machine tools that carry out different machining operations like turning, milling, drilling, etc. There are a variety of CNC machines that perform specific machining operations, including Lathe CNC machine(for turning), Milling CNC machine, Drilling CNC machine, Grinding CNC machine, Plasma cutting CNC machine, Laser cutting CNC machine, and many more.
The CNC Machine System
As a whole, the CNC machine system consists of several hardware components as illustrated in Figure 3.
These components perform the following functions:
Input Devices: When a CNC machine is not integrated with CAD/CAM software, input devices are used to input part programs into the CNC control unit. Examples of CNC input devices include USB flash drives, Floppy disk drives, Ethernet communication using LAN cables, Conversational programming, and Serial communication by connecting a computer through an RS-232-C serial port.
Machine Control Unit (MCU): It is the brain of the CNC machine system and is subdivided into two units: the Control Loop Unit (CLU) and the Data Processing Unit. It hosts the CNC control software that enables it to perform several functions including:
- It reads the G-code and M-code instructions fed into it as part programs.
- It decodes these coded instructions.
- It implements the G-code through linear, helical, and circular geometric interpolations to generate axis of motion commands.
- It feeds the axis of motion commands to the driving system, which uses amplifier circuits to drive the axis mechanisms.
- It receives position and velocity feedback signals for each drive axis from the feedback system.
- It implements the M-code for auxiliary/miscellaneous control functions of the machine tool such as tool change, spindle, or coolant ON/OFF …etc.
Simply put, the MCU performs all the controlling actions of the CNC machine system.
Machine Tool: All CNC machine tools consist of a spindle and slide table for holding and controlling the speed and position of the workpiece or cutting tool. The sliding machine table is controlled in the X-Y axis for horizontal and vertical motion. While the spindle of the machine tool is controlled in the Z-axis for rotary motion.
Feedback or Measuring System: It consists of speed and position transducers, which act as sensors that continuously monitor the instantaneous speed and position of the cutting tool at any given location. They then send this data as feedback signals to the MCU. The Machine Control Unit then compares those feedback signals with reference signals to generate control signals, which it sends to the driving system for correcting position and speed errors.
Driving System: In a CNC machine, the driving system consists of drive motors, ball lead screws, and amplifier circuits. The MCU sends the feedback signals (position and velocity) of each drive axis to the amplifier circuits. The circuits then provide augmented position and speed control signals to actuate the drive motors. Actuating the drives motors enables them to rotate the ball lead screw, which positions the sliding machine table and spindle at the required geometric setpoints. Overall, the drive unit physically realizes the desired tool path generated by the MCU.
Display Unit: This unit leverages application software like Graphical User Interface (GUI) to allow operators to interact with the CNC machine. With GUI it can display programs, control commands, and other useful operational data of the CNC machine. Using the displayed information, commissioning engineers and operators can configure, monitor, and operate the CNC machine.
What is the Difference Between CNC and PLC?
CNC Programs: CNC machining programs consist of readable text lines with M and G prefixes that command machine or geometry data, respectively. Geometry data provides the tool path set points, while machine data adjusts the settings and speed of the machine tool to obtain the desired shapes and designs. The codes with the M prefix are called M-codes, and those with the G prefix are the G-codes.
The standard programming language for CNC machines is the G-code or ISO code. The G-code can be hand-written by a CNC machinist or programmer. But in most cases, it’s generated automatically when a CAD design model is converted into a G-code using different Computer-Aided Manufacturing (CAM) software like MasterCAM or FeatureCAM.
The CAD software defines the mechanical dimensions of the desired part and generates a 2D or 3D CAD file, while the CAM software translates those dimensions into manufacturing directives. It does this by generating a series of Cartesian coordinates called tool paths through which the tip of the machining tool will travel, and converting them into basic CNC programming instructions called G-codes.
The G-code specifically controls the machine tools. A complex machine part may consist of thousands of lines of G-code, with each line of code increasing the tool head by a thousandth of an inch and possibly in multiple drive axes simultaneously. Each tiny incremental step of the G-code is necessary to complete a large machining task.
PLC Programs: A typical PLC program entails a set of instructions and control commands, in either textual or graphical format. It is written by the user on a programming device and then downloaded onto the CPU module. The instruction set of such a program represents the logic that defines the process or system being controlled by the PLC. There are five IEC 61131-3 standardized languages used to create PLC programs, they include:(i) Ladder Diagrams (LD) (or Ladder Logic), (ii) Function Block Diagram (FBD), (iii) Sequential Function Chart (SFC), (iv) Structured Text (ST or STX), and (v) Instruction List (IL).
Due to its visual appeal and ease of implementation, Ladder Diagram (LD) is the most popular programming language across all PLCs. Initially, it was developed to mimic the physical layout of hard-wired relay control systems. Today, ladder logic has advanced to include functions like shift registers, counters, timers, and math operations.
A simple PLC program written using a ladder diagram would consist of two vertical rails among a series of horizontal rungs, as shown in Figure 3. The vertical rails represent power connections to the PLC system. While the horizontal rungs indicate the inputs and control components such as relay contacts, pushbuttons, switches, relay contacts relay coils, and the elements being controlled(outputs) like motors, solenoid valves, and lamps.
B) Software Operation
CNC Software Operation: The CNC control software runs on external devices like a desktop computer on industrial CNC machines, but on small-scale CNC machines, it is connected directly to the CNC controller (MCU) via a transfer protocol like USB. This control software governs the process of developing program codes (G-code and M-code) and instructions, which manipulate the physical operations of the CNC machine tool.
The CNC software can be used to control an extensive range of CNC machinery including grinders, lathes, routers, and mills. It helps eliminate the shortcomings of manual machining in terms of accuracy, production rates, and speed. Additionally, it oversees the production of complex parts and designs using plastic and metal, a manufacturing task that is practically impossible with manual machining operations. There are a lot of different CNC control softwares out there such as PlanetCNC, Mach3, LinuxCNC, GRBL + USG, and Flashcut.
PLC Software Operation: PLCs often require software to configure the hardware components so as to attain the desired output. The PLC software enables the PLC system to perform tasks repeatedly to ensure efficiency, save time and minimize errors. This software includes a robust framework with specialized functionalities like sequential access control, timers, and counters, easy-to-configure hardware, ease of programming, troubleshooting, and consistent high-end control capabilities. It also enables the PLC to operate smoothly even in harsh industrial environments characterized by electrical disturbances, damaging vibrations, extreme temperatures, and humidity.
C) Working Mechanism
How does a CNC Machine Operate? First, the part programs (G-codes and M-codes) are inserted into the Machine Control Unit of the CNC machine via input devices, as illustrated in Figure 2. The MCU data processing unit then decodes those CNC programs and prepares motion commands which it sends to the driving system. The drive system uses the control signals from the MCU as motion commands, to control the position and velocity of the machine tool. While this is taking place, the feedback system records the actual velocity and position measurements of the machine tool and sends them to the MCU as feedback signals.
The MCU compares the speed and position feedback signals with the reference control signals, corrects any errors, and sends the rectified control signals to the drive system. The drive system then controls the machine tool to perform the right operation, and produce the desired part. In addition, the CNC machine is enhanced with an interactive GUI-based display unit, which enables the operator to monitor the CNC machining operation and make any necessary modifications.
How Does A PLC Operate? There are four fundamental steps involved in the operation of all PLCs, which execute continually in a repeating loop. First, the PLC processor acquires information from the connected input field devices through the input modules and processes it as pre-programmed data. Next, the processor executes the logic of the stored PLC program. It then triggers the appropriate outputs as per the results of the program logic execution and the pre-programmed input parameters.
Lastly, the processor performs housing keeping by continuously running memory routines and internal diagnostics, to ensure that the memory and other hardware/software components are not damaged. It also constantly communicates with the programming device to avoid any programming errors. After this step, the processor will again start scanning the inputs and the other steps are repeated continually.
D) Application Specifications
A Programmable Logic Controller (PLC) is a general purpose controller specifically designed to allow the creation of user-specific applications. This means that you can select appropriate I/O modules, communication protocols, and multi-axis servo control, then program your PLC to perform the functions required by that application. So, a PLC dictates the actions of an entire system or process.
In contrast, Computer Numerical Control machines are used to create custom-designed parts and products at a component level. They use CNC programs developed for particular applications, mainly to control specific multi-axis machine tools like a milling machine, lathe, punch press, or a tube bending machine. Also, the CNC controller is normally a purpose-built controller that could be anything from a general purpose computer or a Programmable Logic Controller (PLC). This means that you can use a PLC in a CNC machine system. In such cases, the PLC is interfaced with the Machine Control Unit to handle all logical operations of the CNC system.
A PLC-controlled CNC machine can realize complex motion sequences that involve multiple sensors and actuators. The CNC machine control unit can also use the PLC to process input signals from a user interface or certain input devices and to realize safety and monitoring functions. But you cannot use a CNC controller in a PLC system.
The key differences between CNC and PLC systems can be summarized as follows:
|CNC stands for Computerized Numerical Control||PLC stands for Programmable Logic Controller|
|It provides conditional motion control to a multi-axis machine tool.||It provides sequential motion control to a multi-axis machine tool.|
|CNC controller is purpose-built using a PLC or a general purpose computer for specific manufacturing tasks.||It’s a specially designed general-purpose logic controller that allows users to create their own application programs.|
|CNC machines use CNC programs generated by CAM software as G-codes or M-codes.||PLC systems mainly use Ladder Diagram programs written by the user.|
|CNC control involves numerical values||PLC control involves discrete, analog and high-speed values|