Share this

Research on Limit Protection Device and Method for CNC Machine Tools Based on Negative Logic Control

2026-04-06 06:58:32 · · #1
The limit protection devices of existing CNC machine tools, commonly used by Wu Youde and Hu Minghua of the Deyang Machinery Manufacturing Design and Research Center in Sichuan Province, employ positive logic control. This control method is prone to limit failure due to open circuits. To address the shortcomings of existing limit control circuits in CNC machine tools, a new limit control method, namely negative logic control, has been developed. Its characteristic is that the working contacts of the limit switches use normally closed contacts, and the PLC input port of the CNC system is set to negative logic. The negative logic can be implemented by writing the PLC program for the machine tool and setting machine parameters. This method improves the reliability of the limit circuit. Practical use has yielded excellent results, resolving the shortcomings of existing CNC machine tool limit control circuits. 1. Introduction During the process of upgrading CNC machine tools for Deyang Heavy Standard Parts Factory, extensive investigations revealed that users reported that the existing limit protection devices of CNC machine tools were unreliable and unstable. In response to this phenomenon, we analyzed and studied the existing limit protection devices of CNC machine tools. Analysis revealed that existing limit protection devices for CNC machine tools generally employ positive logic control, which can lead to limit failure due to open circuits. After extensive research and feasibility studies, and considering the characteristics of the Siemens 802S CNC system, a limit protection device and method was proposed that ensures the machine tool's movement will not exceed its travel limit regardless of poor contact or open circuits. This is a negative logic control limit protection device. This technology has been applied to the modified equipment and, after more than a year of operation, has proven its effectiveness. 2. Technical Solution 2.1 Basic Idea This limit protection device for CNC machine tools includes limit switches for each motion axis of the machine tool, a CNC system with a programmable logic controller (PLC), and terminals for connecting the control power supply. [IMG=Figure 2 Positive Logic Input]/uploadpic/THESIS/2007/11/2007111413393867632V.jpg[/IMG] Figure 2 shows a pair of working contacts of a positive logic input limit switch connected to the control power terminal and the PLC input port, respectively. If the working contacts of the limit switch are normally closed, then the PLC input port is set to negative logic. When the limit switch's working contact is a normally closed contact and the PLC input port is set to negative logic, if the machine tool moves within its normal travel range, the normally closed contact of the limit switch remains closed, the input signal's logic value is "1", the PLC determines it as invalid, and there is no signal output. If the machine tool moves beyond its travel range and depresses the limit switch, the normally closed contact of the limit switch opens, the input signal's logic value is "0", the PLC determines it as valid, and outputs an emergency handling signal. If there is poor contact or an open circuit in the line from the power supply terminal to the PLC input terminal, the input signal's logic value is also "0", the PLC determines it as valid, outputs an emergency handling signal, and the machine tool cannot operate. The machine tool can only operate normally when the circuit contact is good, thus ensuring the machine tool's safety. The connection method between the control power supply terminal and the PLC input port when the PLC input port is set to negative logic is shown in Figure 1; the connection method between the control power supply terminal and the PLC input port when the PLC input port is set to positive logic is shown in Figure 2. 2.2 Methods for Setting PLC Input Ports of CNC Machine Tools to Negative Logic There are two methods to set PLC input ports of CNC machine tools to negative logic. One method is to replace normally open contacts with normally closed contacts and vice versa in the program for input terminals requiring negative logic, thus creating a negative logic relationship. The other method is to set machine tool parameters. A set of data is input to the PLC to set the logic state of the input port. XOR logic is used to convert between "1" and "0". Setting a specific bit in this set of data to "1" and then performing an XOR operation makes the corresponding PLC input terminal's logic state negative. There are two methods for implementing XOR logic: one is to implement it in software, i.e., through the PLC's CPU; the other is to implement it in hardware, i.e., by adding a converter circuit containing XOR logic before the PLC input terminal and using this circuit to perform the XOR operation. 2.2.1 Implementing Negative Logic Settings in PLC Programming: When the CNC system's settings are not changed, or when the CNC system lacks the capability to implement negative logic inputs via settings, the negative logic function of the input terminals can be achieved through the machine tool's PLC program. This is done by swapping the normally closed and normally open contacts of the input terminals in a program written for positive logic inputs (i.e., changing the normally closed contacts of input terminals using negative logic inputs to normally open contacts, and vice versa, while keeping the other contacts unchanged). In the PLC, each input terminal's image register contains one binary data bit. The PLC reads data directly from the image register during program execution for logical operations. The state of a specific bit in the data corresponds to the state of the normally open contact of the input terminal, and the state of the normally closed contact is the inverse state of the normally open contact. When the input terminal and the control power supply do not form a circuit, its normally open contact is logic "0" and its normally closed contact is logic "1". When the input terminal and the control power supply form a circuit, its normally open contact is logic "1" and its normally closed contact is logic "0". Figure 3 is the PLC ladder diagram of the X-axis limit section in the Siemens 8028 CNC system. Figure 3(a) and Figure 3(b) are the PLC ladder diagrams using positive logic input and negative logic input, respectively. In the PLC ladder diagram, I1.0 and I1.1 are the negative and positive hardware limit input terminals of the machine tool X-axis, respectively; I1.7 is the input terminal of the overtravel alarm release switch; Q0.7 is the limit alarm output; V16000000.1 is the user alarm text display trigger bit; and V38011000.0 and V38011000.1 are the negative and positive limit information bits output from the PLC to the CNC. Since I1.7 is only used to release the locked state after the limit switch is released, a positive logic input is used. Figure 3(a) is the PLC ladder diagram using a positive logic input. When the machine tool overtravels, the limit switch corresponding to I1.0 or I1.1 is pressed and closed, and the logic value of its normally closed contact changes from "0" to "1". Since the logic value of the normally closed contact of I1.7 is "1" at this time, Q0.7, V38011000.0, and V38011000.1 are effective, and all axes of the machine tool stop and issue and display alarm information. By disabling I1.7 and combining it with other operations, the overtraveled axis is returned to the normal position. If the connection between the limit switch and I1.0, I1.1, and the limit switch and the power supply is open or has poor contact, the machine tool will be operating with a fault, and the operator will not be able to detect it. In this case, even if the machine tool overtravels, the limit switch is pressed and the limit is ineffective, and a major accident will occur in the machine tool. [IMG=Figure 3 PLC Ladder Diagram of X-axis Limiting Section]/uploadpic/THESIS/2007/11/2007111413443132235X.jpg[/IMG] Figure 3 PLC Ladder Diagram of X-axis Limiting Section [IMG=Table 1 XOR Logic Relationship]/uploadpic/THESIS/2007/11/2007111413450270237F.jpg[/IMG] Table 1 XOR Logic Relationship [IMG=Table 2 Correspondence between Setting Data and Input Terminals]/uploadpic/THESIS/2007/11/2007111413452688688L.jpg[/IMG] Table 2 Correspondence between Setting Data and Input Terminals Figure 3(b) is a PLC ladder diagram using negative logic input. Under normal conditions, since the normally closed contact of the limit switch is used, the input terminal and the control power supply form a circuit. Therefore, the logic value of its normally open contact is "1", and the logic value of its normally closed contact is "0". The limit alarm is invalid, and the machine tool works normally. When the machine tool overtravels, the limit switch corresponding to I1.0 or I1.1 is pressed down and disconnected. The logic value of its normally closed contact changes from "0" to "1". Since the logic value of the normally closed contact of I1.7 is "1" at this time, Q0.7, V38011000.0, and V38011000.1 are effective, all axes of the machine tool stop, and an alarm is issued and displayed. By invalidating I1.7 and combining it with other operations, the overtraveled axis returns to the normal position. In this scheme, as long as there is an open circuit or poor contact in the limit circuit, the limit alarm is immediately effective. The machine tool can only work after the circuit fault is eliminated, thus eliminating the possibility of machine tool accidents caused by limit circuit faults. Since the PLC has already established the status of the limit switches when it first reads the input terminal status after the machine tool is powered on, it can be ensured that the PLC program will not produce errors. 2.2.2 Achieving Negative Logic Settings by Setting Machine Tool Parameters By setting machine tool parameters, the logic values ​​of the input ports can be changed between "1" and "0". A PLC program written using positive logic input can implement the function of negative logic. In a CNC system, a set of data is input to set whether the input port uses positive or negative logic. Setting a bit in this data set to "1" sets the corresponding input terminal to a negative logic input, while setting a bit to "0" sets it to a positive logic input. In digital logic, the XOR operation can be used to convert between "1" and "0". As shown in Table 1, a binary data bit XORed with "1" is inverted, while XORed with "0" retains its original value. The principle of implementing negative logic by setting machine tool parameters is to achieve bitwise XOR between the data read from the PLC input terminal and the set data. For example, for an 8-bit input port, if the set data is 46H (01000110B), the corresponding relationship is shown in Table 2. Among them, input terminals 1, 2, and 6 use negative logic input, while other terminals use positive logic input. 2.2.3 Methods of implementing XOR logic (1) Method of implementing XOR logic in hardware The method of implementing XOR logic in hardware can be to put a conversion circuit containing XOR logic in front of the PLC input terminal. For example, the method can be implemented by using an XOR logic conversion circuit with only 8 input terminals (in actual applications, the number of input terminals should be determined according to needs, and the components used can also be flexibly selected). It should have an 8-bit data latch 74LS73, an 8-bit input buffer 74LS244, and OR gate and XOR gate logic circuits. The OR gate logic circuit implements chip select and read/write logic, and the XOR gate logic circuit implements the XOR operation between the set data and the logic value of the input terminal. Write the set data into the control unit of the input port and latch it. Use this circuit to perform a bitwise XOR with the input port. This method can reduce the burden on the CPU in the PLC and improve the running speed. Figure 4 is the flowchart of this method. When the PLC is powered on and initialized, the CPU writes the set data into the data latch (74LS273). The data is then XORed with the state of the input port. If a bit in the set data is "1", the input terminal corresponding to that bit is a negative logic input. For example, if the data written to the latch is 0FH, then 4 input terminals are set as positive logic inputs and the other 4 input terminals are set as negative logic inputs. (2) Implement XOR logic in software. The method of implementing XOR logic in software is to perform XOR operation through the CPU of the PLC. Since XOR operation is performed every time the input port data is read, this method will increase the CPU burden. Figure 5 is the flowchart of this method. After the PLC reads the state of the input port in the CNC system, the read data is XORed with the set data to achieve negative logic. The method of implementing negative logic for input terminals by setting machine tool parameters requires the CNC system to have the function of setting different valid logic states for its PLC input and output ports. 3. Scope of Application In CNC retrofitting of machine tools or CNC system design, using negative logic input technology when inputting detection signals related to machine tool safety into the CNC system is beneficial to improving the reliability and safety of CNC machine tools. If the machine tool circuit uses traditional relays, contactors, and other components to implement logic functions, negative logic is not suitable because it will cause some relays and contactors to be in a constantly energized state. This will cause problems such as high losses, component overheating, shortened lifespan, and malfunctions due to vibration and other factors. Modern CNC systems implement control logic using logic electronic circuits, which do not have the above problems. 4. Conclusion For CNC systems with opto-isolated input ports, this method uses negative logic input to keep the LEDs of the optocouplers in the input circuit in a constantly energized state. However, because the operating current of this LED is very small (only a few milliamps, and the input circuit consumes only tens of milliwatts), the increase in system power consumption is negligible for machine tools with power ratings of several kilowatts. Furthermore, the LED is a cold light source and will not cause the system to heat up. The optocoupler has a service life of over 100,000 hours. Assuming each machine tool operates continuously for 12 hours a day, this can guarantee normal operation for over 20 years without affecting the machine tool's lifespan. Practical application verification has shown that this method is effective and has been widely adopted. (Proceedings of the 2nd Servo and Motion Control Forum; Proceedings of the 3rd Servo and Motion Control Forum)
Read next

Implementation of BACnet-MS/TP protocol stack in embedded systems

1 Introduction In the 1990s, the Internet experienced explosive growth, becoming a globally dominant computer network. ...

Articles 2026-02-22