The relationship between PLC and CNC machine tools
2026-04-06 05:58:59··#1
I. The Relationship Between PLC and NC PLC is used for the automatic control of general-purpose equipment and is called a programmable controller. PLC is used for the control of peripheral auxiliary electrical components of CNC machine tools and is called a programmable machine tool controller. Therefore, in many CNC systems, it is referred to as a PMC (programmable machine tool controller). A CNC system consists of two main parts: NC and PLC. Their roles in CNC machine tools differ. The roles of NC and PLC can be divided as follows: 1. Digital control of the geometric motion of the tool relative to the workpiece's coordinate axes. This task is performed by the NC. 2. Control of machine tool auxiliary equipment is performed by the PLC. During the operation of the CNC machine tool, it controls the operation of components such as the tool magazine, tool changing mechanism, and coolant according to the internal flags of the CNC and the status of the machine tool's control switches, detection elements, and moving parts, based on the control logic set in the program. In CNC machine tools, these two control tasks are inseparable; they are divided according to the above principles and connected in a certain way. The interface between NC and PLC follows the international standard "ISSO 4336-1981(E) Machine Tool Numerical Control – Interface Specification between CNC Devices and Electrical Equipment of CNC Machine Tools". The interface is divided into four types: 1. Connection circuits related to drive commands; 2. Connection circuits between the CNC device and the measurement system and measurement sensors; 3. Power supply and protection circuits; 4. On/off signal and code signal connection circuits. From the interface classification standard, the first and second types of connection circuits transmit control information between the CNC device and servo units, servo motors, position detection, and data detection devices. The third type consists of the power control circuit in the high-voltage circuit of the CNC machine tool. It typically consists of power transformers, control transformers, various circuit breakers, protective switches, relays, contactors, etc., supplying power to other actuators such as motors, solenoid valves, and electromagnets. These belong to the high-voltage circuits relative to the CNC system. These high-voltage circuits cannot be directly connected to the low-voltage circuits of the control system. They can only be converted into switching signals that operate under low DC voltage through intermediate relays and other electronic components before they can become acceptable electrical signals for PLC or relay logic control circuits. Conversely, control signals from PLC or relay logic control must also be converted into signals that can be connected to high-voltage lines through intermediate relays or conversion circuits before the high-voltage circuit drives the actuators to work. The fourth type of signal is the input and output control signals transmitted from the CNC device to the outside. II. Application of PLC in CNC Machine Tools 1. Application Forms of PLC in CNC Machine Tools PLCs are generally used in CNC machine tools in two forms: one is called built-in type; the other is called stand-alone type. Built-in PLCs are also called integrated PLCs. CNC systems using this method combine the NC and PLC from the initial design stage. The signal transmission between the NC and PLC is based on the internal bus, thus having a higher exchange speed and a wider information channel. They can share a single CPU or use separate CPUs. From a holistic hardware and software perspective, this architecture eliminates redundant wiring between the PLC and NC, increasing system reliability. Furthermore, it facilitates the implementation of many advanced functions between the NC and PLC. Information from the PLC can also be displayed on the CNC's monitor, offering significant advantages for system usability. High-end CNC systems generally employ this type of PLC. A stand-alone PLC, also known as an external PLC, is independent of the NC device and has its own independent control functions. Using this approach allows users to select products from different specialized PLC manufacturers based on their specific needs and makes it easier to adjust the control scale. 2. Information Exchange between PLC and CNC Systems and Machine Tools: Compared to the PLC, the machine tool and NC are external. Information exchange between the PLC and the machine tool and NC is crucial for the effective functioning of the PLC. The information exchange between the PLC and the external system usually involves four parts: (1) Machine tool side to PLC: The switch signals from the machine tool side are input to the PLC through the I/O unit interface. Except for a very few signals, the meaning and configured input address of most signals can be defined by the PLC programmer or user. The CNC machine tool manufacturer can easily modify the PLC program and address allocation according to the function and configuration of the machine tool. (2) PLC to machine tool: The control signals of the PLC are sent to the machine tool side through the PLC output interface. The meaning and output address of all output signals are also defined by the PLC programmer or user. (3) NC to PLC: CNC to PLC: The information sent by the CNC to the PLC can be directly sent into the PLC register by the CNC. The meaning and address (switch address or register address) of all signals sent by the CNC to the PLC are determined by the CNC manufacturer. The PLC programmer can only use them and cannot change or add to them. For example, the M, S, and T functions of the CNC instruction are directly sent into the corresponding registers of the PLC after being decoded by the CNC. (4) PLC to CNC: The information sent from the PLC to the CNC is also completed by switch signals or registers. The address and meaning of all signals sent from the PLC to the CNC are determined by the CNC manufacturer. The PLC programmer can only use them and cannot change or add to them. 3. PLC working process in CNC machine tool The working process of the PLC in the CNC machine tool is basically the same as the usual PLC working process, which is divided into the following steps: (1) Input sampling: Input sampling means that the PLC reads the signal status of all input ports in a sequential scanning manner and reads this status into the input image register. Of course, these signal states will not change during the program running cycle unless a new scan cycle arrives and the original port signal state has changed, then the signal state read into the input image register will change. (2) Program execution: During the program execution stage, the system will scan the program in a specific order and read the relevant data from the input image register and the output image register at the same time. After performing relevant calculations, the calculation results are stored in the output image register for output and use in the next run. (3) Output refresh stage: After the instruction is executed, the status (on/off) of all output relays in the output image register area is transferred to the output latch during the output refresh stage and output in a specific way to drive the external load. 4. Control functions of PLC in CNC machine tool (1) Control of operation panel. The operation panel is divided into system operation panel and machine tool operation panel. The control signal of system operation panel first enters NC and then is sent by NC to PLC to control the operation of CNC machine tool. The control signal of machine tool operation panel directly enters PLC to control the operation of machine tool. (2) Machine tool external switch input signal. The switch signal on the machine tool side is input to PLC for logic operation. These switch signals include many detection element signals (such as: limit switch, proximity switch, mode selection switch, etc.) (3) Output signal control: PLC output signal is output to the controlled object through relays, contactors, solenoid valves, etc. in the peripheral control circuit. (4) Function implementation. The system sends a T instruction to the PLC. After decoding, it searches the data table to find the tool number specified by the T code and compares it with the spindle tool number. If they do not match, a tool change instruction is issued, the tool is changed, and after the tool change is completed, the system issues a completion signal. (5) M function implementation. The system sends an M instruction to the PLC. After decoding, it outputs control signals to control the spindle forward and reverse rotation, start and stop, etc. After the M instruction is completed, the system issues a completion signal. III. Relationship between PLC and peripheral circuits of CNC machine tools As mentioned above, the PLC is used in CNC machine tools to control the high-voltage circuits of the machine tool (through some electrical components). In order to better understand the control function of the PLC in CNC machine tools, it is necessary to analyze the relationship between the PLC and the peripheral circuits. 1. PLC control of peripheral circuits CNC machine tools control the auxiliary equipment of the machine tool through the PLC. The PLC controls the auxiliary equipment by controlling the peripheral circuits. The PLC receives the control signals of the NC and the external feedback signals, performs logical operations and processes them, and outputs the results in the form of signals. Output signals are generated from the PLC's output module. Some signals pass through intermediate relays to control contactors and then control specific actuators, thereby controlling peripheral auxiliary mechanisms. Some signals do not require intermediate processing and are directly used to control external facilities; for example, some devices directly driven by low-voltage power supplies (such as indicator lights on a panel). In other words, each external device (controlled by the PLC) is controlled by a single control signal from the PLC, meaning each external device corresponds to a PLC output address. The PLC's control of peripheral devices involves not only outputting signals to control the actions of equipment and facilities but also receiving external feedback signals to monitor their status. In CNC machine tools, devices or components used to detect machine tool status mainly include temperature sensors, vibration sensors, limit switches, proximity switches, etc. Some of these detection signals can be directly input to the PLC's ports, while others must pass through intermediate stages before being input. Whether input or output, the PLC must use external circuitry to control the actions of the machine tool's auxiliary facilities. The most important aspect of the relationship between the PLC and peripheral circuitry is the correspondence between external signals and the PLC's internal signal processing. This correspondence is the address allocation mentioned above, which is to match the address in each PLC with each signal in the peripheral circuit. This work is done by the PLC programming engineer when compiling the PLC program corresponding to the machine tool during the machine tool production process. Of course, such a definition must follow the necessary rules so that the PLC program meets the system requirements. (1) PLC and signal input circuit As shown in Figure 2-1, it is part of the electrical diagram of the input unit of a CNC machine tool's electrical manual. From the figure, we can see that this is a socket or a pin of a certain input interface, which corresponds to a certain component, switch, or knob in the external peripheral circuit and also has a corresponding input address inside the PLC. Starting from the first line, a push button switch or toggle switch is connected to the circuit with wire number 191. Wire number 191 is connected to pin 16 of socket number C71. Pin 16 corresponds to the PLC input address X10001.3, which is defined as Manual absolute. From the description in the figure, we can know that button S27 is suitable for controlling whether the manual absolute value is effective. The on/off state of this switch is connected to pin 16 of socket C71 via line 191. Pin 16 then inputs this signal to the PLC, where the signal's address is X1001.3. This definition method associates the PLC signal with the external circuitry. The state of the external push-button switch can be determined by checking the status of X1001.3 in the PLC. As shown in the diagram, the text on the right describes the signal's meaning, followed by the input signal address to the left, the pin number on the socket further to the left, and the wire number and switch device number of the external circuitry to the left of that. This diagram is a circuit diagram for a machine tool, drawn according to general standards, thus revealing some universally applicable principles. For example, when programming a PLC, addresses of similar switches (based on their purpose and location) and detection elements might be grouped together. From this diagram, we can see that the input signals on C71 are primarily push-button switches or toggle switches on the panel. Their signal types and location distributions are very similar, therefore their input addresses (at the PLC input terminals) are also sequentially distributed. As can be found in the electrical manual to which this diagram belongs, the C71 has a total of 50 pins. Excluding the pins used for the common terminal and 24V power supply, the input addresses of the other pins are sequentially distributed from X1000.0 to 1004.7. Typically, a PLC address consists of three parts: 1: Address type; 2: Address number; 3: Pin number. Each address number has 8 address bits, and each address represents a different signal. The table below shows the I/O addresses shown in Figure 4-1, with textual descriptions. Table 4-1 Input Signal List. From Figure 4-1, we can see several elements: 1. Component number; 2. Wire number; 3. Slot or socket number; 4. Pin number; 5. PLC input address number. We can see that these numbers have a corresponding relationship in the control logic. Therefore, not only when drawing such diagrams, but also when designing peripheral circuits and writing PLC programs, their relationship must be considered. In fact, the correspondence between components must be considered not only when designing and manufacturing machine tools, but also when using, repairing, and maintaining them, based on their correspondence and control logic. The locations of external buttons and other components shown in Figure 4-1 can be found in Figure 4-4. 2. PLC Output Signal Control of Related Actuating Components The previous diagrams described the address allocation of input signals in the PLC and the correspondence between PLC input addresses and external switches, knobs, sockets, and cables. We know that in CNC machine tools, not only are there correspondences between input signals and external circuits, but also between output signals and peripheral control circuits and the devices to be driven. The two diagrams listed below are connection diagrams of PLC output signals and peripheral circuits, but the control relationships they express are different. The first diagram shows that the PLC output signal can directly drive external devices (usually LEDs and lights), while the second diagram shows that the PLC output signal must pass through an intermediate relay to control the final device. This is because the external components shown in the first diagram are low-power components (mainly indicator lights representing machine tool status), while the external devices shown in the second diagram are high-power components. From these two diagrams, we can see the relationship between PLC output addresses and external circuits: 1. External actuators or facilities are controlled by the PLC; 2. Each PLC output signal corresponds to an output address; 3. Each output address corresponds to a pin of a socket or plug; 4. Each pin corresponds to a wire in the external circuit (labeled with a wire number); 5. Each wire number corresponds to a device or component (or through some intermediate components). When designing a PLC program, it is necessary to consider which devices the CNC machine tool will use, which devices can be directly driven by the PLC, which devices must be driven through intermediate links such as relays and contactors, and which address number the control signals of these devices are output through. During the use of CNC machine tools, we can familiarize ourselves with the control and operation methods of the machine tool facilities by reading the electrical manual, which facilitates the maintenance of the machine tool. Table 4-2 Output Signal List. The second and third columns of Table 4-2 list the external components to be controlled, which can be found in Figure 2-4. Through these diagrams, we can clearly see the relationship between the PLC and external components. Table 4-3 lists the output signals. Table 4-3 describes Figure 4-3. From Figure 4-3 and Table 4-3, it can be seen that these output signals control relays. These components can be found in Figure 4-5. Figure 4-5 shows the relay board of the machine tool. Some output signals from the PLC are output through the relay board to further control other components.